diff --git a/.gitattributes b/.gitattributes index b17d448d5..a455f6f5c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ *.res linguist-language=ReScript *.resi linguist-language=ReScript -/public/playground-bundles/** binary linguist-vendored +/apps/docs/public/playground-bundles/** binary linguist-vendored diff --git a/.github/scripts/clean-tracked-rescript-output.sh b/.github/scripts/clean-tracked-rescript-output.sh new file mode 100644 index 000000000..fe3ba5edf --- /dev/null +++ b/.github/scripts/clean-tracked-rescript-output.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -euo pipefail + +# rescript clean only knows sources that still belong to the build. Identify +# tracked compiler output from the index so deleted/excluded sources are covered, +# while handwritten JavaScript and configuration remain untouched. +git ls-files -z -- '*.jsx' '*.mjs' | + while IFS= read -r -d '' output; do + committed=$(git show ":$output") + if [[ "$committed" == "// Generated by ReScript,"* ]]; then + rm -f -- "$output" + fi + done diff --git a/.github/scripts/deployment-environment.sh b/.github/scripts/deployment-environment.sh new file mode 100644 index 000000000..b041b962c --- /dev/null +++ b/.github/scripts/deployment-environment.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Keep the v13 custom domain on its Pages preview branch, including explicit +# releases from workflow_dispatch. Other branches keep isolated preview aliases. +if [[ "$RAW_BRANCH" == "v13" ]] && { + [[ "${GITHUB_EVENT_NAME:-}" == "push" ]] || + [[ "${GITHUB_EVENT_NAME:-}" == "workflow_dispatch" && "${DEPLOY_ENVIRONMENT:-}" == "production" ]]; +}; then + { + echo "SAFE_BRANCH=v13" + echo "DOCS_DEPLOYMENT_ENVIRONMENT=preview" + echo "VITE_DEPLOYMENT_URL=https://v13.rescript-lang.org" + echo "DOCS_DEPLOYMENT_URL=https://v13.rescript-lang.org" + } >> "$GITHUB_ENV" + exit 0 +fi + +# Pages selects production by branch. Manual previews of master must use a +# preview alias, while a manual production deploy must explicitly target master. +if [[ "${GITHUB_EVENT_NAME:-}" == "push" && "$RAW_BRANCH" == "master" ]] || + [[ "${GITHUB_EVENT_NAME:-}" == "workflow_dispatch" && "${DEPLOY_ENVIRONMENT:-}" == "production" ]]; then + { + echo "SAFE_BRANCH=master" + echo "DOCS_DEPLOYMENT_ENVIRONMENT=production" + echo "VITE_DEPLOYMENT_URL=" + echo "DOCS_DEPLOYMENT_URL=https://rescript-lang.org" + } >> "$GITHUB_ENV" +else + SANITIZED_BRANCH=$(echo "$RAW_BRANCH" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9-]+/-/g; s/^-+//; s/-+$//; s/-+/-/g') + BRANCH_PREFIX="${SANITIZED_BRANCH:0:19}" + BRANCH_PREFIX="${BRANCH_PREFIX:-preview}" + BRANCH_DIGEST=$(node --input-type=module -e ' + import {createHash} from "node:crypto"; + process.stdout.write(createHash("sha256").update(process.env.RAW_BRANCH).digest("hex").slice(0, 8)); + ') + SAFE_BRANCH="${BRANCH_PREFIX}-${BRANCH_DIGEST}" + { + echo "SAFE_BRANCH=$SAFE_BRANCH" + echo "DOCS_DEPLOYMENT_ENVIRONMENT=preview" + echo "VITE_DEPLOYMENT_URL=https://${SAFE_BRANCH}.rescript-lang.pages.dev" + echo "DOCS_DEPLOYMENT_URL=https://${SAFE_BRANCH}.rescript-lang.pages.dev" + } >> "$GITHUB_ENV" +fi diff --git a/.github/scripts/homepage-e2e.sh b/.github/scripts/homepage-e2e.sh new file mode 100644 index 000000000..367843895 --- /dev/null +++ b/.github/scripts/homepage-e2e.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Serve the production docs build on Cypress's fixed test port, wait until it is +# reachable, then run the homepage E2E command with any caller-provided options. +# The static server otherwise silently selects a different occupied port. +node --input-type=module -e ' + import {createServer} from "node:net"; + const server = createServer(); + server.once("error", () => { + console.error("Port 4173 must be free before running homepage tests"); + process.exitCode = 1; + }); + server.listen(4173, "127.0.0.1", () => server.close()); +' + +SERVER=$(node --input-type=module -e 'import {fileURLToPath} from "node:url"; console.log(fileURLToPath(import.meta.resolve("@node-cli/static-server")))') +node "$SERVER" --host 127.0.0.1 --port 4173 build/client & +SERVER_PID=$! +trap 'kill "$SERVER_PID" 2>/dev/null || true; wait "$SERVER_PID" 2>/dev/null || true' EXIT + +for _ in {1..30}; do + if curl --fail --silent --max-time 2 http://127.0.0.1:4173/ > /dev/null; then + yarn ci:test:e2e "$@" + exit 0 + fi + kill -0 "$SERVER_PID" + sleep 1 +done + +echo "Homepage test server did not become ready" >&2 +exit 1 diff --git a/.github/scripts/lighthouse-cleanup.sh b/.github/scripts/lighthouse-cleanup.sh new file mode 100644 index 000000000..1985bcf10 --- /dev/null +++ b/.github/scripts/lighthouse-cleanup.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Remove older Lighthouse artifacts for this branch after preserving the +# artifact uploaded by the current workflow run. +gh api --method GET \ + "/repos/${GITHUB_REPOSITORY}/actions/artifacts" \ + -f name="$LIGHTHOUSE_ARTIFACT_NAME" \ + -f per_page=100 \ + --jq '.artifacts[].id' | while read -r ARTIFACT_ID; do + if [[ "$ARTIFACT_ID" != "$CURRENT_ARTIFACT_ID" ]]; then + gh api --method DELETE "/repos/${GITHUB_REPOSITORY}/actions/artifacts/${ARTIFACT_ID}" + fi + done diff --git a/.github/scripts/lighthouse-environment.sh b/.github/scripts/lighthouse-environment.sh new file mode 100644 index 000000000..701c1d9c2 --- /dev/null +++ b/.github/scripts/lighthouse-environment.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Export stable artifact keys for the current branch and its comparison branch; +# pull requests compare against their live base branch. +REPOSITORY_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd) + +if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then + RAW_TARGET_BRANCH=$(gh api "/repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}" --jq '.base.ref') + TARGET_ENVIRONMENT="" +else + RAW_TARGET_BRANCH="$RAW_BRANCH" + TARGET_ENVIRONMENT="${DOCS_DEPLOYMENT_ENVIRONMENT:-}" +fi + +ARTIFACT_NAME=$(node "$REPOSITORY_ROOT/apps/docs/scripts/lighthouse-report.mjs" artifact-name "$RAW_BRANCH" "${DOCS_DEPLOYMENT_ENVIRONMENT:-}") +TARGET_ARTIFACT_NAME=$(node "$REPOSITORY_ROOT/apps/docs/scripts/lighthouse-report.mjs" artifact-name "$RAW_TARGET_BRANCH" "$TARGET_ENVIRONMENT") + +{ + echo "LIGHTHOUSE_ARTIFACT_NAME=$ARTIFACT_NAME" + echo "LIGHTHOUSE_BRANCH=$RAW_BRANCH" + echo "LIGHTHOUSE_TARGET_ARTIFACT_NAME=$TARGET_ARTIFACT_NAME" + echo "LIGHTHOUSE_TARGET_BRANCH=$RAW_TARGET_BRANCH" +} >> "$GITHUB_ENV" diff --git a/.github/scripts/lighthouse-restore.sh b/.github/scripts/lighthouse-restore.sh new file mode 100644 index 000000000..22d40c621 --- /dev/null +++ b/.github/scripts/lighthouse-restore.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Restore the newest Lighthouse baseline for the comparison branch, tolerating +# artifacts removed by a concurrent workflow while retaining other failures. +mkdir -p .lighthouse-target + +ARCHIVE_PATH="$RUNNER_TEMP/lighthouse-target.zip" +DOWNLOAD_ERROR="$RUNNER_TEMP/lighthouse-target-error.log" + +for ATTEMPT in 1 2 3; do + ARTIFACT_ID=$(gh api --method GET \ + "/repos/${GITHUB_REPOSITORY}/actions/artifacts" \ + -f name="$LIGHTHOUSE_TARGET_ARTIFACT_NAME" \ + -f per_page=100 \ + --jq '.artifacts | map(select(.expired == false)) | sort_by(.created_at) | last | .id // empty') + + if [[ -z "$ARTIFACT_ID" ]]; then + echo "No Lighthouse baseline found for target branch $LIGHTHOUSE_TARGET_BRANCH" + exit 0 + fi + + if gh api "/repos/${GITHUB_REPOSITORY}/actions/artifacts/${ARTIFACT_ID}/zip" > "$ARCHIVE_PATH" 2> "$DOWNLOAD_ERROR"; then + unzip -q "$ARCHIVE_PATH" -d .lighthouse-target + exit 0 + else + DOWNLOAD_STATUS=$? + fi + + cat "$DOWNLOAD_ERROR" >&2 + rm -f "$ARCHIVE_PATH" + if ! grep -Eq '^gh: .* \(HTTP (404|410)\)$' "$DOWNLOAD_ERROR"; then + exit "$DOWNLOAD_STATUS" + fi + + echo "Lighthouse baseline artifact $ARTIFACT_ID disappeared during download (attempt $ATTEMPT of 3)" +done + +echo "No Lighthouse baseline available for target branch $LIGHTHOUSE_TARGET_BRANCH after 3 attempts" diff --git a/.github/workflows/clear-ok-to-deploy.yml b/.github/workflows/clear-ok-to-deploy.yml index 58056ff3b..c040d3aa5 100644 --- a/.github/workflows/clear-ok-to-deploy.yml +++ b/.github/workflows/clear-ok-to-deploy.yml @@ -5,7 +5,7 @@ on: jobs: clear-label: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: pull-requests: write steps: diff --git a/.github/workflows/deploy-fork-preview.yml b/.github/workflows/deploy-fork-preview.yml index 52a8d1372..4deedc2c1 100644 --- a/.github/workflows/deploy-fork-preview.yml +++ b/.github/workflows/deploy-fork-preview.yml @@ -10,15 +10,15 @@ on: jobs: deploy-fork: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 if: ${{ github.event_name == 'workflow_dispatch' || github.event.label.name == 'ok-to-deploy' }} permissions: contents: read deployments: write - pull-requests: write + pull-requests: read steps: - # Note: fork PR workflows get a read-only GITHUB_TOKEN even if we request - # pull-requests: write, so we can't post PR comments here. + # The `ok-to-deploy` label permits the base-repository workflow to deploy + # the checked-out fork commit and publish its preview to GitHub. - name: Fetch PR info id: pr uses: actions/github-script@v9.0.0 @@ -55,14 +55,18 @@ jobs: ref: ${{ steps.pr.outputs.sha }} persist-credentials: false + - name: Install Corepack + run: npm install --global corepack + + - name: Enable Corepack + run: corepack enable + - name: Setup Node.js environment uses: actions/setup-node@v6.3.0 with: node-version-file: ".node-version" cache: "yarn" - - name: Enable Corepack - run: corepack enable - name: Install dependencies run: yarn install @@ -74,28 +78,44 @@ jobs: - name: Deploy id: deploy - uses: cloudflare/wrangler-action@v3 + uses: cloudflare/wrangler-action@v4 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} workingDirectory: apps/docs command: pages deploy out --project-name=rescript-lang-org - gitHubToken: ${{ secrets.GITHUB_TOKEN }} - wranglerVersion: 4.85.0 + wranglerVersion: 4.130.0 continue-on-error: true env: FORCE_COLOR: 0 - - - name: Comment PR with deployment link - if: ${{ github.event_name != 'workflow_dispatch' }} - uses: marocchino/sticky-pull-request-comment@v2 + - name: Publish fork preview deployment to GitHub + if: ${{ steps.deploy.outcome == 'success' }} + uses: actions/github-script@v9.0.0 with: - recreate: true - header: fork-preview-deployment - message: | - ## Fork PR Cloudflare deployment - PR: #${{ steps.pr.outputs.number }} - Deployement ID: ${{ steps.deploy.outputs.pages-deployment-id }} - Deployment Environment: ${{ steps.deploy.outputs.pages-environment }} + script: | + const deployment = await github.rest.repos.createDeployment({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: process.env.PR_HEAD_SHA, + auto_merge: false, + required_contexts: [], + environment: "fork-preview", + production_environment: false, + transient_environment: true, + description: "Cloudflare fork preview", + }); - ${{ steps.deploy.outputs.command-output }} + await github.rest.repos.createDeploymentStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + deployment_id: deployment.data.id, + state: "success", + environment: "fork-preview", + environment_url: process.env.DEPLOYMENT_URL, + log_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`, + description: "Cloudflare fork preview deployed", + auto_inactive: false, + }); + env: + DEPLOYMENT_URL: ${{ steps.deploy.outputs.deployment-url }} + PR_HEAD_SHA: ${{ steps.pr.outputs.sha }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f919c10f0..97970ba12 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,52 +7,48 @@ on: workflow_dispatch: inputs: environment: - description: "Choose an environment to deploy to: " + description: "Deployment environment for docs and guide" + type: choice + options: + - preview + - production required: true default: "preview" pull_request: jobs: deploy: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 name: Deploy if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false }} + concurrency: + group: docs-deploy-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true permissions: contents: read deployments: write pull-requests: write steps: - uses: actions/checkout@v6.0.2 + - name: Install Corepack + run: npm install --global corepack + - name: Enable Corepack + run: corepack enable - name: Setup Node.js environment uses: actions/setup-node@v6.3.0 with: node-version-file: ".node-version" cache: "yarn" - - name: Enable Corepack - run: corepack enable - name: Install dependencies run: yarn install - name: Sync playground bundles run: yarn build:sync-bundles - name: Set VITE_DEPLOYMENT_URL + env: + RAW_BRANCH: ${{ github.head_ref || github.ref_name }} + DEPLOY_ENVIRONMENT: ${{ inputs.environment }} shell: bash - run: | - RAW_BRANCH="${{ github.head_ref || github.ref_name }}" - - if [[ "$RAW_BRANCH" == "master" ]]; then - echo "VITE_DEPLOYMENT_URL=" >> "$GITHUB_ENV" - else - SAFE_BRANCH=$(echo "$RAW_BRANCH" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9-]+/-/g; s/^-+//; s/-+$//; s/-+/-/g') - SAFE_BRANCH="${SAFE_BRANCH:0:28}" - - echo "SAFE_BRANCH=$SAFE_BRANCH" >> "$GITHUB_ENV" - - if [[ "$RAW_BRANCH" == "v13" ]]; then - echo "VITE_DEPLOYMENT_URL=https://v13.rescript-lang.org" >> "$GITHUB_ENV" - else - echo "VITE_DEPLOYMENT_URL=https://${SAFE_BRANCH}.rescript-lang.pages.dev" >> "$GITHUB_ENV" - fi - fi + run: bash .github/scripts/deployment-environment.sh - name: Build run: yarn build env: @@ -63,122 +59,213 @@ jobs: - name: Deploy if: ${{ github.actor != 'dependabot[bot]' }} id: deploy - uses: cloudflare/wrangler-action@v3 + uses: cloudflare/wrangler-action@v4 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} workingDirectory: apps/docs command: pages deploy out --project-name=rescript-lang-org --branch=${{ env.SAFE_BRANCH }} gitHubToken: ${{ secrets.GITHUB_TOKEN }} - wranglerVersion: 4.114.0 + wranglerVersion: 4.130.0 env: FORCE_COLOR: 0 - - name: Comment PR with deployment link - if: ${{ github.actor != 'dependabot[bot]' }} - uses: marocchino/sticky-pull-request-comment@v2 + - name: Comment with docs preview link + if: ${{ github.event_name == 'pull_request' && steps.deploy.outcome == 'success' }} + uses: marocchino/sticky-pull-request-comment@v3 with: recreate: true - header: deploymemt + header: docs-deployment message: | - ## Cloudflare deployment - Deployement ID: ${{ steps.deploy.outputs.pages-deployment-id }} - Deployment Environment: ${{ steps.deploy.outputs.pages-environment }} - - ${{ steps.deploy.outputs.command-output }} + [Docs preview](${{ steps.deploy.outputs.deployment-url }}) + lighthouse: + runs-on: ubuntu-24.04 + name: Lighthouse + needs: deploy + if: ${{ github.actor != 'dependabot[bot]' }} + concurrency: + group: docs-lighthouse-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + permissions: + actions: write + contents: read + pull-requests: write + steps: + - uses: actions/checkout@v6.0.2 + - name: Setup Node.js environment + uses: actions/setup-node@v6.3.0 + with: + node-version-file: ".node-version" + - name: Set deployment URL + env: + RAW_BRANCH: ${{ github.head_ref || github.ref_name }} + DEPLOY_ENVIRONMENT: ${{ inputs.environment }} + shell: bash + run: bash .github/scripts/deployment-environment.sh + - name: Set Lighthouse environment + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RAW_BRANCH: ${{ github.head_ref || github.ref_name }} + PR_NUMBER: ${{ github.event.pull_request.number }} + run: bash .github/scripts/lighthouse-environment.sh + - name: Restore target branch Lighthouse baseline + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: bash .github/scripts/lighthouse-restore.sh + - name: Audit homepage with Lighthouse + uses: treosh/lighthouse-ci-action@v12 + with: + urls: ${{ env.DOCS_DEPLOYMENT_URL }} + configPath: ./apps/docs/lighthouserc.json + - name: Create Lighthouse baseline + run: node apps/docs/scripts/lighthouse-report.mjs baseline + env: + LIGHTHOUSE_URL: ${{ env.DOCS_DEPLOYMENT_URL }} + - name: Upload Lighthouse reports + id: lighthouse-artifact + uses: actions/upload-artifact@v6 + with: + name: ${{ env.LIGHTHOUSE_ARTIFACT_NAME }} + path: .lighthouseci/ + if-no-files-found: error + include-hidden-files: true + overwrite: true + retention-days: 90 + - name: Summarize Lighthouse baseline + run: | + node apps/docs/scripts/lighthouse-report.mjs comment + cat .lighthouseci/comment.md >> "$GITHUB_STEP_SUMMARY" + env: + LIGHTHOUSE_ARTIFACT_URL: ${{ steps.lighthouse-artifact.outputs.artifact-url }} + - name: Comment PR with Lighthouse baseline + if: ${{ github.event_name == 'pull_request' }} + uses: marocchino/sticky-pull-request-comment@v3 + with: + header: lighthouse-baseline + path: .lighthouseci/comment.md + - name: Remove superseded Lighthouse artifacts + env: + CURRENT_ARTIFACT_ID: ${{ steps.lighthouse-artifact.outputs.artifact-id }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: bash .github/scripts/lighthouse-cleanup.sh deploy-guide: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 name: Deploy Guide Worker if: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) && github.actor != 'dependabot[bot]' }} permissions: contents: read deployments: write - pull-requests: write steps: - uses: actions/checkout@v6.0.2 + - name: Install Corepack + run: npm install --global corepack + - name: Enable Corepack + run: corepack enable - name: Setup Node.js environment uses: actions/setup-node@v6.3.0 with: node-version-file: ".node-version" cache: "yarn" - - name: Enable Corepack - run: corepack enable - name: Install dependencies run: yarn install - name: Build guide run: yarn build:guide - name: Set guide deployment command shell: bash + env: + RAW_BRANCH_INPUT: ${{ github.head_ref || github.ref_name }} run: | - RAW_BRANCH="${{ github.head_ref || github.ref_name }}" + RAW_BRANCH="$RAW_BRANCH_INPUT" SAFE_BRANCH=$(echo "$RAW_BRANCH" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9-]+/-/g; s/^-+//; s/-+$//; s/-+/-/g') SAFE_BRANCH="${SAFE_BRANCH:0:28}" if [[ "${{ github.event_name }}" == "push" && "$RAW_BRANCH" == "master" ]] || [[ "${{ inputs.environment }}" == "production" ]]; then echo "GUIDE_DEPLOY_COMMAND=deploy" >> "$GITHUB_ENV" + echo "GUIDE_DEPLOYMENT_ENVIRONMENT=guide-production" >> "$GITHUB_ENV" + echo "GUIDE_PRODUCTION_ENVIRONMENT=true" >> "$GITHUB_ENV" else echo "GUIDE_DEPLOY_COMMAND=versions upload --preview-alias=$SAFE_BRANCH" >> "$GITHUB_ENV" + echo "GUIDE_DEPLOYMENT_ENVIRONMENT=guide-preview" >> "$GITHUB_ENV" + echo "GUIDE_PRODUCTION_ENVIRONMENT=false" >> "$GITHUB_ENV" fi - name: Deploy guide id: deploy-guide - uses: cloudflare/wrangler-action@v3 + uses: cloudflare/wrangler-action@v4 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} workingDirectory: apps/guide command: ${{ env.GUIDE_DEPLOY_COMMAND }} - wranglerVersion: 4.114.0 + wranglerVersion: 4.130.0 env: FORCE_COLOR: 0 - - name: Comment PR with guide deployment link - if: ${{ github.event_name == 'pull_request' }} - uses: marocchino/sticky-pull-request-comment@v2 + - name: Publish guide deployment to GitHub + uses: actions/github-script@v9.0.0 with: - recreate: true - header: guide-deployment - message: | - ## Guide Cloudflare deployment + script: | + const environment = process.env.GUIDE_DEPLOYMENT_ENVIRONMENT; + const productionEnvironment = process.env.GUIDE_PRODUCTION_ENVIRONMENT === "true"; + const ref = context.payload.pull_request?.head.ref ?? context.ref; + const deployment = await github.rest.repos.createDeployment({ + owner: context.repo.owner, + repo: context.repo.repo, + ref, + auto_merge: false, + required_contexts: [], + environment, + production_environment: productionEnvironment, + transient_environment: !productionEnvironment, + description: "Cloudflare Guide", + }); - ${{ steps.deploy-guide.outputs.command-output }} + await github.rest.repos.createDeploymentStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + deployment_id: deployment.data.id, + state: "success", + environment, + environment_url: process.env.GUIDE_DEPLOYMENT_URL, + log_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`, + description: "Cloudflare Guide deployed", + auto_inactive: false, + }); + env: + GUIDE_DEPLOYMENT_ENVIRONMENT: ${{ env.GUIDE_DEPLOYMENT_ENVIRONMENT }} + GUIDE_DEPLOYMENT_URL: ${{ steps.deploy-guide.outputs.deployment-url }} + GUIDE_PRODUCTION_ENVIRONMENT: ${{ env.GUIDE_PRODUCTION_ENVIRONMENT }} e2e: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 name: E2E Tests needs: deploy if: ${{ github.actor != 'dependabot[bot]' }} steps: - uses: actions/checkout@v6.0.2 + - name: Install Corepack + run: npm install --global corepack + - name: Enable Corepack + run: corepack enable - name: Setup Node.js environment uses: actions/setup-node@v6.3.0 with: node-version-file: ".node-version" cache: "yarn" - - name: Enable Corepack - run: corepack enable - name: Install dependencies run: yarn install - name: Build ReScript run: yarn build:res - - name: Set Cypress base URL - id: cypress-base-url + - name: Set deployment URL + env: + RAW_BRANCH: ${{ github.head_ref || github.ref_name }} + DEPLOY_ENVIRONMENT: ${{ inputs.environment }} shell: bash - run: | - RAW_BRANCH="${{ github.head_ref || github.ref_name }}" - - if [[ "$RAW_BRANCH" == "master" ]]; then - CYPRESS_BASE_URL="https://rescript-lang.org" - else - SAFE_BRANCH=$(echo "$RAW_BRANCH" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9-]+/-/g; s/^-+//; s/-+$//; s/-+/-/g') - SAFE_BRANCH="${SAFE_BRANCH:0:28}" - - CYPRESS_BASE_URL="https://${SAFE_BRANCH}.rescript-lang.pages.dev" - fi - - echo "url=$CYPRESS_BASE_URL" >> "$GITHUB_OUTPUT" + run: bash .github/scripts/deployment-environment.sh - name: Cypress E2E tests uses: cypress-io/github-action@v7 with: install: false working-directory: apps/docs browser: chrome - config: baseUrl=${{ steps.cypress-base-url.outputs.url }} + config: baseUrl=${{ env.DOCS_DEPLOYMENT_URL }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 0b8898d82..5ea4b01ce 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -2,42 +2,54 @@ name: Pull Request on: [pull_request] jobs: Format: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v6.0.2 + - name: Install Corepack + run: npm install --global corepack + - name: Enable Corepack + run: corepack enable - name: Setup Node.js environment uses: actions/setup-node@v6.3.0 with: node-version-file: ".node-version" cache: yarn - - name: Enable Corepack - run: corepack enable - name: Install dependencies run: yarn - - name: Format check + - name: Check formatting (Oxfmt and ReScript) run: yarn ci:format Site_Checks: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v6.0.2 + - name: Install Corepack + run: npm install --global corepack + - name: Enable Corepack + run: corepack enable - name: Setup Node.js environment uses: actions/setup-node@v6.3.0 with: node-version-file: ".node-version" cache: yarn - - name: Enable Corepack - run: corepack enable - name: Install dependencies run: yarn + - name: Check generated route types + run: | + yarn check:routes + git diff --exit-code -- packages/shared/src/Path.res + - name: Check committed ReScript output + run: yarn ci:generated - name: Test examples and hrefs run: yarn test - Vitest: - runs-on: ubuntu-latest - container: - # Keep this image tag aligned with package.json's playwright version. - image: mcr.microsoft.com/playwright:v1.59.1-noble + - name: Check unused ReScript values and exports + run: yarn check:dead-code + - name: Test dead-code diagnostics + run: node --test scripts/__tests__/check-dead-code.test.mjs + # Check the built Docs Pages routes and the Guide local dev server. + Wrangler: + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v6.0.2 @@ -52,23 +64,144 @@ jobs: run: yarn - name: Build ReScript run: yarn build:res - - name: Vitest - run: yarn ci:test - Visual_Regression: - runs-on: ubuntu-latest + - name: Build docs + run: yarn build:vite + - name: Validate Docs Wrangler dev server + working-directory: apps/docs + run: | + yarn wrangler pages dev build/client --port 8788 > wrangler.log 2>&1 & + server_pid=$! + trap 'kill "$server_pid"' EXIT + + for _ in {1..15}; do + if curl --max-time 2 --fail --silent http://127.0.0.1:8788/favicon.ico > /dev/null; then + node scripts/test-pages.mjs http://127.0.0.1:8788 + exit 0 + fi + sleep 1 + done + + cat wrangler.log + exit 1 + - name: Build guide + run: yarn build:guide + - name: Validate Guide Wrangler dev server + working-directory: apps/guide + run: | + yarn wrangler dev --port 8789 > wrangler.log 2>&1 & + server_pid=$! + trap 'kill "$server_pid"' EXIT + + for _ in {1..15}; do + if curl --max-time 2 --fail --silent http://127.0.0.1:8789/ > /dev/null; then + curl --max-time 2 --fail --silent http://127.0.0.1:8789/robots.txt | cmp public/robots.txt - + for guide_icon in build/client/assets/*.avif; do + curl --max-time 2 --fail --silent "http://127.0.0.1:8789/${guide_icon#build/client/}" | cmp "$guide_icon" - + done + exit 0 + fi + sleep 1 + done + + cat wrangler.log + exit 1 + Vitest: + runs-on: ubuntu-24.04 container: # Keep this image tag aligned with package.json's playwright version. - image: mcr.microsoft.com/playwright:v1.59.1-noble + image: mcr.microsoft.com/playwright:v1.63.0-noble + env: + # The pinned Playwright image provides Chromium from this browser cache. + PLAYWRIGHT_BROWSERS_PATH: /ms-playwright steps: - name: Checkout uses: actions/checkout@v6.0.2 + - name: Install Corepack + run: npm install --global corepack + - name: Enable Corepack + run: corepack enable - name: Setup Node.js environment uses: actions/setup-node@v6.3.0 with: node-version-file: ".node-version" cache: yarn + - name: Install dependencies + run: yarn + - name: Build ReScript + run: yarn build:res + - name: Docs Vitest + run: yarn workspace @rescript-lang/docs ci:test + - name: Docs script tests (Node) + run: yarn workspace @rescript-lang/docs ci:test:scripts + - name: Guide Vitest + run: yarn workspace @rescript-lang/guide ci:test + - name: Guide browser history E2E + env: + # Keep the prerender server and requests on the same localhost address in Docker. + NODE_OPTIONS: --dns-result-order=ipv4first + run: yarn workspace @rescript-lang/guide test:e2e + - name: Upload guide browser test artifacts + if: failure() + uses: actions/upload-artifact@v6 + with: + name: guide-browser-test-artifacts + path: apps/guide/test-results + Homepage_E2E: + runs-on: ubuntu-24.04 + env: + VITE_ALGOLIA_APP_ID: test-app-id + VITE_ALGOLIA_INDEX_NAME: test-index + VITE_ALGOLIA_SEARCH_API_KEY: test-search-key + steps: + - name: Checkout + uses: actions/checkout@v6.0.2 + - name: Install Corepack + run: npm install --global corepack - name: Enable Corepack run: corepack enable + - name: Setup Node.js environment + uses: actions/setup-node@v6.3.0 + with: + node-version-file: ".node-version" + cache: yarn + - name: Install dependencies + run: yarn + - name: Build docs + run: yarn workspace @rescript-lang/docs build + - name: Report homepage asset sizes + run: yarn workspace @rescript-lang/docs ci:homepage-performance + - name: Run homepage Cypress tests + uses: cypress-io/github-action@v7 + with: + install: false + working-directory: apps/docs + browser: chrome + config-file: cypress.homepage.config.mjs + start: yarn serve:build + wait-on: http://127.0.0.1:4173 + - name: Upload Cypress artifacts + if: failure() + uses: actions/upload-artifact@v6 + with: + name: homepage-cypress-artifacts + path: apps/docs/test-results/cypress + Visual_Regression: + runs-on: ubuntu-24.04 + container: + # Keep this image tag aligned with package.json's playwright version. + image: mcr.microsoft.com/playwright:v1.63.0-noble + steps: + - name: Checkout + uses: actions/checkout@v6.0.2 + - name: Install Corepack + run: npm install --global corepack + - name: Enable Corepack + run: corepack enable + - name: Setup Node.js environment + uses: actions/setup-node@v6.3.0 + with: + node-version-file: ".node-version" + cache: yarn - name: Install dependencies run: yarn - name: Build ReScript @@ -77,7 +210,7 @@ jobs: run: yarn ci:test:visual - name: Upload visual regression artifacts if: failure() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: visual-regression-artifacts path: | diff --git a/.github/workflows/update-visual-screenshots.yml b/.github/workflows/update-visual-screenshots.yml index 3120a7c0d..9b1c3e5ed 100644 --- a/.github/workflows/update-visual-screenshots.yml +++ b/.github/workflows/update-visual-screenshots.yml @@ -7,10 +7,10 @@ permissions: jobs: Update_Visual_Screenshots: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 container: # Keep this image tag aligned with package.json's playwright version. - image: mcr.microsoft.com/playwright:v1.59.1-noble + image: mcr.microsoft.com/playwright:v1.63.0-noble steps: - name: Refuse default branch if: github.ref_name == github.event.repository.default_branch @@ -21,13 +21,15 @@ jobs: uses: actions/checkout@v6.0.2 with: ref: ${{ github.ref }} + - name: Install Corepack + run: npm install --global corepack + - name: Enable Corepack + run: corepack enable - name: Setup Node.js environment uses: actions/setup-node@v6.3.0 with: node-version-file: ".node-version" cache: yarn - - name: Enable Corepack - run: corepack enable - name: Install dependencies run: yarn - name: Build ReScript @@ -37,6 +39,7 @@ jobs: - name: Commit changed baselines id: commit-baselines run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" git add apps/docs/__tests__/visual/__screenshots__ if git diff --cached --quiet; then diff --git a/.gitignore b/.gitignore index 0fce7f12c..4f7939a37 100644 --- a/.gitignore +++ b/.gitignore @@ -7,12 +7,8 @@ apps/docs/public/blog/feed.xml node_modules/ -.next/ out/ apps/docs/out/ -apps/guide/out/ -index_data/*.json -apps/docs/index_data/*.json # Generated via docs test examples script temp @@ -29,19 +25,11 @@ apps/docs/lib/ apps/guide/lib/ packages/*/lib/ -.vercel - -apps/docs/src/**/*.mjs apps/docs/src/**/*.jsx -apps/guide/src/**/*.mjs -apps/guide/src/**/*.jsx -packages/*/src/**/*.mjs packages/*/src/**/*.jsx -apps/docs/scripts/gendocs.mjs -apps/docs/scripts/generate_*.mjs -apps/docs/scripts/gendocs.jsx apps/docs/scripts/generate_*.jsx apps/docs/scripts/LogAlgoliaEnvStatus.jsx +apps/docs/scripts/__tests__/**/*.jsx # Generated via generate-llms script apps/docs/public/llms.txt @@ -50,38 +38,23 @@ apps/docs/public/llms/react/**/llm*.txt apps/docs/markdown-pages/docs/**/**/llms.mdx apps/docs/public/playground-bundles/ -!apps/docs/public/_redirects -dist build -apps/docs/dist apps/docs/build -apps/guide/dist apps/guide/build .react-router apps/docs/.react-router apps/guide/.react-router -mdx-manifest.json -apps/docs/mdx-manifest.json -apps/docs/app/**/*.mjs apps/docs/app/**/*.jsx -apps/guide/app/**/*.mjs apps/guide/app/**/*.jsx !apps/guide/app/root.jsx !apps/guide/app/routes.jsx -apps/docs/functions/**/*.mjs apps/docs/functions/**/*.jsx -apps/docs/__tests__/**/*.mjs apps/docs/__tests__/**/*.jsx -apps/docs/test-utils/**/*.mjs apps/docs/test-utils/**/*.jsx -apps/guide/__tests__/**/*.mjs apps/guide/__tests__/**/*.jsx -apps/docs/e2e/**/*.mjs apps/docs/e2e/**/*.jsx -!_shims.mjs -!_shims.jsx # Yarn .yarn/* @@ -103,11 +76,15 @@ apps/docs/_scripts .env.local apps/docs/.env.local -# Local git worktrees -.worktrees - # Vitest screenshots !apps/docs/__tests__/**/__screenshots__/**/* .vitest-attachments apps/docs/.vitest-attachments apps/guide/.vitest-attachments + +# Browser test artifacts +apps/docs/test-results/ +apps/guide/test-results/ + +# Lighthouse artifacts +.lighthouseci/ diff --git a/.node-version b/.node-version index 5bf4400f2..c4697fd56 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -24.15.0 +26.3.0 diff --git a/.oxfmtrc.json b/.oxfmtrc.json index c94351978..7662b39ee 100644 --- a/.oxfmtrc.json +++ b/.oxfmtrc.json @@ -3,42 +3,28 @@ "printWidth": 80, "sortPackageJson": false, "ignorePatterns": [ - "!_shims.mjs", - "!apps/docs/public/_redirects", ".DS_Store", ".worktrees/", - ".next/", ".react-router", "*.swo", "*.swp", - "apps/docs/app/**/*.mjs", + "apps/guide/app/**/*.jsx", "build", "data/api/**/*.json", - "apps/docs/data/api/**/*.json", "dist", - "apps/docs/index_data/*.json", "node_modules/", "apps/docs/out/", "apps/docs/public/playground-bundles/", "apps/docs/public/blog/feed.xml", - "_tempFile.cmi", - "_tempFile.cmj", - "_tempFile.cmt", - "_tempFile.res", "temp", ".bsb.lock", ".merlin", "lib/", "apps/docs/lib/", - ".vercel", - "apps/docs/src/**/*.mjs", - "apps/docs/scripts/gendocs.mjs", - "apps/docs/scripts/generate_*.mjs", "apps/docs/public/llms/manual/**/llm*.txt", "apps/docs/public/llms/react/**/llm*.txt", "apps/docs/markdown-pages/docs/**/**/llms.mdx", "apps/docs/markdown-pages/docs/manual/installation.mdx", - ".yarn/releases/yarn-4.12.0.cjs", - "apps/docs/data/api/*" + ".yarn/releases/*.cjs" ] } diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 241f2c935..9cf683216 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,3 @@ { - "recommendations": ["esbenp.prettier-vscode", "chenglou92.rescript-vscode"] + "recommendations": ["oxc.oxc-vscode", "chenglou92.rescript-vscode"] } diff --git a/AGENTS.md b/AGENTS.md index 0c87878ab..0bc80cdc9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,61 +2,78 @@ ## Project Overview -This is the official documentation website for the [ReScript](https://rescript-lang.org) programming language. It is a **fully pre-rendered static site** (no server-side rendering at runtime) built with **ReScript v12 + React 19 + React Router v7 + Vite 7 + Tailwind CSS v4**, deployed to **Cloudflare Pages**. +This monorepo contains the official documentation website for the [ReScript](https://rescript-lang.org) programming language and the interactive guide. Both use **ReScript v12 + React 19 + React Router v8 + Vite 8**. The docs site uses Tailwind CSS v4 and is primarily pre-rendered at build time, with runtime server-side rendering for `/try` through Cloudflare Pages Functions. The guide pre-renders its entry page and runs its interactive lessons in the browser, with assets served by a Cloudflare Worker. ## System Requirements -- Node.js ≥ 22 -- Yarn 4.12.0 (via Corepack) +- Node.js ≥ 26 +- Yarn 4.13.0 (via Corepack, pinned in `package.json` and `.yarnrc.yml`) ## Project Structure ``` -app/ → React Router app shell (root layout, route definitions, route modules) - routes/ → Route components with loaders (e.g. BlogRoute.res, MdxRoute.res) -src/ → Core ReScript source code - bindings/ → Zero-cost bindings to JS libraries (@module externals) - common/ → Shared utilities, hooks, helpers (non-component modules) - components/ → Reusable React components (e.g. SidebarNav, Breadcrumbs) - ffi/ → Plain JS interop files (prefer %raw over adding new files here) - layouts/ → Page layout components (DocsLayout, SidebarPageLayout, etc.) -markdown-pages/ → MDX content (blog posts, docs, community pages, syntax-lookup) -data/ → Hand-curated data (API docs JSON, sidebar ordering) -styles/ → CSS files (Tailwind v4 config in main.css, custom utilities) -scripts/ → Build/codegen scripts (ReScript + JS) -functions/ → Cloudflare Pages Functions (e.g. OG image generation) -compilers/ → Bundled ReScript compiler versions (for the playground) -plugins/ → HighlightJS & CodeMirror plugins -public/ → Static assets (images, fonts, favicons) -__tests__/ → Vitest browser-mode tests (Playwright) +apps/docs/ → Documentation website workspace (@rescript-lang/docs) + app/ → React Router shell, layouts, and route modules + routes/ → Page components and loaders (e.g. BlogRoute.res) + src/ → Website ReScript code + bindings/ → App-specific bindings to JS libraries + common/ → Shared website utilities and hooks + components/ → Reusable React components + ffi/ → Legacy plain JS interop + layouts/ → Page layout components + markdown/ → MDX loading, compilation, and frontmatter parsing + markdown-pages/ → Blog, docs, community, and syntax-lookup MDX + data/ → Sidebar ordering and content metadata + styles/ → Tailwind v4 entry points, theme, and custom CSS + scripts/ → Build, code generation, and validation scripts + functions/ → Pages Functions for /try, /try.data, and OG images + server/ → React Router request handler for Pages Functions + public/ → Static assets (images, fonts, favicons) + __tests__/ → Vitest browser and visual tests + e2e/ → Cypress browser tests +apps/guide/ → Interactive guide workspace (@rescript-lang/guide) +packages/playground/ → Shared browser playground (@rescript-lang/playground) +packages/shared/ → Shared bindings and utilities (@rescript-lang/shared) + src/ → ReactRouter, Vitest, CodeMirror, highlighting, etc. + plugins/ → CodeMirror 6 ReScript/Reason grammar +data/api/ → Compiler-published API JSON snapshots +.github/ → CI, deployment, and screenshot workflows ``` +Paths in these guidelines are relative to the repository root. Run the commands +below from there; use `yarn workspace ` for workspace commands. +The playground loads published browser compiler bundles. Markdown example checks +use the installed `rescript` package, not a separate compiler installation. + ## Key Commands -| Command | Purpose | -| ---------------- | -------------------------------------------------------------- | -| `yarn dev` | Run ReScript watcher + Vite dev server + Wrangler (parallel) | -| `yarn build` | Full production build (ReScript → scripts → Vite/React Router) | -| `yarn build:res` | ReScript compilation only | -| `yarn dev:res` | ReScript watch mode only | -| `yarn format` | Run Prettier + ReScript formatter | -| `yarn test` | Run example and href validation scripts | -| `yarn vitest` | Run Vitest browser tests with Playwright | -| `make` | Build (install deps + ReScript compile + update index) | +| Command | Purpose | +| ------------------- | ------------------------------------------------------------ | +| `yarn dev` | Run ReScript watcher + Vite dev server + Wrangler (parallel) | +| `yarn build` | Build and pre-render the docs site | +| `yarn build:guide` | Build and pre-render the interactive guide | +| `yarn build:res` | Compile ReScript across all four workspaces | +| `yarn dev:res` | ReScript watch mode only | +| `yarn format` | Run Oxfmt and format ReScript across all four workspaces | +| `yarn test` | Run example, href, and redirect validation scripts | +| `yarn vitest` | Run docs Vitest browser tests in watch mode | +| `yarn vitest:guide` | Run guide Vitest browser tests in watch mode | +| `yarn ci:test` | Run docs and guide Vitest browser tests headlessly | +| `make` | Build (install deps + ReScript compile + update index) | ## Coding Best Practices - Prefer small functions with a single purpose. - Use a functional approach but don't make it too hardcore or difficult to understand. - Keep files and modules small and focused. -- `.res` files must always be capitalized (PascalCase), matching ReScript module conventions. +- Use PascalCase for new `.res` modules. Follow the existing filenames for framework entrypoints such as `root.res` and `routes.res`, and for script entrypoints. - Use the pipe-first operator (`->`) for chaining, which is idiomatic ReScript. -- Resolve all warnings and treat them as errors. The project has `"error": "+8"` in `rescript.json`. -- Never directly edit an `.jsx` files, you must edit the corresponding `.res` file. The `.jsx` files are generated by the ReScript compiler and will be overwritten on the next compile. +- Resolve all warnings before committing. `yarn build:res` applies the repository's strict warning checks. +- Never directly edit generated `.jsx` files; edit the corresponding `.res` file and rebuild. Most compiler output is ignored by Git; the guide's `apps/guide/app/root.jsx` and `apps/guide/app/routes.jsx` are tracked and must be regenerated with their sources. ## ReScript Rules -- You use **ReScript v12** (latest). Ensure all suggestions match this version. +- This branch uses **ReScript v12**. Ensure all suggestions match this version. - Ensure any produced JSX matches ReScript JSX v4 syntax (configured with `"preserve": true`). - **Never use the `Belt` or `Js` modules** — these are legacy. Use the modern `Stdlib` / core modules instead. - Always use the `JSON.t` type for JSON values. @@ -66,7 +83,7 @@ __tests__/ → Vitest browser-mode tests (Playwright) - Reference the abridged documentation for clarification on how ReScript's APIs work: https://rescript-lang.org/llms/manual/llm-small.txt - If you need more information you can access the full documentation, but do this only when needed as the docs are very large: https://rescript-lang.org/llms/manual/llm-full.txt - Never use `%raw` unless you are specifically asked to -- Never use `Object.magic` +- Never use `Obj.magic` - Don't add type annotations unless necessary for clarity or to resolve an error. ReScript's type inference is powerful, and often explicit annotations are not needed. ### ReScript Dependencies @@ -78,35 +95,37 @@ __tests__/ → Vitest browser-mode tests (Playwright) The project uses several patterns for JavaScript interop. Follow the existing conventions: -- **`@module` externals** for binding to npm packages (see `src/bindings/` for examples): +- **`@module` externals** for binding to npm packages (see `apps/docs/src/bindings/` and `packages/shared/src/` for examples): + ``` - @module("react-router") external useNavigate: unit => string => unit = "useNavigate" + type navigateOptions = {replace?: bool} + type navigate = (string, ~options: navigateOptions=?) => unit + + @module("react-router") external useNavigate: unit => navigate = "useNavigate" ``` + - **`@module` with `@react.component`** for binding to external React components: ``` @module("react-router") @react.component - external make: (~children: React.element) => React.element = "Outlet" - ``` -- **`%raw()`** for inline JS when no clean binding is possible: - ``` - let copyToClipboard: string => bool = %raw(`function(str) { ... }`) + external make: unit => React.element = "Outlet" ``` -- **`%%raw()`** (double percent) for top-level side-effectful JS imports. +- `%raw` and `%%raw` embed JavaScript; use them only when specifically requested. - **`@scope`** for binding to object properties like `process.env`. - **`external ... = "%identity"`** for zero-cost type coercions. -- Put new bindings in `src/bindings/` as a dedicated module (e.g. `Fuse.res`, `DocSearch.res`). +- Put app-specific bindings in `apps/docs/src/bindings/` as a dedicated module (e.g. `Fuse.res`, `DocSearch.res`). Bindings shared with the guide or playground belong in `packages/shared/src/`. ## ReScript React -- This project uses **React 19** and **React Router v7** (framework mode). -- The site is **pre-rendered** (`ssr: false`), so loaders have access to the filesystem during build. Loaders do **not** run on a server after the build. -- Route modules live in `app/routes/` and export a `loader` and a `default` component. -- Route modules **require** both a `.res` and a `.resi` (interface) file for Vite HMR to work. -- Only a single React component can be exposed from a module's JS output. +- This project uses **React 19** and **React Router v8** (framework mode). +- The site uses hybrid rendering: most routes are pre-rendered during the build, while `/try` is server-rendered by Cloudflare Pages Functions at runtime. +- Loaders for pre-rendered routes can access the filesystem during the build. Runtime SSR loaders, including shared loader code reachable from `/try`, execute in Cloudflare and must not depend on Node-only filesystem APIs or other build-time-only operations. +- Docs route modules live in `apps/docs/app/routes/`; the guide's route modules live in `apps/guide/app/`. Routes can export a `loader`, `links`, and a `default` component as needed. +- Give route modules a `.resi` interface that exposes their route exports and keeps helper components private. +- Export a route's page component as `default`. Reusable component modules may export multiple components, as `Markdown.resi` does. ### Route Module Pattern -Every route follows this pattern: +Example of a route with a loader. Routes without loader data can omit the loader and its type: ```rescript // SomeRoute.res @@ -152,21 +171,21 @@ let default: unit => React.element ## Styling -- **Tailwind CSS v4** configured via the Vite plugin (`@tailwindcss/vite`). There is no `tailwind.config.js`. -- All Tailwind configuration is in `styles/main.css` using CSS-native `@theme` blocks. +- The docs site uses **Tailwind CSS v4**, configured via the Vite plugin (`@tailwindcss/vite`). Design tokens and custom utilities live in `apps/docs/styles/_theme.css`, imported by `apps/docs/styles/main.css` and referenced by route-specific stylesheets. +- The guide uses its own plain CSS in `apps/guide/styles/main.css`. - **LightningCSS** is used as the CSS transformer. -- The project defines custom design tokens in `styles/main.css`: +- The project defines custom design tokens in `apps/docs/styles/_theme.css`: - Custom colors: `gray-*`, `fire-*`, `sky-*`, `berry-*`, `water`, `turtle`, `orange-*` - Custom font sizes: `text-11` through `text-68` - Custom utility classes: `hl-title`, `hl-1`–`hl-5`, `body-lg`, `body-md`, `body-sm`, `captions` - Fonts: Inter (sans), Roboto Mono (mono) -- Use existing custom utilities and design tokens. Check `styles/main.css` before creating new ones. +- Use existing custom utilities and design tokens. Check `apps/docs/styles/_theme.css` before creating new ones. ## Testing -- Tests use **Vitest 4** in browser mode with **Playwright** (Chromium). -- Test files live in `__tests__/` and are named `ComponentName_.test.res` (compiled to `.test.jsx`). -- Tests use custom ReScript bindings in `src/bindings/Vitest.res`. +- Tests use **Vitest 5** in browser mode with **Playwright** (Chromium). +- Browser tests live in `apps/docs/__tests__/` and `apps/guide/__tests__/`. Docs visual tests live in `apps/docs/__tests__/visual/`. Test modules are named `ComponentName_.test.res` (compiled to `.test.jsx`). +- Tests use custom ReScript bindings in `packages/shared/src/Vitest.res`. - Tests are visual/integration tests that render components and assert visibility, interactions, and screenshots. - Test pattern: @@ -183,23 +202,26 @@ let default: unit => React.element ``` - Components requiring React Router context must be wrapped in ``. -- Do not use `` in tests. -- Run tests with `yarn vitest --browser.headless --run`. -- Do not update snapshots without asking for confirmation. +- Do not use `` in component tests. End-to-end tests exercise the app's normal routing and browser history. +- Run `yarn build:res` first so the tests use current compiler output. Run `yarn vitest --browser.headless --run` for docs tests or `yarn vitest:guide --browser.headless --run` for guide tests. Run `yarn ci:test` to check both suites. +- Do not update snapshots without asking for confirmation. Approved docs visual baseline changes use the `Update Visual Regression Screenshots` GitHub Actions workflow against the feature branch; pull and review the generated commit. Local screenshot updates are blocked by the Vitest configuration. ## MDX Content -- Documentation content is in `markdown-pages/` organized by section (blog, docs, community, syntax-lookup). -- MDX is processed by `react-router-mdx` with remark/rehype plugins. -- Custom MDX components are mapped in `app/routes/MdxRoute.res` (e.g. ``, ``, ``, `, ) switch document->WebAPI.Document.querySelector("article.DocSearch-content") { diff --git a/apps/docs/__tests__/CommunityLayoutBehavior_.test.res b/apps/docs/__tests__/CommunityLayoutBehavior_.test.res new file mode 100644 index 000000000..22abfb1c8 --- /dev/null +++ b/apps/docs/__tests__/CommunityLayoutBehavior_.test.res @@ -0,0 +1,169 @@ +open Vitest + +@module("vitest/browser") @scope("userEvent") +external keyboard: string => promise = "keyboard" + +@send external toHaveFocus: element => promise = "toHaveFocus" + +let categories: array = [ + { + name: "Resources", + items: [ + {name: "Overview", href: "/community/overview"}, + {name: "Code of Conduct", href: "/community/code-of-conduct"}, + ], + }, +] + +let entries: array = [ + {header: "Official Channels", href: "#official-channels"}, +] + +module CurrentPage = { + @react.component + let make = () => { + let {pathname} = ReactRouter.useLocation() +
{React.string((pathname :> string))}
+ } +} + +module Redirect = { + @module("react-router") @react.component + external make: (~to: string) => React.element = "Navigate" +} + +let community = (~redirect=false, ()) => + + + {redirect ? : React.null} + +
+ +

{React.string("Official channels content")}

+
+
+
+
+ +let renderCommunity = () => render(community()) + +test("mobile community navigation opens and closes", async () => { + await viewport(390, 844) + let screen = await renderCommunity() + let trigger = await screen->getByText("Community navigation") + let dialog = await screen->getByTestId("community-mobile-sidebar") + + await element(trigger)->toBeVisible + await element(trigger)->toHaveAttribute("aria-expanded", "false") + await element(dialog)->notToBeInTheDocument + await trigger->click + + await element(trigger)->toHaveAttribute("aria-expanded", "true") + await element(dialog)->toBeVisible + let resources = await dialog->getByText("Resources") + await element(resources)->toBeVisible + let close = await dialog->getByLabelText("Close community navigation") + await close->click + await element(dialog)->notToBeInTheDocument + await element(trigger)->toHaveAttribute("aria-expanded", "false") + await element(trigger)->toHaveFocus +}) + +test("Escape closes community navigation and returns focus to the opener", async () => { + await viewport(390, 844) + let screen = await renderCommunity() + let trigger = await screen->getByText("Community navigation") + let dialog = await screen->getByTestId("community-mobile-sidebar") + await trigger->click + await element(dialog)->toBeVisible + + await keyboard("{Escape}") + await element(dialog)->notToBeInTheDocument + await element(trigger)->toHaveAttribute("aria-expanded", "false") + await element(trigger)->toHaveFocus +}) + +test("community page links close the drawer, including the current page link", async () => { + await viewport(390, 844) + let screen = await renderCommunity() + let trigger = await screen->getByText("Community navigation") + let dialog = await screen->getByTestId("community-mobile-sidebar") + await trigger->click + let link = await dialog->getByText("Code of Conduct") + await link->click + + let currentPage = await screen->getByTestId("current-page") + await element(currentPage)->toHaveTextContent("/community/code-of-conduct") + await element(dialog)->notToBeInTheDocument + + await trigger->click + let currentPageLink = await dialog->getByText("Code of Conduct") + await currentPageLink->click + await element(dialog)->notToBeInTheDocument +}) + +test("community table of contents links close the mobile drawer", async () => { + await viewport(390, 844) + let screen = await renderCommunity() + let trigger = await screen->getByText("Community navigation") + let dialog = await screen->getByTestId("community-mobile-sidebar") + await trigger->click + let tocLink = await dialog->getByText("Official Channels") + await tocLink->click + await element(dialog)->notToBeInTheDocument +}) + +test( + "desktop community navigation stays visible and resizing dismisses an open drawer", + async () => { + await viewport(390, 844) + let screen = await renderCommunity() + let trigger = await screen->getByText("Community navigation") + let dialog = await screen->getByTestId("community-mobile-sidebar") + await trigger->click + await element(dialog)->toBeVisible + + await viewport(900, 900) + await element(dialog)->notToBeInTheDocument + await element(trigger)->notToBeVisible + let resources = await screen->getByText("Resources") + await element(resources)->toBeVisible + + await viewport(390, 844) + await element(trigger)->toBeVisible + await element(trigger)->toHaveAttribute("aria-expanded", "false") + }, +) + +test("rerendering community layout preserves the open dialog and keyboard focus", async () => { + await viewport(390, 844) + let screen = await renderCommunity() + let trigger = await screen->getByText("Community navigation") + let dialog = await screen->getByTestId("community-mobile-sidebar") + await trigger->click + await element(dialog)->toBeVisible + await keyboard("{Tab}") + let overview = await dialog->getByText("Overview") + await element(overview)->toHaveFocus + + await screen->rerender(community()) + await element(dialog)->toBeVisible + await element(overview)->toHaveFocus +}) + +test("route changes outside the drawer reset mobile navigation", async () => { + await viewport(390, 844) + let screen = await renderCommunity() + let trigger = await screen->getByText("Community navigation") + let dialog = await screen->getByTestId("community-mobile-sidebar") + await trigger->click + await element(dialog)->toBeVisible + + await screen->rerender(community(~redirect=true, ())) + let currentPage = await screen->getByTestId("current-page") + await element(currentPage)->toHaveTextContent("/community/code-of-conduct") + await element(dialog)->notToBeInTheDocument + await element(trigger)->toHaveAttribute("aria-expanded", "false") + await trigger->click + await element(dialog)->toBeVisible +}) diff --git a/apps/docs/__tests__/ContentHighlighting_.test.res b/apps/docs/__tests__/ContentHighlighting_.test.res new file mode 100644 index 000000000..a86f1c881 --- /dev/null +++ b/apps/docs/__tests__/ContentHighlighting_.test.res @@ -0,0 +1,102 @@ +open Vitest + +type registeredLanguage +type highlightOptions = {language: string} +type highlightResult = {value: string} + +@module("highlight.js/lib/core") @scope("default") +external createHighlighter: unit => HighlightLanguages.highlighter = "newInstance" + +@send +external getLanguage: (HighlightLanguages.highlighter, string) => option = + "getLanguage" + +@send +external highlight: (HighlightLanguages.highlighter, string, highlightOptions) => highlightResult = + "highlight" + +let aliases = [ + "rescript", + "res", + "resi", + "javascript", + "js", + "jsx", + "mjs", + "cjs", + "css", + "ts", + "tsx", + "mts", + "cts", + "typescript", + "sh", + "bash", + "zsh", + "toml", + "json", + "jsonc", + "text", + "txt", + "html", + "xhtml", + "rss", + "atom", + "xjb", + "xsd", + "xsl", + "plist", + "wsf", + "svg", + "diff", + "patch", + "yaml", + "yml", +] + +test("content registration preserves every established language name and alias", async () => { + let highlighter = createHighlighter() + highlighter->ContentHighlighting.register + + let missingAliases = + aliases->Array.filter(alias => highlighter->getLanguage(alias)->Option.isNone) + expect(missingAliases)->toEqual([]) +}) + +test("content registration produces highlighted ReScript and escaped plain text", async () => { + let highlighter = createHighlighter() + highlighter->ContentHighlighting.register + + let rescript = highlighter->highlight("let count = 1", {language: "res"}) + let text = highlighter->highlight("", {language: "text"}) + + expect(rescript.value->String.includes("let"))->toBe(true) + expect(rescript.value->String.includes("1"))->toBe(true) + expect(text.value)->toBe("<button>Example & code</button>") +}) + +test("repeated content initialization leaves registered grammars unchanged", async () => { + let highlighter = createHighlighter() + highlighter->ContentHighlighting.register + let original = highlighter->getLanguage("javascript") + let before = highlighter->highlight("const count: number = 1;", {language: "ts"}) + + highlighter->ContentHighlighting.register + + let after = highlighter->highlight("const count: number = 1;", {language: "ts"}) + expect(highlighter->getLanguage("javascript"))->toBe(original) + expect(highlighter->getLanguage("js"))->toBe(original) + expect(after.value)->toBe(before.value) +}) + +test("content registration highlights YAML installation examples and their alias", async () => { + let highlighter = createHighlighter() + highlighter->ContentHighlighting.register + let code = "packages:\n - apps/*" + + let yaml = highlighter->highlight(code, {language: "yaml"}) + let alias = highlighter->highlight(code, {language: "yml"}) + + expect(yaml.value->String.includes("packages:"))->toBe(true) + expect(alias.value)->toBe(yaml.value) +}) diff --git a/apps/docs/__tests__/CopyButtons_.test.res b/apps/docs/__tests__/CopyButtons_.test.res new file mode 100644 index 000000000..82a2886e2 --- /dev/null +++ b/apps/docs/__tests__/CopyButtons_.test.res @@ -0,0 +1,62 @@ +open Vitest + +test( + "code copy waits for the write, copies exact code, and permits retry after failure", + async () => { + let copied = ref(None) + let complete = ref(_ => ()) + let writeClipboard = code => { + copied := Some(code) + Promise.make((resolve, _) => complete := resolve) + } + let screen = await render() + let button = await screen->getByLabelText("Copy code") + await button->click + await element(button)->toBeDisabled + expect(copied.contents)->toEqual(Some("let answer = 42")) + complete.contents(Error(Clipboard.WriteFailed)) + let retry = await screen->getByLabelText("Copy failed, try again") + await element(retry)->notToBeDisabled + await retry->click + complete.contents(Ok()) + let feedback = await screen->getByText("Copied to clipboard") + await element(feedback)->toBeVisible + await element(button)->toBeDisabled + await screen->unmount + await element(feedback)->notToBeInTheDocument + }, +) + +test( + "share copy writes the full URL and shows success only after the write completes", + async () => { + let copied = ref(None) + let complete = ref(_ => ()) + let writeClipboard = url => { + copied := Some(url) + Promise.make((resolve, _) => complete := resolve) + } + let screen = await render() + let button = await screen->getByText("Copy Share Link") + await button->click + await element(button)->toBeDisabled + expect(copied.contents)->toEqual(Some(window.location.href)) + complete.contents(Error(Clipboard.WriteFailed)) + let retry = await screen->getByText("Copy failed, try again") + await element(retry)->notToBeDisabled + await retry->click + complete.contents(Ok()) + await element(await screen->getByText("Copied to clipboard!"))->toBeVisible + }, +) + +test("a previous share write cannot change feedback for a new share link", async () => { + let complete = ref(_ => ()) + let writeClipboard = _ => Promise.make((resolve, _) => complete := resolve) + let screen = await render() + await (await screen->getByText("Copy Share Link"))->click + await screen->rerender() + complete.contents(Ok()) + await element(await screen->getByText("Copy Share Link"))->notToBeDisabled + await element(await screen->getByText("Copied to clipboard!"))->notToBeInTheDocument +}) diff --git a/apps/docs/__tests__/DocsLayoutBehavior_.test.res b/apps/docs/__tests__/DocsLayoutBehavior_.test.res index 41441c221..c53becae3 100644 --- a/apps/docs/__tests__/DocsLayoutBehavior_.test.res +++ b/apps/docs/__tests__/DocsLayoutBehavior_.test.res @@ -64,3 +64,23 @@ test("docs layout marks the textual content for DocSearch crawling", async () => expect(lvl0->textContent)->toBe("Manual") }) + +test("following a desktop docs link keeps the in-page sidebar hidden on mobile", async () => { + await viewport(1440, 900) + + let screen = await render( + + +
{React.string("Documentation content")}
+
+
, + ) + + let sidebar = await screen->getByTestId("sidebar-content") + await element(sidebar)->toBeVisible + let installation = await sidebar->getByText("Installation") + await installation->click + + await viewport(390, 844) + await element(sidebar)->notToBeVisible +}) diff --git a/apps/docs/__tests__/HighlightLanguages_.test.res b/apps/docs/__tests__/HighlightLanguages_.test.res new file mode 100644 index 000000000..634b5212b --- /dev/null +++ b/apps/docs/__tests__/HighlightLanguages_.test.res @@ -0,0 +1,30 @@ +open Vitest + +test("registering a missing language makes its grammar and aliases available", async () => { + let highlighter = HighlightLanguages.make(HighlightLanguages.defaultInstance) + + expect(highlighter->HighlightLanguages.getLanguage("javascript"))->toEqual(None) + expect(highlighter->HighlightLanguages.getLanguage("js"))->toEqual(None) + highlighter->HighlightLanguages.ensureRegistered("javascript", HighlightJsBindings.javascript) + + let result = highlighter->HighlightLanguages.highlight("const answer = 42;", {language: "js"}) + expect(result.value)->toBe( + "const answer = 42;", + ) +}) + +test("registering an existing name or alias does not replace its grammar", async () => { + let highlighter = HighlightLanguages.make(HighlightLanguages.defaultInstance) + highlighter->HighlightLanguages.ensureRegistered("javascript", HighlightJsBindings.javascript) + let original = highlighter->HighlightLanguages.getLanguage("javascript") + + highlighter->HighlightLanguages.ensureRegistered("javascript", HighlightJsBindings.text) + highlighter->HighlightLanguages.ensureRegistered("js", HighlightJsBindings.text) + + expect(highlighter->HighlightLanguages.getLanguage("javascript"))->toBe(original) + expect(highlighter->HighlightLanguages.getLanguage("js"))->toBe(original) + let result = highlighter->HighlightLanguages.highlight("const answer = 42;", {language: "js"}) + expect(result.value)->toBe( + "const answer = 42;", + ) +}) diff --git a/apps/docs/__tests__/ImageAsset_.test.res b/apps/docs/__tests__/ImageAsset_.test.res new file mode 100644 index 000000000..af4bf12b5 --- /dev/null +++ b/apps/docs/__tests__/ImageAsset_.test.res @@ -0,0 +1,64 @@ +open Vitest + +let metadata: ImageAsset.metadata = { + availableWidths: [360, 640, 1000], + imageUrlFor: (width, format) => { + let extension = switch format { + | #avif => "avif" + | #webp => "webp" + } + Some(`/images/photo-${width->Int.toString}.${extension}`) + }, +} + +let original: ImageAsset.t = { + src: "/images/photo.avif", + width: 1000, + height: 667, + source: Original, +} + +test("responsive source sets include every available width for the requested format", async () => { + expect(ImageAsset.sourceSet(metadata, #avif))->toEqual( + Some("/images/photo-360.avif 360w, /images/photo-640.avif 640w, /images/photo-1000.avif 1000w"), + ) + expect(ImageAsset.sourceSet(metadata, #webp))->toEqual( + Some("/images/photo-360.webp 360w, /images/photo-640.webp 640w, /images/photo-1000.webp 1000w"), + ) +}) + +test("source sets omit missing and blank image URLs", async () => { + let partial: ImageAsset.metadata = { + availableWidths: [360, 640, 1000], + imageUrlFor: (width, _format) => + switch width { + | 360 => Some("/images/photo-360.avif") + | 640 => None + | _ => Some(" ") + }, + } + expect(ImageAsset.sourceSet(partial, #avif))->toEqual(Some("/images/photo-360.avif 360w")) +}) + +test("empty and unavailable candidates omit the source set entirely", async () => { + expect(ImageAsset.sourceSet({...metadata, availableWidths: []}, #avif))->toEqual(None) + expect( + ImageAsset.sourceSet({...metadata, imageUrlFor: (_width, _format) => None}, #webp), + )->toEqual(None) +}) + +test("the fallback preserves originals and selects a generated WebP when available", async () => { + expect(ImageAsset.fallback(original))->toBe("/images/photo.avif") + expect(ImageAsset.fallback({...original, source: Responsive(metadata)}))->toBe( + "/images/photo-1000.webp", + ) +}) + +test("missing or blank generated fallback URLs retain the original image", async () => { + let missing = {...metadata, imageUrlFor: (_width, _format) => None} + let blank = {...metadata, imageUrlFor: (_width, _format) => Some("")} + expect(ImageAsset.fallback({...original, source: Responsive(missing)}))->toBe( + "/images/photo.avif", + ) + expect(ImageAsset.fallback({...original, source: Responsive(blank)}))->toBe("/images/photo.avif") +}) diff --git a/apps/docs/__tests__/ImageGallery_.test.res b/apps/docs/__tests__/ImageGallery_.test.res new file mode 100644 index 000000000..4237f2489 --- /dev/null +++ b/apps/docs/__tests__/ImageGallery_.test.res @@ -0,0 +1,91 @@ +open Vitest + +let firstImage: ImageAsset.t = { + src: "/lp/community-3.avif", + width: 1000, + height: 667, + source: Original, +} +let images: array = [ + firstImage, + {src: "/lp/community-2.avif", width: 1355, height: 904, source: Original}, + {src: "/lp/community-1.avif", width: 1000, height: 667, source: Original}, +] + +test( + "gallery selectors show their photo and the next control wraps after the last photo", + async () => { + let screen = await render() + let first = await screen->getByLabelText("Show community photo 1") + let third = await screen->getByLabelText("Show community photo 3") + let next = await screen->getByLabelText("Next community photo") + + await element(first)->toHaveAttribute("aria-pressed", "true") + await third->click + await element(third)->toHaveAttribute("aria-pressed", "true") + let lastImage = await screen->getByAltText("ReScript community photo 3") + await element(lastImage)->toHaveAttribute("src", "/lp/community-1.avif") + await next->click + + await element(first)->toHaveAttribute("aria-pressed", "true") + await element(third)->toHaveAttribute("aria-pressed", "false") + let firstImage = await screen->getByAltText("ReScript community photo 1") + await element(firstImage)->toHaveAttribute("src", "/lp/community-3.avif") + }, +) + +test("gallery renders no controls for an empty image list", async () => { + let screen = await render() + expect(screen->container->textContent->Nullable.toOption)->toEqual(Some("")) + let next = await screen->getByLabelText("Next community photo") + await element(next)->notToBeInTheDocument +}) + +test("gallery returns to the first image when the selected image is removed", async () => { + let screen = await render() + let third = await screen->getByLabelText("Show community photo 3") + await third->click + + await screen->rerender() + + let firstImage = await screen->getByAltText("ReScript community photo 1") + await element(firstImage)->toHaveAttribute("src", "/lp/community-3.avif") + let next = await screen->getByLabelText("Next community photo") + await next->click + await element(firstImage)->toHaveAttribute("src", "/lp/community-3.avif") +}) + +test("gallery keeps the first image selected when a shortened list grows again", async () => { + let screen = await render() + let third = await screen->getByLabelText("Show community photo 3") + await third->click + + await screen->rerender() + let first = await screen->getByLabelText("Show community photo 1") + await element(first)->toHaveAttribute("aria-pressed", "true") + + await screen->rerender() + + await element(first)->toHaveAttribute("aria-pressed", "true") + await element(third)->toHaveAttribute("aria-pressed", "false") + let firstImage = await screen->getByAltText("ReScript community photo 1") + await element(firstImage)->toHaveAttribute("src", "/lp/community-3.avif") +}) + +test("gallery keeps the first image selected after an empty list is restored", async () => { + let screen = await render() + let third = await screen->getByLabelText("Show community photo 3") + await third->click + + await screen->rerender() + let next = await screen->getByLabelText("Next community photo") + await element(next)->notToBeInTheDocument + + await screen->rerender() + + let first = await screen->getByLabelText("Show community photo 1") + await element(first)->toHaveAttribute("aria-pressed", "true") + await element(third)->toHaveAttribute("aria-pressed", "false") + let firstImage = await screen->getByAltText("ReScript community photo 1") + await element(firstImage)->toHaveAttribute("src", "/lp/community-3.avif") +}) diff --git a/apps/docs/__tests__/JavaScriptHighlighting_.test.res b/apps/docs/__tests__/JavaScriptHighlighting_.test.res new file mode 100644 index 000000000..78e5b3454 --- /dev/null +++ b/apps/docs/__tests__/JavaScriptHighlighting_.test.res @@ -0,0 +1,35 @@ +open Vitest + +type registeredLanguage +type highlightOptions = {language: string} +type highlightResult = {value: string} + +@module("highlight.js/lib/core") @scope("default") +external createHighlighter: unit => HighlightLanguages.highlighter = "newInstance" + +@send +external listLanguages: HighlightLanguages.highlighter => array = "listLanguages" + +@send +external getLanguage: (HighlightLanguages.highlighter, string) => option = + "getLanguage" + +@send +external highlight: (HighlightLanguages.highlighter, string, highlightOptions) => highlightResult = + "highlight" + +test("playground registration loads only JavaScript and its working aliases", async () => { + let highlighter = createHighlighter() + highlighter->JavaScriptHighlighting.register + + let missingAliases = + ["javascript", "js", "jsx", "mjs", "cjs"]->Array.filter(alias => + highlighter->getLanguage(alias)->Option.isNone + ) + expect(highlighter->listLanguages)->toEqual(["javascript"]) + expect(missingAliases)->toEqual([]) + let result = highlighter->highlight("const answer = 42;", {language: "js"}) + expect(result.value)->toBe( + "const answer = 42;", + ) +}) diff --git a/apps/docs/__tests__/LandingPageBehavior_.test.res b/apps/docs/__tests__/LandingPageBehavior_.test.res index fd26b9843..1d7b5bb20 100644 --- a/apps/docs/__tests__/LandingPageBehavior_.test.res +++ b/apps/docs/__tests__/LandingPageBehavior_.test.res @@ -1,26 +1,44 @@ open ReactRouter open Vitest -let expectedExample = `module Button = { - @react.component - let make = (~count) => { - let times = switch count { - | 1 => "once" - | 2 => "twice" - | n => n->Int.toString ++ " times" +let getOpenGraphImageUrl = () => { + switch document->WebAPI.Document.querySelector("meta[property='og:image']") { + | Value(meta) => + switch meta->WebAPI.Element.getAttribute("content") { + | Value(content) => WebAPI.URL.make(~url=content) + | Null => failwith("expected Open Graph image metadata to have content") } - let text = \`Click me $\{times\}\` + | Null => failwith("expected Open Graph image metadata") + } +} - +test("landing page Open Graph image targets its absolute page URL", async () => { + let _screen = await render( + + + , + ) + let pageUrl = WebAPI.URL.make(~url=Env.root_url) + let imageUrl = getOpenGraphImageUrl() + let targetUrl = switch imageUrl.searchParams + ->WebAPI.URLSearchParams.get("url") + ->Nullable.make + ->Nullable.toOption { + | Some(targetUrl) => WebAPI.URL.make(~url=targetUrl) + | None => failwith("expected Open Graph image URL to include a page URL") } -}` + + expect(imageUrl.origin)->toBe(pageUrl.origin) + expect(imageUrl.pathname)->toBe("/ogimage/index.png") + expect(targetUrl.href)->toBe(pageUrl.href) +}) test( "landing page playground link uses compressed code that the playground can decode", async () => { let screen = await render( - + , ) @@ -50,14 +68,14 @@ test( ->Nullable.toOption expect(decodedCode->Option.isSome)->toBe(true) - expect(decodedCode->Option.getOrThrow)->toBe(expectedExample) + expect(decodedCode->Option.getOrThrow)->toBe(LandingPageFixture.expectedExample) }, ) test("landing page playground hero renders highlighted code tokens", async () => { let screen = await render( - + , ) @@ -79,6 +97,55 @@ test("landing page playground hero renders highlighted code tokens", async () => expect(rescriptCodeBlock.innerHTML->String.includes("toBe(true) expect(javascriptCodeBlock.innerHTML->String.includes("toBe(true) + expect(rescriptCodeBlock.textContent->Null.toOption)->toEqual( + Some(LandingPageFixture.expectedExample), + ) + expect(javascriptCodeBlock.textContent->Null.toOption)->toEqual( + Some(LandingPageFixture.expectedJavascript), + ) + expect(rescriptCodeBlock.className)->toBe("hljs lang-res dark") + expect(javascriptCodeBlock.className)->toBe("hljs lang-js dark") + expect(rescriptCodeBlock->WebAPI.Element.querySelector("button")->Null.toOption)->toEqual(None) +}) + +test("landing page renders its critical sections", async () => { + let screen = await render( + + + , + ) + + let intro = await screen->getByText("JavaScript Made Simple for Humans and AI") + let playground = await screen->getByText("Write in ReScript") + let install = await screen->getByText("Quick Install") + let mainSellingPoint = await screen->getByText("The fastest build system on the web") + let community = await screen->getByText( + "A community of programmers who value getting things done", + ) + let users = await screen->getByText("Trusted by our users") + let resources = await screen->getByText("Curated resources") + + await element(intro)->toBeVisible + await element(playground)->toBeVisible + await element(install)->toBeVisible + await element(mainSellingPoint)->toBeVisible + await element(community)->toBeVisible + await element(users)->toBeVisible + await element(resources)->toBeVisible +}) + +test("landing page copy button shows success feedback", async () => { + let screen = await render( + + + , + ) + + let copyButton = await screen->getByLabelText("Copy npm install rescript command") + await copyButton->click + + let feedback = await screen->getByText("Copied!") + await element(feedback)->toBeVisible }) test( @@ -88,7 +155,7 @@ test( let screen = await render( - + , ) diff --git a/apps/docs/__tests__/LandingPageCopyButton_.test.res b/apps/docs/__tests__/LandingPageCopyButton_.test.res new file mode 100644 index 000000000..77d2d6ddb --- /dev/null +++ b/apps/docs/__tests__/LandingPageCopyButton_.test.res @@ -0,0 +1,64 @@ +open Vitest + +test( + "copy button writes its command and clears success feedback before copying again", + async () => { + let copiedCommand = ref(None) + let writeClipboard = async code => { + copiedCommand := Some(code) + Ok() + } + let screen = await render() + let button = await screen->getByLabelText("Copy npm install rescript command") + + await button->click + + let feedback = await screen->getByText("Copied!") + await element(feedback)->toBeVisible + expect(copiedCommand.contents)->toEqual(Some("npm install rescript")) + await element(button)->toBeDisabled + await element(button)->notToBeDisabled + await element(feedback)->notToBeInTheDocument + await button->click + await element(feedback)->toBeVisible + }, +) + +test("copy button exposes clipboard failure and allows retry", async () => { + let shouldFail = ref(true) + let writeClipboard = async _ => { + if shouldFail.contents { + shouldFail := false + Error(Clipboard.WriteFailed) + } else { + Ok() + } + } + let screen = await render() + let button = await screen->getByLabelText("Copy npm install rescript command") + + await button->click + + let feedback = await screen->getByText("Could not copy. Try again.") + await element(feedback)->toBeVisible + await element(button)->notToBeDisabled + await button->click + + let copied = await screen->getByText("Copied!") + await element(copied)->toBeVisible + await element(feedback)->notToBeInTheDocument +}) + +test("copy button disables duplicate writes until the clipboard operation settles", async () => { + let complete = ref(_ => ()) + let writeClipboard = _ => Promise.make((resolve, _) => complete := resolve) + let screen = await render() + let button = await screen->getByLabelText("Copy npm install rescript command") + + await button->click + await element(button)->toBeDisabled + complete.contents(Ok()) + + let feedback = await screen->getByText("Copied!") + await element(feedback)->toBeVisible +}) diff --git a/apps/docs/__tests__/LandingPageInstallInstructions_.test.res b/apps/docs/__tests__/LandingPageInstallInstructions_.test.res new file mode 100644 index 000000000..586db9134 --- /dev/null +++ b/apps/docs/__tests__/LandingPageInstallInstructions_.test.res @@ -0,0 +1,24 @@ +open Vitest + +test("install instructions update their class prop and keep copying available", async () => { + let screen = await render() + let root = switch document->WebAPI.Document.querySelector(".initial-layout") { + | Value(root) => root + | Null => failwith("expected the install instructions root") + } + await element(root)->toHaveAttribute("class", "w-full max-w-400 initial-layout") + + await screen->rerender() + + await element(root)->toHaveAttribute("class", "w-full max-w-400 updated-layout") + let template = await screen->getByLabelText("Copy npx create-rescript-app command") + await element(template)->toBeVisible + + await screen->rerender() + + await element(root)->toHaveAttribute("class", "w-full max-w-400 ") + let copy = await screen->getByLabelText("Copy npm install rescript command") + await copy->click + let feedback = await screen->getByText("Copied!") + await element(feedback)->toBeVisible +}) diff --git a/apps/docs/__tests__/LandingPagePlaygroundLoader_.test.res b/apps/docs/__tests__/LandingPagePlaygroundLoader_.test.res new file mode 100644 index 000000000..b9c1389f8 --- /dev/null +++ b/apps/docs/__tests__/LandingPagePlaygroundLoader_.test.res @@ -0,0 +1,31 @@ +open Vitest + +test( + "homepage example loader produces only serializable highlighted code and its URL", + async () => { + let data = LandingPagePlaygroundLoader.build() + let serialized = data->JSON.stringifyAny->Option.getOrThrow + let decoded = JSON.parseOrThrow(serialized) + let expected = JSON.Object( + Dict.fromArray([ + ("rescriptHtml", JSON.String(data.rescriptHtml)), + ("javascriptHtml", JSON.String(data.javascriptHtml)), + ("playgroundHref", JSON.String(data.playgroundHref)), + ]), + ) + + expect(decoded)->toEqual(expected) + expect(data.rescriptHtml->String.includes("toBe(true) + expect(data.javascriptHtml->String.includes("toBe(true) + let {pathname, searchParams} = WebAPI.URL.make( + ~url=data.playgroundHref, + ~base="https://rescript-lang.org", + ) + let code = searchParams->WebAPI.URLSearchParams.get("code") + + expect(pathname)->toBe("/try") + expect(LzString.lzString.decompressFromEncodedURIComponent(code))->toBe( + LandingPageFixture.expectedExample, + ) + }, +) diff --git a/apps/docs/__tests__/LandingPageVideo_.test.res b/apps/docs/__tests__/LandingPageVideo_.test.res new file mode 100644 index 000000000..a71fa3fd6 --- /dev/null +++ b/apps/docs/__tests__/LandingPageVideo_.test.res @@ -0,0 +1,28 @@ +open Vitest + +let attribute = (selector, name) => + document + ->WebAPI.Document.querySelector(selector) + ->Null.toOption + ->Option.flatMap(element => element->WebAPI.Element.getAttribute(name)->Null.toOption) + +test( + "homepage videos reserve dimensions and defer media loading while retaining controls", + async () => { + let _screen = await render( + , + ) + expect(attribute("video", "preload"))->toEqual(Some("none")) + expect(attribute("video", "width"))->toEqual(Some("1750")) + expect(attribute("video", "height"))->toEqual(Some("1116")) + expect(attribute("video", "poster"))->toEqual(Some("/lp/fast-build-preview.avif")) + expect(attribute("video", "controls"))->toEqual(Some("")) + expect(attribute("video source", "src"))->toEqual( + Some("https://assets-17077.kxcdn.com/videos/fast-build-3.mp4"), + ) + expect(attribute("video source", "type"))->toEqual(Some("video/mp4")) + }, +) diff --git a/apps/docs/__tests__/MdxFile_.test.res b/apps/docs/__tests__/MdxFile_.test.res new file mode 100644 index 000000000..02b13dbb6 --- /dev/null +++ b/apps/docs/__tests__/MdxFile_.test.res @@ -0,0 +1,25 @@ +open Vitest + +test("MdxFile.normalizePathname preserves a document route", async () => { + let result = MdxFile.normalizePathname("/blog/archived/a-small-step-for-bucklescript") + + expect(result)->toBe("/blog/archived/a-small-step-for-bucklescript") +}) + +test("MdxFile.normalizePathname removes a data route suffix", async () => { + let result = MdxFile.normalizePathname("/blog/archived/a-small-step-for-bucklescript.data") + + expect(result)->toBe("/blog/archived/a-small-step-for-bucklescript") +}) + +test("MdxFile.normalizePathname removes React Router's data path segment", async () => { + let result = MdxFile.normalizePathname("/blog/archived/a-small-step-for-bucklescript/_.data") + + expect(result)->toBe("/blog/archived/a-small-step-for-bucklescript") +}) + +test("MdxFile.normalizePathname removes a trailing slash", async () => { + let result = MdxFile.normalizePathname("/blog/archived/a-small-step-for-bucklescript/") + + expect(result)->toBe("/blog/archived/a-small-step-for-bucklescript") +}) diff --git a/apps/docs/__tests__/Meta_.test.res b/apps/docs/__tests__/Meta_.test.res index 15cd8ed45..f6a6c87b1 100644 --- a/apps/docs/__tests__/Meta_.test.res +++ b/apps/docs/__tests__/Meta_.test.res @@ -1,5 +1,18 @@ open Vitest +test("advertises the blog RSS feed in page metadata", async () => { + let _screen = await render( + + + , + ) + let feed = + document->WebAPI.Document.querySelector("link[rel='alternate'][type='application/rss+xml']") + expect(feed->Null.toOption->Option.map(WebAPI.Element.getAttribute(_, "href")))->toBe( + Some(Null.make("/blog/feed.xml")), + ) +}) + let getMetaContent = name => { switch document->WebAPI.Document.querySelector(`meta[name='${name}']`) { | Value(element) => @@ -50,4 +63,7 @@ test("generates Open Graph image URLs from the current page URL", async () => { expect(getMetaPropertyContent("og:image"))->toBe( `${rootUrl}ogimage/index.png?url=${encodeURIComponent(pageUrl)}`, ) + expect(getMetaContent("twitter:image"))->toBe(getMetaPropertyContent("og:image")) + let images = document->WebAPI.Document.querySelectorAll("meta[property='og:image']") + expect(images.length)->toBe(1) }) diff --git a/apps/docs/__tests__/NavbarTertiaryBehavior_.test.res b/apps/docs/__tests__/NavbarTertiaryBehavior_.test.res index 8e860e1cc..0e777fb82 100644 --- a/apps/docs/__tests__/NavbarTertiaryBehavior_.test.res +++ b/apps/docs/__tests__/NavbarTertiaryBehavior_.test.res @@ -19,12 +19,12 @@ test("mobile drawer can be toggled open", async () => { await viewport(600, 1200) let screen = await render( - + breadcrumbs editLink - , + , ) let sidebar = await screen->getByTestId("sidebar-categories") diff --git a/apps/docs/__tests__/NotFound_.test.res b/apps/docs/__tests__/NotFound_.test.res new file mode 100644 index 000000000..aa454fdbb --- /dev/null +++ b/apps/docs/__tests__/NotFound_.test.res @@ -0,0 +1,24 @@ +open Vitest + +module Location = { + @react.component + let make = () => { + let {pathname} = ReactRouter.useLocation() + {React.string((pathname :> string))} + } +} + +test("unknown documentation paths stay on the not-found page", async () => { + let path = "/docs/react/does-not-exist" + let screen = await render( + + + + , + ) + + let heading = await screen->getByText("Page Not Found") + await element(heading)->toBeVisible + let currentPath = await screen->getByTestId("current-path") + await element(currentPath)->toHaveTextContent(path) +}) diff --git a/apps/docs/__tests__/RescriptCompilerApi_.test.res b/apps/docs/__tests__/RescriptCompilerApi_.test.res new file mode 100644 index 000000000..3b2752407 --- /dev/null +++ b/apps/docs/__tests__/RescriptCompilerApi_.test.res @@ -0,0 +1,24 @@ +open Vitest +open RescriptCompilerApi + +test("recognizes the compiler API used by v13 alpha 6", async () => { + let version = Version.fromString("8") + + expect(version->Version.toString)->toBe("8.0") + expect(version->Version.availableLanguages)->toEqual([Lang.Res]) +}) + +test("enables existing compiler settings for v13 alpha 6", async () => { + let version = Version.fromString("8") + + expect(version->Version.isMinimumVersion(V4))->toBe(true) + expect(version->Version.isMinimumVersion(V6))->toBe(true) +}) + +test("keeps previous compiler APIs supported", async () => { + ["2", "3", "4", "5", "6", "7"]->Array.forEach(version => { + expect(version->Version.fromString->Version.toString)->toBe(`${version}.0`) + }) + expect(Version.fromString("1.0")->Version.availableLanguages)->toEqual([Lang.Reason, Res]) + expect(Version.fromString("unknown")->Version.isMinimumVersion(V4))->toBe(false) +}) diff --git a/apps/docs/__tests__/ResponsiveImage_.test.res b/apps/docs/__tests__/ResponsiveImage_.test.res new file mode 100644 index 000000000..94f46c6d6 --- /dev/null +++ b/apps/docs/__tests__/ResponsiveImage_.test.res @@ -0,0 +1,122 @@ +open Vitest + +let metadata: ImageAsset.metadata = { + availableWidths: [360, 640, 1000], + imageUrlFor: (width, format) => { + let format = switch format { + | #avif => "avif" + | #webp => "webp" + } + Some(`/lp/community-3.avif?width=${width->Int.toString}&format=${format}`) + }, +} + +let original: ImageAsset.t = { + src: "/lp/community-3.avif", + width: 1000, + height: 667, + source: Original, +} + +// Source elements have no accessible role; inspect their native media-selection attributes. +let sourceAttribute = name => + document + ->WebAPI.Document.querySelector("picture source") + ->Null.toOption + ->Option.flatMap(source => source->WebAPI.Element.getAttribute(name)->Null.toOption) + +let imageAttribute = name => + document + ->WebAPI.Document.querySelector("img") + ->Null.toOption + ->Option.flatMap(image => image->WebAPI.Element.getAttribute(name)->Null.toOption) + +test("original images retain a plain image with dimensions and loading attributes", async () => { + let screen = await render( + , + ) + let image = await screen->getByAltText("Community photo") + await element(image)->toHaveAttribute("src", "/lp/community-3.avif") + await element(image)->toHaveAttribute("width", "1000") + await element(image)->toHaveAttribute("height", "667") + await element(image)->toHaveAttribute("loading", "lazy") + await element(image)->toHaveAttribute("decoding", "async") + expect(document->WebAPI.Document.querySelector("picture")->Null.toOption)->toEqual(None) + expect(imageAttribute("srcset"))->toEqual(None) +}) + +test("responsive images render one AVIF source and a sized WebP image fallback", async () => { + let screen = await render( + , + ) + let image = await screen->getByAltText("Responsive community photo") + await element(image)->toHaveAttribute("src", "/lp/community-3.avif?width=1000&format=webp") + await element(image)->toHaveAttribute( + "srcset", + "/lp/community-3.avif?width=360&format=webp 360w, /lp/community-3.avif?width=640&format=webp 640w, /lp/community-3.avif?width=1000&format=webp 1000w", + ) + await element(image)->toHaveAttribute("sizes", "(min-width: 768px) 623.2px, 622px") + await element(image)->toHaveAttribute("width", "1000") + await element(image)->toHaveAttribute("height", "667") + await element(image)->toHaveAttribute("loading", "eager") + await element(image)->toHaveClass("gallery-photo") + expect(sourceAttribute("type"))->toEqual(Some("image/avif")) + expect(sourceAttribute("sizes"))->toEqual(Some("(min-width: 768px) 623.2px, 622px")) + expect(sourceAttribute("srcset"))->toEqual( + Some( + "/lp/community-3.avif?width=360&format=avif 360w, /lp/community-3.avif?width=640&format=avif 640w, /lp/community-3.avif?width=1000&format=avif 1000w", + ), + ) + expect(document->WebAPI.Document.querySelector("source ~ source")->Null.toOption)->toEqual(None) +}) + +test( + "unavailable responsive URLs render the valid original without empty source sets", + async () => { + let missing = {...metadata, imageUrlFor: (_width, _format) => None} + let screen = await render( + , + ) + let image = await screen->getByAltText("Fallback photo") + await element(image)->toHaveAttribute("src", "/lp/community-3.avif") + expect(imageAttribute("srcset"))->toEqual(None) + expect(sourceAttribute("srcset"))->toEqual(None) + expect(document->WebAPI.Document.querySelector("picture")->Null.toOption)->toEqual(None) + }, +) + +test( + "real plugin metadata renders generated assets with the requested image dimensions", + async () => { + let screen = await render( + , + ) + let image = await screen->getByAltText("ReScript editor tooling") + await element(image)->toHaveAttribute("width", "1000") + await element(image)->toHaveAttribute("height", "497") + await element(image)->toHaveAttribute("sizes", LandingPageImages.screenshotSizes) + expect(sourceAttribute("type"))->toEqual(Some("image/avif")) + let generatedWidths = switch LandingPageImages.tooling.source { + | Original => [] + | Responsive(metadata) => metadata.availableWidths + } + expect(generatedWidths)->toEqual([360, 640, 1000]) + let hasGeneratedFallback = + imageAttribute("src")->Option.map(src => + src->String.includes("/@responsive-image/vite-plugin/webp/1000/") + ) + expect(hasGeneratedFallback)->toEqual(Some(true)) + }, +) diff --git a/apps/docs/__tests__/Search_.test.res b/apps/docs/__tests__/Search_.test.res index e481ff699..503e4de4c 100644 --- a/apps/docs/__tests__/Search_.test.res +++ b/apps/docs/__tests__/Search_.test.res @@ -27,6 +27,25 @@ let makeHit = (~type_: DocSearch.contentType, ~url: string): DocSearch.docSearch _snippetResult: {content: Nullable.null}, } +let makeCrawlerHit = (): DocSearch.docSearchHit => { + objectID: "crawler-hit", + content: Nullable.make("map(array, fn) returns a new array."), + url: "https://rescript-lang.org/docs/manual/api/stdlib/array/#value-map", + url_without_anchor: Nullable.undefined, + type_: Content, + anchor: Nullable.undefined, + deprecated: None, + hierarchy: { + lvl0: Nullable.make("Array"), + lvl1: Nullable.make("map"), + lvl2: Nullable.null, + lvl3: Nullable.null, + lvl4: Nullable.null, + lvl5: Nullable.null, + lvl6: Nullable.null, + }, +} + let withHierarchy = ( hit: DocSearch.docSearchHit, ~lvl0: string, @@ -54,26 +73,28 @@ module CurrentPath = { // --------------------------------------------------------------------------- test("markdownToHtml strips leading backslash + whitespace", async () => { - expect(Search.markdownToHtml("\\ hello"))->toBe("hello") + expect(SearchResults.markdownToHtml("\\ hello"))->toBe("hello") }) test("markdownToHtml replaces interior backslash + whitespace with a space", async () => { - expect(Search.markdownToHtml("foo\\ bar"))->toBe("foo bar") + expect(SearchResults.markdownToHtml("foo\\ bar"))->toBe("foo bar") }) test("markdownToHtml handles multiple interior backslashes", async () => { - expect(Search.markdownToHtml("a\\ b\\ c"))->toBe("a b c") + expect(SearchResults.markdownToHtml("a\\ b\\ c"))->toBe("a b c") }) test("markdownToHtml strips leading and replaces interior backslashes together", async () => { - expect(Search.markdownToHtml("\\ a\\ b"))->toBe("a b") + expect(SearchResults.markdownToHtml("\\ a\\ b"))->toBe("a b") }) test( "markdownToHtml removes an MDN reference with a markdown link and trailing period", async () => { expect( - Search.markdownToHtml("Some text. See [Array](https://developer.mozilla.org/array) on MDN."), + SearchResults.markdownToHtml( + "Some text. See [Array](https://developer.mozilla.org/array) on MDN.", + ), )->toBe("Some text.") }, ) @@ -82,105 +103,113 @@ test( "markdownToHtml removes an MDN reference with a markdown link without trailing period", async () => { expect( - Search.markdownToHtml("Some text. See [Array](https://developer.mozilla.org/array) on MDN"), + SearchResults.markdownToHtml( + "Some text. See [Array](https://developer.mozilla.org/array) on MDN", + ), )->toBe("Some text.") }, ) test("markdownToHtml removes an MDN plain URL reference with trailing period", async () => { - expect(Search.markdownToHtml("Read more. See https://developer.mozilla.org/foo on MDN."))->toBe( - "Read more.", - ) + expect( + SearchResults.markdownToHtml("Read more. See https://developer.mozilla.org/foo on MDN."), + )->toBe("Read more.") }) test("markdownToHtml removes an MDN plain URL reference without trailing period", async () => { - expect(Search.markdownToHtml("Read more. See https://developer.mozilla.org/foo on MDN"))->toBe( - "Read more.", - ) + expect( + SearchResults.markdownToHtml("Read more. See https://developer.mozilla.org/foo on MDN"), + )->toBe("Read more.") }) test("markdownToHtml converts a markdown link to plain text", async () => { - expect(Search.markdownToHtml("[click here](https://example.com)"))->toBe("click here") + expect(SearchResults.markdownToHtml("[click here](https://example.com)"))->toBe("click here") }) test("markdownToHtml converts multiple markdown links", async () => { - expect(Search.markdownToHtml("[foo](http://a.com) and [bar](http://b.com)"))->toBe("foo and bar") + expect(SearchResults.markdownToHtml("[foo](http://a.com) and [bar](http://b.com)"))->toBe( + "foo and bar", + ) }) test("markdownToHtml passes through a link with empty text", async () => { - expect(Search.markdownToHtml("[](https://example.com)"))->toBe("[](https://example.com)") + expect(SearchResults.markdownToHtml("[](https://example.com)"))->toBe("[](https://example.com)") }) test("markdownToHtml converts backtick code to tags", async () => { - expect(Search.markdownToHtml("`Array.map`"))->toBe("Array.map") + expect(SearchResults.markdownToHtml("`Array.map`"))->toBe("Array.map") }) test("markdownToHtml converts multiple backtick spans", async () => { - expect(Search.markdownToHtml("Use `map` and `filter`"))->toBe( + expect(SearchResults.markdownToHtml("Use `map` and `filter`"))->toBe( "Use map and filter", ) }) test("markdownToHtml converts **text** to tags", async () => { - expect(Search.markdownToHtml("**important**"))->toBe("important") + expect(SearchResults.markdownToHtml("**important**"))->toBe("important") }) test("markdownToHtml converts bold within a sentence", async () => { - expect(Search.markdownToHtml("This is **very** important"))->toBe( + expect(SearchResults.markdownToHtml("This is **very** important"))->toBe( "This is very important", ) }) test("markdownToHtml converts *text* to tags", async () => { - expect(Search.markdownToHtml("*emphasis*"))->toBe("emphasis") + expect(SearchResults.markdownToHtml("*emphasis*"))->toBe("emphasis") }) test("markdownToHtml converts italic within a sentence", async () => { - expect(Search.markdownToHtml("This is *quite* nice"))->toBe("This is quite nice") + expect(SearchResults.markdownToHtml("This is *quite* nice"))->toBe("This is quite nice") }) test("markdownToHtml converts double newline to
", async () => { - expect(Search.markdownToHtml("first\n\nsecond"))->toBe("first
second") + expect(SearchResults.markdownToHtml("first\n\nsecond"))->toBe("first
second") }) test("markdownToHtml converts triple+ newlines to a single
", async () => { - expect(Search.markdownToHtml("first\n\n\nsecond"))->toBe("first
second") + expect(SearchResults.markdownToHtml("first\n\n\nsecond"))->toBe("first
second") }) test("markdownToHtml converts single newline to a space", async () => { - expect(Search.markdownToHtml("first\nsecond"))->toBe("first second") + expect(SearchResults.markdownToHtml("first\nsecond"))->toBe("first second") }) test("markdownToHtml trims leading whitespace", async () => { - expect(Search.markdownToHtml(" hello"))->toBe("hello") + expect(SearchResults.markdownToHtml(" hello"))->toBe("hello") }) test("markdownToHtml trims trailing whitespace", async () => { - expect(Search.markdownToHtml("hello "))->toBe("hello") + expect(SearchResults.markdownToHtml("hello "))->toBe("hello") }) test("markdownToHtml trims both sides", async () => { - expect(Search.markdownToHtml(" hello "))->toBe("hello") + expect(SearchResults.markdownToHtml(" hello "))->toBe("hello") }) test("markdownToHtml handles empty string", async () => { - expect(Search.markdownToHtml(""))->toBe("") + expect(SearchResults.markdownToHtml(""))->toBe("") }) test("markdownToHtml passes plain text through unchanged", async () => { - expect(Search.markdownToHtml("just plain text"))->toBe("just plain text") + expect(SearchResults.markdownToHtml("just plain text"))->toBe("just plain text") }) test("markdownToHtml applies multiple transformations together", async () => { expect( - Search.markdownToHtml("Use `map` on **arrays**.\n\nSee [docs](http://x.com) for *details*."), + SearchResults.markdownToHtml( + "Use `map` on **arrays**.\n\nSee [docs](http://x.com) for *details*.", + ), )->toBe("Use map on arrays.
See docs for details.") }) test( "markdownToHtml still converts bold inside code because regexes run sequentially", async () => { - expect(Search.markdownToHtml("`**notbold**`"))->toBe("notbold") + expect(SearchResults.markdownToHtml("`**notbold**`"))->toBe( + "notbold", + ) }, ) @@ -200,7 +229,7 @@ test("getHighlightedTitle renders crawler API titles as value names", async () = }, } - expect(Search.getHighlightedTitle(hit))->toBe("mapWithIndex") + expect(SearchResults.getHighlightedTitle(hit))->toBe("mapWithIndex") }) test( @@ -220,7 +249,7 @@ test( _highlightResult: {hierarchy: Nullable.make(highlightedHierarchy)}, } - expect(Search.getHighlightedTitle(hit))->toBe("Section title") + expect(SearchResults.getHighlightedTitle(hit))->toBe("Section title") }, ) @@ -233,7 +262,7 @@ test("getContentHtml prefers crawler snippet markup over plain content", async ( }, } - expect(Search.getContentHtml(hit))->toEqual( + expect(SearchResults.getContentHtml(hit))->toEqual( Some("map(array, fn) returns a new array."), ) }) @@ -246,7 +275,7 @@ test("hitComponent routes relative hit URLs through React Router", async () => { let screen = await render( - {Search.hitComponent({hit, children: React.null})} + , ) @@ -258,47 +287,38 @@ test("hitComponent routes relative hit URLs through React Router", async () => { test( "getContentHtml falls back to plain content when crawler hit has no snippet result", async () => { - let hit: DocSearch.docSearchHit = Obj.magic( - Dict.fromArray([ - ("objectID", "crawler-hit"), - ("content", "map(array, fn) returns a new array."), - ("url", "https://rescript-lang.org/docs/manual/api/stdlib/array/#value-map"), - ("type", "content"), - ( - "hierarchy", - Obj.magic( - Dict.fromArray([ - ("lvl0", Obj.magic("Array")), - ("lvl1", Obj.magic("map")), - ("lvl2", Obj.magic(Nullable.null)), - ("lvl3", Obj.magic(Nullable.null)), - ("lvl4", Obj.magic(Nullable.null)), - ("lvl5", Obj.magic(Nullable.null)), - ("lvl6", Obj.magic(Nullable.null)), - ]), - ), - ), - ]), - ) + let hit: DocSearch.docSearchHit = makeCrawlerHit() - expect(Search.getContentHtml(hit))->toEqual(Some("map(array, fn) returns a new array.")) + expect(SearchResults.getContentHtml(hit))->toEqual(Some("map(array, fn) returns a new array.")) }, ) test("search error boundary catches render errors without replacing surrounding page", async () => { await viewport(1440, 500) + let closed = ref(false) let screen = await render(
{React.string("Docs page stays rendered")} - ()}> + closed := true}> - +
, ) await element(await screen->getByText("Docs page stays rendered"))->toBeVisible await element(await screen->getByText("Search unavailable"))->toBeVisible + await (await screen->getByLabelText("Close search"))->click + expect(closed.contents)->toBe(true) +}) + +test("loading search can be canceled before the modal is available", async () => { + let closed = ref(false) + let screen = await render( closed := true} />) + + await element(await screen->getByText("Loading search"))->toBeVisible + await (await screen->getByLabelText("Close search"))->click + expect(closed.contents)->toBe(true) }) // --------------------------------------------------------------------------- @@ -306,77 +326,126 @@ test("search error boundary catches render errors without replacing surrounding // --------------------------------------------------------------------------- test("isChildHit treats Lvl2 as a child hit", async () => { - expect(Search.isChildHit(makeHit(~type_=Lvl2, ~url="https://example.com/page")))->toBe(true) + expect(SearchResults.isChildHit(makeHit(~type_=Lvl2, ~url="https://example.com/page")))->toBe( + true, + ) +}) + +test("search subtitles omit top-level, missing, and empty parent titles", async () => { + let topLevel = makeHit(~type_=Lvl1, ~url="/docs/manual") + let child = makeHit(~type_=Lvl2, ~url="/docs/manual#child") + + expect(SearchResults.getSubtitle({...topLevel, type_: Lvl0}))->toEqual(None) + expect(SearchResults.getSubtitle(topLevel))->toEqual(None) + expect(SearchResults.getSubtitle(child))->toEqual(Some("Test Page")) + expect( + SearchResults.getSubtitle({...child, hierarchy: {...child.hierarchy, lvl1: Nullable.null}}), + )->toEqual(None) + expect( + SearchResults.getSubtitle({ + ...child, + hierarchy: {...child.hierarchy, lvl1: Nullable.make("")}, + }), + )->toEqual(None) +}) + +test("search state opens once and closes from active or inactive", async () => { + let modal = SearchModal.make + let anotherModal = React.lazy_(() => import(SearchModal.make)) + let active = Search.reduce(Inactive, Open(modal)) + + expect(active)->toEqual(Search.Active(modal)) + expect(Search.reduce(active, Open(anotherModal)))->toEqual(active) + expect(Search.reduce(active, Close))->toEqual(Search.Inactive) + expect(Search.reduce(Inactive, Close))->toEqual(Search.Inactive) }) test("isChildHit treats Lvl3 as a child hit", async () => { - expect(Search.isChildHit(makeHit(~type_=Lvl3, ~url="https://example.com/page")))->toBe(true) + expect(SearchResults.isChildHit(makeHit(~type_=Lvl3, ~url="https://example.com/page")))->toBe( + true, + ) }) test("isChildHit treats Lvl4 as a child hit", async () => { - expect(Search.isChildHit(makeHit(~type_=Lvl4, ~url="https://example.com/page")))->toBe(true) + expect(SearchResults.isChildHit(makeHit(~type_=Lvl4, ~url="https://example.com/page")))->toBe( + true, + ) }) test("isChildHit treats Lvl5 as a child hit", async () => { - expect(Search.isChildHit(makeHit(~type_=Lvl5, ~url="https://example.com/page")))->toBe(true) + expect(SearchResults.isChildHit(makeHit(~type_=Lvl5, ~url="https://example.com/page")))->toBe( + true, + ) }) test("isChildHit treats Lvl6 as a child hit", async () => { - expect(Search.isChildHit(makeHit(~type_=Lvl6, ~url="https://example.com/page")))->toBe(true) + expect(SearchResults.isChildHit(makeHit(~type_=Lvl6, ~url="https://example.com/page")))->toBe( + true, + ) }) test("isChildHit treats Content as a child hit", async () => { - expect(Search.isChildHit(makeHit(~type_=Content, ~url="https://example.com/page")))->toBe(true) + expect(SearchResults.isChildHit(makeHit(~type_=Content, ~url="https://example.com/page")))->toBe( + true, + ) }) test("isChildHit treats Lvl2 as a child hit even without a hash in the URL", async () => { - expect(Search.isChildHit(makeHit(~type_=Lvl2, ~url="https://example.com/no-hash")))->toBe(true) + expect(SearchResults.isChildHit(makeHit(~type_=Lvl2, ~url="https://example.com/no-hash")))->toBe( + true, + ) }) test("isChildHit treats Content as a child hit even with a hash in the URL", async () => { - expect(Search.isChildHit(makeHit(~type_=Content, ~url="https://example.com/page#section")))->toBe( - true, - ) + expect( + SearchResults.isChildHit(makeHit(~type_=Content, ~url="https://example.com/page#section")), + )->toBe(true) }) test("isChildHit treats Lvl0 without a hash as not a child hit", async () => { - expect(Search.isChildHit(makeHit(~type_=Lvl0, ~url="https://example.com/page")))->toBe(false) + expect(SearchResults.isChildHit(makeHit(~type_=Lvl0, ~url="https://example.com/page")))->toBe( + false, + ) }) test("isChildHit treats Lvl0 with a hash as a child hit", async () => { - expect(Search.isChildHit(makeHit(~type_=Lvl0, ~url="https://example.com/page#section")))->toBe( - true, - ) + expect( + SearchResults.isChildHit(makeHit(~type_=Lvl0, ~url="https://example.com/page#section")), + )->toBe(true) }) test("isChildHit treats Lvl0 with a trailing # as a child hit", async () => { - expect(Search.isChildHit(makeHit(~type_=Lvl0, ~url="https://example.com/page#")))->toBe(true) + expect(SearchResults.isChildHit(makeHit(~type_=Lvl0, ~url="https://example.com/page#")))->toBe( + true, + ) }) test("isChildHit treats Lvl1 without a hash as not a child hit", async () => { - expect(Search.isChildHit(makeHit(~type_=Lvl1, ~url="https://example.com/page")))->toBe(false) + expect(SearchResults.isChildHit(makeHit(~type_=Lvl1, ~url="https://example.com/page")))->toBe( + false, + ) }) test("isChildHit treats Lvl1 with a hash as a child hit", async () => { - expect(Search.isChildHit(makeHit(~type_=Lvl1, ~url="https://example.com/page#heading")))->toBe( - true, - ) + expect( + SearchResults.isChildHit(makeHit(~type_=Lvl1, ~url="https://example.com/page#heading")), + )->toBe(true) }) test("isChildHit treats Lvl1 with a deeply nested hash anchor as a child hit", async () => { expect( - Search.isChildHit( + SearchResults.isChildHit( makeHit(~type_=Lvl1, ~url="https://example.com/docs/manual/api#some-section"), ), )->toBe(true) }) test("isChildHit treats Lvl1 with an empty URL as not a child hit", async () => { - expect(Search.isChildHit(makeHit(~type_=Lvl1, ~url="")))->toBe(false) + expect(SearchResults.isChildHit(makeHit(~type_=Lvl1, ~url="")))->toBe(false) }) test("toRelativeSiteUrl strips the site origin from an absolute URL", async () => { - let result = Search.toRelativeSiteUrl( + let result = SearchResults.toRelativeSiteUrl( "https://rescript-lang.org/docs/manual/introduction#what-is-rescript", ~siteUrl="https://rescript-lang.org/", ) @@ -385,7 +454,7 @@ test("toRelativeSiteUrl strips the site origin from an absolute URL", async () = }) test("toRelativeSiteUrl leaves absolute URLs unchanged when siteUrl is empty", async () => { - let result = Search.toRelativeSiteUrl( + let result = SearchResults.toRelativeSiteUrl( "https://rescript-lang.org/docs/manual/introduction#what-is-rescript", ~siteUrl="", ) @@ -398,7 +467,7 @@ test("normalizeHitUrls rewrites absolute site URLs to relative paths", async () ~type_=Lvl1, ~url="https://rescript-lang.org/docs/manual/typescript-integration#gentype", ) - let result = Search.normalizeHitUrls([hit], ~siteUrl="https://rescript-lang.org/") + let result = SearchResults.normalizeHitUrls([hit], ~siteUrl="https://rescript-lang.org/") expect(result[0]->Option.map(hit => hit.url))->toEqual( Some("/docs/manual/typescript-integration#gentype"), @@ -409,30 +478,9 @@ test("normalizeHitUrls rewrites absolute site URLs to relative paths", async () }) test("normalizeHitUrls tolerates crawler hits without url_without_anchor", async () => { - let hit: DocSearch.docSearchHit = Obj.magic( - Dict.fromArray([ - ("objectID", "crawler-hit"), - ("content", "map(array, fn) returns a new array."), - ("url", "https://rescript-lang.org/docs/manual/api/stdlib/array/#value-map"), - ("type", "content"), - ( - "hierarchy", - Obj.magic( - Dict.fromArray([ - ("lvl0", Obj.magic("Array")), - ("lvl1", Obj.magic("map")), - ("lvl2", Obj.magic(Nullable.null)), - ("lvl3", Obj.magic(Nullable.null)), - ("lvl4", Obj.magic(Nullable.null)), - ("lvl5", Obj.magic(Nullable.null)), - ("lvl6", Obj.magic(Nullable.null)), - ]), - ), - ), - ]), - ) + let hit: DocSearch.docSearchHit = makeCrawlerHit() - let result = Search.normalizeHitUrls([hit], ~siteUrl="https://rescript-lang.org/") + let result = SearchResults.normalizeHitUrls([hit], ~siteUrl="https://rescript-lang.org/") expect(result[0]->Option.map(hit => hit.url))->toEqual( Some("/docs/manual/api/stdlib/array/#value-map"), @@ -466,7 +514,10 @@ test("normalizeHitUrls keeps API hit order while separating Belt group labels", ~lvl1="map", ) - let result = Search.normalizeHitUrls([beltHit, stdlibHit], ~siteUrl="https://rescript-lang.org/") + let result = SearchResults.normalizeHitUrls( + [beltHit, stdlibHit], + ~siteUrl="https://rescript-lang.org/", + ) expect(result[0]->Option.map(hit => hit.objectID))->toEqual(Some("belt-array-map")) expect(result[0]->Option.flatMap(hit => hit.hierarchy.lvl0->Nullable.toOption))->toEqual( @@ -492,12 +543,8 @@ test("active DocSearch enables Algolia Insights", async () => { let _screen = await render( - ()} - onClose={() => ()} + ()} /> , ) diff --git a/apps/docs/__tests__/Sitemap_.test.res b/apps/docs/__tests__/Sitemap_.test.res index f35927387..a9f12ce7e 100644 --- a/apps/docs/__tests__/Sitemap_.test.res +++ b/apps/docs/__tests__/Sitemap_.test.res @@ -1,7 +1,7 @@ open Vitest test("renders sorted unique sitemap URLs with a normalized base URL", async () => { - let xml = Sitemap.render( + let xml = Sitemap.renderWithRuntimePaths( ~baseUrl="https://preview.example.com/", ["/docs/manual/introduction", "blog", "/", "/docs/manual/introduction"], ) @@ -17,6 +17,9 @@ test("renders sorted unique sitemap URLs with a normalized base URL", async () = https://preview.example.com/docs/manual/introduction/ + + https://preview.example.com/try/ + `) }) diff --git a/apps/docs/__tests__/SyntaxLookupBehavior_.test.res b/apps/docs/__tests__/SyntaxLookupBehavior_.test.res index 94b8fbe10..06b8473ad 100644 --- a/apps/docs/__tests__/SyntaxLookupBehavior_.test.res +++ b/apps/docs/__tests__/SyntaxLookupBehavior_.test.res @@ -46,11 +46,11 @@ test("syntax lookup detail marks active content for DocSearch crawling", async ( await viewport(1440, 900) let _screen = await render( - + Array.getUnsafe(0)}>

{React.string("Detail content for @as decorator.")}

-
, + , ) switch document->WebAPI.Document.querySelector(".DocSearch-content h1") { diff --git a/apps/docs/__tests__/Url_.test.res b/apps/docs/__tests__/Url_.test.res deleted file mode 100644 index fd29c2185..000000000 --- a/apps/docs/__tests__/Url_.test.res +++ /dev/null @@ -1,29 +0,0 @@ -open Vitest - -test("Url.parse splits an unversioned route into path segments", async () => { - let result = Url.parse("/docs/manual/introduction") - expect(result.base)->toEqual(["docs", "manual", "introduction"]) - expect(result.pagepath)->toEqual([]) - expect(result.fullpath)->toEqual(["docs", "manual", "introduction"]) -}) - -test("Url.parse treats version-like segments as ordinary path content", async () => { - let result = Url.parse("/docs/manual/v12.0.0/introduction") - expect(result.base)->toEqual(["docs", "manual", "v12.0.0", "introduction"]) - expect(result.pagepath)->toEqual([]) - expect(result.fullpath)->toEqual(["docs", "manual", "v12.0.0", "introduction"]) -}) - -test("Url.parse treats latest as ordinary path content", async () => { - let result = Url.parse("/docs/manual/latest/arrays") - expect(result.base)->toEqual(["docs", "manual", "latest", "arrays"]) - expect(result.pagepath)->toEqual([]) - expect(result.fullpath)->toEqual(["docs", "manual", "latest", "arrays"]) -}) - -test("Url.parse parses routes outside docs without special handling", async () => { - let result = Url.parse("/community/overview") - expect(result.base)->toEqual(["community", "overview"]) - expect(result.pagepath)->toEqual([]) - expect(result.fullpath)->toEqual(["community", "overview"]) -}) diff --git a/apps/docs/__tests__/visual/BlogArticle_.test.res b/apps/docs/__tests__/visual/BlogArticle_.test.res index c3f6083a4..3e642fa13 100644 --- a/apps/docs/__tests__/visual/BlogArticle_.test.res +++ b/apps/docs/__tests__/visual/BlogArticle_.test.res @@ -24,13 +24,13 @@ test("desktop blog article renders header, author, date, and body", async () => await viewport(1440, 900) let screen = await render( - +
{React.string("This is the blog post body content for testing.")}
-
, + , ) let title = await screen->getByText("Test Blog Post Title") @@ -50,13 +50,13 @@ test("desktop archived blog article shows warning banner", async () => { await viewport(1440, 900) let screen = await render( - +
{React.string("This is the blog post body content for testing.")}
-
, + , ) let important = await screen->getByText("Important:") @@ -70,13 +70,13 @@ test("mobile blog article", async () => { await viewport(600, 1200) let screen = await render( - +
{React.string("This is the blog post body content for testing.")}
-
, + , ) let title = await screen->getByText("Test Blog Post Title") @@ -115,7 +115,7 @@ test("desktop blog article with co-authors shows all authors", async () => { await viewport(1440, 900) let screen = await render( - +
{
{React.string("Collaborative content.")}
-
, + , ) let mainAuthor = await screen->getByText("Test Author") @@ -151,7 +151,7 @@ test("desktop blog article with article image shows image", async () => { await viewport(1440, 900) let screen = await render( - +
{
{React.string("Content below the article image.")}
-
, + , ) let title = await screen->getByText("Blog Post With Article Image") @@ -185,13 +185,13 @@ test("desktop blog article without description", async () => { await viewport(1440, 900) let screen = await render( - +
{React.string("Content without a description above.")}
-
, + , ) let title = await screen->getByText("Blog Post Without Description") diff --git a/apps/docs/__tests__/visual/Blog_.test.res b/apps/docs/__tests__/visual/Blog_.test.res index 66c62d518..e73c01060 100644 --- a/apps/docs/__tests__/visual/Blog_.test.res +++ b/apps/docs/__tests__/visual/Blog_.test.res @@ -58,11 +58,11 @@ test("desktop blog index shows featured post and cards", async () => { await viewport(1440, 900) let screen = await render( - +
-
, + , ) let featured = await screen->getByText("Announcing ReScript 12") @@ -74,21 +74,6 @@ test("desktop blog index shows featured post and cards", async () => { let card2 = await screen->getByText("Improving Interop") await element(card2)->toBeVisible - let wrapper = await screen->getByTestId("blog-wrapper") - await element(wrapper)->toMatchScreenshot("desktop-blog-index") -}) - -test("desktop blog shows category selector", async () => { - await viewport(1440, 900) - - let screen = await render( - -
- -
-
, - ) - let allTab = await screen->getByText("All") await element(allTab)->toBeVisible @@ -96,18 +81,18 @@ test("desktop blog shows category selector", async () => { await element(archivedTab)->toBeVisible let wrapper = await screen->getByTestId("blog-wrapper") - await element(wrapper)->toMatchScreenshot("desktop-blog-category-selector") + await element(wrapper)->toMatchScreenshot("desktop-blog-index") }) test("mobile blog index", async () => { await viewport(600, 1200) let screen = await render( - +
-
, + , ) let featured = await screen->getByText("Announcing ReScript 12") @@ -121,11 +106,11 @@ test("blog shows empty state when no posts", async () => { await viewport(1440, 900) let screen = await render( - +
-
, + , ) let emptyMsg = await screen->getByText("Blog not yet available") @@ -170,11 +155,11 @@ test("desktop blog shows archived posts", async () => { await viewport(1440, 900) let screen = await render( - +
-
, + , ) let post1 = await screen->getByText("An Old Archived Post") @@ -208,11 +193,11 @@ test("desktop blog with single post", async () => { ] let screen = await render( - +
-
, + , ) let post = await screen->getByText("The Only Post") diff --git a/apps/docs/__tests__/visual/CodeExample_.test.res b/apps/docs/__tests__/visual/CodeExample_.test.res index 2497fb025..6ddd0e527 100644 --- a/apps/docs/__tests__/visual/CodeExample_.test.res +++ b/apps/docs/__tests__/visual/CodeExample_.test.res @@ -62,11 +62,11 @@ test("renders toggle with multiple tabs", async () => { ] let screen = await render( - +
-
, + , ) let resTab = await screen->getByText("ReScript") @@ -98,11 +98,11 @@ test("toggle switches between tabs on click", async () => { ] let screen = await render( - +
-
, + , ) // Click the JavaScript tab diff --git a/apps/docs/__tests__/visual/CommunityLayout_.test.res b/apps/docs/__tests__/visual/CommunityLayout_.test.res index dbbe7cb7f..1a288854b 100644 --- a/apps/docs/__tests__/visual/CommunityLayout_.test.res +++ b/apps/docs/__tests__/visual/CommunityLayout_.test.res @@ -21,13 +21,13 @@ test("desktop community layout shows sidebar and content", async () => { await viewport(1440, 900) let screen = await render( - +
{React.string("Community content goes here.")}
-
, + , ) let resources = await screen->getByText("Resources") @@ -47,13 +47,13 @@ test("mobile community layout hides sidebar", async () => { await viewport(600, 1200) let screen = await render( - +
{React.string("Community content goes here.")}
-
, + , ) let resources = await screen->getByText("Resources") @@ -87,13 +87,13 @@ test("desktop community layout with multiple categories", async () => { await viewport(1440, 900) let screen = await render( - +
{React.string("Community content with multiple categories.")}
-
, + , ) let resources = await screen->getByText("Resources") @@ -113,13 +113,13 @@ test("tablet community layout", async () => { await viewport(900, 900) let screen = await render( - +
{React.string("Community content goes here.")}
-
, + , ) let resources = await screen->getByText("Resources") diff --git a/apps/docs/__tests__/visual/DocsLayout_.test.res b/apps/docs/__tests__/visual/DocsLayout_.test.res index 79d2a8d0b..94e2fc25a 100644 --- a/apps/docs/__tests__/visual/DocsLayout_.test.res +++ b/apps/docs/__tests__/visual/DocsLayout_.test.res @@ -28,7 +28,7 @@ let mockToc: TableOfContents.t = { ], } -test("desktop docs layout shows sidebar with categories", async () => { +test("desktop docs layout shows categories and active-page table of contents", async () => { await viewport(1440, 900) let screen = await render( @@ -50,38 +50,19 @@ test("desktop docs layout shows sidebar with categories", async () => { let introItem = await screen->getByText("Introduction") await element(introItem)->toBeVisible - let mainContent = await screen->getByTestId("side-layout-children") - await element(mainContent)->toBeVisible - - let wrapper = await screen->getByTestId("docs-layout-wrapper") - await element(wrapper)->toMatchScreenshot("desktop-docs-layout") -}) - -test("desktop docs layout shows table of contents entries", async () => { - await viewport(1440, 900) - - let screen = await render( - -
- -
{React.string("This is the documentation content.")}
-
-
-
, - ) - - // The TOC entries render inside the sidebar under the active nav item. - // Since the test isn't at a matching route, the TOC appears for the first - // category item that matches the current location. Verify the layout - // renders with the activeToc data by checking sidebar and content are present. - let overviewHeading = await screen->getByText("Overview") - await element(overviewHeading)->toBeVisible + let sidebar = await screen->getByTestId("sidebar-content") + for i in 0 to Array.length(mockToc.entries) - 1 { + let {TableOfContents.header: header, href} = mockToc.entries->Array.getUnsafe(i) + let tocLink = await sidebar->getByText(header) + await element(tocLink)->toBeVisible + await element(tocLink)->toHaveAttribute("href", "/docs/manual/introduction" ++ href) + } let mainContent = await screen->getByTestId("side-layout-children") await element(mainContent)->toBeVisible let wrapper = await screen->getByTestId("docs-layout-wrapper") - await element(wrapper)->toMatchScreenshot("desktop-docs-layout-with-toc") + await element(wrapper)->toMatchScreenshot("desktop-docs-layout") }) test("mobile docs layout hides sidebar by default", async () => { diff --git a/apps/docs/__tests__/visual/DocsOverview_.test.res b/apps/docs/__tests__/visual/DocsOverview_.test.res index b8e6eb05f..97a79fc70 100644 --- a/apps/docs/__tests__/visual/DocsOverview_.test.res +++ b/apps/docs/__tests__/visual/DocsOverview_.test.res @@ -24,21 +24,6 @@ test("desktop docs overview shows all section cards", async () => { let tools = await screen->getByText("Tools") await element(tools)->toBeVisible - let wrapper = await screen->getByTestId("docs-overview-wrapper") - await element(wrapper)->toMatchScreenshot("desktop-docs-overview") -}) - -test("desktop docs overview shows ecosystem links", async () => { - await viewport(1440, 900) - - let screen = await render( - -
- -
-
, - ) - let packageIndex = await screen->getByText("Package Index") await element(packageIndex)->toBeVisible @@ -46,7 +31,7 @@ test("desktop docs overview shows ecosystem links", async () => { await element(rescriptReact)->toBeVisible let wrapper = await screen->getByTestId("docs-overview-wrapper") - await element(wrapper)->toMatchScreenshot("desktop-docs-overview-ecosystem") + await element(wrapper)->toMatchScreenshot("desktop-docs-overview") }) test("mobile docs overview", async () => { diff --git a/apps/docs/__tests__/visual/Footer_.test.res b/apps/docs/__tests__/visual/Footer_.test.res index 9d20af2ea..f50fe9ffe 100644 --- a/apps/docs/__tests__/visual/Footer_.test.res +++ b/apps/docs/__tests__/visual/Footer_.test.res @@ -5,11 +5,11 @@ test("desktop footer shows all sections and links", async () => { await viewport(1440, 500) let screen = await render( - +
-
, + , ) let community = await screen->getByText("Community") @@ -35,11 +35,11 @@ test("mobile footer stacks sections vertically", async () => { await viewport(600, 800) let screen = await render( - +
-
, + , ) let community = await screen->getByText("Community") diff --git a/apps/docs/__tests__/visual/LandingPage_.test.res b/apps/docs/__tests__/visual/LandingPage_.test.res index fd8d8aabc..cbab54d93 100644 --- a/apps/docs/__tests__/visual/LandingPage_.test.res +++ b/apps/docs/__tests__/visual/LandingPage_.test.res @@ -6,7 +6,7 @@ let snapshotSection = async (~width, ~height, ~sectionTestId, ~screenshotName) = let screen = await render( - + , ) @@ -20,10 +20,6 @@ let snapshotSection = async (~width, ~height, ~sectionTestId, ~screenshotName) = if sectionTestId == "landing-other-selling-points" { let sourceSelector = `[data-testid="${sectionTestId}"]` await TestUtils.waitForImages(sourceSelector) - // Headless UI's appear transition mutates classes after first render. Since - // these tests snapshot a cloned outerHTML string, wait for the live section - // to settle so the clone does not preserve a transient opacity-0 state. - await TestUtils.sleep(1100) } let sandboxTestId = `${sectionTestId}-snapshot` diff --git a/apps/docs/__tests__/visual/MainLayout_.test.res b/apps/docs/__tests__/visual/MainLayout_.test.res index 670d180c0..2b8154cff 100644 --- a/apps/docs/__tests__/visual/MainLayout_.test.res +++ b/apps/docs/__tests__/visual/MainLayout_.test.res @@ -5,13 +5,13 @@ test("desktop main layout renders children and footer", async () => { await viewport(1440, 900) let screen = await render( - +
{React.string("Main page content goes here.")}
-
, + , ) let content = await screen->getByTestId("main-content") @@ -28,13 +28,13 @@ test("mobile main layout", async () => { await viewport(600, 1200) let screen = await render( - +
{React.string("Main page content goes here.")}
-
, + , ) let content = await screen->getByTestId("main-content") diff --git a/apps/docs/__tests__/visual/MarkdownComponents_.test.res b/apps/docs/__tests__/visual/MarkdownComponents_.test.res index 7976d557f..63140ba67 100644 --- a/apps/docs/__tests__/visual/MarkdownComponents_.test.res +++ b/apps/docs/__tests__/visual/MarkdownComponents_.test.res @@ -171,7 +171,7 @@ test("renders links", async () => { await viewport(1440, 900) let screen = await render( - +
@@ -184,7 +184,7 @@ test("renders links", async () => {
-
, + , ) let externalLink = await screen->getByText("External link") @@ -246,11 +246,7 @@ test("renders inline code", async () => {
{React.string("Use ")} - - {React.string("Array.map")} - + {React.string("Array.map")} {React.string(" to transform elements.")}
, @@ -258,6 +254,13 @@ test("renders inline code", async () => { let code = await screen->getByText("Array.map") await element(code)->toBeVisible + await element(code)->toHaveClass("md-inline-code") + await element(code)->toHaveClass("font-mono") + + switch document->WebAPI.Document.querySelector("[data-testid='inline-code-wrapper'] p > code") { + | Value(_) => () + | Null => failwith("expected Markdown.Code to render inline code inside the paragraph") + } let wrapper = await screen->getByTestId("inline-code-wrapper") await element(wrapper)->toMatchScreenshot("markdown-inline-code") diff --git a/apps/docs/__tests__/visual/NavbarPrimary_.test.res b/apps/docs/__tests__/visual/NavbarPrimary_.test.res index 23c7b50e3..5d8f2025f 100644 --- a/apps/docs/__tests__/visual/NavbarPrimary_.test.res +++ b/apps/docs/__tests__/visual/NavbarPrimary_.test.res @@ -5,9 +5,9 @@ test("desktop has everything visible", async () => { await viewport(1440, 500) let screen = await render( - + - , + , ) let leftContent = await screen->getByTestId("navbar-primary-left-content") @@ -33,9 +33,9 @@ test("tablet has everything visible", async () => { await viewport(900, 500) let screen = await render( - + - , + , ) let leftContent = await screen->getByTestId("navbar-primary-left-content") @@ -61,9 +61,9 @@ test("phone has some things hidden and a mobile nav that can be toggled", async await viewport(600, 1200) let screen = await render( - + - , + , ) let leftContent = await screen->getByTestId("navbar-primary-left-content") diff --git a/apps/docs/__tests__/visual/NavbarTertiary_.test.res b/apps/docs/__tests__/visual/NavbarTertiary_.test.res index 015c6d11e..ba8daf6df 100644 --- a/apps/docs/__tests__/visual/NavbarTertiary_.test.res +++ b/apps/docs/__tests__/visual/NavbarTertiary_.test.res @@ -19,12 +19,12 @@ test("desktop shows breadcrumbs and edit link", async () => { await viewport(1440, 500) let screen = await render( - + breadcrumbs editLink - , + , ) let navbar = await screen->getByTestId("navbar-tertiary") @@ -44,12 +44,12 @@ test("mobile shows breadcrumbs and drawer button", async () => { await viewport(600, 1200) let screen = await render( - + breadcrumbs editLink - , + , ) let navbar = await screen->getByTestId("navbar-tertiary") diff --git a/apps/docs/__tests__/visual/SidebarNav_.test.res b/apps/docs/__tests__/visual/SidebarNav_.test.res index 94303a657..70c5906f0 100644 --- a/apps/docs/__tests__/visual/SidebarNav_.test.res +++ b/apps/docs/__tests__/visual/SidebarNav_.test.res @@ -14,11 +14,11 @@ test("sidebar category renders title and nav items", async () => { await viewport(1440, 900) let screen = await render( - +
()} />
-
, + , ) let introduction = await screen->getByText("Introduction") @@ -38,7 +38,7 @@ test("sidebar category highlights active item", async () => { await viewport(1440, 900) let screen = await render( - +
{ onClick={_ => ()} />
-
, + , ) let introduction = await screen->getByText("Introduction") @@ -117,11 +117,11 @@ test("sidebar category with many items", async () => { } let screen = await render( - +
()} />
-
, + , ) let stringItem = await screen->getByText("String") diff --git a/apps/docs/__tests__/visual/SyntaxLookup_.test.res b/apps/docs/__tests__/visual/SyntaxLookup_.test.res index 38b3bb864..734382feb 100644 --- a/apps/docs/__tests__/visual/SyntaxLookup_.test.res +++ b/apps/docs/__tests__/visual/SyntaxLookup_.test.res @@ -40,15 +40,15 @@ let mockItems: array = [ }, ] -test("desktop syntax lookup renders categories and tags", async () => { +test("desktop syntax lookup renders categories and styles deprecated tags", async () => { await viewport(1440, 900) let screen = await render( - +
-
, + , ) let decoratorsHeading = await screen->getByText("Decorators") @@ -63,6 +63,22 @@ test("desktop syntax lookup renders categories and tags", async () => { let operatorsHeading = await screen->getByText("Operators") await element(operatorsHeading)->toBeVisible + let deprecatedTag = await screen->getByText("|>") + await element(deprecatedTag)->toBeVisible + await element(deprecatedTag)->toHaveClass("line-through") + + let deprecatedLink = switch document->WebAPI.Document.querySelector( + "a[href='/syntax-lookup/operators_deprecated_pipe']", + ) { + | Value(link) => link + | Null => failwith("expected a link for the deprecated pipe operator") + } + expect( + getComputedStyle(~elt=deprecatedLink)->WebAPI.CSSStyleDeclaration.getPropertyValue( + "text-decoration-line", + ), + )->toBe("line-through") + let wrapper = await screen->getByTestId("syntax-lookup-wrapper") await element(wrapper)->toMatchScreenshot("desktop-syntax-lookup") }) @@ -71,13 +87,13 @@ test("desktop syntax lookup with active item shows detail box", async () => { await viewport(1440, 900) let screen = await render( - +
Array.getUnsafe(0)}>
{React.string("Detail content for @as decorator.")}
-
, + , ) let detail = await screen->getByText("Detail content for @as decorator.") @@ -91,11 +107,11 @@ test("mobile syntax lookup", async () => { await viewport(600, 1200) let screen = await render( - +
-
, + , ) let decoratorsHeading = await screen->getByText("Decorators") @@ -114,35 +130,17 @@ test("mobile syntax lookup", async () => { await element(wrapper)->toMatchScreenshot("mobile-syntax-lookup") }) -test("deprecated items show with line-through styling", async () => { - await viewport(1440, 900) - - let screen = await render( - -
- -
-
, - ) - - let deprecatedTag = await screen->getByText("|>") - await element(deprecatedTag)->toBeVisible - - let wrapper = await screen->getByTestId("syntax-lookup-wrapper") - await element(wrapper)->toMatchScreenshot("desktop-syntax-lookup-deprecated") -}) - test("syntax lookup detail box shows summary", async () => { await viewport(1440, 900) let screen = await render( - +
Array.getUnsafe(2)}>
{React.string("Detailed documentation about the pipe operator.")}
-
, + , ) let detail = await screen->getByText("Detailed documentation about the pipe operator.") @@ -156,13 +154,13 @@ test("mobile syntax lookup with active item", async () => { await viewport(600, 1200) let screen = await render( - +
Array.getUnsafe(0)}>
{React.string("Detail content for @as decorator.")}
-
, + , ) let detail = await screen->getByText("Detail content for @as decorator.") diff --git a/apps/docs/__tests__/visual/__screenshots__/ApiLayout_.test.jsx/api-old-docs-warning-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/ApiLayout_.test.jsx/api-old-docs-warning-chromium-linux.png deleted file mode 100644 index a2747703c..000000000 Binary files a/apps/docs/__tests__/visual/__screenshots__/ApiLayout_.test.jsx/api-old-docs-warning-chromium-linux.png and /dev/null differ diff --git a/apps/docs/__tests__/visual/__screenshots__/ApiLayout_.test.jsx/desktop-api-layout-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/ApiLayout_.test.jsx/desktop-api-layout-chromium-linux.png deleted file mode 100644 index 26d30b972..000000000 Binary files a/apps/docs/__tests__/visual/__screenshots__/ApiLayout_.test.jsx/desktop-api-layout-chromium-linux.png and /dev/null differ diff --git a/apps/docs/__tests__/visual/__screenshots__/ApiLayout_.test.jsx/mobile-api-layout-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/ApiLayout_.test.jsx/mobile-api-layout-chromium-linux.png deleted file mode 100644 index b44221c1f..000000000 Binary files a/apps/docs/__tests__/visual/__screenshots__/ApiLayout_.test.jsx/mobile-api-layout-chromium-linux.png and /dev/null differ diff --git a/apps/docs/__tests__/visual/__screenshots__/ApiOverviewLayout_.test.jsx/desktop-api-overview-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/ApiOverviewLayout_.test.jsx/desktop-api-overview-chromium-linux.png index 0de5da7a6..632c19aac 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/ApiOverviewLayout_.test.jsx/desktop-api-overview-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/ApiOverviewLayout_.test.jsx/desktop-api-overview-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/ApiOverviewLayout_.test.jsx/desktop-api-overview-with-content-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/ApiOverviewLayout_.test.jsx/desktop-api-overview-with-content-chromium-linux.png index 0a40957b6..57149f3ff 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/ApiOverviewLayout_.test.jsx/desktop-api-overview-with-content-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/ApiOverviewLayout_.test.jsx/desktop-api-overview-with-content-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/ApiOverviewLayout_.test.jsx/mobile-api-overview-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/ApiOverviewLayout_.test.jsx/mobile-api-overview-chromium-linux.png index 7a21c4483..a44498f00 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/ApiOverviewLayout_.test.jsx/mobile-api-overview-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/ApiOverviewLayout_.test.jsx/mobile-api-overview-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/ApiOverviewLayout_.test.jsx/tablet-api-overview-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/ApiOverviewLayout_.test.jsx/tablet-api-overview-chromium-linux.png index 641b0bcac..fef34a0a3 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/ApiOverviewLayout_.test.jsx/tablet-api-overview-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/ApiOverviewLayout_.test.jsx/tablet-api-overview-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Banner_.test.jsx/banner-with-content-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/Banner_.test.jsx/banner-with-content-chromium-linux.png index 9efa58ea3..f7b817fa6 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/Banner_.test.jsx/banner-with-content-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/Banner_.test.jsx/banner-with-content-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-archived-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-archived-chromium-linux.png index ff9ea9924..f9458eeb9 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-archived-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-archived-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-chromium-linux.png index b4b4be9c4..ae018759d 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-coauthors-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-coauthors-chromium-linux.png index d83b793c5..e95c776b5 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-coauthors-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-coauthors-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-no-description-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-no-description-chromium-linux.png index edbe79698..cfdc51945 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-no-description-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-no-description-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-with-image-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-with-image-chromium-linux.png index c69311fb7..a07820499 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-with-image-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/desktop-blog-article-with-image-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/mobile-blog-article-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/mobile-blog-article-chromium-linux.png index 65e38b18b..86aa1d56f 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/mobile-blog-article-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/BlogArticle_.test.jsx/mobile-blog-article-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-archived-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-archived-chromium-linux.png index a90098f6e..e4d9220ca 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-archived-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-archived-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-category-selector-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-category-selector-chromium-linux.png deleted file mode 100644 index 40ef6c563..000000000 Binary files a/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-category-selector-chromium-linux.png and /dev/null differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-empty-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-empty-chromium-linux.png index 8572354f5..0e5842929 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-empty-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-empty-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-index-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-index-chromium-linux.png index 40ef6c563..0057eda32 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-index-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-index-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-single-post-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-single-post-chromium-linux.png index c2790533f..7d45a68ab 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-single-post-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/desktop-blog-single-post-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/mobile-blog-index-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/mobile-blog-index-chromium-linux.png index 18a6f1286..e353424c1 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/mobile-blog-index-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/Blog_.test.jsx/mobile-blog-index-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Breadcrumbs_.test.jsx/sidebar-breadcrumbs-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/Breadcrumbs_.test.jsx/sidebar-breadcrumbs-chromium-linux.png index d3fddde22..52cf36f4a 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/Breadcrumbs_.test.jsx/sidebar-breadcrumbs-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/Breadcrumbs_.test.jsx/sidebar-breadcrumbs-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Breadcrumbs_.test.jsx/sidebar-breadcrumbs-deep-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/Breadcrumbs_.test.jsx/sidebar-breadcrumbs-deep-chromium-linux.png index a28c1ef26..da969b0c4 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/Breadcrumbs_.test.jsx/sidebar-breadcrumbs-deep-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/Breadcrumbs_.test.jsx/sidebar-breadcrumbs-deep-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Button_.test.jsx/button-primary-blue-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/Button_.test.jsx/button-primary-blue-chromium-linux.png index 3e12d3c11..cbf5254ea 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/Button_.test.jsx/button-primary-blue-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/Button_.test.jsx/button-primary-blue-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Button_.test.jsx/button-primary-red-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/Button_.test.jsx/button-primary-red-chromium-linux.png index c75d540fd..d268d185d 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/Button_.test.jsx/button-primary-red-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/Button_.test.jsx/button-primary-red-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Button_.test.jsx/button-secondary-red-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/Button_.test.jsx/button-secondary-red-chromium-linux.png index 9dd6f1c29..82cec8ba0 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/Button_.test.jsx/button-secondary-red-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/Button_.test.jsx/button-secondary-red-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Button_.test.jsx/button-small-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/Button_.test.jsx/button-small-chromium-linux.png index 713da162f..c997f3cd1 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/Button_.test.jsx/button-small-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/Button_.test.jsx/button-small-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-example-highlighted-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-example-highlighted-chromium-linux.png index a4c63f0cd..915afacac 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-example-highlighted-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-example-highlighted-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-example-no-label-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-example-no-label-chromium-linux.png index f7eb775e4..66aaf2f2c 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-example-no-label-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-example-no-label-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-example-rescript-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-example-rescript-chromium-linux.png index 79afabe65..00ce7f80a 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-example-rescript-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-example-rescript-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-toggle-js-selected-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-toggle-js-selected-chromium-linux.png index 145affb31..873cdcef3 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-toggle-js-selected-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-toggle-js-selected-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-toggle-tabs-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-toggle-tabs-chromium-linux.png index dbc4350eb..ca9cec50c 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-toggle-tabs-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/CodeExample_.test.jsx/code-toggle-tabs-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/CommunityLayout_.test.jsx/desktop-community-layout-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/CommunityLayout_.test.jsx/desktop-community-layout-chromium-linux.png index e1c3c2642..a3ae74d12 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/CommunityLayout_.test.jsx/desktop-community-layout-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/CommunityLayout_.test.jsx/desktop-community-layout-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/CommunityLayout_.test.jsx/desktop-community-layout-multi-categories-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/CommunityLayout_.test.jsx/desktop-community-layout-multi-categories-chromium-linux.png index 19b293f8c..1d186cb12 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/CommunityLayout_.test.jsx/desktop-community-layout-multi-categories-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/CommunityLayout_.test.jsx/desktop-community-layout-multi-categories-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/CommunityLayout_.test.jsx/mobile-community-layout-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/CommunityLayout_.test.jsx/mobile-community-layout-chromium-linux.png index e243c27ee..37b0e541e 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/CommunityLayout_.test.jsx/mobile-community-layout-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/CommunityLayout_.test.jsx/mobile-community-layout-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/CommunityLayout_.test.jsx/tablet-community-layout-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/CommunityLayout_.test.jsx/tablet-community-layout-chromium-linux.png index a59195a5a..d81f04a32 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/CommunityLayout_.test.jsx/tablet-community-layout-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/CommunityLayout_.test.jsx/tablet-community-layout-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/desktop-docs-layout-active-item-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/desktop-docs-layout-active-item-chromium-linux.png index 21c6ce57e..f6d17fdd8 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/desktop-docs-layout-active-item-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/desktop-docs-layout-active-item-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/desktop-docs-layout-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/desktop-docs-layout-chromium-linux.png index 43863f45b..a8ff0eaae 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/desktop-docs-layout-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/desktop-docs-layout-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/desktop-docs-layout-pagination-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/desktop-docs-layout-pagination-chromium-linux.png index b3caf7e62..15d44b380 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/desktop-docs-layout-pagination-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/desktop-docs-layout-pagination-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/desktop-docs-layout-with-toc-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/desktop-docs-layout-with-toc-chromium-linux.png deleted file mode 100644 index 7a0259f70..000000000 Binary files a/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/desktop-docs-layout-with-toc-chromium-linux.png and /dev/null differ diff --git a/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/mobile-docs-layout-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/mobile-docs-layout-chromium-linux.png index 2339216c2..ea43c19f8 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/mobile-docs-layout-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/DocsLayout_.test.jsx/mobile-docs-layout-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/DocsOverview_.test.jsx/desktop-docs-overview-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/DocsOverview_.test.jsx/desktop-docs-overview-chromium-linux.png index 48a3c3c69..15688dacb 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/DocsOverview_.test.jsx/desktop-docs-overview-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/DocsOverview_.test.jsx/desktop-docs-overview-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/DocsOverview_.test.jsx/desktop-docs-overview-ecosystem-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/DocsOverview_.test.jsx/desktop-docs-overview-ecosystem-chromium-linux.png deleted file mode 100644 index 48a3c3c69..000000000 Binary files a/apps/docs/__tests__/visual/__screenshots__/DocsOverview_.test.jsx/desktop-docs-overview-ecosystem-chromium-linux.png and /dev/null differ diff --git a/apps/docs/__tests__/visual/__screenshots__/DocsOverview_.test.jsx/mobile-docs-overview-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/DocsOverview_.test.jsx/mobile-docs-overview-chromium-linux.png index ce12209e3..5e2af8000 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/DocsOverview_.test.jsx/mobile-docs-overview-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/DocsOverview_.test.jsx/mobile-docs-overview-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Footer_.test.jsx/desktop-footer-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/Footer_.test.jsx/desktop-footer-chromium-linux.png index 59292cef1..b121af501 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/Footer_.test.jsx/desktop-footer-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/Footer_.test.jsx/desktop-footer-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Footer_.test.jsx/mobile-footer-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/Footer_.test.jsx/mobile-footer-chromium-linux.png index 8f7838e9c..1d2646656 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/Footer_.test.jsx/mobile-footer-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/Footer_.test.jsx/mobile-footer-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-curated-resources-desktop-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-curated-resources-desktop-chromium-linux.png index 611d7bd6a..3ed63e156 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-curated-resources-desktop-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-curated-resources-desktop-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-curated-resources-mobile-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-curated-resources-mobile-chromium-linux.png index d51a5c4ed..c4c2d6d7c 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-curated-resources-mobile-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-curated-resources-mobile-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-curated-resources-tablet-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-curated-resources-tablet-chromium-linux.png index bef337f90..1eb0ce2be 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-curated-resources-tablet-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-curated-resources-tablet-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-intro-desktop-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-intro-desktop-chromium-linux.png index 6354475b9..df7e4c74d 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-intro-desktop-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-intro-desktop-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-intro-mobile-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-intro-mobile-chromium-linux.png index 24612c8b1..d1b9d73b5 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-intro-mobile-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-intro-mobile-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-intro-tablet-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-intro-tablet-chromium-linux.png index 8598a2997..179e37608 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-intro-tablet-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-intro-tablet-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-other-selling-points-desktop-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-other-selling-points-desktop-chromium-linux.png index 61d5acd78..f9668f146 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-other-selling-points-desktop-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-other-selling-points-desktop-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-other-selling-points-mobile-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-other-selling-points-mobile-chromium-linux.png index f94537cbd..bbe012488 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-other-selling-points-mobile-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-other-selling-points-mobile-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-other-selling-points-tablet-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-other-selling-points-tablet-chromium-linux.png index ac7aaaeee..80fbc57b8 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-other-selling-points-tablet-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-other-selling-points-tablet-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-playground-hero-desktop-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-playground-hero-desktop-chromium-linux.png index 6759a1d9a..9fbbf8259 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-playground-hero-desktop-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-playground-hero-desktop-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-playground-hero-mobile-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-playground-hero-mobile-chromium-linux.png index 8dd751a7f..8c24d6f15 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-playground-hero-mobile-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-playground-hero-mobile-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-playground-hero-tablet-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-playground-hero-tablet-chromium-linux.png index 3e7f10b6d..88c498fac 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-playground-hero-tablet-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-playground-hero-tablet-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-quick-install-desktop-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-quick-install-desktop-chromium-linux.png index e37fdf1d0..ddde1e4de 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-quick-install-desktop-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-quick-install-desktop-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-quick-install-mobile-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-quick-install-mobile-chromium-linux.png index f687ccfd9..e5be24a5b 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-quick-install-mobile-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-quick-install-mobile-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-quick-install-tablet-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-quick-install-tablet-chromium-linux.png index 371a4072b..280d20460 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-quick-install-tablet-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-quick-install-tablet-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-trusted-by-desktop-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-trusted-by-desktop-chromium-linux.png index 444e7f7d8..d5a774319 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-trusted-by-desktop-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-trusted-by-desktop-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-trusted-by-mobile-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-trusted-by-mobile-chromium-linux.png index 0c624e042..b919430d1 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-trusted-by-mobile-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-trusted-by-mobile-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-trusted-by-tablet-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-trusted-by-tablet-chromium-linux.png index fe79c3c5e..e109865b8 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-trusted-by-tablet-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/LandingPage_.test.jsx/landing-page-trusted-by-tablet-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/MainLayout_.test.jsx/desktop-main-layout-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/MainLayout_.test.jsx/desktop-main-layout-chromium-linux.png index 2189c313a..d095b7812 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/MainLayout_.test.jsx/desktop-main-layout-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/MainLayout_.test.jsx/desktop-main-layout-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/MainLayout_.test.jsx/mobile-main-layout-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/MainLayout_.test.jsx/mobile-main-layout-chromium-linux.png index 3b41e25e7..0aac6d1e4 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/MainLayout_.test.jsx/mobile-main-layout-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/MainLayout_.test.jsx/mobile-main-layout-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-admonitions-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-admonitions-chromium-linux.png index 7b8821c15..f600dfc57 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-admonitions-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-admonitions-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-anchor-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-anchor-chromium-linux.png index a4a16ddf2..9df13e213 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-anchor-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-anchor-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-blockquote-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-blockquote-chromium-linux.png index 7becb754f..9b2e6d482 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-blockquote-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-blockquote-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-cite-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-cite-chromium-linux.png index efdd94609..c59c583ee 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-cite-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-cite-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-cite-no-author-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-cite-no-author-chromium-linux.png index 239076cf7..6592cbd5f 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-cite-no-author-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-cite-no-author-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-headings-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-headings-chromium-linux.png index 88e6749ec..4319a1dfc 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-headings-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-headings-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-hr-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-hr-chromium-linux.png index cf42ba528..bdd03aa0e 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-hr-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-hr-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-image-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-image-chromium-linux.png index 6d361a284..a6bc2451f 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-image-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-image-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-image-small-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-image-small-chromium-linux.png index 654773dd5..a679d6382 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-image-small-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-image-small-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-inline-code-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-inline-code-chromium-linux.png index 86c248361..b2701ebd1 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-inline-code-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-inline-code-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-links-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-links-chromium-linux.png index 2cbd2707e..5805ba6ae 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-links-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-links-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-lists-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-lists-chromium-linux.png index 6e3d0ab57..3b999993e 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-lists-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-lists-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-nested-lists-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-nested-lists-chromium-linux.png index 0d0db400a..ced2f7b95 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-nested-lists-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-nested-lists-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-strong-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-strong-chromium-linux.png index 1b988b4ee..6668b2752 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-strong-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-strong-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-table-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-table-chromium-linux.png index c3a297951..121571821 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-table-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-table-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-text-elements-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-text-elements-chromium-linux.png index d5f95e028..162f55f5b 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-text-elements-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/MarkdownComponents_.test.jsx/markdown-text-elements-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/NavbarPrimary_.test.jsx/desktop-navbar-primary-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/NavbarPrimary_.test.jsx/desktop-navbar-primary-chromium-linux.png index 9f2555de1..0c77c1046 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/NavbarPrimary_.test.jsx/desktop-navbar-primary-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/NavbarPrimary_.test.jsx/desktop-navbar-primary-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/NavbarPrimary_.test.jsx/mobile-navbar-primary-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/NavbarPrimary_.test.jsx/mobile-navbar-primary-chromium-linux.png index e6b54e021..773893193 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/NavbarPrimary_.test.jsx/mobile-navbar-primary-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/NavbarPrimary_.test.jsx/mobile-navbar-primary-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/NavbarPrimary_.test.jsx/mobile-overlay-navbar-primary-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/NavbarPrimary_.test.jsx/mobile-overlay-navbar-primary-chromium-linux.png index 37f28fd3d..34988008f 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/NavbarPrimary_.test.jsx/mobile-overlay-navbar-primary-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/NavbarPrimary_.test.jsx/mobile-overlay-navbar-primary-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/NavbarSecondary_.test.jsx/desktop-navbar-secondary-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/NavbarSecondary_.test.jsx/desktop-navbar-secondary-chromium-linux.png index ceeb81806..35191fc2f 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/NavbarSecondary_.test.jsx/desktop-navbar-secondary-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/NavbarSecondary_.test.jsx/desktop-navbar-secondary-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/NavbarSecondary_.test.jsx/desktop-navbar-secondary-react-active-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/NavbarSecondary_.test.jsx/desktop-navbar-secondary-react-active-chromium-linux.png index b9e9a6133..1a6ca6200 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/NavbarSecondary_.test.jsx/desktop-navbar-secondary-react-active-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/NavbarSecondary_.test.jsx/desktop-navbar-secondary-react-active-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/NavbarTertiary_.test.jsx/desktop-navbar-tertiary-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/NavbarTertiary_.test.jsx/desktop-navbar-tertiary-chromium-linux.png index a6be3b920..26ef019a0 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/NavbarTertiary_.test.jsx/desktop-navbar-tertiary-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/NavbarTertiary_.test.jsx/desktop-navbar-tertiary-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/NavbarTertiary_.test.jsx/mobile-navbar-tertiary-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/NavbarTertiary_.test.jsx/mobile-navbar-tertiary-chromium-linux.png index 249d18863..844360841 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/NavbarTertiary_.test.jsx/mobile-navbar-tertiary-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/NavbarTertiary_.test.jsx/mobile-navbar-tertiary-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/SearchBox_.test.jsx/searchbox-empty-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/SearchBox_.test.jsx/searchbox-empty-chromium-linux.png index 6e3c1c837..965b78d1b 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/SearchBox_.test.jsx/searchbox-empty-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/SearchBox_.test.jsx/searchbox-empty-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/SearchBox_.test.jsx/searchbox-with-value-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/SearchBox_.test.jsx/searchbox-with-value-chromium-linux.png index 36b3ff6be..c16c0276b 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/SearchBox_.test.jsx/searchbox-with-value-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/SearchBox_.test.jsx/searchbox-with-value-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Search_.test.jsx/markdownToHtml-combined-transformations-bold-inside-code-stays-as-is--code-matched-first--1.png b/apps/docs/__tests__/visual/__screenshots__/Search_.test.jsx/markdownToHtml-combined-transformations-bold-inside-code-stays-as-is--code-matched-first--1.png deleted file mode 100644 index a35891721..000000000 Binary files a/apps/docs/__tests__/visual/__screenshots__/Search_.test.jsx/markdownToHtml-combined-transformations-bold-inside-code-stays-as-is--code-matched-first--1.png and /dev/null differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Search_.test.jsx/markdownToHtml-markdown-link-stripping-handles-link-with-empty-text-1.png b/apps/docs/__tests__/visual/__screenshots__/Search_.test.jsx/markdownToHtml-markdown-link-stripping-handles-link-with-empty-text-1.png deleted file mode 100644 index a35891721..000000000 Binary files a/apps/docs/__tests__/visual/__screenshots__/Search_.test.jsx/markdownToHtml-markdown-link-stripping-handles-link-with-empty-text-1.png and /dev/null differ diff --git a/apps/docs/__tests__/visual/__screenshots__/SidebarNav_.test.jsx/sidebar-category-active-item-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/SidebarNav_.test.jsx/sidebar-category-active-item-chromium-linux.png index a164ae6c9..e9c935a9e 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/SidebarNav_.test.jsx/sidebar-category-active-item-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/SidebarNav_.test.jsx/sidebar-category-active-item-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/SidebarNav_.test.jsx/sidebar-category-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/SidebarNav_.test.jsx/sidebar-category-chromium-linux.png index c1c4cdab3..3aec2fe5f 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/SidebarNav_.test.jsx/sidebar-category-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/SidebarNav_.test.jsx/sidebar-category-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/SidebarNav_.test.jsx/sidebar-category-many-items-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/SidebarNav_.test.jsx/sidebar-category-many-items-chromium-linux.png index ee247dab5..37ca98002 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/SidebarNav_.test.jsx/sidebar-category-many-items-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/SidebarNav_.test.jsx/sidebar-category-many-items-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/SidebarNav_.test.jsx/sidebar-category-with-toc-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/SidebarNav_.test.jsx/sidebar-category-with-toc-chromium-linux.png index 9e27eef58..545390594 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/SidebarNav_.test.jsx/sidebar-category-with-toc-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/SidebarNav_.test.jsx/sidebar-category-with-toc-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/desktop-syntax-lookup-active-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/desktop-syntax-lookup-active-chromium-linux.png index b0664ff31..1259a14a5 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/desktop-syntax-lookup-active-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/desktop-syntax-lookup-active-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/desktop-syntax-lookup-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/desktop-syntax-lookup-chromium-linux.png index 2d77ab3a6..a3c7b34e2 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/desktop-syntax-lookup-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/desktop-syntax-lookup-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/desktop-syntax-lookup-deprecated-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/desktop-syntax-lookup-deprecated-chromium-linux.png deleted file mode 100644 index 2d77ab3a6..000000000 Binary files a/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/desktop-syntax-lookup-deprecated-chromium-linux.png and /dev/null differ diff --git a/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/desktop-syntax-lookup-pipe-detail-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/desktop-syntax-lookup-pipe-detail-chromium-linux.png index 21f7f7b4c..9f059655b 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/desktop-syntax-lookup-pipe-detail-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/desktop-syntax-lookup-pipe-detail-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/mobile-syntax-lookup-active-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/mobile-syntax-lookup-active-chromium-linux.png index 9db6237f5..3d71aaf16 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/mobile-syntax-lookup-active-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/mobile-syntax-lookup-active-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/mobile-syntax-lookup-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/mobile-syntax-lookup-chromium-linux.png index 0fdfad76d..effd7d2fc 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/mobile-syntax-lookup-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/SyntaxLookup_.test.jsx/mobile-syntax-lookup-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Tag_.test.jsx/tag-subtle-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/Tag_.test.jsx/tag-subtle-chromium-linux.png index 3d94db1ce..1d7ab27fa 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/Tag_.test.jsx/tag-subtle-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/Tag_.test.jsx/tag-subtle-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Tag_.test.jsx/tags-multiple-chromium-linux.png b/apps/docs/__tests__/visual/__screenshots__/Tag_.test.jsx/tags-multiple-chromium-linux.png index c76fad15f..e4b1d0b08 100644 Binary files a/apps/docs/__tests__/visual/__screenshots__/Tag_.test.jsx/tags-multiple-chromium-linux.png and b/apps/docs/__tests__/visual/__screenshots__/Tag_.test.jsx/tags-multiple-chromium-linux.png differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Url_.test.jsx/Url-parse-version-detection-parses-next-keyword-1.png b/apps/docs/__tests__/visual/__screenshots__/Url_.test.jsx/Url-parse-version-detection-parses-next-keyword-1.png deleted file mode 100644 index a35891721..000000000 Binary files a/apps/docs/__tests__/visual/__screenshots__/Url_.test.jsx/Url-parse-version-detection-parses-next-keyword-1.png and /dev/null differ diff --git a/apps/docs/__tests__/visual/__screenshots__/Url_.test.jsx/Url-parse-version-detection-parses-version-without-v-prefix--PR--1231--1.png b/apps/docs/__tests__/visual/__screenshots__/Url_.test.jsx/Url-parse-version-detection-parses-version-without-v-prefix--PR--1231--1.png deleted file mode 100644 index a35891721..000000000 Binary files a/apps/docs/__tests__/visual/__screenshots__/Url_.test.jsx/Url-parse-version-detection-parses-version-without-v-prefix--PR--1231--1.png and /dev/null differ diff --git a/apps/docs/app/DocsRoot.res b/apps/docs/app/DocsRoot.res index cbddcf72d..3e38c1f3d 100644 --- a/apps/docs/app/DocsRoot.res +++ b/apps/docs/app/DocsRoot.res @@ -4,47 +4,16 @@ external mainCss: string = "default" @module("../styles/_hljs.css?url") external hljsCss: string = "default" -@module("../styles/utils.css?url") -external utilsCss: string = "default" - -%%raw(` - import hljs from 'highlight.js/lib/core'; - import bash from 'highlight.js/lib/languages/bash'; - import css from 'highlight.js/lib/languages/css'; - import diff from 'highlight.js/lib/languages/diff'; - import javascript from 'highlight.js/lib/languages/javascript'; - import typescript from 'highlight.js/lib/languages/typescript'; - import json from 'highlight.js/lib/languages/json'; - import text from 'highlight.js/lib/languages/plaintext'; - import html from 'highlight.js/lib/languages/xml'; - import toml from 'highlight.js/lib/languages/ini'; - import rescript from 'highlightjs-rescript'; - - hljs.registerLanguage('rescript', rescript) - hljs.registerLanguage('javascript', javascript) - hljs.registerLanguage('css', css) - hljs.registerLanguage('ts', typescript) - hljs.registerLanguage('sh', bash) - hljs.registerLanguage('bash', bash) - hljs.registerLanguage('toml', toml) - hljs.registerLanguage('json', json) - hljs.registerLanguage('text', text) - hljs.registerLanguage('html', html) - hljs.registerLanguage('diff', diff) - hljs.registerLanguage('typescript', typescript) -`) - open ReactRouter @react.component let default = () => { - + {CypressBootstrap.element()} - diff --git a/apps/docs/app/DocsRoot.resi b/apps/docs/app/DocsRoot.resi index aa3387f49..cde121a48 100644 --- a/apps/docs/app/DocsRoot.resi +++ b/apps/docs/app/DocsRoot.resi @@ -1,2 +1,5 @@ -@react.component +/** Shared shell, token styles, and the stable Cypress bootstrap slot. +Runtime grammars belong to content routes and the playground. */ +/** Keep server-rendered content visible; head stylesheets handle render blocking. */ +@react.component @live let default: unit => Jsx.element diff --git a/apps/docs/app/DocsRoutes.res b/apps/docs/app/DocsRoutes.res deleted file mode 100644 index 2992c859f..000000000 --- a/apps/docs/app/DocsRoutes.res +++ /dev/null @@ -1,104 +0,0 @@ -open ReactRouter.Routes - -let stdlibPaths = { - let rawFile = await Node.Fs.readFile("./markdown-pages/docs/api/stdlib.json", "utf-8") - let json = JSON.parseOrThrow(rawFile) - switch json { - | Object(json) => Dict.keysToArray(json) - | _ => [] - } - ->Array.map(key => "docs/manual/api/" ++ key) - ->Array.filter(path => path !== "docs/manual/api/stdlib") -} - -let domPaths = { - let rawFile = await Node.Fs.readFile("./markdown-pages/docs/api/dom.json", "utf-8") - let json = JSON.parseOrThrow(rawFile) - switch json { - | Object(json) => Dict.keysToArray(json) - | _ => [] - } - ->Array.map(key => "docs/manual/api/" ++ key) - ->Array.filter(path => path !== "docs/manual/api/dom") -} - -let beltPaths = { - let rawFile = await Node.Fs.readFile("./markdown-pages/docs/api/belt.json", "utf-8") - let json = JSON.parseOrThrow(rawFile) - switch json { - | Object(json) => Dict.keysToArray(json) - | _ => [] - } - ->Array.map(key => "docs/manual/api/" ++ key) - ->Array.filter(path => path !== "docs/manual/api/belt") -} - -let stdlibRoutes = - stdlibPaths->Array.map(path => route(path, "./routes/ApiRoute.jsx", ~options={id: path})) - -let domRoutes = - domPaths->Array.map(path => route(path, "./routes/ApiRoute.jsx", ~options={id: path})) - -let beltRoutes = - beltPaths->Array.map(path => route(path, "./routes/ApiRoute.jsx", ~options={id: path})) - -let blogArticleRoutes = - MdxFile.scanPaths(~dir="markdown-pages/blog", ~alias="blog")->Array.map(path => - route(path, "./routes/BlogArticleRoute.jsx", ~options={id: path}) - ) - -let docsManualRoutes = - MdxFile.scanPaths(~dir="markdown-pages/docs/manual", ~alias="docs/manual") - ->Array.filter(path => !String.includes(path, "docs/manual/api")) - ->Array.map(path => route(path, "./routes/DocsManualRoute.jsx", ~options={id: path})) - -let docsReactRoutes = - MdxFile.scanPaths(~dir="markdown-pages/docs/react", ~alias="docs/react")->Array.map(path => - route(path, "./routes/DocsReactRoute.jsx", ~options={id: path}) - ) - -let docsGuidesRoutes = - MdxFile.scanPaths(~dir="markdown-pages/docs/guides", ~alias="docs/guides")->Array.map(path => - route(path, "./routes/DocsGuidesRoute.jsx", ~options={id: path}) - ) - -let communityRoutes = - MdxFile.scanPaths(~dir="markdown-pages/community", ~alias="community")->Array.map(path => - route(path, "./routes/CommunityRoute.jsx", ~options={id: path}) - ) - -let syntaxLookupDetailRoutes = - MdxFile.scanPaths(~dir="markdown-pages/syntax-lookup", ~alias="syntax-lookup")->Array.map(path => - route(path, "./routes/SyntaxLookupDetailRoute.jsx", ~options={id: path}) - ) - -let default = [ - index("./routes/LandingPageRoute.jsx"), - route("packages", "./routes/PackagesRoute.jsx"), - route("try", "./routes/TryRoute.jsx"), - route("brand", "./routes/BrandRoute.jsx"), - route("blog", "./routes/BlogRoute.jsx", ~options={id: "blog-index"}), - route("blog/archived", "./routes/BlogRoute.jsx", ~options={id: "blog-archived"}), - ...blogArticleRoutes, - ...communityRoutes, - route("docs", "./routes/DocsOverview.jsx", ~options={id: "docs-overview"}), - layout( - "./layouts/DocsLayoutRoute.jsx", - [ - route("docs/manual/api", "./routes/ApiOverviewRoute.jsx", ~options={id: "api-overview"}), - route("docs/manual/api/stdlib", "./routes/ApiRoute.jsx", ~options={id: "api-stdlib"}), - route("docs/manual/api/introduction", "./routes/ApiRoute.jsx", ~options={id: "api-intro"}), - route("docs/manual/api/belt", "./routes/ApiRoute.jsx", ~options={id: "api-belt"}), - route("docs/manual/api/dom", "./routes/ApiRoute.jsx", ~options={id: "api-dom"}), - ...stdlibRoutes, - ...beltRoutes, - ...domRoutes, - ...docsManualRoutes, - ...docsGuidesRoutes, - ...docsReactRoutes, - route("syntax-lookup", "./routes/SyntaxLookupRoute.jsx", ~options={id: "syntax-lookup"}), - ...syntaxLookupDetailRoutes, - ], - ), - route("*", "./routes/NotFoundRoute.jsx"), -] diff --git a/apps/docs/app/DocsRoutes.resi b/apps/docs/app/DocsRoutes.resi deleted file mode 100644 index 51f6d36ee..000000000 --- a/apps/docs/app/DocsRoutes.resi +++ /dev/null @@ -1,13 +0,0 @@ -let stdlibPaths: array -let domPaths: array -let beltPaths: array -let stdlibRoutes: array -let domRoutes: array -let beltRoutes: array -let blogArticleRoutes: array -let docsManualRoutes: array -let docsReactRoutes: array -let docsGuidesRoutes: array -let communityRoutes: array -let syntaxLookupDetailRoutes: array -let default: array diff --git a/apps/docs/app/entry.client.js b/apps/docs/app/entry.client.js new file mode 100644 index 000000000..09a0112b4 --- /dev/null +++ b/apps/docs/app/entry.client.js @@ -0,0 +1,15 @@ +import { createElement, startTransition, StrictMode } from "react"; +import { createRoot, hydrateRoot } from "react-dom/client"; +import { HydratedRouter } from "react-router/dom"; + +startTransition(() => { + const app = createElement(StrictMode, null, createElement(HydratedRouter)); + if (document.documentElement.hasAttribute("data-static-404")) { + // The static error document was rendered at /404, but Pages serves it at + // any missing URL. Render using the real location instead of hydrating + // URL-dependent markup (such as the active navigation links). + createRoot(document).render(app); + } else { + hydrateRoot(document, app); + } +}); diff --git a/apps/docs/app/entry.server.js b/apps/docs/app/entry.server.js new file mode 100644 index 000000000..f00cc4976 --- /dev/null +++ b/apps/docs/app/entry.server.js @@ -0,0 +1,55 @@ +import React from "react"; +import { renderToReadableStream } from "react-dom/server"; +import { isbot } from "isbot"; +import { ServerRouter } from "react-router"; + +export const streamTimeout = 5_000; + +export default async function handleRequest( + request, + responseStatusCode, + responseHeaders, + routerContext, +) { + responseHeaders.set("Content-Type", "text/html"); + + if (request.method.toUpperCase() === "HEAD") { + return new Response(null, { + status: responseStatusCode, + headers: responseHeaders, + }); + } + + let shellRendered = false; + let userAgent = request.headers.get("user-agent"); + + let body = await renderToReadableStream( + React.createElement(ServerRouter, { + context: routerContext, + url: request.url, + }), + { + signal: AbortSignal.timeout(streamTimeout + 1_000), + onError(error) { + responseStatusCode = 500; + if (shellRendered) { + console.error(error); + } + }, + }, + ); + + shellRendered = true; + + if ( + ((userAgent && isbot(userAgent)) || routerContext.isSpaMode) && + body.allReady + ) { + await body.allReady; + } + + return new Response(body, { + headers: responseHeaders, + status: responseStatusCode, + }); +} diff --git a/apps/docs/app/layouts/ContentLayoutRoute.res b/apps/docs/app/layouts/ContentLayoutRoute.res new file mode 100644 index 000000000..a03d7b926 --- /dev/null +++ b/apps/docs/app/layouts/ContentLayoutRoute.res @@ -0,0 +1,12 @@ +@module("../../styles/content.css?url") +external contentCss: string = "default" + +type stylesheet = {rel: string, href: string} + +let links = () => [{rel: "stylesheet", href: contentCss}] + +// Route-module initialization runs before any content children render. +let () = ContentHighlighting.register(HighlightLanguages.defaultInstance) + +@react.component +let default = () => diff --git a/apps/docs/app/layouts/ContentLayoutRoute.resi b/apps/docs/app/layouts/ContentLayoutRoute.resi new file mode 100644 index 000000000..d11cb3818 --- /dev/null +++ b/apps/docs/app/layouts/ContentLayoutRoute.resi @@ -0,0 +1,8 @@ +type stylesheet = {rel: string, href: string} + +@live +let links: unit => array + +/** Own content styles and runtime highlighting without adding a DOM wrapper. */ +@react.component @live +let default: unit => React.element diff --git a/apps/docs/app/layouts/DocsLayoutRoute.resi b/apps/docs/app/layouts/DocsLayoutRoute.resi index 47fa1ac2e..30cde7b0b 100644 --- a/apps/docs/app/layouts/DocsLayoutRoute.resi +++ b/apps/docs/app/layouts/DocsLayoutRoute.resi @@ -1,2 +1,2 @@ -@react.component +@react.component @live let default: unit => React.element diff --git a/apps/docs/app/layouts/HomepageLayoutRoute.res b/apps/docs/app/layouts/HomepageLayoutRoute.res new file mode 100644 index 000000000..c8bdddb7d --- /dev/null +++ b/apps/docs/app/layouts/HomepageLayoutRoute.res @@ -0,0 +1,9 @@ +@module("../../styles/homepage.css?url") +external homepageCss: string = "default" + +type stylesheet = {rel: string, href: string} + +let links = () => [{rel: "stylesheet", href: homepageCss}] + +@react.component +let default = () => diff --git a/apps/docs/app/layouts/HomepageLayoutRoute.resi b/apps/docs/app/layouts/HomepageLayoutRoute.resi new file mode 100644 index 000000000..61ed8faa7 --- /dev/null +++ b/apps/docs/app/layouts/HomepageLayoutRoute.resi @@ -0,0 +1,8 @@ +type stylesheet = {rel: string, href: string} + +@live +let links: unit => array + +/** Own homepage styles without adding a DOM wrapper. */ +@react.component @live +let default: unit => React.element diff --git a/apps/docs/app/routes.js b/apps/docs/app/routes.js index 7a59de9bb..8fca71115 100644 --- a/apps/docs/app/routes.js +++ b/apps/docs/app/routes.js @@ -1 +1,3 @@ -export { default } from "./DocsRoutes.jsx"; +import { loadRoutes } from "../route-config.mjs"; + +export default loadRoutes().routes; diff --git a/apps/docs/app/routes/ApiDocs.res b/apps/docs/app/routes/ApiDocs.res index 3d5df459b..0b4ea59f3 100644 --- a/apps/docs/app/routes/ApiDocs.res +++ b/apps/docs/app/routes/ApiDocs.res @@ -221,7 +221,7 @@ module MarkdownStylize = { let make = (~content, ~rehypePlugins) => { let components = { ...MarkdownComponents.default, - h2: MarkdownComponents.default.h3->Obj.magic, + h2: props => props.children , } content } @@ -258,7 +258,8 @@ module DocstringsStylize = { } } -@react.componentWithProps +// reanalyze does not see the JSX props spread call in ApiRoute. +@live @react.componentWithProps let make = (props: props) => { let children = { open Markdown @@ -336,45 +337,11 @@ let make = (props: props) => { children } -module Data = { - type t = { - mainModule: Dict.t, - tree: Dict.t, - } - - let dir = try { - Node.Path.resolve("data", "api") - } catch { - | _ => "" - } - - let getVersion = (~moduleName: string) => { - open Node - - let moduleContent = - Fs.readFileSync(`markdown-pages/docs/api/${moduleName}.json`)->JSON.parseOrThrow - - let content = switch moduleContent { - | Object(dict) => dict->Some - | _ => None - } - - switch content { - | Some(content) => Some({mainModule: content, tree: Dict.make()}) - | _ => None - } - } -} - -let processStaticProps = (~slug: array) => { - let moduleName = slug->Belt.Array.getExn(0) +let processStaticProps = (~apiDocs, ~slug: array) => { + let moduleName = slug->Array.at(0)->Option.getOrThrow let modulePath = slug->Array.join("/") - let content = - // TODO post RR7: rename this to getByModuleName - Data.getVersion(~moduleName) - ->Option.map(data => data.mainModule) - ->Option.flatMap(Dict.get(_, modulePath)) + let content = Dict.get(apiDocs, modulePath) switch content { | Some(json) => @@ -456,14 +423,8 @@ let processStaticProps = (~slug: array) => { items: sortedItems, } - Ok({module_, toctree: Obj.magic({name: "root", path: [], children: []})}) + Ok({module_, toctree: {name: "root", path: [], children: []}}) | None => Error(`Failed to get API Data for module ${moduleName}`) } } - -let getStaticProps = async slug => { - let result = processStaticProps(~slug) - - {"props": result} -} diff --git a/apps/docs/app/routes/ApiOverviewRoute.resi b/apps/docs/app/routes/ApiOverviewRoute.resi index 44e515171..6d1265c42 100644 --- a/apps/docs/app/routes/ApiOverviewRoute.resi +++ b/apps/docs/app/routes/ApiOverviewRoute.resi @@ -1,11 +1,11 @@ -let categories: array - type loaderData = { compiledMdx: CompiledMdx.t, title: string, description: string, } +@live let loader: ReactRouter.Loader.t +@live let default: unit => React.element diff --git a/apps/docs/app/routes/ApiRoute.res b/apps/docs/app/routes/ApiRoute.res index d0bdde5d8..f6cd6793f 100644 --- a/apps/docs/app/routes/ApiRoute.res +++ b/apps/docs/app/routes/ApiRoute.res @@ -1,36 +1,39 @@ type loaderData = ApiDocs.props -type rec apiItem = { - id: string, - kind: string, - name: string, - items?: array, - docStrings: array, +let stringField = (fields, key) => { + switch Dict.get(fields, key) { + | Some(JSON.String(value)) => value + | _ => JsError.throwWithMessage(`Invalid API item: missing ${key}`) + } } -let rec rawApiItemToNode = (apiItem: apiItem): ApiDocs.node => { +let rec rawApiItemToNode = (json: JSON.t): ApiDocs.node => { + let fields = switch json { + | Object(fields) => fields + | _ => JsError.throwWithMessage("Invalid API item: expected an object") + } + let items = switch Dict.get(fields, "items") { + | Some(Array(items)) => items + | _ => [] + } { - name: apiItem.name, - path: apiItem.id + name: stringField(fields, "name"), + path: stringField(fields, "id") ->String.split(".") ->Array.filter(segment => segment !== "Stdlib" && segment !== "Belt" && segment !== "Js" && segment !== "Dom" ), - children: apiItem.items - ->Option.map(items => - Array.filter(items, item => - item.id - ->String.split(".") - ->Array.length > 3 - )->Array.map(rawApiItemToNode) + children: items + ->Array.filter(item => + switch item { + | Object(fields) => stringField(fields, "id")->String.split(".")->Array.length > 3 + | _ => false + } ) - ->Option.getOr([]), + ->Array.map(rawApiItemToNode), } } -@scope("JSON") @val -external parseApi: string => Dict.t = "parse" - let groupItems = apiDocs => { let parsedItems = apiDocs @@ -124,30 +127,19 @@ let makeBreadcrumbs = (~prefix: Url.breadcrumb, route: Path.t): list = async args => { let path = WebAPI.URL.make(~url=args.request.url).pathname + ->MdxFile.normalizePathname ->String.replace("/docs/manual/api/", "") ->String.split("/") let basePath = path[0]->Option.getUnsafe - let apiDocs = switch basePath { - | "belt" => parseApi(await Node.Fs.readFile("./markdown-pages/docs/api/belt.json", "utf-8")) - | "dom" => parseApi(await Node.Fs.readFile("./markdown-pages/docs/api/dom.json", "utf-8")) - | _ => parseApi(await Node.Fs.readFile("./markdown-pages/docs/api/stdlib.json", "utf-8")) - } + let apiDocs = ApiData.current()->ApiData.library(basePath) let toctree = groupItems(apiDocs) - let data = { - // TODO POST RR7: refactor this function to only return the module and not the toctree - // or move the toc logic to this function - try { - await ApiDocs.getStaticProps(path) - } catch { - | err => {"props": Error(JSON.stringifyAny(err)->Option.getOr("Error loading API data"))} - } - } + let data = ApiDocs.processStaticProps(~apiDocs, ~slug=path) - data["props"]->Result.map((item): ApiDocs.api => { + data->Result.map((item): ApiDocs.api => { { module_: item.module_, toctree: { diff --git a/apps/docs/app/routes/ApiRoute.resi b/apps/docs/app/routes/ApiRoute.resi index c93fe1897..2f73ea401 100644 --- a/apps/docs/app/routes/ApiRoute.resi +++ b/apps/docs/app/routes/ApiRoute.resi @@ -1,13 +1,8 @@ type loaderData = ApiDocs.props -type rec apiItem = { - id: string, - kind: string, - name: string, - items?: array, - docStrings: array, -} - +/** Loads page content and navigation from the same published compiler dataset. */ +@live let loader: ReactRouter.Loader.t +@live let default: unit => React.element diff --git a/apps/docs/app/routes/BlogArticleRoute.resi b/apps/docs/app/routes/BlogArticleRoute.resi index 40ba9580c..c459baab4 100644 --- a/apps/docs/app/routes/BlogArticleRoute.resi +++ b/apps/docs/app/routes/BlogArticleRoute.resi @@ -4,6 +4,8 @@ type loaderData = { title: string, } +@live let loader: ReactRouter.Loader.t +@live let default: unit => React.element diff --git a/apps/docs/app/routes/BlogRoute.resi b/apps/docs/app/routes/BlogRoute.resi index 34ac9a2a6..d3a21e01a 100644 --- a/apps/docs/app/routes/BlogRoute.resi +++ b/apps/docs/app/routes/BlogRoute.resi @@ -1,6 +1,7 @@ type loaderData = {posts: array, category: Blog.category} +@live let loader: ReactRouter.Loader.t -@react.component +@react.component @live let default: unit => React.element diff --git a/apps/docs/app/routes/BrandRoute.resi b/apps/docs/app/routes/BrandRoute.resi index 5f02c123c..453551df9 100644 --- a/apps/docs/app/routes/BrandRoute.resi +++ b/apps/docs/app/routes/BrandRoute.resi @@ -1 +1,2 @@ +@live let default: unit => React.element diff --git a/apps/docs/app/routes/CommunityRoute.resi b/apps/docs/app/routes/CommunityRoute.resi index 456908ac9..7a46a4347 100644 --- a/apps/docs/app/routes/CommunityRoute.resi +++ b/apps/docs/app/routes/CommunityRoute.resi @@ -7,6 +7,8 @@ type loaderData = { categories: array, } +@live let loader: ReactRouter.Loader.t +@live let default: unit => React.element diff --git a/apps/docs/app/routes/DocsGuidesRoute.resi b/apps/docs/app/routes/DocsGuidesRoute.resi index 6eea0299c..1f083c417 100644 --- a/apps/docs/app/routes/DocsGuidesRoute.resi +++ b/apps/docs/app/routes/DocsGuidesRoute.resi @@ -7,6 +7,8 @@ type loaderData = { filePath: string, } +@live let loader: ReactRouter.Loader.t +@live let default: unit => React.element diff --git a/apps/docs/app/routes/DocsManualRoute.resi b/apps/docs/app/routes/DocsManualRoute.resi index 6eea0299c..1f083c417 100644 --- a/apps/docs/app/routes/DocsManualRoute.resi +++ b/apps/docs/app/routes/DocsManualRoute.resi @@ -7,6 +7,8 @@ type loaderData = { filePath: string, } +@live let loader: ReactRouter.Loader.t +@live let default: unit => React.element diff --git a/apps/docs/app/routes/DocsReactRoute.resi b/apps/docs/app/routes/DocsReactRoute.resi index 6eea0299c..1f083c417 100644 --- a/apps/docs/app/routes/DocsReactRoute.resi +++ b/apps/docs/app/routes/DocsReactRoute.resi @@ -7,6 +7,8 @@ type loaderData = { filePath: string, } +@live let loader: ReactRouter.Loader.t +@live let default: unit => React.element diff --git a/apps/docs/app/routes/LandingPage.res b/apps/docs/app/routes/LandingPage.res index aab1d4bbc..5fbaf7240 100644 --- a/apps/docs/app/routes/LandingPage.res +++ b/apps/docs/app/routes/LandingPage.res @@ -1,723 +1,32 @@ -module Intro = { - @react.component - let make = () => { -
- // We only need this font on the homepage, so we load it here instead of globally to save some bandwidth for users who navigate to other pages directly - -
-

- {React.string("JavaScript Made Simple for Humans and AI")} -

-

- {React.string(`Types > Vibes`)} -

-

- {React.string(`ReScript is a strongly typed language that compiles to clean, - efficient JavaScript that humans and AI tools can read and understand.`)} -

-

- {React.string(`Its fast compiler and static type system keep feedback loops tight, - so you can move quickly with AI assistance while maintaining - confidence as your codebase grows.`)} -

- // Keep the CTA link block-level so the moved top/bottom margins still affect layout after removing its wrapper. - - - -
-
- } -} - -module PlaygroundHero = { - type example = { - res: string, - js: string, - } - - let examples = [ - { - res: `module Button = { - @react.component - let make = (~count) => { - let times = switch count { - | 1 => "once" - | 2 => "twice" - | n => n->Int.toString ++ " times" - } - let text = \`Click me $\{times\}\` - - - } -}`, - js: `import * as JsxRuntime from "react/jsx-runtime"; - -function Playground$Button(props) { - let count = props.count; - let times = count !== 1 ? ( - count !== 2 ? count.toString() + " times" : "twice" - ) : "once"; - let text = "Click me " + times; - return JsxRuntime.jsx("button", { - children: text - }); -} - -let Button = { - make: Playground$Button -}; - -export { - Button, -}`, - }, - ] - - @react.component - let make = () => { - let (example, _setExample) = React.useState(_ => examples->Array.getUnsafe(0)) - - //Playground Section & Background -
-
- // `mx-auto` preserves the removed centering wrapper's max-width behavior for the playground frame. - // Playground widget -
- //Left Side (ReScript) -
-
- {React.string("Write in ReScript")} -
-
-              {HighlightJs.renderHLJS(~darkmode=true, ~code=example.res, ~lang="res", ())}
-            
-
- //Right Side (JavaScript) -
-
- {React.string("Compile to JavaScript")} -
-
-              {HighlightJs.renderHLJS(~darkmode=true, ~code=example.js, ~lang="js", ())}
-            
-
-
- - /* ---Link to Playground--- */ - - {React.string("Edit this example in Playground")} - - // -
- - -
-
- - -
-
-
- } -} - -module QuickInstall = { - module CopyButton = { - let copyToClipboard: string => bool = %raw(` - function(str) { - try { - const el = document.createElement('textarea'); - el.value = str; - el.setAttribute('readonly', ''); - el.style.position = 'absolute'; - el.style.left = '-9999px'; - document.body.appendChild(el); - const selected = - document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : false; - el.select(); - document.execCommand('copy'); - document.body.removeChild(el); - if (selected) { - document.getSelection().removeAllRanges(); - document.getSelection().addRange(selected); - } - return true; - } catch(e) { - return false; - } - } - `) - - type state = - | Init - | Copied - | Failed - - @react.component - let make = (~code) => { - let (state, setState) = React.useState(_ => Init) - - let buttonRef = React.useRef(Nullable.null) - - let onClick = evt => { - ReactEvent.Mouse.preventDefault(evt) - if copyToClipboard(code) { - setState(_ => Copied) - } else { - setState(_ => Failed) - } - } - - React.useEffect(() => { - switch state { - | Copied => - let buttonEl = Nullable.toOption(buttonRef.current)->Option.getOrThrow - - // Note on this imperative DOM nonsense: - // For Tailwind transitions to behave correctly, we need to first paint the DOM element in the tree, - // and in the next tick, add the opacity-100 class, so the transition animation actually takes place. - // If we don't do that, the banner will essentially pop up without any animation - let bannerEl = WebAPI.Document.createElement(document, "div") - bannerEl.className = "foobar opacity-0 absolute top-0 mt-4 -mr-1 px-2 rounded right-0 - bg-turtle text-gray-80-tr body-sm - transition-all duration-500 ease-in-out " - let textNode = WebAPI.Document.createTextNode(document, "Copied!") - - WebAPI.Element.appendChild(bannerEl, textNode)->ignore - WebAPI.Element.appendChild(buttonEl, bannerEl)->ignore - - let nextFrameId = WebAPI.Window.requestAnimationFrame(window, _ => { - WebAPI.DOMTokenList.toggle(bannerEl.classList, ~token="opacity-0")->ignore - WebAPI.DOMTokenList.toggle(bannerEl.classList, ~token="opacity-100")->ignore - }) - - let timeoutId = setTimeout(~handler=() => { - buttonEl->WebAPI.Element.removeChild(bannerEl)->ignore - setState(_ => Init) - }, ~timeout=2000) - - Some( - () => { - cancelAnimationFrame(nextFrameId) - clearTimeout(timeoutId) - }, - ) - | _ => None - } - }, [state]) - - - } - } - - module Instructions = { - let copyBox = text => { -
- {React.string(text)} - -
- } - @react.component - let make = (~className: string="") => { -
-

{React.string("Quick Install")}

-
- {React.string( - "You can quickly add ReScript to your existing JavaScript codebase via npm / yarn:", - )} -
- {copyBox("npm install rescript")} -
- {React.string("Or generate a new project from the official template with npx:")} -
- {copyBox("npx create-rescript-app")} -
- } - } - - @react.component - let make = () => { -
-
- //---Textblock on the left side--- - // Keep the width clamp on the paragraph itself now that the wrapper is gone. -

- - {React.string(`Leverage the full power`)} - - {React.string(` of JavaScript in a robustly typed language without the fear of \`any\` types.`)} -

- //spacing between columns -
-

- {React.string(`ReScript is used to ship and maintain mission-critical products with good UI and UX.`)} -

- // The alignment classes move onto the instructions root so the column still hugs the lower edge without an extra wrapper. - -
-
-
- } -} - -// Main unique selling points -module MainUSP = { - module Item = { - type polygonDirection = Up | Down - - @react.component - let make = ( - ~caption: string, - ~title: React.element, - ~media: React.element=React.string("Placeholder"), - ~polygonDirection: polygonDirection=Down, - ~paragraph: React.element, - ) => { - let polyPointsLg = switch polygonDirection { - | Down => "80,0 85,100 100,100 100,0" - | Up => "85,0 80,100 100,100 100,0" - } - - let polyPointsMobile = switch polygonDirection { - | Down => "0,100 100,100 100,70 0,80" - | Up => "0,100 100,100 100,78 0,72" - } - - let polyColor = switch polygonDirection { - | Up => "text-fire" - | Down => "text-fire-30" - } - -
- // Content -
-
-
{React.string(caption)}
-

title

-
paragraph
-
- //image (right) -
-
- media -
- -
-
- // Mobile SVG - - - - // Tablet / Desktop SVG - - - -
- } - } - - let item1 = - - - } - paragraph={<> -

- {React.string(`ReScript cares about a consistent and fast - feedback loop for any codebase size. Refactor code, pull complex changes, - or switch to feature branches as you please. No sluggish CI builds, stale - caches, wrong type hints, or memory hungry language servers that slow you - down.`)} -

-

- // ReactRouter.Link.to)}> - // - // -

- } - /> - - let item2 = - - {React.string("Type Better")} - } - media={} - polygonDirection=Up - paragraph={React.string(`Every ReScript app is fully typed and provides - reliable type information for any given value in your program. We - prioritize simpler types over complex types for the sake of - clarity and easy debugability. No \`any\`, no magic types, no surprise - \`undefined\`. - `)} - /> - - let item3 = - - {React.string("The familiar JS ecosystem")} - {React.string(" at your fingertips")} - } - media={} - paragraph={React.string(`Use any library from JavaScript, export ReScript - libraries to JavaScript, automatically generate TypeScript types. It's - like you've never left the good parts of JavaScript at all.`)} - /> - - @react.component - let make = () => { -
- item1 - item2 - item3 -
- } -} - -module OtherSellingPoints = { - @react.component - let make = () => { -
- //defines the grid -
- //Large Item -
- -

- {React.string(`A community of programmers who value getting things done`)} -

-

- {React.string(`No language can be popular without a solid - community. A great type system isn't useful if library authors - abuse it. Performance doesn't show if all the libraries are slow. - Join the ReScript community — A group of companies and individuals - who deeply care about simplicity, speed and practicality.`)} -

- // The forum link becomes inline-block so the moved top margin still participates in the card flow. - - - -
- // 2 small items - // Item 2 -
- -

- {React.string(`Tooling that just works out of the box`)} -

-

- {React.string(`A builtin pretty printer, memory friendly - VSCode & Vim plugins, a stable type system and compiler that doesn't require lots - of extra configuration. ReScript brings all the tools you need to - build reliable JavaScript, Node and ReactJS applications.`)} -

-
- // Item 3 -
- -

- {React.string(`Easy to adopt — without any lock-in`)} -

-

- {React.string(`ReScript was made with gradual adoption in mind. If - you ever want to go back to plain JavaScript, just remove all - source files and keep its clean JavaScript output. Tell - your coworkers that your project will keep functioning with or - without ReScript!`)} -

-
- //
- -
- } -} - -module TrustedBy = { - @react.component - let make = () => { - let ourUsersSourcePath = "apps/docs/src/data/OurUsers.res" - -
-

- {React.string("Trusted by our users")} -

-
- {OurUsers.companies - ->Array.map(company => - switch company { - | Logo({name, path, url}) => - - - - } - ) - ->React.array} -
- - - - // The grid image now owns the alignment classes directly because the wrapper only clipped a single child. - -
- } -} - -module CuratedResources = { - type card = { - imgSrc: string, - title: React.element, - descr: string, - href: string, - } - - let cards = [ - { - imgSrc: "/ic_manual@2x.avif", - title: React.string("Language Manual"), - descr: "Look up the basics: Reference for all our language features", - href: "/docs/manual/introduction", - }, - { - imgSrc: "/ic_rescript_react@2x.avif", - title: React.string("ReScript + React"), - descr: "First Class bindings for ReactJS used by production users all over the world.", - href: "/docs/react/introduction", - }, - { - imgSrc: "/ic_manual@2x.avif", - title: React.string("Gradually Adopt ReScript"), - descr: "Learn how to start using ReScript in your current projects. Try before you buy!", - href: "/docs/manual/installation#integrate-into-an-existing-js-project", - }, - { - imgSrc: "/ic_gentype@2x.avif", - title: React.string("TypeScript Integration"), - descr: "Learn how to integrate ReScript in your existing TypeScript codebases.", - href: "/docs/manual/typescript-integration", - }, - ] - - let templates = [ - { - imgSrc: "/nextjs_starter_logo.svg", - title: <> - {React.string("ReScript & ")} - {React.string("NextJS")} - , - descr: "Get started with our NextJS starter template.", - href: "https://github.com/rescript-lang/create-rescript-app/blob/master/templates/rescript-template-nextjs/README.md", - }, - { - imgSrc: "/vitejs_starter_logo.svg", - title: <> - {React.string("ReScript & ")} - {React.string("ViteJS")} - , - descr: "Get started with ViteJS and ReScript.", - href: "https://github.com/rescript-lang/create-rescript-app/blob/master/templates/rescript-template-vite/README.md", - }, - { - imgSrc: "/nodejs_starter_logo.svg", - title: <> - {React.string("ReScript & ")} - - {React.string("NodeJS")} - - , - descr: "Get started with ReScript targeting the Node platform.", - href: "/", - }, - ] - - @react.component - let make = () => { -
- //headline container -
-
- {React.string("Get up and running with ReScript")} -
-

{React.string("Curated resources")}

-
-
-
- {React.string("Guides and Docs")} -
-
-
- - //divider - - //container for guides -
-
- {cards - ->Array.mapWithIndex((card, i) => - - -
{card.title}
-
{React.string(card.descr)}
-
- ) - ->React.array} -
- //Container for templates -
-
- {React.string("Templates")} -
-
-
-
- {templates - ->Array.mapWithIndex((card, i) => - - -
{card.title}
-
{React.string(card.descr)}
-
- ) - ->React.array} -
-
-
- } -} - @react.component -let make = (~components=MarkdownComponents.default) => { - <> - { + <> + - // Keep the inherited typography and stacking context on the absolute shell while removing the inert wrapper chain around the page content. -
- // Enable this when v13 is released - // - // {React.string("ReScript 12 is out! Read the ")} - // - // {React.string("announcement blog post")} - // - // {React.string(".")} - // -
-
-
- -
- - - - - - -
+ keywords=["ReScript", "rescriptlang", "JavaScript", "JS", "TypeScript"] + /> +
+
+
+
+ +
+ + + + + + +
+
+
-
-
- -} + + } diff --git a/apps/docs/app/routes/LandingPage.resi b/apps/docs/app/routes/LandingPage.resi index 65f28d025..5f7c8e3ea 100644 --- a/apps/docs/app/routes/LandingPage.resi +++ b/apps/docs/app/routes/LandingPage.resi @@ -1,2 +1,3 @@ +/** Compose the homepage and opt in to React Compiler for client builds. */ @react.component -let make: (~components: MarkdownComponents.t=?) => React.element +let make: (~playgroundData: LandingPagePlayground.playgroundData) => React.element diff --git a/apps/docs/app/routes/LandingPageRoute.res b/apps/docs/app/routes/LandingPageRoute.res index bf5446708..fd83445f4 100644 --- a/apps/docs/app/routes/LandingPageRoute.res +++ b/apps/docs/app/routes/LandingPageRoute.res @@ -1,5 +1,36 @@ +type fontPreload = { + rel: string, + href: string, + @as("as") as_: string, + @as("type") type_: string, + crossOrigin: string, + media?: string, +} + +let fontPreload = (~media=?, href) => { + rel: "preload", + href, + as_: "font", + type_: "font/woff2", + crossOrigin: "anonymous", + ?media, +} + +let links = () => [ + fontPreload("/fonts/subset-Inter-Regular.woff2"), + fontPreload("/fonts/subset-Inter-SemiBold.woff2"), + fontPreload(~media="(min-width: 1024px)", "/fonts/subset-Inter-Bold.woff2"), + fontPreload("/fonts/red-hat-mono-700.woff2"), +] + +type loaderData = {playgroundData: LandingPagePlayground.playgroundData} + +let loader: ReactRouter.Loader.t = async _ => { + playgroundData: LandingPagePlaygroundLoader.build(), +} + +@react.component let default = () => { - <> - - + let {playgroundData}: loaderData = ReactRouter.useLoaderData() + } diff --git a/apps/docs/app/routes/LandingPageRoute.resi b/apps/docs/app/routes/LandingPageRoute.resi index 5f02c123c..c1ab3df4e 100644 --- a/apps/docs/app/routes/LandingPageRoute.resi +++ b/apps/docs/app/routes/LandingPageRoute.resi @@ -1 +1,21 @@ +type fontPreload = { + rel: string, + href: string, + @as("as") as_: string, + @as("type") type_: string, + crossOrigin: string, + media?: string, +} + +/** Preload above-the-fold faces, including Inter 700 only at the desktop breakpoint. */ +@live +let links: unit => array + +type loaderData = {playgroundData: LandingPagePlayground.playgroundData} + +/** Prerender the fixed example so highlighting and URL compression stay off the client. */ +@live +let loader: ReactRouter.Loader.t + +@react.component @live let default: unit => React.element diff --git a/apps/docs/app/routes/NotFoundRoute.res b/apps/docs/app/routes/NotFoundRoute.res index c594ef16a..7da37901b 100644 --- a/apps/docs/app/routes/NotFoundRoute.res +++ b/apps/docs/app/routes/NotFoundRoute.res @@ -1,24 +1,21 @@ -@react.component -let default = () => { - let {pathname} = ReactRouter.useLocation() - let navigate = ReactRouter.useNavigate() +let loader = async _ => ReactRouter.data(JSON.Null, {status: 404}) - React.useEffect(() => { - if (pathname :> string)->String.includes("/react/") { - navigate("/docs/react/introduction") - } - if (pathname :> string)->String.includes("/docs/") { - navigate("/docs/manual/introduction") - } - None - }, []) +// Pages serves unknown paths from static 404.html. Client navigation does not +// need a server data request to render this page. +let clientLoader = async _ => JSON.Null -
-

{React.string("404")}

-

{React.string("Page Not Found")}

-

{React.string("Oops! The page you're looking for doesn't exist.")}

- - {React.string("Return home")} - -
+@react.component +let default = () => { + <> + {React.string("Page Not Found | ReScript")} + +
+

{React.string("404")}

+

{React.string("Page Not Found")}

+

{React.string("Oops! The page you're looking for doesn't exist.")}

+ + {React.string("Return home")} + +
+ } diff --git a/apps/docs/app/routes/NotFoundRoute.resi b/apps/docs/app/routes/NotFoundRoute.resi index 47fa1ac2e..dbe44edf2 100644 --- a/apps/docs/app/routes/NotFoundRoute.resi +++ b/apps/docs/app/routes/NotFoundRoute.resi @@ -1,2 +1,7 @@ -@react.component +@live +let loader: ReactRouter.Loader.t> +@live +let clientLoader: ReactRouter.Loader.t + +@react.component @live let default: unit => React.element diff --git a/apps/docs/app/routes/Packages.res b/apps/docs/app/routes/Packages.res index c8d2e416c..319501055 100644 --- a/apps/docs/app/routes/Packages.res +++ b/apps/docs/app/routes/Packages.res @@ -112,7 +112,7 @@ module Resource = { let filteredNpm = applyNpmSearch(allNpms, pattern)->Array.map(m => Npm(m["item"])) let filteredOutdated = applyNpmSearch(allOutDated, pattern)->Array.map(m => Outdated(m["item"])) - Belt.Array.concatMany([filteredNpm, filteredOutdated]) + Array.concat(filteredNpm, filteredOutdated) } } @@ -326,7 +326,7 @@ let make = (props: props) => { let allResources = { let npms = props.packages->Array.map(pkg => Resource.Npm(pkg)) let outdated = props.unmaintained->Array.map(pkg => Resource.Outdated(pkg)) - Belt.Array.concatMany([npms, outdated]) + Array.concat(npms, outdated) } let resources = switch state { diff --git a/apps/docs/app/routes/PackagesRoute.resi b/apps/docs/app/routes/PackagesRoute.resi index fc06a02b0..4da28a456 100644 --- a/apps/docs/app/routes/PackagesRoute.resi +++ b/apps/docs/app/routes/PackagesRoute.resi @@ -1,2 +1,4 @@ +@live let loader: unit => promise +@live let default: unit => React.element diff --git a/apps/docs/app/routes/SyntaxLookup.res b/apps/docs/app/routes/SyntaxLookup.res index fdddb1a60..2c88212aa 100644 --- a/apps/docs/app/routes/SyntaxLookup.res +++ b/apps/docs/app/routes/SyntaxLookup.res @@ -51,16 +51,6 @@ module Category = { | _ => Other } } - - @react.component - let make = (~title, ~children) => { -
-

- {React.string(title)} -

-
children
-
- } } module Status = { @@ -119,15 +109,6 @@ module Item = { } } -type itemInfo = { - id: string, - keywords: array, - name: string, - summary: string, - category: Category.t, - status: Status.t, -} - module Tag = { @react.component let make = (~deprecated: bool, ~text: string, ~href) => { @@ -174,40 +155,6 @@ type state = | ShowFiltered(string, array) // (search, filteredItems) | ShowDetails(Item.t) -let scrollToTop = () => WebAPI.Window.scrollTo(window, ~options={left: 0.0, top: 0.0}) - -type params = {slug: string} - -let decode = (json: JSON.t) => { - open JSON - switch json { - | Object(dict{ - "id": String(id), - "keywords": Array(keywords), - "name": String(name), - "summary": String(summary), - "category": String(category), - "status": ?status, - }) => { - id, - name, - summary, - category: Category.fromString(category), - keywords: keywords->Array.filterMap(k => - switch k { - | String(k) => Some(k) - | _ => None - } - ), - status: switch status { - | Some(String(status)) => status->Status.fromString - | _ => Status.Active - }, - } - | _ => throw(Failure(`Failed to decode SyntaxLookup. ${__LOC__}`)) - } -} - type item = { id: string, keywords: array, diff --git a/apps/docs/app/routes/SyntaxLookupDetailRoute.resi b/apps/docs/app/routes/SyntaxLookupDetailRoute.resi index 5436eda52..e6b480cac 100644 --- a/apps/docs/app/routes/SyntaxLookupDetailRoute.resi +++ b/apps/docs/app/routes/SyntaxLookupDetailRoute.resi @@ -6,6 +6,8 @@ type loaderData = { description: string, } +@live let loader: ReactRouter.Loader.t +@live let default: unit => React.element diff --git a/apps/docs/app/routes/SyntaxLookupRoute.resi b/apps/docs/app/routes/SyntaxLookupRoute.resi index fa1131538..e7f2f6f88 100644 --- a/apps/docs/app/routes/SyntaxLookupRoute.resi +++ b/apps/docs/app/routes/SyntaxLookupRoute.resi @@ -1,5 +1,7 @@ type loaderData = {mdxSources: array} +@live let loader: ReactRouter.Loader.t +@live let default: unit => React.element // TODO: move this out of the route file so it can export only a single react component let convert: Mdx.attributes => SyntaxLookup.item diff --git a/apps/docs/app/routes/TryRoute.res b/apps/docs/app/routes/TryRoute.res index d3636e6f6..22785fe5b 100644 --- a/apps/docs/app/routes/TryRoute.res +++ b/apps/docs/app/routes/TryRoute.res @@ -1,3 +1,10 @@ +@module("../../styles/playground.css?url") +external playgroundCss: string = "default" + +type stylesheet = {rel: string, href: string} + +let links = () => [{rel: "stylesheet", href: playgroundCss}] + type props = { bundleBaseUrl: string, versions: array, diff --git a/apps/docs/app/routes/TryRoute.resi b/apps/docs/app/routes/TryRoute.resi index 28764a056..9285f0b75 100644 --- a/apps/docs/app/routes/TryRoute.resi +++ b/apps/docs/app/routes/TryRoute.resi @@ -1,8 +1,15 @@ +type stylesheet = {rel: string, href: string} + +@live +let links: unit => array + type props = { bundleBaseUrl: string, versions: array, } +@live let loader: unit => promise> +@live let default: unit => React.element diff --git a/apps/docs/compilers/README.md b/apps/docs/compilers/README.md deleted file mode 100644 index ceebd0b28..000000000 --- a/apps/docs/compilers/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# compilers - -This folder is needed to install additional rescript compiler versions for testing our documented source code on multiple compiler versions. - -Our `scripts/test-examples.mjs` script will automatically install all package.json dependencies if it cannot find any compiler versions. diff --git a/apps/docs/compilers/dummy/Dummy.res b/apps/docs/compilers/dummy/Dummy.res deleted file mode 100644 index 4992ee3d2..000000000 --- a/apps/docs/compilers/dummy/Dummy.res +++ /dev/null @@ -1 +0,0 @@ -Console.debug("I am a dummy file") diff --git a/apps/docs/compilers/package-lock.json b/apps/docs/compilers/package-lock.json deleted file mode 100644 index 9a20b57aa..000000000 --- a/apps/docs/compilers/package-lock.json +++ /dev/null @@ -1,287 +0,0 @@ -{ - "name": "compilers", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "compilers", - "version": "1.0.0", - "license": "MIT", - "dependencies": { - "@rescript/core": "^1.3.0", - "@rescript/react": "^0.12.0", - "rescript-1000": "npm:rescript@10.0.0", - "rescript-1010": "npm:rescript@10.1.0", - "rescript-1100": "npm:rescript@11.0.0", - "rescript-1110": "npm:rescript@11.1.0", - "rescript-820": "npm:bs-platform@8.2.0", - "rescript-902": "npm:bs-platform@9.0.2", - "rescript-912": "npm:rescript@9.1.2" - } - }, - "node_modules/@rescript/core": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@rescript/core/-/core-1.3.0.tgz", - "integrity": "sha512-wNZOZ63sYcaIYZCmTZeIPCeLa3HCGgPbIOR8zjyNkoBYUlxNV8Nb2ZyqlXR5Mb9ttvv8fTV56JbKhyVEZEYo8g==", - "peerDependencies": { - "rescript": "^11.1.0-rc.7" - } - }, - "node_modules/@rescript/react": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@rescript/react/-/react-0.12.0.tgz", - "integrity": "sha512-EBLsf5rD7sJOjgfLLGwuLw/hONszc3UtYnIVgv7OdTyUNR41/m4deVm62PI0agvr3kWakXz4KchKRSd+19/bRA==", - "peerDependencies": { - "react": ">=18.0.0", - "react-dom": ">=18.0.0" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "peer": true - }, - "node_modules/loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "peer": true, - "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" - }, - "bin": { - "loose-envify": "cli.js" - } - }, - "node_modules/react": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", - "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", - "peer": true, - "dependencies": { - "loose-envify": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-dom": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", - "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", - "peer": true, - "dependencies": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.0" - }, - "peerDependencies": { - "react": "^18.2.0" - } - }, - "node_modules/rescript": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.1.1.tgz", - "integrity": "sha512-FMELeoiR1n3LzBdBt+k7U4l0vsz5Xh0HBSHf+0NhyhzZkMRLkEKEDNrcqZc6RIux9bxmxoO+zEa9qFM01VOXAw==", - "hasInstallScript": true, - "peer": true, - "bin": { - "bsc": "bsc", - "bstracing": "lib/bstracing", - "rescript": "rescript" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/rescript-1000": { - "name": "rescript", - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/rescript/-/rescript-10.0.0.tgz", - "integrity": "sha512-LhNg/4+0j8NvoFeslgAeYLlzUwkq6kR6l6v8BnZ61VDTxopK2l96uT1lq5lv1aMxzMDynvE2qnX0zalre+6XxA==", - "hasInstallScript": true, - "bin": { - "bsc": "bsc", - "bsrefmt": "bsrefmt", - "bstracing": "lib/bstracing", - "rescript": "rescript" - } - }, - "node_modules/rescript-1010": { - "name": "rescript", - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/rescript/-/rescript-10.1.0.tgz", - "integrity": "sha512-85KLtBECo+hYwObbifXk5xpxUCUFMWgCR1w7hDDGhhXIXqEpHQ2ds6o++YPxzXjLuU1/qA7Iovq2zUX4opejQw==", - "hasInstallScript": true, - "bin": { - "bsc": "bsc", - "bsrefmt": "bsrefmt", - "bstracing": "lib/bstracing", - "rescript": "rescript" - } - }, - "node_modules/rescript-1100": { - "name": "rescript", - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.0.0.tgz", - "integrity": "sha512-uIUwDZZmDUb7ymGkBiiGioxMg8hXh1mze/2k/qhYQcZGgi7PrLHQIW9AksM7gb9WnpjCAvFsA8U2VgC0nA468w==", - "hasInstallScript": true, - "bin": { - "bsc": "bsc", - "bstracing": "lib/bstracing", - "rescript": "rescript" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/rescript-1110": { - "name": "rescript", - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.1.0.tgz", - "integrity": "sha512-9la2Dv+ACylQ77I8s4spPu1JnLZXbH5WgxcLHLLUBWgFFSiv0wXqgzWztrBIZqwFgVX5BYcwldUqUVcEzdCyHg==", - "hasInstallScript": true, - "bin": { - "bsc": "bsc", - "bstracing": "lib/bstracing", - "rescript": "rescript" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/rescript-820": { - "name": "bs-platform", - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/bs-platform/-/bs-platform-8.2.0.tgz", - "integrity": "sha512-quvmUac/ZxGDsT7L5+6RNXrLPvLHkWFownacaqlwVoyAm770bPyupTRU49ALPGk3HpjfD5eE+lpGdOSPtuwJiA==" - }, - "node_modules/rescript-902": { - "name": "bs-platform", - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/bs-platform/-/bs-platform-9.0.2.tgz", - "integrity": "sha512-Ye9JqJ4Oa7mcjjoOVRYI8Uc2Cf8N7jQLWDcdUplY7996d/YErSR7WitmV7XnSwr4EvdrbwjEsg1NxNjUQv3ChA==" - }, - "node_modules/rescript-912": { - "name": "rescript", - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/rescript/-/rescript-9.1.2.tgz", - "integrity": "sha512-4wHvTDv3nyYnAPJHcg1RGG8z7u3HDiBf6RN3P/dITDv859Qo35aKOzJWQtfBzbAs0EKNafLqei3TnUqiAv6BwQ==", - "hasInstallScript": true, - "bin": { - "bsc": "bsc", - "bsrefmt": "bsrefmt", - "bstracing": "lib/bstracing", - "rescript": "rescript" - } - }, - "node_modules/scheduler": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", - "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", - "peer": true, - "dependencies": { - "loose-envify": "^1.1.0" - } - } - }, - "dependencies": { - "@rescript/core": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@rescript/core/-/core-1.3.0.tgz", - "integrity": "sha512-wNZOZ63sYcaIYZCmTZeIPCeLa3HCGgPbIOR8zjyNkoBYUlxNV8Nb2ZyqlXR5Mb9ttvv8fTV56JbKhyVEZEYo8g==", - "requires": {} - }, - "@rescript/react": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@rescript/react/-/react-0.12.0.tgz", - "integrity": "sha512-EBLsf5rD7sJOjgfLLGwuLw/hONszc3UtYnIVgv7OdTyUNR41/m4deVm62PI0agvr3kWakXz4KchKRSd+19/bRA==", - "requires": {} - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "peer": true - }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "peer": true, - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } - }, - "react": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", - "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", - "peer": true, - "requires": { - "loose-envify": "^1.1.0" - } - }, - "react-dom": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", - "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", - "peer": true, - "requires": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.0" - } - }, - "rescript": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.1.1.tgz", - "integrity": "sha512-FMELeoiR1n3LzBdBt+k7U4l0vsz5Xh0HBSHf+0NhyhzZkMRLkEKEDNrcqZc6RIux9bxmxoO+zEa9qFM01VOXAw==", - "peer": true - }, - "rescript-1000": { - "version": "npm:rescript@10.0.0", - "resolved": "https://registry.npmjs.org/rescript/-/rescript-10.0.0.tgz", - "integrity": "sha512-LhNg/4+0j8NvoFeslgAeYLlzUwkq6kR6l6v8BnZ61VDTxopK2l96uT1lq5lv1aMxzMDynvE2qnX0zalre+6XxA==" - }, - "rescript-1010": { - "version": "npm:rescript@10.1.0", - "resolved": "https://registry.npmjs.org/rescript/-/rescript-10.1.0.tgz", - "integrity": "sha512-85KLtBECo+hYwObbifXk5xpxUCUFMWgCR1w7hDDGhhXIXqEpHQ2ds6o++YPxzXjLuU1/qA7Iovq2zUX4opejQw==" - }, - "rescript-1100": { - "version": "npm:rescript@11.0.0", - "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.0.0.tgz", - "integrity": "sha512-uIUwDZZmDUb7ymGkBiiGioxMg8hXh1mze/2k/qhYQcZGgi7PrLHQIW9AksM7gb9WnpjCAvFsA8U2VgC0nA468w==" - }, - "rescript-1110": { - "version": "npm:rescript@11.1.0", - "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.1.0.tgz", - "integrity": "sha512-9la2Dv+ACylQ77I8s4spPu1JnLZXbH5WgxcLHLLUBWgFFSiv0wXqgzWztrBIZqwFgVX5BYcwldUqUVcEzdCyHg==" - }, - "rescript-820": { - "version": "npm:bs-platform@8.2.0", - "resolved": "https://registry.npmjs.org/bs-platform/-/bs-platform-8.2.0.tgz", - "integrity": "sha512-quvmUac/ZxGDsT7L5+6RNXrLPvLHkWFownacaqlwVoyAm770bPyupTRU49ALPGk3HpjfD5eE+lpGdOSPtuwJiA==" - }, - "rescript-902": { - "version": "npm:bs-platform@9.0.2", - "resolved": "https://registry.npmjs.org/bs-platform/-/bs-platform-9.0.2.tgz", - "integrity": "sha512-Ye9JqJ4Oa7mcjjoOVRYI8Uc2Cf8N7jQLWDcdUplY7996d/YErSR7WitmV7XnSwr4EvdrbwjEsg1NxNjUQv3ChA==" - }, - "rescript-912": { - "version": "npm:rescript@9.1.2", - "resolved": "https://registry.npmjs.org/rescript/-/rescript-9.1.2.tgz", - "integrity": "sha512-4wHvTDv3nyYnAPJHcg1RGG8z7u3HDiBf6RN3P/dITDv859Qo35aKOzJWQtfBzbAs0EKNafLqei3TnUqiAv6BwQ==" - }, - "scheduler": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", - "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", - "peer": true, - "requires": { - "loose-envify": "^1.1.0" - } - } - } -} diff --git a/apps/docs/compilers/package.json b/apps/docs/compilers/package.json deleted file mode 100644 index 1cf8ac044..000000000 --- a/apps/docs/compilers/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "compilers", - "version": "1.0.0", - "private": true, - "license": "MIT", - "main": "index.js", - "dependencies": { - "@rescript/core": "^1.3.0", - "@rescript/react": "^0.12.0", - "rescript-1000": "npm:rescript@10.0.0", - "rescript-1010": "npm:rescript@10.1.0", - "rescript-1100": "npm:rescript@11.0.0", - "rescript-1110": "npm:rescript@11.1.0", - "rescript-820": "npm:bs-platform@8.2.0", - "rescript-902": "npm:bs-platform@9.0.2", - "rescript-912": "npm:rescript@9.1.2" - } -} diff --git a/apps/docs/compilers/rescript.json b/apps/docs/compilers/rescript.json deleted file mode 100644 index f135476c7..000000000 --- a/apps/docs/compilers/rescript.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "dummy", - "jsx": { "version": 4 }, - "sources": { - "dir": "dummy", - "subdirs": true - }, - "bs-dependencies": ["@rescript/core", "@rescript/react"], - "bsc-flags": ["-open RescriptCore"] -} diff --git a/apps/docs/cypress.config.mjs b/apps/docs/cypress.config.mjs index c18f78711..fbe629e46 100644 --- a/apps/docs/cypress.config.mjs +++ b/apps/docs/cypress.config.mjs @@ -7,8 +7,9 @@ export default defineConfig({ openMode: 0, }, e2e: { - baseUrl: "http://localhost:8080", + baseUrl: "http://localhost:5173", specPattern: "e2e/**/*.cy.jsx", + excludeSpecPattern: "e2e/homepage/**", supportFile: "cypress/support/e2e.js", video: false, screenshotOnRunFailure: false, diff --git a/apps/docs/cypress.homepage.config.mjs b/apps/docs/cypress.homepage.config.mjs new file mode 100644 index 000000000..484a30a2f --- /dev/null +++ b/apps/docs/cypress.homepage.config.mjs @@ -0,0 +1,17 @@ +import { defineConfig } from "cypress"; +import config from "./cypress.config.mjs"; + +export default defineConfig({ + ...config, + viewportWidth: 1440, + viewportHeight: 900, + screenshotsFolder: "test-results/cypress/screenshots", + e2e: { + ...config.e2e, + baseUrl: "http://127.0.0.1:4173", + specPattern: "e2e/homepage/**/*.cy.jsx", + excludeSpecPattern: [], + supportFile: "e2e/homepage/HomepageSupport.jsx", + screenshotOnRunFailure: true, + }, +}); diff --git a/apps/docs/data/api/v12.0.0/stdlib.json b/apps/docs/data/api/v12.0.0/stdlib.json deleted file mode 100644 index 74c6799d1..000000000 --- a/apps/docs/data/api/v12.0.0/stdlib.json +++ /dev/null @@ -1,12715 +0,0 @@ -{ - "stdlib": { - "id": "Stdlib", - "name": "Stdlib", - "docstrings": [], - "items": [ - { - "id": "Stdlib.timeoutId", - "kind": "type", - "name": "timeoutId", - "docstrings": [ - "An `id` representing a timeout started via `setTimeout`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN." - ], - "signature": "type timeoutId = Global.timeoutId" - }, - { - "id": "Stdlib.setTimeout", - "kind": "value", - "name": "setTimeout", - "docstrings": [ - "`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200)\n```" - ], - "signature": "let setTimeout: (unit => unit, int) => timeoutId" - }, - { - "id": "Stdlib.setTimeoutFloat", - "kind": "value", - "name": "setTimeoutFloat", - "docstrings": [ - "`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200.)\n```" - ], - "signature": "let setTimeoutFloat: (unit => unit, float) => timeoutId" - }, - { - "id": "Stdlib.clearTimeout", - "kind": "value", - "name": "clearTimeout", - "docstrings": [ - "`clearTimeout(timeoutId)` clears a scheduled timeout if it hasn't already executed.\n\nSee [`clearTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout) on MDN.\n\n## Examples\n\n```rescript\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 2 seconds.\")\n}, 2000)\n\n// Clearing the timeout right away, before 2 seconds has passed, means that the above callback logging to the console will never run.\nclearTimeout(timeoutId)\n```" - ], - "signature": "let clearTimeout: timeoutId => unit" - }, - { - "id": "Stdlib.intervalId", - "kind": "type", - "name": "intervalId", - "docstrings": [ - "An `id` representing an interval started via `setInterval`.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN." - ], - "signature": "type intervalId = Global.intervalId" - }, - { - "id": "Stdlib.setInterval", - "kind": "value", - "name": "setInterval", - "docstrings": [ - "`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 200 ms (200 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 200 ms.\")\n}, 200)\n\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```" - ], - "signature": "let setInterval: (unit => unit, int) => intervalId" - }, - { - "id": "Stdlib.setIntervalFloat", - "kind": "value", - "name": "setIntervalFloat", - "docstrings": [ - "`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 2 seconds (200 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 200 ms\")\n}, 200.)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeoutFloat(() => {\n clearInterval(intervalId)\n}, 500.0)\n```" - ], - "signature": "let setIntervalFloat: (unit => unit, float) => intervalId" - }, - { - "id": "Stdlib.clearInterval", - "kind": "value", - "name": "clearInterval", - "docstrings": [ - "`clearInterval(intervalId)` clears a scheduled interval.\n\nSee [`clearInterval`](https://developer.mozilla.org/en-US/docs/Web/API/clearInterval) on MDN.\n\n## Examples\n\n```rescript\nlet intervalId = setInterval(() => {\n Console.log(\"This prints in 100 ms\")\n}, 100)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```" - ], - "signature": "let clearInterval: intervalId => unit" - }, - { - "id": "Stdlib.encodeURI", - "kind": "value", - "name": "encodeURI", - "docstrings": [ - "Encodes a URI by replacing characters in the provided string that aren't valid in a URL.\n\nThis is intended to operate on full URIs, so it encodes fewer characters than what `encodeURIComponent` does.\nIf you're looking to encode just parts of a URI, like a query parameter, prefer `encodeURIComponent`.\n\nSee [`encodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI) on MDN.\n\n## Examples\n```rescript\nConsole.log(encodeURI(\"https://rescript-lang.org?array=[someValue]\"))\n// Logs \"https://rescript-lang.org?array=%5BsomeValue%5D\" to the console.\n```" - ], - "signature": "let encodeURI: string => string" - }, - { - "id": "Stdlib.decodeURI", - "kind": "value", - "name": "decodeURI", - "docstrings": [ - "Decodes a previously encoded URI back to a regular string.\n\nThis is intended to operate on full URIs, so it decodes fewer characters than what `decodeURIComponent` does.\nIf you're looking to decode just parts of a URI, like a query parameter, prefer `decodeURIComponent`.\n\nSee [`decodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI) on MDN.\n\n## Examples\n```rescript\nConsole.log(decodeURI(\"https://rescript-lang.org?array=%5BsomeValue%5D\"))\n// Logs \"https://rescript-lang.org?array=[someValue]\" to the console.\n```" - ], - "signature": "let decodeURI: string => string" - }, - { - "id": "Stdlib.encodeURIComponent", - "kind": "value", - "name": "encodeURIComponent", - "docstrings": [ - "Encodes a string so it can be used as part of a URI.\n\nSee [`encodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) on MDN.\n\n## Examples\n```rescript\nConsole.log(encodeURIComponent(\"array=[someValue]\"))\n// Logs \"array%3D%5BsomeValue%5D\" to the console.\n```" - ], - "signature": "let encodeURIComponent: string => string" - }, - { - "id": "Stdlib.decodeURIComponent", - "kind": "value", - "name": "decodeURIComponent", - "docstrings": [ - "Decodes a previously URI encoded string back to its original form.\n\nSee [`decodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) on MDN.\n\n## Examples\n```rescript\nConsole.log(decodeURIComponent(\"array%3D%5BsomeValue%5D\"))\n// Logs \"array=[someValue]\" to the console.\n```" - ], - "signature": "let decodeURIComponent: string => string" - }, - { - "id": "Stdlib.date", - "kind": "type", - "name": "date", - "docstrings": [], - "signature": "type date = Date.t" - }, - { - "id": "Stdlib.null", - "kind": "type", - "name": "null", - "docstrings": [], - "signature": "type null<'a> = null<'a>" - }, - { - "id": "Stdlib.undefined", - "kind": "type", - "name": "undefined", - "docstrings": [], - "signature": "type undefined<'a> = undefined<'a>" - }, - { - "id": "Stdlib.nullable", - "kind": "type", - "name": "nullable", - "docstrings": [], - "signature": "type nullable<'a> = nullable<'a>" - }, - { - "id": "Stdlib.lazy_t", - "kind": "type", - "name": "lazy_t", - "docstrings": [], - "signature": "type lazy_t<'a> = Lazy.t<'a>", - "deprecated": "Use Lazy.t instead" - }, - { - "id": "Stdlib.window", - "kind": "value", - "name": "window", - "docstrings": [], - "signature": "let window: Dom.window", - "deprecated": "Use rescript-webapi instead" - }, - { - "id": "Stdlib.document", - "kind": "value", - "name": "document", - "docstrings": [], - "signature": "let document: Dom.document", - "deprecated": "Use rescript-webapi instead" - }, - { - "id": "Stdlib.globalThis", - "kind": "value", - "name": "globalThis", - "docstrings": [ - "`globalThis` gives you the host global object (`window` in browsers, `global` in Node, etc.).\nYou can reach shared globals from any runtime without special checks.\n\n## Examples\n\n**Note:** These are demonstrative examples. In real code, prefer writing your own type-safe bindings.\nSee [`Bind to Global JS Values`](https://rescript-lang.org/docs/manual/v12.0.0/bind-to-global-js-values).\n\n\n```rescript\ntypeof(globalThis[\"setTimeout\"]) == #function\n\nglobalThis[\"myAppName\"] = \"SuperApp\";\nglobalThis[\"myAppName\"] == \"SuperApp\"\n```" - ], - "signature": "let globalThis: {..}" - }, - { - "id": "Stdlib.import", - "kind": "value", - "name": "import", - "docstrings": [ - "`import(value)` dynamically import a value or function from a ReScript\nmodule. The import call will return a `promise`, resolving to the dynamically loaded\nvalue.\n\n## Examples\n\n`Array.res` file:\n\n```rescript\n@send external indexOf: (array<'a>, 'a) => int = \"indexOf\"\n\nlet indexOfOpt = (arr, item) =>\n switch arr->indexOf(item) {\n | -1 => None\n | index => Some(index)\n }\n```\nIn other file you can import the `indexOfOpt` value defined in `Array.res`\n\n```rescript\nlet main = async () => {\n let indexOfOpt = await import(Array.indexOfOpt)\n let index = indexOfOpt([1, 2], 2)\n Console.log(index)\n}\n```\n\nCompiles to:\n\n```javascript\nasync function main() {\n var add = await import(\"./Array.mjs\").then(function(m) {\n return m.indexOfOpt;\n });\n var index = indexOfOpt([1, 2], 2);\n console.log(index);\n}\n```" - ], - "signature": "let import: 'a => promise<'a>" - }, - { - "id": "Stdlib.panic", - "kind": "value", - "name": "panic", - "docstrings": [ - "`panic(message)` throws a JavaScript `Error` prefixed with `Panic!`.\nCall it when something went wrong and the program should stop right away.\n\n## Examples\n\n```rescript\nlet caught = try panic(\"Invariant violated\") catch {\n| JsExn(err) => JsExn.message(err)->Option.getOrThrow\n}\n\ncaught == \"Panic! Invariant violated\"\n```" - ], - "signature": "let panic: string => 'a" - }, - { - "id": "Stdlib.assertEqual", - "kind": "value", - "name": "assertEqual", - "docstrings": [ - "`assertEqual(a, b)` check if `a` is equal `b`. If not throw a panic exception\n\n## Examples\n\n```rescript\nlist{1, 2}->List.tailExn == list{2}\n```" - ], - "signature": "let assertEqual: ('a, 'a) => unit" - }, - { - "id": "Stdlib.null", - "kind": "value", - "name": "null", - "docstrings": [ - "`null` returns the JavaScript `null` value as a `nullable<'a>`.\nUse the `Nullable` helpers to convert it into an `option` or to read the value.\n\n## Examples\n\n```rescript\nnull->Nullable.toOption == None\n```" - ], - "signature": "let null: nullable<'a>" - }, - { - "id": "Stdlib.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "`undefined` returns the JavaScript `undefined` value as a `nullable<'a>`.\nUse the `Nullable` helpers to convert it into an `option` or to read the value.\n\n## Examples\n\n```rescript\nundefined->Nullable.toOption == None\n```" - ], - "signature": "let undefined: nullable<'a>" - }, - { - "id": "Stdlib.typeof", - "kind": "value", - "name": "typeof", - "docstrings": [ - "`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```" - ], - "signature": "let typeof: 'a => Type.t" - } - ] - }, - "stdlib/intl/numberformat/grouping": { - "id": "Stdlib.Intl.NumberFormat.Grouping", - "name": "Grouping", - "docstrings": [ - "Represents the `useGrouping` option accepted by `Intl.NumberFormat`.\n\nSee [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) on MDN for full option details." - ], - "items": [ - { - "id": "Stdlib.Intl.NumberFormat.Grouping.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.parsed", - "kind": "type", - "name": "parsed", - "docstrings": [], - "signature": "type parsed = [#always | #auto | #bool(bool) | #min2]" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.fromBool", - "kind": "value", - "name": "fromBool", - "docstrings": [ - "Constructs a grouping setting from a boolean.\n\n## Examples\n\n```rescript\nlet formatter =\n Intl.NumberFormat.make(\n ~locales=[\"en-US\"],\n ~options={useGrouping: Intl.NumberFormat.Grouping.fromBool(false)},\n )\nformatter->Intl.NumberFormat.format(1234.) == \"1234\"\n```" - ], - "signature": "let fromBool: bool => t" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Constructs a grouping setting from a string literal.\n\n## Examples\n\n```rescript\nlet formatter =\n Intl.NumberFormat.make(\n ~locales=[\"en-US\"],\n ~options={useGrouping: Intl.NumberFormat.Grouping.fromString(#always)},\n )\nformatter->Intl.NumberFormat.format(1234.) == \"1,234\"\n```" - ], - "signature": "let fromString: [#always | #auto | #min2] => t" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.parseJsValue", - "kind": "value", - "name": "parseJsValue", - "docstrings": [ - "`parseJsValue(value)` attempts to interpret a JavaScript `value` as a grouping setting.\n\n## Examples\n\n```rescript\nIntl.NumberFormat.Grouping.parseJsValue(Js.Json.string(\"auto\")) == Some(#auto)\n```" - ], - "signature": "let parseJsValue: 'a => option<[> #always | #auto | #bool(bool) | #min2]>" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(grouping)` ignores the provided grouping and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/biguint64array/constants": { - "id": "Stdlib.BigUint64Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigUint64Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/bigint64array/constants": { - "id": "Stdlib.BigInt64Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigInt64Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint8clampedarray/constants": { - "id": "Stdlib.Uint8ClampedArray.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8ClampedArray.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint32array/constants": { - "id": "Stdlib.Uint32Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint32Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint16array/constants": { - "id": "Stdlib.Uint16Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint16Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint8array/constants": { - "id": "Stdlib.Uint8Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/int32array/constants": { - "id": "Stdlib.Int32Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int32Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/int16array/constants": { - "id": "Stdlib.Int16Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int16Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/int8array/constants": { - "id": "Stdlib.Int8Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int8Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/float64array/constants": { - "id": "Stdlib.Float64Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float64Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/float32array/constants": { - "id": "Stdlib.Float32Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float32Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/type/classify": { - "id": "Stdlib.Type.Classify", - "name": "Classify", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Type.Classify.function", - "kind": "type", - "name": "function", - "docstrings": [ - "An abstract type representing a JavaScript function.\n\n See [`function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) on MDN." - ], - "signature": "type function" - }, - { - "id": "Stdlib.Type.Classify.object", - "kind": "type", - "name": "object", - "docstrings": [ - "An abstract type representing a JavaScript object.\n\n See [`object`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) on MDN." - ], - "signature": "type object" - }, - { - "id": "Stdlib.Type.Classify.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type representing a classified JavaScript value." - ], - "signature": "type t =\n | Bool(bool)\n | Null\n | Undefined\n | String(string)\n | Number(float)\n | Object(object)\n | Function(function)\n | Symbol(Symbol.t)\n | BigInt(bigint)" - }, - { - "id": "Stdlib.Type.Classify.classify", - "kind": "value", - "name": "classify", - "docstrings": [ - "`classify(anyValue)`\nClassifies a JavaScript value.\n\n## Examples\n```rescript\nswitch %raw(`null`)->Type.Classify.classify {\n| Null => Console.log(\"Yup, that's null.\")\n| _ => Console.log(\"This doesn't actually appear to be null...\")\n}\n```" - ], - "signature": "let classify: 'a => t" - } - ] - }, - "stdlib/regexp/result": { - "id": "Stdlib.RegExp.Result", - "name": "Result", - "docstrings": [], - "items": [ - { - "id": "Stdlib.RegExp.Result.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing the result of a `RegExp` execution." - ], - "signature": "type t = array>" - }, - { - "id": "Stdlib.RegExp.Result.fullMatch", - "kind": "value", - "name": "fullMatch", - "docstrings": [ - "`fullMatch(regExpResult)` returns the full string that matched in this result.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n \n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints the full string that matched, \"ReScript is\"\n }\n ```" - ], - "signature": "let fullMatch: t => string" - }, - { - "id": "Stdlib.RegExp.Result.matches", - "kind": "value", - "name": "matches", - "docstrings": [ - "`matches(regExpResult)` returns all matches for `regExpResult`.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n \n // This below will log \"ReScript\" and \"is\" to the console.\n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) =>\n switch result->RegExp.Result.matches->Array.keepSome {\n | [firstWord, secondWord] => Console.log2(firstWord, secondWord)\n | _ => Console.log(\"Didn't find exactly two words...\")\n }\n }\n ```" - ], - "signature": "let matches: t => array>" - }, - { - "id": "Stdlib.RegExp.Result.index", - "kind": "value", - "name": "index", - "docstrings": [], - "signature": "let index: t => int" - }, - { - "id": "Stdlib.RegExp.Result.input", - "kind": "value", - "name": "input", - "docstrings": [ - "`input(regExpResult)` returns the full input string that was passed to what produced the `RegExp.Result.t`.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n \n // This below will log the full input string \"ReScript is pretty cool, right?\" to the console.\n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) => Console.log(result->RegExp.Result.input)\n }\n ```" - ], - "signature": "let input: t => string" - } - ] - }, - "stdlib/math/int": { - "id": "Stdlib.Math.Int", - "name": "Int", - "docstrings": [ - "Provide Math utilities for `int`" - ], - "items": [ - { - "id": "Stdlib.Math.Int.abs", - "kind": "value", - "name": "abs", - "docstrings": [ - "`abs(v)` returns absolute value of `v`.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.abs(-2) == 2\n Math.Int.abs(3) == 3\n ```" - ], - "signature": "let abs: int => int" - }, - { - "id": "Stdlib.Math.Int.clz32", - "kind": "value", - "name": "clz32", - "docstrings": [ - "`clz32(v)` returns the number of leading zero bits of the argument's 32 bit\nint representation.\nSee [`Math.clz32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32) on MDN.\n\n ## Examples\n\n ```rescript\n // 00000000000000000000000000000001\n Math.Int.clz32(1) == 31\n // 00000000000000000000000000000100\n Math.Int.clz32(4) == 29\n ```" - ], - "signature": "let clz32: int => int" - }, - { - "id": "Stdlib.Math.Int.imul", - "kind": "value", - "name": "imul", - "docstrings": [ - "`imul(a, b)` returns 32-bit integer multiplication. Use this only when you\nneed to optimize performance of multiplication of numbers stored as 32-bit\nintegers.\nSee [`Math.imul`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.imul(3, 4) == 12\n Math.Int.imul(-5, 12) == -60\n ```" - ], - "signature": "let imul: (int, int) => int" - }, - { - "id": "Stdlib.Math.Int.min", - "kind": "value", - "name": "min", - "docstrings": [ - "`min(a, b)` returns the minimum of its two integer arguments.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.min(1, 2) == 1\n Math.Int.min(-1, -2) == -2\n ```" - ], - "signature": "let min: (int, int) => int" - }, - { - "id": "Stdlib.Math.Int.minMany", - "kind": "value", - "name": "minMany", - "docstrings": [ - "`minMany(arr)` returns the minimum of the integers in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.minMany([1, 2]) == 1\n Math.Int.minMany([-1, -2]) == -2\n Math.Int.minMany([])->Int.toFloat->Float.isFinite == false\n ```" - ], - "signature": "let minMany: array => int" - }, - { - "id": "Stdlib.Math.Int.max", - "kind": "value", - "name": "max", - "docstrings": [ - "`max(a, b)` returns the maximum of its two integer arguments.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.max(1, 2) == 2\n Math.Int.max(-1, -2) == -1\n ```" - ], - "signature": "let max: (int, int) => int" - }, - { - "id": "Stdlib.Math.Int.maxMany", - "kind": "value", - "name": "maxMany", - "docstrings": [ - "`maxMany(arr)` returns the maximum of the integers in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.maxMany([1, 2]) == 2\n Math.Int.maxMany([-1, -2]) == -1\n Math.Int.maxMany([])->Int.toFloat->Float.isFinite == false\n ```" - ], - "signature": "let maxMany: array => int" - }, - { - "id": "Stdlib.Math.Int.pow", - "kind": "value", - "name": "pow", - "docstrings": [ - "`pow(a, ~exp)` throws the given base `a` to the given exponent `exp`.\nSee [`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.pow(2, ~exp=4) == 16\n Math.Int.pow(3, ~exp=4) == 81\n ```" - ], - "signature": "let pow: (int, ~exp: int) => int" - }, - { - "id": "Stdlib.Math.Int.sign", - "kind": "value", - "name": "sign", - "docstrings": [ - "`sign(v)` returns the sign of its integer argument: `-1` if negative, `0` if\nzero, `1` if positive.\nSee [`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.sign(3) == 1\n Math.Int.sign(-3) == -1\n Math.Int.sign(0) == 0\n ```" - ], - "signature": "let sign: int => int" - }, - { - "id": "Stdlib.Math.Int.floor", - "kind": "value", - "name": "floor", - "docstrings": [ - "floor(v) returns the largest `int` less than or equal to the argument;\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.floor(3.7) == 3\n Math.Int.floor(3.0) == 3\n Math.Int.floor(-3.1) == -4\n ```" - ], - "signature": "let floor: float => int" - }, - { - "id": "Stdlib.Math.Int.ceil", - "kind": "value", - "name": "ceil", - "docstrings": [ - "ceil(v) returns the smallest `int` greater than or equal to the argument;\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.ceil(3.7) == 4\n Math.Int.ceil(3.0) == 3\n Math.Int.ceil(-3.1) == -3\n ```" - ], - "signature": "let ceil: float => int" - }, - { - "id": "Stdlib.Math.Int.random", - "kind": "value", - "name": "random", - "docstrings": [ - "`random(minVal, maxVal)` returns a random integer number in the half-closed interval \\[minVal, maxVal).\nSee [`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\non MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.random(2, 5)\n Math.Int.random(505, 2000)\n Math.Int.random(-7, -2)\n ```" - ], - "signature": "let random: (int, int) => int" - } - ] - }, - "stdlib/math/constants": { - "id": "Stdlib.Math.Constants", - "name": "Constants", - "docstrings": [ - "Mathematical Constants" - ], - "items": [ - { - "id": "Stdlib.Math.Constants.e", - "kind": "value", - "name": "e", - "docstrings": [ - "`Math.Constants.e` returns Euler's number, ≈ 2.718281828459045.\nSee [`Math.E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.e\n ```" - ], - "signature": "let e: float" - }, - { - "id": "Stdlib.Math.Constants.ln2", - "kind": "value", - "name": "ln2", - "docstrings": [ - "`Math.Constants.ln2` returns Natural logarithm of 2, ≈ 0.6931471805599453.\nSee [`Math.LN2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN2) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.ln2\n ```" - ], - "signature": "let ln2: float" - }, - { - "id": "Stdlib.Math.Constants.ln10", - "kind": "value", - "name": "ln10", - "docstrings": [ - "`Math.Constants.ln10` returns Natural logarithm of 10, ≈ 2.302585092994046.\nSee [`Math.LN10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN10) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.ln10\n ```" - ], - "signature": "let ln10: float" - }, - { - "id": "Stdlib.Math.Constants.log2e", - "kind": "value", - "name": "log2e", - "docstrings": [ - "`Math.Constants.log2e` returns Base 2 logarithm of E, ≈ 1.4426950408889634.\nSee [`Math.LOG2E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG2E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.log2e\n ```" - ], - "signature": "let log2e: float" - }, - { - "id": "Stdlib.Math.Constants.log10e", - "kind": "value", - "name": "log10e", - "docstrings": [ - "`Math.Constants.log10e` returns Base 10 logarithm of E, ≈ 0.4342944819032518.\nSee [`Math.LOG10E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG10E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.log10e\n ```" - ], - "signature": "let log10e: float" - }, - { - "id": "Stdlib.Math.Constants.pi", - "kind": "value", - "name": "pi", - "docstrings": [ - "`Math.Constants.pi` returns Pi - ratio of the circumference to the diameter\nof a circle, ≈ 3.141592653589793.\nSee [`Math.PI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/PI) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.pi\n ```" - ], - "signature": "let pi: float" - }, - { - "id": "Stdlib.Math.Constants.sqrt1_2", - "kind": "value", - "name": "sqrt1_2", - "docstrings": [ - "`Math.Constants.sqrt1_2` returns Square root of 1/2, ≈ 0.7071067811865476.\nSee [`Math.SQRT1_2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.sqrt1_2\n ```" - ], - "signature": "let sqrt1_2: float" - }, - { - "id": "Stdlib.Math.Constants.sqrt2", - "kind": "value", - "name": "sqrt2", - "docstrings": [ - "`Math.Constants.e` returns Absolute value for integer argument.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.sqrt2\n ```" - ], - "signature": "let sqrt2: float" - } - ] - }, - "stdlib/json/decode": { - "id": "Stdlib.JSON.Decode", - "name": "Decode", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JSON.Decode.bool", - "kind": "value", - "name": "bool", - "docstrings": [ - "Decodes a single JSON value. If the value is a bool, it will return `Some(bool)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`true`)->JSON.Decode.bool\n // Some(true)\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.bool\n // None\n ```" - ], - "signature": "let bool: t => option" - }, - { - "id": "Stdlib.JSON.Decode.null", - "kind": "value", - "name": "null", - "docstrings": [ - "Decodes a single JSON value. If the value is null, it will return `Some(Null.t)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`null`)->JSON.Decode.null\n // Some(null)\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.null\n // None\n ```" - ], - "signature": "let null: t => option>" - }, - { - "id": "Stdlib.JSON.Decode.string", - "kind": "value", - "name": "string", - "docstrings": [ - "Decodes a single JSON value. If the value is a string, it will return `Some(string)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.string\n // Some(\"hello world\")\n \n JSON.parseOrThrow(`42`)->JSON.Decode.string\n // None\n ```" - ], - "signature": "let string: t => option" - }, - { - "id": "Stdlib.JSON.Decode.float", - "kind": "value", - "name": "float", - "docstrings": [ - "Decodes a single JSON value. If the value is a float, it will return `Some(float)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`42.0`)->JSON.Decode.float\n // Some(42.0)\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.float\n // None\n ```" - ], - "signature": "let float: t => option" - }, - { - "id": "Stdlib.JSON.Decode.object", - "kind": "value", - "name": "object", - "docstrings": [ - "Decodes a single JSON value. If the value is an object, it will return `Some(dict)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`{\"foo\":\"bar\"}`)->JSON.Decode.object\n // Some({ foo: 'bar' })\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.object\n // None\n ```" - ], - "signature": "let object: t => option>" - }, - { - "id": "Stdlib.JSON.Decode.array", - "kind": "value", - "name": "array", - "docstrings": [ - "Decodes a single JSON value. If the value is an array, it will return `Some(array)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`[\"foo\", \"bar\"]`)->JSON.Decode.array\n // Some([ 'foo', 'bar' ])\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.array\n // None\n ```" - ], - "signature": "let array: t => option>" - } - ] - }, - "stdlib/json/encode": { - "id": "Stdlib.JSON.Encode", - "name": "Encode", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JSON.Encode.bool", - "kind": "value", - "name": "bool", - "docstrings": [ - "Returns a boolean as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.bool(true)\n ```" - ], - "signature": "let bool: bool => t" - }, - { - "id": "Stdlib.JSON.Encode.null", - "kind": "value", - "name": "null", - "docstrings": [ - "Returns null as a JSON value.\n\n ## Examples\n ```rescript\n JSON.Encode.null\n ```" - ], - "signature": "let null: t" - }, - { - "id": "Stdlib.JSON.Encode.string", - "kind": "value", - "name": "string", - "docstrings": [ - "Returns a string as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.string(\"hello world\")\n ```" - ], - "signature": "let string: string => t" - }, - { - "id": "Stdlib.JSON.Encode.int", - "kind": "value", - "name": "int", - "docstrings": [ - "Returns an int as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.int(42)\n ```" - ], - "signature": "let int: int => t" - }, - { - "id": "Stdlib.JSON.Encode.float", - "kind": "value", - "name": "float", - "docstrings": [ - "Returns a float as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.float(42.0)\n ```" - ], - "signature": "let float: float => t" - }, - { - "id": "Stdlib.JSON.Encode.object", - "kind": "value", - "name": "object", - "docstrings": [ - "Returns a dict as a JSON object.\n\n ## Examples\n ```rescript\n let dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n ])\n \n JSON.Encode.object(dict)\n ```" - ], - "signature": "let object: dict => t" - }, - { - "id": "Stdlib.JSON.Encode.array", - "kind": "value", - "name": "array", - "docstrings": [ - "Returns an array as JSON.\n\n ## Examples\n ```rescript\n let array = [JSON.Encode.string(\"hello world\"), JSON.Encode.int(42)]\n \n JSON.Encode.array(array)\n ```" - ], - "signature": "let array: array => t" - }, - { - "id": "Stdlib.JSON.Encode.stringArray", - "kind": "value", - "name": "stringArray", - "docstrings": [ - "Returns an array of strings as a JSON object." - ], - "signature": "let stringArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.floatArray", - "kind": "value", - "name": "floatArray", - "docstrings": [ - "Returns an array of floats as a JSON object." - ], - "signature": "let floatArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.intArray", - "kind": "value", - "name": "intArray", - "docstrings": [ - "Returns an array of integers as a JSON object." - ], - "signature": "let intArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.boolArray", - "kind": "value", - "name": "boolArray", - "docstrings": [ - "Returns an array of booleans as a JSON object." - ], - "signature": "let boolArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.objectArray", - "kind": "value", - "name": "objectArray", - "docstrings": [ - "Returns an array of objects as a JSON object." - ], - "signature": "let objectArray: array> => t" - } - ] - }, - "stdlib/json/classify": { - "id": "Stdlib.JSON.Classify", - "name": "Classify", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JSON.Classify.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a JavaScript type." - ], - "signature": "type t =\n | Bool(bool)\n | Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)" - }, - { - "id": "Stdlib.JSON.Classify.classify", - "kind": "value", - "name": "classify", - "docstrings": [ - "Returns the JSON type of any value.\n\n ## Examples\n ```rescript\n JSON.Classify.classify(\"hello world\")\n // String(\"hello world\")\n \n JSON.Classify.classify(42)\n // Number(42)\n ```" - ], - "signature": "let classify: 'a => t", - "deprecated": "Directly switch on the JSON object instead" - } - ] - }, - "stdlib/jserror/urierror": { - "id": "Stdlib.JsError.URIError", - "name": "URIError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.URIError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `URIError` with the provided `message`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.URIError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `URIError` with the provided `message` and throws it.\n\n `JsError.URIError.throwWithMessage(\"message\")` is equivalent to `JsError.URIError.make(\"message\")->JsError.throw`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/typeerror": { - "id": "Stdlib.JsError.TypeError", - "name": "TypeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.TypeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `TypeError` with the provided `message`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.TypeError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `TypeError` with the provided `message` and throws it.\n\n `JsError.TypeError.throwWithMessage(\"message\")` is equivalent to `JsError.TypeError.make(\"message\")->JsError.throw`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/syntaxerror": { - "id": "Stdlib.JsError.SyntaxError", - "name": "SyntaxError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.SyntaxError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `SyntaxError` with the provided `message`.\n\n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.SyntaxError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `SyntaxError` with the provided `message` and throws it.\n \n `JsError.SyntaxError.throwWithMessage(\"message\")` is equivalent to `JsError.SyntaxError.make(\"message\")->JsError.throw`.\n \n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/referenceerror": { - "id": "Stdlib.JsError.ReferenceError", - "name": "ReferenceError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.ReferenceError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `ReferenceError` with the provided `message`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.ReferenceError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `ReferenceError` with the provided `message` and throws it.\n\n `JsError.ReferenceError.throwWithMessage(\"message\")` is equivalent to `JsError.ReferenceError.make(\"message\")->JsError.throw`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/rangeerror": { - "id": "Stdlib.JsError.RangeError", - "name": "RangeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.RangeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `RangeError` with the provided `message`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.RangeError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `RangeError` with the provided `message` and throws it.\n \n `JsError.RangeError.throwWithMessage(\"message\")` is equivalent to `JsError.RangeError.make(\"message\")->JsError.throw`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/evalerror": { - "id": "Stdlib.JsError.EvalError", - "name": "EvalError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.EvalError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `EvalError` with the provided `message`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.EvalError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `EvalError` with the provided `message` and throws it.\n\n `JsError.EvalError.throwWithMessage(\"message\")` is equivalent to `JsError.EvalError.make(\"message\")->JsError.throw`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/intl/segments": { - "id": "Stdlib.Intl.Segments", - "name": "Segments", - "docstrings": [ - "Bindings to `Segments` objects produced by `Intl.Segmenter.segment`.\n A Segments instance is an object that represents the segments of a specific string, subject to the locale and options of its constructing Intl.Segmenter instance.\nhttps://tc39.es/ecma402/#sec-segments-objects.\n\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment) for API details and the [ECMA-402 specification](https://tc39.es/ecma402/#sec-segments-objects) for the object shape." - ], - "items": [ - { - "id": "Stdlib.Intl.Segments.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Segments.segmentData", - "kind": "type", - "name": "segmentData", - "docstrings": [], - "signature": "type segmentData = {\n segment: string,\n index: int,\n isWordLike: option,\n input: string,\n}" - }, - { - "id": "Stdlib.Intl.Segments.containing", - "kind": "value", - "name": "containing", - "docstrings": [ - "`containing(segments)` returns the segment data for the index supplied when iterating.\n\nUse this when consuming `Segments` via iteration helpers where the index is already implied." - ], - "signature": "let containing: t => segmentData" - }, - { - "id": "Stdlib.Intl.Segments.containingWithIndex", - "kind": "value", - "name": "containingWithIndex", - "docstrings": [ - "`containingWithIndex(segments, index)` returns the segment that contains `index` within the original string.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #word})\nlet segments = segmenter->Intl.Segmenter.segment(\"Hello world\")\nIntl.Segments.containingWithIndex(segments, 0).segment == \"Hello\"\n```" - ], - "signature": "let containingWithIndex: (t, int) => segmentData" - }, - { - "id": "Stdlib.Intl.Segments.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(segments)` ignores the provided segments and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/segmenter": { - "id": "Stdlib.Intl.Segmenter", - "name": "Segmenter", - "docstrings": [ - "Bindings to JavaScript's `Intl.Segmenter`.\n\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter) for API details." - ], - "items": [ - { - "id": "Stdlib.Intl.Segmenter.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Segmenter.granularity", - "kind": "type", - "name": "granularity", - "docstrings": [], - "signature": "type granularity = [#grapheme | #sentence | #word]" - }, - { - "id": "Stdlib.Intl.Segmenter.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n granularity?: granularity,\n}" - }, - { - "id": "Stdlib.Intl.Segmenter.pluralCategories", - "kind": "type", - "name": "pluralCategories", - "docstrings": [], - "signature": "type pluralCategories = [\n | #few\n | #many\n | #one\n | #other\n | #two\n | #zero\n]" - }, - { - "id": "Stdlib.Intl.Segmenter.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n granularity: granularity,\n}" - }, - { - "id": "Stdlib.Intl.Segmenter.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.Segmenter.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.Segmenter` instance for segmenting strings.\n\nSee [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter) on MDN.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #word})\nIntl.Segmenter.resolvedOptions(segmenter).granularity == #word\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.Segmenter.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for segmentation.\n\nSee [`Intl.Segmenter.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.Segmenter.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.Segmenter.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(segmenter)` returns the locale and granularity currently in use.\n\nSee [`Intl.Segmenter.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #sentence})\nIntl.Segmenter.resolvedOptions(segmenter).granularity == #sentence\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.Segmenter.segment", - "kind": "value", - "name": "segment", - "docstrings": [ - "`segment(segmenter, input)` returns a `Segments` object describing `input`.\n\nSee [`Intl.Segmenter.prototype.segment`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment) on MDN.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #word})\nlet segments = segmenter->Intl.Segmenter.segment(\"Hello world\")\nIntl.Segments.containingWithIndex(segments, 0).segment == \"Hello\"\n```" - ], - "signature": "let segment: (t, string) => Intl_Segments.t" - }, - { - "id": "Stdlib.Intl.Segmenter.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(segmenter)` ignores the provided segmenter and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/relativetimeformat": { - "id": "Stdlib.Intl.RelativeTimeFormat", - "name": "RelativeTimeFormat", - "docstrings": [ - "Bindings to JavaScript's `Intl.RelativeTimeFormat`.\n\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) for API details." - ], - "items": [ - { - "id": "Stdlib.Intl.RelativeTimeFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.numeric", - "kind": "type", - "name": "numeric", - "docstrings": [], - "signature": "type numeric = [#always | #auto]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.style", - "kind": "type", - "name": "style", - "docstrings": [], - "signature": "type style = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.timeUnit", - "kind": "type", - "name": "timeUnit", - "docstrings": [], - "signature": "type timeUnit = [\n | #day\n | #hour\n | #minute\n | #month\n | #quarter\n | #second\n | #week\n | #year\n]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n numeric?: numeric,\n style?: style,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n numeric: numeric,\n style: style,\n numberingSystem: string,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.relativeTimePartComponent", - "kind": "type", - "name": "relativeTimePartComponent", - "docstrings": [], - "signature": "type relativeTimePartComponent = [#integer | #literal]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.relativeTimePart", - "kind": "type", - "name": "relativeTimePart", - "docstrings": [], - "signature": "type relativeTimePart = {\n \\\"type\": relativeTimePartComponent,\n value: string,\n unit?: timeUnit,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.RelativeTimeFormat` instance for formatting relative time strings.\n\nSee [`Intl.RelativeTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en-US\"])\nformatter->Intl.RelativeTimeFormat.format(1, #day)->String.length > 0\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for relative time formatting.\n\nSee [`Intl.RelativeTimeFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.RelativeTimeFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the locale and options currently in use.\n\nSee [`Intl.RelativeTimeFormat.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en-US\"])\nIntl.RelativeTimeFormat.resolvedOptions(formatter).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, value, unit)` returns the formatted string for `value` expressed in `unit`.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en\"])\nformatter->Intl.RelativeTimeFormat.format(-1, #day)->String.length > 0\n```" - ], - "signature": "let format: (t, int, timeUnit) => string" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, value, unit)` returns an array describing how the output string is assembled.\n\nSee [`Intl.RelativeTimeFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en\"])\nformatter->Intl.RelativeTimeFormat.formatToParts(-1, #day)->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, int, timeUnit) => array" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(relativeTimeFormat)` ignores the provided relativeTimeFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/pluralrules": { - "id": "Stdlib.Intl.PluralRules", - "name": "PluralRules", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.PluralRules.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.PluralRules.localeType", - "kind": "type", - "name": "localeType", - "docstrings": [], - "signature": "type localeType = [#cardinal | #ordinal]" - }, - { - "id": "Stdlib.Intl.PluralRules.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n \\\"type\"?: localeType,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" - }, - { - "id": "Stdlib.Intl.PluralRules.pluralCategories", - "kind": "type", - "name": "pluralCategories", - "docstrings": [], - "signature": "type pluralCategories = [\n | #few\n | #many\n | #one\n | #other\n | #two\n | #zero\n]" - }, - { - "id": "Stdlib.Intl.PluralRules.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n pluralCategories: array,\n \\\"type\": localeType,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" - }, - { - "id": "Stdlib.Intl.PluralRules.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.PluralRules.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.PluralRules` instance to determine plural categories.\n\nSee [`Intl.PluralRules`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules) on MDN.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nlet category = rules->Intl.PluralRules.select(1.0)\ncategory == #one\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.PluralRules.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for plural rules.\n\nSee [`Intl.PluralRules.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.PluralRules.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.PluralRules.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(rules)` returns the plural rule configuration in use.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nIntl.PluralRules.resolvedOptions(rules).locale == \"en\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.PluralRules.rule", - "kind": "type", - "name": "rule", - "docstrings": [], - "signature": "type rule = [#few | #many | #one | #other | #two | #zero]" - }, - { - "id": "Stdlib.Intl.PluralRules.select", - "kind": "value", - "name": "select", - "docstrings": [ - "`select(rules, value)` returns the plural category for the given number.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.select(1.) == #one\n```" - ], - "signature": "let select: (t, float) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.selectInt", - "kind": "value", - "name": "selectInt", - "docstrings": [ - "`selectInt(rules, value)` is like `select` but accepts an integer.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.selectInt(2) == #other\n```" - ], - "signature": "let selectInt: (t, int) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.selectRange", - "kind": "value", - "name": "selectRange", - "docstrings": [ - "`selectRange(rules, ~start, ~end)` returns the category for numbers in the range.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.selectRange(~start=1., ~end=2.) == #other\n```" - ], - "signature": "let selectRange: (t, ~start: float, ~end: float) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.selectRangeInt", - "kind": "value", - "name": "selectRangeInt", - "docstrings": [ - "`selectRangeInt(rules, ~start, ~end)` is the integer version of `selectRange`.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.selectRangeInt(~start=1, ~end=1) == #other\n```" - ], - "signature": "let selectRangeInt: (t, ~start: int, ~end: int) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(pluralRules)` ignores the provided pluralRules and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/numberformat": { - "id": "Stdlib.Intl.NumberFormat", - "name": "NumberFormat", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.NumberFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.NumberFormat.currency", - "kind": "type", - "name": "currency", - "docstrings": [ - "An ISO 4217 currency code. e.g. USD, EUR, CNY" - ], - "signature": "type currency = string" - }, - { - "id": "Stdlib.Intl.NumberFormat.currencyDisplay", - "kind": "type", - "name": "currencyDisplay", - "docstrings": [], - "signature": "type currencyDisplay = [\n | #code\n | #name\n | #narrowSymbol\n | #symbol\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.currencySign", - "kind": "type", - "name": "currencySign", - "docstrings": [], - "signature": "type currencySign = [#accounting | #standard]" - }, - { - "id": "Stdlib.Intl.NumberFormat.notation", - "kind": "type", - "name": "notation", - "docstrings": [], - "signature": "type notation = [\n | #compact\n | #engineering\n | #scientific\n | #standard\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.compactDisplay", - "kind": "type", - "name": "compactDisplay", - "docstrings": [ - "Used only when notation is #compact" - ], - "signature": "type compactDisplay = [#long | #short]" - }, - { - "id": "Stdlib.Intl.NumberFormat.signDisplay", - "kind": "type", - "name": "signDisplay", - "docstrings": [], - "signature": "type signDisplay = [\n | #always\n | #auto\n | #exceptZero\n | #negative\n | #never\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.style", - "kind": "type", - "name": "style", - "docstrings": [], - "signature": "type style = [#currency | #decimal | #percent | #unit]" - }, - { - "id": "Stdlib.Intl.NumberFormat.unitSystem", - "kind": "type", - "name": "unitSystem", - "docstrings": [ - "Defined in https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier\nOnly used when style is #unit" - ], - "signature": "type unitSystem = string" - }, - { - "id": "Stdlib.Intl.NumberFormat.unitDisplay", - "kind": "type", - "name": "unitDisplay", - "docstrings": [ - "Only used when style is #unit" - ], - "signature": "type unitDisplay = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.NumberFormat.rounding", - "kind": "type", - "name": "rounding", - "docstrings": [], - "signature": "type rounding = [\n | #ceil\n | #expand\n | #floor\n | #halfCeil\n | #halfEven\n | #halfExpand\n | #halfFloor\n | #halfTrunc\n | #trunc\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.roundingPriority", - "kind": "type", - "name": "roundingPriority", - "docstrings": [], - "signature": "type roundingPriority = [\n | #auto\n | #lessPrecision\n | #morePrecision\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.roundingIncrement", - "kind": "type", - "name": "roundingIncrement", - "docstrings": [], - "signature": "type roundingIncrement = [\n | #1\n | #10\n | #100\n | #1000\n | #2\n | #20\n | #200\n | #2000\n | #25\n | #250\n | #2500\n | #5\n | #50\n | #500\n | #5000\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.trailingZeroDisplay", - "kind": "type", - "name": "trailingZeroDisplay", - "docstrings": [], - "signature": "type trailingZeroDisplay = [\n | #auto\n | #lessPrecision\n | #stripIfInteger\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n compactDisplay?: compactDisplay,\n numberingSystem?: Intl_Common.numberingSystem,\n currency?: currency,\n currencyDisplay?: currencyDisplay,\n currencySign?: currencySign,\n localeMatcher?: Intl_Common.localeMatcher,\n notation?: notation,\n signDisplay?: signDisplay,\n style?: style,\n unit?: unitSystem,\n unitDisplay?: unitDisplay,\n useGrouping?: Grouping.t,\n roundingMode?: rounding,\n roundingPriority?: roundingPriority,\n roundingIncrement?: roundingIncrement,\n trailingZeroDisplay?: trailingZeroDisplay,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n currency?: currency,\n currencyDisplay?: currencyDisplay,\n currencySign?: currencySign,\n compactDisplay?: compactDisplay,\n unit: unitSystem,\n unitDisplay: unitDisplay,\n roundingMode?: rounding,\n roundingPriority?: roundingPriority,\n roundingIncrement?: roundingIncrement,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n locale: string,\n notation: notation,\n numberingSystem: Intl_Common.numberingSystem,\n signDisplay: signDisplay,\n style: style,\n useGrouping: Grouping.t,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.numberFormatPartType", - "kind": "type", - "name": "numberFormatPartType", - "docstrings": [], - "signature": "type numberFormatPartType = [\n | #compact\n | #currency\n | #decimal\n | #exponentInteger\n | #exponentMinusSign\n | #exponentSeparator\n | #fraction\n | #group\n | #infinity\n | #integer\n | #literal\n | #minusSign\n | #nan\n | #percentSign\n | #plusSign\n | #unit\n | #unknown\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.numberFormatPart", - "kind": "type", - "name": "numberFormatPart", - "docstrings": [], - "signature": "type numberFormatPart = {\n \\\"type\": numberFormatPartType,\n value: string,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.rangeSource", - "kind": "type", - "name": "rangeSource", - "docstrings": [], - "signature": "type rangeSource = [#endRange | #shared | #startRange]" - }, - { - "id": "Stdlib.Intl.NumberFormat.numberFormatRangePart", - "kind": "type", - "name": "numberFormatRangePart", - "docstrings": [], - "signature": "type numberFormatRangePart = {\n \\\"type\": numberFormatPartType,\n value: string,\n source: rangeSource,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.NumberFormat` instance for locale-aware number formatting.\n\nSee [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"], ~options={style: #currency, currency: \"USD\"})\nformatter->Intl.NumberFormat.format(1234.5) == \"$1,234.50\"\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.NumberFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for number formatting.\n\nSee [`Intl.NumberFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.NumberFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the actual options being used.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nIntl.NumberFormat.resolvedOptions(formatter).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.NumberFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, value)` returns the formatted representation of `value`.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.format(1234.5) == \"1,234.5\"\n```" - ], - "signature": "let format: (t, float) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatRange", - "kind": "value", - "name": "formatRange", - "docstrings": [ - "`formatRange(formatter, ~start, ~end)` formats numbers representing a range.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.formatRange(~start=1., ~end=2.)->String.length > 0\n```" - ], - "signature": "let formatRange: (t, ~start: float, ~end: float) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, value)` breaks the formatted result into parts.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.formatToParts(123)->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, float) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatRangeToParts", - "kind": "value", - "name": "formatRangeToParts", - "docstrings": [ - "`formatRangeToParts(formatter, ~start, ~end)` returns how the range would be rendered.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.formatRangeToParts(~start=1., ~end=2.)->Array.length > 0\n```" - ], - "signature": "let formatRangeToParts: (\n t,\n ~start: float,\n ~end: float,\n) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatInt", - "kind": "value", - "name": "formatInt", - "docstrings": [ - "`formatInt(formatter, value)` formats integer values.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatInt(42) == \"42\"\n```" - ], - "signature": "let formatInt: (t, int) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatIntRange", - "kind": "value", - "name": "formatIntRange", - "docstrings": [ - "`formatIntRange(formatter, ~start, ~end)` formats integer ranges.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatIntRange(~start=1, ~end=3)->String.length > 0\n```" - ], - "signature": "let formatIntRange: (t, ~start: int, ~end: int) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatIntToParts", - "kind": "value", - "name": "formatIntToParts", - "docstrings": [ - "`formatIntToParts(formatter, value)` returns formatting parts for an integer.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatIntToParts(123)->Array.length > 0\n```" - ], - "signature": "let formatIntToParts: (t, int) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatIntRangeToParts", - "kind": "value", - "name": "formatIntRangeToParts", - "docstrings": [ - "`formatIntRangeToParts(formatter, ~start, ~end)` returns how the integer range would be rendered.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatIntRangeToParts(~start=1, ~end=1)->Array.length > 0\n```" - ], - "signature": "let formatIntRangeToParts: (t, ~start: int, ~end: int) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigInt", - "kind": "value", - "name": "formatBigInt", - "docstrings": [ - "`formatBigInt(formatter, value)` formats bigint values." - ], - "signature": "let formatBigInt: (t, bigint) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigIntRange", - "kind": "value", - "name": "formatBigIntRange", - "docstrings": [ - "`formatBigIntRange(formatter, ~start, ~end)` formats a range of bigint values.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatBigIntRange(~start=1n, ~end=2n) == \"1–2\"\n```" - ], - "signature": "let formatBigIntRange: (t, ~start: bigint, ~end: bigint) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigIntToParts", - "kind": "value", - "name": "formatBigIntToParts", - "docstrings": [ - "`formatBigIntToParts(formatter, value)` returns the bigint formatting broken into parts.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatBigIntToParts(5n)->Array.length > 0\n```" - ], - "signature": "let formatBigIntToParts: (t, bigint) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigIntRangeToParts", - "kind": "value", - "name": "formatBigIntRangeToParts", - "docstrings": [ - "`formatBigIntRangeToParts(formatter, ~start, ~end)` describes how the bigint range would be rendered.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatBigIntRangeToParts(~start=3n, ~end=4n)->Array.length > 0\n```" - ], - "signature": "let formatBigIntRangeToParts: (\n t,\n ~start: bigint,\n ~end: bigint,\n) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatString", - "kind": "value", - "name": "formatString", - "docstrings": [ - "`formatString(formatter, value)` interprets `value` as a number string and formats it.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatString(\"1234\") == \"1,234\"\n```" - ], - "signature": "let formatString: (t, string) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatStringToParts", - "kind": "value", - "name": "formatStringToParts", - "docstrings": [ - "`formatStringToParts(formatter, value)` returns formatting parts for a numeric string.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatStringToParts(\"123\")->Array.length > 0\n```" - ], - "signature": "let formatStringToParts: (t, string) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(numberFormat)` ignores the provided numberFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/locale": { - "id": "Stdlib.Intl.Locale", - "name": "Locale", - "docstrings": [ - "Bindings to JavaScript's `Intl.Locale`." - ], - "items": [ - { - "id": "Stdlib.Intl.Locale.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Locale.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n baseName?: string,\n calendar?: Intl_Common.calendar,\n collation?: Intl_Common.collation,\n hourCycle?: [#h11 | #h12 | #h23 | #h24],\n caseFirst?: [#\"false\" | #lower | #upper],\n numberingSystem?: Intl_Common.numberingSystem,\n numeric?: bool,\n language?: string,\n script?: string,\n region?: string,\n}" - }, - { - "id": "Stdlib.Intl.Locale.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.Locale` object from a locale identifier and optional modifiers.\n\nSee [`Intl.Locale`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en-US\")\nlocale->Intl.Locale.language == \"en\"\n```" - ], - "signature": "let make: (string, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.Locale.baseName", - "kind": "value", - "name": "baseName", - "docstrings": [ - "`baseName(locale)` returns the canonical base name (without Unicode extensions).\n\nSee [`Intl.Locale.prototype.baseName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/baseName) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"fr-CA\")\nlocale->Intl.Locale.baseName == \"fr-CA\"\n```" - ], - "signature": "let baseName: t => string" - }, - { - "id": "Stdlib.Intl.Locale.calendar", - "kind": "value", - "name": "calendar", - "docstrings": [ - "`calendar(locale)` returns the specified calendar, if present.\n\nSee [`Intl.Locale.prototype.calendar`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/calendar) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={calendar: #gregory})\nlocale->Intl.Locale.calendar == Some(\"gregory\")\n```" - ], - "signature": "let calendar: t => option" - }, - { - "id": "Stdlib.Intl.Locale.caseFirst", - "kind": "value", - "name": "caseFirst", - "docstrings": [ - "`caseFirst(locale)` returns the case-first ordering setting, if present.\n\nSee [`Intl.Locale.prototype.caseFirst`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/caseFirst) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={caseFirst: #upper})\nlocale->Intl.Locale.caseFirst == Some(\"upper\")\n```" - ], - "signature": "let caseFirst: t => option" - }, - { - "id": "Stdlib.Intl.Locale.collation", - "kind": "value", - "name": "collation", - "docstrings": [ - "`collation(locale)` returns the collation type, if present.\n\nSee [`Intl.Locale.prototype.collation`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/collation) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={collation: #phonebk})\nlocale->Intl.Locale.collation == Some(\"phonebk\")\n```" - ], - "signature": "let collation: t => option" - }, - { - "id": "Stdlib.Intl.Locale.hourCycle", - "kind": "value", - "name": "hourCycle", - "docstrings": [ - "`hourCycle(locale)` returns the preferred hour cycle, if present.\n\nSee [`Intl.Locale.prototype.hourCycle`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={hourCycle: #h12})\nlocale->Intl.Locale.hourCycle == Some(\"h12\")\n```" - ], - "signature": "let hourCycle: t => option" - }, - { - "id": "Stdlib.Intl.Locale.language", - "kind": "value", - "name": "language", - "docstrings": [ - "`language(locale)` returns the primary language subtag.\n\nSee [`Intl.Locale.prototype.language`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/language) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"pt-BR\")\nlocale->Intl.Locale.language == \"pt\"\n```" - ], - "signature": "let language: t => string" - }, - { - "id": "Stdlib.Intl.Locale.numberingSystem", - "kind": "value", - "name": "numberingSystem", - "docstrings": [ - "`numberingSystem(locale)` returns the numbering system identifier, if present.\n\nSee [`Intl.Locale.prototype.numberingSystem`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/numberingSystem) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={numberingSystem: #latn})\nlocale->Intl.Locale.numberingSystem == Some(\"latn\")\n```" - ], - "signature": "let numberingSystem: t => option" - }, - { - "id": "Stdlib.Intl.Locale.numeric", - "kind": "value", - "name": "numeric", - "docstrings": [ - "`numeric(locale)` indicates whether numeric ordering should be used for region subtags.\n\nSee [`Intl.Locale.prototype.numeric`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/numeric) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={numeric: true})\nlocale->Intl.Locale.numeric == true\n```" - ], - "signature": "let numeric: t => bool" - }, - { - "id": "Stdlib.Intl.Locale.region", - "kind": "value", - "name": "region", - "docstrings": [ - "`region(locale)` returns the region subtag, if present.\n\nSee [`Intl.Locale.prototype.region`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/region) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en-US\")\nlocale->Intl.Locale.region == Some(\"US\")\n```" - ], - "signature": "let region: t => option" - }, - { - "id": "Stdlib.Intl.Locale.script", - "kind": "value", - "name": "script", - "docstrings": [ - "`script(locale)` returns the script subtag, if present.\n\nSee [`Intl.Locale.prototype.script`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/script) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"sr-Cyrl\")\nlocale->Intl.Locale.script == Some(\"Cyrl\")\n```" - ], - "signature": "let script: t => option" - }, - { - "id": "Stdlib.Intl.Locale.maximize", - "kind": "value", - "name": "maximize", - "docstrings": [ - "`maximize(locale)` adds likely subtags to produce the most specific locale.\n\nSee [`Intl.Locale.prototype.maximize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/maximize) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\")\nlocale->Intl.Locale.maximize->Intl.Locale.region == Some(\"US\")\n```" - ], - "signature": "let maximize: t => t" - }, - { - "id": "Stdlib.Intl.Locale.minimize", - "kind": "value", - "name": "minimize", - "docstrings": [ - "`minimize(locale)` removes unnecessary subtags while preserving semantics.\n\nSee [`Intl.Locale.prototype.minimize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/minimize) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en-Latn-US\")\nlocale->Intl.Locale.minimize->Intl.Locale.baseName == \"en\"\n```" - ], - "signature": "let minimize: t => t" - }, - { - "id": "Stdlib.Intl.Locale.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(locale)` ignores the provided locale and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/listformat": { - "id": "Stdlib.Intl.ListFormat", - "name": "ListFormat", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.ListFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.ListFormat.listType", - "kind": "type", - "name": "listType", - "docstrings": [], - "signature": "type listType = [#conjunction | #disjunction | #unit]" - }, - { - "id": "Stdlib.Intl.ListFormat.style", - "kind": "type", - "name": "style", - "docstrings": [], - "signature": "type style = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.ListFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n \\\"type\"?: listType,\n style?: style,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.listPartComponentType", - "kind": "type", - "name": "listPartComponentType", - "docstrings": [], - "signature": "type listPartComponentType = [#element | #literal]" - }, - { - "id": "Stdlib.Intl.ListFormat.listPart", - "kind": "type", - "name": "listPart", - "docstrings": [], - "signature": "type listPart = {\n \\\"type\": listPartComponentType,\n value: string,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n style: style,\n \\\"type\": listType,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.ListFormat` instance for formatting lists.\n\nSee [`Intl.ListFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"], ~options={\\\"type\": #conjunction})\nformatter->Intl.ListFormat.format([\"apples\", \"bananas\", \"cherries\"]) == \"apples, bananas, and cherries\"\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.ListFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for list formatting.\n\nSee [`Intl.ListFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.ListFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.ListFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the actual options being used.\n\nSee [`Intl.ListFormat.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"])\nIntl.ListFormat.resolvedOptions(formatter).locale == \"en\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.ListFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, items)` returns the formatted list string.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"])\nformatter->Intl.ListFormat.format([\"a\", \"b\"]) == \"a and b\"\n```" - ], - "signature": "let format: (t, array) => string" - }, - { - "id": "Stdlib.Intl.ListFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, items)` returns the list as an array of parts describing how it would be rendered.\n\nSee [`Intl.ListFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/formatToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"])\nformatter->Intl.ListFormat.formatToParts([\"a\", \"b\"])->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, array) => array" - }, - { - "id": "Stdlib.Intl.ListFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(listFormat)` ignores the provided listFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/datetimeformat": { - "id": "Stdlib.Intl.DateTimeFormat", - "name": "DateTimeFormat", - "docstrings": [ - "Bindings to JavaScript's `Intl.DateTimeFormat`." - ], - "items": [ - { - "id": "Stdlib.Intl.DateTimeFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateStyle", - "kind": "type", - "name": "dateStyle", - "docstrings": [], - "signature": "type dateStyle = [#full | #long | #medium | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.timeStyle", - "kind": "type", - "name": "timeStyle", - "docstrings": [], - "signature": "type timeStyle = [#full | #long | #medium | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dayPeriod", - "kind": "type", - "name": "dayPeriod", - "docstrings": [], - "signature": "type dayPeriod = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.weekday", - "kind": "type", - "name": "weekday", - "docstrings": [], - "signature": "type weekday = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.era", - "kind": "type", - "name": "era", - "docstrings": [], - "signature": "type era = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.year", - "kind": "type", - "name": "year", - "docstrings": [], - "signature": "type year = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.month", - "kind": "type", - "name": "month", - "docstrings": [], - "signature": "type month = [\n | #\"2-digit\"\n | #long\n | #narrow\n | #numeric\n | #short\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.day", - "kind": "type", - "name": "day", - "docstrings": [], - "signature": "type day = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.hour", - "kind": "type", - "name": "hour", - "docstrings": [], - "signature": "type hour = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.minute", - "kind": "type", - "name": "minute", - "docstrings": [], - "signature": "type minute = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.second", - "kind": "type", - "name": "second", - "docstrings": [], - "signature": "type second = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.timeZoneName", - "kind": "type", - "name": "timeZoneName", - "docstrings": [ - "Firefox also supports IANA time zone names here\nNode v19+ supports \"shortOffset\", \"shortGeneric\", \"longOffset\", and \"longGeneric\"." - ], - "signature": "type timeZoneName = [\n | #long\n | #longGeneric\n | #longOffset\n | #short\n | #shortGeneric\n | #shortOffset\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.hourCycle", - "kind": "type", - "name": "hourCycle", - "docstrings": [], - "signature": "type hourCycle = [#h11 | #h12 | #h23 | #h24]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatMatcher", - "kind": "type", - "name": "formatMatcher", - "docstrings": [], - "signature": "type formatMatcher = [#basic | #\"best fit\"]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.fractionalSecondDigits", - "kind": "type", - "name": "fractionalSecondDigits", - "docstrings": [], - "signature": "type fractionalSecondDigits = [#0 | #1 | #2 | #3]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n dateStyle?: dateStyle,\n timeStyle?: timeStyle,\n calendar?: Intl_Common.calendar,\n dayPeriod?: dayPeriod,\n numberingSystem?: Intl_Common.numberingSystem,\n localeMatcher?: Intl_Common.localeMatcher,\n timeZone?: string,\n hour12?: bool,\n hourCycle?: hourCycle,\n formatMatcher?: formatMatcher,\n weekday?: weekday,\n era?: era,\n year?: year,\n month?: month,\n day?: day,\n hour?: hour,\n minute?: minute,\n second?: second,\n fractionalSecondDigits?: fractionalSecondDigits,\n timeZoneName?: timeZoneName,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n dateStyle?: dateStyle,\n timeStyle?: timeStyle,\n weekday?: weekday,\n era?: era,\n year?: year,\n month?: month,\n day?: day,\n hour?: hour,\n minute?: minute,\n second?: second,\n fractionalSecondDigits?: fractionalSecondDigits,\n timeZoneName?: timeZoneName,\n calendar: Intl_Common.calendar,\n hour12: bool,\n hourCycle: hourCycle,\n locale: string,\n numberingSystem: Intl_Common.numberingSystem,\n timeZone: string,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimeComponent", - "kind": "type", - "name": "dateTimeComponent", - "docstrings": [], - "signature": "type dateTimeComponent = [\n | #day\n | #dayPeriod\n | #era\n | #fractionalSecond\n | #hour\n | #literal\n | #minute\n | #month\n | #relatedYear\n | #second\n | #timeZone\n | #weekday\n | #year\n | #yearName\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimePart", - "kind": "type", - "name": "dateTimePart", - "docstrings": [], - "signature": "type dateTimePart = {\n \\\"type\": dateTimeComponent,\n value: string,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimeRangeSource", - "kind": "type", - "name": "dateTimeRangeSource", - "docstrings": [], - "signature": "type dateTimeRangeSource = [\n | #endRange\n | #shared\n | #startRange\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimeRangePart", - "kind": "type", - "name": "dateTimeRangePart", - "docstrings": [], - "signature": "type dateTimeRangePart = {\n \\\"type\": dateTimeComponent,\n value: string,\n source: dateTimeRangeSource,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.DateTimeFormat` instance for formatting date values.\n\nSee [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"], ~options={timeStyle: #short})\nlet sampleDate = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nformatter->Intl.DateTimeFormat.format(sampleDate)->String.length > 0\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported by the runtime for date/time formatting.\n\nSee [`Intl.DateTimeFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.DateTimeFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the actual locale and formatting options in use.\n\nSee [`Intl.DateTimeFormat.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"])\nIntl.DateTimeFormat.resolvedOptions(formatter).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, date)` returns the formatted string for `date`.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en\"])\nlet date = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nformatter->Intl.DateTimeFormat.format(date)->String.length > 0\n```" - ], - "signature": "let format: (t, Date.t) => string" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, date)` breaks the formatted output into an array of parts.\n\nSee [`Intl.DateTimeFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en\"])\nlet date = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nformatter->Intl.DateTimeFormat.formatToParts(date)->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, Date.t) => array" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatRange", - "kind": "value", - "name": "formatRange", - "docstrings": [ - "`formatRange(formatter, ~startDate, ~endDate)` formats the range between `startDate` and `endDate`.\n\nSee [`Intl.DateTimeFormat.prototype.formatRange`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatRange) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"], ~options={dateStyle: #short})\nlet startDate = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nlet endDate = Js.Date.makeWithYMD(~year=2024, ~month=1, ~date=1)\nformatter->Intl.DateTimeFormat.formatRange(~startDate=startDate, ~endDate=endDate)->String.length > 0\n```" - ], - "signature": "let formatRange: (t, ~startDate: Date.t, ~endDate: Date.t) => string" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatRangeToParts", - "kind": "value", - "name": "formatRangeToParts", - "docstrings": [ - "`formatRangeToParts(formatter, ~startDate, ~endDate)` returns an array describing how the range would be rendered.\n\nSee [`Intl.DateTimeFormat.prototype.formatRangeToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatRangeToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"], ~options={dateStyle: #short})\nlet startDate = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nlet endDate = Js.Date.makeWithYMD(~year=2024, ~month=1, ~date=1)\nformatter->Intl.DateTimeFormat.formatRangeToParts(~startDate=startDate, ~endDate=endDate)->Array.length > 0\n```" - ], - "signature": "let formatRangeToParts: (\n t,\n ~startDate: Date.t,\n ~endDate: Date.t,\n) => array" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(dateTimeFormat)` ignores the provided dateTimeFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/collator": { - "id": "Stdlib.Intl.Collator", - "name": "Collator", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.Collator.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Collator.usage", - "kind": "type", - "name": "usage", - "docstrings": [], - "signature": "type usage = [#search | #sort]" - }, - { - "id": "Stdlib.Intl.Collator.sensitivity", - "kind": "type", - "name": "sensitivity", - "docstrings": [], - "signature": "type sensitivity = [#accent | #base | #case | #variant]" - }, - { - "id": "Stdlib.Intl.Collator.caseFirst", - "kind": "type", - "name": "caseFirst", - "docstrings": [], - "signature": "type caseFirst = [#\"false\" | #lower | #upper]" - }, - { - "id": "Stdlib.Intl.Collator.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n usage?: usage,\n sensitivity?: sensitivity,\n ignorePunctuation?: bool,\n numeric?: bool,\n caseFirst?: caseFirst,\n}" - }, - { - "id": "Stdlib.Intl.Collator.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n usage: usage,\n sensitivity: sensitivity,\n ignorePunctuation: bool,\n collation: [\n | #compat\n | #default\n | #dict\n | #emoji\n | #eor\n | #phonebk\n | #phonetic\n | #pinyin\n | #stroke\n | #trad\n | #unihan\n | #zhuyin\n ],\n numeric?: bool,\n caseFirst?: caseFirst,\n}" - }, - { - "id": "Stdlib.Intl.Collator.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.Collator.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.Collator` instance that can compare strings using locale-aware rules.\n\nSee [`Intl.Collator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) on MDN.\n\n## Examples\n\n```rescript\nlet collator = Intl.Collator.make(~locales=[\"en\"])\ncollator->Intl.Collator.compare(\"apple\", \"banana\") < 0\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.Collator.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported by the runtime for collation.\n\nSee [`Intl.Collator.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.Collator.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.Collator.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(collator)` returns the locale and collation settings in use.\n\nSee [`Intl.Collator.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet collator = Intl.Collator.make(~locales=[\"en-US\"])\nIntl.Collator.resolvedOptions(collator).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.Collator.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(collator, a, b)` compares two strings using the rules of `collator`. Returns a negative number when `a` comes before `b`, `0` when equal, and a positive number otherwise.\n\n## Examples\n\n```rescript\nlet collator = Intl.Collator.make(~locales=[\"en-US\"])\ncollator->Intl.Collator.compare(\"apple\", \"banana\") < 0\n```" - ], - "signature": "let compare: (t, string, string) => int" - }, - { - "id": "Stdlib.Intl.Collator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(collator)` ignores the provided collator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/common": { - "id": "Stdlib.Intl.Common", - "name": "Common", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.Common.localeMatcher", - "kind": "type", - "name": "localeMatcher", - "docstrings": [], - "signature": "type localeMatcher = [#\"best fit\" | #lookup]" - }, - { - "id": "Stdlib.Intl.Common.calendar", - "kind": "type", - "name": "calendar", - "docstrings": [], - "signature": "type calendar = [\n | #buddhist\n | #chinese\n | #coptic\n | #dangi\n | #ethioaa\n | #ethiopic\n | #gregory\n | #hebrew\n | #indian\n | #islamic\n | #\"islamic-civil\"\n | #\"islamic-rgsa\"\n | #\"islamic-tbla\"\n | #\"islamic-umalqura\"\n | #iso8601\n | #japanese\n | #persian\n | #roc\n]" - }, - { - "id": "Stdlib.Intl.Common.collation", - "kind": "type", - "name": "collation", - "docstrings": [], - "signature": "type collation = [\n | #compat\n | #dict\n | #emoji\n | #eor\n | #phonebk\n | #phonetic\n | #pinyin\n | #stroke\n | #trad\n | #unihan\n | #zhuyin\n]" - }, - { - "id": "Stdlib.Intl.Common.numberingSystem", - "kind": "type", - "name": "numberingSystem", - "docstrings": [], - "signature": "type numberingSystem = [\n | #adlm\n | #ahom\n | #arab\n | #arabext\n | #bali\n | #beng\n | #bhks\n | #brah\n | #cakm\n | #cham\n | #deva\n | #diak\n | #fullwide\n | #gong\n | #gonm\n | #gujr\n | #guru\n | #hanidec\n | #hmng\n | #hmnp\n | #java\n | #kali\n | #kawi\n | #khmr\n | #knda\n | #lana\n | #lanatham\n | #laoo\n | #latn\n | #lepc\n | #limb\n | #mathbold\n | #mathdbl\n | #mathmono\n | #mathsanb\n | #mathsans\n | #mlym\n | #modi\n | #mong\n | #mroo\n | #mtei\n | #mymr\n | #mymrshan\n | #mymrtlng\n | #nagm\n | #newa\n | #nkoo\n | #olck\n | #orya\n | #osma\n | #rohg\n | #saur\n | #segment\n | #shrd\n | #sind\n | #sinh\n | #sora\n | #sund\n | #takr\n | #talu\n | #tamldec\n | #telu\n | #thai\n | #tibt\n | #tirh\n | #tnsa\n | #vaii\n | #wara\n | #wcho\n]" - }, - { - "id": "Stdlib.Intl.Common.oneTo21", - "kind": "type", - "name": "oneTo21", - "docstrings": [], - "signature": "type oneTo21 = [\n | #1\n | #10\n | #11\n | #12\n | #13\n | #14\n | #15\n | #16\n | #17\n | #18\n | #19\n | #2\n | #20\n | #21\n | #3\n | #4\n | #5\n | #6\n | #7\n | #8\n | #9\n]" - }, - { - "id": "Stdlib.Intl.Common.zeroTo20", - "kind": "type", - "name": "zeroTo20", - "docstrings": [], - "signature": "type zeroTo20 = [\n | #0\n | #1\n | #10\n | #11\n | #12\n | #13\n | #14\n | #15\n | #16\n | #17\n | #18\n | #19\n | #2\n | #20\n | #3\n | #4\n | #5\n | #6\n | #7\n | #8\n | #9\n]" - } - ] - }, - "stdlib/int/ref": { - "id": "Stdlib.Int.Ref", - "name": "Ref", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int.Ref.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = ref" - }, - { - "id": "Stdlib.Int.Ref.increment", - "kind": "value", - "name": "increment", - "docstrings": [ - "`increment(intRef)` increments the value of the provided reference by 1.\n\n ## Examples\n\n ```rescript\n let myRef = ref(4)\n Int.Ref.increment(myRef)\n myRef.contents == 5\n ```" - ], - "signature": "let increment: ref => unit" - }, - { - "id": "Stdlib.Int.Ref.decrement", - "kind": "value", - "name": "decrement", - "docstrings": [ - "`decrement(intRef)` decrements the value of the provided reference by 1.\n\n ## Examples\n\n ```rescript\n let myRef = ref(4)\n Int.Ref.decrement(myRef)\n myRef.contents == 3\n ```" - ], - "signature": "let decrement: ref => unit" - } - ] - }, - "stdlib/int/bitwise": { - "id": "Stdlib.Int.Bitwise", - "name": "Bitwise", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int.Bitwise.land", - "kind": "value", - "name": "land", - "docstrings": [], - "signature": "let land: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lor", - "kind": "value", - "name": "lor", - "docstrings": [], - "signature": "let lor: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lxor", - "kind": "value", - "name": "lxor", - "docstrings": [], - "signature": "let lxor: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lsl", - "kind": "value", - "name": "lsl", - "docstrings": [], - "signature": "let lsl: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lsr", - "kind": "value", - "name": "lsr", - "docstrings": [], - "signature": "let lsr: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.asr", - "kind": "value", - "name": "asr", - "docstrings": [], - "signature": "let asr: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lnot", - "kind": "value", - "name": "lnot", - "docstrings": [], - "signature": "let lnot: int => int", - "deprecated": "" - } - ] - }, - "stdlib/int/constants": { - "id": "Stdlib.Int.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int.Constants.minValue", - "kind": "value", - "name": "minValue", - "docstrings": [ - "The smallest positive number represented in JavaScript.\nSee [`Number.MIN_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE)\non MDN.\n\n ## Examples\n\n ```rescript\n Console.log(Int.Constants.minValue)\n ```" - ], - "signature": "let minValue: int" - }, - { - "id": "Stdlib.Int.Constants.maxValue", - "kind": "value", - "name": "maxValue", - "docstrings": [ - "The largest positive number represented in JavaScript.\nSee [`Number.MAX_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE)\non MDN.\n\n ## Examples\n\n ```rescript\n Console.log(Int.Constants.maxValue)\n ```" - ], - "signature": "let maxValue: int" - } - ] - }, - "stdlib/float/constants": { - "id": "Stdlib.Float.Constants", - "name": "Constants", - "docstrings": [ - "Float constants." - ], - "items": [ - { - "id": "Stdlib.Float.Constants.nan", - "kind": "value", - "name": "nan", - "docstrings": [ - "The special value \"Not a Number\"\nSee [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.nan\n ```" - ], - "signature": "let nan: float" - }, - { - "id": "Stdlib.Float.Constants.epsilon", - "kind": "value", - "name": "epsilon", - "docstrings": [ - "Represents the difference between 1 and the smallest floating point number greater than 1.\nSee [`Number.EPSILON`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.epsilon\n ```" - ], - "signature": "let epsilon: float" - }, - { - "id": "Stdlib.Float.Constants.positiveInfinity", - "kind": "value", - "name": "positiveInfinity", - "docstrings": [ - "The positive Infinity value\nSee [`Number.POSITIVE_INFINITY`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/POSITIVE_INFINITY) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.positiveInfinity\n ```" - ], - "signature": "let positiveInfinity: float" - }, - { - "id": "Stdlib.Float.Constants.negativeInfinity", - "kind": "value", - "name": "negativeInfinity", - "docstrings": [ - "The negative Infinity value\nSee [`Number.NEGATIVE_INFINITY`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.negativeInfinity\n ```" - ], - "signature": "let negativeInfinity: float" - }, - { - "id": "Stdlib.Float.Constants.minValue", - "kind": "value", - "name": "minValue", - "docstrings": [ - "The smallest positive numeric value representable in JavaScript.\nSee [`Number.MIN_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.minValue\n ```" - ], - "signature": "let minValue: float" - }, - { - "id": "Stdlib.Float.Constants.maxValue", - "kind": "value", - "name": "maxValue", - "docstrings": [ - "The maximum positive numeric value representable in JavaScript.\nSee [`Number.MAX_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.minValue\n ```" - ], - "signature": "let maxValue: float" - } - ] - }, - "stdlib/error/urierror": { - "id": "Stdlib.Error.URIError", - "name": "URIError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.URIError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `URIError` with the provided `message`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/typeerror": { - "id": "Stdlib.Error.TypeError", - "name": "TypeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.TypeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `TypeError` with the provided `message`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/syntaxerror": { - "id": "Stdlib.Error.SyntaxError", - "name": "SyntaxError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.SyntaxError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `SyntaxError` with the provided `message`.\n\n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/referenceerror": { - "id": "Stdlib.Error.ReferenceError", - "name": "ReferenceError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.ReferenceError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `ReferenceError` with the provided `message`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/rangeerror": { - "id": "Stdlib.Error.RangeError", - "name": "RangeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.RangeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `RangeError` with the provided `message`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/evalerror": { - "id": "Stdlib.Error.EvalError", - "name": "EvalError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.EvalError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `EvalError` with the provided `message`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/date/utc": { - "id": "Stdlib.Date.UTC", - "name": "UTC", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Date.UTC.makeWithYM", - "kind": "value", - "name": "makeWithYM", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYM(~year=2023, ~month=0)\n // 1672531200000\n \n Date.UTC.makeWithYM(~year=2023, ~month=11)\n // 1701388800000\n \n Date.UTC.makeWithYM(~year=2023, ~month=12)\n // 1704067200000\n \n Date.UTC.makeWithYM(~year=2023, ~month=-1)\n // 1669852800000\n ```" - ], - "signature": "let makeWithYM: (~year: int, ~month: int) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMD", - "kind": "value", - "name": "makeWithYMD", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=20)\n // 1676851200000\n \n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=-1)\n // 1675036800000\n \n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=29)\n // 1677628800000\n ```" - ], - "signature": "let makeWithYMD: (~year: int, ~month: int, ~day: int) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDH", - "kind": "value", - "name": "makeWithYMDH", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=16)\n // 1676908800000\n \n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=24)\n // 1676937600000\n \n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=-1)\n // 1676847600000\n ```" - ], - "signature": "let makeWithYMDH: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDHM", - "kind": "value", - "name": "makeWithYMDHM", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40)\n // 1676911200000\n \n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=60)\n // 1676912400000\n \n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=-1)\n // 1676908740000\n ```" - ], - "signature": "let makeWithYMDHM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDHMS", - "kind": "value", - "name": "makeWithYMDHMS", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0)\n // 1676911200000\n \n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=60)\n // 1676911260000\n \n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=-1)\n // 1676911199000\n ```" - ], - "signature": "let makeWithYMDHMS: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDHMSM", - "kind": "value", - "name": "makeWithYMDHMSM", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=0,\n )->Console.log\n // 1676911200000\n \n Date.UTC.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=1000,\n )->Console.log\n // 1676911201000\n \n Date.UTC.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=-1,\n )->Console.log\n // 1676911199999\n ```" - ], - "signature": "let makeWithYMDHMSM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => msSinceEpoch" - } - ] - }, - "stdlib/biguint64array": { - "id": "Stdlib.BigUint64Array", - "name": "BigUint64Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigUint64Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `BigUint64Array` typed array represents an array of 64-bit unsigned integers in platform byte order. See [BigUint64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.BigUint64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `BigUint64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.BigUint64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `BigUint64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.BigUint64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigUint64Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigUint64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `BigUint64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.BigUint64Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `BigUint64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => bigint=?) => t" - }, - { - "id": "Stdlib.BigUint64Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `BigUint64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigUint64Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bigUintArray)` ignores the provided bigUintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/bigint64array": { - "id": "Stdlib.BigInt64Array", - "name": "BigInt64Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigInt64Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `BigInt64Array` typed array represents an array of 64-bit signed integers in platform byte order. See [BigInt64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.BigInt64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `BigInt64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.BigInt64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `BigInt64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.BigInt64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt64Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `BigInt64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.BigInt64Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `BigInt64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => bigint=?) => t" - }, - { - "id": "Stdlib.BigInt64Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `BigInt64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt64Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bigIntArray)` ignores the provided bigIntArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint8clampedarray": { - "id": "Stdlib.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8ClampedArray.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint8ClampedArray` typed array represents an array of 8-bit unsigned integers clamped to 0-255. See [Uint8ClampedArray on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint8ClampedArray` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint8ClampedArray` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint8ClampedArray` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint8ClampedArray` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8ClampedArray.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint32array": { - "id": "Stdlib.Uint32Array", - "name": "Uint32Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint32Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint32Array` typed array represents an array of 32-bit unsigned integers in platform byte order. See [Uint32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint32Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint32Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint32Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint32Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint32Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint16array": { - "id": "Stdlib.Uint16Array", - "name": "Uint16Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint16Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint16Array` typed array represents an array of 16-bit unsigned integers in platform byte order. See [Uint16Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint16Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint16Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint16Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint16Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint16Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint16Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint16Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint16Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint16Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint16Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint16Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint16Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint8array": { - "id": "Stdlib.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint8Array` typed array represents an array of 8-bit unsigned integers. See [Uint8Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint8Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint8Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint8Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint8Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint8Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint8Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint8Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint8Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint8Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint8Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/int32array": { - "id": "Stdlib.Int32Array", - "name": "Int32Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int32Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Int32Array` typed array represents an array of twos-complemenet 32-bit signed integers in platform byte order. See [Int32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Int32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Int32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Int32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Int32Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Int32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int32Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Int32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Int32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Int32Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Int32Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int32Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/int16array": { - "id": "Stdlib.Int16Array", - "name": "Int16Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int16Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Int16Array` typed array represents an array of twos-complement 16-bit signed integers in platform byte order. See [Int16Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Int16Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int16Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Int16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Int16Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Int16Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int16Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Int16Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Int16Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int16Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Int16Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int16Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int16Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/int8array": { - "id": "Stdlib.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int8Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Int8Array` typed array represents an array of twos-complement 8-bit signed integers. See [Int8Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Int8Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int8Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Int8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Int8Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Int8Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int8Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Int8Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Int8Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int8Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Int8Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int8Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int8Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/float64array": { - "id": "Stdlib.Float64Array", - "name": "Float64Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float64Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Float64Array` typed array represents an array of 64-bit floating point numbers in platform byte order. See [Float64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Float64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Float64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Float64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Float64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Float64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float64Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Float64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Float64Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Float64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => float=?) => t" - }, - { - "id": "Stdlib.Float64Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Float64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float64Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/float32array": { - "id": "Stdlib.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float32Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Float32Array` typed array represents an array of 32-bit floating point numbers in platform byte order. See [Float32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Float32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Float32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Float32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Float32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Float32Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float32Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Float32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Float32Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Float32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => float=?) => t" - }, - { - "id": "Stdlib.Float32Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Float32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float32Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/typedarray": { - "id": "Stdlib.TypedArray", - "name": "TypedArray", - "docstrings": [], - "items": [ - { - "id": "Stdlib.TypedArray.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.TypedArray.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```" - ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```" - ], - "signature": "let set: (t<'a>, int, 'a) => unit" - }, - { - "id": "Stdlib.TypedArray.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [ - "`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN." - ], - "signature": "let buffer: t<'a> => ArrayBuffer.t" - }, - { - "id": "Stdlib.TypedArray.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [ - "`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```" - ], - "signature": "let byteLength: t<'a> => int" - }, - { - "id": "Stdlib.TypedArray.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [ - "`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN." - ], - "signature": "let byteOffset: t<'a> => int" - }, - { - "id": "Stdlib.TypedArray.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [ - "`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```" - ], - "signature": "let setArray: (t<'a>, array<'a>) => unit" - }, - { - "id": "Stdlib.TypedArray.setArrayFrom", - "kind": "value", - "name": "setArrayFrom", - "docstrings": [ - "`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```" - ], - "signature": "let setArrayFrom: (t<'a>, array<'a>, int) => unit" - }, - { - "id": "Stdlib.TypedArray.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```" - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Stdlib.TypedArray.copyAllWithin", - "kind": "value", - "name": "copyAllWithin", - "docstrings": [ - "`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```" - ], - "signature": "let copyAllWithin: (t<'a>, ~target: int) => array<'a>" - }, - { - "id": "Stdlib.TypedArray.copyWithinToEnd", - "kind": "value", - "name": "copyWithinToEnd", - "docstrings": [ - "`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```" - ], - "signature": "let copyWithinToEnd: (t<'a>, ~target: int, ~start: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [ - "`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```" - ], - "signature": "let copyWithin: (t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>" - }, - { - "id": "Stdlib.TypedArray.fillAll", - "kind": "value", - "name": "fillAll", - "docstrings": [ - "`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```" - ], - "signature": "let fillAll: (t<'a>, 'a) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.fillToEnd", - "kind": "value", - "name": "fillToEnd", - "docstrings": [ - "`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array." - ], - "signature": "let fillToEnd: (t<'a>, 'a, ~start: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.fill", - "kind": "value", - "name": "fill", - "docstrings": [ - "`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```" - ], - "signature": "let fill: (t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN." - ], - "signature": "let reverse: t<'a> => unit" - }, - { - "id": "Stdlib.TypedArray.toReversed", - "kind": "value", - "name": "toReversed", - "docstrings": [ - "`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```" - ], - "signature": "let toReversed: t<'a> => t<'a>" - }, - { - "id": "Stdlib.TypedArray.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN." - ], - "signature": "let sort: (t<'a>, ('a, 'a) => Ordering.t) => unit" - }, - { - "id": "Stdlib.TypedArray.toSorted", - "kind": "value", - "name": "toSorted", - "docstrings": [ - "`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```" - ], - "signature": "let toSorted: (t<'a>, ('a, 'a) => Ordering.t) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.with", - "kind": "value", - "name": "with", - "docstrings": [ - "`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```" - ], - "signature": "let with: (t<'a>, int, 'a) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```" - ], - "signature": "let includes: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.TypedArray.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN." - ], - "signature": "let indexOf: (t<'a>, 'a) => int" - }, - { - "id": "Stdlib.TypedArray.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`." - ], - "signature": "let indexOfFrom: (t<'a>, 'a, int) => int" - }, - { - "id": "Stdlib.TypedArray.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```" - ], - "signature": "let joinWith: (t<'a>, string) => string" - }, - { - "id": "Stdlib.TypedArray.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN." - ], - "signature": "let lastIndexOf: (t<'a>, 'a) => int" - }, - { - "id": "Stdlib.TypedArray.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`." - ], - "signature": "let lastIndexOfFrom: (t<'a>, 'a, int) => int" - }, - { - "id": "Stdlib.TypedArray.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN." - ], - "signature": "let slice: (t<'a>, ~start: int, ~end: int=?) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array." - ], - "signature": "let sliceToEnd: (t<'a>, ~start: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(typedArray)` produces a shallow copy of the typed array." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Stdlib.TypedArray.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN." - ], - "signature": "let subarray: (t<'a>, ~start: int, ~end: int=?) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.subarrayToEnd", - "kind": "value", - "name": "subarrayToEnd", - "docstrings": [ - "`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer." - ], - "signature": "let subarrayToEnd: (t<'a>, ~start: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```" - ], - "signature": "let toString: t<'a> => string" - }, - { - "id": "Stdlib.TypedArray.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN." - ], - "signature": "let toLocaleString: t<'a> => string" - }, - { - "id": "Stdlib.TypedArray.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN." - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.everyWithIndex", - "kind": "value", - "name": "everyWithIndex", - "docstrings": [ - "`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`." - ], - "signature": "let everyWithIndex: (t<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN." - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`." - ], - "signature": "let filterWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN." - ], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findWithIndex", - "kind": "value", - "name": "findWithIndex", - "docstrings": [ - "`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index." - ], - "signature": "let findWithIndex: (t<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findLast", - "kind": "value", - "name": "findLast", - "docstrings": [ - "`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN." - ], - "signature": "let findLast: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findLastWithIndex", - "kind": "value", - "name": "findLastWithIndex", - "docstrings": [ - "`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`." - ], - "signature": "let findLastWithIndex: (t<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [ - "`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN." - ], - "signature": "let findIndex: (t<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.TypedArray.findIndexWithIndex", - "kind": "value", - "name": "findIndexWithIndex", - "docstrings": [ - "`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`." - ], - "signature": "let findIndexWithIndex: (t<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.TypedArray.findLastIndex", - "kind": "value", - "name": "findLastIndex", - "docstrings": [ - "`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN." - ], - "signature": "let findLastIndex: (t<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.TypedArray.findLastIndexWithIndex", - "kind": "value", - "name": "findLastIndexWithIndex", - "docstrings": [ - "`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`." - ], - "signature": "let findLastIndexWithIndex: (t<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.TypedArray.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN." - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.TypedArray.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index." - ], - "signature": "let forEachWithIndex: (t<'a>, ('a, int) => unit) => unit" - }, - { - "id": "Stdlib.TypedArray.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.TypedArray.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index." - ], - "signature": "let mapWithIndex: (t<'a>, ('a, int) => 'b) => t<'b>" - }, - { - "id": "Stdlib.TypedArray.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN." - ], - "signature": "let reduce: (t<'a>, ('b, 'a) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`." - ], - "signature": "let reduceWithIndex: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [ - "`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN." - ], - "signature": "let reduceRight: (t<'a>, ('b, 'a) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.reduceRightWithIndex", - "kind": "value", - "name": "reduceRightWithIndex", - "docstrings": [ - "`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`." - ], - "signature": "let reduceRightWithIndex: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN." - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.someWithIndex", - "kind": "value", - "name": "someWithIndex", - "docstrings": [ - "`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index." - ], - "signature": "let someWithIndex: (t<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/arraybuffer": { - "id": "Stdlib.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [ - "Functions for interacting with JavaScript ArrayBuffer.\nSee: [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)." - ], - "items": [ - { - "id": "Stdlib.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an ArrayBuffer object used to represent a generic raw binary data buffer." - ], - "signature": "type t" - }, - { - "id": "Stdlib.ArrayBuffer.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(length)` creates a new ArrayBuffer with the specified length in bytes.\nSee [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/ArrayBuffer) on MDN.\n\n## Examples\n\n```rescript\nlet buffer = ArrayBuffer.make(8)\nArrayBuffer.byteLength(buffer) == 8\n```\n\n## Exceptions\n\n- `RangeError`: If `length` is larger than `Number.MAX_SAFE_INTEGER` or negative." - ], - "signature": "let make: int => t" - }, - { - "id": "Stdlib.ArrayBuffer.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [ - "`byteLength(arrayBuffer)` returns the size, in bytes, of the ArrayBuffer.\nSee [`ArrayBuffer.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet buffer = ArrayBuffer.make(16)\nArrayBuffer.byteLength(buffer) == 16\n```" - ], - "signature": "let byteLength: t => int" - }, - { - "id": "Stdlib.ArrayBuffer.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(arrayBuffer, ~start, ~end)` returns a new ArrayBuffer whose contents are a copy of this ArrayBuffer's bytes from `start`, inclusive, up to `end`, exclusive.\nSee [`ArrayBuffer.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/slice) on MDN.\n\n## Examples\n\n```rescript\nlet buffer = ArrayBuffer.make(16)\nlet sliced = buffer->ArrayBuffer.slice(~start=4, ~end=12)\nArrayBuffer.byteLength(sliced) == 8\n```" - ], - "signature": "let slice: (t, ~start: int=?, ~end: int=?) => t" - }, - { - "id": "Stdlib.ArrayBuffer.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [], - "signature": "let sliceToEnd: (t, ~start: int) => t", - "deprecated": "" - } - ] - }, - "stdlib/weakset": { - "id": "Stdlib.WeakSet", - "name": "WeakSet", - "docstrings": [ - "Bindings to JavaScript's `WeakSet`.\n\nWeak sets store references to objects without preventing those objects from being garbage collected." - ], - "items": [ - { - "id": "Stdlib.WeakSet.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Mutable weak set storing object references of type `'a`." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.WeakSet.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates an empty weak set.\n\nSee [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) on MDN.\n\n## Examples\n\n```rescript\nlet visited = WeakSet.make()\nWeakSet.has(visited, Object.make()) == false\n```" - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Stdlib.WeakSet.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(set, value)` inserts `value` into the weak set and returns the set for chaining.\n\nSee [`WeakSet.prototype.add`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/add) on MDN.\n\n## Examples\n\n```rescript\nlet set = WeakSet.make()\nlet node = Object.make()\nWeakSet.add(set, node)\nWeakSet.has(set, node) == true\n```" - ], - "signature": "let add: (t<'a>, 'a) => t<'a>" - }, - { - "id": "Stdlib.WeakSet.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "`delete(set, value)` removes `value` and returns `true` if an entry existed.\n\nSee [`WeakSet.prototype.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/delete) on MDN.\n\n## Examples\n\n```rescript\nlet set = WeakSet.make()\nlet node = Object.make()\nlet _ = WeakSet.add(set, node)\nWeakSet.delete(set, node) == true\nWeakSet.delete(set, node) == false\n```" - ], - "signature": "let delete: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.WeakSet.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(set, value)` checks whether `value` exists in the weak set.\n\nSee [`WeakSet.prototype.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/has) on MDN.\n\n## Examples\n\n```rescript\nlet set = WeakSet.make()\nlet node = Object.make()\nWeakSet.has(set, node) == false\nlet _ = WeakSet.add(set, node)\nWeakSet.has(set, node) == true\n```" - ], - "signature": "let has: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.WeakSet.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(weakSet)` ignores the provided weakSet and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/set": { - "id": "Stdlib.Set", - "name": "Set", - "docstrings": [ - "Bindings to the mutable JavaScript `Set`.\n\nSee [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) on MDN." - ], - "items": [ - { - "id": "Stdlib.Set.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an instance of `Set`." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.Set.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new, mutable JavaScript `Set`. A `Set` is a collection of unique values.\n\nSee [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) on MDN.\n\n\n\n## Examples\n```rescript\n// You can annotate the type of your set if you want to\nlet mySet: Set.t = Set.make()\n\n// Or you can let ReScript infer what's in your Set\nlet set = Set.make()\nset->Set.add(\"Fine name\") // Inferred as Set.t\n```\n\n## Alternatives\nA JavaScript `Set` is mutable. If you're looking for an immutable alternative, check out `Belt.Set`." - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Stdlib.Set.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Turns an array of values into a Set. Meaning only unique values are preserved.\n\n## Examples\n```rescript\ntype languages = ReScript | JavaScript | TypeScript\nlet languageRank = [ReScript, JavaScript, TypeScript]\n\nlet set = Set.fromArray(languageRank) // Set.t\n\nswitch set->Set.has(ReScript) {\n| true => Console.log(\"Yay, ReScript is in there!\")\n| false => Console.log(\"Uh-oh, something is _terribly_ wrong with this program... abort.\")\n}\n```" - ], - "signature": "let fromArray: array<'a> => t<'a>" - }, - { - "id": "Stdlib.Set.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "Turns an iterator into a `Set`.\n\n## Examples\n\n```rescript\n// Let's pretend we have an interator\nlet iterator: Iterator.t = %raw(`\n (() => {\n var array1 = ['a', 'b', 'c'];\n var iterator1 = array1[Symbol.iterator]();\n return iterator1\n })()\n`)\n\niterator\n->Set.fromIterator\n->Set.size == 3\n```" - ], - "signature": "let fromIterator: Iterator.t<'a> => t<'a>" - }, - { - "id": "Stdlib.Set.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns the size, the number of unique values, of the set.\n\nSee [`Set.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/size) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\n\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue2\")\n\nlet size = set->Set.size // 2\n```" - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Stdlib.Set.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(set)` returns `true` if the set has no values, `false` otherwise.\n\n## Examples\n```rescript\nlet emptySet = Set.make()\nemptySet->Set.isEmpty->assertEqual(true)\n\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.isEmpty->assertEqual(false)\n\n// After clearing the set\nset->Set.clear\nset->Set.isEmpty->assertEqual(true)\n```" - ], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Stdlib.Set.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Clears all entries in the set.\n\nSee [`Set.clear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/clear) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\n\nset->Set.add(\"someKey\")\nset->Set.size // 1\n\nset->Set.clear\nset->Set.size // 0\n```" - ], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Stdlib.Set.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds a new value to the set.\n\nSee [`Set.add`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/add) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\n```" - ], - "signature": "let add: (t<'a>, 'a) => unit" - }, - { - "id": "Stdlib.Set.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "Deletes the provided `value` from the set. Returns a `bool` for whether the value existed, and was deleted.\n\nSee [`Set.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nlet didDeleteValue = set->Set.delete(\"someValue\")\nConsole.log(didDeleteValue) // Logs `true` to the console, becuase the set had the value, so it was successfully deleted\n\nlet didDeleteValue = set->Set.delete(\"someNonExistantKey\")\nConsole.log(didDeleteValue) // Logs `false` to the console, becuase the value did not exist in the set\n```" - ], - "signature": "let delete: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.Set.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks whether the set has a specific value.\n\nSee [`Set.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/has) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\n\nswitch set->Set.has(\"someValue\") {\n| false => Console.log(\"Nope, didn't have it.\")\n| true => Console.log(\"Yay, we have the value!\")\n}\n```" - ], - "signature": "let has: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.Set.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Iterates through all values of the set.\n\nSee [`Set.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/forEach) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue2\")\n\nset->Set.forEach(value => {\n Console.log(value)\n})\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Set.values", - "kind": "value", - "name": "values", - "docstrings": [ - "Returns an iterator that holds all values of the set.\n\nSee [`Set.values`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/values) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.add(\"anotherValue\")\n\nlet values = set->Set.values\n\n// Logs the first value\nConsole.log(Iterator.next(values).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh values iterator to get an array of all values, since we consumed a value via `next` above already.\nConsole.log(set->Set.values->Iterator.toArray)\n```" - ], - "signature": "let values: t<'a> => Iterator.t<'a>" - }, - { - "id": "Stdlib.Set.difference", - "kind": "value", - "name": "difference", - "docstrings": [ - "Returns a new set with the values of the set that are not in the other set.\n\nSee [`Set.difference`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/difference) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.difference(set2) // Set.fromArray([\"orange\"])\n```" - ], - "signature": "let difference: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.symmetricDifference", - "kind": "value", - "name": "symmetricDifference", - "docstrings": [ - "Returns a new set with the values containing the values which are in either the set, but not in both.\n\nSee [`Set.symmetricDifference`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/symmetricDifference) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.symmetricDifference(set2) // Set.fromArray([\"orange\", \"pear\"])\n```" - ], - "signature": "let symmetricDifference: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.intersection", - "kind": "value", - "name": "intersection", - "docstrings": [ - "Returns a new set with the values containing the values which are in both the set and the other set.\n\nSee [`Set.intersection`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/intersection) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.intersection(set2) // Set.fromArray([\"apple\", \"banana\"])\n```" - ], - "signature": "let intersection: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.isDisjointFrom", - "kind": "value", - "name": "isDisjointFrom", - "docstrings": [ - "Returns a bool indicating if this set has no elements in common with the given set.\n\nSee [`Set.isDisjointFrom`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isDisjointFrom) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"kiwi\", \"melon\", \"pear\"])\nset1->Set.isDisjointFrom(set2) // true\n```" - ], - "signature": "let isDisjointFrom: (t<'a>, t<'a>) => bool" - }, - { - "id": "Stdlib.Set.isSubsetOf", - "kind": "value", - "name": "isSubsetOf", - "docstrings": [ - "Returns a bool indicating if the all values in the set are in the given set.\n\nSee [`Set.isSubsetOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isSubsetOf) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.isSubsetOf(set2) // true\n```" - ], - "signature": "let isSubsetOf: (t<'a>, t<'a>) => bool" - }, - { - "id": "Stdlib.Set.isSupersetOf", - "kind": "value", - "name": "isSupersetOf", - "docstrings": [ - "Returns a bool indicating if the all values in the given set are in the set.\n\nSee [`Set.isSupersetOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isSupersetOf) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\"])\nset1->Set.isSupersetOf(set2) // true\n```" - ], - "signature": "let isSupersetOf: (t<'a>, t<'a>) => bool" - }, - { - "id": "Stdlib.Set.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns a new set with the values of the set that are in both the set and the other set.\n\nSee [`Set.union`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/union) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.union(set2) // Set.fromArray([\"apple\", \"orange\", \"banana\", \"pear\"])\n```" - ], - "signature": "let union: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(set)` returns an array of all values of the set.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n```rescript\nlet set = Set.fromArray([\"apple\", \"orange\", \"apple\", \"banana\"])\nset->Set.toArray // [\"apple\", \"orange\", \"banana\"]\n```" - ], - "signature": "let toArray: t<'a> => array<'a>" - }, - { - "id": "Stdlib.Set.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(set)` ignores the provided set and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/weakmap": { - "id": "Stdlib.WeakMap", - "name": "WeakMap", - "docstrings": [ - "Bindings to JavaScript's `WeakMap`.\n\nWeak maps keep key/value pairs where keys must be objects and the references do not prevent garbage collection." - ], - "items": [ - { - "id": "Stdlib.WeakMap.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Mutable weak map storing values of type `'v` with object keys `'k`." - ], - "signature": "type t<'k, 'v>" - }, - { - "id": "Stdlib.WeakMap.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates an empty weak map.\n\nSee [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nWeakMap.get(cache, Object.make()) == None\n```" - ], - "signature": "let make: unit => t<'k, 'v>" - }, - { - "id": "Stdlib.WeakMap.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(map, key)` returns `Some(value)` when `key` exists, otherwise `None`.\n\nSee [`WeakMap.prototype.get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/get) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nWeakMap.get(cache, key) == None\nlet _ = WeakMap.set(cache, key, \"user\")\nWeakMap.get(cache, key) == Some(\"user\")\n```" - ], - "signature": "let get: (t<'k, 'v>, 'k) => option<'v>" - }, - { - "id": "Stdlib.WeakMap.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(map, key)` checks whether `key` exists in the weak map.\n\nSee [`WeakMap.prototype.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/has) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nWeakMap.has(cache, key) == false\nlet _ = WeakMap.set(cache, key, ())\nWeakMap.has(cache, key) == true\n```" - ], - "signature": "let has: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.WeakMap.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(map, key, value)` stores `value` for `key` and returns the map for chaining.\n\nSee [`WeakMap.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/set) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nlet _ = WeakMap.set(cache, key, 42)\nWeakMap.get(cache, key) == Some(42)\n```" - ], - "signature": "let set: (t<'k, 'v>, 'k, 'v) => t<'k, 'v>" - }, - { - "id": "Stdlib.WeakMap.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "`delete(map, key)` removes `key` and returns `true` if an entry existed.\n\nSee [`WeakMap.prototype.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/delete) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nWeakMap.delete(cache, key) == false\nlet _ = WeakMap.set(cache, key, 1)\nWeakMap.delete(cache, key) == true\n```" - ], - "signature": "let delete: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.WeakMap.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(weakMap)` ignores the provided weakMap and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'k, 'v> => unit" - } - ] - }, - "stdlib/map": { - "id": "Stdlib.Map", - "name": "Map", - "docstrings": [ - "Bindings to the mutable JavaScript `Map`.\n\nSee [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) on MDN." - ], - "items": [ - { - "id": "Stdlib.Map.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an instance of `Map`." - ], - "signature": "type t<'k, 'v>" - }, - { - "id": "Stdlib.Map.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new, mutable JavaScript `Map`. A `Map` can have any values as both keys and values.\n\nSee [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) on MDN.\n\n\n\n## Examples\n```rescript\n`make()`\n// You can annotate the type of your map if you want to\nlet myMap: Map.t = Map.make()\n\n// Or you can let ReScript infer what's in your map\nlet map = Map.make()\nmap->Map.set(\"lang\", \"ReScript\") // Inferred as Map.t\n```\n\n## Alternatives\nA JavaScript `Map` is mutable. If you're looking for an immutable alternative, check out`Belt.Map`." - ], - "signature": "let make: unit => t<'k, 'v>" - }, - { - "id": "Stdlib.Map.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Turns an array of key/value pairs into a Map.\n\n## Examples\n```rescript\ntype languages = ReScript | JavaScript | TypeScript\nlet languageRank = [(ReScript, 1), (JavaScript, 2), (TypeScript, 3)]\n\nlet map = Map.fromArray(languageRank) // Map.t\n\nswitch map->Map.get(ReScript) {\n| Some(1) => Console.log(\"Yay, ReScript is #1!\")\n| _ => Console.log(\"Uh-oh, something is _terribly_ wrong with this program... abort.\")\n}\n```" - ], - "signature": "let fromArray: array<('k, 'v)> => t<'k, 'v>" - }, - { - "id": "Stdlib.Map.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "Turns an iterator in the shape of `('key, 'value)` into a `Map`.\n\n## Examples\n\n```rescript\n// Let's pretend we have an interator in the correct shape\nlet iterator: Iterator.t<(string, string)> = %raw(`\n (() => {\n var map1 = new Map();\n\n map1.set('first', '1');\n map1.set('second', '2');\n\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\n\niterator\n->Map.fromIterator\n->Map.size == 2\n```" - ], - "signature": "let fromIterator: Iterator.t<('k, 'v)> => t<'k, 'v>" - }, - { - "id": "Stdlib.Map.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns the size, the number of key/value pairs, of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\n\nmap->Map.set(\"someKey\", \"someValue\")\n\nlet size = map->Map.size // 1\n```" - ], - "signature": "let size: t<'k, 'v> => int" - }, - { - "id": "Stdlib.Map.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(map)` returns `true` if the map has no key/value pairs, `false` otherwise.\n\n## Examples\n```rescript\nlet emptyMap = Map.make()\nemptyMap->Map.isEmpty->assertEqual(true)\n\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.isEmpty->assertEqual(false)\n\n// After clearing the map\nmap->Map.clear\nmap->Map.isEmpty->assertEqual(true)\n```" - ], - "signature": "let isEmpty: t<'k, 'v> => bool" - }, - { - "id": "Stdlib.Map.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Clears all entries in the map.\n\n## Examples\n```rescript\nlet map = Map.make()\n\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.size // 1\n\nmap->Map.clear\nmap->Map.size // 0\n```" - ], - "signature": "let clear: t<'k, 'v> => unit" - }, - { - "id": "Stdlib.Map.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Iterates through all values of the map.\n\n> Please note that this is *without the keys*, just the values. If you need the key as well, use `Map.forEachWithKey`.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\nmap->Map.forEach(value => {\n Console.log(value)\n})\n```" - ], - "signature": "let forEach: (t<'k, 'v>, 'v => unit) => unit" - }, - { - "id": "Stdlib.Map.forEachWithKey", - "kind": "value", - "name": "forEachWithKey", - "docstrings": [ - "Iterates through all values of the map, including the key for each value.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\nmap->Map.forEachWithKey((value, key) => {\n Console.log2(value, key)\n})\n```" - ], - "signature": "let forEachWithKey: (t<'k, 'v>, ('v, 'k) => unit) => unit" - }, - { - "id": "Stdlib.Map.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the value for a key, if a value exists at that key.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n\nswitch map->Map.get(\"someKey\") {\n| None => Console.log(\"Nope, didn't have it.\")\n| Some(value) => Console.log2(\"Yay, had the value, and it's:\", value)\n}\n```" - ], - "signature": "let get: (t<'k, 'v>, 'k) => option<'v>" - }, - { - "id": "Stdlib.Map.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks whether the map has a specific key.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n\nswitch map->Map.has(\"someKey\") {\n| false => Console.log(\"Nope, didn't have it.\")\n| true => Console.log(\"Yay, we have the value!\")\n}\n```" - ], - "signature": "let has: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.Map.set", - "kind": "value", - "name": "set", - "docstrings": [ - "Sets the provided `value` to the provided `key`.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n```" - ], - "signature": "let set: (t<'k, 'v>, 'k, 'v) => unit" - }, - { - "id": "Stdlib.Map.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "Deletes the provided `key` and its value from the map. Returns a `bool` for whether the key existed, and was deleted.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nlet didDeleteKey = map->Map.delete(\"someKey\")\nConsole.log(didDeleteKey) // Logs `true` to the console, becuase the map had the key, so it was successfully deleted\n\nlet didDeleteKey = map->Map.delete(\"someNonExistantKey\")\nConsole.log(didDeleteKey) // Logs `false` to the console, becuase the key did not exist\n```" - ], - "signature": "let delete: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.Map.keys", - "kind": "value", - "name": "keys", - "docstrings": [ - "Returns an iterator that holds all keys of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet keys = map->Map.keys\n\n// Logs the first key\nConsole.log(Iterator.next(keys).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh keys iterator to get an array of all keys, since we consumed a value via `next` above already.\nConsole.log(map->Map.keys->Iterator.toArray)\n```" - ], - "signature": "let keys: t<'k, 'v> => Iterator.t<'k>" - }, - { - "id": "Stdlib.Map.values", - "kind": "value", - "name": "values", - "docstrings": [ - "Returns an iterator that holds all values of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet values = map->Map.values\n\n// Logs the first value\nConsole.log(Iterator.next(values).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh values iterator to get an array of all values, since we consumed a value via `next` above already.\nConsole.log(map->Map.values->Iterator.toArray)\n```" - ], - "signature": "let values: t<'k, 'v> => Iterator.t<'v>" - }, - { - "id": "Stdlib.Map.entries", - "kind": "value", - "name": "entries", - "docstrings": [ - "Returns an iterator that holds all entries of the map.\nAn entry is represented as a tuple of `('key, 'value)`,\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet entries = map->Map.entries\n\n// Logs the first value\nConsole.log(Iterator.next(entries).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes entries. We'll need a fresh entries iterator to get an array of all entries, since we consumed a value via `next` above already.\nConsole.log(map->Map.entries->Iterator.toArray)\n```" - ], - "signature": "let entries: t<'k, 'v> => Iterator.t<('k, 'v)>" - }, - { - "id": "Stdlib.Map.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(map)` ignores the provided map and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'k, 'v> => unit" - } - ] - }, - "stdlib/asynciterator": { - "id": "Stdlib.AsyncIterator", - "name": "AsyncIterator", - "docstrings": [ - "Bindings to async iterators, a way to do async iteration in JavaScript.\n\nSee [async iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) on MDN." - ], - "items": [ - { - "id": "Stdlib.AsyncIterator.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type representing an async iterator." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.AsyncIterator.value", - "kind": "type", - "name": "value", - "docstrings": [], - "signature": "type value<'a> = {done: bool, value: option<'a>}" - }, - { - "id": "Stdlib.AsyncIterator.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(nextFn)`\n\nCreates an async iterator from a function that returns the next value of the iterator.\n\n## Examples\n\n- A simple example, creating an async iterator that returns 1, 2, 3:\n\n```rescript\nlet context = ref(0)\n\nlet asyncIterator = AsyncIterator.make(async () => {\n let currentValue = context.contents\n // Increment current value\n context := currentValue + 1\n\n {\n AsyncIterator.value: Some(currentValue),\n done: currentValue >= 3,\n }\n})\n\n// This will log 1, 2, 3\nlet main = async () =>\n await asyncIterator->AsyncIterator.forEach(value =>\n switch value {\n | Some(value) => Console.log(value)\n | None => ()\n }\n )\n\nmain()->ignore\n```" - ], - "signature": "let make: (unit => promise>) => t<'value>" - }, - { - "id": "Stdlib.AsyncIterator.value", - "kind": "value", - "name": "value", - "docstrings": [ - "`value(value)`\n\nShorthand for creating a value object with the provided value, and the `done` property set to false.\n\n## Examples\n\n```rescript\nlet context = ref(0)\n\nlet asyncIterator = AsyncIterator.make(async () => {\n let currentValue = context.contents\n // Increment current value\n context := currentValue + 1\n\n if currentValue >= 3 {\n AsyncIterator.done()\n } else {\n AsyncIterator.value(currentValue)\n }\n})\n```" - ], - "signature": "let value: 'value => value<'value>" - }, - { - "id": "Stdlib.AsyncIterator.done", - "kind": "value", - "name": "done", - "docstrings": [ - "`done(~finalValue=?)`\n\n Shorthand for creating a value object with the `done` property set to true, and the provided value as the final value, if any.\n\n ## Examples\n ```rescript\n let context = ref(0)\n \n let asyncIterator = AsyncIterator.make(async () => {\n let currentValue = context.contents\n // Increment current value\n context := currentValue + 1\n \n if currentValue >= 3 {\n AsyncIterator.done()\n } else {\n AsyncIterator.value(currentValue)\n }\n })\n ```" - ], - "signature": "let done: (~finalValue: 'value=?) => value<'value>" - }, - { - "id": "Stdlib.AsyncIterator.next", - "kind": "value", - "name": "next", - "docstrings": [ - "`next(asyncIterator)`\n\nReturns the next value of the iterator, if any.\n\nSee [async iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) on MDN.\n\n## Examples\n\n- A simple example, getting the next value:\n\n```rescript\nlet asyncIterator: AsyncIterator.t<(string, string)> = %raw(`\n (() => {\n var map1 = new Map();\n\n map1.set('first', '1');\n map1.set('second', '2');\n\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\n\nlet processMyAsyncIterator = async () => {\n // ReScript doesn't have `for ... of` loops, but it's easy to mimic using a while loop.\n let break = ref(false)\n\n while !break.contents {\n // Await the next iterator value\n let {value, done} = await asyncIterator->AsyncIterator.next\n\n // Exit the while loop if the iterator says it's done\n break := done\n\n if done {\n value->Option.isNone == true\n }\n }\n}\n\nprocessMyAsyncIterator()->ignore\n```" - ], - "signature": "let next: t<'a> => promise>" - }, - { - "id": "Stdlib.AsyncIterator.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(iterator, fn)` consumes all values in the async iterator and runs the callback `fn` for each value.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n\n```rescript\n// Let's pretend we get an async iterator returning ints from somewhere.\nlet asyncIterator: AsyncIterator.t<(string, string)> = %raw(`\n (() => {\n var map1 = new Map();\n\n map1.set('first', '1');\n map1.set('second', '2');\n\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\n\nlet main = async () =>\n await asyncIterator->AsyncIterator.forEach(v => {\n switch v {\n | Some((\"second\", value)) => value == \"2\"\n | _ => ()\n }\n })\n\nmain()->ignore\n```" - ], - "signature": "let forEach: (t<'a>, option<'a> => unit) => promise" - }, - { - "id": "Stdlib.AsyncIterator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(iterator)` ignores the provided async iterator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/iterator": { - "id": "Stdlib.Iterator", - "name": "Iterator", - "docstrings": [ - "Bindings to JavaScript iterators.\n\nSee [`Iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) on MDN." - ], - "items": [ - { - "id": "Stdlib.Iterator.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type representing an iterator." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.Iterator.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The current value of an iterator." - ], - "signature": "type value<'a> = {done: bool, value: option<'a>}" - }, - { - "id": "Stdlib.Iterator.next", - "kind": "value", - "name": "next", - "docstrings": [ - "Returns the next value of the iterator, if any.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n\n```rescript\nlet iterator: Iterator.t = %raw(`\n (() => {\n var array1 = ['a'];\n var iterator1 = array1[Symbol.iterator]();\n return iterator1\n })()\n`)\n(iterator->Iterator.next).done == false\n(iterator->Iterator.next).done == true\n```" - ], - "signature": "let next: t<'a> => value<'a>" - }, - { - "id": "Stdlib.Iterator.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Turns an iterator into an array of the remaining values.\nRemember that each invocation of `next` of an iterator consumes a value. `Iterator.toArray` will consume all remaining values of the iterator and return them in an array to you.\n\nSee [Iterator.prototype.toArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/toArray) on MDN.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\n// `Map.keys` returns all keys of the map as an iterator.\nlet mapKeysAsArray = map->Map.keys->Iterator.toArray\n\nmapKeysAsArray == [\"someKey\", \"someKey2\"]\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let toArray: t<'a> => array<'a>" - }, - { - "id": "Stdlib.Iterator.toArrayWithMapper", - "kind": "value", - "name": "toArrayWithMapper", - "docstrings": [ - "`toArray(iterator)` turns `iterator` into an array of its remaining values, applying the provided mapper function on each item.\nRemember that each invocation of `next` of an iterator consumes a value. `Iterator.toArrayWithMapper` will consume all remaining values of the iterator and return them in an array to you.\n\nSee [Iterator.prototype.toArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/toArray) on MDN.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\n// `Map.keys` returns all keys of the map as an iterator.\nlet mapKeysAsArray =\n map\n ->Map.keys\n ->Iterator.toArrayWithMapper(key => key->String.length)\n\nmapKeysAsArray == [7, 8]\n```" - ], - "signature": "let toArrayWithMapper: (t<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Stdlib.Iterator.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(iterator, fn)` consumes all values in the iterator and runs the callback `fn` for each value.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n```rescript\nlet iterator: Iterator.t = [\"a\", \"b\", \"c\"]->Array.values\nlet acc = ref(\"\")\niterator->Iterator.forEach(v => {\n acc := acc.contents ++ v\n})\n\nacc.contents == \"abc\"\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Iterator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(iterator)` ignores the provided iterator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - }, - { - "id": "Stdlib.Iterator.drop", - "kind": "value", - "name": "drop", - "docstrings": [ - "`drop(iterator, n)` returns a new iterator helper object that skips the given number of elements at the start of this iterator.\n\nSee [Iterator.prototype.drop](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/drop) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.drop(2)\nseq->Iterator.next == {done: false, value: Some(2)}\nseq->Iterator.next == {done: false, value: Some(3)}\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let drop: (t<'a>, int) => t<'a>" - }, - { - "id": "Stdlib.Iterator.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(iterator, fn)` tests whether all elements in the iterator pass the test implemented by the provided function.\n\nSee [Iterator.prototype.every](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/every) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet areAllEven = fibonacci->Iterator.every(n => n % 2 == 0)\nareAllEven == false\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Iterator.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(iterator, fn)` returns a new iterator helper object that contains the elements of the original iterator that pass the test implemented by the provided function.\n\nSee [Iterator.prototype.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/filter) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.filter(n => n % 2 == 0)\nseq->Iterator.next == {done: false, value: Some(2)}\nseq->Iterator.next == {done: false, value: Some(8)}\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Stdlib.Iterator.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(iterator, fn)` returns the value of the first element in the iterator that satisfies the provided testing function.\n\nSee [Iterator.prototype.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/find) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.find(n => n % 2 == 0)\nseq == Some(2)\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Iterator.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(iterator, fn)` returns a new iterator helper object that contains the elements of the original iterator that pass the test implemented by the provided function.\n\nSee [Iterator.prototype.flatMap](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/flatMap) on MDN.\n\n## Examples\n```rescript\nlet map1 = Map.fromArray([(\"a\", 1), (\"b\", 2), (\"c\", 3)])\nlet map2 = Map.fromArray([(\"d\", 4), (\"e\", 5), (\"f\", 6)])\n\nlet letters =\n [map1, map2]\n ->Array.values\n ->Iterator.flatMap(m => Map.keys(m))\n ->Array.fromIterator\nletters == [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Iterator.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(iterator, fn)` returns a new iterator helper object that yields elements of the iterator, each transformed by a mapping function.\n\nSee [Iterator.prototype.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/map) on MDN.\n\n## Examples\n```rescript\nlet map = Map.fromArray([(\"a\", 1), (\"b\", 2), (\"c\", 3)])\nlet letters = map->Map.keys->Iterator.map(v => v->String.toUpperCase)->Array.fromIterator\nletters == [\"A\", \"B\", \"C\"]\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Iterator.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(iterator, fn, initialValue)` applies a function against an accumulator and each element in the iterator (from left to right) to reduce it to a single value.\n\nSee [Iterator.prototype.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/reduce) on MDN.\n\n## Examples\n```rescript\nlet numbers: Iterator.t = [1, 2, 3]->Array.values\n\nlet sum = numbers->Iterator.reduce((acc, n) => acc + n, ~initialValue=0)\nsum == 6\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let reduce: (t<'a>, ('acc, 'a) => 'acc, ~initialValue: 'acc=?) => 'acc" - }, - { - "id": "Stdlib.Iterator.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(iterator, fn)` The some() method of Iterator instances is similar to Array.some:\nit tests whether at least one element produced by the iterator passes the test implemented by the provided function.\nIt returns a boolean value.\n\nSee [Iterator.prototype.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/some) on MDN.\n\n## Examples\n```rescript\nlet numbers: Iterator.t = [1, 2, 3]->Array.values\n\nlet hasEven = numbers->Iterator.some(n => n % 2 == 0)\nhasEven == true\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Iterator.take", - "kind": "value", - "name": "take", - "docstrings": [ - "`take((iterator, n))` returns a new iterator helper object that contains the first `n` elements of this iterator.\n\nSee [Iterator.prototype.take](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/take) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.take(2)\nseq->Iterator.next == {done: false, value: Some(1)}\nseq->Iterator.next == {done: false, value: Some(1)}\nseq->Iterator.next == {done: true, value: None}\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let take: (t<'a>, int) => t<'a>" - } - ] - }, - "stdlib/type": { - "id": "Stdlib.Type", - "name": "Type", - "docstrings": [ - "Utilities for classifying the type of JavaScript values at runtime." - ], - "items": [ - { - "id": "Stdlib.Type.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The possible types of JavaScript values." - ], - "signature": "type t = [\n | #bigint\n | #boolean\n | #function\n | #number\n | #object\n | #string\n | #symbol\n | #undefined\n]" - }, - { - "id": "Stdlib.Type.typeof", - "kind": "value", - "name": "typeof", - "docstrings": [ - "`typeof(someValue)`\n\nReturns the underlying JavaScript type of any runtime value.\n\nSee [`typeof`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof) on MDN.\n\n## Examples\n```rescript\nConsole.log(Type.typeof(\"Hello\")) // Logs \"string\" to the console.\n\nlet someVariable = true\n\nswitch someVariable->Type.typeof {\n| #boolean => Console.log(\"This is a bool, yay!\")\n| _ => Console.log(\"Oh, not a bool sadly...\")\n}\n```" - ], - "signature": "let typeof: 'a => t" - }, - { - "id": "Stdlib.Type.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(type)` ignores the provided type and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/symbol": { - "id": "Stdlib.Symbol", - "name": "Symbol", - "docstrings": [ - "A built-in object that serves as a namespace for globally-unique identifiers.\n\nCompiles to a regular JavaScript Symbol." - ], - "items": [ - { - "id": "Stdlib.Symbol.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a Symbol." - ], - "signature": "type t" - }, - { - "id": "Stdlib.Symbol.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(key)`\n\nMakes a new unique Symbol value.\n\n## Examples\n\n```rescript\nSymbol.make(\"sym1\")->Symbol.description == Some(\"sym1\")\n```" - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.Symbol.getFor", - "kind": "value", - "name": "getFor", - "docstrings": [ - "`getFor(key)`\n\nSearches for existing registered Symbols in the global Symbol registry with the given key and returns it if found.\nOtherwise a new Symbol gets created and registered with key.\n\n## Examples\n\n```rescript\nSymbol.getFor(\"sym1\") == Symbol.getFor(\"sym1\")\n```" - ], - "signature": "let getFor: string => option" - }, - { - "id": "Stdlib.Symbol.keyFor", - "kind": "value", - "name": "keyFor", - "docstrings": [ - "`keyFor(key)`\n\nRetrieves a shared Symbol key from the global Symbol registry for the given Symbol.\n\n## Examples\n\n```rescript\nlet globalSym = Symbol.getFor(\"sym1\") // Global symbol\n\nglobalSym->Option.flatMap(Symbol.description) == Some(\"sym1\")\n```" - ], - "signature": "let keyFor: t => option" - }, - { - "id": "Stdlib.Symbol.description", - "kind": "value", - "name": "description", - "docstrings": [ - "`description`\n\nReturns `Some(string)` containing the description of this symbol, or `None` if the symbol has no description.\n## Examples\n\n```rescript\nlet sym = Symbol.make(\"sym1\")\nSymbol.description(sym) == Some(\"sym1\")\n```" - ], - "signature": "let description: t => option" - }, - { - "id": "Stdlib.Symbol.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString`\n\n// Returns a string representing this symbol value.\n\n## Examples\n\n```rescript\nlet sym = Symbol.make(\"sym1\")\n\nSymbol.toString(sym) == \"Symbol(sym1)\"\n```" - ], - "signature": "let toString: t => string" - }, - { - "id": "Stdlib.Symbol.asyncIterator", - "kind": "value", - "name": "asyncIterator", - "docstrings": [ - "`asyncIterator` is the well-known symbol used by asynchronous iterables.\n\nSee [`Symbol.asyncIterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator) on MDN." - ], - "signature": "let asyncIterator: t" - }, - { - "id": "Stdlib.Symbol.hasInstance", - "kind": "value", - "name": "hasInstance", - "docstrings": [ - "`hasInstance` is used by custom `instanceof` checks.\n\nSee [`Symbol.hasInstance`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance) on MDN." - ], - "signature": "let hasInstance: t" - }, - { - "id": "Stdlib.Symbol.isConcatSpreadable", - "kind": "value", - "name": "isConcatSpreadable", - "docstrings": [ - "`isConcatSpreadable` controls whether objects are flattened when passed to `Array.concat`.\n\nSee [`Symbol.isConcatSpreadable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/isConcatSpreadable) on MDN." - ], - "signature": "let isConcatSpreadable: t" - }, - { - "id": "Stdlib.Symbol.iterator", - "kind": "value", - "name": "iterator", - "docstrings": [ - "`iterator` is returned by objects that can be iterated with `for..of`.\n\nSee [`Symbol.iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/iterator) on MDN." - ], - "signature": "let iterator: t" - }, - { - "id": "Stdlib.Symbol.match", - "kind": "value", - "name": "match", - "docstrings": [ - "`match` customises how values respond to `String.prototype.match`.\n\nSee [`Symbol.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/match) on MDN." - ], - "signature": "let match: t" - }, - { - "id": "Stdlib.Symbol.matchAll", - "kind": "value", - "name": "matchAll", - "docstrings": [ - "`matchAll` customises how values respond to `String.prototype.matchAll`.\n\nSee [`Symbol.matchAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/matchAll) on MDN." - ], - "signature": "let matchAll: t" - }, - { - "id": "Stdlib.Symbol.replace", - "kind": "value", - "name": "replace", - "docstrings": [ - "`replace` customises how values respond to `String.prototype.replace`.\n\nSee [`Symbol.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/replace) on MDN." - ], - "signature": "let replace: t" - }, - { - "id": "Stdlib.Symbol.search", - "kind": "value", - "name": "search", - "docstrings": [ - "`search` customises how values respond to `String.prototype.search`.\n\nSee [`Symbol.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) on MDN." - ], - "signature": "let search: t" - }, - { - "id": "Stdlib.Symbol.species", - "kind": "value", - "name": "species", - "docstrings": [ - "`species` lets constructors return a different derived constructor when methods create new instances.\n\nSee [`Symbol.species`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/species) on MDN." - ], - "signature": "let species: t" - }, - { - "id": "Stdlib.Symbol.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split` customises how values respond to `String.prototype.split`.\n\nSee [`Symbol.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/split) on MDN." - ], - "signature": "let split: t" - }, - { - "id": "Stdlib.Symbol.toPrimitive", - "kind": "value", - "name": "toPrimitive", - "docstrings": [ - "`toPrimitive` customises how objects convert to primitive values.\n\nSee [`Symbol.toPrimitive`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toPrimitive) on MDN." - ], - "signature": "let toPrimitive: t" - }, - { - "id": "Stdlib.Symbol.toStringTag", - "kind": "value", - "name": "toStringTag", - "docstrings": [ - "`toStringTag` customises the default tag shown by `Object.prototype.toString`.\n\nSee [`Symbol.toStringTag`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag) on MDN." - ], - "signature": "let toStringTag: t" - }, - { - "id": "Stdlib.Symbol.unscopables", - "kind": "value", - "name": "unscopables", - "docstrings": [ - "`unscopables` marks properties that should be skipped by `with`.\n\nSee [`Symbol.unscopables`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/unscopables) on MDN." - ], - "signature": "let unscopables: t" - }, - { - "id": "Stdlib.Symbol.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(symbol)` ignores the provided symbol and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/string": { - "id": "Stdlib.String", - "name": "String", - "docstrings": [ - "Functions for interacting with JavaScript strings.\nSee: [`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)." - ], - "items": [ - { - "id": "Stdlib.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a string." - ], - "signature": "type t = string" - }, - { - "id": "Stdlib.String.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nString.make(3.5) == \"3.5\"\nString.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => string" - }, - { - "id": "Stdlib.String.fromCharCode", - "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to\nthat number, `n` ranges from 0 to 65535. If out of range, the lower 16 bits of\nthe value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as\n`fromCharCode(0xF63A)`.\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nString.fromCharCode(65) == \"A\"\nString.fromCharCode(0x3c8) == `ψ`\nString.fromCharCode(0xd55c) == `한`\nString.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => string" - }, - { - "id": "Stdlib.String.fromCharCodeMany", - "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`.\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nString.fromCharCodeMany([189, 43, 190, 61]) == \"½+¾=\"\nString.fromCharCodeMany([65, 66, 67]) == \"ABC\"\n```" - ], - "signature": "let fromCharCodeMany: array => string" - }, - { - "id": "Stdlib.String.fromCodePoint", - "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point.\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint) on MDN.\n\n## Examples\n\n```rescript\nString.fromCodePoint(65) == \"A\"\nString.fromCodePoint(0x3c8) == `ψ`\nString.fromCodePoint(0xd55c) == `한`\nString.fromCodePoint(0x1f63a) == `😺`\n```\n\n## Exceptions\n\n- `RangeError`: If the number is not a valid code point, like `fromCharCode(-5)`." - ], - "signature": "let fromCodePoint: int => string" - }, - { - "id": "Stdlib.String.fromCodePointMany", - "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint) on MDN.\n\n## Examples\n\n```rescript\nString.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```\n\n## Exceptions\n\n- `RangeError`: If one of the number is not a valid code point, like\n `fromCharCode([1, -5])`." - ], - "signature": "let fromCodePointMany: array => string" - }, - { - "id": "Stdlib.String.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(str1, str2)` checks if two strings are equal.\n\n## Examples\n\n```rescript\nString.equal(\"hello\", \"hello\") == true\nString.equal(\"hello\", \"world\") == false\nString.equal(\"\", \"\") == true\n```" - ], - "signature": "let equal: (string, string) => bool" - }, - { - "id": "Stdlib.String.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(str1, str2)` compares two strings, returns an `Ordering.t` value.\n\n## Examples\n\n```rescript\nString.compare(\"hello\", \"hello\") == Ordering.equal\nString.compare(\"apple\", \"banana\") == Ordering.less\nString.compare(\"zebra\", \"apple\") == Ordering.greater\n```" - ], - "signature": "let compare: (string, string) => Ordering.t" - }, - { - "id": "Stdlib.String.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(str)` returns the length of the given `string`.\nSee [`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length) on MDN.\n\n## Examples\n\n```rescript\nString.length(\"abcd\") == 4\n```" - ], - "signature": "let length: string => int" - }, - { - "id": "Stdlib.String.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(str, index)` returns an `option` at the given `index` number. If\n`index` is out of range, this function returns `None`.\n\n## Examples\n\n```rescript\nString.get(\"ReScript\", 0) == Some(\"R\")\nString.get(\"Hello\", 4) == Some(\"o\")\nString.get(`JS`, 4) == None\n```" - ], - "signature": "let get: (string, int) => option" - }, - { - "id": "Stdlib.String.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(str, index)` returns an `string` at the given `index` number.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `string`.\n\nUse `String.getUnsafe` only when you are sure the `index` exists.\n## Examples\n\n```rescript\nString.getUnsafe(\"ReScript\", 0) == \"R\"\nString.getUnsafe(\"Hello\", 4) == \"o\"\n```" - ], - "signature": "let getUnsafe: (string, int) => string" - }, - { - "id": "Stdlib.String.charAt", - "kind": "value", - "name": "charAt", - "docstrings": [ - "`charAt(str, index)` gets the character at `index` within string `str`. If\n`index` is negative or greater than the length of `str`, it returns the empty\nstring. If the string contains characters outside the range \\\\u0000-\\\\uffff, it\nwill return the first 16-bit value at that position in the string.\nSee [`String.charAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt) on MDN.\n\n## Examples\n\n```rescript\nString.charAt(\"ReScript\", 0) == \"R\"\nString.charAt(\"Hello\", 12) == \"\"\nString.charAt(`JS`, 5) == \"\"\n```" - ], - "signature": "let charAt: (string, int) => string" - }, - { - "id": "Stdlib.String.charCodeAt", - "kind": "value", - "name": "charCodeAt", - "docstrings": [ - "`charCodeAt(str, index)` returns the character code at position `index` in\nstring `str` the result is in the range 0-65535, unlike `codePointAt`, so it\nwill not work correctly for characters with code points greater than or equal\nto 0x10000.\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt) on MDN.\n\n## Examples\n\n```rescript\nString.charCodeAt(`😺`, 0) == Some(0xd83d)\nString.charCodeAt(\"\", 0) == None\nString.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" - ], - "signature": "let charCodeAt: (string, int) => option" - }, - { - "id": "Stdlib.String.charCodeAtUnsafe", - "kind": "value", - "name": "charCodeAtUnsafe", - "docstrings": [ - "`charCodeAtUnsafe(str, index)` returns the character code at position `index` in\nstring `str` the result is in the range 0-65535, unlike `codePointAt`, so it\nwill not work correctly for characters with code points greater than or equal\nto 0x10000.\nBeware: If the index is out of range, it will return `NaN` which is not actually a valid int.\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt) on MDN.\n\n## Examples\n\n```rescript\nString.charCodeAtUnsafe(`😺`, 0) == 0xd83d\nString.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" - ], - "signature": "let charCodeAtUnsafe: (string, int) => int" - }, - { - "id": "Stdlib.String.codePointAt", - "kind": "value", - "name": "codePointAt", - "docstrings": [ - "`codePointAt(str, index)` returns the code point at position `index` within\nstring `str` as a `Some(value)`. The return value handles code points greater\nthan or equal to 0x10000. If there is no code point at the given position, the\nfunction returns `None`.\nSee [`String.codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) on MDN.\n\n## Examples\n\n```rescript\nString.codePointAt(`¿😺?`, 1) == Some(0x1f63a)\nString.codePointAt(\"abc\", 5) == None\n```" - ], - "signature": "let codePointAt: (string, int) => option" - }, - { - "id": "Stdlib.String.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(original, append)` returns a new `string` with `append` added after\n`original`.\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat) on MDN.\n\n## Examples\n\n```rescript\nString.concat(\"cow\", \"bell\") == \"cowbell\"\nString.concat(\"Re\", \"Script\") == \"ReScript\"\n```" - ], - "signature": "let concat: (string, string) => string" - }, - { - "id": "Stdlib.String.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(original, arr)` returns a new `string` consisting of each item of an\narray of strings added to the `original` string.\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat) on MDN.\n\n## Examples\n\n```rescript\nString.concatMany(\"1st\", [\"2nd\", \"3rd\", \"4th\"]) == \"1st2nd3rd4th\"\n```" - ], - "signature": "let concatMany: (string, array) => string" - }, - { - "id": "Stdlib.String.endsWith", - "kind": "value", - "name": "endsWith", - "docstrings": [ - "`endsWith(str, substr)` returns `true` if the `str` ends with `substr`, `false`\notherwise.\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith) on MDN.\n\n## Examples\n\n```rescript\nString.endsWith(\"BuckleScript\", \"Script\") == true\nString.endsWith(\"BuckleShoes\", \"Script\") == false\n```" - ], - "signature": "let endsWith: (string, string) => bool" - }, - { - "id": "Stdlib.String.endsWithFrom", - "kind": "value", - "name": "endsWithFrom", - "docstrings": [ - "`endsWithFrom(str, ending, len)` returns `true` if the first len characters of\n`str` end with `ending`, `false` otherwise. If `len` is greater than or equal\nto the length of `str`, then it works like `endsWith`.\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith) on MDN.\n\n## Examples\n\n```rescript\nString.endsWithFrom(\"abcd\", \"cd\", 4) == true\nString.endsWithFrom(\"abcde\", \"cd\", 3) == false\nString.endsWithFrom(\"abcde\", \"cde\", 99) == true\nString.endsWithFrom(\"example.dat\", \"ple\", 7) == true\n```" - ], - "signature": "let endsWithFrom: (string, string, int) => bool" - }, - { - "id": "Stdlib.String.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "`includes(str, searchValue)` returns `true` if `searchValue` is found anywhere\nwithin `str`, `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includes(\"programmer\", \"gram\") == true\nString.includes(\"programmer\", \"er\") == true\nString.includes(\"programmer\", \"pro\") == true\nString.includes(\"programmer.dat\", \"xyz\") == false\n```" - ], - "signature": "let includes: (string, string) => bool" - }, - { - "id": "Stdlib.String.includesFrom", - "kind": "value", - "name": "includesFrom", - "docstrings": [ - "`includesFrom(str, searchValue, start)` returns `true` if `searchValue` is found\nanywhere within `str` starting at character number `start` (where 0 is the\nfirst character), `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includesFrom(\"programmer\", \"gram\", 1) == true\nString.includesFrom(\"programmer\", \"gram\", 4) == false\nString.includesFrom(`대한민국`, `한`, 1) == true\n```" - ], - "signature": "let includesFrom: (string, string, int) => bool" - }, - { - "id": "Stdlib.String.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "`indexOf(str, searchValue)` returns the position at which `searchValue` was\nfirst found within `str`, or `-1` if `searchValue` is not in `str`.\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) on MDN.\n\n## Examples\n\n```rescript\nString.indexOf(\"bookseller\", \"ok\") == 2\nString.indexOf(\"bookseller\", \"sell\") == 4\nString.indexOf(\"beekeeper\", \"ee\") == 1\nString.indexOf(\"bookseller\", \"xyz\") == -1\n```" - ], - "signature": "let indexOf: (string, string) => int" - }, - { - "id": "Stdlib.String.indexOfOpt", - "kind": "value", - "name": "indexOfOpt", - "docstrings": [ - "`indexOfOpt(str, searchValue)`. Like `indexOf`, but return an `option`.\n\n## Examples\n\n```rescript\nString.indexOfOpt(\"bookseller\", \"ok\") == Some(2)\nString.indexOfOpt(\"bookseller\", \"xyz\") == None\n```" - ], - "signature": "let indexOfOpt: (string, string) => option" - }, - { - "id": "Stdlib.String.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "`indexOfFrom(str, searchValue, start)` returns the position at which\n`searchValue` was found within `str` starting at character position `start`, or\n`-1` if `searchValue` is not found in that portion of `str`. The return value is\nrelative to the beginning of the string, no matter where the search started\nfrom.\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) on MDN.\n\n## Examples\n\n```rescript\nString.indexOfFrom(\"bookseller\", \"ok\", 1) == 2\nString.indexOfFrom(\"bookseller\", \"sell\", 2) == 4\nString.indexOfFrom(\"bookseller\", \"sell\", 5) == -1\n```" - ], - "signature": "let indexOfFrom: (string, string, int) => int" - }, - { - "id": "Stdlib.String.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(str, searchValue)` returns the position of the last occurrence of\n`searchValue` within `str`, searching backwards from the end of the string.\nReturns `-1` if `searchValue` is not in `str`. The return value is always\nrelative to the beginning of the string.\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\nString.lastIndexOf(\"bookseller\", \"ok\") == 2\nString.lastIndexOf(\"beekeeper\", \"ee\") == 4\nString.lastIndexOf(\"abcdefg\", \"xyz\") == -1\n```" - ], - "signature": "let lastIndexOf: (string, string) => int" - }, - { - "id": "Stdlib.String.lastIndexOfOpt", - "kind": "value", - "name": "lastIndexOfOpt", - "docstrings": [ - "`lastIndexOfOpt(str, searchValue)`. Like `lastIndexOfOpt`, but return an\n`option`.\n\n## Examples\n\n```rescript\nString.lastIndexOfOpt(\"bookseller\", \"ok\") == Some(2)\nString.lastIndexOfOpt(\"beekeeper\", \"ee\") == Some(4)\nString.lastIndexOfOpt(\"abcdefg\", \"xyz\") == None\n```" - ], - "signature": "let lastIndexOfOpt: (string, string) => option" - }, - { - "id": "Stdlib.String.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "`lastIndexOfFrom(str, searchValue, start)` returns the position of the last\noccurrence of `searchValue` within `str`, searching backwards from the given\nstart position. Returns `-1` if `searchValue` is not in `str`. The return value\nis always relative to the beginning of the string.\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\nString.lastIndexOfFrom(\"bookseller\", \"ok\", 6) == 2\nString.lastIndexOfFrom(\"beekeeper\", \"ee\", 8) == 4\nString.lastIndexOfFrom(\"beekeeper\", \"ee\", 3) == 1\nString.lastIndexOfFrom(\"abcdefg\", \"xyz\", 4) == -1\n```" - ], - "signature": "let lastIndexOfFrom: (string, string, int) => int" - }, - { - "id": "Stdlib.String.match", - "kind": "value", - "name": "match", - "docstrings": [ - "`match(str, regexp)` matches a `string` against the given `regexp`. If there is\nno match, it returns `None`. For regular expressions without the g modifier, if\nthere is a match, the return value is `Some(array)` where the array contains:\n- The entire matched string\n- Any capture groups if the regexp had parentheses\n For regular expressions with the g modifier, a matched expression returns\n `Some(array)` with all the matched substrings and no capture groups.\n See [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match) on MDN.\n\n## Examples\n\n```rescript\nString.match(\"The better bats\", /b[aeiou]t/) == Some([Some(\"bet\")])\nString.match(\"The better bats\", /b[aeiou]t/g) == Some([Some(\"bet\"), Some(\"bat\")])\nString.match(\"Today is 2018-04-05.\", /(\\d+)-(\\d+)-(\\d+)/) ==\n Some([Some(\"2018-04-05\"), Some(\"2018\"), Some(\"04\"), Some(\"05\")])\nString.match(\"The optional example\", /(foo)?(example)/) ==\n Some([Some(\"example\"), None, Some(\"example\")])\nString.match(\"The large container.\", /b[aeiou]g/) == None\n```" - ], - "signature": "let match: (string, RegExp.t) => option<\\\"RegExp.Result\".t>" - }, - { - "id": "Stdlib.String.normalize", - "kind": "value", - "name": "normalize", - "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\\\u00e3 or the combination of a lower case letter A\n\\\\u0061 and a combining tilde \\\\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\nSee also [Unicode technical report \\#15](https://unicode.org/reports/tr15/) for details.\n\n## Examples\n\n```rescript\nlet string1 = \"\\u00F1\"\nlet string2 = \"\\u006E\\u0303\"\n\nassert(string1 != string2) // true\nString.normalize(string1) == String.normalize(string2)\n```" - ], - "signature": "let normalize: string => string" - }, - { - "id": "Stdlib.String.normalizeForm", - "kind": "type", - "name": "normalizeForm", - "docstrings": [ - "`normalizeByForm(str, form)` returns the normalized Unicode string using the\nspecified form of normalization, which may be one of:\n- \"NFC\" — Normalization Form Canonical Composition.\n- \"NFD\" — Normalization Form Canonical Decomposition.\n- \"NFKC\" — Normalization Form Compatibility Composition.\n- \"NFKD\" — Normalization Form Compatibility Decomposition.\n See [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\n See also [Unicode technical report \\#15](https://unicode.org/reports/tr15/) for\n details.\n\n## Examples\n\n```rescript\nlet string1 = \"\\uFB00\"\nlet string2 = \"\\u0066\\u0066\"\nConsole.log(string1 == string2) // false\n\nlet normalizeString1 = String.normalizeByForm(string1, #NFKD)\nlet normalizeString2 = String.normalizeByForm(string2, #NFKD)\nConsole.log(normalizeString1 == normalizeString2) // true\n```" - ], - "signature": "type normalizeForm = [#NFC | #NFD | #NFKC | #NFKD]" - }, - { - "id": "Stdlib.String.normalizeByForm", - "kind": "value", - "name": "normalizeByForm", - "docstrings": [], - "signature": "let normalizeByForm: (string, normalizeForm) => string" - }, - { - "id": "Stdlib.String.repeat", - "kind": "value", - "name": "repeat", - "docstrings": [ - "`repeat(str, n)` returns a `string` that consists of `n` repetitions of `str`.\nSee [`String.repeat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat) on MDN.\n\n## Examples\n\n```rescript\nString.repeat(\"ha\", 3) == \"hahaha\"\nString.repeat(\"empty\", 0) == \"\"\n```\n\n## Exceptions\n\n- `RangeError`: if `n` is negative." - ], - "signature": "let repeat: (string, int) => string" - }, - { - "id": "Stdlib.String.replace", - "kind": "value", - "name": "replace", - "docstrings": [ - "`replace(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with the first matching instance of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nString.replace(\"old string\", \"old\", \"new\") == \"new string\"\nString.replace(\"the cat and the dog\", \"the\", \"this\") == \"this cat and the dog\"\n```" - ], - "signature": "let replace: (string, string, string) => string" - }, - { - "id": "Stdlib.String.replaceRegExp", - "kind": "value", - "name": "replaceRegExp", - "docstrings": [ - "`replaceRegExp(str, regex, replacement)` returns a new `string` where\noccurrences matching regex have been replaced by `replacement`.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nString.replaceRegExp(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nString.replaceRegExp(\"Juan Fulano\", /(\\w+) (\\w+)/, \"$2, $1\") == \"Fulano, Juan\"\n```" - ], - "signature": "let replaceRegExp: (string, RegExp.t, string) => string" - }, - { - "id": "Stdlib.String.replaceAll", - "kind": "value", - "name": "replaceAll", - "docstrings": [ - "`replaceAll(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with all matching instances of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\nSee [`String.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) on MDN.\n\n## Examples\n\n```rescript\nString.replaceAll(\"old old string\", \"old\", \"new\") == \"new new string\"\nString.replaceAll(\"the cat and the dog\", \"the\", \"this\") == \"this cat and this dog\"\n```" - ], - "signature": "let replaceAll: (string, string, string) => string" - }, - { - "id": "Stdlib.String.replaceAllRegExp", - "kind": "value", - "name": "replaceAllRegExp", - "docstrings": [ - "`replaceAllRegExp(str, regex, replacement)` returns a new `string` where\nall occurrences matching regex have been replaced by `replacement`.\nThe pattern must include the global (`g`) flag or a runtime TypeError will be thrown.\nSee [`String.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) on MDN.\n\n## Examples\n\n```rescript\nString.replaceAllRegExp(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nString.replaceAllRegExp(\"aabbcc\", /b/g, \".\") == \"aa..cc\"\n```" - ], - "signature": "let replaceAllRegExp: (string, RegExp.t, string) => string" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy0", - "kind": "value", - "name": "unsafeReplaceRegExpBy0", - "docstrings": [ - "`unsafeReplaceRegExpBy0(str, regex, f)` returns a new `string` with some or all\nmatches of a pattern with no capturing parentheses replaced by the value\nreturned from the given function. The function receives as its parameters the\nmatched string, the offset at which the match begins, and the whole string being\nmatched.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (~match, ~offset as _, ~input as _) => String.toUpperCase(match)\nString.unsafeReplaceRegExpBy0(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy0: (\n string,\n RegExp.t,\n (~match: string, ~offset: int, ~input: string) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy1", - "kind": "value", - "name": "unsafeReplaceRegExpBy1", - "docstrings": [ - "`unsafeReplaceRegExpBy1(str, regexp, f)`. Like `unsafeReplaceRegExpBy0`, but `f`\nhas `group1` parameter.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (~match as _, ~group1, ~offset as _, ~input as _) => {\n group1 ++ \"41\"\n}\nString.unsafeReplaceRegExpBy1(str, re, matchFn) == \"Jony is 41\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy1: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy2", - "kind": "value", - "name": "unsafeReplaceRegExpBy2", - "docstrings": [ - "`unsafeReplaceRegExpBy2(str, regexp, f)`. Like `unsafeReplaceRegExpBy1`, but `f`\nhas two group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (~match as _, ~group1, ~group2, ~offset as _, ~input as _) => {\n switch (Int.fromString(group1), Int.fromString(group2)) {\n | (Some(x), Some(y)) => Int.toString(x * y)\n | _ => \"???\"\n }\n}\nString.unsafeReplaceRegExpBy2(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy2: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy3", - "kind": "value", - "name": "unsafeReplaceRegExpBy3", - "docstrings": [ - "`unsafeReplaceRegExpBy3(str, regexp, f)`. Like `unsafeReplaceRegExpBy2`, but `f`\nhas three group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN." - ], - "signature": "let unsafeReplaceRegExpBy3: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~group3: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.replaceRegExpBy0Unsafe", - "kind": "value", - "name": "replaceRegExpBy0Unsafe", - "docstrings": [ - "`replaceRegExpBy0Unsafe(str, regex, f)` returns a new `string` with some or all\nmatches of a pattern with no capturing parentheses replaced by the value\nreturned from the given function. The function receives as its parameters the\nmatched string, the offset at which the match begins, and the whole string being\nmatched.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (~match, ~offset as _, ~input as _) => String.toUpperCase(match)\nString.replaceRegExpBy0Unsafe(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" - ], - "signature": "let replaceRegExpBy0Unsafe: (\n string,\n RegExp.t,\n (~match: string, ~offset: int, ~input: string) => string,\n) => string" - }, - { - "id": "Stdlib.String.replaceRegExpBy1Unsafe", - "kind": "value", - "name": "replaceRegExpBy1Unsafe", - "docstrings": [ - "`replaceRegExpBy1Unsafe(str, regexp, f)`. Like `replaceRegExpBy0Unsafe`, but `f`\nhas `group1` parameter.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (~match as _, ~group1, ~offset as _, ~input as _) => {\n group1 ++ \"41\"\n}\nString.replaceRegExpBy1Unsafe(str, re, matchFn) == \"Jony is 41\"\n```" - ], - "signature": "let replaceRegExpBy1Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" - }, - { - "id": "Stdlib.String.replaceRegExpBy2Unsafe", - "kind": "value", - "name": "replaceRegExpBy2Unsafe", - "docstrings": [ - "`replaceRegExpBy2Unsafe(str, regexp, f)`. Like `replaceRegExpBy1Unsafe`, but `f`\nhas two group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (~match as _, ~group1, ~group2, ~offset as _, ~input as _) => {\n switch (Int.fromString(group1), Int.fromString(group2)) {\n | (Some(x), Some(y)) => Int.toString(x * y)\n | _ => \"???\"\n }\n}\nString.replaceRegExpBy2Unsafe(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let replaceRegExpBy2Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" - }, - { - "id": "Stdlib.String.replaceRegExpBy3Unsafe", - "kind": "value", - "name": "replaceRegExpBy3Unsafe", - "docstrings": [ - "`replaceRegExpBy3Unsafe(str, regexp, f)`. Like `replaceRegExpBy2Unsafe`, but `f`\nhas three group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN." - ], - "signature": "let replaceRegExpBy3Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~group3: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" - }, - { - "id": "Stdlib.String.search", - "kind": "value", - "name": "search", - "docstrings": [ - "`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search) on MDN.\n\n## Examples\n\n```rescript\nString.search(\"testing 1 2 3\", /\\d+/) == 8\nString.search(\"no numbers\", /\\d+/) == -1\n```" - ], - "signature": "let search: (string, RegExp.t) => int" - }, - { - "id": "Stdlib.String.searchOpt", - "kind": "value", - "name": "searchOpt", - "docstrings": [ - "`searchOpt(str, regexp)`. Like `search`, but return an `option`.\n\n## Examples\n\n```rescript\nString.searchOpt(\"testing 1 2 3\", /\\d+/) == Some(8)\nString.searchOpt(\"no numbers\", /\\d+/) == None\n```" - ], - "signature": "let searchOpt: (string, RegExp.t) => option" - }, - { - "id": "Stdlib.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(str)` returns `true` if the string is empty (has zero length), \n`false` otherwise.\n\n## Examples\n\n```rescript\nString.isEmpty(\"\") == true\nString.isEmpty(\"hello\") == false\nString.isEmpty(\" \") == false\n```" - ], - "signature": "let isEmpty: string => bool" - }, - { - "id": "Stdlib.String.capitalize", - "kind": "value", - "name": "capitalize", - "docstrings": [ - "`capitalize(str)` returns a new string with the first character converted to \nuppercase and the remaining characters unchanged. If the string is empty, \nreturns the empty string.\n\n## Examples\n\n```rescript\nString.capitalize(\"hello\") == \"Hello\"\nString.capitalize(\"HELLO\") == \"HELLO\"\nString.capitalize(\"hello world\") == \"Hello world\"\nString.capitalize(\"\") == \"\"\n```" - ], - "signature": "let capitalize: string => string" - }, - { - "id": "Stdlib.String.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```" - ], - "signature": "let slice: (string, ~start: int, ~end: int=?) => string" - }, - { - "id": "Stdlib.String.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```" - ], - "signature": "let sliceToEnd: (string, ~start: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nString.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nString.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nString.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```" - ], - "signature": "let split: (string, string) => array" - }, - { - "id": "Stdlib.String.splitAtMost", - "kind": "value", - "name": "splitAtMost", - "docstrings": [ - "`splitAtMost(str, delimiter, ~limit)` splits the given `str` at every\noccurrence of `delimiter` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings,\nthe array will contain all the substrings.\n\n## Examples\n\n```rescript\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=3) == [\"ant\", \"bee\", \"cat\"]\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=0) == []\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=9) == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```" - ], - "signature": "let splitAtMost: (string, string, ~limit: int) => array" - }, - { - "id": "Stdlib.String.splitByRegExp", - "kind": "value", - "name": "splitByRegExp", - "docstrings": [ - "`splitByRegExp(str, regexp)` splits the given `str` at every occurrence of\n`regexp` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExp(\"Jan,Feb,Mar\", /,/) == [Some(\"Jan\"), Some(\"Feb\"), Some(\"Mar\")]\n```" - ], - "signature": "let splitByRegExp: (string, RegExp.t) => array>" - }, - { - "id": "Stdlib.String.splitByRegExpAtMost", - "kind": "value", - "name": "splitByRegExpAtMost", - "docstrings": [ - "`splitByRegExpAtMost(str, regexp, ~limit)` splits the given `str` at every\noccurrence of `regexp` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings, the\narray will contain all the substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExpAtMost(\"Hello World. How are you doing?\", / /, ~limit=3) == [\n Some(\"Hello\"),\n Some(\"World.\"),\n Some(\"How\"),\n ]\n```" - ], - "signature": "let splitByRegExpAtMost: (string, RegExp.t, ~limit: int) => array>" - }, - { - "id": "Stdlib.String.startsWith", - "kind": "value", - "name": "startsWith", - "docstrings": [ - "`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```" - ], - "signature": "let startsWith: (string, string) => bool" - }, - { - "id": "Stdlib.String.startsWithFrom", - "kind": "value", - "name": "startsWithFrom", - "docstrings": [ - "`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```" - ], - "signature": "let startsWithFrom: (string, string, int) => bool" - }, - { - "id": "Stdlib.String.substring", - "kind": "value", - "name": "substring", - "docstrings": [ - "`substring(str, ~start, ~end)` returns characters `start` up to but not\nincluding end from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `end` is zero or negative, the empty string is returned.\n- If `start` is greater than `end`, the `start` and `end` points are swapped.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substring(\"playground\", ~start=3, ~end=6) == \"ygr\"\nString.substring(\"playground\", ~start=6, ~end=3) == \"ygr\"\nString.substring(\"playground\", ~start=4, ~end=12) == \"ground\"\nString.substring(\"playground\", ~start=4) == \"ground\"\nString.substring(\"Hello World\", ~start=6) == \"World\"\n```" - ], - "signature": "let substring: (string, ~start: int, ~end: int=?) => string" - }, - { - "id": "Stdlib.String.substringToEnd", - "kind": "value", - "name": "substringToEnd", - "docstrings": [ - "`substringToEnd(str, ~start)` returns the substring of `str` from position\n`start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string\n is returned.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substringToEnd(\"playground\", ~start=4) == \"ground\"\nString.substringToEnd(\"playground\", ~start=-3) == \"playground\"\nString.substringToEnd(\"playground\", ~start=12) == \"\"\n```" - ], - "signature": "let substringToEnd: (string, ~start: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.toLowerCase", - "kind": "value", - "name": "toLowerCase", - "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms, one when it is the last\ncharacter in a string and another when it is not.\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase) on MDN.\n\n## Examples\n\n```rescript\nString.toLowerCase(\"ABC\") == \"abc\"\nString.toLowerCase(`ΣΠ`) == `σπ`\nString.toLowerCase(`ΠΣ`) == `πς`\n```" - ], - "signature": "let toLowerCase: string => string" - }, - { - "id": "Stdlib.String.toLocaleLowerCase", - "kind": "value", - "name": "toLocaleLowerCase", - "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase) on MDN." - ], - "signature": "let toLocaleLowerCase: string => string" - }, - { - "id": "Stdlib.String.toUpperCase", - "kind": "value", - "name": "toUpperCase", - "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result, for example the German ß\ncapitalizes to two Ses in a row.\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) on MDN.\n\n## Examples\n\n```rescript\nString.toUpperCase(\"abc\") == \"ABC\"\nString.toUpperCase(`Straße`) == `STRASSE`\nString.toUpperCase(`πς`) == `ΠΣ`\n```" - ], - "signature": "let toUpperCase: string => string" - }, - { - "id": "Stdlib.String.toLocaleUpperCase", - "kind": "value", - "name": "toLocaleUpperCase", - "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\nSee [`String.toLocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase) on MDN." - ], - "signature": "let toLocaleUpperCase: string => string" - }, - { - "id": "Stdlib.String.trim", - "kind": "value", - "name": "trim", - "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim) on MDN.\n\n## Examples\n\n```rescript\nString.trim(\" abc def \") == \"abc def\"\nString.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" - ], - "signature": "let trim: string => string" - }, - { - "id": "Stdlib.String.trimStart", - "kind": "value", - "name": "trimStart", - "docstrings": [ - "`trimStart(str)` returns a string that is `str` with whitespace stripped from\nthe beginning of a string. Internal whitespace is not removed.\nSee [`String.trimStart`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimStart) on MDN.\n\n## Examples\n\n```rescript\nString.trimStart(\" Hello world! \") == \"Hello world! \"\nString.trimStart(\" Hello world! \") == \"Hello world! \"\n```" - ], - "signature": "let trimStart: string => string" - }, - { - "id": "Stdlib.String.trimEnd", - "kind": "value", - "name": "trimEnd", - "docstrings": [ - "`trimEnd(str)` returns a string that is `str` with whitespace stripped from the\nend of a string. Internal whitespace is not removed.\nSee [`String.trimEnd`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd) on MDN.\n\n## Examples\n\n```rescript\nString.trimEnd(\" Hello world! \") == \" Hello world!\"\nString.trimEnd(\" Hello world! \") == \" Hello world!\"\n```" - ], - "signature": "let trimEnd: string => string" - }, - { - "id": "Stdlib.String.padStart", - "kind": "value", - "name": "padStart", - "docstrings": [ - "`padStart(str, n, padStr)` returns a string that has been padded with `padStr`\n(multiple times, if needed) until the resulting string reaches the given `n`\nlength. The padding is applied from the start of the current string.\nSee [`String.padStart`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart) on MDN.\n\n## Examples\n\n```rescript\nString.padStart(\"abc\", 5, \" \") == \" abc\"\nString.padStart(\"abc\", 6, \"123465\") == \"123abc\"\n```" - ], - "signature": "let padStart: (string, int, string) => string" - }, - { - "id": "Stdlib.String.padEnd", - "kind": "value", - "name": "padEnd", - "docstrings": [ - "`padEnd(str, n, padStr)` returns a string that has been padded with `padStr`\n(multiple times, if needed) until the resulting string reaches the given `n`\nlength. The padding is applied from the end of the current string.\nSee [`String.padEnd`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd) on MDN.\n\n## Examples\n\n```rescript\nString.padEnd(\"Hello\", 10, \".\") == \"Hello.....\"\nString.padEnd(\"abc\", 1, \"\") == \"abc\"\n```" - ], - "signature": "let padEnd: (string, int, string) => string" - }, - { - "id": "Stdlib.String.localeCompare", - "kind": "value", - "name": "localeCompare", - "docstrings": [ - "`localeCompare(referenceStr, compareStr)` returns a float than indicatings\nwhether a reference string comes before or after, or is the same as the given\nstring in sort order. If `referenceStr` occurs before `compareStr` positive if\nthe `referenceStr` occurs after `compareStr`, `0` if they are equivalent.\nDo not rely on exact return values of `-1` or `1`\nSee [`String.localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare) on MDN.\n\n## Examples\n\n```rescript\nString.localeCompare(\"a\", \"c\") < 0.0 == true\nString.localeCompare(\"a\", \"a\") == 0.0\n```" - ], - "signature": "let localeCompare: (string, string) => float" - }, - { - "id": "Stdlib.String.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(string)` ignores the provided string and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: string => unit" - }, - { - "id": "Stdlib.String.getSymbolUnsafe", - "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [ - "`getSymbolUnsafe(str, symbol)` returns the value of the symbol property of a string.\n\n## Examples\n\n```rescript\nlet it: Iterator.t = (\"foo\"->String.getSymbolUnsafe(Symbol.iterator))()\nNullable.make(it)->Nullable.isNullable == false\n```" - ], - "signature": "let getSymbolUnsafe: (string, Symbol.t) => 'a" - } - ] - }, - "stdlib/result": { - "id": "Stdlib.Result", - "name": "Result", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Result.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Result types are really useful to describe the result of a certain operation\n without relying on exceptions or `option` types.\n\n This module gives you useful utilities to create and combine `Result` data." - ], - "signature": "type t<'res, 'err> = result<'res, 'err> =\n | Ok('res)\n | Error('err)" - }, - { - "id": "Stdlib.Result.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getExn(Result.Ok(42)) == 42\n \n switch Result.getExn(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getExn(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```" - ], - "signature": "let getExn: (result<'a, 'b>, ~message: string=?) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Result.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getOrThrow(Result.Ok(42)) == 42\n \n switch Result.getOrThrow(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getOrThrow(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```" - ], - "signature": "let getOrThrow: (result<'a, 'b>, ~message: string=?) => 'a" - }, - { - "id": "Stdlib.Result.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(res, default, f)`: When res is `Ok(n)`, returns `f(n)`, otherwise `default`.\n\n## Examples\n\n```rescript\nlet ok = Ok(42)\nResult.mapOr(ok, 0, x => x / 2) == 21\n\nlet error = Error(\"Invalid data\")\nResult.mapOr(error, 0, x => x / 2) == 0\n```" - ], - "signature": "let mapOr: (result<'a, 'c>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Result.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (result<'a, 'c>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Result.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(res, f)`: When res is `Ok(n)`, returns `Ok(f(n))`. Otherwise returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns an\nordinary value.\n\n## Examples\n\n```rescript\nlet f = x => sqrt(Int.toFloat(x))\n\nResult.map(Ok(64), f) == Ok(8.0)\n\nResult.map(Error(\"Invalid data\"), f) == Error(\"Invalid data\")\n```" - ], - "signature": "let map: (result<'a, 'c>, 'a => 'b) => result<'b, 'c>" - }, - { - "id": "Stdlib.Result.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(res, f)`: When res is `Ok(n)`, returns `f(n)`. Otherwise, returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns a\n`Result`.\n\n## Examples\n\n```rescript\nlet recip = x =>\n if x !== 0.0 {\n Ok(1.0 /. x)\n } else {\n Error(\"Divide by zero\")\n }\n\nResult.flatMap(Ok(2.0), recip) == Ok(0.5)\n\nResult.flatMap(Ok(0.0), recip) == Error(\"Divide by zero\")\n\nResult.flatMap(Error(\"Already bad\"), recip) == Error(\"Already bad\")\n```" - ], - "signature": "let flatMap: (result<'a, 'c>, 'a => result<'b, 'c>) => result<'b, 'c>" - }, - { - "id": "Stdlib.Result.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`, otherwise `default`\n\n## Examples\n\n```rescript\nResult.getOr(Ok(42), 0) == 42\n\nResult.getOr(Error(\"Invalid Data\"), 0) == 0\n```" - ], - "signature": "let getOr: (result<'a, 'b>, 'a) => 'a" - }, - { - "id": "Stdlib.Result.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (result<'a, 'b>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Result.isOk", - "kind": "value", - "name": "isOk", - "docstrings": [ - "`isOk(res)`: Returns `true` if `res` is of the form `Ok(n)`, `false` if it is the `Error(e)` variant." - ], - "signature": "let isOk: result<'a, 'b> => bool" - }, - { - "id": "Stdlib.Result.isError", - "kind": "value", - "name": "isError", - "docstrings": [ - "`isError(res)`: Returns `true` if `res` is of the form `Error(e)`, `false` if it is the `Ok(n)` variant." - ], - "signature": "let isError: result<'a, 'b> => bool" - }, - { - "id": "Stdlib.Result.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(res1, res2, eqOk, eqError)`: Determine if two `Result` variables are equal with\nrespect to equality functions. If `res1` and `res2` are of the form `Ok(n)`\nand `Ok(m)`, return the result of `eqOk(n, m)`. If one of `res1` and `res2` are of\nthe form `Error(e)`, return false If both `res1` and `res2` are of the form\n`Error(e)`, return the result of `eqError(e1, e2)`.\n\n## Examples\n\n```rescript\nlet good1 = Ok(42)\n\nlet good2 = Ok(32)\n\nlet bad1 = Error(\"invalid\")\n\nlet bad2 = Error(\"really invalid\")\n\nlet mod10equal = (a, b) => mod(a, 10) === mod(b, 10)\n\nResult.equal(good1, good2, mod10equal, String.equal) == true\n\nResult.equal(good1, bad1, mod10equal, String.equal) == false\n\nResult.equal(bad2, good2, mod10equal, String.equal) == false\n\nResult.equal(bad1, bad2, mod10equal, String.equal) == false\n```" - ], - "signature": "let equal: (\n result<'a, 'c>,\n result<'b, 'd>,\n ('a, 'b) => bool,\n ('c, 'd) => bool,\n) => bool" - }, - { - "id": "Stdlib.Result.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(res1, res2, cmpOk, cmpError)`: Compare two `Result` variables with respect to a\ncomparison function. The comparison function returns -1. if the first variable\nis \"less than\" the second, 0. if the two variables are equal, and 1. if the first\nis \"greater than\" the second.\n\nIf `res1` and `res2` are of the form `Ok(n)` and `Ok(m)`, return the result of\n`cmpOk(n, m)`. If `res1` is of the form `Error(e)` and `res2` of the form `Ok(n)`,\nreturn -1. (nothing is less than something) If `res1` is of the form `Ok(n)` and\n`res2` is of the form `Error(e)`, return 1. (something is greater than nothing) If\nboth `res1` and `res2` are of the form `Error(e)`, return cmpError(e1, e2).\n\n## Examples\n\n```rescript\nlet good1 = Ok(59)\n\nlet good2 = Ok(37)\n\nlet bad1 = Error(\"invalid\")\n\nlet bad2 = Error(\"really invalid\")\n\nlet mod10cmp = (a, b) => Int.compare(mod(a, 10), mod(b, 10))\n\nResult.compare(Ok(39), Ok(57), mod10cmp, String.compare) == 1.\n\nResult.compare(Ok(57), Ok(39), mod10cmp, String.compare) == -1.\n\nResult.compare(Ok(39), Error(\"y\"), mod10cmp, String.compare) == 1.\n\nResult.compare(Error(\"x\"), Ok(57), mod10cmp, String.compare) == -1.\n\nResult.compare(Error(\"x\"), Error(\"y\"), mod10cmp, String.compare) == -1.\n```" - ], - "signature": "let compare: (\n result<'a, 'c>,\n result<'b, 'd>,\n ('a, 'b) => Ordering.t,\n ('c, 'd) => Ordering.t,\n) => Ordering.t" - }, - { - "id": "Stdlib.Result.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(res, f)` runs the provided function `f` on the `Ok` value. If `res` is `Error`, nothing happens.\n\n## Examples\n\n```rescript\nResult.forEach(Ok(3), Console.log) // Logs \"3\", returns ()\nResult.forEach(Error(\"x\"), Console.log) // Does nothing, returns ()\n```" - ], - "signature": "let forEach: (result<'a, 'b>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Result.mapError", - "kind": "value", - "name": "mapError", - "docstrings": [ - "`mapError(r, f)` generates a new `result` by applying the function `f` to the `Error` value. If the source is `Ok`, return it as-is.\n\n## Examples\n\n```rescript\nlet format = n => `Error code: ${n->Int.toString}`\nResult.mapError(Error(14), format) == Error(\"Error code: 14\")\nResult.mapError(Ok(\"abc\"), format) == Ok(\"abc\")\n```" - ], - "signature": "let mapError: (result<'a, 'b>, 'b => 'c) => result<'a, 'c>" - }, - { - "id": "Stdlib.Result.all", - "kind": "value", - "name": "all", - "docstrings": [ - "`all(results)` returns a result of array if all options are Ok, otherwise returns Error.\n## Examples\n```rescript\nResult.all([Ok(1), Ok(2), Ok(3)]) == Ok([1, 2, 3])\nResult.all([Ok(1), Error(1)]) == Error(1)\n```" - ], - "signature": "let all: array> => result, 'b>" - }, - { - "id": "Stdlib.Result.all2", - "kind": "value", - "name": "all2", - "docstrings": [ - "`all2((r1, r2))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all2: (\n (result<'r1, 'e>, result<'r2, 'e>),\n) => result<('r1, 'r2), 'e>" - }, - { - "id": "Stdlib.Result.all3", - "kind": "value", - "name": "all3", - "docstrings": [ - "`all3((r1, r2, r3))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all3: (\n (result<'r1, 'e>, result<'r2, 'e>, result<'r3, 'e>),\n) => result<('r1, 'r2, 'r3), 'e>" - }, - { - "id": "Stdlib.Result.all4", - "kind": "value", - "name": "all4", - "docstrings": [ - "`all4((r1, r2, r3, r4))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all4: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4), 'e>" - }, - { - "id": "Stdlib.Result.all5", - "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((r1, r2, r3, r4, r5))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all5: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n result<'r5, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4, 'r5), 'e>" - }, - { - "id": "Stdlib.Result.all6", - "kind": "value", - "name": "all6", - "docstrings": [ - "`all6((r1, r2, r3, r4, r5, r6))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all6: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n result<'r5, 'e>,\n result<'r6, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4, 'r5, 'r6), 'e>" - }, - { - "id": "Stdlib.Result.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(result)` ignores the provided result and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: result<'res, 'err> => unit" - }, - { - "id": "Stdlib.Result.mapOkAsync", - "kind": "value", - "name": "mapOkAsync", - "docstrings": [ - "`mapOkAsync(res, f)`: Asynchronously maps over the Ok value of a Result. When `res` is `Ok(n)`, \napplies the async function `f` to `n` and wraps the result in `Ok`. \nWhen `res` is `Error`, returns the error unchanged.\n\n## Examples\n\n```rescript\n let square = x => x * x\n\n let result1 = await Result.mapOkAsync(Promise.resolve(Ok(4)), square)\n result1 == Ok(16)\n\n let result2 = await Result.mapOkAsync(\n Promise.resolve(Error(\"invalid\")),\n square,\n )\n result2 == Error(\"invalid\")\n```" - ], - "signature": "let mapOkAsync: (\n promise>,\n 'ok => 'mappedOk,\n) => promise>" - }, - { - "id": "Stdlib.Result.mapErrorAsync", - "kind": "value", - "name": "mapErrorAsync", - "docstrings": [ - "`mapErrorAsync(res, f)`: Asynchronously maps over the Error value of a Result. When `res` is `Error(e)`, \napplies the async function `f` to `e` and wraps the result in `Error`. \nWhen `res` is `Ok`, returns the ok value unchanged.\n\n## Examples\n\n```rescript\nlet formatError = e => `Error: ${e}`\n\nlet result1 = await Result.mapErrorAsync(Promise.resolve(Ok(42)), formatError)\nresult1 == Ok(42)\n\nlet result2 = await Result.mapErrorAsync(Promise.resolve(Error(\"invalid\")), formatError)\nresult2 == Error(\"Error: invalid\")\n```" - ], - "signature": "let mapErrorAsync: (\n promise>,\n 'error => 'mappedError,\n) => promise>" - }, - { - "id": "Stdlib.Result.flatMapOkAsync", - "kind": "value", - "name": "flatMapOkAsync", - "docstrings": [ - "`flatMapOkAsync(res, f)`: Asynchronously flat-maps over the Ok value of a Result. When `res` is `Ok(n)`, \napplies the async function `f` to `n` which returns a Promise of a Result. \nWhen `res` is `Error`, returns the error unchanged.\n\n## Examples\n\n```rescript\nlet asyncValidate = async x =>\n if x > 0 {\n Ok(x * 2)\n } else {\n Error(\"Must be positive\")\n }\n\nlet result1 = await Result.flatMapOkAsync(Promise.resolve(Ok(5)), asyncValidate)\nresult1 == Ok(10)\n\nlet result2 = await Result.flatMapOkAsync(\n Promise.resolve(Error(\"Already failed\")),\n asyncValidate,\n)\nresult2 == Error(\"Already failed\")\n```" - ], - "signature": "let flatMapOkAsync: (\n promise>,\n 'ok => promise>,\n) => promise>" - }, - { - "id": "Stdlib.Result.flatMapErrorAsync", - "kind": "value", - "name": "flatMapErrorAsync", - "docstrings": [ - "`flatMapErrorAsync(res, f)`: Asynchronously flat-maps over the Error value of a Result. When `res` is `Error(e)`, \napplies the async function `f` to `e` which returns a Promise of a Result. \nWhen `res` is `Ok`, returns the ok value unchanged.\n\n## Examples\n\n```rescript\nlet asyncRecover = async error =>\n if error === \"timeout\" {\n Ok(\"default\")\n } else {\n Error(error)\n }\n\nlet result1 = await Result.flatMapErrorAsync(\n Promise.resolve(Error(\"timeout\")),\n asyncRecover,\n)\nresult1 == Ok(\"default\")\n\nlet result2 = await Result.flatMapErrorAsync(\n Promise.resolve(Ok(\"default\")),\n asyncRecover,\n)\nresult2 == Ok(\"default\")\n```" - ], - "signature": "let flatMapErrorAsync: (\n promise>,\n 'error => promise>,\n) => promise>" - } - ] - }, - "stdlib/regexp": { - "id": "Stdlib.RegExp", - "name": "RegExp", - "docstrings": [ - "Functions for handling RegExp's in ReScript.\n\nSee [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) on MDN." - ], - "items": [ - { - "id": "Stdlib.RegExp.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an instantiated `RegExp`." - ], - "signature": "type t" - }, - { - "id": "Stdlib.RegExp.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(string)` creates a `RegExp.t` from the provided string. This can then be used to match on strings using `RegExp.exec`.\n\nSee [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n\n// Match 'foo' with case insensitive flag\nlet regexp = RegExp.fromString(\"foo\", ~flags=\"i\")\n\nswitch regexp->RegExp.exec(\"FOO\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"FOO\"\n}\n```" - ], - "signature": "let fromString: (string, ~flags: string=?) => t" - }, - { - "id": "Stdlib.RegExp.fromStringWithFlags", - "kind": "value", - "name": "fromStringWithFlags", - "docstrings": [ - "`fromStringWithFlags(string)` creates a `RegExp.t` from the provided string, using the provided `flags`. This can then be used to match on strings using `RegExp.exec`.\n\nSee [`RegExp parameters`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp#parameters) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```" - ], - "signature": "let fromStringWithFlags: (string, ~flags: string) => t", - "deprecated": "" - }, - { - "id": "Stdlib.RegExp.escape", - "kind": "value", - "name": "escape", - "docstrings": [ - "`escape(string)` escapes any potential regex syntax characters in a string.\n\nSee [`RegExp.escape`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/escape) on MDN.\n\n## Examples\n```rescript\nlet literal = \"foo[bar]\"\nlet regexp = literal->RegExp.escape->RegExp.fromString\nregexp->RegExp.test(\"foo[bar]\") == true\n```\n\n## Remark\n\nSince May 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let escape: string => string" - }, - { - "id": "Stdlib.RegExp.test", - "kind": "value", - "name": "test", - "docstrings": [ - "`test(regexp, string)` tests whether the provided `regexp` matches on the provided string.\n\nSee [`RegExp.test`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nif regexp->RegExp.test(\"ReScript is cool!\") {\n Console.log(\"Yay, there's a word in there.\")\n}\n```" - ], - "signature": "let test: (t, string) => bool" - }, - { - "id": "Stdlib.RegExp.exec", - "kind": "value", - "name": "exec", - "docstrings": [ - "`exec(regexp, string)` executes the provided regexp on the provided string, optionally returning a `RegExp.Result.t` if the regexp matches on the string.\n\nSee [`RegExp.exec`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```" - ], - "signature": "let exec: (t, string) => option" - }, - { - "id": "Stdlib.RegExp.lastIndex", - "kind": "value", - "name": "lastIndex", - "docstrings": [ - "`lastIndex(regexp)` returns the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `0` to the console\n\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `4` to the console\n```" - ], - "signature": "let lastIndex: t => int" - }, - { - "id": "Stdlib.RegExp.setLastIndex", - "kind": "value", - "name": "setLastIndex", - "docstrings": [ - "`setLastIndex(regexp, index)` set the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nregexp->RegExp.setLastIndex(4)\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `10` to the console\n```" - ], - "signature": "let setLastIndex: (t, int) => unit" - }, - { - "id": "Stdlib.RegExp.ignoreCase", - "kind": "value", - "name": "ignoreCase", - "docstrings": [ - "`ignoreCase(regexp)` returns whether the ignore case (`i`) flag is set on this `RegExp`.\n\nSee [`RegExp.ignoreCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/ignoreCase) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.ignoreCase) // Logs `false`, since `i` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.ignoreCase) // Logs `true`, since `i` is set\n```" - ], - "signature": "let ignoreCase: t => bool" - }, - { - "id": "Stdlib.RegExp.global", - "kind": "value", - "name": "global", - "docstrings": [ - "`global(regexp)` returns whether the global (`g`) flag is set on this `RegExp`.\n\nSee [`RegExp.global`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/global) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.global) // Logs `true`, since `g` is set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.global) // Logs `false`, since `g` is not set\n```" - ], - "signature": "let global: t => bool" - }, - { - "id": "Stdlib.RegExp.multiline", - "kind": "value", - "name": "multiline", - "docstrings": [ - "`multiline(regexp)` returns whether the multiline (`m`) flag is set on this `RegExp`.\n\nSee [`RegExp.multiline`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/multiline) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.multiline) // Logs `false`, since `m` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mi\")\nConsole.log(regexp2->RegExp.multiline) // Logs `true`, since `m` is set\n```" - ], - "signature": "let multiline: t => bool" - }, - { - "id": "Stdlib.RegExp.source", - "kind": "value", - "name": "source", - "docstrings": [ - "`source(regexp)` returns the source text for this `RegExp`, without the two forward slashes (if present), and without any set flags.\n\nSee [`RegExp.source`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/source) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp->RegExp.source) // Logs `\\w+`, the source text of the `RegExp`\n```" - ], - "signature": "let source: t => string" - }, - { - "id": "Stdlib.RegExp.sticky", - "kind": "value", - "name": "sticky", - "docstrings": [ - "`sticky(regexp)` returns whether the sticky (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.sticky`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `y` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"my\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `y` is set\n```" - ], - "signature": "let sticky: t => bool" - }, - { - "id": "Stdlib.RegExp.unicode", - "kind": "value", - "name": "unicode", - "docstrings": [ - "`unicode(regexp)` returns whether the unicode (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.unicode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `u` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mu\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `u` is set\n```" - ], - "signature": "let unicode: t => bool" - }, - { - "id": "Stdlib.RegExp.flags", - "kind": "value", - "name": "flags", - "docstrings": [ - "`flags(regexp)` returns a string consisting of all the flags set on this `RegExp`.\n\nSee [`RegExp.flags`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromString(\"\\\\w+\", ~flags=\"gi\")\nConsole.log(regexp->RegExp.flags) // Logs \"gi\", all the flags set on the RegExp\n```" - ], - "signature": "let flags: t => string" - }, - { - "id": "Stdlib.RegExp.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(regExp)` ignores the provided regExp and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/promise": { - "id": "Stdlib.Promise", - "name": "Promise", - "docstrings": [ - "Functions for interacting with JavaScript Promise.\nSee: [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)." - ], - "items": [ - { - "id": "Stdlib.Promise.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>" - }, - { - "id": "Stdlib.Promise.resolve", - "kind": "value", - "name": "resolve", - "docstrings": [ - "`resolve(value)` creates a resolved Promise with a given `value`.\nSee [`Promise.resolve`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve) on MDN.\n\n## Examples\n\n```rescript\nlet p = Promise.resolve(5) // promise\n```" - ], - "signature": "let resolve: 'a => t<'a>" - }, - { - "id": "Stdlib.Promise.reject", - "kind": "value", - "name": "reject", - "docstrings": [ - "`reject(exn)` reject a Promise.\nSee [`Promise.reject`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject) on MDN.\n\n## Examples\n\n```rescript\nexception TestError(string)\n\nTestError(\"some rejected value\")\n->Promise.reject\n->Promise.catch(v => {\n switch v {\n | TestError(msg) => msg == \"some rejected value\"\n | _ => assert(false)\n }\n Promise.resolve()\n})\n->ignore\n```" - ], - "signature": "let reject: exn => t<'a>" - }, - { - "id": "Stdlib.Promise.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(callback)` creates a new Promise based on a `callback` that receives two\nuncurried functions `resolve` and `reject` for defining the Promise's result.\n\n## Examples\n\n```rescript\nopen Promise\n\nlet n = 4\nPromise.make((resolve, reject) => {\n if n < 5 {\n resolve(\"success\")\n } else {\n reject(\"failed\")\n }\n})\n->then(str => {\n Console.log(str)->resolve\n})\n->catch(_ => {\n Console.log(\"Error occurred\")\n resolve()\n})\n->ignore\n```" - ], - "signature": "let make: (('a => unit, 'e => unit) => unit) => t<'a>" - }, - { - "id": "Stdlib.Promise.promiseAndResolvers", - "kind": "type", - "name": "promiseAndResolvers", - "docstrings": [], - "signature": "type promiseAndResolvers<'a> = {\n promise: t<'a>,\n resolve: 'a => unit,\n reject: exn => unit,\n}" - }, - { - "id": "Stdlib.Promise.withResolvers", - "kind": "value", - "name": "withResolvers", - "docstrings": [ - "`withResolvers()` returns a object containing a new promise with functions to resolve or reject it. See [`Promise.withResolvers`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\n\nlet {promise, resolve, _} = Promise.withResolvers()\n\nsetTimeout(() => {\n resolve(\"success\")\n}, 1000)->TimeoutId.ignore\n\npromise\n->thenResolve(str => {\n Console.log(str)\n})\n->ignore\n```" - ], - "signature": "let withResolvers: unit => promiseAndResolvers<'a>" - }, - { - "id": "Stdlib.Promise.catch", - "kind": "value", - "name": "catch", - "docstrings": [ - "`catch(promise, errorCallback)` registers an exception handler in a promise chain.\nThe `errorCallback` receives an `exn` value that can later be refined into a JS\nerror or ReScript error. The `errorCallback` needs to return a promise with the\nsame type as the consumed promise. See [`Promise.catch`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\n\nexception SomeError(string)\n\nreject(SomeError(\"this is an error\"))\n->then(_ => {\n Ok(\"This result will never be returned\")->resolve\n})\n->catch(e => {\n let msg = switch e {\n | SomeError(msg) => \"ReScript error occurred: \" ++ msg\n | JsExn(obj) =>\n switch JsExn.message(obj) {\n | Some(msg) => \"JS exception occurred: \" ++ msg\n | None => \"Some other JS value has been thrown\"\n }\n | _ => \"Unexpected error occurred\"\n }\n\n Error(msg)->resolve\n})\n->then(result => {\n switch result {\n | Ok(r) => Console.log2(\"Operation successful: \", r)\n | Error(msg) => Console.log2(\"Operation failed: \", msg)\n }->resolve\n})\n->ignore // Ignore needed for side-effects\n```\n\nIn case you want to return another promise in your `callback`, consider using\n`then` instead." - ], - "signature": "let catch: (t<'a>, exn => t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Promise.then", - "kind": "value", - "name": "then", - "docstrings": [ - "`then(promise, callback)` returns a new promise based on the result of `promise`'s\nvalue. The `callback` needs to explicitly return a new promise via `resolve`.\nIt is **not allowed** to resolve a nested promise (like `resolve(resolve(1))`).\nSee [`Promise.then`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) on MDN.\n## Examples\n\n```rescript\nopen Promise\nresolve(5)\n->then(num => {\n resolve(num + 5)\n})\n->then(num => {\n Console.log2(\"Your lucky number is: \", num)\n resolve()\n})\n->ignore\n```" - ], - "signature": "let then: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Promise.thenResolve", - "kind": "value", - "name": "thenResolve", - "docstrings": [ - "`thenResolve(promise, callback)` converts an encapsulated value of a promise\ninto another promise wrapped value. It is **not allowed** to return a promise\nwithin the provided callback (e.g. `thenResolve(value => resolve(value))`).\n\n## Examples\n\n```rescript\nopen Promise\nresolve(\"Anna\")\n->thenResolve(str => {\n \"Hello \" ++ str\n})\n->thenResolve(str => {\n Console.log(str)\n})\n->ignore // Ignore needed for side-effects\n```\n\nIn case you want to return another promise in your `callback`, consider using\n`then` instead." - ], - "signature": "let thenResolve: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Promise.finally", - "kind": "value", - "name": "finally", - "docstrings": [ - "`finally(promise, callback)` is used to execute a function that is called no\nmatter if a promise was resolved or rejected. It will return the same `promise`\nit originally received. See [`Promise.finally`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/finally) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nexception SomeError(string)\nlet isDone = ref(false)\n\nresolve(5)\n->then(_ => {\n reject(SomeError(\"test\"))\n})\n->then(v => {\n Console.log2(\"final result\", v)\n resolve()\n})\n->catch(_ => {\n Console.log(\"Error handled\")\n resolve()\n})\n->finally(() => {\n Console.log(\"finally\")\n isDone := true\n})\n->then(() => {\n Console.log2(\"isDone:\", isDone.contents)\n resolve()\n})\n->ignore\n```" - ], - "signature": "let finally: (t<'a>, unit => unit) => t<'a>" - }, - { - "id": "Stdlib.Promise.race", - "kind": "value", - "name": "race", - "docstrings": [ - "`race(arr)` runs all promises concurrently and returns promise settles with the eventual state of the first promise that settles. See [`Promise.race`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nlet racer = (ms, name) => {\n Promise.make((resolve, _) => {\n setTimeout(() => {\n resolve(name)\n }, ms)->TimeoutId.ignore\n })\n}\n\nlet promises = [racer(1000, \"Turtle\"), racer(500, \"Hare\"), racer(100, \"Eagle\")]\n\nrace(promises)->then(winner => {\n Console.log(\"The winner is \" ++ winner)\n resolve()\n})\n```" - ], - "signature": "let race: array> => t<'a>" - }, - { - "id": "Stdlib.Promise.any", - "kind": "value", - "name": "any", - "docstrings": [ - "`any(arr)` runs all promises concurrently and returns promise fulfills when any of the input's promises fulfills, with this first fulfillment value. See [`Promise.any`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/any) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nlet racer = (ms, name) => {\n Promise.make((resolve, _) => {\n setTimeout(() => {\n resolve(name)\n }, ms)->TimeoutId.ignore\n })\n}\n\nlet promises = [racer(1000, \"Turtle\"), racer(500, \"Hare\"), racer(100, \"Eagle\")]\n\nany(promises)->then(winner => {\n Console.log(\"The winner is \" ++ winner)\n resolve()\n})\n```" - ], - "signature": "let any: array> => t<'a>" - }, - { - "id": "Stdlib.Promise.all", - "kind": "value", - "name": "all", - "docstrings": [ - "`all(promises)` runs all promises concurrently and returns a promise fulfills when all of the input's promises fulfill, with an array of the fulfillment values. See [`Promise.all`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all) on MDN.\n\n```rescript\nopen Promise\nlet promises = [resolve(1), resolve(2), resolve(3)]\n\nall(promises)\n->then(results => {\n results->Array.forEach(num => {\n Console.log2(\"Number: \", num)\n })\n\n resolve()\n})\n->ignore\n```" - ], - "signature": "let all: array> => t>" - }, - { - "id": "Stdlib.Promise.all2", - "kind": "value", - "name": "all2", - "docstrings": [ - "`all2((p1, p2))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all2: ((t<'a>, t<'b>)) => t<('a, 'b)>" - }, - { - "id": "Stdlib.Promise.all3", - "kind": "value", - "name": "all3", - "docstrings": [ - "`all3((p1, p2, p3))`. Like `all()`, but with a fixed size tuple of 3" - ], - "signature": "let all3: ((t<'a>, t<'b>, t<'c>)) => t<('a, 'b, 'c)>" - }, - { - "id": "Stdlib.Promise.all4", - "kind": "value", - "name": "all4", - "docstrings": [ - "`all4((p1, p2, p3, p4))`. Like `all()`, but with a fixed size tuple of 4" - ], - "signature": "let all4: ((t<'a>, t<'b>, t<'c>, t<'d>)) => t<('a, 'b, 'c, 'd)>" - }, - { - "id": "Stdlib.Promise.all5", - "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((p1, p2, p3, p4, p5))`. Like `all()`, but with a fixed size tuple of 5" - ], - "signature": "let all5: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>),\n) => t<('a, 'b, 'c, 'd, 'e)>" - }, - { - "id": "Stdlib.Promise.all6", - "kind": "value", - "name": "all6", - "docstrings": [ - "`all6((p1, p2, p4, p5, p6))`. Like `all()`, but with a fixed size tuple of 6\n\")" - ], - "signature": "let all6: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>, t<'f>),\n) => t<('a, 'b, 'c, 'd, 'e, 'f)>" - }, - { - "id": "Stdlib.Promise.settledResult", - "kind": "type", - "name": "settledResult", - "docstrings": [], - "signature": "type settledResult<'a> =\n | Fulfilled({value: 'a})\n | Rejected({reason: exn})" - }, - { - "id": "Stdlib.Promise.allSettled", - "kind": "value", - "name": "allSettled", - "docstrings": [ - "`allSettled(promises)` runs all promises concurrently and returns promise fulfills when all of the input's promises settle with an array of objects that describe the outcome of each promise. See [`Promise.allSettled`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled) on MDN.\n\n```rescript\nopen Promise\n\nexception TestError(string)\n\nlet promises = [resolve(1), resolve(2), reject(TestError(\"some rejected promise\"))]\n\nallSettled(promises)\n->then(results => {\n results->Array.forEach(result => {\n switch result {\n | Fulfilled({value: num}) => Console.log2(\"Number: \", num)\n | Rejected({reason}) => Console.log(reason)\n }\n })\n\n resolve()\n})\n->ignore\n```" - ], - "signature": "let allSettled: array> => t>>" - }, - { - "id": "Stdlib.Promise.allSettled2", - "kind": "value", - "name": "allSettled2", - "docstrings": [ - "`allSettled2((p1, p2))`. Like `allSettled()`, but with a fixed size tuple of 2" - ], - "signature": "let allSettled2: (\n (t<'a>, t<'b>),\n) => t<(settledResult<'a>, settledResult<'b>)>" - }, - { - "id": "Stdlib.Promise.allSettled3", - "kind": "value", - "name": "allSettled3", - "docstrings": [ - "`allSettled3((p1, p2, p3))`. Like `allSettled()`, but with a fixed size tuple of 3" - ], - "signature": "let allSettled3: (\n (t<'a>, t<'b>, t<'c>),\n) => t<\n (settledResult<'a>, settledResult<'b>, settledResult<'c>),\n>" - }, - { - "id": "Stdlib.Promise.allSettled4", - "kind": "value", - "name": "allSettled4", - "docstrings": [ - "`allSettled4((p1, p2, p3, p4))`. Like `allSettled()`, but with a fixed size tuple of 4" - ], - "signature": "let allSettled4: (\n (t<'a>, t<'b>, t<'c>, t<'d>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n ),\n>" - }, - { - "id": "Stdlib.Promise.allSettled5", - "kind": "value", - "name": "allSettled5", - "docstrings": [ - "`allSettled5((p1, p2, p3, p4, p5))`. Like `allSettled()`, but with a fixed size tuple of 5" - ], - "signature": "let allSettled5: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n settledResult<'e>,\n ),\n>" - }, - { - "id": "Stdlib.Promise.allSettled6", - "kind": "value", - "name": "allSettled6", - "docstrings": [ - "`allSettled6((p1, p2, p4, p5, p6))`. Like `allSettled()`, but with a fixed size tuple of 6\n\")" - ], - "signature": "let allSettled6: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>, t<'f>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n settledResult<'e>,\n settledResult<'f>,\n ),\n>" - }, - { - "id": "Stdlib.Promise.done", - "kind": "value", - "name": "done", - "docstrings": [ - "`done(p)` is a safe way to ignore a promise. If a value is anything else than a\npromise, it will throw a type error." - ], - "signature": "let done: promise<'a> => unit", - "deprecated": "" - }, - { - "id": "Stdlib.Promise.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(promise)` ignores the provided promise and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: promise<'a> => unit" - } - ] - }, - "stdlib/pair": { - "id": "Stdlib.Pair", - "name": "Pair", - "docstrings": [ - "This module provides functions to work with pairs, which are 2-element tuples." - ], - "items": [ - { - "id": "Stdlib.Pair.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a, 'b> = ('a, 'b)" - }, - { - "id": "Stdlib.Pair.first", - "kind": "value", - "name": "first", - "docstrings": [ - "`first(pair)` returns the first element of a pair.\n\n## Examples\n\n```rescript\nPair.first((1, 2)) == 1\n```" - ], - "signature": "let first: (('a, 'b)) => 'a" - }, - { - "id": "Stdlib.Pair.second", - "kind": "value", - "name": "second", - "docstrings": [ - "`second(pair)` returns the second element of a pair.\n\n## Examples\n\n```rescript\nPair.second((1, 2)) == 2\n```" - ], - "signature": "let second: (('a, 'b)) => 'b" - }, - { - "id": "Stdlib.Pair.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(pair)` ignores the provided pair and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Pair.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(pair1, pair2, f1, f2)` check equality of `pair2` and `pair2` using `f1` for\nequality on the first element and `f2` for equality on the second element.\n\n## Examples\n\n```rescript\nPair.equal((1, \"test\"), (1, \"test\"), Int.equal, String.equal) == true\n\nPair.equal((1, \"test\"), (2, \"test\"), Int.equal, String.equal) == false\n```" - ], - "signature": "let equal: (\n ('a, 'b),\n ('c, 'd),\n ('a, 'c) => bool,\n ('b, 'd) => bool,\n) => bool" - }, - { - "id": "Stdlib.Pair.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(pair1, pair2, f1, f2)` compares two pairs, using `f1` to compare the first element\nand `f2` to compare the second element. Ordering is based on the first element,\nif they are equal, the second element is compared.\n\n## Examples\n\n```rescript\nPair.compare((1, \"a\"), (1, \"a\"), Int.compare, String.compare) == Ordering.equal\nPair.compare((1, \"a\"), (1, \"b\"), Int.compare, String.compare) == Ordering.less\nPair.compare((2, \"a\"), (1, \"b\"), Int.compare, String.compare) == Ordering.greater\n```" - ], - "signature": "let compare: (\n ('a, 'b),\n ('c, 'd),\n ('a, 'c) => float,\n ('b, 'd) => float,\n) => float" - } - ] - }, - "stdlib/ordering": { - "id": "Stdlib.Ordering", - "name": "Ordering", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Ordering.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Ordering values represent the result of a comparison: `less`, `equal`, or `greater`." - ], - "signature": "type t = float" - }, - { - "id": "Stdlib.Ordering.less", - "kind": "value", - "name": "less", - "docstrings": [], - "signature": "let less: float" - }, - { - "id": "Stdlib.Ordering.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: float" - }, - { - "id": "Stdlib.Ordering.greater", - "kind": "value", - "name": "greater", - "docstrings": [], - "signature": "let greater: float" - }, - { - "id": "Stdlib.Ordering.isLess", - "kind": "value", - "name": "isLess", - "docstrings": [ - "`isLess(ordering)` returns `true` when `ordering` equals `Ordering.less`.\n\n## Examples\n\n```rescript\nOrdering.isLess(Ordering.less) == true\nOrdering.isLess(Ordering.equal) == false\n```" - ], - "signature": "let isLess: float => bool" - }, - { - "id": "Stdlib.Ordering.isEqual", - "kind": "value", - "name": "isEqual", - "docstrings": [ - "`isEqual(ordering)` returns `true` when `ordering` equals `Ordering.equal`.\n\n## Examples\n\n```rescript\nOrdering.isEqual(Ordering.equal) == true\nOrdering.isEqual(Ordering.greater) == false\n```" - ], - "signature": "let isEqual: float => bool" - }, - { - "id": "Stdlib.Ordering.isGreater", - "kind": "value", - "name": "isGreater", - "docstrings": [ - "`isGreater(ordering)` returns `true` when `ordering` equals `Ordering.greater`.\n\n## Examples\n\n```rescript\nOrdering.isGreater(Ordering.greater) == true\nOrdering.isGreater(Ordering.less) == false\n```" - ], - "signature": "let isGreater: float => bool" - }, - { - "id": "Stdlib.Ordering.invert", - "kind": "value", - "name": "invert", - "docstrings": [ - "`invert(ordering)` flips the ordering result (less becomes greater and vice versa).\n\n## Examples\n\n```rescript\nOrdering.invert(Ordering.less) == Ordering.greater\nOrdering.invert(Ordering.equal) == Ordering.equal\n```" - ], - "signature": "let invert: float => float" - }, - { - "id": "Stdlib.Ordering.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "`fromInt(n)` converts an integer comparison result into an ordering.\n\n## Examples\n\n```rescript\nOrdering.fromInt(-5) == Ordering.less\nOrdering.fromInt(0) == Ordering.equal\nOrdering.fromInt(3) == Ordering.greater\n```" - ], - "signature": "let fromInt: int => float" - }, - { - "id": "Stdlib.Ordering.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(ordering)` ignores the provided ordering and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/option": { - "id": "Stdlib.Option", - "name": "Option", - "docstrings": [ - "We represent the existence and nonexistence of a value by wrapping it with\nthe `option` type. In order to make it a bit more convenient to work with\noption-types, we provide utility-functions for it.\n\nThe `option` type is a part of the ReScript standard library which is defined\nlike this:\n\n```rescript\ntype option<'a> = None | Some('a)\n```\n\n```rescript\nlet someString: option = Some(\"hello\")\n```" - ], - "items": [ - { - "id": "Stdlib.Option.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an option of type 'a." - ], - "signature": "type t<'a> = option<'a> = None | Some('a)" - }, - { - "id": "Stdlib.Option.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(opt, f)` applies `f` to `opt`, if `f` returns `true`, then it returns `Some(value)`, otherwise returns `None`.\n\n## Examples\n\n```rescript\nOption.filter(Some(10), x => x > 5) // Some(10)\nOption.filter(Some(4), x => x > 5) // None\nOption.filter(None, x => x > 5) // None\n```" - ], - "signature": "let filter: (option<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Option.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(opt, f)` call `f` on `opt`. if `opt` is `Some(value)`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nOption.forEach(Some(\"thing\"), x => Console.log(x)) // logs \"thing\"\nOption.forEach(None, x => Console.log(x)) // returns ()\n```" - ], - "signature": "let forEach: (option<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Option.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(opt, ~message=?)` returns `value` if `opt` is `Some(value)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n```rescript\nOption.getExn(Some(3)) == 3\n\nswitch Option.getExn(None) {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n\nswitch Option.getExn(None, ~message=\"was None!\") {\n| exception _ => assert(true) // Throws a JsError with the message \"was None!\"\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an error if `opt` is `None`" - ], - "signature": "let getExn: (option<'a>, ~message: string=?) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Option.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(opt, ~message=?)` returns `value` if `opt` is `Some(value)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n```rescript\nOption.getOrThrow(Some(3)) == 3\n\nswitch Option.getOrThrow(None) {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n\nswitch Option.getOrThrow(None, ~message=\"was None!\") {\n| exception _ => assert(true) // Throws a JsError with the message \"was None!\"\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an error if `opt` is `None`" - ], - "signature": "let getOrThrow: (option<'a>, ~message: string=?) => 'a" - }, - { - "id": "Stdlib.Option.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(opt)` returns `value` if `opt` is `Some(value)`, otherwise `undefined`.\n\n## Examples\n\n```rescript\nOption.getUnsafe(Some(3)) == 3\nOption.getUnsafe((None: option)) // Returns `undefined`, which is not a valid `int`\n```\n\n## Notes\n\n- This is an unsafe operation. It assumes `value` is not `None`, and may cause undefined behaviour if it is." - ], - "signature": "let getUnsafe: option<'a> => 'a" - }, - { - "id": "Stdlib.Option.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(opt, default, f)` returns `f(value)` if `opt` is `Some(value)`, otherwise `default`.\n\n## Examples\n\n```rescript\nlet someValue = Some(3)\nsomeValue->Option.mapOr(0, x => x + 5) // 8\n\nlet noneValue = None\nnoneValue->Option.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (option<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Option.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (option<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Option.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(opt, f)` returns `Some(f(value))` if `opt` is `Some(value)`, otherwise `None`.\n\n## Examples\n\n```rescript\nOption.map(Some(3), x => x * x) // Some(9)\nOption.map(None, x => x * x) // None\n```" - ], - "signature": "let map: (option<'a>, 'a => 'b) => option<'b>" - }, - { - "id": "Stdlib.Option.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(opt, f)` returns `f(value)` if `opt` is `Some(value)`, otherwise `None`.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Some(value + 1)\n } else {\n None\n }\n\nOption.flatMap(Some(2), addIfAboveOne) // Some(3)\nOption.flatMap(Some(-4), addIfAboveOne) // None\nOption.flatMap(None, addIfAboveOne) // None\n```" - ], - "signature": "let flatMap: (option<'a>, 'a => option<'b>) => option<'b>" - }, - { - "id": "Stdlib.Option.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(opt, default)` returns `value` if `opt` is `Some(value)`, otherwise `default`.\n\n## Examples\n\n```rescript\nOption.getOr(None, \"Banana\") // Banana\nOption.getOr(Some(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nSome(\"Jane\")->greet // \"Greetings Jane\"\nNone->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (option<'a>, 'a) => 'a" - }, - { - "id": "Stdlib.Option.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (option<'a>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Option.orElse", - "kind": "value", - "name": "orElse", - "docstrings": [ - "`orElse(opt1, opt2)` returns `opt2` if `opt1` is `None`, otherwise `opt1`.\n\n## Examples\n\n```rescript\nOption.orElse(Some(1812), Some(1066)) == Some(1812)\nOption.orElse(None, Some(1066)) == Some(1066)\nOption.orElse(None, None) == None\n```" - ], - "signature": "let orElse: (option<'a>, option<'a>) => option<'a>" - }, - { - "id": "Stdlib.Option.isSome", - "kind": "value", - "name": "isSome", - "docstrings": [ - "`isSome(opt)` returns `true` if `opt` is `Some(value)`, otherwise returns `false`.\n\n## Examples\n\n```rescript\nOption.isSome(None) // false\nOption.isSome(Some(1)) // true\n```" - ], - "signature": "let isSome: option<'a> => bool" - }, - { - "id": "Stdlib.Option.isNone", - "kind": "value", - "name": "isNone", - "docstrings": [ - "`isNone(opt)` returns `true` if `opt` is `None`, false otherwise.\n\n## Examples\n\n```rescript\nOption.isNone(None) // true\nOption.isNone(Some(1)) // false\n```" - ], - "signature": "let isNone: option<'a> => bool" - }, - { - "id": "Stdlib.Option.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(opt1, opt2, f)` evaluates two optional values for equality with respect to a predicate function `f`. If both `opt1` and `opt2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, the predicate function `f` must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Option\n\nequal(Some(3), Some(15), clockEqual) // true\nequal(Some(3), None, clockEqual) // false\nequal(None, Some(3), clockEqual) // false\nequal(None, None, clockEqual) // true\n```" - ], - "signature": "let equal: (option<'a>, option<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.Option.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(opt1, opt2, f)` compares two optional values with respect to given `f`.\n\nIf both `opt1` and `opt2` are `None`, it returns `0.`. If the first argument is `Some(value1)` and the second is `None`, returns `1.` (something is greater than nothing).\n\nIf the first argument is `None` and the second is `Some(value2)`, returns `-1.`\n(nothing is less than something).\n\nIf the arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, `f` takes two arguments and returns `-1.` if the first\nargument is less than the second, `0.` if the arguments are equal, and `1.` if\nthe first argument is greater than the second.\n\n## Examples\n\n```rescript\nlet clockCompare = (a, b) => Int.compare(mod(a, 12), mod(b, 12))\n\nOption.compare(Some(3), Some(15), clockCompare) // 0.\nOption.compare(Some(3), Some(14), clockCompare) // 1.\nOption.compare(Some(2), Some(15), clockCompare) // (-1.)\nOption.compare(None, Some(15), clockCompare) // (-1.)\nOption.compare(Some(14), None, clockCompare) // 1.\nOption.compare(None, None, clockCompare) // 0.\n```" - ], - "signature": "let compare: (\n option<'a>,\n option<'b>,\n ('a, 'b) => Ordering.t,\n) => Ordering.t" - }, - { - "id": "Stdlib.Option.all", - "kind": "value", - "name": "all", - "docstrings": [ - "`all(options)` returns an option of array if all options are Some, otherwise returns None.\n\n## Examples\n\n```rescript\nOption.all([Some(1), Some(2), Some(3)]) // Some([1, 2, 3])\nOption.all([Some(1), None]) // None\n```" - ], - "signature": "let all: array> => option>" - }, - { - "id": "Stdlib.Option.all2", - "kind": "value", - "name": "all2", - "docstrings": [ - "`all2((o1, o2))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all2: ((option<'a>, option<'b>)) => option<('a, 'b)>" - }, - { - "id": "Stdlib.Option.all3", - "kind": "value", - "name": "all3", - "docstrings": [ - "`all3((o1, o2, o3))`. Like `all()`, but with a fixed size tuple of 3" - ], - "signature": "let all3: (\n (option<'a>, option<'b>, option<'c>),\n) => option<('a, 'b, 'c)>" - }, - { - "id": "Stdlib.Option.all4", - "kind": "value", - "name": "all4", - "docstrings": [ - "`all4((o1, o2, o3, o4))`. Like `all()`, but with a fixed size tuple of 4" - ], - "signature": "let all4: (\n (option<'a>, option<'b>, option<'c>, option<'d>),\n) => option<('a, 'b, 'c, 'd)>" - }, - { - "id": "Stdlib.Option.all5", - "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((o1, o2, o3, o4, o5))`. Like `all()`, but with a fixed size tuple of 5" - ], - "signature": "let all5: (\n (\n option<'a>,\n option<'b>,\n option<'c>,\n option<'d>,\n option<'e>,\n ),\n) => option<('a, 'b, 'c, 'd, 'e)>" - }, - { - "id": "Stdlib.Option.all6", - "kind": "value", - "name": "all6", - "docstrings": [ - "`all6((o1, o2, o3, o4, o5, o6))`. Like `all()`, but with a fixed size tuple of 6" - ], - "signature": "let all6: (\n (\n option<'a>,\n option<'b>,\n option<'c>,\n option<'d>,\n option<'e>,\n option<'f>,\n ),\n) => option<('a, 'b, 'c, 'd, 'e, 'f)>" - }, - { - "id": "Stdlib.Option.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(option)` ignores the provided option and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: option<'a> => unit" - } - ] - }, - "stdlib/object": { - "id": "Stdlib.Object", - "name": "Object", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Object.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make` create a new object that inherits the properties and methods from the standard built-in Object, such as `toString`. See [Object on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)\n\n## Examples\n\n```rescript\nlet x = Object.make()\nx->Object.keysToArray->Array.length // 0\nx->Object.get(\"toString\")->Option.isSome // true\n```" - ], - "signature": "let make: unit => {..}" - }, - { - "id": "Stdlib.Object.is", - "kind": "value", - "name": "is", - "docstrings": [ - "`is` determines if two objects are identical in all contexts. Objects, arrays, records, and other non-primitives are only identical if they reference the **exact** same object in memory. Primitives like ints, floats, and strings are identical if they have the same value. `+0` and `-0` are distinct. NaN is equal to itself. See [Object.is on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)\n\nIn most scenarios use `==` or `===` or the custom `equals` function (if provided) for the type.\n\n## Examples\n\n```rescript\nObject.is(25, 13) // false\nObject.is(\"abc\", \"abc\") // true\nObject.is(undefined, undefined) // true\nObject.is(undefined, null) // false\nObject.is(-0.0, 0.0) // false\nObject.is(list{1, 2}, list{1, 2}) // false\n\nObject.is([1, 2, 3], [1, 2, 3]) // false\n[1, 2, 3] == [1, 2, 3] // true\n[1, 2, 3] === [1, 2, 3] // false\n\nlet fruit = {\"name\": \"Apple\"}\nObject.is(fruit, fruit) // true\nObject.is(fruit, {\"name\": \"Apple\"}) // false\nfruit == {\"name\": \"Apple\"} // true\nfruit === {\"name\": \"Apple\"} // false\n```" - ], - "signature": "let is: ('a, 'a) => bool" - }, - { - "id": "Stdlib.Object.create", - "kind": "value", - "name": "create", - "docstrings": [ - "`create` creates a new object, using an existing object as the prototype of the new object. See [Object.create on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\n\n**Note:** ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object) and [records](https://rescript-lang.org/docs/manual/latest/record). This is often safer and more convenient than using `create` and other functions in this module.\n\n## Examples\n\n```rescript\nlet x = {\"fruit\": \"banana\"}\nlet y = Object.create(x)\ny->Object.get(\"fruit\") // Some(\"banana\")\n```" - ], - "signature": "let create: {..} => {..}" - }, - { - "id": "Stdlib.Object.createWithProperties", - "kind": "value", - "name": "createWithProperties", - "docstrings": [ - "`createWithProperties(proto, descriptors)` creates a new object that delegates to `proto` and defines additional properties using descriptor objects.\n\nSee [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) on MDN.\n\n## Examples\n\n```rescript\nlet proto = {\"kind\": \"fruit\"}\nlet obj = Object.createWithProperties(proto, {\"name\": {\"value\": \"banana\"}})\nobj->Object.get(\"name\") == Some(\"banana\")\nobj->Object.get(\"kind\") == Some(\"fruit\")\n```" - ], - "signature": "let createWithProperties: ({..}, {..}) => {..}" - }, - { - "id": "Stdlib.Object.createWithNull", - "kind": "value", - "name": "createWithNull", - "docstrings": [ - "`createWithNull()` creates an object with a `null` prototype (no inherited properties).\n\nSee [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) on MDN.\n\n## Examples\n\n```rescript\nlet obj = Object.createWithNull()\nobj->Object.get(\"toString\") == None\n```" - ], - "signature": "let createWithNull: unit => {..}" - }, - { - "id": "Stdlib.Object.createWithNullAndProperties", - "kind": "value", - "name": "createWithNullAndProperties", - "docstrings": [ - "`createWithNullAndProperties(descriptors)` creates an object with a `null` prototype and defines properties using descriptor objects.\n\nSee [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) on MDN.\n\n## Examples\n\n```rescript\nlet obj = Object.createWithNullAndProperties({\"name\": {\"value\": \"banana\"}})\nobj->Object.get(\"name\") == Some(\"banana\")\nobj->Object.get(\"toString\") == None\n```" - ], - "signature": "let createWithNullAndProperties: {..} => {..}" - }, - { - "id": "Stdlib.Object.assign", - "kind": "value", - "name": "assign", - "docstrings": [ - "`assign(target, source)` copies enumerable own properties from the source to the target, overwriting properties with the same name. It returns the modified target object. A deep clone is not created; properties are copied by reference.\n\n**Warning:** ReScript provides compile-time support for type-safe access to JavaScript objects. This eliminates common errors such as accessing properties that do not exist, or using a property of type x as if it were a y. Using `assign` can bypass these safety checks and lead to run-time errors (if you are not careful). ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object) and [records](https://rescript-lang.org/docs/manual/latest/record). This is often safer and more convenient than using `assign` and other functions in this module.\n\nSee [Object.assign on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) or [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign).\n\n## Examples\n\n```rescript\nObject.assign({\"a\": 1}, {\"a\": 2}) // {\"a\": 2}\nObject.assign({\"a\": 1, \"b\": 2}, {\"a\": 0}) // {\"a\": 0, \"b\": 2}\nObject.assign({\"a\": 1}, {\"a\": null}) // {\"a\": null}\n```" - ], - "signature": "let assign: ({..}, {..}) => {..}" - }, - { - "id": "Stdlib.Object.assignMany", - "kind": "value", - "name": "assignMany", - "docstrings": [ - "`assignMany(target, sources)` copies enumerable own properties from each source to the target, overwriting properties with the same name. Later sources' properties overwrite earlier ones. It returns the modified target object. A deep clone is not created; properties are copied by reference.\n\n**Note:** ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object), including spreading one object into another. This is often more convenient than using `assign` or `assignMany`. \n\nSee [Object.assign on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) or [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign)." - ], - "signature": "let assignMany: ({..}, array<{..}>) => {..}" - }, - { - "id": "Stdlib.Object.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(object)` creates a shallow copy of `object`.\n\nSee [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) on MDN.\n\n## Examples\n\n```rescript\nlet original = {\"name\": \"banana\"}\nlet cloned = Object.copy(original)\ncloned->Object.get(\"name\") == Some(\"banana\")\nObject.is(original, cloned) == false\n```" - ], - "signature": "let copy: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get` gets the value of a property by name. Returns `None` if the property does not exist or has the value `undefined`. Otherwise returns `Some`, including if the value is `null`.\n\n## Examples\n\n```rescript\n{\"a\": 1}->Object.get(\"a\") // Some(1)\n{\"a\": 1}->Object.get(\"b\") // None\n{\"a\": undefined}->Object.get(\"a\") // None\n{\"a\": null}->Object.get(\"a\") // Some(null)\n{\"a\": 1}->Object.get(\"toString\")->Option.isSome // true\n```" - ], - "signature": "let get: ({..}, string) => option<'a>" - }, - { - "id": "Stdlib.Object.getSymbol", - "kind": "value", - "name": "getSymbol", - "docstrings": [ - "`getSymbol` gets the value of a property by symbol. Returns `None` if the property does not exist or has the value `undefined`. Otherwise returns `Some`, including if the value is `null`.\n\n## Examples\n\n```rescript\nlet fruit = Symbol.make(\"fruit\")\nlet x = Object.make()\nx->Object.setSymbol(fruit, \"banana\")\nx->Object.getSymbol(fruit) == Some(\"banana\")\n```" - ], - "signature": "let getSymbol: ({..}, Symbol.t) => option<'a>" - }, - { - "id": "Stdlib.Object.getSymbolUnsafe", - "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [ - "`getSymbolUnsafe(object, key)` reads the value stored under the symbol `key` without any optional check.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet obj = Object.make()\nobj->Object.setSymbol(key, \"hello\")\nObject.getSymbolUnsafe(obj, key) == \"hello\"\n```" - ], - "signature": "let getSymbolUnsafe: ({..}, Symbol.t) => 'a" - }, - { - "id": "Stdlib.Object.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(name, value)` assigns a value to the named object property, overwriting the previous value if any. See [Working with Objects on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#objects_and_properties)\n\n## Examples\n\n```rescript\n{\"a\": 1}->Object.set(\"a\", 2) // {\"a\": 2}\n{\"a\": 1}->Object.set(\"a\", None) // {\"a\": None}\n{\"a\": 1}->Object.set(\"b\", 2) // {\"a\": 1, \"b\": 2}\n```" - ], - "signature": "let set: ({..}, string, 'a) => unit" - }, - { - "id": "Stdlib.Object.setSymbol", - "kind": "value", - "name": "setSymbol", - "docstrings": [ - "`setSymbol(object, key, value)` stores `value` under the symbol `key` on `object`.\n\nBeware this will *mutate* the object.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"count\")\nlet obj = Object.make()\nobj->Object.setSymbol(key, 5)\nObject.getSymbol(obj, key) == Some(5)\n```" - ], - "signature": "let setSymbol: ({..}, Symbol.t, 'a) => unit" - }, - { - "id": "Stdlib.Object.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "`keysToArray` returns an array of an object's own enumerable string-keyed property names. See [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.keys)\nor [Object.keys on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys).\n\n## Examples\n\n```rescript\n{\"a\": 1, \"b\": 2}->Object.keysToArray // [\"a\", \"b\"]\n{\"a\": None}->Object.keysToArray // [\"a\"]\nObject.make()->Object.keysToArray // []\n```" - ], - "signature": "let keysToArray: {..} => array" - }, - { - "id": "Stdlib.Object.hasOwnProperty", - "kind": "value", - "name": "hasOwnProperty", - "docstrings": [ - "`hasOwnProperty` determines whether the object has the specified property as its **own** property, as opposed to inheriting it. See [hasOwnProperty on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 2}\n{\"a\": 1}->Object.hasOwnProperty(\"a\") // true\n{\"a\": 1}->Object.hasOwnProperty(\"b\") // false\n{\"a\": 1}->Object.hasOwnProperty(\"toString\") // false\n```" - ], - "signature": "let hasOwnProperty: ({..}, string) => bool" - }, - { - "id": "Stdlib.Object.seal", - "kind": "value", - "name": "seal", - "docstrings": [ - "`seal` seals an object. Sealing an object prevents extensions and makes existing properties non-configurable. A sealed object has a fixed set of properties. Unlike `freeze`, values of existing properties can still be changed as long as they are writable.\n\n**Note:** `seal` returns the same object that was passed in; it does not create a copy. Any attempt to delete or add properties to a sealed object will fail, either silently or by throwing an error.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.seal) and [Object.seal on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 2}\npoint->Object.set(\"x\", -7) // succeeds\npoint->Object.seal->ignore\n\ntry {\n point->Object.set(\"z\", 9) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n\npoint->Object.set(\"x\", 13) // succeeds\n```" - ], - "signature": "let seal: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.preventExtensions", - "kind": "value", - "name": "preventExtensions", - "docstrings": [ - "`preventExtensions` prevents new properties from being added to the object. It modifies the object (rather than creating a copy) and returns it.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.preventextensions) and [Object.preventExtensions on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/preventExtensions)\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.set(\"b\", 2) // succeeds\nobj->Object.preventExtensions->ignore\ntry {\n obj->Object.set(\"c\", 3) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let preventExtensions: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.freeze", - "kind": "value", - "name": "freeze", - "docstrings": [ - "`freeze` freezes an object. Freezing an object makes existing properties non-writable and prevents extensions. Once an object is frozen, new properties cannot be be added, existing properties cannot be removed, and their values cannot be changed.\n\n**Note:** `freeze` returns the same object that was passed in; it does not create a frozen copy. Any attempt to change a frozen object will fail, either silently or by throwing an exception.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isfrozen) and [Object.isFrozen on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen).\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.set(\"a\", 2) // succeeds\nobj->Object.freeze->ignore\n\ntry {\n obj->Object.set(\"a\", 3) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let freeze: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.isSealed", - "kind": "value", - "name": "isSealed", - "docstrings": [ - "`isSealed` determines if an object is sealed. A sealed object has a fixed set of properties.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.issealed) and [Object.isSealed on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 3}->Object.seal\nlet pointIsSealed = point->Object.isSealed // true\nlet fruit = {\"name\": \"Apple\"}\nlet fruitIsSealed = fruit->Object.isSealed // false\n```" - ], - "signature": "let isSealed: 'a => bool" - }, - { - "id": "Stdlib.Object.isFrozen", - "kind": "value", - "name": "isFrozen", - "docstrings": [ - "`isFrozen` determines if an object is frozen. An object is frozen if an only if it is not extensible, all its properties are non-configurable, and all its data properties are non-writable.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isfrozen) and [Object.isFrozen on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen).\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 3}->Object.freeze\nlet pointIsFrozen = point->Object.isFrozen // true\nlet fruit = {\"name\": \"Apple\"}\nlet fruitIsFrozen = fruit->Object.isFrozen // false\n```" - ], - "signature": "let isFrozen: 'a => bool" - }, - { - "id": "Stdlib.Object.isExtensible", - "kind": "value", - "name": "isExtensible", - "docstrings": [ - "`isExtensible` determines if an object is extensible (whether it can have new properties added to it).\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isextensible) and [Object.isExtensible on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible)\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.isExtensible // true\nobj->Object.preventExtensions->ignore\nobj->Object.isExtensible // false\n```" - ], - "signature": "let isExtensible: 'a => bool" - }, - { - "id": "Stdlib.Object.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(object)` ignores the provided object and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: {..} => unit" - } - ] - }, - "stdlib/nullable": { - "id": "Stdlib.Nullable", - "name": "Nullable", - "docstrings": [ - "Functions for handling nullable values.\n\nPrimarily useful when interoping with JavaScript when you don't know whether you'll get a value, `null` or `undefined`." - ], - "items": [ - { - "id": "Stdlib.Nullable.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a nullable value.\nA nullable value can be the value `'a`, `null` or `undefined`." - ], - "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined" - }, - { - "id": "Stdlib.Nullable.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The value `null`.\n\nSee [`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null) on MDN.\n\n## Examples\n```rescript\nConsole.log(Nullable.null) // Logs `null` to the console.\n```" - ], - "signature": "let null: t<'a>" - }, - { - "id": "Stdlib.Nullable.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The value `undefined`.\n\nSee [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/undefined) on MDN.\n\n## Examples\n```rescript\nConsole.log(undefined) // Logs `undefined` to the console.\n```" - ], - "signature": "let undefined: t<'a>" - }, - { - "id": "Stdlib.Nullable.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [ - "`isNullable(a)` returns `true` if `a` is null or undefined, `false` otherwise.\n\n## Examples\n\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Check if asNullable is not null or undefined\nswitch asNullable->Nullable.isNullable {\n| true => assert(false)\n| false => assert(true)\n}\n```" - ], - "signature": "let isNullable: t<'a> => bool" - }, - { - "id": "Stdlib.Nullable.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new nullable value from the provided value.\nThis means the compiler will enforce null checks for the new value.\n\n## Examples\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Need to do this\nswitch asNullable->Nullable.toOption {\n| Some(value) if value == myStr => Console.log(\"Yay, values matched!\")\n| _ => Console.log(\"Values did not match.\")\n}\n```" - ], - "signature": "let make: 'a => t<'a>" - }, - { - "id": "Stdlib.Nullable.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.Nullable.compare", - "kind": "value", - "name": "compare", - "docstrings": [], - "signature": "let compare: (t<'a>, t<'b>, ('a, 'b) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.Nullable.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Converts a nullable value into an option, so it can be pattern matched on.\nWill convert both `null` and `undefined` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullableString = Nullable.make(\"Hello\")\n\nswitch nullableString->Nullable.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```" - ], - "signature": "let toOption: t<'a> => option<'a>" - }, - { - "id": "Stdlib.Nullable.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Turns an `option` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet optString = Some(\"Hello\")\nlet asNullable = optString->Nullable.fromOption // Nullable.t\n```" - ], - "signature": "let fromOption: option<'a> => t<'a>" - }, - { - "id": "Stdlib.Nullable.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(value, default)` returns `value` if not `null` or `undefined`,\notherwise return `default`.\n\n## Examples\n\n```rescript\nNullable.getOr(Nullable.null, \"Banana\") // Banana\nNullable.getOr(Nullable.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNullable.make(\"Jane\")->Nullable.toOption->greet // \"Greetings Jane\"\nNullable.null->Nullable.toOption->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (t<'a>, 'a) => 'a" - }, - { - "id": "Stdlib.Nullable.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Nullable.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getExn(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getExn(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`" - ], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Nullable.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getOrThrow(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getOrThrow(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`" - ], - "signature": "let getOrThrow: t<'a> => 'a" - }, - { - "id": "Stdlib.Nullable.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNullable.getUnsafe(Nullable.make(3)) == 3\nNullable.getUnsafe(Nullable.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null` or `undefined`." - ], - "signature": "let getUnsafe: t<'a> => 'a" - }, - { - "id": "Stdlib.Nullable.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(value, f)` call `f` on `value`. if `value` is not `null` or `undefined`,\nthen if calls `f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNullable.forEach(Nullable.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNullable.forEach(Nullable.null, x => Console.log(x)) // returns ()\nNullable.forEach(undefined, x => Console.log(x)) // returns ()\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Nullable.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nNullable.map(Nullable.make(3), x => x * x) // Nullable.make(9)\nNullable.map(undefined, x => x * x) // undefined\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Nullable.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`\nor `undefined`, otherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Nullable.make(3)\nsomeValue->Nullable.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Nullable.null\nnoneValue->Nullable.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (t<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Nullable.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (t<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Nullable.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Nullable.make(value + 1)\n } else {\n Nullable.null\n }\n\nNullable.flatMap(Nullable.make(2), addIfAboveOne) // Nullable.make(3)\nNullable.flatMap(Nullable.make(-4), addIfAboveOne) // undefined\nNullable.flatMap(Nullable.null, addIfAboveOne) // undefined\n```" - ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Nullable.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(nullable)` ignores the provided nullable and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/null": { - "id": "Stdlib.Null", - "name": "Null", - "docstrings": [ - "Functions for handling values that could be `null`.\n\nIf you also need to cover `undefined`, check out `Nullable` instead." - ], - "items": [ - { - "id": "Stdlib.Null.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a value that can be either `'a` or `null`." - ], - "signature": "@unboxed\ntype t<'a> = null<'a> =\n | Value('a)\n | @as(null) Null" - }, - { - "id": "Stdlib.Null.asNullable", - "kind": "value", - "name": "asNullable", - "docstrings": [ - "Converts a `Null.t` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet nullValue = Null.make(\"Hello\")\nlet asNullable = nullValue->Null.asNullable // Nullable.t\n```" - ], - "signature": "let asNullable: t<'a> => Nullable.t<'a>" - }, - { - "id": "Stdlib.Null.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The value `null`.\n\nSee [`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null) on MDN.\n\n## Examples\n```rescript\nConsole.log(null) // Logs `null` to the console.\n```" - ], - "signature": "let null: t<'a>" - }, - { - "id": "Stdlib.Null.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Null.t` from the provided value.\nThis means the compiler will enforce null checks for the new value.\n\n## Examples\n```rescript\nlet myStr = \"Hello\"\nlet asNullValue = myStr->Null.make // The compiler now thinks this can be `string` or `null`.\n```" - ], - "signature": "let make: 'a => t<'a>" - }, - { - "id": "Stdlib.Null.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(a, b, eq)` checks if `a` and `b` are equal.\nIf both are `Null.Value`, it will use function `eq` to check if the values are equal.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\nNull.equal(a, b, Int.equal) == false\nNull.equal(a, c, Int.equal) == false\nNull.equal(Null.null, Null.null, Int.equal) == true\n```" - ], - "signature": "let equal: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.Null.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(a, b, cmp)` compares `a` and `b`.\nIf both are `Null.Value`, it will use function `cmp` to compare the values.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\n// A value is greater than null\nNull.compare(a, b, Int.compare) == Ordering.greater\n// A value is less than null\nNull.compare(b, a, Int.compare) == Ordering.less\n// A null is equal to null\nNull.compare(Null.null, Null.null, Int.compare) == Ordering.equal\n// The compare function is used if both are `Null.Value`\nNull.compare(a, c, Int.compare) == Ordering.less\n```" - ], - "signature": "let compare: (t<'a>, t<'b>, ('a, 'b) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.Null.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Converts a nullable value into an option, so it can be pattern matched on.\nWill convert `null` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullStr = Null.make(\"Hello\")\n\nswitch nullStr->Null.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```" - ], - "signature": "let toOption: t<'a> => option<'a>" - }, - { - "id": "Stdlib.Null.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Turns an `option` into a `Null.t`. `None` will be converted to `null`.\n\n## Examples\n```rescript\nlet optString: option = None\nlet asNull = optString->Null.fromOption // Null.t\nConsole.log(asNull == Null.null) // Logs `true` to the console.\n```" - ], - "signature": "let fromOption: option<'a> => t<'a>" - }, - { - "id": "Stdlib.Null.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(value, default)` returns `value` if not `null`, otherwise return\n`default`.\n\n## Examples\n\n```rescript\nNull.getOr(Null.null, \"Banana\") // Banana\nNull.getOr(Null.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNull.make(\"Jane\")->Null.toOption->greet // \"Greetings Jane\"\nNull.null->Null.toOption->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (t<'a>, 'a) => 'a" - }, - { - "id": "Stdlib.Null.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Null.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getExn(Null.make(3)) == 3\n\nswitch Null.getExn(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`" - ], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Null.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getOrThrow(Null.make(3)) == 3\n\nswitch Null.getOrThrow(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`" - ], - "signature": "let getOrThrow: t<'a> => 'a" - }, - { - "id": "Stdlib.Null.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNull.getUnsafe(Null.make(3)) == 3\nNull.getUnsafe(Null.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null`." - ], - "signature": "let getUnsafe: t<'a> => 'a" - }, - { - "id": "Stdlib.Null.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(value, f)` call `f` on `value`. if `value` is not `null`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNull.forEach(Null.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNull.forEach(Null.null, x => Console.log(x)) // logs nothing\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Null.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(value, f)` returns `f(value)` if `value` is not `null`, otherwise returns\n`value` unchanged.\n\n## Examples\n\n```rescript\nNull.map(Null.make(3), x => x * x) // Null.make(9)\nNull.map(Null.null, x => x * x) // null\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Null.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`,\notherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Null.make(3)\nsomeValue->Null.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Null.null\nnoneValue->Null.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (t<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Null.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (t<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Null.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(value, f)` returns `f(value)` if `value` is not `null`, otherwise\nreturns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Null.make(value + 1)\n } else {\n Null.null\n }\n\nNull.flatMap(Null.make(2), addIfAboveOne) // Null.make(3)\nNull.flatMap(Null.make(-4), addIfAboveOne) // null\nNull.flatMap(Null.null, addIfAboveOne) // null\n```" - ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Null.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(null)` ignores the provided null and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/math": { - "id": "Stdlib.Math", - "name": "Math", - "docstrings": [ - "Functions for interacting with JavaScript Math.\nSee: [`Math`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math)." - ], - "items": [ - { - "id": "Stdlib.Math.abs", - "kind": "value", - "name": "abs", - "docstrings": [ - "`abs(v)` returns absolute value of `v`.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n## Examples\n\n```rescript\nMath.abs(-2.0) == 2.0\nMath.abs(3.0) == 3.0\n```" - ], - "signature": "let abs: float => float" - }, - { - "id": "Stdlib.Math.acos", - "kind": "value", - "name": "acos", - "docstrings": [ - "`acos(v)` returns arccosine (in radians) of argument `v`, returns `NaN` if the\nargument is outside the range \\[-1.0, 1.0\\].\nSee [`Math.acos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acos) on MDN.\n\n## Examples\n\n```rescript\nMath.acos(-1.0) == 3.141592653589793\nMath.acos(-3.0)->Float.isNaN == true\n```" - ], - "signature": "let acos: float => float" - }, - { - "id": "Stdlib.Math.acosh", - "kind": "value", - "name": "acosh", - "docstrings": [ - "`acosh(v)` returns the inverse hyperbolic arccosine (in radians) of argument `v`,\nreturns `NaN` if the argument is less than `1.0`.\nSee [`Math.acosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acosh) on MDN.\n\n## Examples\n\n```rescript\nMath.acosh(1.0) == 0.0\nMath.acosh(0.5)->Float.isNaN == true\n```" - ], - "signature": "let acosh: float => float" - }, - { - "id": "Stdlib.Math.asin", - "kind": "value", - "name": "asin", - "docstrings": [ - "`asin(v)` returns the inverse sine (in radians) of argument `v`, returns `NaN`\nif the argument `v` is outside the range \\[-1.0, 1.0\\].\nSee [`Math.asin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asin) on MDN.\n\n## Examples\n\n```rescript\nMath.asin(-1.0) == -1.5707963267948966\nMath.asin(-2.0)->Float.isNaN == true\n```" - ], - "signature": "let asin: float => float" - }, - { - "id": "Stdlib.Math.asinh", - "kind": "value", - "name": "asinh", - "docstrings": [ - "`asinh(v)` returns the inverse hyperbolic sine of argument `v`.\nSee [`Math.asinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh) on MDN.\n\n## Examples\n\n```rescript\nMath.asinh(-1.0) == -0.881373587019543\nMath.asinh(-0.0) == -0.0\n```" - ], - "signature": "let asinh: float => float" - }, - { - "id": "Stdlib.Math.atan", - "kind": "value", - "name": "atan", - "docstrings": [ - "`atan(v)` returns the inverse tangent (in radians) of argument `v`.\nSee [`Math.atan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan) on MDN.\n\n## Examples\n\n```rescript\nMath.atan(-0.0) == -0.0\nMath.atan(0.0) == 0.0\nMath.atan(1.0) == 0.7853981633974483\n```" - ], - "signature": "let atan: float => float" - }, - { - "id": "Stdlib.Math.atanh", - "kind": "value", - "name": "atanh", - "docstrings": [ - "`atanh(v)` returns the invert hyperbolic tangent of argument `v`. Returns `NaN`\nif the argument `v` is is outside the range \\[-1.0, 1.0\\] and `Infinity` if `v`\nis `-1.0` or `1.0`.\nSee [`Math.atanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh) on MDN.\n\n## Examples\n\n```rescript\nMath.atanh(-2.0)->Float.isNaN == true\nMath.atanh(-1.0)->Float.isFinite == false\nMath.atanh(-0.0) == -0.0\nMath.atanh(0.0) == 0.0\nMath.atanh(0.5) == 0.5493061443340548\n```" - ], - "signature": "let atanh: float => float" - }, - { - "id": "Stdlib.Math.atan2", - "kind": "value", - "name": "atan2", - "docstrings": [ - "`atan2(~y, ~x)` returns the angle (in radians) of the quotient `y /. x`. It is\nalso the angle between the *x*\\-axis and point (*x*, *y*).\nSee [`Math.atan2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2) on MDN.\n\n## Examples\n\n```rescript\nMath.atan2(~y=0.0, ~x=10.0) == 0.0\nMath.atan2(~x=5.0, ~y=5.0) == Math.Constants.pi /. 4.0\nMath.atan2(~x=90.0, ~y=15.0) == 0.16514867741462683\nMath.atan2(~x=15.0, ~y=90.0) == 1.4056476493802699\n```" - ], - "signature": "let atan2: (~y: float, ~x: float) => float" - }, - { - "id": "Stdlib.Math.cbrt", - "kind": "value", - "name": "cbrt", - "docstrings": [ - "`cbrt(v)` returns the cube root of argument `v`.\nSee [`Math.cbrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt) on MDN.\n\n## Examples\n\n```rescript\nMath.cbrt(-1.0) == -1.0\nMath.cbrt(-0.0) == -0.0\nMath.cbrt(0.0) == 0.0\n```" - ], - "signature": "let cbrt: float => float" - }, - { - "id": "Stdlib.Math.ceil", - "kind": "value", - "name": "ceil", - "docstrings": [ - "`ceil(v)` returns the smallest integral value greater than or equal to the\nargument `v`. The result is a `float` and is not restricted to the `int` data\ntype range.\nSee [`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil) on MDN.\n\n## Examples\n\n```rescript\nMath.ceil(3.1) == 4.0\nMath.ceil(3.0) == 3.0\nMath.ceil(-3.1) == -3.0\nMath.ceil(2_150_000_000.3) == 2_150_000_001.0\n```" - ], - "signature": "let ceil: float => float" - }, - { - "id": "Stdlib.Math.cos", - "kind": "value", - "name": "cos", - "docstrings": [ - "`cos(v)` returns the cosine of argument `v`, which must be specified in radians.\nSee [`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos) on MDN.\n\n## Examples\n\n```rescript\nMath.cos(-0.0) == 1.0\nMath.cos(0.0) == 1.0\nMath.cos(1.0) == 0.5403023058681398\n```" - ], - "signature": "let cos: float => float" - }, - { - "id": "Stdlib.Math.cosh", - "kind": "value", - "name": "cosh", - "docstrings": [ - "`cosh(v)` returns the hyperbolic cosine of argument `v`, which must be specified\nin radians.\nSee [`Math.cosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh) on MDN.\n\n## Examples\n\n```rescript\nMath.cosh(-1.0) == 1.5430806348152437\nMath.cosh(-0.0) == 1.0\nMath.cosh(0.0) == 1.0\n```" - ], - "signature": "let cosh: float => float" - }, - { - "id": "Stdlib.Math.exp", - "kind": "value", - "name": "exp", - "docstrings": [ - "`exp(v)` returns natural exponentional, returns *e* (the base of natural logarithms)\nto the power of the given argument `v`.\nSee [`Math.exp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/exp) on MDN.\n\n## Examples\n\n```rescript\nMath.exp(-1.0) == 0.36787944117144233\nMath.exp(0.0) == 1.0\n```" - ], - "signature": "let exp: float => float" - }, - { - "id": "Stdlib.Math.expm1", - "kind": "value", - "name": "expm1", - "docstrings": [ - "`expm1(v)` returns *e* (the base of natural logarithms) to the power of the given\nargument `v` minus 1.\nSee [`Math.expm1`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1) on MDN.\n\n## Examples\n\n```rescript\nMath.expm1(-1.0) == -0.6321205588285577\nMath.expm1(-0.0) == -0.0\n```" - ], - "signature": "let expm1: float => float" - }, - { - "id": "Stdlib.Math.floor", - "kind": "value", - "name": "floor", - "docstrings": [ - "`floor(v)` returns the largest integral value less than or equal to the argument\n`v`. The result is a `float` and is not restricted to the `int` data type range.\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor) on MDN.\n\n## Examples\n\n```rescript\nMath.floor(-45.95) == -46.0\nMath.floor(-45.05) == -46.0\nMath.floor(-0.0) == -0.0\n```" - ], - "signature": "let floor: float => float" - }, - { - "id": "Stdlib.Math.fround", - "kind": "value", - "name": "fround", - "docstrings": [ - "`fround(v)` returns the nearest single precision float.\nSee [`Math.fround`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround) on MDN.\n\n## Examples\n\n```rescript\nMath.fround(5.5) == 5.5\nMath.fround(5.05) == 5.050000190734863\n```" - ], - "signature": "let fround: float => float" - }, - { - "id": "Stdlib.Math.hypot", - "kind": "value", - "name": "hypot", - "docstrings": [ - "`hypot(a, b)` returns the square root of the sum of squares of its two arguments\n(the Pythagorean formula).\nSee [`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot) on MDN.\n\n## Examples\n\n```rescript\nMath.hypot(3.0, 4.0) == 5.0\nMath.hypot(3.0, 5.0) == 5.8309518948453\n```" - ], - "signature": "let hypot: (float, float) => float" - }, - { - "id": "Stdlib.Math.hypotMany", - "kind": "value", - "name": "hypotMany", - "docstrings": [ - "`hypotMany(arr)` returns the square root of the sum of squares of the numbers in\nthe array argument (generalized Pythagorean equation). Using an array allows you\nto have more than two items. If `arr` is an empty array then returns `0.0`.\nSee [`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot) on MDN.\n\n## Examples\n\n```rescript\nMath.hypotMany([3.0, 4.0, 5.0]) == 7.0710678118654755\nMath.hypotMany([]) == 0.0\n```" - ], - "signature": "let hypotMany: array => float" - }, - { - "id": "Stdlib.Math.log", - "kind": "value", - "name": "log", - "docstrings": [ - "`log(v)` returns the natural logarithm of argument `v`, this is the number *x*\nsuch that `e^x` equals the argument. Returns `NaN` for negative arguments and\n`Infinity` for `0.0` or `-0.0`.\nSee [`Math.log`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log) on MDN.\n\n## Examples\n\n```rescript\nMath.log(-1.0)->Float.isNaN == true\nMath.log(-0.0)->Float.isFinite == false\nMath.log(0.0)->Float.isFinite == false\nMath.log(1.0) == 0.0\n```" - ], - "signature": "let log: float => float" - }, - { - "id": "Stdlib.Math.log1p", - "kind": "value", - "name": "log1p", - "docstrings": [ - "`log1p(v)` returns the natural logarithm of one plus the argument `v`.\nReturns `NaN` for arguments less than `-1` and `Infinity` if `v` is `-1.0`.\nSee [`Math.log1p`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log1p) on MDN.\n\n## Examples\n\n```rescript\nMath.log1p(-2.0)->Float.isNaN == true\nMath.log1p(-1.0)->Float.isFinite == false\nMath.log1p(-0.0) == -0.0\n```" - ], - "signature": "let log1p: float => float" - }, - { - "id": "Stdlib.Math.log10", - "kind": "value", - "name": "log10", - "docstrings": [ - "`log10(v)` returns the base 10 logarithm of argument `v`. Returns `NaN` for\nnegative `v`. If `v` is `-0.0` or `0.0` returns `Infinity`.\nSee [`Math.log10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log10) on MDN.\n\n## Examples\n\n```rescript\nMath.log10(-2.0)->Float.isNaN == true\nMath.log10(-0.0)->Float.isFinite == false\nMath.log10(0.0)->Float.isFinite == false\nMath.log10(1.0) == 0.0\n```" - ], - "signature": "let log10: float => float" - }, - { - "id": "Stdlib.Math.log2", - "kind": "value", - "name": "log2", - "docstrings": [ - "`log2(v)` returns the base 2 logarithm of argument `v`. Returns `NaN` for\nnegative `v` and `Infinity` if `v` is `-0.0` or `0.0`.\nSee [`Math.log2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2) on MDN.\n\n## Examples\n\n```rescript\nMath.log2(-2.0)->Float.isNaN == true\nMath.log2(-0.0)->Float.isFinite == false\nMath.log2(0.0)->Float.isFinite == false\nMath.log2(1.0) == 0.0\n```" - ], - "signature": "let log2: float => float" - }, - { - "id": "Stdlib.Math.min", - "kind": "value", - "name": "min", - "docstrings": [ - "`min(a, b)` returns the minimum of its two float arguments.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n## Examples\n\n```rescript\nMath.min(1.0, 2.0) == 1.0\nMath.min(-1.0, -2.0) == -2.0\n```" - ], - "signature": "let min: (float, float) => float" - }, - { - "id": "Stdlib.Math.minMany", - "kind": "value", - "name": "minMany", - "docstrings": [ - "`minMany(arr)` returns the minimum of the float in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n## Examples\n\n```rescript\nMath.minMany([1.0, 2.0]) == 1.0\nMath.minMany([-1.0, -2.0]) == -2.0\nMath.minMany([])->Float.isFinite == false\n```" - ], - "signature": "let minMany: array => float" - }, - { - "id": "Stdlib.Math.max", - "kind": "value", - "name": "max", - "docstrings": [ - "`max(a, b)` returns the maximum of its two float arguments.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n## Examples\n\n```rescript\nMath.max(1.0, 2.0) == 2.0\nMath.max(-1.0, -2.0) == -1.0\n```" - ], - "signature": "let max: (float, float) => float" - }, - { - "id": "Stdlib.Math.maxMany", - "kind": "value", - "name": "maxMany", - "docstrings": [ - "`maxMany(arr)` returns the maximum of the float in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n## Examples\n\n```rescript\nMath.maxMany([1.0, 2.0]) == 2.0\nMath.maxMany([-1.0, -2.0]) == -1.0\nMath.maxMany([])->Float.isFinite == false\n```" - ], - "signature": "let maxMany: array => float" - }, - { - "id": "Stdlib.Math.pow", - "kind": "value", - "name": "pow", - "docstrings": [ - "`pow(a, ~exp)` throws the given base `a` to the given exponent `exp`.\nSee [`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow) on MDN.\n\n## Examples\n\n```rescript\nMath.pow(2.0, ~exp=4.0) == 16.0\nMath.pow(3.0, ~exp=4.0) == 81.0\n```" - ], - "signature": "let pow: (float, ~exp: float) => float" - }, - { - "id": "Stdlib.Math.random", - "kind": "value", - "name": "random", - "docstrings": [ - "`random()` returns a random number in the half-closed interval \\[0,1\\].\nSee [`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random) on MDN.\n\n## Examples\n\n```rescript\nMath.random()\n```" - ], - "signature": "let random: unit => float" - }, - { - "id": "Stdlib.Math.round", - "kind": "value", - "name": "round", - "docstrings": [ - "`round(v)` returns then value of `v` rounded to nearest integral value\n(expressed as a float). If the fractional portion of the argument `v` is greater\nthan `0.5`, the argument `v` is rounded to the float with the next higher\nabsolute value.\nSee [`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round) on MDN.\n\n## Examples\n\n```rescript\nMath.round(-20.5) == -20.0\nMath.round(-0.1) == -0.0\nMath.round(0.0) == 0.0\nMath.round(-0.0) == -0.0\n```" - ], - "signature": "let round: float => float" - }, - { - "id": "Stdlib.Math.sign", - "kind": "value", - "name": "sign", - "docstrings": [ - "`sign(v)` returns the sign of its foat argument: `-1` if negative, `0` if\nzero, `1` if positive.\nSee [`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign) on MDN.\n\n## Examples\n\n```rescript\nMath.sign(3.0) == 1.0\nMath.sign(-3.0) == -1.0\nMath.sign(0.0) == 0.0\n```" - ], - "signature": "let sign: float => float" - }, - { - "id": "Stdlib.Math.sin", - "kind": "value", - "name": "sin", - "docstrings": [ - "`sin(v)` returns the sine of argument `v`, which must be specified in radians.\nSee [`Math.sin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin) on MDN.\n\n## Examples\n\n```rescript\nMath.sin(-0.0) == -0.0\nMath.sin(0.0) == 0.0\nMath.sin(1.0) == 0.8414709848078965\n```" - ], - "signature": "let sin: float => float" - }, - { - "id": "Stdlib.Math.sinh", - "kind": "value", - "name": "sinh", - "docstrings": [ - "`sinh(v)` returns then hyperbolic sine of argument `v`, which must be specified\nin radians.\nSee [`Math.sinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sinh) on MDN.\n\n## Examples\n\n```rescript\nMath.sinh(-0.0) == -0.0\nMath.sinh(0.0) == 0.0\nMath.sinh(1.0) == 1.1752011936438014\n```" - ], - "signature": "let sinh: float => float" - }, - { - "id": "Stdlib.Math.sqrt", - "kind": "value", - "name": "sqrt", - "docstrings": [ - "`sqrt(v)` returns the square root of `v`. If `v` is negative returns `NaN`.\nSee [`Math.sqrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt) on MDN.\n\n## Examples\n\n```rescript\nMath.sqrt(-1.0)->Float.isNaN == true\nMath.sqrt(-0.0) == -0.0\nMath.sqrt(0.0) == 0.0\nMath.sqrt(1.0) == 1.0\nMath.sqrt(9.0) == 3.0\n```" - ], - "signature": "let sqrt: float => float" - }, - { - "id": "Stdlib.Math.tan", - "kind": "value", - "name": "tan", - "docstrings": [ - "`tan(v)` returns the tangent of argument `v`, which must be specified in\nradians. Returns `NaN` if `v` is positive `Infinity` or negative `Infinity`.\nSee [`Math.tan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tan) on MDN.\n\n## Examples\n\n```rescript\nMath.tan(-0.0) == -0.0\nMath.tan(0.0) == 0.0\nMath.tan(1.0) == 1.5574077246549023\n```" - ], - "signature": "let tan: float => float" - }, - { - "id": "Stdlib.Math.tanh", - "kind": "value", - "name": "tanh", - "docstrings": [ - "`tanh(v)` returns the hyperbolic tangent of argument `v`, which must be\nspecified in radians.\nSee [`Math.tanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tanh) on MDN.\n\n## Examples\n\n```rescript\nMath.tanh(-0.0) == -0.0\nMath.tanh(0.0) == 0.0\nMath.tanh(1.0) == 0.7615941559557649\n```" - ], - "signature": "let tanh: float => float" - }, - { - "id": "Stdlib.Math.trunc", - "kind": "value", - "name": "trunc", - "docstrings": [ - "`trunc(v)` truncates the argument `v`, i.e., removes fractional digits.\nSee [`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc) on MDN.\n\n## Examples\n\n```rescript\nMath.trunc(0.123) == 0.0\nMath.trunc(1.999) == 1.0\nMath.trunc(13.37) == 13.0\nMath.trunc(42.84) == 42.0\n```" - ], - "signature": "let trunc: float => float" - } - ] - }, - "stdlib/list": { - "id": "Stdlib.List", - "name": "List", - "docstrings": [], - "items": [ - { - "id": "Stdlib.List.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Collection functions for manipulating the `list` data structures, a singly-linked list.\n\n**Prefer Array** if you need any of the following:\n\n- Random access of element\n- Better interop with JavaScript\n- Better memory usage & performance." - ], - "signature": "type t<'a> = list<'a>" - }, - { - "id": "Stdlib.List.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(list)` returns the length of `list`.\n\n## Examples\n\n```rescript\nList.length(list{1, 2, 3}) == 3\n```" - ], - "signature": "let length: list<'a> => int" - }, - { - "id": "Stdlib.List.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(list)`. See [`length`](#length)\n\n## Examples\n\n```rescript\nList.size(list{1, 2, 3}) == 3\n```" - ], - "signature": "let size: list<'a> => int" - }, - { - "id": "Stdlib.List.head", - "kind": "value", - "name": "head", - "docstrings": [ - "`head(list)` returns `Some(value)` where `value` is the first element in the\nlist, or `None` if `list` is an empty list.\n\n## Examples\n\n```rescript\nList.head(list{}) == None\nList.head(list{1, 2, 3}) == Some(1)\n```" - ], - "signature": "let head: list<'a> => option<'a>" - }, - { - "id": "Stdlib.List.headExn", - "kind": "value", - "name": "headExn", - "docstrings": [ - "`headExn(list)` same as [`head`](#head).\n\n## Examples\n\n```rescript\nList.headExn(list{1, 2, 3}) == 1\n\nswitch List.headExn(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let headExn: list<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.List.headOrThrow", - "kind": "value", - "name": "headOrThrow", - "docstrings": [ - "`headOrThrow(list)` same as [`head`](#head).\n\n## Examples\n\n```rescript\nList.headOrThrow(list{1, 2, 3}) == 1\n\nswitch List.headOrThrow(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let headOrThrow: list<'a> => 'a" - }, - { - "id": "Stdlib.List.tail", - "kind": "value", - "name": "tail", - "docstrings": [ - "`tail(list)` returns `None` if `list` is empty, otherwise it returns `Some(tail)`\nwhere `tail` is everything except the first element of `list`.\n\n## Examples\n\n```rescript\nList.tail(list{1, 2, 3}) == Some(list{2, 3})\n\nList.tail(list{}) == None\n```" - ], - "signature": "let tail: list<'a> => option>" - }, - { - "id": "Stdlib.List.tailExn", - "kind": "value", - "name": "tailExn", - "docstrings": [ - "`tailExn(list)` same as [`tail`](#tail).\n\n## Examples\n\n```rescript\nList.tailExn(list{1, 2, 3}) == list{2, 3}\n\nswitch List.tailExn(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let tailExn: list<'a> => list<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.List.tailOrThrow", - "kind": "value", - "name": "tailOrThrow", - "docstrings": [ - "`tailOrThrow(list)` same as [`tail`](#tail).\n\n## Examples\n\n```rescript\nList.tailOrThrow(list{1, 2, 3}) == list{2, 3}\n\nswitch List.tailOrThrow(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let tailOrThrow: list<'a> => list<'a>" - }, - { - "id": "Stdlib.List.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(list, value)` adds a `value` to the beginning of list `list`.\n\n## Examples\n\n```rescript\nList.add(list{2, 3}, 1) == list{1, 2, 3}\n\nList.add(list{\"World\", \"!\"}, \"Hello\") == list{\"Hello\", \"World\", \"!\"}\n```" - ], - "signature": "let add: (list<'a>, 'a) => list<'a>" - }, - { - "id": "Stdlib.List.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(list, index)` return the `index` element in `list`, or `None` if `index`\nis larger than the length of list `list`.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.get(1) == Some(\"B\")\n\nabc->List.get(4) == None\n```" - ], - "signature": "let get: (list<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.List.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(list, index)` same as [`get`](#get).\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.getExn(1) == \"B\"\n\nswitch abc->List.getExn(4) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if `index` is larger than the length of list." - ], - "signature": "let getExn: (list<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.List.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(list, index)` same as [`get`](#get).\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.getOrThrow(1) == \"B\"\n\nswitch abc->List.getOrThrow(4) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if `index` is larger than the length of list." - ], - "signature": "let getOrThrow: (list<'a>, int) => 'a" - }, - { - "id": "Stdlib.List.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(length, value)` returns a list of length `length` with each element filled\nwith `value`. Returns an empty list if `value` is negative.\n\n## Examples\n\n```rescript\nList.make(~length=3, 1) == list{1, 1, 1}\n```" - ], - "signature": "let make: (~length: int, 'a) => list<'a>" - }, - { - "id": "Stdlib.List.fromInitializer", - "kind": "value", - "name": "fromInitializer", - "docstrings": [ - "`fromInitializer(length, f)` return a list of length `length` with element initialized\nwith `f`. Returns an empty list if `length` is negative.\n\n## Examples\n\n```rescript\nList.fromInitializer(~length=5, i => i) == list{0, 1, 2, 3, 4}\n\nList.fromInitializer(~length=5, i => i * i) == list{0, 1, 4, 9, 16}\n```" - ], - "signature": "let fromInitializer: (~length: int, int => 'a) => list<'a>" - }, - { - "id": "Stdlib.List.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "`shuffle(list)` returns a new list in random order.\n\n## Examples\n\n```rescript\nList.shuffle(list{1, 2, 3}) // list{2, 1, 3}\n```" - ], - "signature": "let shuffle: list<'a> => list<'a>" - }, - { - "id": "Stdlib.List.toShuffled", - "kind": "value", - "name": "toShuffled", - "docstrings": [ - "`toShuffled(list)` returns a new list in random order.\n\n## Examples\n\n```rescript\nList.toShuffled(list{1, 2, 3}) // list{2, 1, 3}\n```" - ], - "signature": "let toShuffled: list<'a> => list<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.List.drop", - "kind": "value", - "name": "drop", - "docstrings": [ - "`drop(list, value)` return a new list, dropping the first `value` element.\nReturns `None` if `list` has fewer than `value` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.drop(2) == Some(list{3})\n\nlist{1, 2, 3}->List.drop(3) == Some(list{})\n\nlist{1, 2, 3}->List.drop(4) == None\n```" - ], - "signature": "let drop: (list<'a>, int) => option>" - }, - { - "id": "Stdlib.List.take", - "kind": "value", - "name": "take", - "docstrings": [ - "`take(list, value)` returns a list with the first `value` elements from `list`,\nor `None` if `list` has fewer than `value` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.take(1) == Some(list{1})\n\nlist{1, 2, 3}->List.take(2) == Some(list{1, 2})\n\nlist{1, 2, 3}->List.take(4) == None\n```" - ], - "signature": "let take: (list<'a>, int) => option>" - }, - { - "id": "Stdlib.List.splitAt", - "kind": "value", - "name": "splitAt", - "docstrings": [ - "`splitAt(list, n)` split the list `list` at `n`. Returns `None` when the length\nof `list` is less than `n`.\n\n## Examples\n\n```rescript\nlist{\"Hello\", \"World\"}->List.splitAt(1) == Some((list{\"Hello\"}, list{\"World\"}))\n\nlist{0, 1, 2, 3, 4}->List.splitAt(2) == Some((list{0, 1}, list{2, 3, 4}))\n```" - ], - "signature": "let splitAt: (list<'a>, int) => option<(list<'a>, list<'a>)>" - }, - { - "id": "Stdlib.List.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(list1, list2)` returns the list obtained by adding `list2` after `list1`.\n\n## Examples\n\n```rescript\nList.concat(list{1, 2, 3}, list{4, 5}) == list{1, 2, 3, 4, 5}\n```" - ], - "signature": "let concat: (list<'a>, list<'a>) => list<'a>" - }, - { - "id": "Stdlib.List.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(arr)` returns the list obtained by concatenating all the lists in\narray `arr`, in order.\n\n## Examples\n\n```rescript\nList.concatMany([list{1, 2, 3}, list{}, list{3}]) == list{1, 2, 3, 3}\n```" - ], - "signature": "let concatMany: array> => list<'a>" - }, - { - "id": "Stdlib.List.reverseConcat", - "kind": "value", - "name": "reverseConcat", - "docstrings": [ - "`reverseConcat(list1, list2)` is equivalent to writing: `concat(reverse(list1, list2)`\n\n## Examples\n\n```rescript\nList.reverseConcat(list{1, 2}, list{3, 4}) == list{2, 1, 3, 4}\n```" - ], - "signature": "let reverseConcat: (list<'a>, list<'a>) => list<'a>" - }, - { - "id": "Stdlib.List.flat", - "kind": "value", - "name": "flat", - "docstrings": [ - "`flat(list)` return the list obtained by concatenating all the lists in\n`list`, in order.\n\n## Examples\n\n```rescript\nList.flat(list{list{1, 2, 3}, list{}, list{3}}) == list{1, 2, 3, 3}\n```" - ], - "signature": "let flat: list> => list<'a>" - }, - { - "id": "Stdlib.List.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nlist{1, 2}->List.map(x => x + 1) == list{2, 3}\n```" - ], - "signature": "let map: (list<'a>, 'a => 'b) => list<'b>" - }, - { - "id": "Stdlib.List.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "`zip(list1, list2)` returns a list of pairs from the two lists with the length\nof the shorter list.\n\n## Examples\n\n```rescript\nList.zip(list{1, 2}, list{3, 4, 5}) == list{(1, 3), (2, 4)}\n```" - ], - "signature": "let zip: (list<'a>, list<'b>) => list<('a, 'b)>" - }, - { - "id": "Stdlib.List.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "`zipBy(list1, list2, f)`. See [`zip`](#zip)\n\n## Examples\n\n```rescript\nList.zipBy(list{1, 2, 3}, list{4, 5}, (a, b) => 2 * a + b) == list{6, 9}\n```" - ], - "signature": "let zipBy: (list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>" - }, - { - "id": "Stdlib.List.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(list, f)` applies `f` to each element of `list`. Function `f`\ntakes two arguments: the index starting from 0 and the element from `list`, in\nthat order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.mapWithIndex((x, index) => index + x) == list{1, 3, 5}\n```" - ], - "signature": "let mapWithIndex: (list<'a>, ('a, int) => 'b) => list<'b>" - }, - { - "id": "Stdlib.List.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(arr)` converts the given array `arr` to a list.\n\n## Examples\n\n```rescript\nList.fromArray([1, 2, 3]) == list{1, 2, 3}\n```" - ], - "signature": "let fromArray: array<'a> => list<'a>" - }, - { - "id": "Stdlib.List.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(list)` converts the given list `list` to an array.\n\n## Examples\n\n```rescript\nList.toArray(list{1, 2, 3}) == [1, 2, 3]\n```" - ], - "signature": "let toArray: list<'a> => array<'a>" - }, - { - "id": "Stdlib.List.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(list)` returns a new list whose elements are those of `list` in\nreversed order.\n\n## Examples\n\n```rescript\nList.reverse(list{1, 2, 3}) == list{3, 2, 1}\n```" - ], - "signature": "let reverse: list<'a> => list<'a>" - }, - { - "id": "Stdlib.List.mapReverse", - "kind": "value", - "name": "mapReverse", - "docstrings": [ - "`mapReverse(list, f)` is equivalent to `map` function.\n\n## Examples\n\n```rescript\nlet f = x => x * x\nlet l = list{3, 4, 5}\n\nlet withMap = List.map(l, f)->List.reverse\nlet withMapReverse = l->List.mapReverse(f)\n\nConsole.log(withMap == withMapReverse) // true\n```" - ], - "signature": "let mapReverse: (list<'a>, 'a => 'b) => list<'b>" - }, - { - "id": "Stdlib.List.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(list, f)` call `f` on each element of `list` from the beginning to end.\n`f` returns `unit`, so no new array is created. Use `forEach` when you are primarily\nconcerned with repetitively creating side effects.\n\n## Examples\n\n```rescript\nList.forEach(list{\"a\", \"b\", \"c\"}, x => Console.log(\"Item: \" ++ x))\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\n```" - ], - "signature": "let forEach: (list<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.List.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(list, f, index)` call `f` on each element of `list` from beginning\nto end. Function `f` takes two arguments: the `index` starting from 0 and the\nelement from `list`. `f` returns `unit`.\n\n## Examples\n\n```rescript\nList.forEachWithIndex(list{\"a\", \"b\", \"c\"}, (x, index) => {\n Console.log(\"Item \" ++ Int.toString(index) ++ \" is \" ++ x)\n})\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\n```" - ], - "signature": "let forEachWithIndex: (list<'a>, ('a, int) => unit) => unit" - }, - { - "id": "Stdlib.List.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(list, initialValue, f)` applies `f` to each element of `list` from\nbeginning to end. Function `f` has two parameters: the item from the list and\nan \"accumulator\", which starts with a value of `initialValue`. `reduce` returns\nthe final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduce(0, (a, b) => a + b) == 10\n\n// same as\n\nlist{1, 2, 3, 4}->List.reduce(0, (acc, item) => acc + item) == 10\n```" - ], - "signature": "let reduce: (list<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.List.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(list, initialValue, f)` applies `f` to each element of `list`\nfrom beginning to end. Function `f` has three parameters: the item from the list\nand an \"accumulator\", which starts with a value of `initialValue` and the index\nof each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduceWithIndex(0, (acc, item, index) => acc + item + index) == 16\n```" - ], - "signature": "let reduceWithIndex: (list<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Stdlib.List.reduceReverse", - "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "`reduceReverse(list, initialValue, f)` works like `reduce`, except that\nfunction `f` is applied to each item of `list` from the last back to the first.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduceReverse(0, (a, b) => a + b) == 10\n\nlist{1, 2, 3, 4}->List.reduceReverse(10, (a, b) => a - b) == 0\n\nlist{1, 2, 3, 4}->List.reduceReverse(list{}, List.add) == list{1, 2, 3, 4}\n```" - ], - "signature": "let reduceReverse: (list<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.List.mapReverse2", - "kind": "value", - "name": "mapReverse2", - "docstrings": [ - "`mapReverse2(list1, list2, f)` is equivalent to `List.zipBy(list1, list2, f)->List.reverse`.\n\n## Examples\n\n```rescript\nList.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) == list{4, 2}\n```" - ], - "signature": "let mapReverse2: (list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>" - }, - { - "id": "Stdlib.List.forEach2", - "kind": "value", - "name": "forEach2", - "docstrings": [ - "`forEach2(list1, list2, f)` is similar to `forEach`, but accepts two lists and\nstops at the length of the shorter list.\n\n## Examples\n\n```rescript\nList.forEach2(list{\"Z\", \"Y\"}, list{\"A\", \"B\", \"C\"}, (x, y) => Console.log2(x, y))\n\n/*\n prints:\n \"Z\" \"A\"\n \"Y\" \"B\"\n*/\n```" - ], - "signature": "let forEach2: (list<'a>, list<'b>, ('a, 'b) => 'c) => unit" - }, - { - "id": "Stdlib.List.reduce2", - "kind": "value", - "name": "reduce2", - "docstrings": [ - "`reduce2(list1, list2, initialValue, f)` applies `f` to each element of `list1`\nand `list2` from beginning to end. Stops with the shorter list. Function `f` has\nthree parameters: an accumulator which starts with a value of `initialValue`, an\nitem from `l1`, and an item from `l2`. `reduce2` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nList.reduce2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduce2: (list<'b>, list<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a" - }, - { - "id": "Stdlib.List.reduceReverse2", - "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "`reduceReverse2(list1, list2, initialValue, f)` applies `f` to each element of\n`list1` and `list2`from end to beginning. Stops with the shorter list. Function\n`f` has three parameters: an accumulator which starts with a value of\n`initialValue`, an item from `l1`, and an item from `l2`. `reduce2` returns the\nfinal value of the accumulator.\n\n## Examples\n\n```rescript\nList.reduceReverse2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduceReverse2: (list<'a>, list<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" - }, - { - "id": "Stdlib.List.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(list, f)` returns `true` if all elements in `list` satisfy `f`, where `f`\nis a predicate: a function taking an element and returning a bool.\n\n## Examples\n\n```rescript\nlet isBelow10 = value => value < 10\n\nlist{1, 9, 8, 2}->List.every(isBelow10) == true\n\nlist{1, 99, 8, 2}->List.every(isBelow10) == false\n```" - ], - "signature": "let every: (list<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.List.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(list, f)` returns `true` if at least _one_ of the elements in `list`\nsatisfies `f`, where `f` is a predicate: a function taking an element and\nreturning a bool.\n\n## Examples\n\n```rescript\nlet isAbove100 = value => value > 100\n\nlist{101, 1, 2, 3}->List.some(isAbove100) == true\n\nlist{1, 2, 3, 4}->List.some(isAbove100) == false\n```" - ], - "signature": "let some: (list<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.List.every2", - "kind": "value", - "name": "every2", - "docstrings": [ - "`every2(list1, list2, f)` returns `true` if predicate `f` is `true` for all\npairs of elements up to the shorter length (i.e. `min(length(list1), length(list2))`)\n\n## Examples\n\n```rescript\nList.every2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nList.every2(list{}, list{1}, (a, b) => a > b) == true\n\nList.every2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nList.every2(list{0, 1}, list{5, 0}, (a, b) => a > b) == false\n```" - ], - "signature": "let every2: (list<'a>, list<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.List.some2", - "kind": "value", - "name": "some2", - "docstrings": [ - "`some2(list1, list2, f)` returns `true` if predicate `f` is `true` for any pair\nof elements up to the shorter length (i.e. `min(length(list1), length(list2))`)\n\n## Examples\n\n```rescript\nList.some2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nList.some2(list{}, list{1}, (a, b) => a > b) == false\n\nList.some2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nList.some2(list{0, 1}, list{5, 0}, (a, b) => a > b) == true\n```" - ], - "signature": "let some2: (list<'a>, list<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.List.compareLength", - "kind": "value", - "name": "compareLength", - "docstrings": [ - "`compareLength(list1, list2)` compare two lists solely by length. Returns `-1.` if\n`length(list1)` is less than `length(list2)`, `0.` if `length(list1)` equals\n`length(list2)`, and `1.` if `length(list1)` is greater than `length(list2)`.\n\n## Examples\n\n```rescript\nList.compareLength(list{1, 2}, list{3, 4, 5, 6}) == -1.\n\nList.compareLength(list{1, 2, 3}, list{4, 5, 6}) == 0.\n\nList.compareLength(list{1, 2, 3, 4}, list{5, 6}) == 1.\n```" - ], - "signature": "let compareLength: (list<'a>, list<'a>) => Ordering.t" - }, - { - "id": "Stdlib.List.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(list1, list2, f)` compare elements one by one `f`. `f` returns a negative\nnumber if `list1` is \"less than\" `list2`, zero if `list1` is \"equal to\" `list2`,\na positive number if `list1` is \"greater than\" `list2`.\n\nThe comparison returns the first non-zero result of `f`, or zero if `f` returns\nzero for all `list1` and `list2`.\n\n- If all items have compared equal, but `list1` is exhausted first, return `-1.`. (`list1` is shorter).\n- If all items have compared equal, but `list2` is exhausted first, return `1.` (`list1` is longer).\n\n## Examples\n\n```rescript\nList.compare(list{3}, list{3, 7}, (a, b) => Int.compare(a, b)) == -1.\nList.compare(list{5, 3}, list{5}, (a, b) => Int.compare(a, b)) == 1.\nList.compare(list{1, 3, 5}, list{1, 4, 2}, (a, b) => Int.compare(a, b)) == -1.\nList.compare(list{1, 3, 5}, list{1, 2, 3}, (a, b) => Int.compare(a, b)) == 1.\nList.compare(list{1, 3, 5}, list{1, 3, 5}, (a, b) => Int.compare(a, b)) == 0.\n```\n\n**Please note:** The total ordering of List is different from Array,\nfor Array, we compare the length first and, only if the lengths are equal, elements one by one.\nFor lists, we just compare elements one by one." - ], - "signature": "let compare: (list<'a>, list<'a>, ('a, 'a) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.List.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(list1, list2, f)` check equality of `list2` and `list2` using `f` for\nequality on elements, where `f` is a function that returns `true` if items `x` and\n`y` meet some criterion for equality, `false` otherwise. equal `false` if length\nof `list1` and `list2` are not the same.\n\n## Examples\n\n```rescript\nList.equal(list{1, 2, 3}, list{1, 2}, (a, b) => a == b) == false\n\nList.equal(list{1, 2}, list{1, 2}, (a, b) => a == b) == true\n\nList.equal(list{1, 2, 3}, list{-1, -2, -3}, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let equal: (list<'a>, list<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Stdlib.List.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(list, element, f)` returns `true` if the list contains at least one\n`element` for which `f` returns \\`true'.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.has(2, (a, b) => a == b) == true\n\nlist{1, 2, 3}->List.has(4, (a, b) => a == b) == false\n\nlist{-1, -2, -3}->List.has(2, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let has: (list<'a>, 'b, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.List.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(list, f)` returns `Some(value)` for the first value in `list` that\nsatisfies the predicate function `f`. Returns `None` if no element satisfies\nthe function.\n\n## Examples\n\n```rescript\nList.find(list{1, 4, 3, 2}, x => x > 3) == Some(4)\n\nList.find(list{1, 4, 3, 2}, x => x > 4) == None\n```" - ], - "signature": "let find: (list<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.List.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(list, f)` returns a list of all elements in `list` which satisfy the\npredicate function `f`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nList.filter(list{1, 2, 3, 4}, isEven) == list{2, 4}\n\nList.filter(list{None, Some(2), Some(3), None}, Option.isSome) == list{Some(2), Some(3)}\n```" - ], - "signature": "let filter: (list<'a>, 'a => bool) => list<'a>" - }, - { - "id": "Stdlib.List.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(list, f)` returns a list of all elements in `list` which\nsatisfy the predicate function `f`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nList.filterWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) == list{1, 3}\n```" - ], - "signature": "let filterWithIndex: (list<'a>, ('a, int) => bool) => list<'a>" - }, - { - "id": "Stdlib.List.filterMap", - "kind": "value", - "name": "filterMap", - "docstrings": [ - "`filterMap(list, f)` applies `f` to each element of `list`. If `f` returns\n`Some(value)`, then `value` is _kept_ in the resulting list. If `f` returns\n`None`, the element is _not_ retained in the result.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nlist{1, 2, 3, 4}->List.filterMap(x =>\n if isEven(x) {\n Some(x)\n } else {\n None\n }\n) // list{2, 4}\n\nlist{Some(1), Some(2), None}->List.filterMap(x => x) == list{1, 2}\n```" - ], - "signature": "let filterMap: (list<'a>, 'a => option<'b>) => list<'b>" - }, - { - "id": "Stdlib.List.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(list, f)` creates a pair of lists; the first list consists of all\nelements of `list` that satisfy the predicate function `f`, the second list\nconsists of all elements of `list` that _do not_ satisfy `f`.\n\n## Examples\n\n```rescript\n// (elementsThatSatisfies, elementsThatDoesNotSatisfy)\n\nList.partition(list{1, 2, 3, 4}, x => x > 2) == (list{3, 4}, list{1, 2})\n```" - ], - "signature": "let partition: (list<'a>, 'a => bool) => (list<'a>, list<'a>)" - }, - { - "id": "Stdlib.List.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "`unzip(list)` takes a list of pairs and creates a pair of lists. The first list\ncontains all the first items of the pairs, the second list contains all the\nsecond items.\n\n## Examples\n\n```rescript\nList.unzip(list{(1, 2), (3, 4)}) // (list{1, 3}, list{2, 4})\n\nList.unzip(list{(\"H\", \"W\"), (\"e\", \"o\"), (\"l\", \"r\"), (\"l\", \"l\"), (\"o\", \"d\"), (\" \", \"!\")}) ==\n (list{\"H\", \"e\", \"l\", \"l\", \"o\", \" \"}, list{\"W\", \"o\", \"r\", \"l\", \"d\", \"!\"})\n```" - ], - "signature": "let unzip: list<('a, 'b)> => (list<'a>, list<'b>)" - }, - { - "id": "Stdlib.List.getAssoc", - "kind": "value", - "name": "getAssoc", - "docstrings": [ - "`getAssoc(list, k, f)` return the second element of a pair in `list` where\nthe first element equals `k` as per the predicate function `f`, or `None` if\nnot found.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.getAssoc(3, (a, b) => a == b) // Some(\"c\")\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->List.getAssoc(15, (k, item) =>\n k /* 15 */ == item\n) == Some(\"afternoon\")\n/* 9, 5, 22 */\n```" - ], - "signature": "let getAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.hasAssoc", - "kind": "value", - "name": "hasAssoc", - "docstrings": [ - "`hasAssoc(list, k, f)` returns `true` if there is a pair in `list` where the\nfirst element equals `k` as per the predicate function `f`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.hasAssoc(1, (a, b) => a == b) // true\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->List.hasAssoc(25, (k, item) =>\n k /* 25 */ == item\n) == false\n/* 9, 5, 22 */\n```" - ], - "signature": "let hasAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => bool", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.removeAssoc", - "kind": "value", - "name": "removeAssoc", - "docstrings": [ - "`removeAssoc(list, k, f)` return a list after removing the first pair whose\nfirst value is `k` per the equality predicate `f`, if not found, return a new\nlist identical to `list`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.removeAssoc(1, (a, b) => a == b) // list{(2, \"b\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->List.removeAssoc(9, (k, item) =>\n k /* 9 */ == item\n) == list{(15, \"afternoon\"), (22, \"night\")}\n/* 9, 5, 22 */\n```" - ], - "signature": "let removeAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => list<('a, 'c)>", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.setAssoc", - "kind": "value", - "name": "setAssoc", - "docstrings": [ - "`setAssoc(list, k, v, f)`. If `k` exists in `list` by satisfying the `f`\npredicate, return a new list with the key and value replaced by the new `k` and\n`v`, otherwise, return a new list with the pair `k`, `v` added to the head of\n`list`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.setAssoc(2, \"x\", (a, b) => a == b) ==\n list{(1, \"a\"), (2, \"x\"), (3, \"c\")}\n\nlist{(1, \"a\"), (3, \"c\")}->List.setAssoc(2, \"b\", (a, b) => a == b) ==\n list{(2, \"b\"), (1, \"a\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (3, \"morning?!\"), (22, \"night\")}->List.setAssoc(15, \"afternoon\", (a, b) =>\n mod(a, 12) == mod(b, 12)\n) == list{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n```\n\n**Please note**: In the last example, since: `15 mod 12` equals `3 mod 12`. Both\nthe key _and_ the value are replaced in the list." - ], - "signature": "let setAssoc: (list<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => list<('a, 'c)>", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(list, f)` returns a sorted list.\n\n## Examples\n\n```rescript\nList.sort(list{5, 4, 9, 3, 7}, Int.compare) == list{3, 4, 5, 7, 9}\n```" - ], - "signature": "let sort: (list<'a>, ('a, 'a) => Ordering.t) => list<'a>" - }, - { - "id": "Stdlib.List.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(list)` ignores the provided list and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: list<'a> => unit" - } - ] - }, - "stdlib/lazy": { - "id": "Stdlib.Lazy", - "name": "Lazy", - "docstrings": [ - "This module provides a type `Lazy.t` and functions to create and\n manipulate lazy values. A lazy value is a value that is not\n computed until it is needed. This is useful for deferring\n computations that may be expensive or unnecessary." - ], - "items": [ - { - "id": "Stdlib.Lazy.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of a lazy value. `Lazy.t<'a>` represents a lazy value\n that will eventually yield a value of type `'a` when accessed.\n The value is computed only once, and the result is cached for\n subsequent accesses. If the computation throws an exception,\n the same exception is thrown again on subsequent accesses." - ], - "signature": "type t<+'a>" - }, - { - "id": "Stdlib.Lazy.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`Lazy.make(f)` creates a lazy value from `f` which is the\n computation to be deferred of type `unit => 'a`. \n The function returns a lazy value of type `Lazy.t<'a>`. \n The computation is not executed until the lazy value is accessed.\n\n ## Examples \n ```rescript \n let lazyValue = Lazy.make(() => {\n // Some expensive computation\n Console.log(\"Computing...\")\n 42\n });\n lazyValue->Lazy.get->assertEqual(42)\n ```" - ], - "signature": "let make: (unit => 'a) => t<'a>" - }, - { - "id": "Stdlib.Lazy.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`Lazy.get(x)` forces the suspension `x` and returns its result.\n If `x` has already been forced, `Lazy.get(x)` returns the\n same value again without recomputing it. If it threw an\n exception, the same exception is thrown again.\n Throw `Undefined` if the forcing of `x` tries to force `x` itself\n recursively. This is a runtime error." - ], - "signature": "let get: t<'a> => 'a" - }, - { - "id": "Stdlib.Lazy.isEvaluated", - "kind": "value", - "name": "isEvaluated", - "docstrings": [ - "`Lazy.isEvaluated(x)` returns `true` if the suspension `x` has\n already been forced and did not throw an exception. Otherwise, \n it returns `false`. This is useful for checking if a lazy value\n has been computed before accessing it.\n\n ## Examples\n ```rescript \n let lazyValue = Lazy.make(() => {\n // Some expensive computation\n Console.log(\"Computing...\")\n 42\n })\n Lazy.isEvaluated(lazyValue)->assertEqual(false)\n lazyValue->Lazy.get->assertEqual(42)\n lazyValue->Lazy.isEvaluated->assertEqual(true)\n ```" - ], - "signature": "let isEvaluated: t<'a> => bool" - }, - { - "id": "Stdlib.Lazy.force", - "kind": "value", - "name": "force", - "docstrings": [ - "`force(x)` forces the suspension `x` and returns its result.\n If `x` has already been forced, `Lazy.force(x)` returns the\n same value again without recomputing it. If it threw an exception,\n the same exception is thrown again.\n Throw `Undefined` if the forcing of `x` tries to force `x` itself\n recursively." - ], - "signature": "let force: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.force_val", - "kind": "value", - "name": "force_val", - "docstrings": [ - "`force_val(x)` forces the suspension `x` and returns its\n result. If `x` has already been forced, `force_val(x)`\n returns the same value again without recomputing it.\n Throw `Undefined` if the forcing of `x` tries to force `x` itself\n recursively.\n If the computation of `x` throws an exception, it is unspecified\n whether `force_val(x)` throws the same exception or `Undefined`." - ], - "signature": "let force_val: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.from_fun", - "kind": "value", - "name": "from_fun", - "docstrings": [ - "`Lazy.from_fun(f)` creates a lazy value from `f` which is the\n computation to be deferred of type `unit => 'a`. \n The function returns a lazy value of type `Lazy.t<'a>`. \n The computation is not executed until the lazy value is accessed." - ], - "signature": "let from_fun: (unit => 'a) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.from_val", - "kind": "value", - "name": "from_val", - "docstrings": [ - "`from_val(v)` returns an already-forced suspension of `v`.\n This is for special purposes only." - ], - "signature": "let from_val: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.is_val", - "kind": "value", - "name": "is_val", - "docstrings": [ - "`is_val(x)` returns `true` if `x has already been forced and\n did not throw an exception." - ], - "signature": "let is_val: t<'a> => bool", - "deprecated": "" - } - ] - }, - "stdlib/json": { - "id": "Stdlib.JSON", - "name": "JSON", - "docstrings": [ - "Functions for interacting with JSON." - ], - "items": [ - { - "id": "Stdlib.JSON.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a JSON object." - ], - "signature": "@unboxed\ntype t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)" - }, - { - "id": "Stdlib.JSON.replacer", - "kind": "type", - "name": "replacer", - "docstrings": [], - "signature": "@unboxed\ntype replacer =\n | Keys(array)\n | Replacer((string, t) => t)" - }, - { - "id": "Stdlib.JSON.parseOrThrow", - "kind": "value", - "name": "parseOrThrow", - "docstrings": [ - "`parseOrThrow(string, ~reviver=?)`\n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\ntry {\n let _ = JSON.parseOrThrow(`{\"foo\":\"bar\",\"hello\":\"world\"}`)\n // { foo: 'bar', hello: 'world' }\n\n let _ = JSON.parseOrThrow(\"\")\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\ntry {\n JSON.parseOrThrow(jsonString, ~reviver)->Console.log\n // { hello: 'WORLD', someNumber: 42 }\n\n JSON.parseOrThrow(\"\", ~reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions\n\n- Throws a SyntaxError (Exn.t) if the string isn't valid JSON." - ], - "signature": "let parseOrThrow: (string, ~reviver: (string, t) => t=?) => t" - }, - { - "id": "Stdlib.JSON.parseExn", - "kind": "value", - "name": "parseExn", - "docstrings": [ - "`parseExn(string, ~reviver=?)`\n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\ntry {\n let _ = JSON.parseExn(`{\"foo\":\"bar\",\"hello\":\"world\"}`)\n // { foo: 'bar', hello: 'world' }\n\n let _ = JSON.parseExn(\"\")\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\ntry {\n JSON.parseExn(jsonString, ~reviver)->Console.log\n // { hello: 'WORLD', someNumber: 42 }\n\n JSON.parseExn(\"\", ~reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions\n\n- Throws a SyntaxError (Exn.t) if the string isn't valid JSON." - ], - "signature": "let parseExn: (string, ~reviver: (string, t) => t=?) => t", - "deprecated": "Use `parseOrThrow` instead" - }, - { - "id": "Stdlib.JSON.parseExnWithReviver", - "kind": "value", - "name": "parseExnWithReviver", - "docstrings": [ - "`parseExnWithReviver(string, reviver)`\n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\nJSON.parseExnWithReviver(jsonString, reviver)->Console.log\n// { hello: 'WORLD', someNumber: 42 }\n\ntry {\n JSON.parseExnWithReviver(\"\", reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions\n\n- Throws a SyntaxError if the string is not a valid JSON." - ], - "signature": "let parseExnWithReviver: (string, (string, t) => t) => t", - "deprecated": "Use `parseOrThrow` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringify", - "kind": "value", - "name": "stringify", - "docstrings": [ - "`stringify(json, ~replacer=?, ~space=?)`\n\nConverts a JSON object to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value,\nor an array of keys which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAny` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringify(json)\n// {\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}\n\nJSON.stringify(json, ~space=2)\n// {\n// \"foo\": \"bar\",\n// \"hello\": \"world\",\n// \"someNumber\": 42\n// }\n\nJSON.stringify(json, ~replacer=Keys([\"foo\", \"someNumber\"]))\n// {\"foo\":\"bar\",\"someNumber\":42}\n\nlet replacer = JSON.Replacer(\n (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n },\n)\n\nJSON.stringify(json, ~replacer)\n// {\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}\n```" - ], - "signature": "let stringify: (t, ~replacer: replacer=?, ~space: int=?) => string" - }, - { - "id": "Stdlib.JSON.stringifyWithIndent", - "kind": "value", - "name": "stringifyWithIndent", - "docstrings": [ - "`stringifyWithIndent(json, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nIf you want to stringify any type, use `JSON.stringifyAnyWithIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithIndent(json, 2)\n// {\n// \"foo\": \"bar\",\n// \"hello\": \"world\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithIndent: (t, int) => string", - "deprecated": "Use `stringify` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyWithReplacer", - "kind": "value", - "name": "stringifyWithReplacer", - "docstrings": [ - "`stringifyWithReplacer(json, replacer)`\n\nConverts a JSON object to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nIf you want to stringify any type, use `JSON.stringifyAnyWithReplacer` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\nJSON.stringifyWithReplacer(json, replacer)\n// {\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}\n```" - ], - "signature": "let stringifyWithReplacer: (t, (string, t) => t) => string", - "deprecated": "Use `stringify` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyWithReplacerAndIndent", - "kind": "value", - "name": "stringifyWithReplacerAndIndent", - "docstrings": [ - "`stringifyWithReplacerAndIndent(json, replacer, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nIf you want to stringify any type, use `JSON.stringifyAnyWithReplacerAndIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\nJSON.stringifyWithReplacerAndIndent(json, replacer, 2)\n// {\n// \"foo\": \"BAR\",\n// \"hello\": \"WORLD\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithReplacerAndIndent: (t, (string, t) => t, int) => string", - "deprecated": "Use `stringify` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.stringifyWithFilter", - "kind": "value", - "name": "stringifyWithFilter", - "docstrings": [ - "`stringifyWithFilter(json, filter)`\n\nConverts a JSON object to a JSON string.\nThe filter is an array of keys, which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAnyWithFilter` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithFilter(json, [\"foo\", \"someNumber\"])\n// {\"foo\":\"bar\",\"someNumber\":42}\n```" - ], - "signature": "let stringifyWithFilter: (t, array) => string", - "deprecated": "Use `stringify` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyWithFilterAndIndent", - "kind": "value", - "name": "stringifyWithFilterAndIndent", - "docstrings": [ - "`stringifyWithFilterAndIndent(json, filter, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nThe filter is an array of keys, which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAnyWithFilterAndIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithFilterAndIndent(json, [\"foo\", \"someNumber\"], 2)\n// {\n// \"foo\": \"bar\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithFilterAndIndent: (t, array, int) => string", - "deprecated": "Use `stringify` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.stringifyAny", - "kind": "value", - "name": "stringifyAny", - "docstrings": [ - "`stringifyAny(any, ~replacer=?, ~space=?)`\n\nConverts any type to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringify` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAny\n->Option.getUnsafe == `{\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}`\n\ndict\n->JSON.stringifyAny(~space=2)\n->Option.getUnsafe == `{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`\n\ndict\n->JSON.stringifyAny(~replacer=Keys([\"foo\", \"someNumber\"]))\n->Option.getUnsafe == `{\"foo\":\"bar\",\"someNumber\":42}`\n\nlet replacer = JSON.Replacer(\n (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n },\n)\n\ndict\n->JSON.stringifyAny(~replacer)\n->Option.getUnsafe == `{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\n// Throw a exception\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAny: ('a, ~replacer: replacer=?, ~space: int=?) => option" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithIndent", - "kind": "value", - "name": "stringifyAnyWithIndent", - "docstrings": [ - "`stringifyAnyWithIndent(any, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAnyWithIndent(2)\n->Option.getUnsafe == `{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithIndent: ('a, int) => option", - "deprecated": "Use `stringifyAny` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithReplacer", - "kind": "value", - "name": "stringifyAnyWithReplacer", - "docstrings": [ - "`stringifyAnyWithReplacer(json, replacer)`\n\nConverts any type to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithReplacer` instead.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\ndict\n->JSON.stringifyAnyWithReplacer(replacer)\n->Option.getUnsafe == `{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithReplacer: ('a, (string, t) => t) => option", - "deprecated": "Use `stringifyAny` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithReplacerAndIndent", - "kind": "value", - "name": "stringifyAnyWithReplacerAndIndent", - "docstrings": [ - "`stringifyAnyWithReplacerAndIndent(json, replacer, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithReplacerAndIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\ndict\n->JSON.stringifyAnyWithReplacer(replacer)\n->Option.getUnsafe == `{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithReplacerAndIndent: ('a, (string, t) => t, int) => option", - "deprecated": "Use `stringifyAny` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithFilter", - "kind": "value", - "name": "stringifyAnyWithFilter", - "docstrings": [ - "`stringifyAnyWithFilter(json, filter)`\n\nConverts any type to a JSON string.\nThe filter is an array of keys, which should be included in the output.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithFilter` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict->JSON.stringifyAnyWithFilter([\"foo\", \"someNumber\"]) == `{\"foo\":\"bar\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithFilter: ('a, array) => string", - "deprecated": "Use `stringifyAny` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithFilterAndIndent", - "kind": "value", - "name": "stringifyAnyWithFilterAndIndent", - "docstrings": [ - "`stringifyAnyWithFilterAndIndent(json, filter, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nThe filter is an array of keys, which should be included in the output.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithFilterAndIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAny\n->Option.getUnsafe == `{\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}`\n\ndict\n->JSON.stringifyAny(~space=2)\n->Option.getUnsafe == `{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`\n\ndict\n->JSON.stringifyAny(~replacer=Keys([\"foo\", \"someNumber\"]))\n->Option.getUnsafe == `{\"foo\":\"bar\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithFilterAndIndent: ('a, array, int) => string", - "deprecated": "Use `stringifyAny` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(json)` ignores the provided json and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/jsexn": { - "id": "Stdlib.JsExn", - "name": "JsExn", - "docstrings": [ - "Provide utilities for dealing with JS exceptions.\n\nJS exceptions can be of any type, even though they *should* be of type `Error` of one of its subclasses.\n\nSee [`throw`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/throw) on MDN." - ], - "items": [ - { - "id": "Stdlib.JsExn.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JS exception" - ], - "signature": "type t = unknown" - }, - { - "id": "Stdlib.JsExn.fromException", - "kind": "value", - "name": "fromException", - "docstrings": [], - "signature": "let fromException: exn => option" - }, - { - "id": "Stdlib.JsExn.anyToExnInternal", - "kind": "value", - "name": "anyToExnInternal", - "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a JsExn if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." - ], - "signature": "let anyToExnInternal: 'a => exn" - }, - { - "id": "Stdlib.JsExn.stack", - "kind": "value", - "name": "stack", - "docstrings": [ - "`stack(jsExn)` retrieves the `stack` property of the exception, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\ntry {JsError.make(\"error\")->JsError.throw} catch {\n| JsExn(e) => Console.log(JsExn.stack(e)) // Logs `stack`\n| _ => assert(false)\n}\n```" - ], - "signature": "let stack: t => option" - }, - { - "id": "Stdlib.JsExn.message", - "kind": "value", - "name": "message", - "docstrings": [ - "`message(error)` retrieves the `message` property of the error, if it exists.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\ntry {JsError.SyntaxError.throwWithMessage(\"Some message here\")} catch {\n| JsExn(e) => e->JsExn.message->Option.getExn == \"Some message here\"\n| _ => assert(false)\n}\n```" - ], - "signature": "let message: t => option" - }, - { - "id": "Stdlib.JsExn.name", - "kind": "value", - "name": "name", - "docstrings": [ - "`name(error)` retrieves the `name` property of the error, if it exists.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\ntry {JsError.SyntaxError.throwWithMessage(\"Some message here\")} catch {\n| JsExn(e) => e->JsExn.name->Option.getExn == \"SyntaxError\"\n| _ => assert(false)\n}\n```" - ], - "signature": "let name: t => option" - }, - { - "id": "Stdlib.JsExn.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [ - "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." - ], - "signature": "let fileName: t => option" - }, - { - "id": "Stdlib.JsExn.throw", - "kind": "value", - "name": "throw", - "docstrings": [ - "Throws the given value, terminating execution unless caught by a surrounding try/catch block.\n\nThis is meant to be used when a JS API is based on throwing values that are not of type `Error` or its subclasses." - ], - "signature": "let throw: 'a => 'b" - }, - { - "id": "Stdlib.JsExn.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(jsExn)` ignores the provided JS exception and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/jserror": { - "id": "Stdlib.JsError", - "name": "JsError", - "docstrings": [ - "Functions for working with JavaScript errors.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) on MDN." - ], - "items": [ - { - "id": "Stdlib.JsError.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JavaScript error." - ], - "signature": "type t" - }, - { - "id": "Stdlib.JsError.stack", - "kind": "value", - "name": "stack", - "docstrings": [ - "`stack(error)` retrieves the `stack` property of the error, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\nlet error = JsError.make(\"error\")\nConsole.log(error->JsError.stack) // Logs `stack` if it exists on `someError`\n```" - ], - "signature": "let stack: t => option" - }, - { - "id": "Stdlib.JsError.message", - "kind": "value", - "name": "message", - "docstrings": [ - "`message(error)` retrieves the `message` property of the error.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\nlet error = JsError.SyntaxError.make(\"Some message here\")\nerror->JsError.message == \"Some message here\"\n```" - ], - "signature": "let message: t => string" - }, - { - "id": "Stdlib.JsError.name", - "kind": "value", - "name": "name", - "docstrings": [ - "`name(error)` retrieves the `name` property of the error.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\nlet error = JsError.SyntaxError.make(\"Some message here\")\nerror->JsError.name == \"SyntaxError\"\n```" - ], - "signature": "let name: t => string" - }, - { - "id": "Stdlib.JsError.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [ - "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." - ], - "signature": "let fileName: t => option" - }, - { - "id": "Stdlib.JsError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(message)` creates a new error, setting its `message` to the provided value.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error) on MDN.\n\n## Example\n```rescript\nlet error = JsError.make(\"Some message here\")\nerror->JsError.message == \"Some message here\"\nerror->JsError.name == \"Error\"\n```" - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.throw", - "kind": "value", - "name": "throw", - "docstrings": [ - "Throws the given error, terminating execution unless caught by a surrounding try/catch block.\n\n## Examples\n\n```rescript\nlet error = JsError.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n JsError.throw(error)\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" - ], - "signature": "let throw: t => 'a" - }, - { - "id": "Stdlib.JsError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `Error` with the provided `message` and throws it.\n\n`JsError.throwWithMessage(\"message\")` is equivalent to `JsError.make(\"message\")->JsError.throw`." - ], - "signature": "let throwWithMessage: string => 'a" - }, - { - "id": "Stdlib.JsError.panic", - "kind": "value", - "name": "panic", - "docstrings": [ - "Throws a panic exception with the given message.\n\nA panic exception is a native JavaScript exception that is not intended to be caught and\nhandled. Compared to a ReScript exception this will give a better stack trace and\ndebugging experience.\n\n## Examples\n\n```rescript\ntry {\n JsError.panic(\"Uh oh. This was unexpected!\")\n} catch {\n| JsExn(obj) =>\n switch JsExn.message(obj) {\n | Some(m) => assert(m == \"Panic! Uh oh. This was unexpected!\")\n | None => assert(false)\n }\n| _ => assert(false)\n}\n```" - ], - "signature": "let panic: string => 'a" - }, - { - "id": "Stdlib.JsError.toJsExn", - "kind": "value", - "name": "toJsExn", - "docstrings": [ - "Casts a `JsError.t` to a `JsExn.t`. \n\nThis is useful when you want to compare a JS exception and a JS error." - ], - "signature": "let toJsExn: t => JsExn.t" - }, - { - "id": "Stdlib.JsError.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(error)` ignores the provided error and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl": { - "id": "Stdlib.Intl", - "name": "Intl", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.getCanonicalLocalesExn", - "kind": "value", - "name": "getCanonicalLocalesExn", - "docstrings": [ - "`getCanonicalLocalesExn(locale)` returns the canonical form of `locale`.\n\nThrows `RangeError` when the locale string is malformed.\n\nSee [`Intl.getCanonicalLocales`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales) on MDN.\n\n## Examples\n\n```rescript\nIntl.getCanonicalLocalesExn(\"EN-US\") == [\"en-US\"]\n```" - ], - "signature": "let getCanonicalLocalesExn: string => array" - }, - { - "id": "Stdlib.Intl.getCanonicalLocalesManyExn", - "kind": "value", - "name": "getCanonicalLocalesManyExn", - "docstrings": [ - "`getCanonicalLocalesManyExn(locales)` canonicalises every locale in `locales`.\n\nThrows `RangeError` when any locale string is malformed.\n\nSee [`Intl.getCanonicalLocales`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales) on MDN.\n\n## Examples\n\n```rescript\nIntl.getCanonicalLocalesManyExn([\"EN-US\", \"fr\"]) == [\"en-US\", \"fr\"]\n```" - ], - "signature": "let getCanonicalLocalesManyExn: array => array" - }, - { - "id": "Stdlib.Intl.supportedValuesOfExn", - "kind": "value", - "name": "supportedValuesOfExn", - "docstrings": [ - "`supportedValuesOfExn(key)` returns the list of values supported by the runtime for the feature identified by `key`.\n\nThrows `RangeError` when `key` is unsupported.\n\nSee [`Intl.supportedValuesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.supportedValuesOfExn(\"calendar\")->Array.includes(\"gregory\") == true\n```" - ], - "signature": "let supportedValuesOfExn: string => array" - } - ] - }, - "stdlib/int": { - "id": "Stdlib.Int", - "name": "Int", - "docstrings": [ - "Functions for interacting with JavaScript Number.\nSee: [`Number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)." - ], - "items": [ - { - "id": "Stdlib.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an int." - ], - "signature": "type t = int" - }, - { - "id": "Stdlib.Int.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (int, int) => bool" - }, - { - "id": "Stdlib.Int.compare", - "kind": "value", - "name": "compare", - "docstrings": [], - "signature": "let compare: (int, int) => Ordering.t" - }, - { - "id": "Stdlib.Int.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponential: (int, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Int.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponentialWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toFixed", - "kind": "value", - "name": "toFixed", - "docstrings": [ - "`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixed: (int, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Int.toFixedWithPrecision", - "kind": "value", - "name": "toFixedWithPrecision", - "docstrings": [ - "`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixedWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecision: (int, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Int.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecisionWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." - ], - "signature": "let toString: (int, ~radix: int=?) => string" - }, - { - "id": "Stdlib.Int.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." - ], - "signature": "let toStringWithRadix: (int, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```" - ], - "signature": "let toLocaleString: int => string" - }, - { - "id": "Stdlib.Int.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [ - "`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```" - ], - "signature": "let toFloat: int => float" - }, - { - "id": "Stdlib.Int.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "`fromFloat(n)` return an `int` representing the given value. The conversion is\ndone by truncating the decimal part.\n\n## Examples\n\n```rescript\nInt.fromFloat(2.0) == 2\nInt.fromFloat(1.999) == 1\nInt.fromFloat(1.5) == 1\nInt.fromFloat(0.9999) == 0\n```" - ], - "signature": "let fromFloat: float => int" - }, - { - "id": "Stdlib.Int.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(str, ~radix=?)` return an `option` representing the given value\n`str`. `~radix` specifies the radix base to use for the formatted number.\n\n## Examples\n\n```rescript\nInt.fromString(\"0\") == Some(0)\nInt.fromString(\"NaN\") == None\nInt.fromString(\"6\", ~radix=2) == None\n```" - ], - "signature": "let fromString: (string, ~radix: int=?) => option" - }, - { - "id": "Stdlib.Int.mod", - "kind": "value", - "name": "mod", - "docstrings": [ - "`mod(n1, n2)` calculates the modulo (remainder after division) of two integers.\n\n## Examples\n\n```rescript\nInt.mod(7, 4) == 3\n```" - ], - "signature": "let mod: (int, int) => int" - }, - { - "id": "Stdlib.Int.rangeOptions", - "kind": "type", - "name": "rangeOptions", - "docstrings": [ - "The options for `range`." - ], - "signature": "type rangeOptions = {step?: int, inclusive?: bool}" - }, - { - "id": "Stdlib.Int.range", - "kind": "value", - "name": "range", - "docstrings": [ - "`range(start, end, ~options=?)` returns an int array of the sequence of integers in the\nrange `[start, end)`. That is, including `start` but excluding `end`.\n\nIf `step` is not set and `start < end`, the sequence will be increasing in steps of 1.\n\nIf `step` is not set and `start > end`, the sequence will be decreasing in steps of -1.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nthrown as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.range(3, 6) == [3, 4, 5]\nInt.range(-3, -1) == [-3, -2]\nInt.range(3, 1) == [3, 2]\nInt.range(3, 7, ~options={step: 2}) == [3, 5]\nInt.range(3, 7, ~options={step: 2, inclusive: true}) == [3, 5, 7]\nInt.range(3, 6, ~options={step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`." - ], - "signature": "let range: (int, int, ~options: rangeOptions=?) => array" - }, - { - "id": "Stdlib.Int.rangeWithOptions", - "kind": "value", - "name": "rangeWithOptions", - "docstrings": [ - "`rangeWithOptions(start, end, options)` is like `range`, but with `step` and\n`inclusive` options configurable.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nraised as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.rangeWithOptions(3, 7, {step: 2}) == [3, 5]\nInt.rangeWithOptions(3, 7, {step: 2, inclusive: true}) == [3, 5, 7]\nInt.rangeWithOptions(3, 6, {step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`." - ], - "signature": "let rangeWithOptions: (int, int, rangeOptions) => array", - "deprecated": "" - }, - { - "id": "Stdlib.Int.clamp", - "kind": "value", - "name": "clamp", - "docstrings": [ - "`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nInt.clamp(42) == 42\nInt.clamp(42, ~min=50) == 50\nInt.clamp(42, ~max=40) == 40\nInt.clamp(42, ~min=50, ~max=40) == 50\n```" - ], - "signature": "let clamp: (~min: int=?, ~max: int=?, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseAnd", - "kind": "value", - "name": "bitwiseAnd", - "docstrings": [ - "`bitwiseAnd(n1, n2)` calculates the bitwise AND of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseAnd(7, 4) == 4\n```" - ], - "signature": "let bitwiseAnd: (int, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseOr", - "kind": "value", - "name": "bitwiseOr", - "docstrings": [ - "`bitwiseOr(n1, n2)` calculates the bitwise OR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseOr(7, 4) == 7\n```" - ], - "signature": "let bitwiseOr: (int, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseXor", - "kind": "value", - "name": "bitwiseXor", - "docstrings": [ - "`bigwiseXor(n1, n2)` calculates the bitwise XOR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseXor(7, 4) == 3\n```" - ], - "signature": "let bitwiseXor: (int, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseNot", - "kind": "value", - "name": "bitwiseNot", - "docstrings": [ - "`bitwiseNot(n)` calculates the bitwise NOT of an integer.\n\n## Examples\n\n```rescript\nInt.bitwiseNot(2) == -3\n```" - ], - "signature": "let bitwiseNot: int => int" - }, - { - "id": "Stdlib.Int.shiftLeft", - "kind": "value", - "name": "shiftLeft", - "docstrings": [ - "`shiftLeft(n, length)` calculates the shifted value of an integer `n` by `length` bits to the left.\n\n## Examples\n\n```rescript\nInt.shiftLeft(4, 1) == 8\n```" - ], - "signature": "let shiftLeft: (int, int) => int" - }, - { - "id": "Stdlib.Int.shiftRight", - "kind": "value", - "name": "shiftRight", - "docstrings": [ - "`shiftRight(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\n\nAlso known as \"arithmetic right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRight(8, 1) == 4\n```" - ], - "signature": "let shiftRight: (int, int) => int" - }, - { - "id": "Stdlib.Int.shiftRightUnsigned", - "kind": "value", - "name": "shiftRightUnsigned", - "docstrings": [ - "`shiftRightUnsigned(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\nExcess bits shifted off to the right are discarded, and zero bits are shifted in from the left.\n\nAlso known as \"zero-filling right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRightUnsigned(4, 1) == 2\n```" - ], - "signature": "let shiftRightUnsigned: (int, int) => int" - }, - { - "id": "Stdlib.Int.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(int)` ignores the provided int and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: int => unit" - } - ] - }, - "stdlib/float": { - "id": "Stdlib.Float", - "name": "Float", - "docstrings": [ - "Functions for interacting with float." - ], - "items": [ - { - "id": "Stdlib.Float.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a float." - ], - "signature": "type t = float" - }, - { - "id": "Stdlib.Float.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "Checks if two floating point numbers are equal.\n\n## Examples\n```rescript\nFloat.equal(1.0, 1.0) == true\nFloat.equal(1.0, 2.0) == false\n```" - ], - "signature": "let equal: (float, float) => bool" - }, - { - "id": "Stdlib.Float.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "Compares two floating point numbers, returns an `Ordering.t` value.\n\n## Examples\n```rescript\nFloat.compare(1.0, 1.0) == Ordering.equal\nFloat.compare(1.0, 2.0) == Ordering.less\nFloat.compare(2.0, 1.0) == Ordering.greater\n```" - ], - "signature": "let compare: (float, float) => Ordering.t" - }, - { - "id": "Stdlib.Float.isNaN", - "kind": "value", - "name": "isNaN", - "docstrings": [ - "`isNaN(v)` tests if the given `v` is `NaN`.\nSee [`isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) on MDN.\n\n## Examples\n\n```rescript\nFloat.isNaN(3.0) // false\nFloat.isNaN(Float.Constants.nan) // true\n```" - ], - "signature": "let isNaN: float => bool" - }, - { - "id": "Stdlib.Float.isFinite", - "kind": "value", - "name": "isFinite", - "docstrings": [ - "`isFinite(v)` tests if the given `v` is finite.\nSee [`isFinite`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite) on MDN.\n\n## Examples\n\n```rescript\nFloat.isFinite(1.0) == true\nFloat.isFinite(Float.Constants.nan) == false\nFloat.isFinite(Float.Constants.positiveInfinity) == false\n```" - ], - "signature": "let isFinite: float => bool" - }, - { - "id": "Stdlib.Float.parseFloat", - "kind": "value", - "name": "parseFloat", - "docstrings": [ - "`parseFloat(v)` parse the given `v` and returns a float. Leading whitespace in\n`v` is ignored. Returns `NaN` if `v` can't be parsed. Use \\[`fromString`\\] to\nensure it returns a valid float and not `NaN`.\nSee [`parseFloat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseFloat(\"1.0\") == 1.0\nFloat.parseFloat(\" 3.14 \") == 3.14\nFloat.parseFloat(\"3.0\") == 3.0\nFloat.parseFloat(\"3.14some non-digit characters\") == 3.14\nFloat.parseFloat(\"error\")->Float.isNaN == true\n```" - ], - "signature": "let parseFloat: string => float" - }, - { - "id": "Stdlib.Float.parseInt", - "kind": "value", - "name": "parseInt", - "docstrings": [ - "`parseInt(v, ~radix=?)` parse the given `v` and returns a float. Leading\nwhitespace in this argument `v`is ignored. `radix` specifies the radix base to\nuse for the formatted number. The value must be in the range \\[2, 36\\] (inclusive).\nReturns `NaN` if `v` can't be parsed and `radix` is smaller than 2 or bigger\nthan 36.\nSee [`parseInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseInt(\"1.0\") == 1.0\nFloat.parseInt(\" 3.14 \") == 3.0\nFloat.parseInt(3) == 3.0\nFloat.parseInt(\"3.14some non-digit characters\") == 3.0\nFloat.parseInt(\"error\")->Float.isNaN == true\nFloat.parseInt(\"10.0\", ~radix=2) == 2.0\nFloat.parseInt(\"15 * 3\", ~radix=10) == 15.0\nFloat.parseInt(\"12\", ~radix=13) == 15.0\nFloat.parseInt(\"17\", ~radix=40)->Float.isNaN == true\n```" - ], - "signature": "let parseInt: ('a, ~radix: int=?) => float" - }, - { - "id": "Stdlib.Float.parseIntWithRadix", - "kind": "value", - "name": "parseIntWithRadix", - "docstrings": [ - "`parseIntWithRadix(v, ~radix)` parse the given `v` and returns a float. Leading\nwhitespace in this argument `v`is ignored. `radix` specifies the radix base to\nuse for the formatted number. The value must be in the range \\[2, 36\\] (inclusive).\nReturns `NaN` if `v` can't be parsed and `radix` is smaller than 2 or bigger\nthan 36.\nSee [`parseInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseIntWithRadix(\"10.0\", ~radix=2) == 2.0\nFloat.parseIntWithRadix(\"15 * 3\", ~radix=10) == 15.0\nFloat.parseIntWithRadix(\"12\", ~radix=13) == 15.0\nFloat.parseIntWithRadix(\"17\", ~radix=40)->Float.isNaN == true\n```" - ], - "signature": "let parseIntWithRadix: ('a, ~radix: int) => float", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "`toExponential(v, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponential(1000.0) == \"1e+3\"\nFloat.toExponential(-1000.0) == \"-1e+3\"\nFloat.toExponential(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponential(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponential: (float, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Float.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "`toExponential(v, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponentialWithPrecision(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponentialWithPrecision(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponentialWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toFixed", - "kind": "value", - "name": "toFixed", - "docstrings": [ - "`toFixed(v, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixed(123456.0) == \"123456\"\nFloat.toFixed(10.0) == \"10\"\nFloat.toFixed(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixed(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixed: (float, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Float.toFixedWithPrecision", - "kind": "value", - "name": "toFixedWithPrecision", - "docstrings": [ - "`toFixedWithPrecision(v, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixedWithPrecision(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixedWithPrecision(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixedWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "`toPrecision(v, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecision(100.0) == \"100\"\nFloat.toPrecision(1.0) == \"1\"\nFloat.toPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecision: (float, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Float.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "`toPrecisionWithPrecision(v, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecisionWithPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecisionWithPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecisionWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(v)` return a `string` representing the given value.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toString(1000.0) == \"1000\"\nFloat.toString(-1000.0) == \"-1000\"\n```" - ], - "signature": "let toString: (float, ~radix: int=?) => string" - }, - { - "id": "Stdlib.Float.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "`toStringWithRadix(v, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toStringWithRadix(6.0, ~radix=2) == \"110\"\nFloat.toStringWithRadix(3735928559.0, ~radix=16) == \"deadbeef\"\nFloat.toStringWithRadix(123456.0, ~radix=36) == \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." - ], - "signature": "let toStringWithRadix: (float, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(v)` return a `string` with language-sensitive representing the\ngiven value.\nSee [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nFloat.toLocaleString(1000.0) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nFloat.toLocaleString(1000.0) // \"1.000\"\n```" - ], - "signature": "let toLocaleString: float => string" - }, - { - "id": "Stdlib.Float.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(str)` return an `option` representing the given value `str`.\n\n## Examples\n\n```rescript\nFloat.fromString(\"0\") == Some(0.0)\nFloat.fromString(\"NaN\") == None\nFloat.fromString(\"6\") == Some(6.0)\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.Float.toInt", - "kind": "value", - "name": "toInt", - "docstrings": [ - "`toInt(v)` returns an int to given float `v`.\n\n## Examples\n\n```rescript\nFloat.toInt(2.0) == 2\nFloat.toInt(1.0) == 1\nFloat.toInt(1.1) == 1\nFloat.toInt(1.6) == 1\n```" - ], - "signature": "let toInt: float => int" - }, - { - "id": "Stdlib.Float.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "`fromInt(v)` returns a float to given int `v`.\n\n## Examples\n\n```rescript\nFloat.fromInt(2) == 2.0\nFloat.fromInt(1) == 1.0\n```" - ], - "signature": "let fromInt: int => float" - }, - { - "id": "Stdlib.Float.mod", - "kind": "value", - "name": "mod", - "docstrings": [ - "`mod(n1, n2)` calculates the modulo (remainder after division) of two floats.\n\n## Examples\n\n```rescript\nFloat.mod(7.0, 4.0) == 3.0\n```" - ], - "signature": "let mod: (float, float) => float" - }, - { - "id": "Stdlib.Float.clamp", - "kind": "value", - "name": "clamp", - "docstrings": [ - "`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nFloat.clamp(4.2) == 4.2\nFloat.clamp(4.2, ~min=4.3) == 4.3\nFloat.clamp(4.2, ~max=4.1) == 4.1\nFloat.clamp(4.2, ~min=4.3, ~max=4.1) == 4.3\n```" - ], - "signature": "let clamp: (~min: float=?, ~max: float=?, float) => float" - }, - { - "id": "Stdlib.Float.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(float)` ignores the provided float and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: float => unit" - } - ] - }, - "stdlib/error": { - "id": "Stdlib.Error", - "name": "Error", - "docstrings": [ - "Functions for working with JavaScript exceptions.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) on MDN." - ], - "items": [ - { - "id": "Stdlib.Error.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JavaScript exception." - ], - "signature": "type t = Exn.t", - "deprecated": "" - }, - { - "id": "Stdlib.Error.fromException", - "kind": "value", - "name": "fromException", - "docstrings": [], - "signature": "let fromException: exn => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.toException", - "kind": "value", - "name": "toException", - "docstrings": [ - "Turns an `Error.t` into an `exn`.\n\n## Examples\n```rescript\nlet error = Error.make(\"Something went wrong.\")\n\nlet asExn = error->Error.toException // `asExn` is now type `exn`\n```" - ], - "signature": "let toException: t => exn", - "deprecated": "Use functions from `JsExn` instead" - }, - { - "id": "Stdlib.Error.stack", - "kind": "value", - "name": "stack", - "docstrings": [ - "`stack(error)` retrieves the `stack` property of the error, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\nlet error = Error.make(\"error\")\nConsole.log(error->Error.stack) // Logs `stack` if it exists on `someError`\n```" - ], - "signature": "let stack: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.message", - "kind": "value", - "name": "message", - "docstrings": [ - "`message(error)` retrieves the `message` property of the error, if it exists.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\nlet error = Error.SyntaxError.make(\"Some message here\")\nConsole.log(error->Error.message) // Logs \"Some message here\" to the console\n```" - ], - "signature": "let message: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.name", - "kind": "value", - "name": "name", - "docstrings": [ - "`name(error)` retrieves the `name` property of the error, if it exists.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\nlet error = Error.SyntaxError.make(\"Some message here\")\nConsole.log(error->Error.name) // Logs \"SyntaxError\" to the console\n```" - ], - "signature": "let name: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [ - "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." - ], - "signature": "let fileName: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(message)` creates a new error, setting its `message` to the provided value.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error) on MDN.\n\n## Example\n```rescript\nlet error = Error.make(\"Some message here\")\nConsole.log(error->Error.message) // Logs \"Some message here\" to the console\nConsole.log(error->Error.name) // Logs \"Error\" to the console, because this is a regular error\n```" - ], - "signature": "let make: string => t", - "deprecated": "" - }, - { - "id": "Stdlib.Error.raise", - "kind": "value", - "name": "raise", - "docstrings": [ - "Raises (throws in JavaScript language) the provided `Error.t`, which will stop execution.\n\n## Examples\n```rescript\nlet error = Error.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n error->Error.raise\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" - ], - "signature": "let raise: t => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Error.throw", - "kind": "value", - "name": "throw", - "docstrings": [ - "Throws the given exception, terminating execution unless caught by a surrounding try/catch block.\n\n## Examples\n\n```rescript\nlet error = Error.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n Error.throw(error)\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" - ], - "signature": "let throw: t => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Error.panic", - "kind": "value", - "name": "panic", - "docstrings": [ - "Throws a panic exception with the given message.\n\nA panic exception is a native JavaScript exception that is not intended to be caught and\nhandled. Compared to a ReScript exception this will give a better stack trace and\ndebugging experience.\n\n## Examples\n\n```rescript\ntry {\n Error.panic(\"Uh oh. This was unexpected!\")\n} catch {\n| Exn.Error(obj) =>\n switch Exn.message(obj) {\n | Some(m) => assert(m == \"Panic! Uh oh. This was unexpected!\")\n | None => assert(false)\n }\n| _ => assert(false)\n}\n```" - ], - "signature": "let panic: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Error.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(error)` ignores the provided error and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit", - "deprecated": "" - } - ] - }, - "stdlib/exn": { - "id": "Stdlib.Exn", - "name": "Exn", - "docstrings": [ - "Provide utilities for dealing with JS exceptions." - ], - "items": [ - { - "id": "Stdlib.Exn.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JS exception" - ], - "signature": "type t", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.asJsExn", - "kind": "value", - "name": "asJsExn", - "docstrings": [], - "signature": "let asJsExn: exn => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.stack", - "kind": "value", - "name": "stack", - "docstrings": [], - "signature": "let stack: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.message", - "kind": "value", - "name": "message", - "docstrings": [], - "signature": "let message: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.name", - "kind": "value", - "name": "name", - "docstrings": [], - "signature": "let name: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [], - "signature": "let fileName: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.anyToExnInternal", - "kind": "value", - "name": "anyToExnInternal", - "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a Exn.Error if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." - ], - "signature": "let anyToExnInternal: 'a => exn", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseError", - "kind": "value", - "name": "raiseError", - "docstrings": [ - "Raise Js exception Error object with stacktrace" - ], - "signature": "let raiseError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseEvalError", - "kind": "value", - "name": "raiseEvalError", - "docstrings": [], - "signature": "let raiseEvalError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseRangeError", - "kind": "value", - "name": "raiseRangeError", - "docstrings": [], - "signature": "let raiseRangeError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseReferenceError", - "kind": "value", - "name": "raiseReferenceError", - "docstrings": [], - "signature": "let raiseReferenceError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseSyntaxError", - "kind": "value", - "name": "raiseSyntaxError", - "docstrings": [], - "signature": "let raiseSyntaxError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseTypeError", - "kind": "value", - "name": "raiseTypeError", - "docstrings": [], - "signature": "let raiseTypeError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseUriError", - "kind": "value", - "name": "raiseUriError", - "docstrings": [], - "signature": "let raiseUriError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(exn)` ignores the provided exn and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit", - "deprecated": "" - } - ] - }, - "stdlib/dict": { - "id": "Stdlib.Dict", - "name": "Dict", - "docstrings": [ - "A mutable dictionary with string keys.\n\nCompiles to a regular JavaScript object." - ], - "items": [ - { - "id": "Stdlib.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a dictionary of value `'a`." - ], - "signature": "type t<'a> = dict<'a>" - }, - { - "id": "Stdlib.Dict.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(dict, key)` Returns the `value` at the provided `key`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `key` does not exist in `dict`.\n\nUse `Dict.getUnsafe` only when you are sure the key exists (i.e. when iterating `Dict.keys` result).\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\nlet value = dict->Dict.getUnsafe(\"key1\")\nConsole.log(value) // value1\n```" - ], - "signature": "let getUnsafe: (dict<'a>, string) => 'a" - }, - { - "id": "Stdlib.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the value at the provided key, if it exists. Returns an option.\n\n## Examples\n```rescript\nlet dict = dict{\"someKey\": \"someValue\"}\n\nswitch dict->Dict.get(\"someKey\") {\n| None => Console.log(\"Nope, didn't have the key.\")\n| Some(value) => Console.log(value)\n}\n```\n\n## Alternative: Pattern Matching with `dict{}`\n\nFor nested dictionary access, consider using the more concise `dict{}` pattern matching syntax:\n\n```rescript\n// More concise approach using pattern matching\nlet decodeImageUrl = (json: JSON.t) => {\n switch json {\n | JSON.Object(dict{\"data\": JSON.Object(dict{\"image_url\": JSON.String(url)})}) => Some(url)\n | _ => None\n }\n}\n\n// Alternative using Dict.get\nlet decodeImageUrl = (json: JSON.t) => {\n switch json {\n | JSON.Object(obj) =>\n switch Dict.get(obj, \"data\") {\n | Some(JSON.Object(data)) =>\n switch Dict.get(data, \"image_url\") {\n | Some(JSON.String(url)) => Some(url)\n | _ => None\n }\n | _ => None\n }\n | _ => None\n }\n}\n```" - ], - "signature": "let get: (dict<'a>, string) => option<'a>" - }, - { - "id": "Stdlib.Dict.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(dictionary, key, value)` sets the value at the provided key to the provided value.\n\n## Examples\n```rescript\nlet dict = Dict.make()\n\ndict->Dict.set(\"someKey\", \"someValue\")\n```" - ], - "signature": "let set: (dict<'a>, string, 'a) => unit" - }, - { - "id": "Stdlib.Dict.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "`delete(dictionary, key)` deletes the value at `key`, if it exists.\n\n## Examples\n```rescript\nlet dict = dict{\"someKey\": \"someValue\"}\n\ndict->Dict.delete(\"someKey\")\n```" - ], - "signature": "let delete: (dict<'a>, string) => unit" - }, - { - "id": "Stdlib.Dict.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make()` creates a new, empty dictionary.\n\n## Examples\n```rescript\nlet dict1: dict = Dict.make() // You can annotate the type of the values of your dict yourself if you want\n\nlet dict2 = Dict.make() // Or you can let ReScript infer it via usage.\ndict2->Dict.set(\"someKey\", 12)\n```" - ], - "signature": "let make: unit => dict<'a>" - }, - { - "id": "Stdlib.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(entries)` creates a new dictionary from the provided array of key/value pairs.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([(\"key1\", \"value1\"), (\"key2\", \"value2\")])\n```" - ], - "signature": "let fromArray: array<(string, 'a)> => dict<'a>" - }, - { - "id": "Stdlib.Dict.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "`fromIterator(entries)` creates a new dictionary from the provided iterator of key/value pairs.\n\n## Examples\n\n```rescript\nlet iterator: Iterator.t<(string, int)> = %raw(`\n (() => {\n var map1 = new Map();\n map1.set('first', 1);\n map1.set('second', 2);\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\niterator\n->Dict.fromIterator\n->Dict.valuesToArray == [1, 2]\n```" - ], - "signature": "let fromIterator: Iterator.t<(string, 'a)> => dict<'a>" - }, - { - "id": "Stdlib.Dict.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(dictionary)` returns an array of all the key/value pairs of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet asArray = dict->Dict.toArray\nConsole.log(asArray) // Logs `[[\"someKey\", 1], [\"someKey2\", 2]]` to the console\n```" - ], - "signature": "let toArray: dict<'a> => array<(string, 'a)>" - }, - { - "id": "Stdlib.Dict.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "`keysToArray(dictionary)` returns an array of all the keys of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet keys = dict->Dict.keysToArray\nConsole.log(keys) // Logs `[\"someKey\", \"someKey2\"]` to the console\n```" - ], - "signature": "let keysToArray: dict<'a> => array" - }, - { - "id": "Stdlib.Dict.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(dictionary)` returns the number of key/value pairs in the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.size->assertEqual(0)\n\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\ndict->Dict.size->assertEqual(2)\n\n// After deleting a key\ndict->Dict.delete(\"someKey\")\ndict->Dict.size->assertEqual(1)\n```" - ], - "signature": "let size: dict<'a> => int" - }, - { - "id": "Stdlib.Dict.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(dictionary)` returns `true` if the dictionary is empty (has no key/value pairs), `false` otherwise.\n\n## Examples\n```rescript\nlet emptyDict = Dict.make()\nemptyDict->Dict.isEmpty->assertEqual(true)\n\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.isEmpty->assertEqual(false)\n\n// After clearing all keys\ndict->Dict.delete(\"someKey\")\ndict->Dict.isEmpty->assertEqual(true)\n```" - ], - "signature": "let isEmpty: dict<'a> => bool" - }, - { - "id": "Stdlib.Dict.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [ - "`valuesToArray(dictionary)` returns an array of all the values of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet values = dict->Dict.valuesToArray\nConsole.log(values) // Logs `[1, 2]` to the console\n```" - ], - "signature": "let valuesToArray: dict<'a> => array<'a>" - }, - { - "id": "Stdlib.Dict.assign", - "kind": "value", - "name": "assign", - "docstrings": [ - "`assign(dictionary1, dictionary2)` [shallowly](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) merges dictionary2 into dictionary1, and returns dictionary1.\n\nBeware this will *mutate* dictionary1. If you're looking for a way to copy a dictionary, check out `Dict.copy`.\n\n## Examples\n```rescript\nlet dict1 = Dict.make()\ndict1->Dict.set(\"firstKey\", 1)\nConsole.log(dict1->Dict.keysToArray) // Logs `[\"firstKey\"]`\n\nlet dict2 = Dict.make()\ndict2->Dict.set(\"someKey\", 2)\ndict2->Dict.set(\"someKey2\", 3)\n\nlet dict1 = dict1->Dict.assign(dict2)\n\nConsole.log(dict1->Dict.keysToArray) // Logs `[\"firstKey\", \"someKey\", \"someKey2\"]`\n```" - ], - "signature": "let assign: (dict<'a>, dict<'a>) => dict<'a>" - }, - { - "id": "Stdlib.Dict.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(dictionary)` [shallowly copies](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) the provided dictionary to a new dictionary.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\nlet dict2 = dict->Dict.copy\n\n// Both log `[\"key1\", \"key2\"]` here.\nConsole.log2(dict->Dict.keysToArray, dict2->Dict.keysToArray)\n```" - ], - "signature": "let copy: dict<'a> => dict<'a>" - }, - { - "id": "Stdlib.Dict.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(dictionary, f)` iterates through all values of the dict.\n\n> Please note that this is *without the keys*, just the values. If you need the key as well, use `Dict.forEachWithKey`.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\n\ndict->Dict.forEach(value => {\n Console.log(value)\n})\n```" - ], - "signature": "let forEach: (dict<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Dict.forEachWithKey", - "kind": "value", - "name": "forEachWithKey", - "docstrings": [ - "`forEachWithKey(dictionary, f)` iterates through all values of the dict, including the key for each value.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\n\ndict->Dict.forEachWithKey((value, key) => {\n Console.log2(value, key)\n})\n```" - ], - "signature": "let forEachWithKey: (dict<'a>, ('a, string) => unit) => unit" - }, - { - "id": "Stdlib.Dict.mapValues", - "kind": "value", - "name": "mapValues", - "docstrings": [ - "`mapValues(dictionary, f)` returns a new dictionary with the same keys, and `f` applied to each value in the original dictionary.\n\n## Examples\n\n```rescript\nlet dict = dict{\"key1\": 1, \"key2\": 2}\n\ndict->Dict.mapValues(v => v + 10)->Dict.toArray // [(\"key1\", 11), (\"key2\", 12)]\ndict->Dict.mapValues(v => Int.toString(v))->Dict.toArray // [(\"key1\", \"1\"), (\"key2\", \"2\")]\n```" - ], - "signature": "let mapValues: (dict<'a>, 'a => 'b) => dict<'b>" - }, - { - "id": "Stdlib.Dict.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(dictionary, \"key\")` returns true if the \"key\" is present in the dictionary.\n\nBe aware that it uses the JavaScript `in` operator under the hood.\n\n## Examples\n\n```rescript\nlet dict = dict{\"key1\": Some(1), \"key2\": None}\n\ndict->Dict.has(\"key1\") == true\ndict->Dict.has(\"key2\") == true\ndict->Dict.has(\"key3\") == false\ndict->Dict.has(\"toString\") == true\n```" - ], - "signature": "let has: (dict<'a>, string) => bool" - }, - { - "id": "Stdlib.Dict.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(dict)` ignores the provided dict and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: dict<'a> => unit" - } - ] - }, - "stdlib/date": { - "id": "Stdlib.Date", - "name": "Date", - "docstrings": [ - "Functions for interacting with JavaScript Dates." - ], - "items": [ - { - "id": "Stdlib.Date.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a JavaScript date." - ], - "signature": "type t" - }, - { - "id": "Stdlib.Date.msSinceEpoch", - "kind": "type", - "name": "msSinceEpoch", - "docstrings": [ - "Time, in milliseconds, since / until the UNIX epoch (January 1, 1970 00:00:00 UTC).\nPositive numbers represent dates after, negative numbers dates before epoch." - ], - "signature": "type msSinceEpoch = float" - }, - { - "id": "Stdlib.Date.localeOptions", - "kind": "type", - "name": "localeOptions", - "docstrings": [ - "A type representing date time format options.\n\nNote: There are some properties missing:\n- fractionalSecondDigits\n- dayPeriod\n- calendar\n- numberingSystem\n- localeMatcher\n- timeZone\n- hour12\n- hourCycle\n- formatMatcher\n\nSee full spec at https://tc39.es/ecma402/#datetimeformat-objects" - ], - "signature": "type localeOptions = {\n dateStyle?: [#full | #long | #medium | #short],\n timeStyle?: [#full | #long | #medium | #short],\n weekday?: [#long | #narrow | #short],\n era?: [#long | #narrow | #short],\n year?: [#\"2-digit\" | #numeric],\n month?: [\n | #\"2-digit\"\n | #long\n | #narrow\n | #numeric\n | #short\n ],\n day?: [#\"2-digit\" | #numeric],\n hour?: [#\"2-digit\" | #numeric],\n minute?: [#\"2-digit\" | #numeric],\n second?: [#\"2-digit\" | #numeric],\n timeZoneName?: [#long | #short],\n}" - }, - { - "id": "Stdlib.Date.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make()`\n\nCreates a date object with the current date time as value.\n\n## Examples\n```rescript\nDate.make()\n```" - ], - "signature": "let make: unit => t" - }, - { - "id": "Stdlib.Date.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(dateTimeString)`\n\nCreates a date object from given date time string.\nThe string has to be in the ISO 8601 format YYYY-MM-DDTHH:mm:ss.sssZ (https://tc39.es/ecma262/\\#sec-date-time-string-format).\n\nInvalid date time strings will create invalid dates.\nYou can use the result like any valid date, but many functions like `toString` will return \"Invalid Date\" or functions like `Date.getTime` will return NaN.\n\n## Examples\n```rescript\nDate.fromString(\"2023\") // 2023-01-01T00:00:00.000Z\n\nDate.fromString(\"2023-02-20\") // 2023-02-20T00:00:00.000Z\n\nDate.fromString(\"2023-02-20T16:40:00.00Z\") // 2023-02-20T16:40:00.000Z\n\nDate.fromString(\"\") // Invalid Date\n\nDate.fromString(\"\")->Date.getTime // NaN\n```" - ], - "signature": "let fromString: string => t" - }, - { - "id": "Stdlib.Date.fromTime", - "kind": "value", - "name": "fromTime", - "docstrings": [ - "`fromTime(msSinceEpoch)`\n\nCreates a date object from the given time in milliseconds since / until UNIX epoch (January 1, 1970 00:00:00 UTC).\nPositive numbers create dates after epoch, negative numbers create dates before epoch.\n\n## Examples\n```rescript\nDate.fromTime(0.0)\n// 1970-01-01T00:00:00.000Z\n\nDate.fromTime(-86_400_000.0)\n// 1969-12-31T00:00:00.000Z\n\nDate.fromTime(86_400_000.0)\n// 1970-01-02T00:00:00.000Z\n```" - ], - "signature": "let fromTime: msSinceEpoch => t" - }, - { - "id": "Stdlib.Date.makeWithYM", - "kind": "value", - "name": "makeWithYM", - "docstrings": [ - "Creates a date object with the given year and month.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYM(~year=2023, ~month=0)\n// 2023-01-01T00:00:00.000Z\n\nDate.makeWithYM(~year=2023, ~month=11)\n// 2023-12-01T00:00:00.000Z\n\nDate.makeWithYM(~year=2023, ~month=12)\n// 2024-01-01T00:00:00.000Z\n\nDate.makeWithYM(~year=2023, ~month=-1)\n// 2022-12-01T00:00:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYM: (~year: int, ~month: int) => t" - }, - { - "id": "Stdlib.Date.makeWithYMD", - "kind": "value", - "name": "makeWithYMD", - "docstrings": [ - "Creates a date object with the given year, month and date (day of month).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMD(~year=2023, ~month=1, ~day=20)\n// 2023-02-20T00:00:00.000Z\n\nDate.makeWithYMD(~year=2023, ~month=1, ~day=-1)\n// 2022-11-29T00:00:00.000Z\n\nDate.makeWithYMD(~year=2023, ~month=1, ~day=29)\n// 2023-03-01T00:00:00.000Z\n```" - ], - "signature": "let makeWithYMD: (~year: int, ~month: int, ~day: int) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDH", - "kind": "value", - "name": "makeWithYMDH", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month) and hours.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=16)\n// 2023-02-20T16:00:00.000Z\n\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=24)\n// 2023-02-21T00:00:00.000Z\n\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=-1)\n// 2023-02-19T23:00:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDH: (~year: int, ~month: int, ~day: int, ~hours: int) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDHM", - "kind": "value", - "name": "makeWithYMDHM", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours and minutes.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=60)\n// 2023-02-20T17:00:00.000Z\n\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=-1)\n// 2023-02-20T15:59:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDHM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDHMS", - "kind": "value", - "name": "makeWithYMDHMS", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours, minutes and seconds.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=60)\n// 2023-02-20T16:41:00.000Z\n\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=-1)\n// 2023-02-20T16:39:59.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDHMS: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDHMSM", - "kind": "value", - "name": "makeWithYMDHMSM", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours, minutes, seconds and milliseconds.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=0,\n)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=1000,\n)\n// 2023-02-20T16:40:01.000Z\n\nDate.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=-1,\n)\n// 2023-02-20T16:39:59.999Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDHMSM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => t" - }, - { - "id": "Stdlib.Date.now", - "kind": "value", - "name": "now", - "docstrings": [ - "`now()`\n\nReturns the time, in milliseconds, between UNIX epoch (January 1, 1970 00:00:00 UTC) and the current date time." - ], - "signature": "let now: unit => msSinceEpoch" - }, - { - "id": "Stdlib.Date.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(date1, date2)` checks if two dates represent the same point in time.\n\n## Examples\n```rescript\nDate.equal(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-01\")) == true\nDate.equal(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-02\")) == false\n```" - ], - "signature": "let equal: (t, t) => bool" - }, - { - "id": "Stdlib.Date.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(date1, date2)` compares two dates chronologically, returns an `Ordering.t` value.\n\n## Examples\n```rescript\nDate.compare(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-01\")) == Ordering.equal\nDate.compare(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-02\")) == Ordering.less\nDate.compare(Date.fromString(\"2023-01-02\"), Date.fromString(\"2023-01-01\")) == Ordering.greater\n```" - ], - "signature": "let compare: (t, t) => Ordering.t" - }, - { - "id": "Stdlib.Date.getTime", - "kind": "value", - "name": "getTime", - "docstrings": [ - "`getTime(date)`\n\nReturns the time, in milliseconds, between UNIX epoch (January 1, 1970 00:00:00 UTC) and the current date time.\nInvalid dates will return NaN.\nDates before epoch will return negative numbers.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20\")->Date.getTime\n// 1676851200000\n```" - ], - "signature": "let getTime: t => msSinceEpoch" - }, - { - "id": "Stdlib.Date.getTimezoneOffset", - "kind": "value", - "name": "getTimezoneOffset", - "docstrings": [ - "`getTimezoneOffset(date)`\n\nReturns the time in minutes between the UTC time and the locale time.\nThe timezone of the given date doesn't matter.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01\")->Date.getTimezoneOffset\n// -60 with local time zone = Europe/Berlin\n\nDate.fromString(\"2023-06-01\")->Date.getTimezoneOffset\n// -120 with local time zone = Europe/Berlin\n```" - ], - "signature": "let getTimezoneOffset: t => int" - }, - { - "id": "Stdlib.Date.getFullYear", - "kind": "value", - "name": "getFullYear", - "docstrings": [ - "`getFullYear(date)`\n\nReturns the year of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20\")->Date.getFullYear\n// 2023\n```" - ], - "signature": "let getFullYear: t => int" - }, - { - "id": "Stdlib.Date.getMonth", - "kind": "value", - "name": "getMonth", - "docstrings": [ - "`getMonth(date)`\n\nReturns the month (0-indexed) of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01\")->Date.getMonth\n// 0\n```" - ], - "signature": "let getMonth: t => int" - }, - { - "id": "Stdlib.Date.getDate", - "kind": "value", - "name": "getDate", - "docstrings": [ - "`getDate(date)`\n\nReturns the date (day of month) of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getDate\n// 20\n```" - ], - "signature": "let getDate: t => int" - }, - { - "id": "Stdlib.Date.getHours", - "kind": "value", - "name": "getHours", - "docstrings": [ - "`getHours(date)`\n\nReturns the hours of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getHours\n// 16\n```" - ], - "signature": "let getHours: t => int" - }, - { - "id": "Stdlib.Date.getMinutes", - "kind": "value", - "name": "getMinutes", - "docstrings": [ - "`getMinutes(date)`\n\nReturns the minutes of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getMinutes\n// 40\n```" - ], - "signature": "let getMinutes: t => int" - }, - { - "id": "Stdlib.Date.getSeconds", - "kind": "value", - "name": "getSeconds", - "docstrings": [ - "`getSeconds(date)`\n\nReturns the seconds of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getSeconds\n// 0\n```" - ], - "signature": "let getSeconds: t => int" - }, - { - "id": "Stdlib.Date.getMilliseconds", - "kind": "value", - "name": "getMilliseconds", - "docstrings": [ - "`getMilliseconds(date)`\n\nReturns the milliseconds of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getMilliseconds\n// 0\n```" - ], - "signature": "let getMilliseconds: t => int" - }, - { - "id": "Stdlib.Date.getDay", - "kind": "value", - "name": "getDay", - "docstrings": [ - "`getDay(date)`\n\nReturns the day of week of a given date (according to local time).\n0 = Sunday, 1 = Monday, ... 6 = Saturday\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getDay\n// 1\n```" - ], - "signature": "let getDay: t => int" - }, - { - "id": "Stdlib.Date.setFullYear", - "kind": "value", - "name": "setFullYear", - "docstrings": [ - "`setFullYear(date, year)`\n\nSets the year of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYear(2024)\n```" - ], - "signature": "let setFullYear: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setFullYearM", - "kind": "value", - "name": "setFullYearM", - "docstrings": [ - "`setFullYearM(date, ~year, ~month)`\n\nSets the year and month of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYearM(~year=2024, ~month=0)\n```" - ], - "signature": "let setFullYearM: (t, ~year: int, ~month: int) => unit" - }, - { - "id": "Stdlib.Date.setFullYearMD", - "kind": "value", - "name": "setFullYearMD", - "docstrings": [ - "`setFullYearMD(date, ~year, ~month, ~day)`\n\nSets the year, month and date (day of month) of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYearMD(~year=2024, ~month=0, ~day=1)\n```" - ], - "signature": "let setFullYearMD: (t, ~year: int, ~month: int, ~day: int) => unit" - }, - { - "id": "Stdlib.Date.setMonth", - "kind": "value", - "name": "setMonth", - "docstrings": [ - "`setMonth(date, month)`\n\nSets the month of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMonth(0)\n```" - ], - "signature": "let setMonth: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setDate", - "kind": "value", - "name": "setDate", - "docstrings": [ - "`setDate(date, day)`\n\nSets the date (day of month) of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setDate(1)\n```" - ], - "signature": "let setDate: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setHours", - "kind": "value", - "name": "setHours", - "docstrings": [ - "`setHours(date, hours)`\n\nSets the hours of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHours(0)\n```" - ], - "signature": "let setHours: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setHoursM", - "kind": "value", - "name": "setHoursM", - "docstrings": [ - "`setHoursM(date, ~hours, ~minutes)`\n\nSets the hours and minutes of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHoursM(~hours=0, ~minutes=0)\n```" - ], - "signature": "let setHoursM: (t, ~hours: int, ~minutes: int) => unit" - }, - { - "id": "Stdlib.Date.setHoursMS", - "kind": "value", - "name": "setHoursMS", - "docstrings": [ - "`setHoursMS(date, ~hours, ~minutes, ~seconds)`\n\nSets the hours, minutes and seconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHoursMS(~hours=0, ~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setHoursMS: (t, ~hours: int, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setHoursMSMs", - "kind": "value", - "name": "setHoursMSMs", - "docstrings": [ - "`setHoursMSMs(date, ~hours, ~minutes, ~seconds, ~milliseconds)`\n\nSets the hours, minutes, seconds and milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHoursMSMs(\n ~hours=0,\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setHoursMSMs: (\n t,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setMinutes", - "kind": "value", - "name": "setMinutes", - "docstrings": [ - "`setMinutes(date, minutes)`\n\nSets the minutes of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMinutes(0)\n```" - ], - "signature": "let setMinutes: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setMinutesS", - "kind": "value", - "name": "setMinutesS", - "docstrings": [ - "`setMinutesS(date, ~minutes, ~seconds)`\n\nSets the minutes and seconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMinutesS(~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setMinutesS: (t, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setMinutesSMs", - "kind": "value", - "name": "setMinutesSMs", - "docstrings": [ - "`setMinutesSMs(date, ~minutes, ~seconds, ~milliseconds)`\n\nSets the minutes, seconds and milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMinutesSMs(\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setMinutesSMs: (\n t,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setSeconds", - "kind": "value", - "name": "setSeconds", - "docstrings": [ - "`setSeconds(date, seconds)`\n\nSets the seconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setSeconds(0)\n```" - ], - "signature": "let setSeconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setSecondsMs", - "kind": "value", - "name": "setSecondsMs", - "docstrings": [ - "`setSecondsMs(date, ~seconds, ~milliseconds)`\n\nSets the seconds and milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setSecondsMs(~seconds=0, ~milliseconds=0)\n```" - ], - "signature": "let setSecondsMs: (t, ~seconds: int, ~milliseconds: int) => unit" - }, - { - "id": "Stdlib.Date.setMilliseconds", - "kind": "value", - "name": "setMilliseconds", - "docstrings": [ - "`setMilliseconds(date, milliseconds)`\n\nSets the milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMilliseconds(0)\n```" - ], - "signature": "let setMilliseconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.getUTCFullYear", - "kind": "value", - "name": "getUTCFullYear", - "docstrings": [ - "`getUTCFullYear(date)`\n\nReturns the year of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCFullYear // 2022\n```" - ], - "signature": "let getUTCFullYear: t => int" - }, - { - "id": "Stdlib.Date.getUTCMonth", - "kind": "value", - "name": "getUTCMonth", - "docstrings": [ - "`getUTCMonth(date)`\n\nReturns the month of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCMonth // 11\n```" - ], - "signature": "let getUTCMonth: t => int" - }, - { - "id": "Stdlib.Date.getUTCDate", - "kind": "value", - "name": "getUTCDate", - "docstrings": [ - "`getUTCDate(date)`\n\nReturns the date (day of month) of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCDate // 31\n```" - ], - "signature": "let getUTCDate: t => int" - }, - { - "id": "Stdlib.Date.getUTCHours", - "kind": "value", - "name": "getUTCHours", - "docstrings": [ - "`getUTCHours(date)`\n\nReturns the hours of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCHours // 23\n```" - ], - "signature": "let getUTCHours: t => int" - }, - { - "id": "Stdlib.Date.getUTCMinutes", - "kind": "value", - "name": "getUTCMinutes", - "docstrings": [ - "`getUTCMinutes(date)`\n\nReturns the minutes of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCMinutes // 0\n```" - ], - "signature": "let getUTCMinutes: t => int" - }, - { - "id": "Stdlib.Date.getUTCSeconds", - "kind": "value", - "name": "getUTCSeconds", - "docstrings": [ - "`getUTCSeconds(date)`\n\nReturns the seconds of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCSeconds // 0\n```" - ], - "signature": "let getUTCSeconds: t => int" - }, - { - "id": "Stdlib.Date.getUTCMilliseconds", - "kind": "value", - "name": "getUTCMilliseconds", - "docstrings": [ - "`getUTCMilliseconds(date)`\n\nReturns the milliseconds of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCMilliseconds // 0\n```" - ], - "signature": "let getUTCMilliseconds: t => int" - }, - { - "id": "Stdlib.Date.getUTCDay", - "kind": "value", - "name": "getUTCDay", - "docstrings": [ - "`getUTCDay(date)`\n\nReturns the day (day of week) of a given date (according to UTC time).\n0 = Sunday, 1 = Monday, ... 6 = Saturday\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCDay // 6\n```" - ], - "signature": "let getUTCDay: t => int" - }, - { - "id": "Stdlib.Date.setUTCFullYear", - "kind": "value", - "name": "setUTCFullYear", - "docstrings": [ - "`setUTCFullYear(date, year)`\n\nSets the year of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYear(2024)\n```" - ], - "signature": "let setUTCFullYear: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCFullYearM", - "kind": "value", - "name": "setUTCFullYearM", - "docstrings": [ - "`setUTCFullYearM(date, ~year, ~month)`\n\nSets the year and month of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYearM(~year=2024, ~month=0)\n```" - ], - "signature": "let setUTCFullYearM: (t, ~year: int, ~month: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCFullYearMD", - "kind": "value", - "name": "setUTCFullYearMD", - "docstrings": [ - "`setUTCFullYearMD(date, ~year, ~month, ~day)`\n\nSets the year, month and date (day of month) of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYearMD(~year=2024, ~month=0, ~day=1)\n```" - ], - "signature": "let setUTCFullYearMD: (t, ~year: int, ~month: int, ~day: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMonth", - "kind": "value", - "name": "setUTCMonth", - "docstrings": [ - "`setUTCMonth(date, month)`\n\nSets the month of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMonth(0)\n```" - ], - "signature": "let setUTCMonth: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCDate", - "kind": "value", - "name": "setUTCDate", - "docstrings": [ - "`setDate(date, day)`\n\nSets the date (day of month) of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCDate(1)\n```" - ], - "signature": "let setUTCDate: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHours", - "kind": "value", - "name": "setUTCHours", - "docstrings": [ - "`setUTCHours(date, hours)`\n\nSets the hours of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHours(0)\n```" - ], - "signature": "let setUTCHours: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHoursM", - "kind": "value", - "name": "setUTCHoursM", - "docstrings": [ - "`setHoursM(date, ~hours, ~minutes)`\n\nSets the hours and minutes of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHoursM(~hours=0, ~minutes=0)\n```" - ], - "signature": "let setUTCHoursM: (t, ~hours: int, ~minutes: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHoursMS", - "kind": "value", - "name": "setUTCHoursMS", - "docstrings": [ - "`setUTCHoursMS(date, ~hours, ~minutes, ~seconds)`\n\nSets the hours, minutes and seconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHoursMS(~hours=0, ~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setUTCHoursMS: (t, ~hours: int, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHoursMSMs", - "kind": "value", - "name": "setUTCHoursMSMs", - "docstrings": [ - "`setUTCHoursMSMs(date, ~hours, ~minutes, ~seconds, ~milliseconds)`\n\nSets the hours, minutes, seconds and milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHoursMSMs(\n ~hours=0,\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setUTCHoursMSMs: (\n t,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setUTCMinutes", - "kind": "value", - "name": "setUTCMinutes", - "docstrings": [ - "`setUTCMinutes(date, minutes)`\n\nSets the minutes of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMinutes(0)\n```" - ], - "signature": "let setUTCMinutes: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMinutesS", - "kind": "value", - "name": "setUTCMinutesS", - "docstrings": [ - "`setUTCMinutesS(date, ~minutes, ~seconds)`\n\nSets the minutes and seconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMinutesS(~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setUTCMinutesS: (t, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMinutesSMs", - "kind": "value", - "name": "setUTCMinutesSMs", - "docstrings": [ - "`setUTCMinutesSMs(date, ~minutes, ~seconds, ~milliseconds)`\n\nSets the minutes, seconds and milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMinutesSMs(\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setUTCMinutesSMs: (\n t,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setUTCSeconds", - "kind": "value", - "name": "setUTCSeconds", - "docstrings": [ - "`setUTCSeconds(date, seconds)`\n\nSets the seconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCSeconds(0)\n```" - ], - "signature": "let setUTCSeconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCSecondsMs", - "kind": "value", - "name": "setUTCSecondsMs", - "docstrings": [ - "`setUTCSecondsMs(date, ~seconds, ~milliseconds)`\n\nSets the seconds and milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCSecondsMs(~seconds=0, ~milliseconds=0)\n```" - ], - "signature": "let setUTCSecondsMs: (t, ~seconds: int, ~milliseconds: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMilliseconds", - "kind": "value", - "name": "setUTCMilliseconds", - "docstrings": [ - "`setUTCMilliseconds(date, milliseconds)`\n\nSets the milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMilliseconds(0)\n```" - ], - "signature": "let setUTCMilliseconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.toDateString", - "kind": "value", - "name": "toDateString", - "docstrings": [ - "`toDateString(date)`\n\nConverts a JavaScript date to a standard date string. The date will be mapped to the current time zone.\nIf you want to convert it to a localized string, use `Date.toLocaleDateString` instead.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.toDateString->Console.log\n// Sun Jan 01 2023\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toDateString->Console.log\n// Sat Dec 31 2022\n```" - ], - "signature": "let toDateString: t => string" - }, - { - "id": "Stdlib.Date.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(date)`\n\nConverts a JavaScript date to a standard date time string. The date will be mapped to the current time zone.\nIf you want to convert it to a localized string, use `Date.toLocaleString` instead.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.toString->Console.log\n// Sun Jan 01 2023 00:00:00 GMT+0100 (Central European Standard Time)\n\nDate.fromString(\"2023-06-01T00:00:00.00+01:00\")->Date.toString->Console.log\n// Thu Jun 01 2023 01:00:00 GMT+0200 (Central European Summer Time)\n```" - ], - "signature": "let toString: t => string" - }, - { - "id": "Stdlib.Date.toTimeString", - "kind": "value", - "name": "toTimeString", - "docstrings": [ - "`toTimeString(date)`\n\nConverts a JavaScript date to a standard time string. The date will be mapped to the current time zone.\nIf you want to convert it to a localized string, use `Date.toLocaleStimeString` instead.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.toTimeString->Console.log\n// 00:00:00 GMT+0100 (Central European Standard Time)\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toTimeString->Console.log\n// 17:00:00 GMT+0100 (Central European Standard Time)\n```" - ], - "signature": "let toTimeString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleDateString", - "kind": "value", - "name": "toLocaleDateString", - "docstrings": [ - "`toLocaleDateString(date)`\n\nConverts a JavaScript date to a localized date string. It will use the current locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleDateString->Console.log\n// 2/19/2023\n```" - ], - "signature": "let toLocaleDateString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleDateStringWithLocale", - "kind": "value", - "name": "toLocaleDateStringWithLocale", - "docstrings": [ - "`toLocaleDateStringWithLocale(date, locale)`\n\nConverts a JavaScript date to a localized date string. It will use the specified locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleDateStringWithLocale(\"en-US\")->Console.log\n// 2/19/2023\n```" - ], - "signature": "let toLocaleDateStringWithLocale: (t, string) => string" - }, - { - "id": "Stdlib.Date.toLocaleDateStringWithLocaleAndOptions", - "kind": "value", - "name": "toLocaleDateStringWithLocaleAndOptions", - "docstrings": [ - "`toLocaleDateStringWithLocaleAndOptions(date, locale, options)`\n\nConverts a JavaScript date to a localized date string. It will use the specified locale and formatting options.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleDateStringWithLocaleAndOptions(\"en-US\", {dateStyle: #long})->Console.log\n// February 19, 2023\n\nDate.make()\n->Date.toLocaleDateStringWithLocaleAndOptions(\"de\", {hour: #\"2-digit\", minute: #\"2-digit\"})\n->Console.log\n// 19.2.2023, 15:40\n\nDate.make()->Date.toLocaleDateStringWithLocaleAndOptions(\"de\", {year: #numeric})->Console.log\n// 2023\n```" - ], - "signature": "let toLocaleDateStringWithLocaleAndOptions: (t, string, localeOptions) => string" - }, - { - "id": "Stdlib.Date.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(date)`\n\nConverts a JavaScript date to a localized date-time string. It will use the current locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleString->Console.log\n// 2/19/2023, 3:40:00 PM\n```" - ], - "signature": "let toLocaleString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleStringWithLocale", - "kind": "value", - "name": "toLocaleStringWithLocale", - "docstrings": [ - "`toLocaleStringWithLocale(date, locale)`\n\nConverts a JavaScript date to a localized date-time string. It will use the specified locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleStringWithLocale(\"en-US\")->Console.log\n// 2/19/2023, 3:40:00 PM\n```" - ], - "signature": "let toLocaleStringWithLocale: (t, string) => string" - }, - { - "id": "Stdlib.Date.toLocaleStringWithLocaleAndOptions", - "kind": "value", - "name": "toLocaleStringWithLocaleAndOptions", - "docstrings": [ - "`toLocaleStringWithLocaleAndOptions(date, locale, options)`\n\nConverts a JavaScript date to a localized date-time string. It will use the specified locale and formatting options.\n\n## Examples\n```rescript\nDate.make()\n->Date.toLocaleStringWithLocaleAndOptions(\"en\", {dateStyle: #short, timeStyle: #short})\n->Console.log\n// 2/19/23, 3:40 PM\n\nDate.make()\n->Date.toLocaleStringWithLocaleAndOptions(\n \"en\",\n {\n era: #long,\n year: #numeric,\n month: #\"2-digit\",\n day: #\"2-digit\",\n hour: #numeric,\n timeZoneName: #short,\n },\n)\n->Console.log\n// 02/19/2023 Anno Domini, 3 PM GMT+1\n```" - ], - "signature": "let toLocaleStringWithLocaleAndOptions: (t, string, localeOptions) => string" - }, - { - "id": "Stdlib.Date.toLocaleTimeString", - "kind": "value", - "name": "toLocaleTimeString", - "docstrings": [ - "`toLocaleTimeString(date)`\n\nConverts a JavaScript date to a localized time string. It will use the current locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleTimeString->Console.log\n// 3:40:00 PM\n```" - ], - "signature": "let toLocaleTimeString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleTimeStringWithLocale", - "kind": "value", - "name": "toLocaleTimeStringWithLocale", - "docstrings": [ - "`toLocaleTimeStringWithLocale(date, locale)`\n\nConverts a JavaScript date to a localized time string. It will use the specified locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleTimeStringWithLocale(\"en-US\")->Console.log\n// 3:40:00 PM\n```" - ], - "signature": "let toLocaleTimeStringWithLocale: (t, string) => string" - }, - { - "id": "Stdlib.Date.toLocaleTimeStringWithLocaleAndOptions", - "kind": "value", - "name": "toLocaleTimeStringWithLocaleAndOptions", - "docstrings": [ - "`toLocaleTimeStringWithLocaleAndOptions(date, locale, options)`\n\nConverts a JavaScript date to a localized time string. It will use the specified locale and formatting options.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleTimeStringWithLocaleAndOptions(\"en-US\", {timeStyle: #long})->Console.log\n// 3:40:00 PM GMT+1\n\nDate.make()\n->Date.toLocaleTimeStringWithLocaleAndOptions(\"de\", {hour: #\"2-digit\", minute: #\"2-digit\"})\n->Console.log\n// 15:40\n```" - ], - "signature": "let toLocaleTimeStringWithLocaleAndOptions: (t, string, localeOptions) => string" - }, - { - "id": "Stdlib.Date.toISOString", - "kind": "value", - "name": "toISOString", - "docstrings": [ - "`toISOString(date)`\n\nConverts a JavaScript date to a ISO 8601 string (YYYY-MM-DDTHH:mm:ss.sssZ). The date will be mapped to the UTC time.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toISOString->Console.log\n// 2023-01-01T00:00:00.000Z\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toISOString->Console.log\n// 2022-12-31T16:00:00.000Z\n```" - ], - "signature": "let toISOString: t => string" - }, - { - "id": "Stdlib.Date.toUTCString", - "kind": "value", - "name": "toUTCString", - "docstrings": [ - "`toUTCString(date)`\n\nConverts a JavaScript date to date time string. The date will be mapped to the UTC time.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toUTCString->Console.log\n// Sun, 01 Jan 2023 00:00:00 GMT\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toUTCString->Console.log\n// Sat, 31 Dec 2022 16:00:00 GMT\n```" - ], - "signature": "let toUTCString: t => string" - }, - { - "id": "Stdlib.Date.toJSON", - "kind": "value", - "name": "toJSON", - "docstrings": [ - "`toJSON(date)`\n\nConverts a JavaScript date to a string.\nIf the date is valid, the function will return the same result as `Date.toISOString`.\nInvalid dates will return `None`.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toJSON\n// Some(\"2023-01-01T00:00:00.000Z\")\n\nDate.fromString(\"\")->Date.toJSON\n// None\n```" - ], - "signature": "let toJSON: t => option" - }, - { - "id": "Stdlib.Date.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(date)` ignores the provided date and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/dataview": { - "id": "Stdlib.DataView", - "name": "DataView", - "docstrings": [ - "Functions for interacting with DataView.\n\nSee [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN." - ], - "items": [ - { - "id": "Stdlib.DataView.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a DataView." - ], - "signature": "type t" - }, - { - "id": "Stdlib.DataView.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer(buffer)` creates a DataView for the entire ArrayBuffer.\n\nSee [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN.\n\n## Examples\n\n```rescript\nDataView.fromBuffer(ArrayBuffer.make(16))\nDataView.fromBuffer(ArrayBuffer.make(16), ~byteOffset=4)\nDataView.fromBuffer(ArrayBuffer.make(16), ~byteOffset=4, ~length=8)\n```" - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.DataView.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd(buffer, ~byteOffset)` creates a DataView starting at a given byte offset. See [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN.\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.\n\n## Examples\n\n```rescript\nDataView.fromBufferToEnd(buffer, ~byteOffset=4)\n```" - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.DataView.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange(buffer, ~byteOffset, ~length)` creates a DataView for a specific byte range.\n\nSee [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN.\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.\n\n## Examples\n\n```rescript\nDataView.fromBufferWithRange(ArrayBuffer.make(16), ~byteOffset=2, ~length=8)\n```" - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.DataView.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [ - "`buffer(dataView)` returns the underlying ArrayBuffer referenced by this DataView.\n\nSee [`DataView.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/buffer) on MDN.\n\n## Examples\n\n```rescript\nlet array_buffer = ArrayBuffer.make(16)\nlet dv = DataView.fromBuffer(array_buffer)\nDataView.buffer(dv) == array_buffer\n```" - ], - "signature": "let buffer: t => ArrayBuffer.t" - }, - { - "id": "Stdlib.DataView.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [ - "`byteLength(dataView)` returns the length (in bytes) of this DataView.\n\nSee [`DataView.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet array_buffer = ArrayBuffer.make(16)\nlet dv = DataView.fromBuffer(array_buffer)\nDataView.byteLength(dv) == 16\n```" - ], - "signature": "let byteLength: t => int" - }, - { - "id": "Stdlib.DataView.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [ - "`byteOffset(dataView)` returns the byte offset of this DataView from the start of its ArrayBuffer.\n\nSee [`DataView.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/byteOffset) on MDN.\n\n## Examples\n\n```rescript\nlet array_buffer = ArrayBuffer.make(16)\nlet dv = DataView.fromBuffer(array_buffer, ~byteOffset=4)\nDataView.byteOffset(dv) == 4\n```" - ], - "signature": "let byteOffset: t => int" - }, - { - "id": "Stdlib.DataView.getInt8", - "kind": "value", - "name": "getInt8", - "docstrings": [ - "`getInt8(dataView, offset)` reads an 8-bit signed integer at the specified byte offset.\n\nSee [`DataView.getInt8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setInt8(0, -12)\nDataView.getInt8(dv, 0) == -12\n```" - ], - "signature": "let getInt8: (t, int) => int" - }, - { - "id": "Stdlib.DataView.getUint8", - "kind": "value", - "name": "getUint8", - "docstrings": [ - "`getUint8(dataView, offset)` reads an 8-bit unsigned integer at the specified byte offset.\n\nSee [`DataView.getUint8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setUint8(1, 255)\nDataView.getUint8(dv, 1) == 255\n```" - ], - "signature": "let getUint8: (t, int) => int" - }, - { - "id": "Stdlib.DataView.getInt16", - "kind": "value", - "name": "getInt16", - "docstrings": [ - "`getInt16(dataView, offset, ~littleEndian=?)` reads a 16-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getInt16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setInt16(0, -1234)\ndv->DataView.setInt16(2, -1234, ~littleEndian=true)\nDataView.getInt16(dv, 0) == -1234\nDataView.getInt16(dv, 2, ~littleEndian=true) == -1234\n```" - ], - "signature": "let getInt16: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getUint16", - "kind": "value", - "name": "getUint16", - "docstrings": [ - "`getUint16(dataView, offset, ~littleEndian=?)` reads a 16-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getUint16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setUint16(0, 1234)\ndv->DataView.setUint16(2, 1234, ~littleEndian=true)\nDataView.getUint16(dv, 0) == 1234\nDataView.getUint16(dv, 2, ~littleEndian=true) == 1234\n```" - ], - "signature": "let getUint16: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getInt32", - "kind": "value", - "name": "getInt32", - "docstrings": [ - "`getInt32(dataView, offset, ~littleEndian=?)` reads a 32-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getInt32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setInt32(0, -123456)\ndv->DataView.setInt32(4, -123456, ~littleEndian=true)\nDataView.getInt32(dv, 0) == -123456\nDataView.getInt32(dv, 4, ~littleEndian=true) == -123456\n```" - ], - "signature": "let getInt32: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getUint32", - "kind": "value", - "name": "getUint32", - "docstrings": [ - "`getUint32(dataView, offset, ~littleEndian=?)` reads a 32-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getUint32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setUint32(0, 123456)\ndv->DataView.setUint32(4, 123456, ~littleEndian=true)\nDataView.getUint32(dv, 0) == 123456\nDataView.getUint32(dv, 4, ~littleEndian=true) == 123456\n```" - ], - "signature": "let getUint32: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getFloat16", - "kind": "value", - "name": "getFloat16", - "docstrings": [ - "`getFloat16(dataView, offset, ~littleEndian=?)` reads a 16-bit floating point number (if supported) at the specified byte offset, with optional endianness.\n\nSee [`DataView.getFloat16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat16) on MDN.\n\n## Examples\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setFloat16(0, 1.5)\ndv->DataView.setFloat16(2, 1.5, ~littleEndian=true)\nDataView.getFloat16(dv, 0) == 1.5\nDataView.getFloat16(dv, 2, ~littleEndian=true) == 1.5\n```" - ], - "signature": "let getFloat16: (t, int, ~littleEndian: bool=?) => float" - }, - { - "id": "Stdlib.DataView.getFloat32", - "kind": "value", - "name": "getFloat32", - "docstrings": [ - "`getFloat32(dataView, offset, ~littleEndian=?)` reads a 32-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.getFloat32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setFloat32(0, 3.14)\ndv->DataView.setFloat32(4, 3.14, ~littleEndian=true)\n// DataView.getFloat32(dv, 0) == 3.14\n// DataView.getFloat32(dv, 4, ~littleEndian=true) == 3.14\n```" - ], - "signature": "let getFloat32: (t, int, ~littleEndian: bool=?) => float" - }, - { - "id": "Stdlib.DataView.getFloat64", - "kind": "value", - "name": "getFloat64", - "docstrings": [ - "`getFloat64(dataView, offset, ~littleEndian=?)` reads a 64-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.getFloat64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setFloat64(0, 6.28)\ndv->DataView.setFloat64(8, 6.28, ~littleEndian=true)\nDataView.getFloat64(dv, 0) == 6.28\nDataView.getFloat64(dv, 8, ~littleEndian=true) == 6.28\n```" - ], - "signature": "let getFloat64: (t, int, ~littleEndian: bool=?) => float" - }, - { - "id": "Stdlib.DataView.getBigInt64", - "kind": "value", - "name": "getBigInt64", - "docstrings": [ - "`getBigInt64(dataView, offset, ~littleEndian=?)` reads a 64-bit signed integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.getBigInt64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getBigInt64) on MDN.\n\n## Examples\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setBigInt64(0, -123456789n)\ndv->DataView.setBigInt64(8, -123456789n, ~littleEndian=true)\nDataView.getBigInt64(dv, 0) == -123456789n\nDataView.getBigInt64(dv, 8, ~littleEndian=true) == -123456789n\n```" - ], - "signature": "let getBigInt64: (t, int, ~littleEndian: bool=?) => bigint" - }, - { - "id": "Stdlib.DataView.getBigUint64", - "kind": "value", - "name": "getBigUint64", - "docstrings": [ - "`getBigUint64(dataView, offset, ~littleEndian=?)` reads a 64-bit unsigned integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.getBigUint64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getBigUint64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setBigUint64(0, 123456789n)\ndv->DataView.setBigUint64(8, 123456789n, ~littleEndian=true)\nDataView.getBigUint64(dv, 0) == 123456789n\nDataView.getBigUint64(dv, 8, ~littleEndian=true) == 123456789n\n```" - ], - "signature": "let getBigUint64: (t, int, ~littleEndian: bool=?) => bigint" - }, - { - "id": "Stdlib.DataView.setInt8", - "kind": "value", - "name": "setInt8", - "docstrings": [ - "`setInt8(dataView, offset, value)` writes an 8-bit signed integer at the specified byte offset.\n\nSee [`DataView.setInt8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setInt8(dv, 0, -12)\ndv->DataView.getInt8(0) == -12\n```" - ], - "signature": "let setInt8: (t, int, int) => unit" - }, - { - "id": "Stdlib.DataView.setUint8", - "kind": "value", - "name": "setUint8", - "docstrings": [ - "`setUint8(dataView, offset, value)` writes an 8-bit unsigned integer at the specified byte offset.\n\nSee [`DataView.setUint8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setUint8(dv, 0, 255)\ndv->DataView.getUint8(0) == 255\n```" - ], - "signature": "let setUint8: (t, int, int) => unit" - }, - { - "id": "Stdlib.DataView.setInt16", - "kind": "value", - "name": "setInt16", - "docstrings": [ - "`setInt16(dataView, offset, value, ~littleEndian=?)` writes a 16-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setInt16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setInt16(dv, 0, -1234)\nDataView.setInt16(dv, 2, -1234, ~littleEndian=true)\ndv->DataView.getInt16(0) == -1234\ndv->DataView.getInt16(2, ~littleEndian=true) == -1234\n```" - ], - "signature": "let setInt16: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setUint16", - "kind": "value", - "name": "setUint16", - "docstrings": [ - "`setUint16(dataView, offset, value, ~littleEndian=?)` writes a 16-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setUint16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setUint16(dv, 0, 1234)\nDataView.setUint16(dv, 2, 1234, ~littleEndian=true)\ndv->DataView.getUint16(0) == 1234\ndv->DataView.getUint16(2, ~littleEndian=true) == 1234\n```" - ], - "signature": "let setUint16: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setInt32", - "kind": "value", - "name": "setInt32", - "docstrings": [ - "`setInt32(dataView, offset, value, ~littleEndian=?)` writes a 32-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setInt32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setInt32(dv, 0, -123456)\nDataView.setInt32(dv, 4, -123456, ~littleEndian=true)\ndv->DataView.getInt32(0) == -123456\ndv->DataView.getInt32(4, ~littleEndian=true) == -123456\n```" - ], - "signature": "let setInt32: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setUint32", - "kind": "value", - "name": "setUint32", - "docstrings": [ - "`setUint32(dataView, offset, value, ~littleEndian=?)` writes a 32-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setUint32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setUint32(dv, 0, 123456)\nDataView.setUint32(dv, 4, 123456, ~littleEndian=true)\ndv->DataView.getUint32(0) == 123456\ndv->DataView.getUint32(4, ~littleEndian=true) == 123456\n```" - ], - "signature": "let setUint32: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setFloat16", - "kind": "value", - "name": "setFloat16", - "docstrings": [ - "`setFloat16(dataView, offset, value, ~littleEndian=?)` writes a 16-bit floating point number (if supported) at the specified byte offset, with optional endianness.\n\nSee [`DataView.setFloat16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setFloat16(dv, 0, 1.5)\nDataView.setFloat16(dv, 2, 1.5, ~littleEndian=true)\ndv->DataView.getFloat16(0) == 1.5\ndv->DataView.getFloat16(2, ~littleEndian=true) == 1.5\n```" - ], - "signature": "let setFloat16: (t, int, float, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setFloat32", - "kind": "value", - "name": "setFloat32", - "docstrings": [ - "`setFloat32(dataView, offset, value, ~littleEndian=?)` writes a 32-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.setFloat32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setFloat32(dv, 0, 3.14)\nDataView.setFloat32(dv, 4, 3.14, ~littleEndian=true)\n// dv->DataView.getFloat32(0) == 3.14\n// dv->DataView.getFloat32(4, ~littleEndian=true) == 3.14\n```" - ], - "signature": "let setFloat32: (t, int, float, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setFloat64", - "kind": "value", - "name": "setFloat64", - "docstrings": [ - "`setFloat64(dataView, offset, value, ~littleEndian=?)` writes a 64-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.setFloat64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setFloat64(dv, 0, 6.28)\nDataView.setFloat64(dv, 8, 6.28, ~littleEndian=true)\ndv->DataView.getFloat64(0) == 6.28\ndv->DataView.getFloat64(8, ~littleEndian=true) == 6.28\n```" - ], - "signature": "let setFloat64: (t, int, float, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setBigInt64", - "kind": "value", - "name": "setBigInt64", - "docstrings": [ - "`setBigInt64(dataView, offset, value, ~littleEndian=?)` writes a 64-bit signed integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.setBigInt64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setBigInt64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setBigInt64(dv, 0, -123456789n)\nDataView.setBigInt64(dv, 8, -123456789n, ~littleEndian=true)\ndv->DataView.getBigInt64(0) == -123456789n\ndv->DataView.getBigInt64(8, ~littleEndian=true) == -123456789n\n```" - ], - "signature": "let setBigInt64: (t, int, bigint, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setBigUint64", - "kind": "value", - "name": "setBigUint64", - "docstrings": [ - "`setBigUint64(dataView, offset, value, ~littleEndian=?)` writes a 64-bit unsigned integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.setBigUint64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setBigUint64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setBigUint64(dv, 0, 123456789n)\nDataView.setBigUint64(dv, 8, 123456789n, ~littleEndian=true)\ndv->DataView.getBigUint64(0) == 123456789n\ndv->DataView.getBigUint64(8, ~littleEndian=true) == 123456789n\n```" - ], - "signature": "let setBigUint64: (t, int, bigint, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(dataView)` ignores the provided DataView and returns unit.\n\nThis helper is useful when you want to discard a value (for example, the result of an operation with side effects) without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/console": { - "id": "Stdlib.Console", - "name": "Console", - "docstrings": [ - "Functions for interacting with JavaScript console.\n\nSee: [`console`](https://developer.mozilla.org/en-US/docs/Web/API/Console)." - ], - "items": [ - { - "id": "Stdlib.Console.assert_", - "kind": "value", - "name": "assert_", - "docstrings": [ - "`assert_(assertion, value)` print a message to console if `assertion` evaluates `false`. Does nothing if it's `true`.\n\nSee [`console.assert`](https://developer.mozilla.org/en-US/docs/Web/API/console/assert)\non MDN.\n\n## Examples\n\n```rescript\nConsole.assert_(false, \"Hello World!\")\nConsole.assert_(42 === 42, \"The answer\")\n```" - ], - "signature": "let assert_: (bool, 'a) => unit" - }, - { - "id": "Stdlib.Console.assert2", - "kind": "value", - "name": "assert2", - "docstrings": [ - "`assert2(v1, v2)`. Like `assert_`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.assert2(false, \"Hello\", \"World\")\nConsole.assert2(42 === 42, [1, 2, 3], '4')\n```" - ], - "signature": "let assert2: (bool, 'a, 'b) => unit" - }, - { - "id": "Stdlib.Console.assert3", - "kind": "value", - "name": "assert3", - "docstrings": [ - "`assert3(v1, v2, v3)`. Like `assert_`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.assert3(false, \"Hello\", \"World\", \"ReScript\")\nConsole.assert3(42 === 42, \"One\", 2, #3)\n```" - ], - "signature": "let assert3: (bool, 'a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.assert4", - "kind": "value", - "name": "assert4", - "docstrings": [ - "`assert4(v1, v2, v3, v4)`. Like `assert_`, but with four arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert4(false, \"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.assert4(value === 42, [1, 2], (3, 4), [#5, #6], #polyvar)\n```" - ], - "signature": "let assert4: (bool, 'a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.assert5", - "kind": "value", - "name": "assert5", - "docstrings": [ - "`assert5(v1, v2, v3, v4, v5)`. Like `assert_`, but with five arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert5(false, \"Hello\", \"World\", \"JS\", '!', '!')\nConsole.assert5(value === 42, [1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let assert5: (bool, 'a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.assert6", - "kind": "value", - "name": "assert6", - "docstrings": [ - "`assert6(v1, v2)`. Like `assert_`, but with six arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert6(false, \"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.assert6(value === 42, [1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let assert6: (bool, 'a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.assertMany", - "kind": "value", - "name": "assertMany", - "docstrings": [ - "`assertMany(assertion, arr)`. Like `assert_`, but variadic.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assertMany(false, [\"Hello\", \"World\"])\nConsole.assertMany(value === 42, [1, 2, 3])\n```" - ], - "signature": "let assertMany: (bool, array<'a>) => unit" - }, - { - "id": "Stdlib.Console.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "`clear()` clears the console, if allowed.\n\nSee [`console.clear`](https://developer.mozilla.org/en-US/docs/Web/API/console/clear)\non MDN.\n\n## Examples\n\n```rescript\nConsole.clear()\n```" - ], - "signature": "let clear: unit => unit" - }, - { - "id": "Stdlib.Console.count", - "kind": "value", - "name": "count", - "docstrings": [ - "`count(label)` prints to the console the number of times it's been called with the given label.\n\nSee [`console.count`](https://developer.mozilla.org/en-US/docs/Web/API/console/count)\non MDN.\n\n## Examples\n\n```rescript\nConsole.count(\"rescript\")\n```" - ], - "signature": "let count: string => unit" - }, - { - "id": "Stdlib.Console.countReset", - "kind": "value", - "name": "countReset", - "docstrings": [ - "`countReset(label)` resets the count for the given label to 0.\n\nSee [`console.countReset`](https://developer.mozilla.org/en-US/docs/Web/API/console/countReset)\non MDN.\n\n## Examples\n\n```rescript\nConsole.countReset(\"rescript\")\n```" - ], - "signature": "let countReset: string => unit" - }, - { - "id": "Stdlib.Console.debug", - "kind": "value", - "name": "debug", - "docstrings": [ - "`debug(value)` print a debug message to console.\n\nSee [`console.debug`](https://developer.mozilla.org/en-US/docs/Web/API/console/debug)\non MDN.\n\n## Examples\n\n```rescript\nConsole.debug(\"Hello\")\nlet obj = {\"name\": \"ReScript\", \"version\": 10}\nConsole.debug(obj)\n```" - ], - "signature": "let debug: 'a => unit" - }, - { - "id": "Stdlib.Console.debug2", - "kind": "value", - "name": "debug2", - "docstrings": [ - "`debug2(v1, v2)`. Like `debug`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.debug2(\"Hello\", \"World\")\nConsole.debug2([1, 2, 3], '4')\n```" - ], - "signature": "let debug2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.debug3", - "kind": "value", - "name": "debug3", - "docstrings": [ - "`debug3(v1, v2, v3)`. Like `debug`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.debug3(\"Hello\", \"World\", \"ReScript\")\nConsole.debug3(\"One\", 2, #3)\n```" - ], - "signature": "let debug3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.debug4", - "kind": "value", - "name": "debug4", - "docstrings": [ - "`debug4(v1, v2, v3, v4)`. Like `debug`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.debug4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.debug4([1, 2], (3, 4), [#5, #6], #polyvar)\n```" - ], - "signature": "let debug4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.debug5", - "kind": "value", - "name": "debug5", - "docstrings": [ - "`debug5(v1, v2, v3, v4, v5)`. Like `debug`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.debug5(\"Hello\", \"World\", \"JS\", '!', '!')\nConsole.debug5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let debug5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.debug6", - "kind": "value", - "name": "debug6", - "docstrings": [ - "`debug6(v1, v2, v3, v4, v5, v6)`. Like `debug`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.debug6(\"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.debug6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let debug6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.debugMany", - "kind": "value", - "name": "debugMany", - "docstrings": [ - "`debugMany(arr)`. Like `debug`, but variadic.\n\n## Examples\n\n```rescript\nConsole.debugMany([\"Hello\", \"World\"])\nConsole.debugMany([1, 2, 3])\n```" - ], - "signature": "let debugMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.dirOptions", - "kind": "type", - "name": "dirOptions", - "docstrings": [], - "signature": "type dirOptions = {\n colors?: bool,\n depth?: Nullable.t,\n showHidden?: bool,\n}" - }, - { - "id": "Stdlib.Console.dir", - "kind": "value", - "name": "dir", - "docstrings": [ - "`dir(object, options)` displays an interactive view of the object in the console.\n\nSee [`console.dir`](https://developer.mozilla.org/en-US/docs/Web/API/console/dir)\non MDN.\n\n## Examples\n\n```rescript\nConsole.dir({\"language\": \"rescript\", \"version\": \"10.1.2\"})\nConsole.dir(\n {\"language\": \"rescript\", \"version\": {\"major\": \"10\", \"minor\": \"1\", \"patch\": \"2\"}},\n ~options={depth: null},\n)\n```" - ], - "signature": "let dir: ('a, ~options: dirOptions=?) => unit" - }, - { - "id": "Stdlib.Console.dirxml", - "kind": "value", - "name": "dirxml", - "docstrings": [ - "`dirxml(object)` displays an interactive tree view of an XML/HTML element in the console.\n\nSee [`console.dirxml`](https://developer.mozilla.org/en-US/docs/Web/API/console/dirxml)\non MDN." - ], - "signature": "let dirxml: 'a => unit" - }, - { - "id": "Stdlib.Console.error", - "kind": "value", - "name": "error", - "docstrings": [ - "`error(value)` prints an error message to console.\n\nSee [`console.error`](https://developer.mozilla.org/en-US/docs/Web/API/console/error)\non MDN.\n\n## Examples\n\n```rescript\nConsole.error(\"error message\")\nConsole.error((\"error\", \"invalid value\"))\n```" - ], - "signature": "let error: 'a => unit" - }, - { - "id": "Stdlib.Console.error2", - "kind": "value", - "name": "error2", - "docstrings": [ - "`error(v1, v2)`. Like `error`, but two arguments.\n\n## Examples\n\n```rescript\nConsole.error2(\"Error\", \"here\")\nConsole.error2((\"log\", \"error\"), \"message\")\n```" - ], - "signature": "let error2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.error3", - "kind": "value", - "name": "error3", - "docstrings": [ - "`error3(v1, v2, v3)`. Like `error`, but three arguments.\n\n## Examples\n\n```rescript\nConsole.error3(\"Hello\", \"World\", \"!!!\")\nConsole.error3(#first, #second, #third)\n```" - ], - "signature": "let error3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.error4", - "kind": "value", - "name": "error4", - "docstrings": [ - "`error4(v1, v2, v3, v4)`. Like `error`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.error4(\"Hello\", \"World\", \"ReScript\", '!')\nConsole.error4(#first, #second, #third, \"fourth\")\n```" - ], - "signature": "let error4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.error5", - "kind": "value", - "name": "error5", - "docstrings": [ - "`error5(v1, v2, v3, v4, v5)`. Like `error`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.error5('e', 'r', 'r', 'o', 'r')\nConsole.error5(1, #second, #third, \"fourth\", 'c')\n```" - ], - "signature": "let error5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.error6", - "kind": "value", - "name": "error6", - "docstrings": [ - "`error6(v1, v2, v3, v4, v5, v6)`. Like `error`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.error6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.error6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let error6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.group", - "kind": "value", - "name": "group", - "docstrings": [ - "`group(label)` creates a new \"group\" level with the given label.\n\nSee [`console.group`](https://developer.mozilla.org/en-US/docs/Web/API/console/group)\non MDN.\n\n## Example\n\n```rescript\nConsole.group(\"first group\")\nConsole.group(\"second group\")\nConsole.log(\"a message on the second level\")\nConsole.groupEnd()\nConsole.log(\"a message message on the first level\")\nConsole.groupEnd()\n```" - ], - "signature": "let group: string => unit" - }, - { - "id": "Stdlib.Console.groupCollapsed", - "kind": "value", - "name": "groupCollapsed", - "docstrings": [ - "`groupCollapsed(label)`. Like `group` but collapses the group initially.\n\nSee [`console.groupCollapsed`](https://developer.mozilla.org/en-US/docs/Web/API/console/groupCollapsed)\non MDN." - ], - "signature": "let groupCollapsed: string => unit" - }, - { - "id": "Stdlib.Console.groupEnd", - "kind": "value", - "name": "groupEnd", - "docstrings": [ - "`groupEnd()` ends the current group.\n\nSee [`console.groupEnd`](https://developer.mozilla.org/en-US/docs/Web/API/console/groupEnd)\non MDN." - ], - "signature": "let groupEnd: unit => unit" - }, - { - "id": "Stdlib.Console.errorMany", - "kind": "value", - "name": "errorMany", - "docstrings": [ - "`errorMany(arr)`. Like `error`, but variadic.\n\n## Examples\n\n```rescript\nConsole.errorMany([\"Hello\", \"World\"])\nConsole.errorMany([1, 2, 3])\n```" - ], - "signature": "let errorMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.info", - "kind": "value", - "name": "info", - "docstrings": [ - "`info(value)` print an informational message to console.\n\nSee [`console.info`](https://developer.mozilla.org/en-US/docs/Web/API/console/info)\non MDN.\n\n## Examples\n\n```rescript\nConsole.info(\"Information\")\nConsole.info((\"Hello\", \"JS\"))\n```" - ], - "signature": "let info: 'a => unit" - }, - { - "id": "Stdlib.Console.info2", - "kind": "value", - "name": "info2", - "docstrings": [ - "`info2(v1, v2)`. Like `info`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.info2(\"Info\", \"failed to download\")\nConsole.info2(#info, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let info2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.info3", - "kind": "value", - "name": "info3", - "docstrings": [ - "`info3(v1, v2, v3)`. Like `info`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.info3(\"Hello\", \"World\", \"ReScript\")\nConsole.info3([1, 2, 3], #4, #5)\n```" - ], - "signature": "let info3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.info4", - "kind": "value", - "name": "info4", - "docstrings": [ - "`info4(v1, v2, v3, v4)`. Like `info`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.info4(\"Hello\", \"World\", \"ReScript\", '!')\nConsole.info4([1, 2, 3], #4, #5, #lastinfo)\n```" - ], - "signature": "let info4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.info5", - "kind": "value", - "name": "info5", - "docstrings": [ - "`info5(v1, v2, v3, v4, v5)`. Like `info`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.info5(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\")\nConsole.info5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let info5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.info6", - "kind": "value", - "name": "info6", - "docstrings": [ - "`info6(v1, v2, v3, v4, v5, v6)`. Like `info`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.info6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.info6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let info6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.infoMany", - "kind": "value", - "name": "infoMany", - "docstrings": [ - "`infoMany(arr)`. Like `info`, but variadic.\n\n## Examples\n\n```rescript\nConsole.infoMany([\"Hello\", \"World\"])\nConsole.infoMany([1, 2, 3])\n```" - ], - "signature": "let infoMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.log", - "kind": "value", - "name": "log", - "docstrings": [ - "`log(value)` print a message to console.\n\nSee [`console.log`](https://developer.mozilla.org/en-US/docs/Web/API/console/log)\non MDN.\n\n## Examples\n\n```rescript\nConsole.log(\"Hello\")\nlet obj = {\"name\": \"ReScript\", \"version\": 10}\nConsole.log(obj)\n```" - ], - "signature": "let log: 'a => unit" - }, - { - "id": "Stdlib.Console.log2", - "kind": "value", - "name": "log2", - "docstrings": [ - "`log2(v1, v2)`. Like `log`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.log2(\"Hello\", \"World\")\nConsole.log2([1, 2, 3], '4')\n```" - ], - "signature": "let log2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.log3", - "kind": "value", - "name": "log3", - "docstrings": [ - "`log3(v1, v2, v3)`. Like `log`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.log3(\"Hello\", \"World\", \"ReScript\")\nConsole.log3(\"One\", 2, #3)\n```" - ], - "signature": "let log3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.log4", - "kind": "value", - "name": "log4", - "docstrings": [ - "`log4(v1, v2, v3, v4)`. Like `log`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.log4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.log4([1, 2], (3, 4), [#5, #6], #polyvar)\n```" - ], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.log5", - "kind": "value", - "name": "log5", - "docstrings": [ - "`log5(v1, v2, v3, v4, v5)`. Like `log`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.log5(\"Hello\", \"World\", \"JS\", '!', '!')\nConsole.log5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let log5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.log6", - "kind": "value", - "name": "log6", - "docstrings": [ - "`log6(v1, v2, v3, v4, v5, v6)`. Like `log`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.log6(\"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.log6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let log6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.logMany", - "kind": "value", - "name": "logMany", - "docstrings": [ - "`logMany(arr)`. Like `log`, but variadic.\n\n## Examples\n\n```rescript\nConsole.logMany([\"Hello\", \"World\"])\nConsole.logMany([1, 2, 3])\n```" - ], - "signature": "let logMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.table", - "kind": "value", - "name": "table", - "docstrings": [ - "`table(object)` displays an tabular view of the object in the console.\n\nSee [`console.table`](https://developer.mozilla.org/en-US/docs/Web/API/console/table)\non MDN.\n\n## Examples\n\n```rescript\nConsole.table({\"language\": \"rescript\", \"version\": \"10.1.2\"})\n```" - ], - "signature": "let table: 'a => unit" - }, - { - "id": "Stdlib.Console.time", - "kind": "value", - "name": "time", - "docstrings": [ - "`time(label)` creates a timer to measure how long an operation takes. `label`\nmust be a unique name. Call `console.timeEnd` with the same `label` to print\noutput time.\n\nSee [`console.time`](https://developer.mozilla.org/en-US/docs/Web/API/console/time)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let time: string => unit" - }, - { - "id": "Stdlib.Console.timeEnd", - "kind": "value", - "name": "timeEnd", - "docstrings": [ - "`timeEnd(label)` stops a timer created by `time`.\n\nSee [`console.timeEnd`](https://developer.mozilla.org/en-US/docs/Web/API/console/timeEnd)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let timeEnd: string => unit" - }, - { - "id": "Stdlib.Console.timeLog", - "kind": "value", - "name": "timeLog", - "docstrings": [ - "`timeLog(label)` prints the current elapsed time of the given timer to the console.\n\nSee [`console.timeLog`](https://developer.mozilla.org/en-US/docs/Web/API/console/timeLog)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let timeLog: string => unit" - }, - { - "id": "Stdlib.Console.trace", - "kind": "value", - "name": "trace", - "docstrings": [ - "`trace()` print a stack trace to console.\n\nSee [`console.trace`](https://developer.mozilla.org/en-US/docs/Web/API/console/trace)\non MDN.\n\n## Examples\n\n```rescript\nlet main = () => {\n Console.trace()\n}\nmain()\n// In the console, the following trace will be displayed:\n// main\n// \n```" - ], - "signature": "let trace: unit => unit" - }, - { - "id": "Stdlib.Console.warn", - "kind": "value", - "name": "warn", - "docstrings": [ - "`warn(value)` print a warning message to console.\n\nSee [`console.warn`](https://developer.mozilla.org/en-US/docs/Web/API/console/warn)\non MDN.\n\n## Examples\n\n```rescript\nConsole.warn(\"Warning\")\nConsole.warn((\"Warning\", \"invalid number\"))\n```" - ], - "signature": "let warn: 'a => unit" - }, - { - "id": "Stdlib.Console.warn2", - "kind": "value", - "name": "warn2", - "docstrings": [ - "`warn2(v1, v2)`. Like `warn`, but two arguments.\n\n## Examples\n\n```rescript\nConsole.warn2(\"Hello\", \"World\")\nConsole.warn2([1, 2, 3], 4)\n```" - ], - "signature": "let warn2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.warn3", - "kind": "value", - "name": "warn3", - "docstrings": [ - "`warn3(v1, v2, v3)`. Like `warn`, but three arguments.\n\n## Examples\n\n```rescript\nConsole.warn3(\"Hello\", \"World\", \"ReScript\")\nConsole.warn3([1, 2, 3], #4, #5)\n```" - ], - "signature": "let warn3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.warn4", - "kind": "value", - "name": "warn4", - "docstrings": [ - "`warn4(v1, v2, v3, v4)`. Like `warn`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.warn4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.warn4(#first, #second, #third, \"fourth\")\n```" - ], - "signature": "let warn4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.warn5", - "kind": "value", - "name": "warn5", - "docstrings": [ - "`warn5(v1, v2, v3, v4, v5)`. Like `warn`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.warn5(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\")\nConsole.warn5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let warn5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.warn6", - "kind": "value", - "name": "warn6", - "docstrings": [ - "`warn6(v1, v2, v3, v4, v5, v6)`. Like `warn`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.warn6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.warn6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let warn6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.warnMany", - "kind": "value", - "name": "warnMany", - "docstrings": [ - "`warnMany(arr)`. Like `warn`, but variadic.\n\n## Examples\n\n```rescript\nConsole.warnMany([\"Hello\", \"World\"])\nConsole.warnMany([1, 2, 3])\n```" - ], - "signature": "let warnMany: array<'a> => unit" - } - ] - }, - "stdlib/bool": { - "id": "Stdlib.Bool", - "name": "Bool", - "docstrings": [ - "Functions for interacting with JavaScript booleans.\nSee: [`Boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)" - ], - "items": [ - { - "id": "Stdlib.Bool.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a boolean." - ], - "signature": "type t = bool" - }, - { - "id": "Stdlib.Bool.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts a boolean to a string.\n\n## Examples\n```rescript\nBool.toString(true) == \"true\"\nBool.toString(false) == \"false\"\n```" - ], - "signature": "let toString: bool => string" - }, - { - "id": "Stdlib.Bool.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Converts a string to a boolean.\n\n## Examples\n```rescript\nBool.fromString(\"true\") == Some(true)\nBool.fromString(\"false\") == Some(false)\nBool.fromString(\"notAValidBoolean\") == None\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.Bool.fromStringOrThrow", - "kind": "value", - "name": "fromStringOrThrow", - "docstrings": [ - "Converts a string to a boolean.\nThrows an `Invalid_argument` exception if the string is not a valid boolean.\n\n## Examples\n```rescript\nBool.fromStringOrThrow(\"true\") == true\nBool.fromStringOrThrow(\"false\") == false\nswitch Bool.fromStringOrThrow(\"notAValidBoolean\") {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let fromStringOrThrow: string => bool" - }, - { - "id": "Stdlib.Bool.fromStringExn", - "kind": "value", - "name": "fromStringExn", - "docstrings": [ - "Converts a string to a boolean.\nBeware, this function will throw an `Invalid_argument` exception\nif the string is not a valid boolean.\n\n## Examples\n```rescript\nBool.fromStringExn(\"true\") == true\nBool.fromStringExn(\"false\") == false\nswitch Bool.fromStringExn(\"notAValidBoolean\") {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let fromStringExn: string => bool", - "deprecated": "" - }, - { - "id": "Stdlib.Bool.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "Compares two booleans, returns an `Ordering.t` value.\n\n## Examples\n```rescript\nBool.compare(true, true) == Ordering.equal\nBool.compare(false, false) == Ordering.equal\nBool.compare(true, false) == Ordering.greater\nBool.compare(false, true) == Ordering.less\n```" - ], - "signature": "let compare: (bool, bool) => Ordering.t" - }, - { - "id": "Stdlib.Bool.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "Checks if two booleans are equal and have the same value.\n\n## Examples\n```rescript\nBool.equal(true, true) == true\nBool.equal(false, false) == true\nBool.equal(true, false) == false\nBool.equal(false, true) == false\n```" - ], - "signature": "let equal: (bool, bool) => bool" - } - ] - }, - "stdlib/bigint": { - "id": "Stdlib.BigInt", - "name": "BigInt", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigInt.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a bigint." - ], - "signature": "type t = bigint" - }, - { - "id": "Stdlib.BigInt.asIntN", - "kind": "value", - "name": "asIntN", - "docstrings": [ - "`asIntN(~width, bigint)` returns a bigint value truncated to the given number of bits as a signed integer.\n\nSee [`BigInt.asIntN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/asIntN) on MDN.\n\n## Examples\n\n```rescript\nBigInt.asIntN(~width=4, 25n) == -7n\nBigInt.asIntN(~width=4, 3n) == 3n\n```" - ], - "signature": "let asIntN: (~width: int, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.asUintN", - "kind": "value", - "name": "asUintN", - "docstrings": [ - "`asUintN(~width, bigint)` returns a bigint value truncated to the given number of bits as an unsigned integer.\n\nSee [`BigInt.asUintN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/asUintN) on MDN.\n\n## Examples\n\n```rescript\nBigInt.asUintN(~width=4, 25n) == 9n\nBigInt.asUintN(~width=4, 3n) == 3n\n```" - ], - "signature": "let asUintN: (~width: int, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.fromStringOrThrow", - "kind": "value", - "name": "fromStringOrThrow", - "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Return the\nnumber as a `bigint` if successfully parsed. Throws a syntax exception otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromStringOrThrow(\"123\") == 123n\n\nBigInt.fromStringOrThrow(\"\") == 0n\n\nBigInt.fromStringOrThrow(\"0x11\") == 17n\n\nBigInt.fromStringOrThrow(\"0b11\") == 3n\n\nBigInt.fromStringOrThrow(\"0o11\") == 9n\n\n/* catch exception */\nswitch BigInt.fromStringOrThrow(\"a\") {\n| exception JsExn(_error) => assert(true)\n| _bigInt => assert(false)\n}\n```" - ], - "signature": "let fromStringOrThrow: string => bigint" - }, - { - "id": "Stdlib.BigInt.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Returns\n`Some(bigint)` if the string can be parsed, `None` otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromString(\"123\") == Some(123n)\n\nBigInt.fromString(\"\") == Some(0n)\n\nBigInt.fromString(\"0x11\") == Some(17n)\n\nBigInt.fromString(\"0b11\") == Some(3n)\n\nBigInt.fromString(\"0o11\") == Some(9n)\n\nBigInt.fromString(\"invalid\") == None\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.BigInt.fromStringExn", - "kind": "value", - "name": "fromStringExn", - "docstrings": [], - "signature": "let fromStringExn: string => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "`fromInt(int)` converts an `int` to a `bigint`.\n\n## Examples\n\n```rescript\nBigInt.fromInt(123) == 123n\nBigInt.fromInt(0) == 0n\nBigInt.fromInt(-456) == -456n\n```" - ], - "signature": "let fromInt: int => bigint" - }, - { - "id": "Stdlib.BigInt.fromFloatOrThrow", - "kind": "value", - "name": "fromFloatOrThrow", - "docstrings": [ - "Converts a `float` to a `bigint` using JavaScript semantics.\nThrows an exception if the float is not an integer or is infinite/NaN.\n\n## Examples\n\n```rescript\nBigInt.fromFloatOrThrow(123.0) == 123n\n\nBigInt.fromFloatOrThrow(0.0) == 0n\n\nBigInt.fromFloatOrThrow(-456.0) == -456n\n\n/* This will throw an exception */\nswitch BigInt.fromFloatOrThrow(123.5) {\n| exception JsExn(_error) => assert(true)\n| _bigInt => assert(false)\n}\n```" - ], - "signature": "let fromFloatOrThrow: float => bigint" - }, - { - "id": "Stdlib.BigInt.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "`fromFloat(float)` converts a `float` to a `bigint` using JavaScript semantics.\nReturns `Some(bigint)` if the float is a valid `bigint`, `None` otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromFloat(123.0) == Some(123n)\nBigInt.fromFloat(0.0) == Some(0n)\nBigInt.fromFloat(-456.0) == Some(-456n)\nBigInt.fromFloat(123.5) == None\n```" - ], - "signature": "let fromFloat: float => option" - }, - { - "id": "Stdlib.BigInt.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats a `bigint` as a string. Return a `string` representing the given value.\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nBigInt.toString(123n) == \"123\"\n```" - ], - "signature": "let toString: (bigint, ~radix: int=?) => string" - }, - { - "id": "Stdlib.BigInt.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [], - "signature": "let toStringWithRadix: (bigint, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Returns a string with a language-sensitive representation of this BigInt value.\n\n## Examples\n\n```rescript\nBigInt.toString(123n) == \"123\"\n```" - ], - "signature": "let toLocaleString: bigint => string" - }, - { - "id": "Stdlib.BigInt.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [ - "`toFloat(bigint)` converts a `bigint` to a `float`.\n\n## Examples\n\n```rescript\nBigInt.toFloat(123n) == 123.0\nBigInt.toFloat(0n) == 0.0\nBigInt.toFloat(-456n) == -456.0\n```" - ], - "signature": "let toFloat: bigint => float" - }, - { - "id": "Stdlib.BigInt.toInt", - "kind": "value", - "name": "toInt", - "docstrings": [ - "`toInt(bigint)` converts a `bigint` to an `int`.\n\n## Examples\n\n```rescript\nBigInt.toInt(123n) == 123\nBigInt.toInt(0n) == 0\nBigInt.toInt(-456n) == -456\n```" - ], - "signature": "let toInt: bigint => int" - }, - { - "id": "Stdlib.BigInt.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(a, b)` calculates the sum of two bigints.\n\n## Examples\n\n```rescript\nBigInt.add(5n, 3n) == 8n\nBigInt.add(-2n, 7n) == 5n\n```" - ], - "signature": "let add: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.sub", - "kind": "value", - "name": "sub", - "docstrings": [ - "`sub(a, b)` calculates the difference of two bigints.\n\n## Examples\n\n```rescript\nBigInt.sub(8n, 3n) == 5n\nBigInt.sub(2n, 7n) == -5n\n```" - ], - "signature": "let sub: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.mul", - "kind": "value", - "name": "mul", - "docstrings": [ - "`mul(a, b)` calculates the product of two bigints.\n\n## Examples\n\n```rescript\nBigInt.mul(5n, 3n) == 15n\nBigInt.mul(-2n, 7n) == -14n\n```" - ], - "signature": "let mul: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.div", - "kind": "value", - "name": "div", - "docstrings": [ - "`div(a, b)` calculates the quotient of two bigints.\n\n## Examples\n\n```rescript\nBigInt.div(15n, 3n) == 5n\nBigInt.div(14n, 3n) == 4n\n```" - ], - "signature": "let div: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.mod", - "kind": "value", - "name": "mod", - "docstrings": [ - "`mod(a, b)` calculates the remainder of dividing two bigints.\n\n## Examples\n\n```rescript\nBigInt.mod(15n, 4n) == 3n\nBigInt.mod(14n, 3n) == 2n\n```" - ], - "signature": "let mod: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseAnd", - "kind": "value", - "name": "bitwiseAnd", - "docstrings": [ - "`bitwiseAnd(a, b)` calculates the bitwise AND of two bigints.\n\n## Examples\n\n```rescript\nBigInt.bitwiseAnd(7n, 4n) == 4n\nBigInt.bitwiseAnd(15n, 8n) == 8n\n```" - ], - "signature": "let bitwiseAnd: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseOr", - "kind": "value", - "name": "bitwiseOr", - "docstrings": [ - "`bitwiseOr(a, b)` calculates the bitwise OR of two bigints.\n\n## Examples\n\n```rescript\nBigInt.bitwiseOr(7n, 4n) == 7n\nBigInt.bitwiseOr(8n, 4n) == 12n\n```" - ], - "signature": "let bitwiseOr: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseXor", - "kind": "value", - "name": "bitwiseXor", - "docstrings": [ - "`bitwiseXor(a, b)` calculates the bitwise XOR of two bigints.\n\n## Examples\n\n```rescript\nBigInt.bitwiseXor(7n, 4n) == 3n\nBigInt.bitwiseXor(15n, 8n) == 7n\n```" - ], - "signature": "let bitwiseXor: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseNot", - "kind": "value", - "name": "bitwiseNot", - "docstrings": [ - "`bitwiseNot(bigint)` calculates the bitwise NOT of a bigint.\n\n## Examples\n\n```rescript\nBigInt.bitwiseNot(2n) == -3n\nBigInt.bitwiseNot(-1n) == 0n\n```" - ], - "signature": "let bitwiseNot: bigint => bigint" - }, - { - "id": "Stdlib.BigInt.shiftLeft", - "kind": "value", - "name": "shiftLeft", - "docstrings": [ - "`shiftLeft(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the left.\n\n## Examples\n\n```rescript\nBigInt.shiftLeft(4n, 1n) == 8n\nBigInt.shiftLeft(1n, 3n) == 8n\n```" - ], - "signature": "let shiftLeft: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.shiftRight", - "kind": "value", - "name": "shiftRight", - "docstrings": [ - "`shiftRight(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the right.\n\n## Examples\n\n```rescript\nBigInt.shiftRight(8n, 1n) == 4n\nBigInt.shiftRight(16n, 2n) == 4n\n```" - ], - "signature": "let shiftRight: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bigint)` ignores the provided bigint and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: bigint => unit" - }, - { - "id": "Stdlib.BigInt.land", - "kind": "value", - "name": "land", - "docstrings": [ - "`land(a, b)` calculates the bitwise AND of two bigints.\n\n**Deprecated:** Use `&&&` operator or `bitwiseAnd` instead.\n\n## Examples\n\n```rescript\nBigInt.land(7n, 4n) == 4n\n```" - ], - "signature": "let land: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lor", - "kind": "value", - "name": "lor", - "docstrings": [ - "`lor(a, b)` calculates the bitwise OR of two bigints.\n\n**Deprecated:** Use `|||` operator or `bitwiseOr` instead.\n\n## Examples\n\n```rescript\nBigInt.lor(7n, 4n) == 7n\n```" - ], - "signature": "let lor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lxor", - "kind": "value", - "name": "lxor", - "docstrings": [ - "`lxor(a, b)` calculates the bitwise XOR of two bigints.\n\n**Deprecated:** Use `^^^` operator or `bitwiseXor` instead.\n\n## Examples\n\n```rescript\nBigInt.lxor(7n, 4n) == 3n\n```" - ], - "signature": "let lxor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lnot", - "kind": "value", - "name": "lnot", - "docstrings": [ - "`lnot(bigint)` calculates the bitwise NOT of a bigint.\n\n**Deprecated:** Use `~~~` operator or `bitwiseNot` instead.\n\n## Examples\n\n```rescript\nBigInt.lnot(2n) == -3n\n```" - ], - "signature": "let lnot: bigint => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lsl", - "kind": "value", - "name": "lsl", - "docstrings": [ - "`lsl(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the left.\n\n**Deprecated:** Use `<<` operator or `shiftLeft` instead.\n\n## Examples\n\n```rescript\nBigInt.lsl(4n, 1n) == 8n\n```" - ], - "signature": "let lsl: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.asr", - "kind": "value", - "name": "asr", - "docstrings": [ - "`asr(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the right.\n\n**Deprecated:** Use `>>` operator or `shiftRight` instead.\n\n## Examples\n\n```rescript\nBigInt.asr(8n, 1n) == 4n\n```" - ], - "signature": "let asr: (bigint, bigint) => bigint", - "deprecated": "" - } - ] - }, - "stdlib/array": { - "id": "Stdlib.Array", - "name": "Array", - "docstrings": [ - "A mutable array.\n\nCompiles to a regular JavaScript array." - ], - "items": [ - { - "id": "Stdlib.Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an array of value `'a`." - ], - "signature": "type t<'a> = array<'a>" - }, - { - "id": "Stdlib.Array.arrayLike", - "kind": "type", - "name": "arrayLike", - "docstrings": [], - "signature": "type arrayLike<'a>" - }, - { - "id": "Stdlib.Array.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "`fromIterator(iterator)` creates an array from the provided `iterator`\n\n## Examples\n\n```rescript\nMap.fromArray([(\"foo\", 1), (\"bar\", 2)])\n->Map.values\n->Array.fromIterator == [1, 2]\n```" - ], - "signature": "let fromIterator: Iterator.t<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.fromArrayLike", - "kind": "value", - "name": "fromArrayLike", - "docstrings": [ - "`fromArrayLike(source)` converts an array-like value (anything with indexed items and a `length`) into a regular array.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 10, 1: 20, length: 2}`)\nArray.fromArrayLike(source) == [10, 20]\n```" - ], - "signature": "let fromArrayLike: arrayLike<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.fromArrayLikeWithMap", - "kind": "value", - "name": "fromArrayLikeWithMap", - "docstrings": [ - "`fromArrayLikeWithMap(source, map)` converts an array-like value into an array and applies `map` to every element.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 1, 1: 2, length: 2}`)\nArray.fromArrayLikeWithMap(source, x => x * 10) == [10, 20]\n```" - ], - "signature": "let fromArrayLikeWithMap: (arrayLike<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Stdlib.Array.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(str)` creates an array of each character as a separate string from the provided `str`.\n\n## Examples\n\n```rescript\nArray.fromString(\"abcde\") == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let fromString: string => array" - }, - { - "id": "Stdlib.Array.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(~length, init)` creates an array of length `length` initialized with the value of `init`.\n\n## Examples\n\n```rescript\nArray.make(~length=3, #apple) == [#apple, #apple, #apple]\nArray.make(~length=6, 7) == [7, 7, 7, 7, 7, 7]\n```" - ], - "signature": "let make: (~length: int, 'a) => array<'a>" - }, - { - "id": "Stdlib.Array.fromInitializer", - "kind": "value", - "name": "fromInitializer", - "docstrings": [ - "`fromInitializer(~length, f)`\n\nCreates an array of length `length` initialized with the value returned from `f ` for each index.\n\n## Examples\n\n```rescript\nArray.fromInitializer(~length=3, i => i + 3) == [3, 4, 5]\n\nArray.fromInitializer(~length=7, i => i + 3) == [3, 4, 5, 6, 7, 8, 9]\n```" - ], - "signature": "let fromInitializer: (~length: int, int => 'a) => array<'a>" - }, - { - "id": "Stdlib.Array.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(left, right, predicate)` checks if the two arrays contain the same elements according to the equality `predicate`.\n\n## Examples\n\n```rescript\nArray.equal([1, 2, 3], [1, 2, 3], Int.equal) == true\nArray.equal([1, 2, 3], [1, 3, 2], Int.equal) == false\n```" - ], - "signature": "let equal: (array<'a>, array<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Stdlib.Array.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(left, right, comparator)` compares two arrays element by element using `comparator` and returns an `Ordering`.\n\n## Examples\n\n```rescript\nArray.compare([1, 3], [1, 2], Int.compare) == Ordering.greater\nArray.compare([1, 2], [1, 2], Int.compare) == Ordering.equal\n```" - ], - "signature": "let compare: (array<'a>, array<'a>, ('a, 'a) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.Array.isArray", - "kind": "value", - "name": "isArray", - "docstrings": [ - "`isArray(value)` returns `true` when `value` is a JavaScript array and `false` otherwise.\n\nSee [`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) on MDN.\n\n## Examples\n\n```rescript\nArray.isArray([1, 2, 3]) == true\nArray.isArray(\"not an array\") == false\n```" - ], - "signature": "let isArray: 'a => bool" - }, - { - "id": "Stdlib.Array.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(array)` returns the length of (i.e. number of items in) the array.\n\nSee [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.length == 2\n```" - ], - "signature": "let length: array<'a> => int" - }, - { - "id": "Stdlib.Array.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\n[]->Array.isEmpty->assertEqual(true)\n[1, 2, 3]->Array.isEmpty->assertEqual(false)\n\nlet emptyArray = []\nemptyArray->Array.isEmpty->assertEqual(true)\n\nlet nonEmptyArray = [\"hello\"]\nnonEmptyArray->Array.isEmpty->assertEqual(false)\n```" - ], - "signature": "let isEmpty: array<'a> => bool" - }, - { - "id": "Stdlib.Array.copyAllWithin", - "kind": "value", - "name": "copyAllWithin", - "docstrings": [ - "`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyAllWithin(~target=2) == [100, 101, 100, 101, 102]\narr == [100, 101, 100, 101, 102]\n```" - ], - "signature": "let copyAllWithin: (array<'a>, ~target: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Array.copyWithinToEnd", - "kind": "value", - "name": "copyWithinToEnd", - "docstrings": [ - "`copyWithinToEnd(array, ~target, ~start)` copies starting at element `start` in the given array to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyWithinToEnd(~target=0, ~start=2) == [102, 103, 104, 103, 104]\narr == [102, 103, 104, 103, 104]\n```" - ], - "signature": "let copyWithinToEnd: (array<'a>, ~target: int, ~start: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [ - "`copyWithin(array, ~target, ~start, ~end)` copies starting at element `start` in the given array up to but not including `end` to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105]\narr->Array.copyWithin(~target=1, ~start=2, ~end=5) == [100, 102, 103, 104, 104, 105]\narr == [100, 102, 103, 104, 104, 105]\n```" - ], - "signature": "let copyWithin: (\n array<'a>,\n ~target: int,\n ~start: int,\n ~end: int=?,\n) => array<'a>" - }, - { - "id": "Stdlib.Array.fillAll", - "kind": "value", - "name": "fillAll", - "docstrings": [ - "`fillAll(array, value)` fills the entire `array` with `value`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillAll(9)\nmyArray == [9, 9, 9, 9]\n```" - ], - "signature": "let fillAll: (array<'a>, 'a) => unit", - "deprecated": "" - }, - { - "id": "Stdlib.Array.fillToEnd", - "kind": "value", - "name": "fillToEnd", - "docstrings": [ - "`fillToEnd(array, value, ~start)` fills `array` with `value` from the `start` index.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillToEnd(9, ~start=1)\nmyArray == [1, 9, 9, 9]\n```" - ], - "signature": "let fillToEnd: (array<'a>, 'a, ~start: int) => unit", - "deprecated": "" - }, - { - "id": "Stdlib.Array.fill", - "kind": "value", - "name": "fill", - "docstrings": [ - "`fill(array, value, ~start, ~end)` fills `array` with `value` from `start` to `end`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\n\nmyArray->Array.fill(9)\nmyArray == [9, 9, 9, 9]\n\nmyArray->Array.fill(0, ~start=1)\nmyArray == [9, 0, 0, 0]\n\nmyArray->Array.fill(5, ~start=1, ~end=3)\nmyArray == [9, 5, 5, 0]\n```" - ], - "signature": "let fill: (array<'a>, 'a, ~start: int=?, ~end: int=?) => unit" - }, - { - "id": "Stdlib.Array.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "`pop(array)` removes the last item from `array` and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pop == Some(\"hello\")\n\nsomeArray == [\"hi\"] // Notice last item is gone.\n```" - ], - "signature": "let pop: array<'a> => option<'a>" - }, - { - "id": "Stdlib.Array.push", - "kind": "value", - "name": "push", - "docstrings": [ - "`push(array, item)` appends `item` to the end of `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.push(\"yay\")\n\nsomeArray == [\"hi\", \"hello\", \"yay\"]\n```" - ], - "signature": "let push: (array<'a>, 'a) => unit" - }, - { - "id": "Stdlib.Array.pushMany", - "kind": "value", - "name": "pushMany", - "docstrings": [ - "`pushMany(array, itemsArray)` appends many new items to the end of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pushMany([\"yay\", \"wehoo\"])\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let pushMany: (array<'a>, array<'a>) => unit" - }, - { - "id": "Stdlib.Array.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(array)` reverses the order of the items in `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.reverse\n\nsomeArray == [\"hello\", \"hi\"]\n```" - ], - "signature": "let reverse: array<'a> => unit" - }, - { - "id": "Stdlib.Array.shift", - "kind": "value", - "name": "shift", - "docstrings": [ - "`shift(array)` removes the first item in the array, and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.shift == Some(\"hi\")\n\nsomeArray == [\"hello\"] // Notice first item is gone.\n```" - ], - "signature": "let shift: array<'a> => option<'a>" - }, - { - "id": "Stdlib.Array.toSorted", - "kind": "value", - "name": "toSorted", - "docstrings": [ - "`toSorted(array, comparator)` returns a new, sorted array from `array`, using the `comparator` function.\n\nSee [`Array.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [3, 2, 1]\n\nsomeArray->Array.toSorted(Int.compare) == [1, 2, 3]\n\nsomeArray == [3, 2, 1] // Original unchanged\n```" - ], - "signature": "let toSorted: (array<'a>, ('a, 'a) => Ordering.t) => array<'a>" - }, - { - "id": "Stdlib.Array.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(array, comparator)` sorts `array` in-place using the `comparator` function.\n\nBeware this will *mutate* the array.\n\nSee [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet array = [3, 2, 1]\narray->Array.sort((a, b) => float(a - b))\narray == [1, 2, 3]\n```" - ], - "signature": "let sort: (array<'a>, ('a, 'a) => Ordering.t) => unit" - }, - { - "id": "Stdlib.Array.splice", - "kind": "value", - "name": "splice", - "docstrings": [ - "`splice(array, ~start, ~remove, ~insert)` removes `remove` items starting at `start` and inserts the values from `insert`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) on MDN.\n\n## Examples\n\n```rescript\nlet items = [\"a\", \"b\", \"c\"]\nitems->Array.splice(~start=1, ~remove=1, ~insert=[\"x\"])\nitems == [\"a\", \"x\", \"c\"]\n```" - ], - "signature": "let splice: (\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => unit" - }, - { - "id": "Stdlib.Array.toSpliced", - "kind": "value", - "name": "toSpliced", - "docstrings": [ - "`toSpliced(array, ~start, ~remove, ~insert)` returns a new array with the same edits that `splice` would perform, leaving the original unchanged.\n\nSee [`Array.toSpliced`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced) on MDN.\n\n## Examples\n\n```rescript\nlet original = [1, 2, 3]\nlet updated = original->Array.toSpliced(~start=1, ~remove=1, ~insert=[10])\nupdated == [1, 10, 3]\noriginal == [1, 2, 3]\n```" - ], - "signature": "let toSpliced: (\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => array<'a>" - }, - { - "id": "Stdlib.Array.removeInPlace", - "kind": "value", - "name": "removeInPlace", - "docstrings": [ - "`removeInPlace(array, index)` removes the item at the specified `index` from `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = []\narray->Array.removeInPlace(0)\narray == [] // Removing from an empty array does nothing\n\nlet array2 = [\"Hello\", \"Hi\", \"Good bye\"]\narray2->Array.removeInPlace(1)\narray2 == [\"Hello\", \"Good bye\"] // Removes the item at index 1\n```" - ], - "signature": "let removeInPlace: (array<'a>, int) => unit" - }, - { - "id": "Stdlib.Array.with", - "kind": "value", - "name": "with", - "docstrings": [ - "`with(array, index, value)` returns a copy of `array` where the element at `index` is replaced with `value`.\n\nSee [`Array.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/with) on MDN.\n\n## Examples\n\n```rescript\nlet original = [\"a\", \"b\", \"c\"]\nlet replaced = original->Array.with(1, \"x\")\nreplaced == [\"a\", \"x\", \"c\"]\noriginal == [\"a\", \"b\", \"c\"]\n```" - ], - "signature": "let with: (array<'a>, int, 'a) => array<'a>" - }, - { - "id": "Stdlib.Array.unshift", - "kind": "value", - "name": "unshift", - "docstrings": [ - "`unshift(array, item)` inserts a new item at the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshift(\"yay\")\nsomeArray == [\"yay\", \"hi\", \"hello\"]\n```" - ], - "signature": "let unshift: (array<'a>, 'a) => unit" - }, - { - "id": "Stdlib.Array.unshiftMany", - "kind": "value", - "name": "unshiftMany", - "docstrings": [ - "`unshiftMany(array, itemsArray)` inserts many new items to the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshiftMany([\"yay\", \"wehoo\"])\nsomeArray == [\"yay\", \"wehoo\", \"hi\", \"hello\"]\n```" - ], - "signature": "let unshiftMany: (array<'a>, array<'a>) => unit" - }, - { - "id": "Stdlib.Array.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(array1, array2)` concatenates the two arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\", \"wehoo\"]\n\nlet someArray = array1->Array.concat(array2)\n\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let concat: (array<'a>, array<'a>) => array<'a>" - }, - { - "id": "Stdlib.Array.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(array1, arrays)` concatenates array1 with several other arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\"]\nlet array3 = [\"wehoo\"]\n\nlet someArray = array1->Array.concatMany([array2, array3])\n\nConsole.log(someArray) // [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let concatMany: (array<'a>, array>) => array<'a>" - }, - { - "id": "Stdlib.Array.flat", - "kind": "value", - "name": "flat", - "docstrings": [ - "`flat(arrays)` concatenates an array of arrays into a single array.\n\nSee [`Array.flat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) on MDN.\n\n## Examples\n\n```rescript\n[[1], [2], [3, 4]]->Array.flat == [1, 2, 3, 4]\n```" - ], - "signature": "let flat: array> => array<'a>" - }, - { - "id": "Stdlib.Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "`includes(array, item)` checks whether `array` includes `item`, by doing a [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality).\n\nSee [`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.includes(1) == true\n[1, 2]->Array.includes(3) == false\n\n[{\"language\": \"ReScript\"}]->Array.includes({\"language\": \"ReScript\"}) == false // false, because of strict equality\n```" - ], - "signature": "let includes: (array<'a>, 'a) => bool" - }, - { - "id": "Stdlib.Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "`indexOf(array, item, ~from)` returns the index of the provided `item` in `array`, starting the search at `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.indexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOf(2) == 1\n[1, 2]->Array.indexOf(3) == -1\n[1, 2, 1, 2]->Array.indexOf(2, ~from=2) == 3\n\n[{\"language\": \"ReScript\"}]->Array.indexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```" - ], - "signature": "let indexOf: (array<'a>, 'a, ~from: int=?) => int" - }, - { - "id": "Stdlib.Array.indexOfOpt", - "kind": "value", - "name": "indexOfOpt", - "docstrings": [ - "`indexOfOpt(array, item)` returns an option of the index of the provided `item` in `array`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOfOpt(2) == Some(1)\n[1, 2]->Array.indexOfOpt(3) == None\n[{\"language\": \"ReScript\"}]->Array.indexOfOpt({\"language\": \"ReScript\"}) == None // None, because of strict equality\n```" - ], - "signature": "let indexOfOpt: (array<'a>, 'a) => option" - }, - { - "id": "Stdlib.Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (array<'a>, 'a, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Array.join", - "kind": "value", - "name": "join", - "docstrings": [ - "`join(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.join(\" -- \") == \"One -- Two -- Three\"\n```" - ], - "signature": "let join: (array, string) => string" - }, - { - "id": "Stdlib.Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "`joinWith(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinWithUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.joinWith(\" -- \") == \"One -- Two -- Three\"\n```" - ], - "signature": "let joinWith: (array, string) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Array.joinUnsafe", - "kind": "value", - "name": "joinUnsafe", - "docstrings": [ - "`joinUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```" - ], - "signature": "let joinUnsafe: (array<'a>, string) => string" - }, - { - "id": "Stdlib.Array.joinWithUnsafe", - "kind": "value", - "name": "joinWithUnsafe", - "docstrings": [ - "`joinWithUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinWithUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```" - ], - "signature": "let joinWithUnsafe: (array<'a>, string) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(array, item, ~from)` returns the last index of the provided `item` in `array`, searching backwards from `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.lastIndexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 1, 2]->Array.lastIndexOf(2) == 3\n[1, 2]->Array.lastIndexOf(3) == -1\n[1, 2, 1, 2]->Array.lastIndexOf(2, ~from=2) == 1\n\n[{\"language\": \"ReScript\"}]->Array.lastIndexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```" - ], - "signature": "let lastIndexOf: (array<'a>, 'a, ~from: int=?) => int" - }, - { - "id": "Stdlib.Array.lastIndexOfOpt", - "kind": "value", - "name": "lastIndexOfOpt", - "docstrings": [], - "signature": "let lastIndexOfOpt: (array<'a>, 'a) => option" - }, - { - "id": "Stdlib.Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (array<'a>, 'a, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(array, ~start, ~end)` creates a new array of items copied from `array` from `start` until (but not including) `end`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.slice(~start=1, ~end=3) == [2, 3]\n[1, 2, 3, 4]->Array.slice(~start=1) == [2, 3, 4]\n[1, 2, 3, 4]->Array.slice == [1, 2, 3, 4]\n```" - ], - "signature": "let slice: (array<'a>, ~start: int=?, ~end: int=?) => array<'a>" - }, - { - "id": "Stdlib.Array.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(array, start)` creates a new array from `array`, with all items from `array` starting from `start`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.sliceToEnd(~start=1) == [2, 3, 4]\n```" - ], - "signature": "let sliceToEnd: (array<'a>, ~start: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(array)` makes a copy of the array with the items in it, but does not make copies of the items themselves.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3]\nlet copyOfMyArray = myArray->Array.copy\n\ncopyOfMyArray == [1, 2, 3]\n(myArray === copyOfMyArray) == false\n```" - ], - "signature": "let copy: array<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(array)` stringifies `array` by running `toString` on all of the array elements and joining them with \",\".\n\nSee [`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.toString == \"1,2,3,4\"\n```" - ], - "signature": "let toString: array<'a> => string" - }, - { - "id": "Stdlib.Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(array)` converts each element to a locale-aware string and joins them with commas.\n\nSee [`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n[\"apple\", \"banana\"]->Array.toLocaleString == \"apple,banana\"\n```" - ], - "signature": "let toLocaleString: array<'a> => string" - }, - { - "id": "Stdlib.Array.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(array, predicate)` returns true if `predicate` returns true for all items in `array`.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.every(num => num <= 4) == true\n\narray->Array.every(num => num === 1) == false\n```" - ], - "signature": "let every: (array<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Array.everyWithIndex", - "kind": "value", - "name": "everyWithIndex", - "docstrings": [ - "`everyWithIndex(array, checker)` returns true if all items in `array` returns true when running the provided `checker` function.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.everyWithIndex((num, index) => index < 5 && num <= 4) == true\n\narray->Array.everyWithIndex((num, index) => index < 2 && num >= 2) == false\n```" - ], - "signature": "let everyWithIndex: (array<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filter(num => num > 2) == [3, 4]\n```" - ], - "signature": "let filter: (array<'a>, 'a => bool) => array<'a>" - }, - { - "id": "Stdlib.Array.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filterWithIndex((num, index) => index === 0 || num === 2) == [1, 2]\n```" - ], - "signature": "let filterWithIndex: (array<'a>, ('a, int) => bool) => array<'a>" - }, - { - "id": "Stdlib.Array.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.find(item => item == ReScript) == Some(ReScript)\n```" - ], - "signature": "let find: (array<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findWithIndex", - "kind": "value", - "name": "findWithIndex", - "docstrings": [ - "`findWithIndex(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [TypeScript, JavaScript, ReScript]\n\narray->Array.findWithIndex((item, index) => index > 1 && item == ReScript) == Some(ReScript)\n```" - ], - "signature": "let findWithIndex: (array<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findLast", - "kind": "value", - "name": "findLast", - "docstrings": [ - "`findLast(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLast(item => item > 0) == Some(3)\n```" - ], - "signature": "let findLast: (array<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findLastWithIndex", - "kind": "value", - "name": "findLastWithIndex", - "docstrings": [ - "`findLastWithIndex(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLastWithIndex((item, index) => index < 2 && item > 0) == Some(2)\n```" - ], - "signature": "let findLastWithIndex: (array<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [ - "`findIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\narray->Array.findIndex(item => item == ReScript) == 0\n\narray->Array.findIndex(item => item == TypeScript) == -1\n```" - ], - "signature": "let findIndex: (array<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.Array.findIndexWithIndex", - "kind": "value", - "name": "findIndexWithIndex", - "docstrings": [ - "`findIndexWithIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\nlet isReScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == ReScript)\nlet isTypeScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == TypeScript)\n\nisReScriptFirst == 0\nisTypeScriptFirst == -1\n```" - ], - "signature": "let findIndexWithIndex: (array<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.Array.findLastIndex", - "kind": "value", - "name": "findLastIndex", - "docstrings": [ - "`findLastIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, ReScript]\n\narray->Array.findLastIndex(item => item == ReScript) == 2\n\narray->Array.findLastIndex(item => item == TypeScript) == -1\n```" - ], - "signature": "let findLastIndex: (array<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.Array.findLastIndexWithIndex", - "kind": "value", - "name": "findLastIndexWithIndex", - "docstrings": [ - "`findLastIndexWithIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, JavaScript, ReScript]\n\nlet isReScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == ReScript)\nlet isTypeScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == TypeScript)\n\nisReScriptLast == 3\nisTypeScriptLast == -1\n```" - ], - "signature": "let findLastIndexWithIndex: (array<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEach(item => {\n Console.log(item)\n})\n```" - ], - "signature": "let forEach: (array<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Array.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEachWithIndex((item, index) => {\n Console.log(\"At item \" ++ Int.toString(index) ++ \": \" ++ item)\n})\n```" - ], - "signature": "let forEachWithIndex: (array<'a>, ('a, int) => unit) => unit" - }, - { - "id": "Stdlib.Array.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```" - ], - "signature": "let map: (array<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Stdlib.Array.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```" - ], - "signature": "let mapWithIndex: (array<'a>, ('a, int) => 'b) => array<'b>" - }, - { - "id": "Stdlib.Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(xs, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has two parameters: the item from the list and an \"accumulator\"; which starts with a value of `init`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\nArray.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n\n[1, 2, 3]->Array.reduce(list{}, List.add) == list{3, 2, 1}\n\nArray.reduce([], list{}, List.add) == list{}\n```" - ], - "signature": "let reduce: (array<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(x, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has three parameters: the item from the array and an \"accumulator\", which starts with a value of `init` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceWithIndex([1, 2, 3], list{}, (acc, v, i) => list{v + i, ...acc}) == list{5, 3, 1}\n\nArray.reduceWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```" - ], - "signature": "let reduceWithIndex: (array<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [ - "`reduceRight(xs, init, fn)`\n\nWorks like `Array.reduce`; except that function `fn` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nArray.reduceRight([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n\nArray.reduceRight([1, 2, 3], list{}, List.add) == list{1, 2, 3}\n\nArray.reduceRight([], list{}, List.add) == list{}\n```" - ], - "signature": "let reduceRight: (array<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.reduceRightWithIndex", - "kind": "value", - "name": "reduceRightWithIndex", - "docstrings": [ - "`reduceRightWithIndex(xs, init, fn)`\n\nLike `reduceRight`, but with an additional index argument on the callback function.\n\n## Examples\n\n```rescript\nArray.reduceRightWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceRightWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```" - ], - "signature": "let reduceRightWithIndex: (array<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(array, predicate)` returns true if `predicate` returns true for any element in `array`.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.some(greeting => greeting === \"Hello\") == true\n```" - ], - "signature": "let some: (array<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Array.someWithIndex", - "kind": "value", - "name": "someWithIndex", - "docstrings": [ - "`someWithIndex(array, checker)` returns true if running the provided `checker` function on any element in `array` returns true.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.someWithIndex((greeting, index) => greeting === \"Hello\" && index === 0) == true\n```" - ], - "signature": "let someWithIndex: (array<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.Array.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(array, index)` returns the element at `index` of `array`.\n\nReturns `None` if the index does not exist in the array. Equivalent to doing `array[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.get(0) == Some(\"Hello\")\n\narray->Array.get(3) == None\n```" - ], - "signature": "let get: (array<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.Array.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.set(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```" - ], - "signature": "let set: (array<'a>, int, 'a) => unit" - }, - { - "id": "Stdlib.Array.getSymbol", - "kind": "value", - "name": "getSymbol", - "docstrings": [ - "`getSymbol(array, key)` retrieves the value stored under the symbol `key`, if present.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN for more details about symbol keys.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbol(items, key) == Some(\"hello\")\n```" - ], - "signature": "let getSymbol: (array<'a>, Symbol.t) => option<'b>" - }, - { - "id": "Stdlib.Array.getSymbolUnsafe", - "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [ - "`getSymbolUnsafe(array, key)` retrieves the value stored under the symbol `key` without any safety checks.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbolUnsafe(items, key) == \"hello\"\n```" - ], - "signature": "let getSymbolUnsafe: (array<'a>, Symbol.t) => 'b" - }, - { - "id": "Stdlib.Array.setSymbol", - "kind": "value", - "name": "setSymbol", - "docstrings": [ - "`setSymbol(array, key, value)` stores `value` under the symbol `key` on `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"count\")\nlet items = []\nitems->Array.setSymbol(key, 5)\nArray.getSymbol(items, key) == Some(5)\n```" - ], - "signature": "let setSymbol: (array<'a>, Symbol.t, 'b) => unit" - }, - { - "id": "Stdlib.Array.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.getUnsafe` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.getUnsafe(index)\n Console.log(value)\n}\n```" - ], - "signature": "let getUnsafe: (array<'a>, int) => 'a" - }, - { - "id": "Stdlib.Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [ - "`unsafe_get(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.unsafe_get` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.unsafe_get(index)\n Console.log(value)\n}\n```" - ], - "signature": "let unsafe_get: (array<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Array.setUnsafe", - "kind": "value", - "name": "setUnsafe", - "docstrings": [ - "`setUnsafe(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array, and is *unsafe*.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.setUnsafe(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```" - ], - "signature": "let setUnsafe: (array<'a>, int, 'a) => unit" - }, - { - "id": "Stdlib.Array.findIndexOpt", - "kind": "value", - "name": "findIndexOpt", - "docstrings": [ - "`findIndexOpt(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.findIndexOpt(item => item == ReScript) == Some(0)\n```" - ], - "signature": "let findIndexOpt: (array<'a>, 'a => bool) => option" - }, - { - "id": "Stdlib.Array.findLastIndexOpt", - "kind": "value", - "name": "findLastIndexOpt", - "docstrings": [ - "`findIndexOpt(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"hello\", \"world\", \"!\"]\n\narray->Array.findLastIndexOpt(item => item->String.includes(\"o\")) == Some(1)\n```" - ], - "signature": "let findLastIndexOpt: (array<'a>, 'a => bool) => option" - }, - { - "id": "Stdlib.Array.toReversed", - "kind": "value", - "name": "toReversed", - "docstrings": [ - "`toReversed(array)` creates a new array with all items from `array` in reversed order.\n\nSee [`Array.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nlet reversed = someArray->Array.toReversed\n\nreversed == [\"hello\", \"hi\"]\nsomeArray == [\"hi\", \"hello\"] // Original unchanged\n```" - ], - "signature": "let toReversed: array<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.filterMap", - "kind": "value", - "name": "filterMap", - "docstrings": [ - "`filterMap(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMap(item =>\n switch item {\n | \"Hello\" => Some(item->String.length)\n | _ => None\n }\n) == [5]\n\n[1, 2, 3, 4, 5, 6]->Array.filterMap(n => mod(n, 2) == 0 ? Some(n * n) : None) == [4, 16, 36]\n\nArray.filterMap([1, 2, 3, 4, 5, 6], _ => None) == []\n\nArray.filterMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == []\n```" - ], - "signature": "let filterMap: (array<'a>, 'a => option<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.filterMapWithIndex", - "kind": "value", - "name": "filterMapWithIndex", - "docstrings": [ - "`filterMapWithIndex(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMapWithIndex((item, index) =>\n switch item {\n | \"Hello\" => Some(index)\n | _ => None\n }\n) == [0]\n```" - ], - "signature": "let filterMapWithIndex: (array<'a>, ('a, int) => option<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.keepSome", - "kind": "value", - "name": "keepSome", - "docstrings": [ - "`keepSome(arr)`\n\nReturns a new array containing `value` for all elements that are `Some(value)`\nand ignoring every value that is `None`\n\n## Examples\n\n```rescript\nArray.keepSome([Some(1), None, Some(3)]) == [1, 3]\n\nArray.keepSome([Some(1), Some(2), Some(3)]) == [1, 2, 3]\n\nArray.keepSome([None, None, None]) == []\n\nArray.keepSome([]) == []\n```" - ], - "signature": "let keepSome: array> => array<'a>" - }, - { - "id": "Stdlib.Array.toShuffled", - "kind": "value", - "name": "toShuffled", - "docstrings": [ - "`toShuffled(array)` returns a new array with all items in `array` in a random order.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet shuffledArray = array->Array.toShuffled\nConsole.log(shuffledArray)\n\nArray.toShuffled([1, 2, 3])->Array.length == 3\n```" - ], - "signature": "let toShuffled: array<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "`shuffle(array)` randomizes the position of all items in `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.shuffle\nConsole.log(array)\n\nlet array2 = [1, 2, 3]\narray2->Array.shuffle\n\narray2->Array.length == 3\n```" - ], - "signature": "let shuffle: array<'a> => unit" - }, - { - "id": "Stdlib.Array.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMap(item =>\n switch item {\n | ReScript => [1, 2, 3]\n | TypeScript => [4, 5, 6]\n | JavaScript => [7, 8, 9]\n }\n) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\n```" - ], - "signature": "let flatMap: (array<'a>, 'a => array<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.flatMapWithIndex", - "kind": "value", - "name": "flatMapWithIndex", - "docstrings": [ - "`flatMapWithIndex(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMapWithIndex((item, index) =>\n switch item {\n | ReScript => [index]\n | TypeScript => [index, index + 1]\n | JavaScript => [index, index + 1, index + 2]\n }\n) == [0, 1, 2, 2, 3, 4]\n```" - ], - "signature": "let flatMapWithIndex: (array<'a>, ('a, int) => array<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.findMap", - "kind": "value", - "name": "findMap", - "docstrings": [ - "`findMap(arr, fn)`\n\nCalls `fn` for each element and returns the first value from `fn` that is `Some(_)`.\nOtherwise returns `None`\n\n## Examples\n\n```rescript\nArray.findMap([1, 2, 3], n => mod(n, 2) == 0 ? Some(n - 2) : None) == Some(0)\n\nArray.findMap([1, 2, 3, 4, 5, 6], n => mod(n, 2) == 0 ? Some(n - 8) : None) == Some(-6)\n\nArray.findMap([1, 2, 3, 4, 5, 6], _ => None) == None\n\nArray.findMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == None\n```" - ], - "signature": "let findMap: (array<'a>, 'a => option<'b>) => option<'b>" - }, - { - "id": "Stdlib.Array.at", - "kind": "value", - "name": "at", - "docstrings": [ - "`at(array, index)`\n\nGet an element by its index. Negative indices count backwards from the last item.\n\n## Examples\n\n```rescript\n[\"a\", \"b\", \"c\"]->Array.at(0) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(2) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(3) == None\n[\"a\", \"b\", \"c\"]->Array.at(-1) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(-3) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(-4) == None\n```" - ], - "signature": "let at: (array<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.Array.last", - "kind": "value", - "name": "last", - "docstrings": [ - "`last(array)` returns the last element of `array`.\n\nReturns `None` if the array is empty.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.last == Some(\"Good bye\")\n\n[]->Array.last == None\n```" - ], - "signature": "let last: array<'a> => option<'a>" - }, - { - "id": "Stdlib.Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(array)` ignores the provided array and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: array<'a> => unit" - }, - { - "id": "Stdlib.Array.entries", - "kind": "value", - "name": "entries", - "docstrings": [ - "`entries(array)` returns a new array iterator object that contains the key/value pairs for each index in the array.\n\nSee [Array.prototype.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: Iterator.t<(int, int)> = array->Array.entries\niterator->Iterator.next == {done: false, value: Some((0, 5))}\niterator->Iterator.next == {done: false, value: Some((1, 6))}\n```" - ], - "signature": "let entries: array<'a> => Iterator.t<(int, 'a)>" - }, - { - "id": "Stdlib.Array.values", - "kind": "value", - "name": "values", - "docstrings": [ - "`values(array)` returns a new array iterator object that contains the values for each index in the array.\n\nSee [Array.prototype.values](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: Iterator.t = array->Array.values\niterator->Iterator.next == {done: false, value: Some(5)}\niterator->Iterator.next == {done: false, value: Some(6)}\n```" - ], - "signature": "let values: array<'a> => Iterator.t<'a>" - } - ] - }, - "stdlib/intervalid": { - "id": "Stdlib.IntervalId", - "name": "IntervalId", - "docstrings": [], - "items": [] - }, - "stdlib/timeoutid": { - "id": "Stdlib.TimeoutId", - "name": "TimeoutId", - "docstrings": [], - "items": [] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v12.0.1/belt.json b/apps/docs/data/api/v12.0.1/belt.json deleted file mode 100644 index 74e7ee076..000000000 --- a/apps/docs/data/api/v12.0.1/belt.json +++ /dev/null @@ -1,9728 +0,0 @@ -{ - "belt": { - "id": "Belt", - "name": "Belt", - "docstrings": [ - "The ReScript standard library.\n\nBelt is currently mostly covering collection types. It has no string or date functions yet, although Belt.String is in the works. In the meantime, use [Js.String](js/string) for string functions and [Js.Date](js/date) for date functions.\n\n## Motivation\n\nBelt provides:\n\n- The **highest quality** immutable data structures in JavaScript.\n- Safety by default: A Belt function will never throw exceptions, unless it is\n indicated explicitly in the function name (suffix \"Exn\").\n- Better performance and smaller code size running on the JS platform.\n- Ready for [Tree Shaking](https://webpack.js.org/guides/tree-shaking/).\n\n## Usage\n\nTo use modules from Belt, either refer to them by their fully qualified name (`Belt.List`, `Belt.Array` etc.) or open the `Belt` module by putting\n\n## Examples\n\n```rescript\nopen Belt\n```\n\nat the top of your source files. After opening Belt this way, `Array` will refer to `Belt.Array`, `List` will refer to `Belt.List` etc. in the subsequent code.\n\nIf you want to open Belt globally for all files in your project instead, you can put\n\n```json\n{\n \"compiler-flags\": [\"-open Belt\"]\n}\n```\n\ninto your `rescript.json`.\n\n**Note**: this is the **only** `open` we encourage.\n\nExample usage:\n\n## Examples\n\n```rescript\nlet someNumbers = [1, 1, 4, 2, 3, 6, 3, 4, 2]\n\nlet greaterThan2UniqueAndSorted =\n someNumbers\n ->Belt.Array.keep(x => x > 2)\n // convert to and from set to make values unique\n ->Belt.Set.Int.fromArray\n ->Belt.Set.Int.toArray // output is already sorted\n\nJs.log2(\"result\", greaterThan2UniqueAndSorted)\n```\n\n## Specialized Collections\n\nFor collections types like set or map, Belt provides both a generic module as well as specialized, more efficient implementations for string and int keys.\n\nFor example, Belt has the following set modules:\n\n- [Belt.Set](belt/set)\n- [Belt.Set.Int](belt/set/int)\n- [Belt.Set.String](belt/set/string)\n\n## Implementation Details\n\n### Array access runtime safety\n\nOne common confusion comes from the way Belt handles array access. It differs from than the default standard library's.\n\n## Examples\n\n```rescript\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0] // a == \"a\"\nlet capitalA = Js.String.toUpperCase(a)\nlet k = letters[10] // Throws an exception! The 10th index doesn't exist.\n```\n\nBecause Belt avoids exceptions and returns `options` instead, this code behaves differently:\n\n## Examples\n\n```rescript\nopen Belt\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0] // a == Some(\"a\")\nlet captialA = Js.String.toUpperCase(a) // Type error! This code will not compile.\nlet k = letters[10] // k == None\n```\n\nAlthough we've fixed the problem where `k` throws an exception, we now have a type error when trying to capitalize `a`. There are a few things going on here:\n\n- Reason transforms array index access to the function `Array.get`. So `letters[0]` is the same as `Array.get(letters, 0)`.\n- The compiler uses whichever `Array` module is in scope. If you `open Belt`, then it uses `Belt.Array`.\n- `Belt.Array.get` returns values wrapped in options, so `letters[0] == Some(\"a\")`.\n\nFortunately, this is easy to fix:\n\n## Examples\n\n```rescript\nopen Belt\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0]\n\n// Use a switch statement:\nlet capitalA = switch a {\n| Some(a) => Some(Js.String.toUpperCase(a))\n| None => None\n}\n\nlet k = letters[10] // k == None\n```\n\nWith that little bit of tweaking, our code now compiles successfully and is 100% free of runtime errors\\!\n\n### A Special Encoding for Collection Safety\n\nWhen we create a collection library for a custom data type we need a way to provide a comparator function. Take Set for example, suppose its element type is a pair of ints, it needs a custom compare function that takes two tuples and returns their order. The Set could not just be typed as Set.t (int \\* int) , its customized compare function needs to manifest itself in the signature, otherwise, if the user creates another customized compare function, the two collection could mix which would result in runtime error.\n\nWe use a phantom type to solve the problem:\n\n## Examples\n\n```rescript\nmodule Comparable1 = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet1 = Belt.Set.make(~id=module(Comparable1))\n\nmodule Comparable2 = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet2 = Belt.Set.make(~id=module(Comparable2))\n```\n\nHere, the compiler would infer `mySet1` and `mySet2` having different type, so e.g. a `merge` operation that tries to merge these two sets will correctly fail.\n\n## Examples\n\n```rescript\nlet mySet1: t<(int, int), Comparable1.identity> = %todo\nlet mySet2: t<(int, int), Comparable2.identity> = %todo\n```\n\n`Comparable1.identity` and `Comparable2.identity` are not the same using our encoding scheme." - ], - "items": [] - }, - "belt/hashmap/string": { - "id": "Belt.HashMap.String", - "name": "String", - "docstrings": [ - "Specalized when key type is `string`, more efficient than the generic type" - ], - "items": [ - { - "id": "Belt.HashMap.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.HashMap.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'b>" - }, - { - "id": "Belt.HashMap.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t<'b>" - }, - { - "id": "Belt.HashMap.String.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'b> => unit" - }, - { - "id": "Belt.HashMap.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.HashMap.String.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`setDone(tbl, k, v)` if `k` does not exist, add the binding `k,v`, otherwise,\nupdate the old value with the new `v`" - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.HashMap.String.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.HashMap.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.HashMap.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'b>, key) => bool" - }, - { - "id": "Belt.HashMap.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.HashMap.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'b>, (key, 'b) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashMap.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'b>, (key, 'b) => unit) => unit" - }, - { - "id": "Belt.HashMap.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashMap.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c" - }, - { - "id": "Belt.HashMap.String.keepMapInPlaceU", - "kind": "value", - "name": "keepMapInPlaceU", - "docstrings": [], - "signature": "let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit", - "deprecated": "Use `keepMapInPlace` instead" - }, - { - "id": "Belt.HashMap.String.keepMapInPlace", - "kind": "value", - "name": "keepMapInPlace", - "docstrings": [], - "signature": "let keepMapInPlace: (t<'a>, (key, 'a) => option<'a>) => unit" - }, - { - "id": "Belt.HashMap.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.HashMap.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.HashMap.String.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.HashMap.String.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.HashMap.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.HashMap.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'a>, array<(key, 'a)>) => unit" - }, - { - "id": "Belt.HashMap.String.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t<'a> => array" - }, - { - "id": "Belt.HashMap.String.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t<'a> => unit" - } - ] - }, - "belt/hashmap/int": { - "id": "Belt.HashMap.Int", - "name": "Int", - "docstrings": [ - "Specalized when key type is `int`, more efficient than the generic type" - ], - "items": [ - { - "id": "Belt.HashMap.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.HashMap.Int.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'b>" - }, - { - "id": "Belt.HashMap.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t<'b>" - }, - { - "id": "Belt.HashMap.Int.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'b> => unit" - }, - { - "id": "Belt.HashMap.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.HashMap.Int.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`setDone(tbl, k, v)` if `k` does not exist, add the binding `k,v`, otherwise,\nupdate the old value with the new `v`" - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.HashMap.Int.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.HashMap.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.HashMap.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'b>, key) => bool" - }, - { - "id": "Belt.HashMap.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.HashMap.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'b>, (key, 'b) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashMap.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'b>, (key, 'b) => unit) => unit" - }, - { - "id": "Belt.HashMap.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashMap.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c" - }, - { - "id": "Belt.HashMap.Int.keepMapInPlaceU", - "kind": "value", - "name": "keepMapInPlaceU", - "docstrings": [], - "signature": "let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit", - "deprecated": "Use `keepMapInPlace` instead" - }, - { - "id": "Belt.HashMap.Int.keepMapInPlace", - "kind": "value", - "name": "keepMapInPlace", - "docstrings": [], - "signature": "let keepMapInPlace: (t<'a>, (key, 'a) => option<'a>) => unit" - }, - { - "id": "Belt.HashMap.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.HashMap.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.HashMap.Int.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.HashMap.Int.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.HashMap.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.HashMap.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'a>, array<(key, 'a)>) => unit" - }, - { - "id": "Belt.HashMap.Int.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t<'a> => array" - }, - { - "id": "Belt.HashMap.Int.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t<'a> => unit" - } - ] - }, - "belt/hashset/string": { - "id": "Belt.HashSet.String", - "name": "String", - "docstrings": [ - "Specalized when key type is `string`, more efficient than the generic type", - "This module is [`Belt.HashSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.HashSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.HashSet`]()" - ], - "items": [ - { - "id": "Belt.HashSet.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.HashSet.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Belt.HashSet.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t" - }, - { - "id": "Belt.HashSet.String.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Belt.HashSet.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.HashSet.String.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, key) => unit" - }, - { - "id": "Belt.HashSet.String.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.HashSet.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, key) => bool" - }, - { - "id": "Belt.HashSet.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, key) => unit" - }, - { - "id": "Belt.HashSet.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, key => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashSet.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, key => unit) => unit" - }, - { - "id": "Belt.HashSet.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'c, ('c, key) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashSet.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, 'c, ('c, key) => 'c) => 'c" - }, - { - "id": "Belt.HashSet.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.HashSet.String.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t => unit" - }, - { - "id": "Belt.HashSet.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.HashSet.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.HashSet.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.HashSet.String.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t => array" - } - ] - }, - "belt/hashset/int": { - "id": "Belt.HashSet.Int", - "name": "Int", - "docstrings": [ - "Specalized when key type is `int`, more efficient than the generic type", - "This module is [`Belt.HashSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.HashSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.HashSet`]()" - ], - "items": [ - { - "id": "Belt.HashSet.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.HashSet.Int.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Belt.HashSet.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t" - }, - { - "id": "Belt.HashSet.Int.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Belt.HashSet.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.HashSet.Int.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, key) => unit" - }, - { - "id": "Belt.HashSet.Int.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.HashSet.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, key) => bool" - }, - { - "id": "Belt.HashSet.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, key) => unit" - }, - { - "id": "Belt.HashSet.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, key => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashSet.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, key => unit) => unit" - }, - { - "id": "Belt.HashSet.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'c, ('c, key) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashSet.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, 'c, ('c, key) => 'c) => 'c" - }, - { - "id": "Belt.HashSet.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.HashSet.Int.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t => unit" - }, - { - "id": "Belt.HashSet.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.HashSet.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.HashSet.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.HashSet.Int.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t => array" - } - ] - }, - "belt/mutablemap/string": { - "id": "Belt.MutableMap.String", - "name": "String", - "docstrings": [], - "items": [ - { - "id": "Belt.MutableMap.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.MutableMap.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableMap.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableMap.String.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableMap.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a>, key) => bool" - }, - { - "id": "Belt.MutableMap.String.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.MutableMap.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m1, m2, cmp)`. First compare by size, if size is the same, compare by key,\nvalue pair" - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.MutableMap.String.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.MutableMap.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, cmp)`" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, (key, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableMap.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the key as\nfirst argument, and the associated value as second argument. The application \norder of `f` is in increasing order." - ], - "signature": "let forEach: (t<'a>, (key, 'a) => unit) => unit" - }, - { - "id": "Belt.MutableMap.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableMap.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`, where `k1 ... kN` are\nthe keys of all bindings in `m` (in increasing order), and `d1 ... dN` are the\nassociated data." - ], - "signature": "let reduce: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableMap.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableMap.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let every: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableMap.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let some: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableMap.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t<'a> => list<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order" - ], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.MutableMap.String.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.MutableMap.String.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.MutableMap.String.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.String.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.String.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.String.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.MutableMap.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'a>, key) => Js.undefined<'a>" - }, - { - "id": "Belt.MutableMap.String.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, key, 'a) => 'a" - }, - { - "id": "Belt.MutableMap.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` do the in-place modification" - ], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.MutableMap.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'a>, array) => unit" - }, - { - "id": "Belt.MutableMap.String.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` do the in-place modification, return `m` for chaining. If `x` was\nalready bound in `m`, its previous binding disappears." - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.MutableMap.String.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'a>, key, option<'a> => option<'a>) => unit", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.MutableMap.String.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'a>, key, option<'a> => option<'a>) => unit" - }, - { - "id": "Belt.MutableMap.String.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableMap.String.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.MutableMap.String.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'a>, (key, 'a) => 'b) => t<'b>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.MutableMap.String.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'a>, (key, 'a) => 'b) => t<'b>" - } - ] - }, - "belt/mutablemap/int": { - "id": "Belt.MutableMap.Int", - "name": "Int", - "docstrings": [], - "items": [ - { - "id": "Belt.MutableMap.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.MutableMap.Int.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableMap.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableMap.Int.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableMap.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a>, key) => bool" - }, - { - "id": "Belt.MutableMap.Int.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.MutableMap.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m1, m2, cmp)`. First compare by size, if size is the same, compare by key,\nvalue pair" - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.MutableMap.Int.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.MutableMap.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, cmp)`" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, (key, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableMap.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the key as\nfirst argument, and the associated value as second argument. The application \norder of `f` is in increasing order." - ], - "signature": "let forEach: (t<'a>, (key, 'a) => unit) => unit" - }, - { - "id": "Belt.MutableMap.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableMap.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`, where `k1 ... kN` are\nthe keys of all bindings in `m` (in increasing order), and `d1 ... dN` are the\nassociated data." - ], - "signature": "let reduce: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableMap.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableMap.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let every: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableMap.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let some: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableMap.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t<'a> => list<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order" - ], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.MutableMap.Int.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.MutableMap.Int.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.MutableMap.Int.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.Int.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.Int.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.Int.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.MutableMap.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'a>, key) => Js.undefined<'a>" - }, - { - "id": "Belt.MutableMap.Int.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, key, 'a) => 'a" - }, - { - "id": "Belt.MutableMap.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**Throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` do the in-place modification" - ], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.MutableMap.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'a>, array) => unit" - }, - { - "id": "Belt.MutableMap.Int.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` do the in-place modification, return `m` for chaining. If `x` was\nalready bound in `m`, its previous binding disappears." - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.MutableMap.Int.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'a>, key, option<'a> => option<'a>) => unit", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.MutableMap.Int.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'a>, key, option<'a> => option<'a>) => unit" - }, - { - "id": "Belt.MutableMap.Int.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableMap.Int.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.MutableMap.Int.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'a>, (key, 'a) => 'b) => t<'b>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.MutableMap.Int.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'a>, (key, 'a) => 'b) => t<'b>" - } - ] - }, - "belt/mutableset/string": { - "id": "Belt.MutableSet.String", - "name": "String", - "docstrings": [ - "Specialized when key type is `string`, more efficient than the generic type", - "This module is [`Belt.MutableSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.MutableSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.MutableSet`]()" - ], - "items": [ - { - "id": "Belt.MutableSet.String.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = string" - }, - { - "id": "Belt.MutableSet.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.MutableSet.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t" - }, - { - "id": "Belt.MutableSet.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.MutableSet.String.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.MutableSet.String.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.MutableSet.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.MutableSet.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.String.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.String.addCheck", - "kind": "value", - "name": "addCheck", - "docstrings": [], - "signature": "let addCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.String.removeCheck", - "kind": "value", - "name": "removeCheck", - "docstrings": [], - "signature": "let removeCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.String.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.MutableSet.String.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.MutableSet.String.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.MutableSet.String.subset", - "kind": "value", - "name": "subset", - "docstrings": [], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.MutableSet.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableSet.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.MutableSet.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableSet.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.MutableSet.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableSet.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`.\nOrder unspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableSet.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.String.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.MutableSet.String.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(s, p)` returns a fresh copy of the set of all elements in `s` that satisfy\npredicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.MutableSet.String.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.MutableSet.String.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(s, p)` returns a fresh copy pair of sets `(s1, s2)`, where `s1` is\nthe set of all the elements of `s` that satisfy the predicate `p`, and `s2` is\nthe set of all the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.MutableSet.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.MutableSet.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.MutableSet.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.MutableSet.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.MutableSet.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.MutableSet.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.MutableSet.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.MutableSet.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.MutableSet.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.MutableSet.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(s, key)` return a fresh copy of each" - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.MutableSet.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/mutableset/int": { - "id": "Belt.MutableSet.Int", - "name": "Int", - "docstrings": [ - "Specialized when key type is `int`, more efficient than the generic type", - "This module is [`Belt.MutableSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.MutableSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.MutableSet`]()" - ], - "items": [ - { - "id": "Belt.MutableSet.Int.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = int" - }, - { - "id": "Belt.MutableSet.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.MutableSet.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t" - }, - { - "id": "Belt.MutableSet.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.MutableSet.Int.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.MutableSet.Int.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.MutableSet.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.MutableSet.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.Int.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.Int.addCheck", - "kind": "value", - "name": "addCheck", - "docstrings": [], - "signature": "let addCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.Int.removeCheck", - "kind": "value", - "name": "removeCheck", - "docstrings": [], - "signature": "let removeCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.Int.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.MutableSet.Int.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.MutableSet.Int.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.MutableSet.Int.subset", - "kind": "value", - "name": "subset", - "docstrings": [], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.MutableSet.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableSet.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.MutableSet.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableSet.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.MutableSet.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableSet.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`.\nOrder unspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableSet.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.Int.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.MutableSet.Int.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(s, p)` returns a fresh copy of the set of all elements in `s` that satisfy\npredicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.MutableSet.Int.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.MutableSet.Int.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(s, p)` returns a fresh copy pair of sets `(s1, s2)`, where `s1` is\nthe set of all the elements of `s` that satisfy the predicate `p`, and `s2` is\nthe set of all the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.MutableSet.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.MutableSet.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.MutableSet.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.MutableSet.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.MutableSet.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.MutableSet.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.MutableSet.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.MutableSet.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.MutableSet.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.MutableSet.Int.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(s, key)` return a fresh copy of each" - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.MutableSet.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/map/dict": { - "id": "Belt.Map.Dict", - "name": "Dict", - "docstrings": [ - "This module separates identity from data, it is a bit more verbose but\nslightly more efficient due to the fact that there is no need to pack\nidentity and data back after each operation.\n\n**_Advanced usage only_**" - ], - "items": [ - { - "id": "Belt.Map.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'key, 'value, 'id>" - }, - { - "id": "Belt.Map.Dict.cmp", - "kind": "type", - "name": "cmp", - "docstrings": [], - "signature": "type cmp<'key, 'id> = Belt_Id.cmp<'key, 'id>" - }, - { - "id": "Belt.Map.Dict.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.Dict.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'k, 'v, 'id> => bool" - }, - { - "id": "Belt.Map.Dict.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => bool" - }, - { - "id": "Belt.Map.Dict.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (\n t<'k, 'v, 'id>,\n t<'k, 'v, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~vcmp: ('v, 'v) => int,\n) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.Dict.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (\n t<'k, 'v, 'id>,\n t<'k, 'v, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~vcmp: ('v, 'v) => int,\n) => int" - }, - { - "id": "Belt.Map.Dict.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (\n t<'k, 'a, 'id>,\n t<'k, 'a, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~veq: ('a, 'a) => bool,\n) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.Dict.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, cmp)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `cmp` is the\nequality predicate used to compare the data associated with the keys." - ], - "signature": "let eq: (\n t<'k, 'a, 'id>,\n t<'k, 'a, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~veq: ('a, 'a) => bool,\n) => bool" - }, - { - "id": "Belt.Map.Dict.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.Dict.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`findFirstBy(m, p)` uses function `f` to find the first key value pair to\nmatch predicate `p`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Map.Dict.fromArray([(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")], ~cmp=IntCmp.cmp)\n\nBelt.Map.Dict.findFirstBy(s0, (k, _) => k == 4) == Some((4, \"4\"))\n```" - ], - "signature": "let findFirstBy: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>" - }, - { - "id": "Belt.Map.Dict.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.Dict.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the\nkey as first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys." - ], - "signature": "let forEach: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit" - }, - { - "id": "Belt.Map.Dict.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.Dict.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `f(kN, dN ... f(k1, d1, a)...)`, where `k1 ... kN` \nare the keys of all bindings in `m` (in increasing order), and `d1 ... dN` \nare the associated data." - ], - "signature": "let reduce: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b" - }, - { - "id": "Belt.Map.Dict.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.Dict.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let every: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.Map.Dict.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.Dict.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the\npredicate `p`. Order unspecified" - ], - "signature": "let some: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.Map.Dict.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'k, 'a, 'id> => int" - }, - { - "id": "Belt.Map.Dict.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'k, 'a, 'id> => list<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'k, 'a, 'id> => array<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: (array<('k, 'a)>, ~cmp: cmp<'k, 'id>) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.Map.Dict.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'k, 'a, 'id> => array<'k>" - }, - { - "id": "Belt.Map.Dict.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'k, 'a, 'id> => array<'a>" - }, - { - "id": "Belt.Map.Dict.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.Dict.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.Dict.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.Dict.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.Dict.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => option<'a>" - }, - { - "id": "Belt.Map.Dict.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => Js.undefined<'a>" - }, - { - "id": "Belt.Map.Dict.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'k, 'a, 'id>, 'k, 'a, ~cmp: cmp<'k, 'id>) => 'a" - }, - { - "id": "Belt.Map.Dict.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => 'a" - }, - { - "id": "Belt.Map.Dict.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => 'a" - }, - { - "id": "Belt.Map.Dict.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [], - "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit" - }, - { - "id": "Belt.Map.Dict.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` returns a map containing the same bindings as `m`, except\nfor `x` which is unbound in the returned map." - ], - "signature": "let remove: (t<'a, 'b, 'id>, 'a, ~cmp: cmp<'a, 'id>) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (\n t<'a, 'b, 'id>,\n array<'a>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as `m`, plus a\nbinding of `x` to `y`. If `x` was already bound in `m`, its previous\nbinding disappears." - ], - "signature": "let set: (\n t<'a, 'b, 'id>,\n 'a,\n 'b,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (\n t<'a, 'b, 'id>,\n 'a,\n option<'b> => option<'b>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.Dict.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (\n t<'a, 'b, 'id>,\n 'a,\n option<'b> => option<'b>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'a, 'b, 'id>,\n t<'a, 'c, 'id>,\n ('a, option<'b>, option<'c>) => option<'d>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'd, 'id>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.Dict.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'a, 'b, 'id>,\n t<'a, 'c, 'id>,\n ('a, option<'b>, option<'c>) => option<'d>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'd, 'id>" - }, - { - "id": "Belt.Map.Dict.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (\n t<'a, 'b, 'id>,\n array<('a, 'b)>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => t<'k, 'a, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.Dict.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in `m` that satisfy\npredicate `p`." - ], - "signature": "let keep: (t<'k, 'a, 'id>, ('k, 'a) => bool) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.Map.Dict.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'k, 'a, 'id>,\n ('k, 'a) => bool,\n) => (t<'k, 'a, 'id>, t<'k, 'a, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.Dict.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains\nall the bindings of `s` that satisfy the predicate `p`, and `m2` is the map\nwith all the bindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (\n t<'k, 'a, 'id>,\n ('k, 'a) => bool,\n) => (t<'k, 'a, 'id>, t<'k, 'a, 'id>)" - }, - { - "id": "Belt.Map.Dict.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with\nall the bindings of `m` whose key is strictly less than `x`; `r` is the map\nwith all the bindings of `m` whose key is strictly greater than `x`; `data`\nis `None` if `m` contains no binding for `x`, or `Some(v)` if `m` binds `v`\nto `x`." - ], - "signature": "let split: (\n t<'a, 'b, 'id>,\n 'a,\n ~cmp: cmp<'a, 'id>,\n) => ((t<'a, 'b, 'id>, t<'a, 'b, 'id>), option<'b>)" - }, - { - "id": "Belt.Map.Dict.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.Dict.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated\nvalue `a` of all bindings of `m` has been replaced by the result of the\napplication of `f` to `a`. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let map: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.Dict.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>" - } - ] - }, - "belt/map/string": { - "id": "Belt.Map.String", - "name": "String", - "docstrings": [], - "items": [ - { - "id": "Belt.Map.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.Map.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of maps from type `key` to type `'value`." - ], - "signature": "type t<'value>" - }, - { - "id": "Belt.Map.String.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t<'v>" - }, - { - "id": "Belt.Map.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'v> => bool" - }, - { - "id": "Belt.Map.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'v>, key) => bool" - }, - { - "id": "Belt.Map.String.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'v>, t<'v>, ('v, 'v) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t<'v>, t<'v>, ('v, 'v) => int) => int" - }, - { - "id": "Belt.Map.String.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'v>, t<'v>, ('v, 'v) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2)` tests whether the maps `m1` and `m2` are\nequal, that is, contain equal keys and associate them with\nequal data." - ], - "signature": "let eq: (t<'v>, t<'v>, ('v, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.String.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.String.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`findFirstBy(m, p)` uses funcion `f` to find the first key value pair\nto match predicate `p`.\n\n## Examples\n\n```rescript\nlet mapString = Belt.Map.String.fromArray([(\"1\", \"one\"), (\"2\", \"two\"), (\"3\", \"three\")])\n\nmapString->Belt.Map.String.findFirstBy((k, v) => k == \"1\" && v == \"one\") == Some(\"1\", \"one\")\n```" - ], - "signature": "let findFirstBy: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>" - }, - { - "id": "Belt.Map.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'v>, (key, 'v) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`.\n`f` receives the key as first argument, and the associated value\nas second argument. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let forEach: (t<'v>, (key, 'v) => unit) => unit" - }, - { - "id": "Belt.Map.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`,\nwhere `k1 ... kN` are the keys of all bindings in `m`\n(in increasing order), and `d1 ... dN` are the associated data." - ], - "signature": "let reduce: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2" - }, - { - "id": "Belt.Map.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nOrder unspecified" - ], - "signature": "let every: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let some: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'v> => int" - }, - { - "id": "Belt.Map.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'v> => list<(key, 'v)>" - }, - { - "id": "Belt.Map.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'v> => array<(key, 'v)>" - }, - { - "id": "Belt.Map.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'v)> => t<'v>" - }, - { - "id": "Belt.Map.String.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'v> => array" - }, - { - "id": "Belt.Map.String.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'v> => array<'v>" - }, - { - "id": "Belt.Map.String.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.Map.String.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.String.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.Map.String.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'v>, key) => option<'v>" - }, - { - "id": "Belt.Map.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'v>, key) => Js.undefined<'v>" - }, - { - "id": "Belt.Map.String.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'v>, key, 'v) => 'v" - }, - { - "id": "Belt.Map.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.Map.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove m x` returns a map containing the same bindings as\n `m`, except for `x` which is unbound in the returned map." - ], - "signature": "let remove: (t<'v>, key) => t<'v>" - }, - { - "id": "Belt.Map.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'v>, array) => t<'v>" - }, - { - "id": "Belt.Map.String.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as\n`m`, plus a binding of `x` to `y`. If `x` was already bound\nin `m`, its previous binding disappears." - ], - "signature": "let set: (t<'v>, key, 'v) => t<'v>" - }, - { - "id": "Belt.Map.String.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'v>, key, option<'v> => option<'v>) => t<'v>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.String.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'v>, key, option<'v> => option<'v>) => t<'v>" - }, - { - "id": "Belt.Map.String.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.String.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>" - }, - { - "id": "Belt.Map.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'v>, array<(key, 'v)>) => t<'v>" - }, - { - "id": "Belt.Map.String.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'v>, (key, 'v) => bool) => t<'v>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.String.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in `m` that satisfy predicate\n`p`." - ], - "signature": "let keep: (t<'v>, (key, 'v) => bool) => t<'v>" - }, - { - "id": "Belt.Map.String.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.String.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains all the\nbindings of `s` that satisfy the predicate `p`, and `m2` is the map with all the\nbindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)" - }, - { - "id": "Belt.Map.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with all the\nbindings of `m` whose key is strictly less than `x`; `r` is the map with all the\nbindings of `m` whose key is strictly greater than `x`; `data` is `None` if `m`\ncontains no binding for `x`, or `Some(v)` if `m` binds `v` to `x`." - ], - "signature": "let split: (key, t<'v>) => (t<'v>, option<'v>, t<'v>)" - }, - { - "id": "Belt.Map.String.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'v>, 'v => 'v2) => t<'v2>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.String.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'v>, 'v => 'v2) => t<'v2>" - }, - { - "id": "Belt.Map.String.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'v>, (key, 'v) => 'v2) => t<'v2>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.String.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'v>, (key, 'v) => 'v2) => t<'v2>" - } - ] - }, - "belt/map/int": { - "id": "Belt.Map.Int", - "name": "Int", - "docstrings": [ - "## Examples\n\n```rescript\ntype t<'key, 'value, 'identity>\ntype id<'key, 'id> = Belt_Id.comparable<'key, 'id>\n```" - ], - "items": [ - { - "id": "Belt.Map.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.Map.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of maps from type `key` to type `'value`." - ], - "signature": "type t<'value>" - }, - { - "id": "Belt.Map.Int.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t<'v>" - }, - { - "id": "Belt.Map.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'v> => bool" - }, - { - "id": "Belt.Map.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'v>, key) => bool" - }, - { - "id": "Belt.Map.Int.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'v>, t<'v>, ('v, 'v) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t<'v>, t<'v>, ('v, 'v) => int) => int" - }, - { - "id": "Belt.Map.Int.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'v>, t<'v>, ('v, 'v) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2)` tests whether the maps `m1` and `m2` are\nequal, that is, contain equal keys and associate them with\nequal data." - ], - "signature": "let eq: (t<'v>, t<'v>, ('v, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.Int.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.Int.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`findFirstBy(m, p)` uses funcion `f` to find the first key value pair\nto match predicate `p`.\n\n## Examples\n\n```rescript\nlet mapInt = Belt.Map.Int.fromArray([(1, \"one\"), (2, \"two\"), (3, \"three\")])\n\nmapInt->Belt.Map.Int.findFirstBy((k, v) => k == 1 && v == \"one\") == Some(1, \"one\")\n```" - ], - "signature": "let findFirstBy: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'v>, (key, 'v) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`.\n`f` receives the key as first argument, and the associated value\nas second argument. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let forEach: (t<'v>, (key, 'v) => unit) => unit" - }, - { - "id": "Belt.Map.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`,\nwhere `k1 ... kN` are the keys of all bindings in `m`\n(in increasing order), and `d1 ... dN` are the associated data." - ], - "signature": "let reduce: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2" - }, - { - "id": "Belt.Map.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nOrder unspecified" - ], - "signature": "let every: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let some: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'v> => int" - }, - { - "id": "Belt.Map.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'v> => list<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'v> => array<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'v)> => t<'v>" - }, - { - "id": "Belt.Map.Int.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'v> => array" - }, - { - "id": "Belt.Map.Int.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'v> => array<'v>" - }, - { - "id": "Belt.Map.Int.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.Map.Int.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.Int.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.Map.Int.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'v>, key) => option<'v>" - }, - { - "id": "Belt.Map.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'v>, key) => Js.undefined<'v>" - }, - { - "id": "Belt.Map.Int.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'v>, key, 'v) => 'v" - }, - { - "id": "Belt.Map.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.Map.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove m x` returns a map containing the same bindings as\n `m`, except for `x` which is unbound in the returned map." - ], - "signature": "let remove: (t<'v>, key) => t<'v>" - }, - { - "id": "Belt.Map.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'v>, array) => t<'v>" - }, - { - "id": "Belt.Map.Int.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as\n`m`, plus a binding of `x` to `y`. If `x` was already bound\nin `m`, its previous binding disappears." - ], - "signature": "let set: (t<'v>, key, 'v) => t<'v>" - }, - { - "id": "Belt.Map.Int.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'v>, key, option<'v> => option<'v>) => t<'v>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.Int.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'v>, key, option<'v> => option<'v>) => t<'v>" - }, - { - "id": "Belt.Map.Int.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.Int.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>" - }, - { - "id": "Belt.Map.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'v>, array<(key, 'v)>) => t<'v>" - }, - { - "id": "Belt.Map.Int.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'v>, (key, 'v) => bool) => t<'v>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.Int.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in `m` that satisfy predicate\n`p`." - ], - "signature": "let keep: (t<'v>, (key, 'v) => bool) => t<'v>" - }, - { - "id": "Belt.Map.Int.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.Int.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains all the\nbindings of `s` that satisfy the predicate `p`, and `m2` is the map with all the\nbindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)" - }, - { - "id": "Belt.Map.Int.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with all the\nbindings of `m` whose key is strictly less than `x`; `r` is the map with all the\nbindings of `m` whose key is strictly greater than `x`; `data` is `None` if `m`\ncontains no binding for `x`, or `Some(v)` if `m` binds `v` to `x`." - ], - "signature": "let split: (key, t<'v>) => (t<'v>, option<'v>, t<'v>)" - }, - { - "id": "Belt.Map.Int.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'v>, 'v => 'v2) => t<'v2>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.Int.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'v>, 'v => 'v2) => t<'v2>" - }, - { - "id": "Belt.Map.Int.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'v>, (key, 'v) => 'v2) => t<'v2>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.Int.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'v>, (key, 'v) => 'v2) => t<'v2>" - } - ] - }, - "belt/set/dict": { - "id": "Belt.Set.Dict", - "name": "Dict", - "docstrings": [ - "This module separates identity from data, it is a bit more verbose but slightly\nmore efficient due to the fact that there is no need to pack identity and data back\nafter each operation", - "This module separates identity from data. It is a bit more verbose but slightly\nmore efficient due to the fact that there is no need to pack identity and data\nback after each operation." - ], - "items": [ - { - "id": "Belt.Set.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'value, 'identity>" - }, - { - "id": "Belt.Set.Dict.cmp", - "kind": "type", - "name": "cmp", - "docstrings": [ - "Type of compare function." - ], - "signature": "type cmp<'value, 'id> = Belt_Id.cmp<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "## Examples\n\n```rescript\nlet s0 = Belt.Set.Dict.empty\n```" - ], - "signature": "let empty: t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 3, 2, 4], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let fromArray: (array<'value>, ~cmp: cmp<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [ - "The same as [fromArray][#fromarray] except it is after assuming the input array\nis already sorted." - ], - "signature": "let fromSortedArrayUnsafe: array<'value> => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.Set.Dict.fromArray([], ~cmp=IntCmp.cmp)\nlet notEmpty = Belt.Set.Dict.fromArray([1], ~cmp=IntCmp.cmp)\n\nBelt.Set.Dict.isEmpty(empty) == true\nBelt.Set.Dict.isEmpty(notEmpty) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.Set.Dict.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if an element exists in the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.fromArray([1, 4, 2, 5], ~cmp=IntCmp.cmp)\n\nset->Belt.Set.Dict.has(3, ~cmp=IntCmp.cmp) == false\nset->Belt.Set.Dict.has(1, ~cmp=IntCmp.cmp) == true\n```" - ], - "signature": "let has: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => bool" - }, - { - "id": "Belt.Set.Dict.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = s0->Belt.Set.Dict.add(1, ~cmp=IntCmp.cmp)\nlet s2 = s1->Belt.Set.Dict.add(2, ~cmp=IntCmp.cmp)\nlet s3 = s2->Belt.Set.Dict.add(2, ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.toArray == []\ns1->Belt.Set.Dict.toArray == [1]\ns2->Belt.Set.Dict.toArray == [1, 2]\ns3->Belt.Set.Dict.toArray == [1, 2]\ns2 == s3\n```" - ], - "signature": "let add: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "Adds each element of array to set. Unlike [add](#add), the reference of return value might be changed even if all values in array already exist in set\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.empty\n\nlet newSet = set->Belt.Set.Dict.mergeMany([5, 4, 3, 2, 1], ~cmp=IntCmp.cmp)\nnewSet->Belt.Set.Dict.toArray == [1, 2, 3, 4, 5]\n```" - ], - "signature": "let mergeMany: (\n t<'value, 'id>,\n array<'value>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([2, 3, 1, 4, 5], ~cmp=IntCmp.cmp)\nlet s1 = s0->Belt.Set.Dict.remove(1, ~cmp=IntCmp.cmp)\nlet s2 = s1->Belt.Set.Dict.remove(3, ~cmp=IntCmp.cmp)\nlet s3 = s2->Belt.Set.Dict.remove(3, ~cmp=IntCmp.cmp)\n\ns1->Belt.Set.Dict.toArray == [2, 3, 4, 5]\ns2->Belt.Set.Dict.toArray == [2, 4, 5]\ns2 == s3\n```" - ], - "signature": "let remove: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "Removes each element of array from set. Unlike [remove](#remove), the reference of return value might be changed even if any values in array not existed in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.fromArray([1, 2, 3, 4], ~cmp=IntCmp.cmp)\n\nlet newSet = set->Belt.Set.Dict.removeMany([5, 4, 3, 2, 1], ~cmp=IntCmp.cmp)\nnewSet->Belt.Set.Dict.toArray == []\n```" - ], - "signature": "let removeMany: (\n t<'value, 'id>,\n array<'value>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet union = Belt.Set.Dict.union(s0, s1, ~cmp=IntCmp.cmp)\nunion->Belt.Set.Dict.toArray == [1, 2, 3, 4, 5, 6]\n```" - ], - "signature": "let union: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet intersect = Belt.Set.Dict.intersect(s0, s1, ~cmp=IntCmp.cmp)\nintersect->Belt.Set.Dict.toArray == [2, 3, 5]\n```" - ], - "signature": "let intersect: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.diff", - "kind": "value", - "name": "diff", - "docstrings": [ - "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\n\nlet diff1 = Belt.Set.Dict.diff(s0, s1, ~cmp=IntCmp.cmp)\nlet diff2 = Belt.Set.Dict.diff(s1, s0, ~cmp=IntCmp.cmp)\n\ndiff1->Belt.Set.Dict.toArray == [6]\ndiff2->Belt.Set.Dict.toArray == [1, 4]\n```" - ], - "signature": "let diff: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet s2 = Belt.Set.Dict.intersect(s0, s1, ~cmp=IntCmp.cmp)\nBelt.Set.Dict.subset(s2, s0, ~cmp=IntCmp.cmp) == true\nBelt.Set.Dict.subset(s2, s1, ~cmp=IntCmp.cmp) == true\nBelt.Set.Dict.subset(s1, s0, ~cmp=IntCmp.cmp) == false\n```" - ], - "signature": "let subset: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => bool" - }, - { - "id": "Belt.Set.Dict.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets. It compares size first and then iterates over each element following the\norder of elements." - ], - "signature": "let cmp: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => int" - }, - { - "id": "Belt.Set.Dict.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 5], ~cmp=IntCmp.cmp)\n\nBelt.Set.Dict.eq(s0, s1, ~cmp=IntCmp.cmp) == true\n```" - ], - "signature": "let eq: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => bool" - }, - { - "id": "Belt.Set.Dict.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as [forEach](##forEach) but takes uncurried functon." - ], - "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.Dict.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet acc = ref(list{})\ns0->Belt.Set.Dict.forEach(x => acc := Belt.List.add(acc.contents, x))\nacc.contents == list{6, 5, 3, 2}\n```" - ], - "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit" - }, - { - "id": "Belt.Set.Dict.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.Dict.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) == list{6, 5, 3, 2}\n```" - ], - "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a" - }, - { - "id": "Belt.Set.Dict.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.Dict.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.Dict.fromArray([2, 4, 6, 8], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.every(isEven) == true\n```" - ], - "signature": "let every: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.Dict.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.Dict.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 4, 6, 8], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.some(isOdd) == true\n```" - ], - "signature": "let some: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.Dict.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.Dict.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\nlet s1 = s0->Belt.Set.Dict.keep(isEven)\n\ns1->Belt.Set.Dict.toArray == [2, 4]\n```" - ], - "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.Dict.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "Returns a pair of sets, where first is the set of all the elements of set that satisfy the predicate, and second is the set of all the elements of set that do not satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\nlet (s1, s2) = s0->Belt.Set.Dict.partition(isOdd)\n\ns1->Belt.Set.Dict.toArray == [1, 3, 5]\ns2->Belt.Set.Dict.toArray == [2, 4]\n```" - ], - "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)" - }, - { - "id": "Belt.Set.Dict.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.size == 4\n```" - ], - "signature": "let size: t<'value, 'id> => int" - }, - { - "id": "Belt.Set.Dict.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toList == list{1, 2, 3, 5}\n```" - ], - "signature": "let toList: t<'value, 'id> => list<'value>" - }, - { - "id": "Belt.Set.Dict.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toArray == [1, 2, 3, 5]\n```" - ], - "signature": "let toArray: t<'value, 'id> => array<'value>" - }, - { - "id": "Belt.Set.Dict.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.minimum == None\ns1->Belt.Set.Dict.minimum == Some(1)\n```" - ], - "signature": "let minimum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.Dict.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "Returns minimum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.minUndefined == Js.undefined\ns1->Belt.Set.Dict.minUndefined == Js.Undefined.return(1)\n```" - ], - "signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.Dict.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.maximum == None\ns1->Belt.Set.Dict.maximum == Some(5)\n```" - ], - "signature": "let maximum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.Dict.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "Returns maximum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.maxUndefined == Js.undefined\ns1->Belt.Set.Dict.maxUndefined == Js.Undefined.return(5)\n```" - ], - "signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the reference of the value which is equivalent to value using the comparator\nspecifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.get(3, ~cmp=IntCmp.cmp) == Some(3)\ns0->Belt.Set.Dict.get(20, ~cmp=IntCmp.cmp) == None\n```" - ], - "signature": "let get: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => option<'value>" - }, - { - "id": "Belt.Set.Dict.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "Same as [get](#get) but returns `undefined` when element does not exist." - ], - "signature": "let getUndefined: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => Js.undefined<'value>" - }, - { - "id": "Belt.Set.Dict.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getExn: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => 'value" - }, - { - "id": "Belt.Set.Dict.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getOrThrow: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => 'value" - }, - { - "id": "Belt.Set.Dict.split", - "kind": "value", - "name": "split", - "docstrings": [ - "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\n\nlet ((smaller, larger), present) = s0->Belt.Set.Dict.split(3, ~cmp=IntCmp.cmp)\n\npresent == true\nsmaller->Belt.Set.Dict.toArray == [1, 2]\nlarger->Belt.Set.Dict.toArray == [4, 5]\n```" - ], - "signature": "let split: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)" - }, - { - "id": "Belt.Set.Dict.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b> => unit" - } - ] - }, - "belt/set/string": { - "id": "Belt.Set.String", - "name": "String", - "docstrings": [ - "Specialized when value type is `string`, more efficient than the generic type,\nits compare behavior is fixed using the built-in comparison", - "This module is [`Belt.Set`]() specialized with value type to be a primitive type.\nIt is more efficient in general, the API is the same with [`Belt_Set`]() except its value type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.Set`]()" - ], - "items": [ - { - "id": "Belt.Set.String.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = string" - }, - { - "id": "Belt.Set.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.Set.String.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t" - }, - { - "id": "Belt.Set.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.Set.String.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.Set.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.Set.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.Set.String.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(s, x)` If `x` was already in `s`, `s` is returned unchanged." - ], - "signature": "let add: (t, value) => t" - }, - { - "id": "Belt.Set.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => t" - }, - { - "id": "Belt.Set.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` If `x` was not in `m`, `m` is returned reference unchanged." - ], - "signature": "let remove: (t, value) => t" - }, - { - "id": "Belt.Set.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => t" - }, - { - "id": "Belt.Set.String.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.Set.String.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.Set.String.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.Set.String.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "`subset(s1, s2)` tests whether the set `s1` is a subset of the set `s2`." - ], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.Set.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets." - ], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.Set.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(s1, s2)` tests whether the sets `s1` and `s2` are equal, that is, contain\nequal elements." - ], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.Set.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(s, f)` applies `f` in turn to all elements of `s`. In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.Set.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.Set.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`. Order\nunspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.String.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.String.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(p, s)` returns the set of all elements in `s` that satisfy predicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.Set.String.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.String.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(p, s)` returns a pair of sets `(s1, s2)`, where `s1` is the set of\nall the elements of `s` that satisfy the predicate `p`, and `s2` is the set of\nall the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.Set.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.Set.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.Set.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.Set.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.Set.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.Set.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.Set.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.Set.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.Set.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.Set.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, s)` returns a triple `(l, present, r)`, where `l` is the set of\nelements of `s` that are strictly less than `x`;`r` is the set of elements of\n`s` that are strictly greater than `x`; `present` is `false` if `s` contains no\nelement equal to `x`, or `true` if `s` contains an element equal to `x`." - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.Set.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/set/int": { - "id": "Belt.Set.Int", - "name": "Int", - "docstrings": [ - "Specialized when value type is `int`, more efficient than the generic type, its\ncompare behavior is fixed using the built-in comparison", - "This module is [`Belt.Set`]() specialized with value type to be a primitive type.\nIt is more efficient in general, the API is the same with [`Belt_Set`]() except its value type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.Set`]()" - ], - "items": [ - { - "id": "Belt.Set.Int.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = int" - }, - { - "id": "Belt.Set.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.Set.Int.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t" - }, - { - "id": "Belt.Set.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.Set.Int.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.Set.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.Set.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.Set.Int.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(s, x)` If `x` was already in `s`, `s` is returned unchanged." - ], - "signature": "let add: (t, value) => t" - }, - { - "id": "Belt.Set.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => t" - }, - { - "id": "Belt.Set.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` If `x` was not in `m`, `m` is returned reference unchanged." - ], - "signature": "let remove: (t, value) => t" - }, - { - "id": "Belt.Set.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => t" - }, - { - "id": "Belt.Set.Int.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.Set.Int.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.Set.Int.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.Set.Int.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "`subset(s1, s2)` tests whether the set `s1` is a subset of the set `s2`." - ], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.Set.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets." - ], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.Set.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(s1, s2)` tests whether the sets `s1` and `s2` are equal, that is, contain\nequal elements." - ], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.Set.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(s, f)` applies `f` in turn to all elements of `s`. In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.Set.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.Set.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`. Order\nunspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.Int.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.Int.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(p, s)` returns the set of all elements in `s` that satisfy predicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.Set.Int.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.Int.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(p, s)` returns a pair of sets `(s1, s2)`, where `s1` is the set of\nall the elements of `s` that satisfy the predicate `p`, and `s2` is the set of\nall the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.Set.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.Set.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.Set.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.Set.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.Set.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.Set.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.Set.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.Set.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.Set.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.Set.Int.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, s)` returns a triple `(l, present, r)`, where `l` is the set of\nelements of `s` that are strictly less than `x`;`r` is the set of elements of\n`s` that are strictly greater than `x`; `present` is `false` if `s` contains no\nelement equal to `x`, or `true` if `s` contains an element equal to `x`." - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.Set.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/sortarray/string": { - "id": "Belt.SortArray.String", - "name": "String", - "docstrings": [ - "Specalized when key type is `string`, more efficient than the generic type", - "This is a specialized module for [`Belt_SortArray`](), the docs in that module also\napplies here, except the comparator is fixed and inlined" - ], - "items": [ - { - "id": "Belt.SortArray.String.element", - "kind": "type", - "name": "element", - "docstrings": [], - "signature": "type element = string" - }, - { - "id": "Belt.SortArray.String.strictlySortedLength", - "kind": "value", - "name": "strictlySortedLength", - "docstrings": [ - "The same as [`Belt_SortArray.strictlySortedLength`]() except the comparator is fixed\n\n**return** `+n` means increasing order `-n` means negative order" - ], - "signature": "let strictlySortedLength: array => int" - }, - { - "id": "Belt.SortArray.String.isSorted", - "kind": "value", - "name": "isSorted", - "docstrings": [ - "`sorted(xs)` return true if `xs` is in non strict increasing order" - ], - "signature": "let isSorted: array => bool" - }, - { - "id": "Belt.SortArray.String.stableSortInPlace", - "kind": "value", - "name": "stableSortInPlace", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortInPlaceBy`]() except the comparator is fixed" - ], - "signature": "let stableSortInPlace: array => unit" - }, - { - "id": "Belt.SortArray.String.stableSort", - "kind": "value", - "name": "stableSort", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortBy`]() except the comparator is fixed" - ], - "signature": "let stableSort: array => array" - }, - { - "id": "Belt.SortArray.String.binarySearch", - "kind": "value", - "name": "binarySearch", - "docstrings": [ - "If value is not found and value is less than one or more elements in array,\nthe negative number returned is the bitwise complement of the index of the first element\nthat is larger than value.\n\nIf value is not found and value is greater than all elements in array,\nthe negative number returned is the bitwise complement of\n(the index of the last element plus 1)\n\nfor example, if `key` is smaller than all elements return `-1` since `lnot (-1) = 0`\nif `key` is larger than all elements return `- (len + 1)` since `lnot (-(len+1)) = len`" - ], - "signature": "let binarySearch: (array, element) => int" - }, - { - "id": "Belt.SortArray.String.union", - "kind": "value", - "name": "union", - "docstrings": [ - "`union(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp)` assume\n`src` and `src2` is strictly sorted. for equivalent elements, it is picked from\n`src` also assume that `dst` is large enough to store all elements" - ], - "signature": "let union: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.String.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.String.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - } - ] - }, - "belt/sortarray/int": { - "id": "Belt.SortArray.Int", - "name": "Int", - "docstrings": [ - "Specalized when key type is `int`, more efficient than the generic type", - "This is a specialized module for [`Belt_SortArray`](), the docs in that module also\napplies here, except the comparator is fixed and inlined" - ], - "items": [ - { - "id": "Belt.SortArray.Int.element", - "kind": "type", - "name": "element", - "docstrings": [], - "signature": "type element = int" - }, - { - "id": "Belt.SortArray.Int.strictlySortedLength", - "kind": "value", - "name": "strictlySortedLength", - "docstrings": [ - "The same as [`Belt_SortArray.strictlySortedLength`]() except the comparator is fixed\n\n**return** `+n` means increasing order `-n` means negative order" - ], - "signature": "let strictlySortedLength: array => int" - }, - { - "id": "Belt.SortArray.Int.isSorted", - "kind": "value", - "name": "isSorted", - "docstrings": [ - "`sorted(xs)` return true if `xs` is in non strict increasing order" - ], - "signature": "let isSorted: array => bool" - }, - { - "id": "Belt.SortArray.Int.stableSortInPlace", - "kind": "value", - "name": "stableSortInPlace", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortInPlaceBy`]() except the comparator is fixed" - ], - "signature": "let stableSortInPlace: array => unit" - }, - { - "id": "Belt.SortArray.Int.stableSort", - "kind": "value", - "name": "stableSort", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortBy`]() except the comparator is fixed" - ], - "signature": "let stableSort: array => array" - }, - { - "id": "Belt.SortArray.Int.binarySearch", - "kind": "value", - "name": "binarySearch", - "docstrings": [ - "If value is not found and value is less than one or more elements in array,\nthe negative number returned is the bitwise complement of the index of the first element\nthat is larger than value.\n\nIf value is not found and value is greater than all elements in array,\nthe negative number returned is the bitwise complement of\n(the index of the last element plus 1)\n\nfor example, if `key` is smaller than all elements return `-1` since `lnot (-1) = 0`\nif `key` is larger than all elements return `- (len + 1)` since `lnot (-(len+1)) = len`" - ], - "signature": "let binarySearch: (array, element) => int" - }, - { - "id": "Belt.SortArray.Int.union", - "kind": "value", - "name": "union", - "docstrings": [ - "`union(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp)` assume\n`src` and `src2` is strictly sorted. for equivalent elements, it is picked from\n`src` also assume that `dst` is large enough to store all elements" - ], - "signature": "let union: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.Int.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.Int.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - } - ] - }, - "belt/id/makehashable": { - "id": "Belt.Id.MakeHashable", - "name": "MakeHashable", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeHashable.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeHashable.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeHashable.hash", - "kind": "value", - "name": "hash", - "docstrings": [], - "signature": "let hash: hash" - }, - { - "id": "Belt.Id.MakeHashable.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: eq" - } - ] - }, - "belt/id/makehashableu": { - "id": "Belt.Id.MakeHashableU", - "name": "MakeHashableU", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeHashableU.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeHashableU.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeHashableU.hash", - "kind": "value", - "name": "hash", - "docstrings": [], - "signature": "let hash: hash" - }, - { - "id": "Belt.Id.MakeHashableU.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: eq" - } - ] - }, - "belt/id/makecomparable": { - "id": "Belt.Id.MakeComparable", - "name": "MakeComparable", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeComparable.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeComparable.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeComparable.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: cmp" - } - ] - }, - "belt/id/makecomparableu": { - "id": "Belt.Id.MakeComparableU", - "name": "MakeComparableU", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeComparableU.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeComparableU.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeComparableU.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: cmp" - } - ] - }, - "belt/float": { - "id": "Belt.Float", - "name": "Float", - "docstrings": [ - "[`Belt.Float`]()\n\n Utilities for Float.", - "This module includes convenience methods for handling `float` types." - ], - "items": [ - { - "id": "Belt.Float.toInt", - "kind": "value", - "name": "toInt", - "docstrings": [ - "Converts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nBelt.Float.toInt(1.0) == 1\n```" - ], - "signature": "let toInt: float => int" - }, - { - "id": "Belt.Float.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "Converts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nBelt.Float.fromInt(1) == 1.0\n```" - ], - "signature": "let fromInt: int => float" - }, - { - "id": "Belt.Float.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Converts a given `string` to a `float`. Returns `Some(float)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nBelt.Float.fromString(\"1.0\") == Some(1.0)\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Belt.Float.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts a given `float` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nBelt.Float.toString(1.0) == \"1\"\n```" - ], - "signature": "let toString: float => string" - }, - { - "id": "Belt.Float.+", - "kind": "value", - "name": "+", - "docstrings": [ - "Addition of two `float` values.\nCan be opened in a module to avoid dot-notation (`+.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n2.0 + 2.0 == 4.0\n```" - ], - "signature": "let +: (float, float) => float" - }, - { - "id": "Belt.Float.-", - "kind": "value", - "name": "-", - "docstrings": [ - "Subtraction of two `float` values.\nCan be opened in a module to avoid dot-notation (`-.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n2.0 - 1.0 == 1.0\n```" - ], - "signature": "let -: (float, float) => float" - }, - { - "id": "Belt.Float.*", - "kind": "value", - "name": "*", - "docstrings": [ - "Multiplication of two `float` values.\nCan be opened in a module to avoid dot-notation (`*.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n2.0 * 2.0 == 4.0\n```" - ], - "signature": "let *: (float, float) => float" - }, - { - "id": "Belt.Float./", - "kind": "value", - "name": "/", - "docstrings": [ - "Division of two `float` values.\nCan be opened in a module to avoid dot-notation (`/.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n4.0 / 2.0 == 2.0\n```" - ], - "signature": "let /: (float, float) => float" - } - ] - }, - "belt/int": { - "id": "Belt.Int", - "name": "Int", - "docstrings": [ - "[`Belt.Int`]()\n\n Utilities for Int.", - "This module includes convenience methods for handling `int` types." - ], - "items": [ - { - "id": "Belt.Int.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [ - "Converts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nBelt.Int.toFloat(1) == 1.0\n```" - ], - "signature": "let toFloat: int => float" - }, - { - "id": "Belt.Int.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "Converts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nBelt.Int.fromFloat(1.0) == 1\n```" - ], - "signature": "let fromFloat: float => int" - }, - { - "id": "Belt.Int.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Converts a given `string` to an `int`. Returns `Some(int)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nBelt.Int.fromString(\"1\") == Some(1)\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Belt.Int.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nBelt.Int.toString(1) == \"1\"\n```" - ], - "signature": "let toString: int => string" - }, - { - "id": "Belt.Int.+", - "kind": "value", - "name": "+", - "docstrings": [ - "Addition of two `int` values. Same as the addition from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n2 + 2 == 4\n```" - ], - "signature": "let +: (int, int) => int" - }, - { - "id": "Belt.Int.-", - "kind": "value", - "name": "-", - "docstrings": [ - "Subtraction of two `int` values. Same as the subtraction from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n2 - 1 == 1\n```" - ], - "signature": "let -: (int, int) => int" - }, - { - "id": "Belt.Int.*", - "kind": "value", - "name": "*", - "docstrings": [ - "Multiplication of two `int` values. Same as the multiplication from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n2 * 2 == 4\n```" - ], - "signature": "let *: (int, int) => int" - }, - { - "id": "Belt.Int./", - "kind": "value", - "name": "/", - "docstrings": [ - "Division of two `int` values. Same as the division from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n4 / 2 == 2\n```" - ], - "signature": "let /: (int, int) => int" - } - ] - }, - "belt/result": { - "id": "Belt.Result", - "name": "Result", - "docstrings": [ - "[`Belt.Result`]()\n\n Utilities for result data type.", - "Result types are really useful to describe the result of a certain operation\nwithout relying on exceptions or `option` types.\n\nThis module gives you useful utilities to create and combine `Result` data." - ], - "items": [ - { - "id": "Belt.Result.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a, 'b> = result<'a, 'b> = Ok('a) | Error('b)" - }, - { - "id": "Belt.Result.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(res)`: when `res` is `Ok(n)`, returns `n` when `res` is `Error(m)`, throw an exception\n\n## Examples\n\n```rescript\nBelt.Result.Ok(42)->Belt.Result.getExn == 42\n\nswitch Belt.Result.getExn(Belt.Result.Error(\"Invalid data\")) {\n// throw a exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getExn: t<'a, 'b> => 'a" - }, - { - "id": "Belt.Result.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(res)`: when `res` is `Ok(n)`, returns `n` when `res` is `Error(m)`, throw an exception\n\n## Examples\n\n```rescript\nBelt.Result.Ok(42)->Belt.Result.getOrThrow == 42\n\nswitch Belt.Result.getOrThrow(Belt.Result.Error(\"Invalid data\")) {\n// throw a exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getOrThrow: t<'a, 'b> => 'a" - }, - { - "id": "Belt.Result.mapWithDefaultU", - "kind": "value", - "name": "mapWithDefaultU", - "docstrings": [], - "signature": "let mapWithDefaultU: (t<'a, 'c>, 'b, 'a => 'b) => 'b", - "deprecated": "Use `mapWithDefault` instead" - }, - { - "id": "Belt.Result.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [ - "`mapWithDefault(res, default, f)`: When res is `Ok(n)`, returns `f(n)`,\notherwise `default`.\n\n## Examples\n\n```rescript\nlet ok = Belt.Result.Ok(42)\nBelt.Result.mapWithDefault(ok, 0, x => x / 2) == 21\n\nlet error = Belt.Result.Error(\"Invalid data\")\nBelt.Result.mapWithDefault(error, 0, x => x / 2) == 0\n```" - ], - "signature": "let mapWithDefault: (t<'a, 'c>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Belt.Result.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a, 'c>, 'a => 'b) => t<'b, 'c>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Result.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(res, f)`: When res is `Ok(n)`, returns `Ok(f(n))`. Otherwise returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns an\nordinary value.\n\n## Examples\n\n```rescript\nlet f = x => sqrt(Belt.Int.toFloat(x))\n\nBelt.Result.map(Ok(64), f) == Ok(8.0)\n\nBelt.Result.map(Error(\"Invalid data\"), f) == Error(\"Invalid data\")\n```" - ], - "signature": "let map: (t<'a, 'c>, 'a => 'b) => t<'b, 'c>" - }, - { - "id": "Belt.Result.flatMapU", - "kind": "value", - "name": "flatMapU", - "docstrings": [], - "signature": "let flatMapU: (t<'a, 'c>, 'a => t<'b, 'c>) => t<'b, 'c>", - "deprecated": "Use `flatMap` instead" - }, - { - "id": "Belt.Result.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(res, f)`: When res is `Ok(n)`, returns `f(n)`. Otherwise, returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns a\n`Belt.Result`.\n\n## Examples\n\n```rescript\nlet recip = x =>\n if x !== 0.0 {\n Belt.Result.Ok(1.0 /. x)\n } else {\n Belt.Result.Error(\"Divide by zero\")\n }\n\nBelt.Result.flatMap(Ok(2.0), recip) == Ok(0.5)\n\nBelt.Result.flatMap(Ok(0.0), recip) == Error(\"Divide by zero\")\n\nBelt.Result.flatMap(Error(\"Already bad\"), recip) == Error(\"Already bad\")\n```" - ], - "signature": "let flatMap: (t<'a, 'c>, 'a => t<'b, 'c>) => t<'b, 'c>" - }, - { - "id": "Belt.Result.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [ - "`getWithDefault(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`,\notherwise `default`\n\n## Examples\n\n```rescript\nBelt.Result.getWithDefault(Ok(42), 0) == 42\n\nBelt.Result.getWithDefault(Error(\"Invalid Data\"), 0) == 0\n```" - ], - "signature": "let getWithDefault: (t<'a, 'b>, 'a) => 'a" - }, - { - "id": "Belt.Result.isOk", - "kind": "value", - "name": "isOk", - "docstrings": [ - "`isOk(res)`: Returns `true` if `res` is of the form `Ok(n)`, `false` if it is\nthe `Error(e)` variant." - ], - "signature": "let isOk: t<'a, 'b> => bool" - }, - { - "id": "Belt.Result.isError", - "kind": "value", - "name": "isError", - "docstrings": [ - "`isError(res)`: Returns `true` if `res` is of the form `Error(e)`, `false` if\nit is the `Ok(n)` variant." - ], - "signature": "let isError: t<'a, 'b> => bool" - }, - { - "id": "Belt.Result.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Result.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(res1, res2, f)`: Determine if two `Belt.Result` variables are equal with\nrespect to an equality function. If `res1` and `res2` are of the form `Ok(n)`\nand `Ok(m)`, return the result of `f(n, m)`. If one of `res1` and `res2` are of\nthe form `Error(e)`, return false If both `res1` and `res2` are of the form\n`Error(e)`, return true\n\n## Examples\n\n```rescript\nlet good1 = Belt.Result.Ok(42)\n\nlet good2 = Belt.Result.Ok(32)\n\nlet bad1 = Belt.Result.Error(\"invalid\")\n\nlet bad2 = Belt.Result.Error(\"really invalid\")\n\nlet mod10equal = (a, b) => mod(a, 10) === mod(b, 10)\n\nBelt.Result.eq(good1, good2, mod10equal) == true\n\nBelt.Result.eq(good1, bad1, mod10equal) == false\n\nBelt.Result.eq(bad2, good2, mod10equal) == false\n\nBelt.Result.eq(bad1, bad2, mod10equal) == true\n```" - ], - "signature": "let eq: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Result.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Result.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(res1, res2, f)`: Compare two `Belt.Result` variables with respect to a\ncomparison function. The comparison function returns -1 if the first variable\nis \"less than\" the second, 0 if the two variables are equal, and 1 if the first\nis \"greater than\" the second.\n\nIf `res1` and `res2` are of the form `Ok(n)` and `Ok(m)`, return the result of\n`f(n, m)`. If `res1` is of the form `Error(e)` and `res2` of the form `Ok(n)`,\nreturn -1 (nothing is less than something) If `res1` is of the form `Ok(n)` and\n`res2` of the form `Error(e)`, return 1 (something is greater than nothing) If\nboth `res1` and `res2` are of the form `Error(e)`, return 0 (equal)\n\n## Examples\n\n```rescript\nlet good1 = Belt.Result.Ok(59)\n\nlet good2 = Belt.Result.Ok(37)\n\nlet bad1 = Belt.Result.Error(\"invalid\")\n\nlet bad2 = Belt.Result.Error(\"really invalid\")\n\nlet mod10cmp = (a, b) => Pervasives.compare(mod(a, 10), mod(b, 10))\n\nBelt.Result.cmp(Ok(39), Ok(57), mod10cmp) == 1\n\nBelt.Result.cmp(Ok(57), Ok(39), mod10cmp) == -1\n\nBelt.Result.cmp(Ok(39), Error(\"y\"), mod10cmp) == 1\n\nBelt.Result.cmp(Error(\"x\"), Ok(57), mod10cmp) == -1\n\nBelt.Result.cmp(Error(\"x\"), Error(\"y\"), mod10cmp) == 0\n```" - ], - "signature": "let cmp: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => int) => int" - } - ] - }, - "belt/option": { - "id": "Belt.Option", - "name": "Option", - "docstrings": [ - "[`Belt.Option`]()\n\n Utilities for option data type.", - "In Belt we represent the existence and nonexistence of a value by wrapping it\nwith the `option` type. In order to make it a bit more convenient to work with\noption-types, Belt provides utility-functions for it.\n\nThe `option` type is a part of the ReScript standard library which is defined like this:\n\n## Examples\n\n```rescript\ntype option<'a> = None | Some('a)\n```\n\n```rescript\nlet someString: option = Some(\"hello\")\n```" - ], - "items": [ - { - "id": "Belt.Option.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [ - "Uncurried version of `keep`" - ], - "signature": "let keepU: (option<'a>, 'a => bool) => option<'a>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Option.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "If `optionValue` is `Some(value)` and `p(value) = true`, it returns `Some(value)`; otherwise returns `None`\n\n## Examples\n\n```rescript\nBelt.Option.keep(Some(10), x => x > 5) == Some(10)\nBelt.Option.keep(Some(4), x => x > 5) == None\nBelt.Option.keep(None, x => x > 5) == None\n```" - ], - "signature": "let keep: (option<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Belt.Option.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Uncurried version of `forEach`" - ], - "signature": "let forEachU: (option<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Option.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "If `optionValue` is `Some(value`), it calls `f(value)`; otherwise returns `()`\n\n## Examples\n\n```rescript\nBelt.Option.forEach(Some(\"thing\"), x => Js.log(x)) /* logs \"thing\" */\nBelt.Option.forEach(None, x => Js.log(x)) /* returns () */\n```" - ], - "signature": "let forEach: (option<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.Option.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Throws an Error in case `None` is provided. Use with care.\n\n## Examples\n\n```rescript\nSome(3)->Belt.Option.getExn == 3\n\nswitch Belt.Option.getExn(None) {\n// Throws an exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getExn: option<'a> => 'a" - }, - { - "id": "Belt.Option.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Throws an Error in case `None` is provided. Use with care.\n\n## Examples\n\n```rescript\nSome(3)->Belt.Option.getOrThrow == 3\n\nswitch Belt.Option.getOrThrow(None) {\n// Throws an exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getOrThrow: option<'a> => 'a" - }, - { - "id": "Belt.Option.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(x)` returns `x`\n\nThis is an unsafe operation, it assumes `x` is neither `None`\nnor `Some(None(...)))`" - ], - "signature": "let getUnsafe: option<'a> => 'a" - }, - { - "id": "Belt.Option.mapWithDefaultU", - "kind": "value", - "name": "mapWithDefaultU", - "docstrings": [ - "Uncurried version of `mapWithDefault`" - ], - "signature": "let mapWithDefaultU: (option<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "Use `mapWithDefault` instead" - }, - { - "id": "Belt.Option.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [ - "If `optionValue` is of `Some(value)`,\nthis function returns that value applied with `f`, in other words `f(value)`.\n\nIf `optionValue` is `None`, the default is returned.\n\n## Examples\n\n```rescript\nlet someValue = Some(3)\nsomeValue->Belt.Option.mapWithDefault(0, x => x + 5) == 8\n\nlet noneValue = None\nnoneValue->Belt.Option.mapWithDefault(0, x => x + 5) == 0\n```" - ], - "signature": "let mapWithDefault: (option<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Belt.Option.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [ - "Uncurried version of `map`" - ], - "signature": "let mapU: (option<'a>, 'a => 'b) => option<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Option.map", - "kind": "value", - "name": "map", - "docstrings": [ - "If `optionValue` is `Some(value)` this returns `f(value)`, otherwise it returns `None`.\n\n## Examples\n\n```rescript\nBelt.Option.map(Some(3), x => x * x) == Some(9)\n\nBelt.Option.map(None, x => x * x) == None\n```" - ], - "signature": "let map: (option<'a>, 'a => 'b) => option<'b>" - }, - { - "id": "Belt.Option.flatMapU", - "kind": "value", - "name": "flatMapU", - "docstrings": [ - "Uncurried version of `flatMap`" - ], - "signature": "let flatMapU: (option<'a>, 'a => option<'b>) => option<'b>", - "deprecated": "Use `flatMap` instead" - }, - { - "id": "Belt.Option.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "If `optionValue` is `Some(value)`, returns `f(value)`, otherwise returns\n`None`.
\nThe function `f` must have a return type of `option<'b>`.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Some(value + 1)\n } else {\n None\n }\n\nBelt.Option.flatMap(Some(2), addIfAboveOne) == Some(3)\n\nBelt.Option.flatMap(Some(-4), addIfAboveOne) == None\n\nBelt.Option.flatMap(None, addIfAboveOne) == None\n```" - ], - "signature": "let flatMap: (option<'a>, 'a => option<'b>) => option<'b>" - }, - { - "id": "Belt.Option.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [ - "If `optionalValue` is `Some(value)`, returns `value`, otherwise default.\n\n## Examples\n\n```rescript\nBelt.Option.getWithDefault(None, \"Banana\") == \"Banana\"\n\nBelt.Option.getWithDefault(Some(\"Apple\"), \"Banana\") == \"Apple\"\n```\n\n```rescript\nlet greet = (firstName: option) =>\n \"Greetings \" ++ firstName->Belt.Option.getWithDefault(\"Anonymous\")\n\nSome(\"Jane\")->greet == \"Greetings Jane\"\n\nNone->greet == \"Greetings Anonymous\"\n```" - ], - "signature": "let getWithDefault: (option<'a>, 'a) => 'a" - }, - { - "id": "Belt.Option.orElse", - "kind": "value", - "name": "orElse", - "docstrings": [ - "`orElse(optionalValue, otherOptional)` if `optionalValue` is `Some(value)`,\nreturns `Some(value)`, otherwise `otherOptional`\n\n## Examples\n\n```rescript\nBelt.Option.orElse(Some(1812), Some(1066)) == Some(1812)\nBelt.Option.orElse(None, Some(1066)) == Some(1066)\nBelt.Option.orElse(None, None) == None\n```" - ], - "signature": "let orElse: (option<'a>, option<'a>) => option<'a>" - }, - { - "id": "Belt.Option.isSome", - "kind": "value", - "name": "isSome", - "docstrings": [ - "Returns `true` if the argument is `Some(value)`, `false` otherwise.\n\n## Examples\n\n```rescript\nBelt.Option.isSome(None) == false\n\nBelt.Option.isSome(Some(1)) == true\n```" - ], - "signature": "let isSome: option<'a> => bool" - }, - { - "id": "Belt.Option.isNone", - "kind": "value", - "name": "isNone", - "docstrings": [ - "Returns `true` if the argument is `None`, `false` otherwise.\n\n## Examples\n\n```rescript\nBelt.Option.isNone(None) == true\n\nBelt.Option.isNone(Some(1)) == false\n```" - ], - "signature": "let isNone: option<'a> => bool" - }, - { - "id": "Belt.Option.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [ - "Uncurried version of `eq`" - ], - "signature": "let eqU: (option<'a>, option<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Option.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Evaluates two optional values for equality with respect to a predicate\nfunction. If both `optValue1` and `optValue2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\n\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`predicate(value1, value2)`; the predicate function must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Belt.Option\n\neq(Some(3), Some(15), clockEqual) == true\n\neq(Some(3), None, clockEqual) == false\n\neq(None, Some(3), clockEqual) == false\n\neq(None, None, clockEqual) == true\n```" - ], - "signature": "let eq: (option<'a>, option<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Option.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [ - "Uncurried version of `cmp`" - ], - "signature": "let cmpU: (option<'a>, option<'b>, ('a, 'b) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Option.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(optValue1, optValue2, comparisonFunction)` compares two optional values\nwith respect to given `comparisonFunction`.\n\nIf both `optValue1` and `optValue2` are `None`, it returns `0`.\n\nIf the first argument is `Some(value1)` and the second is `None`, returns `1`\n(something is greater than nothing).\n\nIf the first argument is `None` and the second is `Some(value2)`, returns `-1`\n(nothing is less than something).\n\nIf the arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`comparisonFunction(value1, value2)`; comparisonFunction takes two arguments\nand returns `-1` if the first argument is less than the second, `0` if the\narguments are equal, and `1` if the first argument is greater than the second.\n\n## Examples\n\n```rescript\nlet clockCompare = (a, b) => compare(mod(a, 12), mod(b, 12))\n\nopen Belt.Option\n\ncmp(Some(3), Some(15), clockCompare) == 0\n\ncmp(Some(3), Some(14), clockCompare) == 1\n\ncmp(Some(2), Some(15), clockCompare) == -1\n\ncmp(None, Some(15), clockCompare) == -1\n\ncmp(Some(14), None, clockCompare) == 1\n\ncmp(None, None, clockCompare) == 0\n```" - ], - "signature": "let cmp: (option<'a>, option<'b>, ('a, 'b) => int) => int" - } - ] - }, - "belt/hashmap": { - "id": "Belt.HashMap", - "name": "HashMap", - "docstrings": [ - "[`Belt.HashMap`]()\n\n The top level provides generic **mutable** hash map operations.\n\n It also has two specialized inner modules\n [`Belt.HashMap.Int`]() and [`Belt.HashMap.String`]()", - "A **mutable** Hash map which allows customized [`hash`]() behavior.\n\nAll data are parameterized by not its only type but also a unique identity in\nthe time of initialization, so that two _HashMaps of ints_ initialized with different\n_hash_ functions will have different type.\n\n## Examples\n\n```rescript\ntype t = int\nmodule I0 = unpack(Belt.Id.hashable(~hash=(_: t) => 0xff_ff, ~eq=(a, b) => a == b))\nlet s0: Belt.HashMap.t = Belt.HashMap.make(~hintSize=40, ~id=module(I0))\n\nmodule I1 = unpack(Belt.Id.hashable(~hash=(_: t) => 0xff, ~eq=(a, b) => a == b))\nlet s1: Belt.HashMap.t = Belt.HashMap.make(~hintSize=40, ~id=module(I1))\n```\n\nThe invariant must be held: for two elements who are _equal_,\ntheir hashed value should be the same\n\nHere the compiler would infer `s0` and `s1` having different type so that\nit would not mix.\n\n## Examples\n\n```\nlet s0: t\nlet s1: t\n```\n\nWe can add elements to the collection:\n\n## Examples\n\n```rescript\nlet () = {\n Belt.HashMap.set(s0, 0, 3)\n Belt.HashMap.set(s1, 1, \"3\")\n}\n```\n\nSince this is an mutable data strucure, `s1` will contain two pairs." - ], - "items": [ - { - "id": "Belt.HashMap.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of hash tables from type `'key` to type `'value`." - ], - "signature": "type t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making an empty hash map." - ], - "signature": "type id<'a, 'id> = Belt_Id.hashable<'a, 'id>" - }, - { - "id": "Belt.HashMap.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(~hintSize=10, ~id)` creates a new map by taking in the comparator and `hintSize`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\n\nBelt.HashMap.set(hMap, 0, \"a\")\n```" - ], - "signature": "let make: (~hintSize: int, ~id: id<'key, 'id>) => t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Clears a hash table.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.fromArray([(1, \"1\")], ~id=module(IntHash))\nBelt.HashMap.clear(hMap)\nBelt.HashMap.isEmpty(hMap) == true\n```" - ], - "signature": "let clear: t<'key, 'value, 'id> => unit" - }, - { - "id": "Belt.HashMap.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(m)` checks whether a hash map is empty.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nBelt.HashMap.isEmpty(Belt.HashMap.fromArray([(1, \"1\")], ~id=module(IntHash))) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b, 'c> => bool" - }, - { - "id": "Belt.HashMap.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(hMap, k, v)` if `k` does not exist, add the binding `k,v`, otherwise, update the old value with the new `v`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntHash))\n\nBelt.HashMap.set(s0, 2, \"3\")\n\nBelt.HashMap.valuesToArray(s0) == [\"1\", \"3\", \"3\"]\n```" - ], - "signature": "let set: (t<'key, 'value, 'id>, 'key, 'value) => unit" - }, - { - "id": "Belt.HashMap.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Creates copy of a hash map.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntHash))\nlet s1 = Belt.HashMap.copy(s0)\n\nBelt.HashMap.set(s0, 2, \"3\")\n\n(Belt.HashMap.get(s0, 2) != Belt.HashMap.get(s1, 2)) == true\n```" - ], - "signature": "let copy: t<'key, 'value, 'id> => t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns value bound under specific key. If values not exist returns `None`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\n\nBelt.HashMap.get(s0, 1) == Some(\"value1\")\nBelt.HashMap.get(s0, 2) == None\n```" - ], - "signature": "let get: (t<'key, 'value, 'id>, 'key) => option<'value>" - }, - { - "id": "Belt.HashMap.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if `x` is bound in `tbl`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\n\nBelt.HashMap.has(s0, 1) == true\nBelt.HashMap.has(s0, 2) == false\n```" - ], - "signature": "let has: (t<'key, 'value, 'id>, 'key) => bool" - }, - { - "id": "Belt.HashMap.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "If bound exists, removes it from the hash map.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.remove(s0, 1)\nBelt.HashMap.has(s0, 1) == false\n```" - ], - "signature": "let remove: (t<'key, 'value, 'id>, 'key) => unit" - }, - { - "id": "Belt.HashMap.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as [forEach](#forEach) but takes uncurried function." - ], - "signature": "let forEachU: (t<'key, 'value, 'id>, ('key, 'value) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashMap.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(tbl, f)` applies `f` to all bindings in table `tbl`. `f` receives the key as first argument, and the associated value as second argument. Each binding is presented exactly once to `f`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.forEach(s0, (key, value) => Js.log2(key, value))\n// prints (1, \"value1\")\n```" - ], - "signature": "let forEach: (t<'key, 'value, 'id>, ('key, 'value) => unit) => unit" - }, - { - "id": "Belt.HashMap.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashMap.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(tbl, init, f)` computes `(f(kN, dN) ... (f(k1, d1, init))...)`, where `k1 ... kN` are the keys of all bindings in `tbl`, and `d1 ... dN` are the associated values. Each binding is presented exactly once to `f`.\n\nThe order in which the bindings are passed to `f` is unspecified. However, if the table contains several bindings for the same key, they are passed to `f` in reverse order of introduction, that is, the most recent binding is passed first.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\n\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\ns0->Belt.HashMap.reduce(\"\", (acc, _, value) => acc ++ (\", \" ++ value)) == \", value1, value2\"\n```\n\n## More Examples\n\n```rescript\nConsole.log(\"lol\")\n```" - ], - "signature": "let reduce: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c" - }, - { - "id": "Belt.HashMap.keepMapInPlaceU", - "kind": "value", - "name": "keepMapInPlaceU", - "docstrings": [ - "Same as [keepMapInPlace](#keepMapInPlace) but takes uncurried function." - ], - "signature": "let keepMapInPlaceU: (\n t<'key, 'value, 'id>,\n ('key, 'value) => option<'value>,\n) => unit", - "deprecated": "Use `keepMapInPlace` instead" - }, - { - "id": "Belt.HashMap.keepMapInPlace", - "kind": "value", - "name": "keepMapInPlace", - "docstrings": [ - "Filters out values for which function `f` returned `None`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.keepMapInPlace(s0, (key, value) => key == 1 ? None : Some(value))\n```" - ], - "signature": "let keepMapInPlace: (\n t<'key, 'value, 'id>,\n ('key, 'value) => option<'value>,\n) => unit" - }, - { - "id": "Belt.HashMap.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(tbl)` returns the number of bindings in `tbl`. It takes constant time.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.size(s0) == 2\n```" - ], - "signature": "let size: t<'a, 'b, 'c> => int" - }, - { - "id": "Belt.HashMap.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of key value pairs.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.toArray(s0) == [(1, \"value1\"), (2, \"value2\")]\n```" - ], - "signature": "let toArray: t<'key, 'value, 'id> => array<('key, 'value)>" - }, - { - "id": "Belt.HashMap.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "Returns array of keys.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.keysToArray(s0) == [1, 2]\n```" - ], - "signature": "let keysToArray: t<'key, 'a, 'b> => array<'key>" - }, - { - "id": "Belt.HashMap.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [ - "Returns array of values.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.valuesToArray(s0) == [\"value1\", \"value2\"]\n```" - ], - "signature": "let valuesToArray: t<'a, 'value, 'b> => array<'value>" - }, - { - "id": "Belt.HashMap.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new hash map from array of pairs.\n\nReturns array of values.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(1, \"value1\"), (2, \"value2\")], ~id=module(IntHash))\nBelt.HashMap.toArray(s0) == [(1, \"value1\"), (2, \"value2\")]\n```" - ], - "signature": "let fromArray: (\n array<('key, 'value)>,\n ~id: id<'key, 'id>,\n) => t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.mergeMany(hMap, [(1, \"1\"), (2, \"2\")])\n```" - ], - "signature": "let mergeMany: (t<'key, 'value, 'id>, array<('key, 'value)>) => unit" - }, - { - "id": "Belt.HashMap.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(hMap, 1, \"1\")\n\nBelt.HashMap.getBucketHistogram(hMap)\n```" - ], - "signature": "let getBucketHistogram: t<'a, 'b, 'c> => array" - }, - { - "id": "Belt.HashMap.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(hMap, 1, \"1\")\n\nBelt.HashMap.logStats(hMap)\n```" - ], - "signature": "let logStats: t<'a, 'b, 'c> => unit" - } - ] - }, - "belt/hashset": { - "id": "Belt.HashSet", - "name": "HashSet", - "docstrings": [ - "[`Belt.HashSet`]()\n\n The top level provides generic **mutable** hash set operations.\n\n It also has two specialized inner modules\n [`Belt.HashSet.Int`]() and [`Belt.HashSet.String`]()", - "A **mutable** Hash set which allows customized `hash` behavior.\n\nAll data are parameterized by not its only type but also a unique identity in\nthe time of initialization, so that two _HashSets of ints_ initialized with\ndifferent _hash_ functions will have different type.\n\n## Examples\n\n```rescript\nmodule I0 = unpack(Belt.Id.hashable(~hash=(a: int) => land(a, 65535), ~eq=(a, b) => a == b))\n\nlet s0 = Belt.HashSet.make(~id=module(I0), ~hintSize=40)\n\nmodule I1 = unpack(Belt.Id.hashable(~hash=(a: int) => land(a, 255), ~eq=(a, b) => a == b))\n\nlet s1 = Belt.HashSet.make(~id=module(I1), ~hintSize=40)\n\nBelt.HashSet.add(s1, 0)\nBelt.HashSet.add(s1, 1)\n```\n\nThe invariant must be held: for two elements who are equal, their hashed\nvalue should be the same.\n\nHere the compiler would infer `s0` and `s1` having different type so that it\nwould not mix.\n\nSignatures:\n\n```\nlet s0: Belt.HashSet.t\nlet s1: Belt.HashSet.t\n```\n\nWe can add elements to the collection (see last two lines in the example\nabove). Since this is an mutable data structure, `s1` will contain two pairs." - ], - "items": [ - { - "id": "Belt.HashSet.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a, 'id>" - }, - { - "id": "Belt.HashSet.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The type of hash tables from type `'a` to type `'b`." - ], - "signature": "type id<'a, 'id> = Belt_Id.hashable<'a, 'id>" - }, - { - "id": "Belt.HashSet.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int, ~id: id<'a, 'id>) => t<'a, 'id>" - }, - { - "id": "Belt.HashSet.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a, 'id> => unit" - }, - { - "id": "Belt.HashSet.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.HashSet.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t<'a, 'id>, 'a) => unit" - }, - { - "id": "Belt.HashSet.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a, 'id> => t<'a, 'id>" - }, - { - "id": "Belt.HashSet.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a, 'id>, 'a) => bool" - }, - { - "id": "Belt.HashSet.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t<'a, 'id>, 'a) => unit" - }, - { - "id": "Belt.HashSet.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a, 'id>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashSet.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Order unspecified." - ], - "signature": "let forEach: (t<'a, 'id>, 'a => unit) => unit" - }, - { - "id": "Belt.HashSet.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a, 'id>, 'c, ('c, 'a) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashSet.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Order unspecified." - ], - "signature": "let reduce: (t<'a, 'id>, 'c, ('c, 'a) => 'c) => 'c" - }, - { - "id": "Belt.HashSet.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a, 'id> => int" - }, - { - "id": "Belt.HashSet.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t<'a, 'b> => unit" - }, - { - "id": "Belt.HashSet.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'a, 'id> => array<'a>" - }, - { - "id": "Belt.HashSet.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: (array<'a>, ~id: id<'a, 'id>) => t<'a, 'id>" - }, - { - "id": "Belt.HashSet.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'a, 'id>, array<'a>) => unit" - }, - { - "id": "Belt.HashSet.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t<'a, 'b> => array" - } - ] - }, - "belt/mutablemap": { - "id": "Belt.MutableMap", - "name": "MutableMap", - "docstrings": [ - "[`Belt.MutableMap`]()\n\n The top level provides generic **mutable** map operations.\n\n It also has two specialized inner modules\n [`Belt.MutableMap.Int`]() and [`Belt.MutableMap.String`]()" - ], - "items": [ - { - "id": "Belt.MutableMap.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v, 'id>" - }, - { - "id": "Belt.MutableMap.id", - "kind": "type", - "name": "id", - "docstrings": [], - "signature": "type id<'key, 'id> = Belt_Id.comparable<'key, 'id>" - }, - { - "id": "Belt.MutableMap.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~id: id<'k, 'id>) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.MutableMap.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a, 'b, 'c> => unit" - }, - { - "id": "Belt.MutableMap.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a, 'b, 'c> => bool" - }, - { - "id": "Belt.MutableMap.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'k, 'a, 'b>, 'k) => bool" - }, - { - "id": "Belt.MutableMap.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.MutableMap.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m1, m2, cmp)` First compare by size, if size is the same, compare by\nkey, value pair." - ], - "signature": "let cmp: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.MutableMap.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.MutableMap.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, eqf)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `eqf` is the\nequality predicate used to compare the data associated with the keys." - ], - "signature": "let eq: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableMap.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies f to all bindings in map `m`. `f` receives the `'k`\nas first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys." - ], - "signature": "let forEach: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit" - }, - { - "id": "Belt.MutableMap.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableMap.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f), computes`(f(kN, dN) ... (f(k1, d1, a))...)`, where`k1 ...\nkN`are the keys of all bindings in`m`(in increasing order), and`d1 ... dN`\nare the associated data." - ], - "signature": "let reduce: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableMap.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableMap.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`." - ], - "signature": "let every: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableMap.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`." - ], - "signature": "let some: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'k, 'a, 'id> => int" - }, - { - "id": "Belt.MutableMap.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'k, 'a, 'id> => list<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'k, 'a, 'id> => array<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: (array<('k, 'a)>, ~id: id<'k, 'id>) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.MutableMap.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'k, 'a, 'b> => array<'k>" - }, - { - "id": "Belt.MutableMap.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'b, 'a, 'c> => array<'a>" - }, - { - "id": "Belt.MutableMap.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.MutableMap.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.MutableMap.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.MutableMap.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.MutableMap.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'k, 'a, 'id>, 'k) => option<'a>" - }, - { - "id": "Belt.MutableMap.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'k, 'a, 'id>, 'k) => Js.undefined<'a>" - }, - { - "id": "Belt.MutableMap.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'k, 'a, 'id>, 'k, 'a) => 'a" - }, - { - "id": "Belt.MutableMap.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'k, 'a, 'id>, 'k) => 'a" - }, - { - "id": "Belt.MutableMap.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'k, 'a, 'id>, 'k) => 'a" - }, - { - "id": "Belt.MutableMap.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "Throw when invariant is not held." - ], - "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit" - }, - { - "id": "Belt.MutableMap.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` do the in-place modification." - ], - "signature": "let remove: (t<'k, 'a, 'id>, 'k) => unit" - }, - { - "id": "Belt.MutableMap.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'k, 'a, 'id>, array<'k>) => unit" - }, - { - "id": "Belt.MutableMap.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` do the in-place modification" - ], - "signature": "let set: (t<'k, 'a, 'id>, 'k, 'a) => unit" - }, - { - "id": "Belt.MutableMap.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'k, 'a, 'id>, 'k, option<'a> => option<'a>) => unit", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.MutableMap.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'k, 'a, 'id>, 'k, option<'a> => option<'a>) => unit" - }, - { - "id": "Belt.MutableMap.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'k, 'a, 'id>, array<('k, 'a)>) => unit" - }, - { - "id": "Belt.MutableMap.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableMap.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated\nvalue a of all bindings of `m` has been replaced by the result of the\napplication of `f` to `a`. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let map: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>" - }, - { - "id": "Belt.MutableMap.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.MutableMap.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>" - } - ] - }, - "belt/mutableset": { - "id": "Belt.MutableSet", - "name": "MutableSet", - "docstrings": [ - "[`Belt.MutableSet`]()\n\n The top level provides generic **mutable** set operations.\n\n It also has two specialized inner modules\n [`Belt.MutableSet.Int`]() and [`Belt.MutableSet.String`]()", - "A **mutable** sorted set module which allows customized compare behavior.\nThe implementation uses balanced binary trees, and therefore searching and insertion take time logarithmic in the size of the map.\n\nIt also has two specialized inner modules [Belt.MutableSet.Int](mutable-set-int) and [Belt.MutableSet.String](mutable-set-string) - This module separates data from function which is more verbose but slightly more efficient\n\n## Examples\n\n```rescript\nmodule PairComparator = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet = Belt.MutableSet.make(~id=module(PairComparator))\nmySet->Belt.MutableSet.add((1, 2))\n```" - ], - "items": [ - { - "id": "Belt.MutableSet.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'value, 'identity>" - }, - { - "id": "Belt.MutableSet.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making a set from scratch" - ], - "signature": "type id<'value, 'id> = Belt_Id.comparable<'value, 'id>" - }, - { - "id": "Belt.MutableSet.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new set by taking in the comparator" - ], - "signature": "let make: (~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let fromArray: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [ - "The same as [fromArray][#fromarray] except it is after assuming the input array is already sorted." - ], - "signature": "let fromSortedArrayUnsafe: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Returns copy of a set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\nlet copied = s0->Belt.MutableSet.copy\ncopied->Belt.MutableSet.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let copy: t<'value, 'id> => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.MutableSet.fromArray([], ~id=module(IntCmp))\nlet notEmpty = Belt.MutableSet.fromArray([1], ~id=module(IntCmp))\n\nBelt.MutableSet.isEmpty(empty) == true\nBelt.MutableSet.isEmpty(notEmpty) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.MutableSet.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if element exists in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.fromArray([1, 4, 2, 5], ~id=module(IntCmp))\n\nset->Belt.MutableSet.has(3) == false\nset->Belt.MutableSet.has(1) == true\n```" - ], - "signature": "let has: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.MutableSet.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\ns0->Belt.MutableSet.add(1)\ns0->Belt.MutableSet.add(2)\ns0->Belt.MutableSet.add(2)\n\ns0->Belt.MutableSet.toArray == [1, 2]\n```" - ], - "signature": "let add: (t<'value, 'id>, 'value) => unit" - }, - { - "id": "Belt.MutableSet.addCheck", - "kind": "value", - "name": "addCheck", - "docstrings": [], - "signature": "let addCheck: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.MutableSet.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "Adds each element of array to set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.make(~id=module(IntCmp))\n\nset->Belt.MutableSet.mergeMany([5, 4, 3, 2, 1])\nset->Belt.MutableSet.toArray == [1, 2, 3, 4, 5]\n```" - ], - "signature": "let mergeMany: (t<'value, 'id>, array<'value>) => unit" - }, - { - "id": "Belt.MutableSet.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([2, 3, 1, 4, 5], ~id=module(IntCmp))\ns0->Belt.MutableSet.remove(1)\ns0->Belt.MutableSet.remove(3)\ns0->Belt.MutableSet.remove(3)\n\ns0->Belt.MutableSet.toArray == [2, 4, 5]\n```" - ], - "signature": "let remove: (t<'value, 'id>, 'value) => unit" - }, - { - "id": "Belt.MutableSet.removeCheck", - "kind": "value", - "name": "removeCheck", - "docstrings": [], - "signature": "let removeCheck: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.MutableSet.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "Removes each element of array from set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\nset->Belt.MutableSet.removeMany([5, 4, 3, 2, 1])\nset->Belt.MutableSet.toArray == []\n```" - ], - "signature": "let removeMany: (t<'value, 'id>, array<'value>) => unit" - }, - { - "id": "Belt.MutableSet.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet union = Belt.MutableSet.union(s0, s1)\nunion->Belt.MutableSet.toArray == [1, 2, 3, 4, 5, 6]\n```" - ], - "signature": "let union: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet intersect = Belt.MutableSet.intersect(s0, s1)\nintersect->Belt.MutableSet.toArray == [2, 3, 5]\n```" - ], - "signature": "let intersect: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.diff", - "kind": "value", - "name": "diff", - "docstrings": [ - "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nBelt.MutableSet.toArray(Belt.MutableSet.diff(s0, s1)) == [6]\nBelt.MutableSet.toArray(Belt.MutableSet.diff(s1, s0)) == [1, 4]\n```" - ], - "signature": "let diff: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet s2 = Belt.MutableSet.intersect(s0, s1)\nBelt.MutableSet.subset(s2, s0) == true\nBelt.MutableSet.subset(s2, s1) == true\nBelt.MutableSet.subset(s1, s0) == false\n```" - ], - "signature": "let subset: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.MutableSet.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets of sets.\nIt compares size first and then iterates over each element following the order of elements." - ], - "signature": "let cmp: (t<'value, 'id>, t<'value, 'id>) => int" - }, - { - "id": "Belt.MutableSet.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 5], ~id=module(IntCmp))\n\nBelt.MutableSet.eq(s0, s1) == true\n```" - ], - "signature": "let eq: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.MutableSet.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as `Belt.MutableSet.forEach` but takes uncurried functon." - ], - "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableSet.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet acc = ref(list{})\ns0->Belt.MutableSet.forEach(x => acc := Belt.List.add(acc.contents, x))\nacc.contents == list{6, 5, 3, 2}\n```" - ], - "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit" - }, - { - "id": "Belt.MutableSet.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableSet.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\ns0->Belt.MutableSet.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) ==\n list{6, 5, 3, 2}\n```" - ], - "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a" - }, - { - "id": "Belt.MutableSet.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableSet.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.MutableSet.fromArray([2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.MutableSet.every(isEven) == true\n```" - ], - "signature": "let every: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.MutableSet.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableSet.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.MutableSet.some(isOdd) == true\n```" - ], - "signature": "let some: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.MutableSet.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.MutableSet.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.MutableSet.keep(isEven)\n\ns1->Belt.MutableSet.toArray == [2, 4]\n```" - ], - "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.MutableSet.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet (s1, s2) = s0->Belt.MutableSet.partition(isOdd)\n\ns1->Belt.MutableSet.toArray == [1, 3, 5]\ns2->Belt.MutableSet.toArray == [2, 4]\n```" - ], - "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)" - }, - { - "id": "Belt.MutableSet.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.size == 4\n```" - ], - "signature": "let size: t<'value, 'id> => int" - }, - { - "id": "Belt.MutableSet.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toList == list{1, 2, 3, 5}\n```" - ], - "signature": "let toList: t<'value, 'id> => list<'value>" - }, - { - "id": "Belt.MutableSet.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toArray == [1, 2, 3, 5]\n```" - ], - "signature": "let toArray: t<'value, 'id> => array<'value>" - }, - { - "id": "Belt.MutableSet.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.minimum == None\ns1->Belt.MutableSet.minimum == Some(1)\n```" - ], - "signature": "let minimum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.MutableSet.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "Returns minimum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.minUndefined == Js.undefined\ns1->Belt.MutableSet.minUndefined == Js.Undefined.return(1)\n```" - ], - "signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.MutableSet.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.maximum == None\ns1->Belt.MutableSet.maximum == Some(5)\n```" - ], - "signature": "let maximum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.MutableSet.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "Returns maximum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.maxUndefined == Js.undefined\ns1->Belt.MutableSet.maxUndefined == Js.Undefined.return(5)\n```" - ], - "signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.MutableSet.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the reference of the value which is equivalent to value using the comparator specifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.get(3) == Some(3)\ns0->Belt.MutableSet.get(20) == None\n```" - ], - "signature": "let get: (t<'value, 'id>, 'value) => option<'value>" - }, - { - "id": "Belt.MutableSet.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "Same as `Belt.MutableSet.get` but returns `undefined` when element does not exist." - ], - "signature": "let getUndefined: (t<'value, 'id>, 'value) => Js.undefined<'value>" - }, - { - "id": "Belt.MutableSet.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as `Belt.MutableSet.get` but throw when element does not exist." - ], - "signature": "let getExn: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.MutableSet.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as `Belt.MutableSet.get` but throw when element does not exist." - ], - "signature": "let getOrThrow: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.MutableSet.split", - "kind": "value", - "name": "split", - "docstrings": [ - "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\nlet ((smaller, larger), present) = s0->Belt.MutableSet.split(3)\n\npresent == true\nsmaller->Belt.MutableSet.toArray == [1, 2]\nlarger->Belt.MutableSet.toArray == [4, 5]\n```" - ], - "signature": "let split: (\n t<'value, 'id>,\n 'value,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)" - }, - { - "id": "Belt.MutableSet.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b> => unit" - } - ] - }, - "belt/map": { - "id": "Belt.Map", - "name": "Map", - "docstrings": [ - "[`Belt.Map`](),\n\n The top level provides generic **immutable** map operations.\n\n It also has three specialized inner modules\n [`Belt.Map.Int`](), [`Belt.Map.String`]() and\n\n [`Belt.Map.Dict`](): This module separates data from function\n which is more verbose but slightly more efficient", - "The top level provides generic immutable map operations.\n\nIt also has three specialized inner modules `Belt.Map.Int`, `Belt.Map.String`\nand `Belt.Map.Dict`." - ], - "items": [ - { - "id": "Belt.Map.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'key` is the field type\n\n`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'key, 'value, 'identity>" - }, - { - "id": "Belt.Map.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making an empty map." - ], - "signature": "type id<'key, 'id> = Belt_Id.comparable<'key, 'id>" - }, - { - "id": "Belt.Map.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(~id)` creates a new map by taking in the comparator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet m = Belt.Map.make(~id=module(IntCmp))\n\nBelt.Map.set(m, 0, \"a\")\n```" - ], - "signature": "let make: (~id: id<'k, 'id>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(m)` checks whether a map m is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.isEmpty(Belt.Map.fromArray([(1, \"1\")], ~id=module(IntCmp))) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b, 'c> => bool" - }, - { - "id": "Belt.Map.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(m, k)` checks whether `m` has the key `k`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.has(Belt.Map.fromArray([(1, \"1\")], ~id=module(IntCmp)), 1) == true\n```" - ], - "signature": "let has: (t<'k, 'v, 'id>, 'k) => bool" - }, - { - "id": "Belt.Map.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m0, m1, vcmp);`\n\nTotal ordering of map given total ordering of value function.\n\nIt will compare size first and each element following the order one by one." - ], - "signature": "let cmp: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => int) => int" - }, - { - "id": "Belt.Map.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "eq(m1, m2, veq)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `veq` is the\nequality predicate used to compare the data associated with the keys." - ], - "signature": "let eq: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`\nfindFirstBy(m, p)` uses function `f` to find the first key value pair to match predicate `p`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"\")])\n\ns0->Belt.Map.findFirstBy((k, _) => k == 4) == Some(4, \"4\")\n```" - ], - "signature": "let findFirstBy: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>" - }, - { - "id": "Belt.Map.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'k, 'v, 'id>, ('k, 'v) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the\n`'k` as first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")])\n\nlet acc = ref(list{})\n\nBelt.Map.forEach(s0, (k, v) => acc := list{(k, v), ...acc.contents})\n\nacc.contents == list{(4, \"4\"), (3, \"3\"), (2, \"2\"), (1, \"1\")}\n```" - ], - "signature": "let forEach: (t<'k, 'v, 'id>, ('k, 'v) => unit) => unit" - }, - { - "id": "Belt.Map.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'k, 'v, 'id>, 'acc, ('acc, 'k, 'v) => 'acc) => 'acc", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f(kN, dN) ... (f(k1, d1, a))...)`, where `k1\n... kN` are the keys of all bindings in m (in increasing order), and `d1\n... dN` are the associated data.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")])\n\nBelt.Map.reduce(s0, list{}, (acc, k, v) => list{(k, v), ...acc}) ==\n list{(4, \"4\"), (3, \"3\"), (2, \"2\"), (1, \"1\")}\n```" - ], - "signature": "let reduce: (t<'k, 'v, 'id>, 'acc, ('acc, 'k, 'v) => 'acc) => 'acc" - }, - { - "id": "Belt.Map.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let every: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate \n`p`. Order unspecified" - ], - "signature": "let some: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(s)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.size(Belt.Map.fromArray([(2, \"2\"), (2, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == 2\n```" - ], - "signature": "let size: t<'k, 'v, 'id> => int" - }, - { - "id": "Belt.Map.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(s)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.toArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n (1, \"1\"),\n (2, \"2\"),\n (3, \"3\"),\n ]\n```" - ], - "signature": "let toArray: t<'k, 'v, 'id> => array<('k, 'v)>" - }, - { - "id": "Belt.Map.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order. See `Belt.Map.toArray`" - ], - "signature": "let toList: t<'k, 'v, 'id> => list<('k, 'v)>" - }, - { - "id": "Belt.Map.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(kvs, ~id);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.toArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n (1, \"1\"),\n (2, \"2\"),\n (3, \"3\"),\n ]\n```" - ], - "signature": "let fromArray: (array<('k, 'v)>, ~id: id<'k, 'id>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "`keysToArray(s);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.keysToArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n 1,\n 2,\n 3,\n ]\n```" - ], - "signature": "let keysToArray: t<'k, 'v, 'id> => array<'k>" - }, - { - "id": "Belt.Map.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [ - "`valuesToArray(s);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.valuesToArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n \"1\",\n \"2\",\n \"3\",\n ]\n```" - ], - "signature": "let valuesToArray: t<'k, 'v, 'id> => array<'v>" - }, - { - "id": "Belt.Map.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [ - "`minKey(s)` returns the minimum key, None if not exist." - ], - "signature": "let minKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [ - "See `Belt.Map.minKey`" - ], - "signature": "let minKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [ - "`maxKey(s)` returns the maximum key, None if not exist." - ], - "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [ - "See `Belt.Map.maxKey`" - ], - "signature": "let maxKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "`minimum(s)` returns the minimum key value pair, None if not exist." - ], - "signature": "let minimum: t<'k, 'v, 'a> => option<('k, 'v)>" - }, - { - "id": "Belt.Map.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "See `Belt.Map.minimum`" - ], - "signature": "let minUndefined: t<'k, 'v, 'a> => Js.undefined<('k, 'v)>" - }, - { - "id": "Belt.Map.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "`maximum(s)` returns the maximum key value pair, None if not exist." - ], - "signature": "let maximum: t<'k, 'v, 'a> => option<('k, 'v)>" - }, - { - "id": "Belt.Map.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "See `Belt.Map.maximum`" - ], - "signature": "let maxUndefined: t<'k, 'v, 'a> => Js.undefined<('k, 'v)>" - }, - { - "id": "Belt.Map.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(s, k)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.get(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp)), 2) == Some(\"2\")\n\nBelt.Map.get(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp)), 4) == None\n```" - ], - "signature": "let get: (t<'k, 'v, 'id>, 'k) => option<'v>" - }, - { - "id": "Belt.Map.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "See `Belt.Map.get`. Returns `undefined` when not found" - ], - "signature": "let getUndefined: (t<'k, 'v, 'id>, 'k) => Js.undefined<'v>" - }, - { - "id": "Belt.Map.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [ - "`getWithDefault(s, k, default)`\n\nSee `Belt.Map.get`\n\nReturns default when `k` is not found." - ], - "signature": "let getWithDefault: (t<'k, 'v, 'id>, 'k, 'v) => 'v" - }, - { - "id": "Belt.Map.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(s, k)`\n\nSee `Belt.Map.get`\n\nthrow when `k` not exist" - ], - "signature": "let getExn: (t<'k, 'v, 'id>, 'k) => 'v" - }, - { - "id": "Belt.Map.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(s, k)`\n\nSee `Belt.Map.get`\n\nthrow when `k` not exist" - ], - "signature": "let getOrThrow: (t<'k, 'v, 'id>, 'k) => 'v" - }, - { - "id": "Belt.Map.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` when `x` is not in `m`, `m` is returned reference unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))\n\nlet s1 = Belt.Map.remove(s0, 1)\n\nlet s2 = Belt.Map.remove(s1, 1)\n\ns1 == s2\n\nBelt.Map.keysToArray(s1) == [2, 3]\n```" - ], - "signature": "let remove: (t<'k, 'v, 'id>, 'k) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "`removeMany(s, xs)`\n\nRemoving each of `xs` to `s`, note unlike `Belt.Map.remove`, the reference\nof return value might be changed even if none in `xs` exists `s`." - ], - "signature": "let removeMany: (t<'k, 'v, 'id>, array<'k>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as `m`, with a\nnew binding of `x` to `y`. If `x` was already bound in `m`, its previous\nbinding disappears.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))\n\nlet s1 = Belt.Map.set(s0, 2, \"3\")\n\nBelt.Map.valuesToArray(s1) == [\"1\", \"3\", \"3\"]\n```" - ], - "signature": "let set: (t<'k, 'v, 'id>, 'k, 'v) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (\n t<'k, 'v, 'id>,\n 'k,\n option<'v> => option<'v>,\n) => t<'k, 'v, 'id>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.update", - "kind": "value", - "name": "update", - "docstrings": [ - "`update(m, x, f)` returns a map containing the same bindings as `m`, except\nfor the binding of `x`. Depending on the value of `y` where `y` is\n`f(get(m, x))`, the binding of `x` is added, removed or updated. If `y` is\n`None`, the binding is removed if it exists; otherwise, if `y` is `Some(z)`\nthen `x` is associated to `z` in the resulting map." - ], - "signature": "let update: (\n t<'k, 'v, 'id>,\n 'k,\n option<'v> => option<'v>,\n) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "`mergeMany(s, xs)`\n\nAdding each of `xs` to `s`, note unlike `add`, the reference of return\nvalue might be changed even if all values in `xs` exist `s`." - ], - "signature": "let mergeMany: (t<'k, 'v, 'id>, array<('k, 'v)>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'k, 'v, 'id>,\n t<'k, 'v2, 'id>,\n ('k, option<'v>, option<'v2>) => option<'v3>,\n) => t<'k, 'v3, 'id>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'k, 'v, 'id>,\n t<'k, 'v2, 'id>,\n ('k, option<'v>, option<'v2>) => option<'v3>,\n) => t<'k, 'v3, 'id>" - }, - { - "id": "Belt.Map.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => t<'k, 'v, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in m that satisfy\npredicate `p`." - ], - "signature": "let keep: (t<'k, 'v, 'id>, ('k, 'v) => bool) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'k, 'v, 'id>,\n ('k, 'v) => bool,\n) => (t<'k, 'v, 'id>, t<'k, 'v, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains\nall the bindings of `s` that satisfy the predicate `p`, and `m2` is the map\nwith all the bindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (\n t<'k, 'v, 'id>,\n ('k, 'v) => bool,\n) => (t<'k, 'v, 'id>, t<'k, 'v, 'id>)" - }, - { - "id": "Belt.Map.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a tuple `(l, r)`, data, where `l` is the map with all\nthe bindings of `m` whose 'k is strictly less than `x`; `r` is the map with\nall the bindings of m whose 'k is strictly greater than `x`; `data` is\n`None` if `m` contains no binding for `x`, or `Some(v)` if `m` binds `v` to\n`x`." - ], - "signature": "let split: (\n t<'k, 'v, 'id>,\n 'k,\n) => ((t<'k, 'v, 'id>, t<'k, 'v, 'id>), option<'v>)" - }, - { - "id": "Belt.Map.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'k, 'v, 'id>, 'v => 'v2) => t<'k, 'v2, 'id>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'k, 'v, 'id>, 'v => 'v2) => t<'k, 'v2, 'id>" - }, - { - "id": "Belt.Map.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'k, 'v, 'id>, ('k, 'v) => 'v2) => t<'k, 'v2, 'id>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [ - "`mapWithKey(m, f)`\n\nThe same as `Belt.Map.map` except that `f` is supplied with one more\nargument: the key." - ], - "signature": "let mapWithKey: (t<'k, 'v, 'id>, ('k, 'v) => 'v2) => t<'k, 'v2, 'id>" - }, - { - "id": "Belt.Map.getData", - "kind": "value", - "name": "getData", - "docstrings": [ - "`getData(s0)`\n\nAdvanced usage only\n\nReturns the raw data (detached from comparator), but its type is still\nmanifested, so that user can pass identity directly without boxing." - ], - "signature": "let getData: t<'k, 'v, 'id> => Belt_MapDict.t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.getId", - "kind": "value", - "name": "getId", - "docstrings": [ - "Advanced usage only. Returns the identity of s0." - ], - "signature": "let getId: t<'k, 'v, 'id> => id<'k, 'id>" - }, - { - "id": "Belt.Map.packIdData", - "kind": "value", - "name": "packIdData", - "docstrings": [ - "`packIdData(~id, ~data)`\n\nAdvanced usage only\n\nReturns the packed collection." - ], - "signature": "let packIdData: (\n ~id: id<'k, 'id>,\n ~data: Belt_MapDict.t<'k, 'v, 'id>,\n) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit" - } - ] - }, - "belt/set": { - "id": "Belt.Set", - "name": "Set", - "docstrings": [ - "[`Belt.Set`]()\n\n The top level provides generic **immutable** set operations.\n\n It also has three specialized inner modules\n [`Belt.Set.Int`](), [`Belt.Set.String`]() and\n\n [`Belt.Set.Dict`](): This module separates data from function\n which is more verbose but slightly more efficient", - "An _immutable_ sorted set module which allows customized _compare_ behavior.\n\nThe implementation uses balanced binary trees, and therefore searching\nand insertion take time logarithmic in the size of the map.\n\nFor more info on this module's usage of identity, `make` and others, please see\nthe top level documentation of Belt, **A special encoding for collection safety**.\n\n## Examples\n\n```rescript\nmodule PairComparator = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet = Belt.Set.make(~id=module(PairComparator))\nlet mySet2 = Belt.Set.add(mySet, (1, 2))\n```\n\n**Note:** This module's examples will assume a predeclared module for integers\ncalled `IntCmp`. It is declared like this:\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n```" - ], - "items": [ - { - "id": "Belt.Set.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'value, 'identity>" - }, - { - "id": "Belt.Set.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making a set from scratch" - ], - "signature": "type id<'value, 'id> = Belt_Id.comparable<'value, 'id>" - }, - { - "id": "Belt.Set.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new set by taking in the comparator\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.make(~id=module(IntCmp))\n\nBelt.Set.isEmpty(set) == true\n```" - ], - "signature": "let make: (~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\ns0->Belt.Set.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let fromArray: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [ - "The same as [fromArray][#fromarray] except it is after assuming the input array\nis already sorted." - ], - "signature": "let fromSortedArrayUnsafe: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.Set.fromArray([], ~id=module(IntCmp))\nlet notEmpty = Belt.Set.fromArray([1], ~id=module(IntCmp))\n\nBelt.Set.isEmpty(empty) == true\nBelt.Set.isEmpty(notEmpty) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.Set.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if element exists in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.fromArray([1, 4, 2, 5], ~id=module(IntCmp))\n\nset->Belt.Set.has(3) == false\nset->Belt.Set.has(1) == true\n```" - ], - "signature": "let has: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.Set.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\n\nlet s1 = s0->Belt.Set.add(1)\nlet s2 = s1->Belt.Set.add(2)\nlet s3 = s2->Belt.Set.add(2)\n\ns0->Belt.Set.toArray == []\ns1->Belt.Set.toArray == [1]\ns2->Belt.Set.toArray == [1, 2]\ns3->Belt.Set.toArray == [1, 2]\ns2 == s3\n```" - ], - "signature": "let add: (t<'value, 'id>, 'value) => t<'value, 'id>" - }, - { - "id": "Belt.Set.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "Adds each element of array to set. Unlike `Belt.Set.add`\\](\\#add), the reference of return value might be changed even if all values in array already exist in set\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.make(~id=module(IntCmp))\n\nlet newSet = set->Belt.Set.mergeMany([5, 4, 3, 2, 1])\n\nnewSet->Belt.Set.toArray == [1, 2, 3, 4, 5]\n```" - ], - "signature": "let mergeMany: (t<'value, 'id>, array<'value>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([2, 3, 1, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.Set.remove(1)\nlet s2 = s1->Belt.Set.remove(3)\nlet s3 = s2->Belt.Set.remove(3)\n\ns1->Belt.Set.toArray == [2, 3, 4, 5]\ns2->Belt.Set.toArray == [2, 4, 5]\ns2 == s3\n```" - ], - "signature": "let remove: (t<'value, 'id>, 'value) => t<'value, 'id>" - }, - { - "id": "Belt.Set.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "Removes each element of array from set. Unlike [remove](#remove), the reference of return value might be changed even if none of values in array existed in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\nlet newSet = set->Belt.Set.removeMany([5, 4, 3, 2, 1])\n\nnewSet->Belt.Set.toArray == []\n```" - ], - "signature": "let removeMany: (t<'value, 'id>, array<'value>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet union = Belt.Set.union(s0, s1)\n\nunion->Belt.Set.toArray == [1, 2, 3, 4, 5, 6]\n```" - ], - "signature": "let union: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\n\nlet intersect = Belt.Set.intersect(s0, s1)\n\nintersect->Belt.Set.toArray == [2, 3, 5]\n```" - ], - "signature": "let intersect: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.diff", - "kind": "value", - "name": "diff", - "docstrings": [ - "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\n\nBelt.Set.diff(s0, s1)->Belt.Set.toArray == [6]\n\nBelt.Set.diff(s1, s0)->Belt.Set.toArray == [1, 4]\n```" - ], - "signature": "let diff: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet s2 = Belt.Set.intersect(s0, s1)\n\nBelt.Set.subset(s2, s0) == true\nBelt.Set.subset(s2, s1) == true\nBelt.Set.subset(s1, s0) == false\n```" - ], - "signature": "let subset: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.Set.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets. It compares size first and then iterates over each element following\nthe order of elements." - ], - "signature": "let cmp: (t<'value, 'id>, t<'value, 'id>) => int" - }, - { - "id": "Belt.Set.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 5], ~id=module(IntCmp))\n\nBelt.Set.eq(s0, s1) == true\n```" - ], - "signature": "let eq: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.Set.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as [forEach](#forEach) but takes uncurried functon." - ], - "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\n\nlet acc = ref(list{})\n\ns0->Belt.Set.forEach(x => {\n acc := Belt.List.add(acc.contents, x)\n})\n\nacc.contents == list{6, 5, 3, 2}\n```" - ], - "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit" - }, - { - "id": "Belt.Set.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\ns0->Belt.Set.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) == list{6, 5, 3, 2}\n```" - ], - "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a" - }, - { - "id": "Belt.Set.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.fromArray([2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.Set.every(isEven) == true\n```" - ], - "signature": "let every: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.fromArray([1, 2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.Set.some(isOdd) == true\n```" - ], - "signature": "let some: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.Set.keep(isEven)\n\ns1->Belt.Set.toArray == [2, 4]\n```" - ], - "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>" - }, - { - "id": "Belt.Set.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "Returns a pair of sets, where first is the set of all the elements of set that satisfy the predicate, and second is the set of all the elements of set that do not satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet (s1, s2) = s0->Belt.Set.partition(isOdd)\n\ns1->Belt.Set.toArray == [1, 3, 5]\ns2->Belt.Set.toArray == [2, 4]\n```" - ], - "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)" - }, - { - "id": "Belt.Set.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\ns0->Belt.Set.size == 4\n```" - ], - "signature": "let size: t<'value, 'id> => int" - }, - { - "id": "Belt.Set.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.toArray == [1, 2, 3, 5]\n```" - ], - "signature": "let toArray: t<'value, 'id> => array<'value>" - }, - { - "id": "Belt.Set.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.toList == list{1, 2, 3, 5}\n```" - ], - "signature": "let toList: t<'value, 'id> => list<'value>" - }, - { - "id": "Belt.Set.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.minimum == None\ns1->Belt.Set.minimum == Some(1)\n```" - ], - "signature": "let minimum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "Returns minimum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.minUndefined->Js.Undefined.toOption == None\ns1->Belt.Set.minUndefined->Js.Undefined.toOption == Some(1)\n```" - ], - "signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.maximum == None\ns1->Belt.Set.maximum == Some(5)\n```" - ], - "signature": "let maximum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "Returns maximum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0\n->Belt.Set.maxUndefined\n->Js.Undefined.toOption == None\n\ns1\n->Belt.Set.maxUndefined\n->Js.Undefined.toOption == Some(5)\n```" - ], - "signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the reference of the value which is equivalent to value using the comparator specifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.get(3) == Some(3)\ns0->Belt.Set.get(20) == None\n```" - ], - "signature": "let get: (t<'value, 'id>, 'value) => option<'value>" - }, - { - "id": "Belt.Set.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "Same as [get](#get) but returns `undefined` when element does not exist." - ], - "signature": "let getUndefined: (t<'value, 'id>, 'value) => Js.undefined<'value>" - }, - { - "id": "Belt.Set.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getExn: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.Set.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getOrThrow: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.Set.split", - "kind": "value", - "name": "split", - "docstrings": [ - "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\nlet ((smaller, larger), present) = s0->Belt.Set.split(3)\n\npresent == true\nsmaller->Belt.Set.toArray == [1, 2]\nlarger->Belt.Set.toArray == [4, 5]\n```" - ], - "signature": "let split: (\n t<'value, 'id>,\n 'value,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)" - }, - { - "id": "Belt.Set.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b> => unit" - }, - { - "id": "Belt.Set.getData", - "kind": "value", - "name": "getData", - "docstrings": [ - "**Advanced usage only**\n\nReturns the raw data (detached from comparator), but its type is still manifested,\nso that user can pass identity directly without boxing." - ], - "signature": "let getData: t<'value, 'id> => Belt_SetDict.t<'value, 'id>" - }, - { - "id": "Belt.Set.getId", - "kind": "value", - "name": "getId", - "docstrings": [ - "**Advanced usage only**\n\nReturns the identity of set." - ], - "signature": "let getId: t<'value, 'id> => id<'value, 'id>" - }, - { - "id": "Belt.Set.packIdData", - "kind": "value", - "name": "packIdData", - "docstrings": [ - "**Advanced usage only**\n\nReturns the packed collection." - ], - "signature": "let packIdData: (\n ~id: id<'value, 'id>,\n ~data: Belt_SetDict.t<'value, 'id>,\n) => t<'value, 'id>" - } - ] - }, - "belt/range": { - "id": "Belt.Range", - "name": "Range", - "docstrings": [ - "[`Belt.Range`]()\n\n Utilities for a closed range `(from, start)`", - "A small utility module to provide inclusive range operations for `[start, finish]`.\nInternally it is relying on loops instead of creating new arrays, which makes it\npretty performant and memory friendly." - ], - "items": [ - { - "id": "Belt.Range.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (int, int, int => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Range.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(start, finish, action)` equivalent to `Belt.Array.forEach(Belt.Array.range(start, finish), action))`\n\n## Examples\n\n```rescript\nBelt.Range.forEach(0, 4, i => Js.log(i))\n\n// Prints:\n// 0\n// 1\n// 2\n// 3\n// 4\n```" - ], - "signature": "let forEach: (int, int, int => unit) => unit" - }, - { - "id": "Belt.Range.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (int, int, int => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Range.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(start, finish, p)` equivalent to `Belt.Array.every(Belt.Array.range(start, finish), p)`\n## Examples\n\n```rescript\nBelt.Range.every(0, 4, i => i < 5) == true\n\nBelt.Range.every(0, 4, i => i < 4) == false\n```" - ], - "signature": "let every: (int, int, int => bool) => bool" - }, - { - "id": "Belt.Range.everyByU", - "kind": "value", - "name": "everyByU", - "docstrings": [], - "signature": "let everyByU: (int, int, ~step: int, int => bool) => bool", - "deprecated": "Use `everyBy` instead" - }, - { - "id": "Belt.Range.everyBy", - "kind": "value", - "name": "everyBy", - "docstrings": [ - "`everyBy(start, finish, ~step, p)`. See `Belt.Array.rangeBy`, equivalent to\n`Belt.Array.every(Belt.Array.rangeBy(start, finish, ~step), p)`\n\n## Examples\n\n```rescript\nBelt.Range.everyBy(0, 4, ~step=1, i => mod(i, 2) === 0) == false\n\nBelt.Range.everyBy(0, 4, ~step=2, i => mod(i, 2) === 0) == true\n```" - ], - "signature": "let everyBy: (int, int, ~step: int, int => bool) => bool" - }, - { - "id": "Belt.Range.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (int, int, int => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Range.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(start, finish, p)` equivalent to `Belt.Array.some(Belt.Array.range(start, finish), p)`\n\n## Examples\n\n```rescript\nBelt.Range.some(0, 4, i => i > 5) == false\n\nBelt.Range.some(0, 4, i => i > 2) == true\n```" - ], - "signature": "let some: (int, int, int => bool) => bool" - }, - { - "id": "Belt.Range.someByU", - "kind": "value", - "name": "someByU", - "docstrings": [], - "signature": "let someByU: (int, int, ~step: int, int => bool) => bool", - "deprecated": "Use `someBy` instead" - }, - { - "id": "Belt.Range.someBy", - "kind": "value", - "name": "someBy", - "docstrings": [ - "`someBy(start, finish, ~step, p)` See `Belt.Array.rangeBy`, equivalent to\n`Belt.Array.some(Belt.Array.rangeBy(start, finish, ~step), p)`\n\n## Examples\n\n```rescript\nBelt.Range.someBy(1, 5, ~step=2, i => mod(i, 2) === 0) == false\nBelt.Range.someBy(0, 4, ~step=2, i => mod(i, 2) === 0) == true\n```" - ], - "signature": "let someBy: (int, int, ~step: int, int => bool) => bool" - } - ] - }, - "belt/list": { - "id": "Belt.List", - "name": "List", - "docstrings": [ - "[`Belt.List`]()\n\n Utilities for List data type", - "Collection functions for manipulating the `list` data structures, a singly-linked list.\n\n**Prefer Array** if you need any of the following:\n\n- Random access of element\n- Better interop with JavaScript\n- Better memory usage & performance." - ], - "items": [ - { - "id": "Belt.List.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'a t` is compatible with built-in `list` type" - ], - "signature": "type t<'a> = list<'a>" - }, - { - "id": "Belt.List.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Returns the length of a list.\n\n## Examples\n\n```rescript\nBelt.List.length(list{1, 2, 3}) == 3\n```" - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Belt.List.size", - "kind": "value", - "name": "size", - "docstrings": [ - "See `Belt.List.length`" - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.List.head", - "kind": "value", - "name": "head", - "docstrings": [ - "Returns `Some(value)` where `value` is the first element in the list, or\n`None` if `someList` is an empty list.\n\n## Examples\n\n```rescript\nBelt.List.head(list{}) == None\nBelt.List.head(list{1, 2, 3}) == Some(1)\n```" - ], - "signature": "let head: t<'a> => option<'a>" - }, - { - "id": "Belt.List.headExn", - "kind": "value", - "name": "headExn", - "docstrings": [ - "Same as `Belt.List.head` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.headExn(list{1, 2, 3}) == 1\n\nswitch Belt.List.headExn(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let headExn: t<'a> => 'a" - }, - { - "id": "Belt.List.headOrThrow", - "kind": "value", - "name": "headOrThrow", - "docstrings": [ - "Same as `Belt.List.head` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.headOrThrow(list{1, 2, 3}) == 1\n\nswitch Belt.List.headOrThrow(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let headOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.List.tail", - "kind": "value", - "name": "tail", - "docstrings": [ - "Returns `None` if `someList` is empty, otherwise it returns `Some(tail)`\nwhere `tail` is everything except the first element of `someList`.\n\n## Examples\n\n```rescript\nBelt.List.tail(list{1, 2, 3}) == Some(list{2, 3})\n\nBelt.List.tail(list{}) == None\n```" - ], - "signature": "let tail: t<'a> => option>" - }, - { - "id": "Belt.List.tailExn", - "kind": "value", - "name": "tailExn", - "docstrings": [ - "Same as `Belt.List.tail` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.tailExn(list{1, 2, 3}) == list{2, 3}\n\nswitch Belt.List.tailExn(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let tailExn: t<'a> => t<'a>" - }, - { - "id": "Belt.List.tailOrThrow", - "kind": "value", - "name": "tailOrThrow", - "docstrings": [ - "Same as `Belt.List.tail` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.tailOrThrow(list{1, 2, 3}) == list{2, 3}\n\nswitch Belt.List.tailOrThrow(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let tailOrThrow: t<'a> => t<'a>" - }, - { - "id": "Belt.List.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds `value` to the beginning of `someList`.\n\n## Examples\n\n```rescript\nBelt.List.add(list{2, 3}, 1) // list{1, 2, 3}\n\nBelt.List.add(list{\"World\", \"!\"}, \"Hello\") == list{\"Hello\", \"World\", \"!\"}\n```" - ], - "signature": "let add: (t<'a>, 'a) => t<'a>" - }, - { - "id": "Belt.List.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Return the nth element in `someList`, or `None` if `index` is larger than the\nlength.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.get(1) == Some(\"B\")\n\nabc->Belt.List.get(4) == None\n```" - ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, - { - "id": "Belt.List.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as `Belt.List.get` but throws an exception if `index` is larger than the\nlength. Use with care.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.getExn(1) == \"B\"\n\nswitch abc->Belt.List.getExn(4) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getExn: (t<'a>, int) => 'a" - }, - { - "id": "Belt.List.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as `Belt.List.get` but throws an exception if `index` is larger than the\nlength. Use with care.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.getOrThrow(1) == \"B\"\n\nswitch abc->Belt.List.getOrThrow(4) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getOrThrow: (t<'a>, int) => 'a" - }, - { - "id": "Belt.List.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a list of length `numItems` with each element filled with value `v`. Returns an empty list if `numItems` is negative.\n\n## Examples\n\n```rescript\nBelt.List.make(3, 1) == list{1, 1, 1}\n```" - ], - "signature": "let make: (int, 'a) => t<'a>" - }, - { - "id": "Belt.List.makeByU", - "kind": "value", - "name": "makeByU", - "docstrings": [ - "Uncurried version of [makeBy](#makeBy)" - ], - "signature": "let makeByU: (int, int => 'a) => t<'a>", - "deprecated": "Use `makeBy` instead" - }, - { - "id": "Belt.List.makeBy", - "kind": "value", - "name": "makeBy", - "docstrings": [ - "Return a list of length `numItems` with element `i` initialized with `f(i)`.\nReturns an empty list if `numItems` is negative.\n\n## Examples\n\n```rescript\nBelt.List.makeBy(5, i => i) == list{0, 1, 2, 3, 4}\n\nBelt.List.makeBy(5, i => i * i) == list{0, 1, 4, 9, 16}\n```" - ], - "signature": "let makeBy: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.List.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "Returns a new list in random order.\n\n## Examples\n\n```rescript\nBelt.List.shuffle(list{1, 2, 3}) // list{2, 1, 3}\n```" - ], - "signature": "let shuffle: t<'a> => t<'a>" - }, - { - "id": "Belt.List.drop", - "kind": "value", - "name": "drop", - "docstrings": [ - "Return a new list, dropping the first `n` elements. Returns `None` if `someList` has fewer than `n` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.drop(2) == Some(list{3})\n\nlist{1, 2, 3}->Belt.List.drop(3) == Some(list{})\n\nlist{1, 2, 3}->Belt.List.drop(4) == None\n```" - ], - "signature": "let drop: (t<'a>, int) => option>" - }, - { - "id": "Belt.List.take", - "kind": "value", - "name": "take", - "docstrings": [ - "Returns a list with the first `n` elements from `someList`, or `None` if `someList` has fewer than `n` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.take(1) == Some(list{1})\n\nlist{1, 2, 3}->Belt.List.take(2) == Some(list{1, 2})\n\nlist{1, 2, 3}->Belt.List.take(4) == None\n```" - ], - "signature": "let take: (t<'a>, int) => option>" - }, - { - "id": "Belt.List.splitAt", - "kind": "value", - "name": "splitAt", - "docstrings": [ - "Split the list `someList` at `index`. Returns `None` when the length of `someList` is less than `index`.\n\n## Examples\n\n```rescript\nlist{\"Hello\", \"World\"}->Belt.List.splitAt(1) == Some((list{\"Hello\"}, list{\"World\"}))\n\nlist{0, 1, 2, 3, 4}->Belt.List.splitAt(2) == Some((list{0, 1}, list{2, 3, 4}))\n```" - ], - "signature": "let splitAt: (t<'a>, int) => option<(list<'a>, list<'a>)>" - }, - { - "id": "Belt.List.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "Returns the list obtained by adding `secondList` after `firstList`.\n\n## Examples\n\n```rescript\nBelt.List.concat(list{1, 2, 3}, list{4, 5}) == list{1, 2, 3, 4, 5}\n```" - ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Belt.List.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "Returns the list obtained by concatenating all the lists in array `a`, in\norder.\n\n## Examples\n\n```rescript\nBelt.List.concatMany([list{1, 2, 3}, list{}, list{3}]) == list{1, 2, 3, 3}\n```" - ], - "signature": "let concatMany: array> => t<'a>" - }, - { - "id": "Belt.List.reverseConcat", - "kind": "value", - "name": "reverseConcat", - "docstrings": [ - "Equivalent to writing: `concat(reverse(firstList, secondList)`\n\n## Examples\n\n```rescript\nBelt.List.reverseConcat(list{1, 2}, list{3, 4}) == list{2, 1, 3, 4}\n```" - ], - "signature": "let reverseConcat: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Belt.List.flatten", - "kind": "value", - "name": "flatten", - "docstrings": [ - "Return the list obtained by concatenating all the lists in list `ls`, in order.\n\n## Examples\n\n```rescript\nBelt.List.flatten(list{list{1, 2, 3}, list{}, list{3}}) == list{1, 2, 3, 3}\n```" - ], - "signature": "let flatten: t> => t<'a>" - }, - { - "id": "Belt.List.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [ - "Uncurried version of [map](#map)." - ], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.List.map", - "kind": "value", - "name": "map", - "docstrings": [ - "Returns a new list with `f` applied to each element of `someList`.\n\n## Examples\n\n```rescript\nlist{1, 2}->Belt.List.map(x => x + 1) == list{2, 3}\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.List.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "Returns a list of pairs from the two lists with the length of the shorter list.\n\n## Examples\n\n```rescript\nBelt.List.zip(list{1, 2}, list{3, 4, 5}) == list{(1, 3), (2, 4)}\n```" - ], - "signature": "let zip: (t<'a>, t<'b>) => t<('a, 'b)>" - }, - { - "id": "Belt.List.zipByU", - "kind": "value", - "name": "zipByU", - "docstrings": [ - "Uncurried version of [zipBy](#zipBy)." - ], - "signature": "let zipByU: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>", - "deprecated": "Use `zipBy` instead" - }, - { - "id": "Belt.List.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "See [Belt.List.zip](#zip)\n\n## Examples\n\n```rescript\nBelt.List.zipBy(list{1, 2, 3}, list{4, 5}, (a, b) => 2 * a + b) == list{6, 9}\n```" - ], - "signature": "let zipBy: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>" - }, - { - "id": "Belt.List.mapWithIndexU", - "kind": "value", - "name": "mapWithIndexU", - "docstrings": [ - "Uncurried version of [mapWithIndex](#mapWithIndex)." - ], - "signature": "let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => t<'b>", - "deprecated": "Use `mapWithIndex` instead" - }, - { - "id": "Belt.List.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "Applies `f` to each element of `someList`.\nFunction `f` takes two arguments: the index starting from 0 and the element from `someList`, in that order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.mapWithIndex((index, x) => index + x) == list{1, 3, 5}\n```" - ], - "signature": "let mapWithIndex: (t<'a>, (int, 'a) => 'b) => t<'b>" - }, - { - "id": "Belt.List.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Converts the given array to a list.\n\n## Examples\n\n```rescript\nBelt.List.fromArray([1, 2, 3]) == list{1, 2, 3}\n```" - ], - "signature": "let fromArray: array<'a> => t<'a>" - }, - { - "id": "Belt.List.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Converts the given list to an array.\n\n## Examples\n\n```rescript\nBelt.List.toArray(list{1, 2, 3}) == [1, 2, 3]\n```" - ], - "signature": "let toArray: t<'a> => array<'a>" - }, - { - "id": "Belt.List.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "Returns a new list whose elements are those of `someList` in reversed order.\n\n## Examples\n\n```rescript\nBelt.List.reverse(list{1, 2, 3}) == list{3, 2, 1}\n```" - ], - "signature": "let reverse: t<'a> => t<'a>" - }, - { - "id": "Belt.List.mapReverseU", - "kind": "value", - "name": "mapReverseU", - "docstrings": [ - "Uncurried version of [mapReverse](#mapReverse)." - ], - "signature": "let mapReverseU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `mapReverse` instead" - }, - { - "id": "Belt.List.mapReverse", - "kind": "value", - "name": "mapReverse", - "docstrings": [ - "Equivalent to `Belt.List.map(someList, f)->Belt.List.reverse`\n\n## Examples\n\n```rescript\nlist{3, 4, 5}->Belt.List.mapReverse(x => x * x) == list{25, 16, 9}\n```" - ], - "signature": "let mapReverse: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.List.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Uncurried version of [forEach](#forEach)." - ], - "signature": "let forEachU: (t<'a>, 'a => 'b) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.List.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Call `f` on each element of `someList` from the beginning to end.\n`f` returns `unit`, so no new array is created. Use `forEach` when you are primarily concerned with repetitively creating side effects.\n\n## Examples\n\n```rescript\nBelt.List.forEach(list{\"a\", \"b\", \"c\"}, x => Js.log(\"Item: \" ++ x))\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\n```" - ], - "signature": "let forEach: (t<'a>, 'a => 'b) => unit" - }, - { - "id": "Belt.List.forEachWithIndexU", - "kind": "value", - "name": "forEachWithIndexU", - "docstrings": [ - "Uncurried version of [forEachWithIndex](#forEachWithIndex)." - ], - "signature": "let forEachWithIndexU: (t<'a>, (int, 'a) => 'b) => unit", - "deprecated": "Use `forEachWithIndex` instead" - }, - { - "id": "Belt.List.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "Call `f` on each element of `someList` from beginning to end.\nFunction `f` takes two arguments: the index starting from 0 and the element from `someList`. `f` returns `unit`.\n\n## Examples\n\n```rescript\nBelt.List.forEachWithIndex(list{\"a\", \"b\", \"c\"}, (index, x) => {\n Js.log(\"Item \" ++ Belt.Int.toString(index) ++ \" is \" ++ x)\n})\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\n```" - ], - "signature": "let forEachWithIndex: (t<'a>, (int, 'a) => 'b) => unit" - }, - { - "id": "Belt.List.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [ - "Uncurried version of [reduce](#reduce)." - ], - "signature": "let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.List.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies `f` to each element of `someList` from beginning to end. Function `f` has two parameters: the item from the list and an “accumulator”, which starts with a value of `initialValue`. reduce returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduce(0, (a, b) => a + b) == 10\n\n/* same as */\n\nlist{1, 2, 3, 4}->Belt.List.reduce(0, (acc, item) => acc + item) == 10\n```" - ], - "signature": "let reduce: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Belt.List.reduceWithIndexU", - "kind": "value", - "name": "reduceWithIndexU", - "docstrings": [ - "Uncurried version of [reduceWithIndex](#reduceWithIndex)." - ], - "signature": "let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b", - "deprecated": "Use `reduceWithIndex` instead" - }, - { - "id": "Belt.List.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "Applies `f` to each element of `someList` from beginning to end. Function `f` has three parameters: the item from the list and an “accumulator”, which starts with a value of `initialValue` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduceWithIndex(0, (acc, item, index) => acc + item + index) == 16\n```" - ], - "signature": "let reduceWithIndex: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Belt.List.reduceReverseU", - "kind": "value", - "name": "reduceReverseU", - "docstrings": [ - "Uncurried version of [reduceReverse](#reduceReverse)." - ], - "signature": "let reduceReverseU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b", - "deprecated": "Use `reduceReverse` instead" - }, - { - "id": "Belt.List.reduceReverse", - "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "Works like [reduce](#reduce), except that function `f` is applied to each\nitem of `someList` from the last back to the first.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(0, (a, b) => a + b) == 10\n\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(10, (a, b) => a - b) == 0\n\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(list{}, Belt.List.add) == list{1, 2, 3, 4}\n```" - ], - "signature": "let reduceReverse: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Belt.List.mapReverse2U", - "kind": "value", - "name": "mapReverse2U", - "docstrings": [ - "Uncurried version of [mapReverse2](#mapReverse2)." - ], - "signature": "let mapReverse2U: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>", - "deprecated": "Use `mapReverse2` instead" - }, - { - "id": "Belt.List.mapReverse2", - "kind": "value", - "name": "mapReverse2", - "docstrings": [ - "Equivalent to: `zipBy(xs, ys, f)->reverse`\n\n## Examples\n\n```rescript\nBelt.List.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) == list{4, 2}\n```" - ], - "signature": "let mapReverse2: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>" - }, - { - "id": "Belt.List.forEach2U", - "kind": "value", - "name": "forEach2U", - "docstrings": [ - "Uncurried version of [forEach2](#forEach2)." - ], - "signature": "let forEach2U: (t<'a>, t<'b>, ('a, 'b) => 'c) => unit", - "deprecated": "Use `forEach2` instead" - }, - { - "id": "Belt.List.forEach2", - "kind": "value", - "name": "forEach2", - "docstrings": [ - "Stops at the length of the shorter list.\n\n## Examples\n\n```rescript\nBelt.List.forEach2(list{\"Z\", \"Y\"}, list{\"A\", \"B\", \"C\"}, (x, y) => Js.log2(x, y))\n\n/*\n prints:\n \"Z\" \"A\"\n \"Y\" \"B\"\n*/\n```" - ], - "signature": "let forEach2: (t<'a>, t<'b>, ('a, 'b) => 'c) => unit" - }, - { - "id": "Belt.List.reduce2U", - "kind": "value", - "name": "reduce2U", - "docstrings": [ - "Uncurried version of [reduce2](#reduce2)." - ], - "signature": "let reduce2U: (t<'b>, t<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a", - "deprecated": "Use `reduce2` instead" - }, - { - "id": "Belt.List.reduce2", - "kind": "value", - "name": "reduce2", - "docstrings": [ - "Applies `f` to each element of `firstList` and `secondList` from beginning to end. Stops with the shorter list. Function `f` has three parameters: an “accumulator” which starts with a value of `initialValue`, an item from `firstList`, and an item from `secondList`. `reduce2` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nBelt.List.reduce2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduce2: (t<'b>, t<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a" - }, - { - "id": "Belt.List.reduceReverse2U", - "kind": "value", - "name": "reduceReverse2U", - "docstrings": [ - "Uncurried version of [reduceReverse2](#reduceReverse2)." - ], - "signature": "let reduceReverse2U: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c", - "deprecated": "Use `reduceReverse2` instead" - }, - { - "id": "Belt.List.reduceReverse2", - "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "Applies `f` to each element of `firstList` and `secondList` from end to\nbeginning. Stops with the shorter list. Function `f` has three parameters: an\n“accumulator” which starts with a value of init, an item from `firstList`,\nand an item from `secondList`. `reduce2` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nBelt.List.reduceReverse2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduceReverse2: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" - }, - { - "id": "Belt.List.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [ - "Uncurried version of [every](#every)." - ], - "signature": "let everyU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.List.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Returns `true` if all elements satisfy `pred`, where `pred` is a predicate: a function taking an element and returning a bool.\n\n## Examples\n\n```rescript\nlet isBelow10 = value => value < 10\n\nlist{1, 9, 8, 2}->Belt.List.every(isBelow10) == true\n\nlist{1, 99, 8, 2}->Belt.List.every(isBelow10) == false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.List.someU", - "kind": "value", - "name": "someU", - "docstrings": [ - "Uncurried version of [some](#some)." - ], - "signature": "let someU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.List.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Returns `true` if at least _one_ of the elements in `someList` satisfies\n`pred`, where `pred` is a predicate: a function taking an element and\nreturning a bool.\n\n## Examples\n\n```rescript\nlet isAbove100 = value => value > 100\n\nlist{101, 1, 2, 3}->Belt.List.some(isAbove100) == true\n\nlist{1, 2, 3, 4}->Belt.List.some(isAbove100) == false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.List.every2U", - "kind": "value", - "name": "every2U", - "docstrings": [ - "Uncurried version of [every2](#every2)." - ], - "signature": "let every2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `every2` instead" - }, - { - "id": "Belt.List.every2", - "kind": "value", - "name": "every2", - "docstrings": [ - "Returns `true` if predicate `pred(a, b)` is `true` for all pairs of elements\nup to the shorter length (i.e. `min(length(firstList), length(secondList))`)\n\n## Examples\n\n```rescript\nBelt.List.every2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nBelt.List.every2(list{}, list{1}, (a, b) => a > b) == true\n\nBelt.List.every2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nBelt.List.every2(list{0, 1}, list{5, 0}, (a, b) => a > b) == false\n```" - ], - "signature": "let every2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.some2U", - "kind": "value", - "name": "some2U", - "docstrings": [ - "Uncurried version of [some2](#some2)." - ], - "signature": "let some2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `some2` instead" - }, - { - "id": "Belt.List.some2", - "kind": "value", - "name": "some2", - "docstrings": [ - "Returns `true` if predicate `pred(a, b)` is true for any pair of elements up\nto the shorter length (i.e. `min(length(firstList), length(secondList))`)\n\n## Examples\n\n```rescript\nBelt.List.some2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nBelt.List.some2(list{}, list{1}, (a, b) => a > b) == false\n\nBelt.List.some2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nBelt.List.some2(list{0, 1}, list{5, 0}, (a, b) => a > b) == true\n```" - ], - "signature": "let some2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.cmpByLength", - "kind": "value", - "name": "cmpByLength", - "docstrings": [ - "Compare two lists solely by length. Returns `-1` if `length(firstList)` is\nless than `length(secondList)`, `0` if `length(firstList)` equals\n`length(secondList)`, and `1` if `length(firstList)` is greater than\n`length(secondList)`.\n\n## Examples\n\n```rescript\nBelt.List.cmpByLength(list{1, 2}, list{3, 4, 5, 6}) == -1\n\nBelt.List.cmpByLength(list{1, 2, 3}, list{4, 5, 6}) == 0\n\nBelt.List.cmpByLength(list{1, 2, 3, 4}, list{5, 6}) == 1\n```" - ], - "signature": "let cmpByLength: (t<'a>, t<'a>) => int" - }, - { - "id": "Belt.List.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [ - "Uncurried version of [cmp](#cmp)." - ], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.List.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Compare elements one by one `compareFn(a, b)`. `compareFn` returns a negative number if `a` is \"less than\" `b`, zero if `a` is \"equal to\" `b`, a positive number if `a` is \"greater than\" `b`.\n\nThe comparison returns the first non-zero result of `compareFn`, or zero if `compareFn` returns zero for all `a` and `b`.\n\nIf all items have compared equal, but `firstList` is exhausted first, return `-1`. (`firstList` is shorter).\nIf all items have compared equal, but `secondList` is exhausted first, return `1` (`firstList` is longer).\n\n## Examples\n\n```rescript\nBelt.List.cmp(list{3}, list{3, 7}, (a, b) => compare(a, b)) == -1\n\nBelt.List.cmp(list{5, 3}, list{5}, (a, b) => compare(a, b)) == 1\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 4, 2}, (a, b) => compare(a, b)) == -1\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 2, 3}, (a, b) => compare(a, b)) == 1\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 3, 5}, (a, b) => compare(a, b)) == 0\n```\n\n**Please note:** The total ordering of List is different from Array,\nfor Array, we compare the length first and, only if the lengths are equal, elements one by one.\nFor lists, we just compare elements one by one." - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.List.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [ - "Uncurried version of [eq](#eq)." - ], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.List.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Check equality of `firstList` and `secondList` using `eqElem` for equality on\nelements, where `eqElem` is a function that returns `true` if items `x` and\n`y` meet some criterion for equality, `false` otherwise. eq `false` if length\nof `firstList` and `secondList` are not the same.\n\n## Examples\n\n```rescript\nBelt.List.eq(list{1, 2, 3}, list{1, 2}, (a, b) => a == b) == false\n\nBelt.List.eq(list{1, 2}, list{1, 2}, (a, b) => a == b) == true\n\nBelt.List.eq(list{1, 2, 3}, list{-1, -2, -3}, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.List.hasU", - "kind": "value", - "name": "hasU", - "docstrings": [ - "Uncurried version of [has](#has)." - ], - "signature": "let hasU: (t<'a>, 'b, ('a, 'b) => bool) => bool", - "deprecated": "Use `has` instead" - }, - { - "id": "Belt.List.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Returns `true` if the list contains at least one element for which\n`eqFunction(x)` returns true.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.has(2, (a, b) => a == b) == true\n\nlist{1, 2, 3}->Belt.List.has(4, (a, b) => a == b) == false\n\nlist{-1, -2, -3}->Belt.List.has(2, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let has: (t<'a>, 'b, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.getByU", - "kind": "value", - "name": "getByU", - "docstrings": [ - "Uncurried version of [getBy](#getBy)." - ], - "signature": "let getByU: (t<'a>, 'a => bool) => option<'a>", - "deprecated": "Use `getBy` instead" - }, - { - "id": "Belt.List.getBy", - "kind": "value", - "name": "getBy", - "docstrings": [ - "Returns `Some(value)` for the first value in `someList` that satisfies the\npredicate function `pred`. Returns `None` if no element satisfies the function.\n\n## Examples\n\n```rescript\nBelt.List.getBy(list{1, 4, 3, 2}, x => x > 3) == Some(4)\n\nBelt.List.getBy(list{1, 4, 3, 2}, x => x > 4) == None\n```" - ], - "signature": "let getBy: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Belt.List.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [ - "Uncurried version of [keep](#keep)." - ], - "signature": "let keepU: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.List.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.keep(list{1, 2, 3, 4}, isEven) == list{2, 4}\n\nBelt.List.keep(list{None, Some(2), Some(3), None}, Belt.Option.isSome) == list{Some(2), Some(3)}\n```" - ], - "signature": "let keep: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Belt.List.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.filter(list{1, 2, 3, 4}, isEven) == list{2, 4}\n\nBelt.List.filter(list{None, Some(2), Some(3), None}, Belt.Option.isSome) == list{Some(2), Some(3)}\n```" - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "This function will soon be deprecated. Please, use `List.keep` instead." - }, - { - "id": "Belt.List.keepWithIndexU", - "kind": "value", - "name": "keepWithIndexU", - "docstrings": [ - "Uncurried version of [keepWithIndex](#keepWithIndex)." - ], - "signature": "let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "Use `keepWithIndex` instead" - }, - { - "id": "Belt.List.keepWithIndex", - "kind": "value", - "name": "keepWithIndex", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.keepWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) == list{1, 3}\n```" - ], - "signature": "let keepWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" - }, - { - "id": "Belt.List.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.filterWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) == list{1, 3}\n```" - ], - "signature": "let filterWithIndex: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "This function will soon be deprecated. Please, use `List.keepWithIndex` \\\n instead." - }, - { - "id": "Belt.List.keepMapU", - "kind": "value", - "name": "keepMapU", - "docstrings": [ - "Uncurried version of [keepMap](#keepMap)." - ], - "signature": "let keepMapU: (t<'a>, 'a => option<'b>) => t<'b>", - "deprecated": "Use `keepMap` instead" - }, - { - "id": "Belt.List.keepMap", - "kind": "value", - "name": "keepMap", - "docstrings": [ - "Applies `f` to each element of `someList`. If `f(x)` returns `Some(value)`, then `value` is _kept_ in the resulting list.\nIf `f(x)` returns `None`, the element is _not_ retained in the result.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nlist{1, 2, 3, 4}->Belt.List.keepMap(x =>\n if isEven(x) {\n Some(x)\n } else {\n None\n }\n) /* list{2, 4} */\n\nlist{Some(1), Some(2), None}->Belt.List.keepMap(x => x) == list{1, 2}\n```" - ], - "signature": "let keepMap: (t<'a>, 'a => option<'b>) => t<'b>" - }, - { - "id": "Belt.List.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [ - "Uncurried version of [partition](#partition)." - ], - "signature": "let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.List.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "Creates a pair of lists; the first list consists of all elements of `someList` that satisfy the predicate function `pred`; the second list consists of all elements of `someList` that _do not_ satisfy \\`pred.\n\nIn other words:\n\n```\n(elementsThatSatisfies, elementsThatDoesNotSatisfy)\n```\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.partition(x => x > 2) == (list{3, 4}, list{1, 2})\n```" - ], - "signature": "let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)" - }, - { - "id": "Belt.List.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "Takes a list of pairs and creates a pair of lists. The first list contains all the first items of the pairs; the second list contains all the second items.\n\n## Examples\n\n```rescript\nBelt.List.unzip(list{(1, 2), (3, 4)}) == (list{1, 3}, list{2, 4})\n\nBelt.List.unzip(list{(\"H\", \"W\"), (\"e\", \"o\"), (\"l\", \"r\"), (\"l\", \"l\"), (\"o\", \"d\"), (\" \", \"!\")}) ==\n (list{\"H\", \"e\", \"l\", \"l\", \"o\", \" \"}, list{\"W\", \"o\", \"r\", \"l\", \"d\", \"!\"})\n```" - ], - "signature": "let unzip: t<('a, 'b)> => (t<'a>, t<'b>)" - }, - { - "id": "Belt.List.getAssocU", - "kind": "value", - "name": "getAssocU", - "docstrings": [ - "Uncurried version of [getAssoc](#getAssoc)." - ], - "signature": "let getAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>", - "deprecated": "Use `getAssoc` instead" - }, - { - "id": "Belt.List.getAssoc", - "kind": "value", - "name": "getAssoc", - "docstrings": [ - "Return the second element of a pair in `someList` where the first element equals `k` as per the predicate function `eqFunction`, or `None` if not found.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.getAssoc(3, (a, b) => a == b) /* Some(\"c\") */\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.getAssoc(15, (k, item) =>\n k /* 15 */ == item\n) == Some(\"afternoon\")\n/* 9, 5, 22 */\n```" - ], - "signature": "let getAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>" - }, - { - "id": "Belt.List.hasAssocU", - "kind": "value", - "name": "hasAssocU", - "docstrings": [ - "Uncurried version of [hasAssoc](#hasAssoc)." - ], - "signature": "let hasAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => bool", - "deprecated": "Use `hasAssoc` instead" - }, - { - "id": "Belt.List.hasAssoc", - "kind": "value", - "name": "hasAssoc", - "docstrings": [ - "Returns `true` if there is a pair in `someList` where the first element equals `k` as per the predicate function `eqFunction`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.hasAssoc(1, (a, b) => a == b) == true\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.hasAssoc(25, (k, item) =>\n k /* 25 */ == item\n) == false\n/* 9, 5, 22 */\n```" - ], - "signature": "let hasAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.removeAssocU", - "kind": "value", - "name": "removeAssocU", - "docstrings": [ - "Uncurried version of [removeAssoc](#removeAssoc)." - ], - "signature": "let removeAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => t<('a, 'c)>", - "deprecated": "Use `removeAssoc` instead" - }, - { - "id": "Belt.List.removeAssoc", - "kind": "value", - "name": "removeAssoc", - "docstrings": [ - "Return a list after removing the first pair whose first value is `k` per the equality predicate `eqFunction`; if not found, return a new list identical to `someList`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.removeAssoc(1, (a, b) => a == b) ==\n list{(2, \"b\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.removeAssoc(9, (k, item) =>\n k /* 9 */ == item\n) == list{(15, \"afternoon\"), (22, \"night\")}\n/* 9, 5, 22 */\n```" - ], - "signature": "let removeAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => t<('a, 'c)>" - }, - { - "id": "Belt.List.setAssocU", - "kind": "value", - "name": "setAssocU", - "docstrings": [ - "Uncurried version of [setAssoc](#setAssoc)." - ], - "signature": "let setAssocU: (t<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => t<('a, 'c)>", - "deprecated": "Use `setAssoc` instead" - }, - { - "id": "Belt.List.setAssoc", - "kind": "value", - "name": "setAssoc", - "docstrings": [ - "If `k` exists in `someList` by satisfying the `eqFunction` predicate, return a new list with the key and value replaced by the new `k` and `v`; otherwise, return a new list with the pair `k`, `v` added to the head of `someList`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.setAssoc(2, \"x\", (a, b) => a == b) ==\n list{(1, \"a\"), (2, \"x\"), (3, \"c\")}\n\nlist{(1, \"a\"), (3, \"c\")}->Belt.List.setAssoc(2, \"b\", (a, b) => a == b) ==\n list{(2, \"b\"), (1, \"a\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (3, \"morning?!\"), (22, \"night\")}->Belt.List.setAssoc(15, \"afternoon\", (a, b) =>\n mod(a, 12) == mod(b, 12)\n) == list{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n```\n\n**Please note**\n\nIn the last example, since: `15 mod 12` equals `3 mod 12`\n\nBoth the key _and_ the value are replaced in the list." - ], - "signature": "let setAssoc: (t<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => t<('a, 'c)>" - }, - { - "id": "Belt.List.sortU", - "kind": "value", - "name": "sortU", - "docstrings": [ - "Uncurried version of [sort](#sort)." - ], - "signature": "let sortU: (t<'a>, ('a, 'a) => int) => t<'a>", - "deprecated": "Use `sort` instead" - }, - { - "id": "Belt.List.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "Returns a sorted list.\n\n## Examples\n\n```rescript\nBelt.List.sort(list{5, 4, 9, 3, 7}, (a, b) => a - b) == list{3, 4, 5, 7, 9}\n```" - ], - "signature": "let sort: (t<'a>, ('a, 'a) => int) => t<'a>" - } - ] - }, - "belt/mutablestack": { - "id": "Belt.MutableStack", - "name": "MutableStack", - "docstrings": [ - "[`Belt.MutableStack`]()\n\n An FILO(first in last out) stack data structure", - "First in last out stack. This module implements stacks, with in-place\nmodification." - ], - "items": [ - { - "id": "Belt.MutableStack.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableStack.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a new stack, initially empty." - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableStack.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Discard all elements from the stack." - ], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableStack.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(x)` O(1) operation, return a new stack." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.MutableStack.push", - "kind": "value", - "name": "push", - "docstrings": [], - "signature": "let push: (t<'a>, 'a) => unit" - }, - { - "id": "Belt.MutableStack.popUndefined", - "kind": "value", - "name": "popUndefined", - "docstrings": [], - "signature": "let popUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableStack.pop", - "kind": "value", - "name": "pop", - "docstrings": [], - "signature": "let pop: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableStack.topUndefined", - "kind": "value", - "name": "topUndefined", - "docstrings": [], - "signature": "let topUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableStack.top", - "kind": "value", - "name": "top", - "docstrings": [], - "signature": "let top: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableStack.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableStack.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableStack.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableStack.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.MutableStack.dynamicPopIterU", - "kind": "value", - "name": "dynamicPopIterU", - "docstrings": [], - "signature": "let dynamicPopIterU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `dynamicPopIter` instead" - }, - { - "id": "Belt.MutableStack.dynamicPopIter", - "kind": "value", - "name": "dynamicPopIter", - "docstrings": [ - "`dynamicPopIter(s, f)` apply `f` to each element of `s`. The item is poped\nbefore applying `f`, `s` will be empty after this opeartion. This function is\nuseful for worklist algorithm." - ], - "signature": "let dynamicPopIter: (t<'a>, 'a => unit) => unit" - } - ] - }, - "belt/mutablequeue": { - "id": "Belt.MutableQueue", - "name": "MutableQueue", - "docstrings": [ - "[`Belt.MutableQueue`]()\n\n An FIFO(first in first out) queue data structure", - "A FIFO (first in first out) queue data structure." - ], - "items": [ - { - "id": "Belt.MutableQueue.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of queues containing elements of `type('a)`." - ], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableQueue.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a new queue, initially empty." - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableQueue.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Discard all elements from the queue." - ], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableQueue.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Returns `true` if the given queue is empty, `false` otherwise." - ], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableQueue.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` a is equivalent to `Array.forEach(a, add(q, a));`" - ], - "signature": "let fromArray: array<'a> => t<'a>" - }, - { - "id": "Belt.MutableQueue.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(q, x)` adds the element `x` at the end of the queue `q`." - ], - "signature": "let add: (t<'a>, 'a) => unit" - }, - { - "id": "Belt.MutableQueue.peek", - "kind": "value", - "name": "peek", - "docstrings": [ - "`peekOpt(q)` returns the first element in queue `q`, without removing it from the queue." - ], - "signature": "let peek: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableQueue.peekUndefined", - "kind": "value", - "name": "peekUndefined", - "docstrings": [ - "`peekUndefined(q)` returns `undefined` if not found." - ], - "signature": "let peekUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableQueue.peekExn", - "kind": "value", - "name": "peekExn", - "docstrings": [ - "`peekExn(q)` throws an exception if `q` is empty." - ], - "signature": "let peekExn: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.peekOrThrow", - "kind": "value", - "name": "peekOrThrow", - "docstrings": [ - "`peekOrThrow(q)` throws an exception if `q` is empty." - ], - "signature": "let peekOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "`pop(q)` removes and returns the first element in queue `q`." - ], - "signature": "let pop: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableQueue.popUndefined", - "kind": "value", - "name": "popUndefined", - "docstrings": [ - "`popUndefined(q)` removes and returns the first element in queue `q`. it will\nreturn `undefined` if it is already empty." - ], - "signature": "let popUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableQueue.popExn", - "kind": "value", - "name": "popExn", - "docstrings": [ - "`popExn(q)` throw an exception if q is empty." - ], - "signature": "let popExn: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.popOrThrow", - "kind": "value", - "name": "popOrThrow", - "docstrings": [ - "`popOrThrow(q)` throw an exception if q is empty." - ], - "signature": "let popOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(q)` returns a fresh queue." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.MutableQueue.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns the number of elements in a queue." - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableQueue.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableQueue.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.MutableQueue.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableQueue.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(q, f) applies`f`in turn to all elements of`q`, from the least\nrecently entered to the most recently entered. The queue itself is unchanged." - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.MutableQueue.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableQueue.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(q, accu, f)` is equivalent to `List.reduce(l, accu, f)`, where `l` is the\nlist of `q`'s elements. The queue remains unchanged." - ], - "signature": "let reduce: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableQueue.transfer", - "kind": "value", - "name": "transfer", - "docstrings": [ - "`transfer(q1, q2)` adds all of `q1`'s elements at the end of the queue `q2`,\nthen clears `q1`. It is equivalent to the sequence `forEach((x) => add(x, q2), q1)`;\nclear `q1`, but runs in constant time." - ], - "signature": "let transfer: (t<'a>, t<'a>) => unit" - }, - { - "id": "Belt.MutableQueue.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "First added will be in the beginning of the array." - ], - "signature": "let toArray: t<'a> => array<'a>" - } - ] - }, - "belt/sortarray": { - "id": "Belt.SortArray", - "name": "SortArray", - "docstrings": [ - "[`Belt.SortArray`]()\n\n The top level provides some generic sort related utilities.\n\n It also has two specialized inner modules\n [`Belt.SortArray.Int`]() and [`Belt.SortArray.String`]()", - "A module for Array sort relevant utiliites" - ], - "items": [ - { - "id": "Belt.SortArray.strictlySortedLengthU", - "kind": "value", - "name": "strictlySortedLengthU", - "docstrings": [], - "signature": "let strictlySortedLengthU: (array<'a>, ('a, 'a) => bool) => int", - "deprecated": "Use `strictlySortedLength` instead" - }, - { - "id": "Belt.SortArray.strictlySortedLength", - "kind": "value", - "name": "strictlySortedLength", - "docstrings": [ - "`strictlySortedLenght(xs, cmp);` return `+n` means increasing order `-n` means negative order\n\n## Examples\n\n```rescript\nBelt.SortArray.strictlySortedLength([1, 2, 3, 4, 3], (x, y) => x < y) == 4\n\nBelt.SortArray.strictlySortedLength([], (x, y) => x < y) == 0\n\nBelt.SortArray.strictlySortedLength([1], (x, y) => x < y) == 1\n\nBelt.SortArray.strictlySortedLength([4, 3, 2, 1], (x, y) => x < y) == -4\n```" - ], - "signature": "let strictlySortedLength: (array<'a>, ('a, 'a) => bool) => int" - }, - { - "id": "Belt.SortArray.isSortedU", - "kind": "value", - "name": "isSortedU", - "docstrings": [], - "signature": "let isSortedU: (array<'a>, ('a, 'a) => int) => bool", - "deprecated": "Use `isSorted` instead" - }, - { - "id": "Belt.SortArray.isSorted", - "kind": "value", - "name": "isSorted", - "docstrings": [ - "`isSorted(arr, cmp)`: Returns true if array is increasingly sorted (equal is okay)" - ], - "signature": "let isSorted: (array<'a>, ('a, 'a) => int) => bool" - }, - { - "id": "Belt.SortArray.stableSortInPlaceByU", - "kind": "value", - "name": "stableSortInPlaceByU", - "docstrings": [], - "signature": "let stableSortInPlaceByU: (array<'a>, ('a, 'a) => int) => unit", - "deprecated": "Use `stableSortInPlaceBy` instead" - }, - { - "id": "Belt.SortArray.stableSortInPlaceBy", - "kind": "value", - "name": "stableSortInPlaceBy", - "docstrings": [], - "signature": "let stableSortInPlaceBy: (array<'a>, ('a, 'a) => int) => unit" - }, - { - "id": "Belt.SortArray.stableSortByU", - "kind": "value", - "name": "stableSortByU", - "docstrings": [], - "signature": "let stableSortByU: (array<'a>, ('a, 'a) => int) => array<'a>", - "deprecated": "Use `stableSortBy` instead" - }, - { - "id": "Belt.SortArray.stableSortBy", - "kind": "value", - "name": "stableSortBy", - "docstrings": [ - "`stableSortBy(xs, cmp)`: Returns a fresh array Sort `xs` in place using\ncomparator `cmp`, the stable means if the elements are equal, their order will\nbe preserved" - ], - "signature": "let stableSortBy: (array<'a>, ('a, 'a) => int) => array<'a>" - }, - { - "id": "Belt.SortArray.binarySearchByU", - "kind": "value", - "name": "binarySearchByU", - "docstrings": [], - "signature": "let binarySearchByU: (array<'a>, 'a, ('a, 'a) => int) => int", - "deprecated": "Use `binarySearchBy` instead" - }, - { - "id": "Belt.SortArray.binarySearchBy", - "kind": "value", - "name": "binarySearchBy", - "docstrings": [ - "If value is not found and value is less than one or more elements in array, the\nnegative number returned is the bitwise complement of the index of the first\nelement that is larger than value.\n\nIf value is not found and value is greater\nthan all elements in array, the negative number returned is the bitwise\ncomplement of (the index of the last element plus 1)for example, if `key` is\nsmaller than all elements return `-1` since `lnot(-1) == 0` if `key` is larger\nthan all elements return `lnot(-1) == 0` since `lnot(- (len + 1)) == len`\n\n## Examples\n\n```rescript\nBelt.SortArray.binarySearchBy([1, 2, 3, 4, 33, 35, 36], 33, Pervasives.compare) == 4\n\nlnot(Belt.SortArray.binarySearchBy([1, 3, 5, 7], 4, Pervasives.compare)) == 2\n```" - ], - "signature": "let binarySearchBy: (array<'a>, 'a, ('a, 'a) => int) => int" - }, - { - "id": "Belt.SortArray.unionU", - "kind": "value", - "name": "unionU", - "docstrings": [], - "signature": "let unionU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int", - "deprecated": "Use `union` instead" - }, - { - "id": "Belt.SortArray.union", - "kind": "value", - "name": "union", - "docstrings": [ - "`union src src1ofs src1len src2 src2ofs src2len dst dstofs cmp` assume `src` and\n`src2` is strictly sorted. for equivalent elements, it is picked from `src`\nalso assume that `dst` is large enough to store all elements" - ], - "signature": "let union: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int" - }, - { - "id": "Belt.SortArray.intersectU", - "kind": "value", - "name": "intersectU", - "docstrings": [], - "signature": "let intersectU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int", - "deprecated": "Use `intersect` instead" - }, - { - "id": "Belt.SortArray.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "`union src src1ofs src1len src2 src2ofs src2len dst dstofs cmp`\n\n**return** the `offset` in the output array" - ], - "signature": "let intersect: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int" - }, - { - "id": "Belt.SortArray.diffU", - "kind": "value", - "name": "diffU", - "docstrings": [], - "signature": "let diffU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int", - "deprecated": "Use `diff` instead" - }, - { - "id": "Belt.SortArray.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int" - } - ] - }, - "belt/array": { - "id": "Belt.Array", - "name": "Array", - "docstrings": [ - "[`Belt.Array`]()\n\n **mutable array**: Utilities functions", - "Utilities for `Array` functions." - ], - "items": [ - { - "id": "Belt.Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = array<'a>" - }, - { - "id": "Belt.Array.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Return the size of the array\n\n## Examples\n\n```rescript\nBelt.Array.length([\"test\"]) == 1\n```" - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Belt.Array.size", - "kind": "value", - "name": "size", - "docstrings": [ - "See [`Belt.Array.length`]()" - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.Array.get", - "kind": "value", - "name": "get", - "docstrings": [ - "If `i <= 0 <= length(arr)` returns `Some(value)` where `value` is the item at index `i`.\nIf `i` is out of range returns `None`.\n\n## Examples\n\n```rescript\nBelt.Array.get([\"a\", \"b\", \"c\"], 0) == Some(\"a\")\nBelt.Array.get([\"a\", \"b\", \"c\"], 3) == None\nBelt.Array.get([\"a\", \"b\", \"c\"], -1) == None\n```" - ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, - { - "id": "Belt.Array.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Throw an exception if `i` is out of range.\nOtherwise return the value at index `i` in `arr`." - ], - "signature": "let getExn: (t<'a>, int) => 'a" - }, - { - "id": "Belt.Array.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Throw an exception if `i` is out of range.\nOtherwise return the value at index `i` in `arr`." - ], - "signature": "let getOrThrow: (t<'a>, int) => 'a" - }, - { - "id": "Belt.Array.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(arr, i)`\n\n**Unsafe**\n\nno bounds checking; this would cause type error if `i` does not stay within range" - ], - "signature": "let getUnsafe: (t<'a>, int) => 'a" - }, - { - "id": "Belt.Array.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "`getUndefined(arr, i)`\n\nIt does the samething in the runtime as [`getUnsafe`]();\nit is _type safe_ since the return type still track whether it is\nin range or not" - ], - "signature": "let getUndefined: (t<'a>, int) => Js.undefined<'a>" - }, - { - "id": "Belt.Array.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(arr, n, x)` modifies `arr` in place; it replaces the nth element of `arr`\nwith `x`. Returning `false` means not updated due to out of range." - ], - "signature": "let set: (t<'a>, int, 'a) => bool" - }, - { - "id": "Belt.Array.setExn", - "kind": "value", - "name": "setExn", - "docstrings": [ - "`setExn(arr, i, x)` throw an exception if `i` is out of range." - ], - "signature": "let setExn: (t<'a>, int, 'a) => unit" - }, - { - "id": "Belt.Array.setOrThrow", - "kind": "value", - "name": "setOrThrow", - "docstrings": [ - "`setOrThrow(arr, i, x)` throw an exception if `i` is out of range." - ], - "signature": "let setOrThrow: (t<'a>, int, 'a) => unit" - }, - { - "id": "Belt.Array.setUnsafe", - "kind": "value", - "name": "setUnsafe", - "docstrings": [], - "signature": "let setUnsafe: (t<'a>, int, 'a) => unit" - }, - { - "id": "Belt.Array.shuffleInPlace", - "kind": "value", - "name": "shuffleInPlace", - "docstrings": [ - "`shuffleInPlace(arr)` randomly re-orders the items in `arr`" - ], - "signature": "let shuffleInPlace: t<'a> => unit" - }, - { - "id": "Belt.Array.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "Returns a fresh array with items in original array randomly shuffled." - ], - "signature": "let shuffle: t<'a> => t<'a>" - }, - { - "id": "Belt.Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [ - "`reverseInPlace(arr)` reverses items in `arr` in place.\n\n## Examples\n\n```rescript\nlet arr = [10, 11, 12, 13, 14]\n\nlet () = Belt.Array.reverseInPlace(arr)\n\narr == [14, 13, 12, 11, 10]\n```" - ], - "signature": "let reverseInPlace: t<'a> => unit" - }, - { - "id": "Belt.Array.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(arr)` returns a fresh array with items in arr in reverse order.\n\n## Examples\n\n```rescript\nBelt.Array.reverse([10, 11, 12, 13, 14]) == [14, 13, 12, 11, 10]\n```" - ], - "signature": "let reverse: t<'a> => t<'a>" - }, - { - "id": "Belt.Array.makeUninitialized", - "kind": "value", - "name": "makeUninitialized", - "docstrings": [ - "`makeUninitialized(n)` creates an array of length `n` filled with the undefined\nvalue. You must specify the type of data that will eventually fill the array.\n\n## Examples\n\n```rescript\nlet arr: array> = Belt.Array.makeUninitialized(5)\n\nBelt.Array.getExn(arr, 0) == Js.undefined\n```" - ], - "signature": "let makeUninitialized: int => array>" - }, - { - "id": "Belt.Array.makeUninitializedUnsafe", - "kind": "value", - "name": "makeUninitializedUnsafe", - "docstrings": [ - "**Unsafe**\n\n## Examples\n\n```rescript\nlet arr = Belt.Array.makeUninitializedUnsafe(5)\n\nJs.log(Belt.Array.getExn(arr, 0)) // undefined\n\nBelt.Array.setExn(arr, 0, \"example\")\n\nBelt.Array.getExn(arr, 0) == \"example\"\n```" - ], - "signature": "let makeUninitializedUnsafe: int => t<'a>" - }, - { - "id": "Belt.Array.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(n, e)` return an array of size `n` filled with value `e`.\nReturns an empty array when `n` is negative." - ], - "signature": "let make: (int, 'a) => t<'a>" - }, - { - "id": "Belt.Array.range", - "kind": "value", - "name": "range", - "docstrings": [ - "`range(start, finish)` create an inclusive array.\n\n## Examples\n\n```rescript\nBelt.Array.range(0, 3) == [0, 1, 2, 3]\n\nBelt.Array.range(3, 0) == []\n\nBelt.Array.range(3, 3) == [3]\n```" - ], - "signature": "let range: (int, int) => array" - }, - { - "id": "Belt.Array.rangeBy", - "kind": "value", - "name": "rangeBy", - "docstrings": [ - "`rangeBy(start, finish, ~step)` returns empty array when step is 0 or negative.\nIt also return an empty array when `start > finish`.\n\n## Examples\n\n```rescript\nBelt.Array.rangeBy(0, 10, ~step=3) == [0, 3, 6, 9]\n\nBelt.Array.rangeBy(0, 12, ~step=3) == [0, 3, 6, 9, 12]\n\nBelt.Array.rangeBy(33, 0, ~step=1) == []\n\nBelt.Array.rangeBy(33, 0, ~step=-1) == []\n\nBelt.Array.rangeBy(3, 12, ~step=-1) == []\n\nBelt.Array.rangeBy(3, 3, ~step=0) == []\n\nBelt.Array.rangeBy(3, 3, ~step=1) == [3]\n```" - ], - "signature": "let rangeBy: (int, int, ~step: int) => array" - }, - { - "id": "Belt.Array.makeByU", - "kind": "value", - "name": "makeByU", - "docstrings": [], - "signature": "let makeByU: (int, int => 'a) => t<'a>", - "deprecated": "Use `makeBy` instead" - }, - { - "id": "Belt.Array.makeBy", - "kind": "value", - "name": "makeBy", - "docstrings": [ - "`makeBy(n, f)` return an empty array when n is negative return an array of size\nn populated by `f(i)` start from `0` to `n - 1`.\n\n## Examples\n\n```rescript\nBelt.Array.makeBy(5, i => i) == [0, 1, 2, 3, 4]\n\nBelt.Array.makeBy(5, i => i * i) == [0, 1, 4, 9, 16]\n```" - ], - "signature": "let makeBy: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.Array.makeByAndShuffleU", - "kind": "value", - "name": "makeByAndShuffleU", - "docstrings": [], - "signature": "let makeByAndShuffleU: (int, int => 'a) => t<'a>", - "deprecated": "Use `makeByAndShuffle` instead" - }, - { - "id": "Belt.Array.makeByAndShuffle", - "kind": "value", - "name": "makeByAndShuffle", - "docstrings": [ - "Equivalent to `shuffle(makeBy(n, f))`" - ], - "signature": "let makeByAndShuffle: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.Array.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "`zip(a, b)` create an array of pairs from corresponding elements of a and b.\nStop with the shorter array.\n\n## Examples\n\n```rescript\nBelt.Array.zip([1, 2], [3, 4, 5]) == [(1, 3), (2, 4)]\n```" - ], - "signature": "let zip: (t<'a>, array<'b>) => array<('a, 'b)>" - }, - { - "id": "Belt.Array.zipByU", - "kind": "value", - "name": "zipByU", - "docstrings": [], - "signature": "let zipByU: (t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>", - "deprecated": "Use `zipBy` instead" - }, - { - "id": "Belt.Array.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "`zipBy(xs, ys, f)` create an array by applying `f` to corresponding elements of\n`xs` and `ys`. Stops with shorter array.\n\nEquivalent to `map(zip(xs, ys), ((a, b)) => f(a, b))`\n\n## Examples\n\n```rescript\nBelt.Array.zipBy([1, 2, 3], [4, 5], (a, b) => 2 * a + b) == [6, 9]\n```" - ], - "signature": "let zipBy: (t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>" - }, - { - "id": "Belt.Array.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "`unzip(a)` takes an array of pairs and creates a pair of arrays. The first array\ncontains all the first items of the pairs; the second array contains all the\nsecond items.\n\n## Examples\n\n```rescript\nBelt.Array.unzip([(1, 2), (3, 4)]) == ([1, 3], [2, 4])\n\nBelt.Array.unzip([(1, 2), (3, 4), (5, 6), (7, 8)]) == ([1, 3, 5, 7], [2, 4, 6, 8])\n```" - ], - "signature": "let unzip: array<('a, 'b)> => (t<'a>, array<'b>)" - }, - { - "id": "Belt.Array.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(xs, ys)` returns a fresh array containing the concatenation of the arrays\n`v1` and `v2`, so even if `v1` or `v2` is empty; it can not be shared.\n\n## Examples\n\n```rescript\nBelt.Array.concat([1, 2, 3], [4, 5]) == [1, 2, 3, 4, 5]\n\nBelt.Array.concat([], [\"a\", \"b\", \"c\"]) == [\"a\", \"b\", \"c\"]\n```" - ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Belt.Array.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(xss)` returns a fresh array as the concatenation of `xss` (an array of arrays)\n\n## Examples\n\n```rescript\nBelt.Array.concatMany([[1, 2, 3], [4, 5, 6], [7, 8]]) == [1, 2, 3, 4, 5, 6, 7, 8]\n```" - ], - "signature": "let concatMany: array> => t<'a>" - }, - { - "id": "Belt.Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(xs, offset, len)` creates a new array with the len elements of `xs`\nstarting at `offset` for `offset` can be negative;and is evaluated as\n`length(xs) - offset(slice, xs) - 1(1)` means get the last element as a\nsingleton array `slice(xs, ~-len, len)` will return a copy of the array if the\narray does not have enough data; `slice` extracts through the end of sequence.\n\nif `len` is negative; returns the empty array.\n\n## Examples\n\n```rescript\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=2, ~len=3) == [12, 13, 14]\n\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=-4, ~len=3) == [13, 14, 15]\n\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=4, ~len=9) == [14, 15, 16]\n```" - ], - "signature": "let slice: (t<'a>, ~offset: int, ~len: int) => t<'a>" - }, - { - "id": "Belt.Array.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(xs, offset)` creates a new array with the elements of `xs` starting\nat `offset`\n\n`offset` can be negative; and is evaluated as `length(xs) - offset(sliceToEnd, xs) - 1`\nmeans get the last element as a singleton array\n\n`sliceToEnd(xs, 0)` will return a copy of the array\n\n## Examples\n\n```rescript\nBelt.Array.sliceToEnd([10, 11, 12, 13, 14, 15, 16], 2) == [12, 13, 14, 15, 16]\n\nBelt.Array.sliceToEnd([10, 11, 12, 13, 14, 15, 16], -4) == [13, 14, 15, 16]\n```" - ], - "signature": "let sliceToEnd: (t<'a>, int) => t<'a>" - }, - { - "id": "Belt.Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(a)` returns a copy of `a`; that is; a fresh array containing the same\nelements as `a`." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.Array.fill", - "kind": "value", - "name": "fill", - "docstrings": [ - "`fill(arr, ~offset, ~len, x)` modifies `arr` in place, storing `x` in elements\nnumber `offset` to `offset + len - 1`. `offset` can be negative; and is evaluated\nas `length(arr - offset)`.\n\n`fill(arr, ~offset=-1, ~len=1)` means fill the last element, if the array does not have enough data; `fill` will ignore it\n\n## Examples\n\n```rescript\nlet arr = Belt.Array.makeBy(5, i => i)\n\nBelt.Array.fill(arr, ~offset=2, ~len=2, 9)\n\narr == [0, 1, 9, 9, 4]\n\nBelt.Array.fill(arr, ~offset=7, ~len=2, 8)\n\narr == [0, 1, 9, 9, 4]\n```" - ], - "signature": "let fill: (t<'a>, ~offset: int, ~len: int, 'a) => unit" - }, - { - "id": "Belt.Array.blit", - "kind": "value", - "name": "blit", - "docstrings": [ - "`blit(~src=v1, ~srcOffset=o1, ~dst=v2, ~dstOffset=o2, ~len)` copies `len` elements\nfrom array `v1`;starting at element number `o1`;to array `v2`, starting at element\nnumber `o2`. It works correctly even if `v1` and `v2` are the same array and the\nsource and destination chunks overlap.\n\n`offset` can be negative; `-1` means `len - 1`; if `len + offset` is still negative;it will be set as 0\n\nFor each of the examples;presume that `v1 == [10, 11, 12, 13, 14, 15, 16, 17]` and `v2 == [20, 21, 22, 23, 24, 25, 26, 27]`. The result shown is the content of the destination array.\n\n## Examples\n\n```rescript\nlet v1 = [10, 11, 12, 13, 14, 15, 16, 17]\nlet v2 = [20, 21, 22, 23, 24, 25, 26, 27]\n\nBelt.Array.blit(~src=v1, ~srcOffset=4, ~dst=v2, ~dstOffset=2, ~len=3)\nv2 == [20, 21, 14, 15, 16, 25, 26, 27]\n\nBelt.Array.blit(~src=v1, ~srcOffset=4, ~dst=v1, ~dstOffset=2, ~len=3)\nv1 == [10, 11, 14, 15, 16, 15, 16, 17]\n```" - ], - "signature": "let blit: (\n ~src: t<'a>,\n ~srcOffset: int,\n ~dst: t<'a>,\n ~dstOffset: int,\n ~len: int,\n) => unit" - }, - { - "id": "Belt.Array.blitUnsafe", - "kind": "value", - "name": "blitUnsafe", - "docstrings": [ - "Unsafe blit without bounds checking." - ], - "signature": "let blitUnsafe: (\n ~src: t<'a>,\n ~srcOffset: int,\n ~dst: t<'a>,\n ~dstOffset: int,\n ~len: int,\n) => unit" - }, - { - "id": "Belt.Array.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(xs, f)`\n\nCall `f` on each element of `xs` from the beginning to end. `f` returns `unit`\nso no new array is created. Use `forEach` when you are primarily concerned with\nrepetitively creating side effects.\n\n## Examples\n\n```rescript\nBelt.Array.forEach([\"a\", \"b\", \"c\"], x => Js.log(\"Item: \" ++ x))\n\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\nlet total = ref(0)\n\nBelt.Array.forEach([1, 2, 3, 4], x => total := total.contents + x)\n\ntotal.contents == 1 + 2 + 3 + 4\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.Array.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => array<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Array.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(xs, f)` returns a new array by calling `f` for each element of `xs` from\nthe beginning to end.\n\n## Examples\n\n```rescript\nBelt.Array.map([1, 2], x => x + 1) == [2, 3]\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Belt.Array.flatMapU", - "kind": "value", - "name": "flatMapU", - "docstrings": [], - "signature": "let flatMapU: (t<'a>, 'a => array<'b>) => array<'b>", - "deprecated": "Use `flatMap` instead" - }, - { - "id": "Belt.Array.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(xs, f)` returns a new array by calling `f` for each element of `xs` from\nthe beginning to end, concatenating the results.\n\n## Examples\n\n```rescript\nBelt.Array.flatMap([1, 2], x => [x + 10, x + 20]) == [11, 21, 12, 22]\n```" - ], - "signature": "let flatMap: (t<'a>, 'a => array<'b>) => array<'b>" - }, - { - "id": "Belt.Array.getByU", - "kind": "value", - "name": "getByU", - "docstrings": [], - "signature": "let getByU: (t<'a>, 'a => bool) => option<'a>", - "deprecated": "Use `getBy` instead" - }, - { - "id": "Belt.Array.getBy", - "kind": "value", - "name": "getBy", - "docstrings": [ - "`getBy(xs, p)` returns `Some(value)` for the first value in `xs` that satisifies\nthe predicate function `p`; returns `None` if no element satisifies the function.\n\n## Examples\n\n```rescript\nBelt.Array.getBy([1, 4, 3, 2], x => mod(x, 2) == 0) == Some(4)\nBelt.Array.getBy([15, 13, 11], x => mod(x, 2) == 0) == None\n```" - ], - "signature": "let getBy: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Belt.Array.getIndexByU", - "kind": "value", - "name": "getIndexByU", - "docstrings": [], - "signature": "let getIndexByU: (t<'a>, 'a => bool) => option", - "deprecated": "Use `getIndexBy` instead" - }, - { - "id": "Belt.Array.getIndexBy", - "kind": "value", - "name": "getIndexBy", - "docstrings": [ - "`getIndexBy(xs, p)` returns `Some(index)` for the first value in `xs` that\nsatisifies the predicate function `p`; returns `None` if no element satisifies\nthe function.\n\n## Examples\n\n```rescript\nBelt.Array.getIndexBy([1, 4, 3, 2], x => mod(x, 2) == 0) == Some(1)\nBelt.Array.getIndexBy([15, 13, 11], x => mod(x, 2) == 0) == None\n```" - ], - "signature": "let getIndexBy: (t<'a>, 'a => bool) => option" - }, - { - "id": "Belt.Array.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Array.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(xs, p)` returns a new array that keep all elements satisfy `p`." - ], - "signature": "let keep: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Belt.Array.keepWithIndexU", - "kind": "value", - "name": "keepWithIndexU", - "docstrings": [], - "signature": "let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "Use `keepWithIndex` instead" - }, - { - "id": "Belt.Array.keepWithIndex", - "kind": "value", - "name": "keepWithIndex", - "docstrings": [ - "`keepWithIndex(xs, p)` returns a new array that keep all elements satisfy `p`.\n\n## Examples\n\n```rescript\nBelt.Array.keepWithIndex([1, 2, 3], (_x, i) => i == 1) == [2]\n```" - ], - "signature": "let keepWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" - }, - { - "id": "Belt.Array.keepMapU", - "kind": "value", - "name": "keepMapU", - "docstrings": [], - "signature": "let keepMapU: (t<'a>, 'a => option<'b>) => array<'b>", - "deprecated": "Use `keepMap` instead" - }, - { - "id": "Belt.Array.keepMap", - "kind": "value", - "name": "keepMap", - "docstrings": [ - "`keepMap(xs, p)` returns a new array that keep all elements that return a non\nNone applied `p`.\n\n## Examples\n\n```rescript\nBelt.Array.keepMap([1, 2, 3], x =>\n if mod(x, 2) == 0 {\n Some(x)\n } else {\n None\n }\n) == [2]\n```" - ], - "signature": "let keepMap: (t<'a>, 'a => option<'b>) => array<'b>" - }, - { - "id": "Belt.Array.forEachWithIndexU", - "kind": "value", - "name": "forEachWithIndexU", - "docstrings": [], - "signature": "let forEachWithIndexU: (t<'a>, (int, 'a) => unit) => unit", - "deprecated": "Use `forEachWithIndex` instead" - }, - { - "id": "Belt.Array.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(xs, f)` same as `Belt.Array.forEach`, except that `f` is\nsupplied two arguments: the index starting from 0 and the element from `xs`.\n\n## Examples\n\n```rescript\nBelt.Array.forEachWithIndex([\"a\", \"b\", \"c\"], (i, x) =>\n Js.log(\"Item \" ++ Belt.Int.toString(i) ++ \" is \" ++ x)\n)\n\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\nlet total = ref(0)\n\nBelt.Array.forEachWithIndex([10, 11, 12, 13], (i, x) => total := total.contents + x + i)\n\ntotal.contents == 0 + 10 + 1 + 11 + 2 + 12 + 3 + 13\n```" - ], - "signature": "let forEachWithIndex: (t<'a>, (int, 'a) => unit) => unit" - }, - { - "id": "Belt.Array.mapWithIndexU", - "kind": "value", - "name": "mapWithIndexU", - "docstrings": [], - "signature": "let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => array<'b>", - "deprecated": "Use `mapWithIndex` instead" - }, - { - "id": "Belt.Array.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(xs, f)` applies `f` to each element of `xs`. Function `f` takes\ntwo arguments: the index starting from 0 and the element from `xs`.\n\n## Examples\n\n```rescript\nBelt.Array.mapWithIndex([1, 2, 3], (i, x) => i + x) == [0 + 1, 1 + 2, 2 + 3]\n```" - ], - "signature": "let mapWithIndex: (t<'a>, (int, 'a) => 'b) => array<'b>" - }, - { - "id": "Belt.Array.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Array.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(f, a)` split array into tuple of two arrays based on predicate `f`;\nfirst of tuple where predicate cause true, second where predicate cause false\n\n## Examples\n\n```rescript\nBelt.Array.partition([1, 2, 3, 4, 5], x => mod(x, 2) == 0) == ([2, 4], [1, 3, 5])\n\nBelt.Array.partition([1, 2, 3, 4, 5], x => mod(x, 2) != 0) == ([1, 3, 5], [2, 4])\n```" - ], - "signature": "let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)" - }, - { - "id": "Belt.Array.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(xs, init, f)` applies `f` to each element of `xs` from beginning to end.\nFunction `f` has two parameters: the item from the list and an “accumulator”;\nwhich starts with a value of `init`. `reduce` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nBelt.Array.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\nBelt.Array.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n```" - ], - "signature": "let reduce: (array<'b>, 'a, ('a, 'b) => 'a) => 'a" - }, - { - "id": "Belt.Array.reduceReverseU", - "kind": "value", - "name": "reduceReverseU", - "docstrings": [], - "signature": "let reduceReverseU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a", - "deprecated": "Use `reduceReverse` instead" - }, - { - "id": "Belt.Array.reduceReverse", - "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "`reduceReverse(xs, init, f)` works like `Belt.Array.reduce` except that\nfunction `f` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nBelt.Array.reduceReverse([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n```" - ], - "signature": "let reduceReverse: (array<'b>, 'a, ('a, 'b) => 'a) => 'a" - }, - { - "id": "Belt.Array.reduceReverse2U", - "kind": "value", - "name": "reduceReverse2U", - "docstrings": [], - "signature": "let reduceReverse2U: (t<'a>, array<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c", - "deprecated": "Use `reduceReverse2` instead" - }, - { - "id": "Belt.Array.reduceReverse2", - "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "`reduceReverse2(xs, ys, init, f)` reduces two arrays xs and ys;taking items\nstarting at `min(length(xs), length(ys))` down to and including zero.\n\n## Examples\n\n```rescript\nBelt.Array.reduceReverse2([1, 2, 3], [1, 2], 0, (acc, x, y) => acc + x + y) == 6\n```" - ], - "signature": "let reduceReverse2: (t<'a>, array<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" - }, - { - "id": "Belt.Array.reduceWithIndexU", - "kind": "value", - "name": "reduceWithIndexU", - "docstrings": [], - "signature": "let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b", - "deprecated": "Use `reduceWithIndex` instead" - }, - { - "id": "Belt.Array.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "Applies `f` to each element of `xs` from beginning to end. Function `f` has\nthree parameters: the item from the array and an “accumulator”, which starts\nwith a value of `init` and the index of each element. `reduceWithIndex` returns\nthe final value of the accumulator.\n\n## Examples\n\n```rescript\nBelt.Array.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n```" - ], - "signature": "let reduceWithIndex: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Belt.Array.joinWithU", - "kind": "value", - "name": "joinWithU", - "docstrings": [], - "signature": "let joinWithU: (t<'a>, string, 'a => string) => string", - "deprecated": "Use `joinWith` instead" - }, - { - "id": "Belt.Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "`joinWith(xs, sep, toString)`\n\nConcatenates all the elements of `xs` converted to string with `toString`, each\nseparated by `sep`, the string given as the second argument, into a single string.\nIf the array has only one element, then that element will be returned without\nusing the separator. If the array is empty, the empty string will be returned.\n\n## Examples\n\n```rescript\nBelt.Array.joinWith([0, 1], \", \", Js.Int.toString) == \"0, 1\"\nBelt.Array.joinWith([], \" \", Js.Int.toString) == \"\"\nBelt.Array.joinWith([1], \" \", Js.Int.toString) == \"1\"\n```" - ], - "signature": "let joinWith: (t<'a>, string, 'a => string) => string" - }, - { - "id": "Belt.Array.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Array.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(xs, p)` returns true if at least one of the elements in `xs` satifies `p`;\nwhere `p` is a predicate: a function taking an element and returning a `bool`.\n\n## Examples\n\n```rescript\nBelt.Array.some([2, 3, 4], x => mod(x, 2) == 1) == true\n\nBelt.Array.some([-1, -3, -5], x => x > 0) == false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.Array.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Array.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(xs, p)` returns `true` if all elements satisfy `p`; where `p` is a\npredicate: a function taking an element and returning a `bool`.\n\n## Examples\n\n```rescript\nBelt.Array.every([1, 3, 5], x => mod(x, 2) == 1) == true\n\nBelt.Array.every([1, -3, 5], x => x > 0) == false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.Array.every2U", - "kind": "value", - "name": "every2U", - "docstrings": [], - "signature": "let every2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `every2` instead" - }, - { - "id": "Belt.Array.every2", - "kind": "value", - "name": "every2", - "docstrings": [ - "`every2(xs, ys, p)` returns true if `p(xi, yi)` is true for all pairs of\nelements up to the shorter length (i.e. `min(length(xs), length(ys))`)\n\n## Examples\n\n```rescript\nBelt.Array.every2([1, 2, 3], [0, 1], (a, b) => a > b) == true\n\nBelt.Array.every2([], [1], (x, y) => x > y) == true\n\nBelt.Array.every2([2, 3], [1], (x, y) => x > y) == true\n\nBelt.Array.every2([0, 1], [5, 0], (x, y) => x > y) == false\n```" - ], - "signature": "let every2: (t<'a>, array<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Array.some2U", - "kind": "value", - "name": "some2U", - "docstrings": [], - "signature": "let some2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `some2` instead" - }, - { - "id": "Belt.Array.some2", - "kind": "value", - "name": "some2", - "docstrings": [ - "`some2(xs, ys, p)` returns true if `p(xi, yi)` is true for any pair of elements\nup to the shorter length (i.e. `min(length(xs), length(ys))`)\n\n## Examples\n\n```rescript\nBelt.Array.some2([0, 2], [1, 0, 3], (a, b) => a > b) == true\n\nBelt.Array.some2([], [1], (x, y) => x > y) == false\n\nBelt.Array.some2([2, 3], [1, 4], (x, y) => x > y) == true\n```" - ], - "signature": "let some2: (t<'a>, array<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Array.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Array.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(xs, ys, f)` compared by length if `length(xs) != length(ys)`; returning `-1`\nif `length(xs) < length(ys)` or 1 if `length(xs) > length(ys)`. Otherwise\ncompare one by one `f(x, y)`. `f` returns a negative number if `x` is “less than” `y`\nzero if `x` is “equal to” `y` a positive number if `x` is “greater than”\n`y`. The comparison returns the first non-zero result of `f`; or zero if `f`\nreturns zero for all `x` and `y`.\n\n## Examples\n\n```rescript\nBelt.Array.cmp([1, 3, 5], [1, 4, 2], (a, b) => compare(a, b)) == -1\n\nBelt.Array.cmp([1, 3, 5], [1, 2, 3], (a, b) => compare(a, b)) == 1\n\nBelt.Array.cmp([1, 3, 5], [1, 3, 5], (a, b) => compare(a, b)) == 0\n```" - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.Array.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Array.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(xs, ys)` return `false` if length is not the same otherwise compare items\none by one using `f(xi, yi)`; and return true if all results are true false otherwise\n\n## Examples\n\n```rescript\nBelt.Array.eq([1, 2, 3], [-1, -2, -3], (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.Array.truncateToLengthUnsafe", - "kind": "value", - "name": "truncateToLengthUnsafe", - "docstrings": [ - "Unsafe `truncateToLengthUnsafe(xs, n)` sets length of array `xs` to `n`. If `n`\nis greater than the length of `xs`; the extra elements are set to `Js.Null_undefined.null`.\nIf `n` is less than zero; throws a `RangeError`.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n\nBelt.Array.truncateToLengthUnsafe(arr, 3)\n\narr == [\"ant\", \"bee\", \"cat\"]\n```" - ], - "signature": "let truncateToLengthUnsafe: (t<'a>, int) => unit" - }, - { - "id": "Belt.Array.initU", - "kind": "value", - "name": "initU", - "docstrings": [], - "signature": "let initU: (int, int => 'a) => t<'a>", - "deprecated": "Use `init` instead" - }, - { - "id": "Belt.Array.init", - "kind": "value", - "name": "init", - "docstrings": [], - "signature": "let init: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.Array.push", - "kind": "value", - "name": "push", - "docstrings": [ - "`arr->push(item)` pushes an element `item` into an array `arr`." - ], - "signature": "let push: (t<'a>, 'a) => unit" - } - ] - }, - "belt/id": { - "id": "Belt.Id", - "name": "Id", - "docstrings": [ - "[`Belt.Id`]()\n\n Provide utilities to create identified comparators or hashes for\n data structures used below.\n\n It create a unique identifier per module of\n functions so that different data structures with slightly different\n comparison functions won't mix", - "[`Belt.Id`]()\n\nProvide utiliites to create identified comparators or hashes for\ndata structures used below.\n\nIt create a unique identifer per module of functions so that different data structures with slightly different\ncomparison functions won't mix." - ], - "items": [ - { - "id": "Belt.Id.hash", - "kind": "type", - "name": "hash", - "docstrings": [ - "`('a, 'id) hash`\n\nIts runtime represenation is a `hash` function, but signed with a\ntype parameter, so that different hash functions type mismatch" - ], - "signature": "type hash<'a, 'id>" - }, - { - "id": "Belt.Id.eq", - "kind": "type", - "name": "eq", - "docstrings": [ - "`('a, 'id) eq`\n\nIts runtime represenation is an `eq` function, but signed with a\ntype parameter, so that different hash functions type mismatch" - ], - "signature": "type eq<'a, 'id>" - }, - { - "id": "Belt.Id.cmp", - "kind": "type", - "name": "cmp", - "docstrings": [ - "`('a,'id) cmp`\n\nIts runtime representation is a `cmp` function, but signed with a\ntype parameter, so that different hash functions type mismatch" - ], - "signature": "type cmp<'a, 'id>" - }, - { - "id": "Belt.Id.comparable", - "kind": "type", - "name": "comparable", - "docstrings": [ - "`('key, 'id) cmparable` is a module of functions, here it only includes `cmp`.\n\nUnlike normal functions, when created, it comes with a unique identity (guaranteed\nby the type system).\n\nIt can be created using function [`comparableU`]() or [`comparable`]().\n\nThe idea of a unique identity when created is that it makes sure two sets would type\nmismatch if they use different comparison function" - ], - "signature": "type comparable<'key, 'id> = module(Comparable\n with type identity = 'id\n and type t = 'key)" - }, - { - "id": "Belt.Id.comparableU", - "kind": "value", - "name": "comparableU", - "docstrings": [], - "signature": "let comparableU: (\n ~cmp: ('a, 'a) => int,\n) => module(Comparable with type t = 'a)", - "deprecated": "Use `comparable` instead" - }, - { - "id": "Belt.Id.comparable", - "kind": "value", - "name": "comparable", - "docstrings": [], - "signature": "let comparable: (\n ~cmp: ('a, 'a) => int,\n) => module(Comparable with type t = 'a)" - }, - { - "id": "Belt.Id.hashable", - "kind": "type", - "name": "hashable", - "docstrings": [ - "`('key, 'id) hashable` is a module of functions, here it only includes `hash`, `eq`.\n\nUnlike normal functions, when created, it comes with a unique identity (guaranteed\nby the type system).\n\nIt can be created using function [`hashableU`]() or [`hashable`]().\n\nThe idea of a unique identity when created is that it makes sure two hash sets would type\nmismatch if they use different comparison function" - ], - "signature": "type hashable<'key, 'id> = module(Hashable\n with type identity = 'id\n and type t = 'key)" - }, - { - "id": "Belt.Id.hashableU", - "kind": "value", - "name": "hashableU", - "docstrings": [], - "signature": "let hashableU: (\n ~hash: 'a => int,\n ~eq: ('a, 'a) => bool,\n) => module(Hashable with type t = 'a)", - "deprecated": "Use `hashable` instead" - }, - { - "id": "Belt.Id.hashable", - "kind": "value", - "name": "hashable", - "docstrings": [], - "signature": "let hashable: (\n ~hash: 'a => int,\n ~eq: ('a, 'a) => bool,\n) => module(Hashable with type t = 'a)" - }, - { - "id": "Belt.Id.getHashInternal", - "kind": "value", - "name": "getHashInternal", - "docstrings": [], - "signature": "let getHashInternal: hash<'a, 'id> => 'a => int" - }, - { - "id": "Belt.Id.getEqInternal", - "kind": "value", - "name": "getEqInternal", - "docstrings": [], - "signature": "let getEqInternal: eq<'a, 'id> => ('a, 'a) => bool" - }, - { - "id": "Belt.Id.getCmpInternal", - "kind": "value", - "name": "getCmpInternal", - "docstrings": [], - "signature": "let getCmpInternal: cmp<'a, 'id> => ('a, 'a) => int" - } - ] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v12.0.1/dom.json b/apps/docs/data/api/v12.0.1/dom.json deleted file mode 100644 index 2bf0f3038..000000000 --- a/apps/docs/data/api/v12.0.1/dom.json +++ /dev/null @@ -1,1962 +0,0 @@ -{ - "dom": { - "id": "Dom", - "name": "Dom", - "docstrings": [], - "items": [ - { - "id": "Dom._baseClass", - "kind": "type", - "name": "_baseClass", - "docstrings": [], - "signature": "type _baseClass" - }, - { - "id": "Dom.animation", - "kind": "type", - "name": "animation", - "docstrings": [], - "signature": "type animation" - }, - { - "id": "Dom.cssStyleDeclaration", - "kind": "type", - "name": "cssStyleDeclaration", - "docstrings": [], - "signature": "type cssStyleDeclaration" - }, - { - "id": "Dom.cssStyleSheet", - "kind": "type", - "name": "cssStyleSheet", - "docstrings": [], - "signature": "type cssStyleSheet" - }, - { - "id": "Dom.eventTarget_like", - "kind": "type", - "name": "eventTarget_like", - "docstrings": [], - "signature": "type eventTarget_like<'a>" - }, - { - "id": "Dom.eventTarget", - "kind": "type", - "name": "eventTarget", - "docstrings": [], - "signature": "type eventTarget = eventTarget_like<_baseClass>" - }, - { - "id": "Dom._node", - "kind": "type", - "name": "_node", - "docstrings": [], - "signature": "type _node<'a>" - }, - { - "id": "Dom.node_like", - "kind": "type", - "name": "node_like", - "docstrings": [], - "signature": "type node_like<'a> = eventTarget_like<_node<'a>>" - }, - { - "id": "Dom.node", - "kind": "type", - "name": "node", - "docstrings": [], - "signature": "type node = node_like<_baseClass>" - }, - { - "id": "Dom._attr", - "kind": "type", - "name": "_attr", - "docstrings": [], - "signature": "type _attr" - }, - { - "id": "Dom.attr", - "kind": "type", - "name": "attr", - "docstrings": [], - "signature": "type attr = node_like<_attr>" - }, - { - "id": "Dom._characterData", - "kind": "type", - "name": "_characterData", - "docstrings": [], - "signature": "type _characterData<'a>" - }, - { - "id": "Dom.characterData_like", - "kind": "type", - "name": "characterData_like", - "docstrings": [], - "signature": "type characterData_like<'a> = node_like<_characterData<'a>>" - }, - { - "id": "Dom.characterData", - "kind": "type", - "name": "characterData", - "docstrings": [], - "signature": "type characterData = characterData_like<_baseClass>" - }, - { - "id": "Dom._cdataSection", - "kind": "type", - "name": "_cdataSection", - "docstrings": [], - "signature": "type _cdataSection" - }, - { - "id": "Dom.cdataSection", - "kind": "type", - "name": "cdataSection", - "docstrings": [], - "signature": "type cdataSection = characterData_like<_cdataSection>" - }, - { - "id": "Dom._comment", - "kind": "type", - "name": "_comment", - "docstrings": [], - "signature": "type _comment" - }, - { - "id": "Dom.comment", - "kind": "type", - "name": "comment", - "docstrings": [], - "signature": "type comment = characterData_like<_comment>" - }, - { - "id": "Dom._document", - "kind": "type", - "name": "_document", - "docstrings": [], - "signature": "type _document<'a>" - }, - { - "id": "Dom.document_like", - "kind": "type", - "name": "document_like", - "docstrings": [], - "signature": "type document_like<'a> = node_like<_document<'a>>" - }, - { - "id": "Dom.document", - "kind": "type", - "name": "document", - "docstrings": [], - "signature": "type document = document_like<_baseClass>" - }, - { - "id": "Dom._documentFragment", - "kind": "type", - "name": "_documentFragment", - "docstrings": [], - "signature": "type _documentFragment" - }, - { - "id": "Dom.documentFragment", - "kind": "type", - "name": "documentFragment", - "docstrings": [], - "signature": "type documentFragment = node_like<_documentFragment>" - }, - { - "id": "Dom._documentType", - "kind": "type", - "name": "_documentType", - "docstrings": [], - "signature": "type _documentType" - }, - { - "id": "Dom.documentType", - "kind": "type", - "name": "documentType", - "docstrings": [], - "signature": "type documentType = node_like<_documentType>" - }, - { - "id": "Dom.domImplementation", - "kind": "type", - "name": "domImplementation", - "docstrings": [], - "signature": "type domImplementation" - }, - { - "id": "Dom._element", - "kind": "type", - "name": "_element", - "docstrings": [], - "signature": "type _element<'a>" - }, - { - "id": "Dom.element_like", - "kind": "type", - "name": "element_like", - "docstrings": [], - "signature": "type element_like<'a> = node_like<_element<'a>>" - }, - { - "id": "Dom.element", - "kind": "type", - "name": "element", - "docstrings": [], - "signature": "type element = element_like<_baseClass>" - }, - { - "id": "Dom.htmlCollection", - "kind": "type", - "name": "htmlCollection", - "docstrings": [], - "signature": "type htmlCollection" - }, - { - "id": "Dom.htmlFormControlsCollection", - "kind": "type", - "name": "htmlFormControlsCollection", - "docstrings": [], - "signature": "type htmlFormControlsCollection" - }, - { - "id": "Dom.htmlOptionsCollection", - "kind": "type", - "name": "htmlOptionsCollection", - "docstrings": [], - "signature": "type htmlOptionsCollection" - }, - { - "id": "Dom.intersectionObserver", - "kind": "type", - "name": "intersectionObserver", - "docstrings": [], - "signature": "type intersectionObserver" - }, - { - "id": "Dom.intersectionObserverEntry", - "kind": "type", - "name": "intersectionObserverEntry", - "docstrings": [], - "signature": "type intersectionObserverEntry" - }, - { - "id": "Dom.mutationObserver", - "kind": "type", - "name": "mutationObserver", - "docstrings": [], - "signature": "type mutationObserver" - }, - { - "id": "Dom.mutationRecord", - "kind": "type", - "name": "mutationRecord", - "docstrings": [], - "signature": "type mutationRecord" - }, - { - "id": "Dom.performanceObserver", - "kind": "type", - "name": "performanceObserver", - "docstrings": [], - "signature": "type performanceObserver" - }, - { - "id": "Dom.performanceObserverEntryList", - "kind": "type", - "name": "performanceObserverEntryList", - "docstrings": [], - "signature": "type performanceObserverEntryList" - }, - { - "id": "Dom.reportingObserver", - "kind": "type", - "name": "reportingObserver", - "docstrings": [], - "signature": "type reportingObserver" - }, - { - "id": "Dom.reportingObserverOptions", - "kind": "type", - "name": "reportingObserverOptions", - "docstrings": [], - "signature": "type reportingObserverOptions" - }, - { - "id": "Dom.resizeObserver", - "kind": "type", - "name": "resizeObserver", - "docstrings": [], - "signature": "type resizeObserver" - }, - { - "id": "Dom.resizeObserverEntry", - "kind": "type", - "name": "resizeObserverEntry", - "docstrings": [], - "signature": "type resizeObserverEntry" - }, - { - "id": "Dom.namedNodeMap", - "kind": "type", - "name": "namedNodeMap", - "docstrings": [], - "signature": "type namedNodeMap" - }, - { - "id": "Dom.nodeList", - "kind": "type", - "name": "nodeList", - "docstrings": [], - "signature": "type nodeList" - }, - { - "id": "Dom.radioNodeList", - "kind": "type", - "name": "radioNodeList", - "docstrings": [], - "signature": "type radioNodeList" - }, - { - "id": "Dom.processingInstruction", - "kind": "type", - "name": "processingInstruction", - "docstrings": [], - "signature": "type processingInstruction" - }, - { - "id": "Dom._shadowRoot", - "kind": "type", - "name": "_shadowRoot", - "docstrings": [], - "signature": "type _shadowRoot" - }, - { - "id": "Dom.shadowRoot", - "kind": "type", - "name": "shadowRoot", - "docstrings": [], - "signature": "type shadowRoot = node_like<_shadowRoot>" - }, - { - "id": "Dom._text", - "kind": "type", - "name": "_text", - "docstrings": [], - "signature": "type _text" - }, - { - "id": "Dom.text", - "kind": "type", - "name": "text", - "docstrings": [], - "signature": "type text = characterData_like<_text>" - }, - { - "id": "Dom.domRect", - "kind": "type", - "name": "domRect", - "docstrings": [], - "signature": "type domRect" - }, - { - "id": "Dom.dataTransfer", - "kind": "type", - "name": "dataTransfer", - "docstrings": [], - "signature": "type dataTransfer" - }, - { - "id": "Dom.domStringMap", - "kind": "type", - "name": "domStringMap", - "docstrings": [], - "signature": "type domStringMap" - }, - { - "id": "Dom.history", - "kind": "type", - "name": "history", - "docstrings": [], - "signature": "type history" - }, - { - "id": "Dom._htmlDocument", - "kind": "type", - "name": "_htmlDocument", - "docstrings": [], - "signature": "type _htmlDocument" - }, - { - "id": "Dom.htmlDocument", - "kind": "type", - "name": "htmlDocument", - "docstrings": [], - "signature": "type htmlDocument = document_like<_htmlDocument>" - }, - { - "id": "Dom._htmlElement", - "kind": "type", - "name": "_htmlElement", - "docstrings": [], - "signature": "type _htmlElement<'a>" - }, - { - "id": "Dom.htmlElement_like", - "kind": "type", - "name": "htmlElement_like", - "docstrings": [], - "signature": "type htmlElement_like<'a> = element_like<_htmlElement<'a>>" - }, - { - "id": "Dom.htmlElement", - "kind": "type", - "name": "htmlElement", - "docstrings": [], - "signature": "type htmlElement = htmlElement_like<_baseClass>" - }, - { - "id": "Dom._htmlAnchorElement", - "kind": "type", - "name": "_htmlAnchorElement", - "docstrings": [], - "signature": "type _htmlAnchorElement" - }, - { - "id": "Dom.htmlAnchorElement", - "kind": "type", - "name": "htmlAnchorElement", - "docstrings": [], - "signature": "type htmlAnchorElement = htmlElement_like<\n _htmlAnchorElement,\n>" - }, - { - "id": "Dom._htmlAreaElement", - "kind": "type", - "name": "_htmlAreaElement", - "docstrings": [], - "signature": "type _htmlAreaElement" - }, - { - "id": "Dom.htmlAreaElement", - "kind": "type", - "name": "htmlAreaElement", - "docstrings": [], - "signature": "type htmlAreaElement = htmlElement_like<_htmlAreaElement>" - }, - { - "id": "Dom._htmlAudioElement", - "kind": "type", - "name": "_htmlAudioElement", - "docstrings": [], - "signature": "type _htmlAudioElement" - }, - { - "id": "Dom.htmlAudioElement", - "kind": "type", - "name": "htmlAudioElement", - "docstrings": [], - "signature": "type htmlAudioElement = htmlElement_like<_htmlAudioElement>" - }, - { - "id": "Dom._htmlBaseElement", - "kind": "type", - "name": "_htmlBaseElement", - "docstrings": [], - "signature": "type _htmlBaseElement" - }, - { - "id": "Dom.htmlBaseElement", - "kind": "type", - "name": "htmlBaseElement", - "docstrings": [], - "signature": "type htmlBaseElement = htmlElement_like<_htmlBaseElement>" - }, - { - "id": "Dom._htmlBodyElement", - "kind": "type", - "name": "_htmlBodyElement", - "docstrings": [], - "signature": "type _htmlBodyElement" - }, - { - "id": "Dom.htmlBodyElement", - "kind": "type", - "name": "htmlBodyElement", - "docstrings": [], - "signature": "type htmlBodyElement = htmlElement_like<_htmlBodyElement>" - }, - { - "id": "Dom._htmlBrElement", - "kind": "type", - "name": "_htmlBrElement", - "docstrings": [], - "signature": "type _htmlBrElement" - }, - { - "id": "Dom.htmlBrElement", - "kind": "type", - "name": "htmlBrElement", - "docstrings": [], - "signature": "type htmlBrElement = htmlElement_like<_htmlBrElement>" - }, - { - "id": "Dom._htmlButtonElement", - "kind": "type", - "name": "_htmlButtonElement", - "docstrings": [], - "signature": "type _htmlButtonElement" - }, - { - "id": "Dom.htmlButtonElement", - "kind": "type", - "name": "htmlButtonElement", - "docstrings": [], - "signature": "type htmlButtonElement = htmlElement_like<\n _htmlButtonElement,\n>" - }, - { - "id": "Dom._htmlCanvasElement", - "kind": "type", - "name": "_htmlCanvasElement", - "docstrings": [], - "signature": "type _htmlCanvasElement" - }, - { - "id": "Dom.htmlCanvasElement", - "kind": "type", - "name": "htmlCanvasElement", - "docstrings": [], - "signature": "type htmlCanvasElement = htmlElement_like<\n _htmlCanvasElement,\n>" - }, - { - "id": "Dom._htmlDataElement", - "kind": "type", - "name": "_htmlDataElement", - "docstrings": [], - "signature": "type _htmlDataElement" - }, - { - "id": "Dom.htmlDataElement", - "kind": "type", - "name": "htmlDataElement", - "docstrings": [], - "signature": "type htmlDataElement = htmlElement_like<_htmlDataElement>" - }, - { - "id": "Dom._htmlDataListElement", - "kind": "type", - "name": "_htmlDataListElement", - "docstrings": [], - "signature": "type _htmlDataListElement" - }, - { - "id": "Dom.htmlDataListElement", - "kind": "type", - "name": "htmlDataListElement", - "docstrings": [], - "signature": "type htmlDataListElement = htmlElement_like<\n _htmlDataListElement,\n>" - }, - { - "id": "Dom._htmlDialogElement", - "kind": "type", - "name": "_htmlDialogElement", - "docstrings": [], - "signature": "type _htmlDialogElement" - }, - { - "id": "Dom.htmlDialogElement", - "kind": "type", - "name": "htmlDialogElement", - "docstrings": [], - "signature": "type htmlDialogElement = htmlElement_like<\n _htmlDialogElement,\n>" - }, - { - "id": "Dom._htmlDivElement", - "kind": "type", - "name": "_htmlDivElement", - "docstrings": [], - "signature": "type _htmlDivElement" - }, - { - "id": "Dom.htmlDivElement", - "kind": "type", - "name": "htmlDivElement", - "docstrings": [], - "signature": "type htmlDivElement = htmlElement_like<_htmlDivElement>" - }, - { - "id": "Dom._htmlDlistElement", - "kind": "type", - "name": "_htmlDlistElement", - "docstrings": [], - "signature": "type _htmlDlistElement" - }, - { - "id": "Dom.htmlDlistElement", - "kind": "type", - "name": "htmlDlistElement", - "docstrings": [], - "signature": "type htmlDlistElement = htmlElement_like<_htmlDlistElement>" - }, - { - "id": "Dom._htmlEmbedElement", - "kind": "type", - "name": "_htmlEmbedElement", - "docstrings": [], - "signature": "type _htmlEmbedElement" - }, - { - "id": "Dom.htmlEmbedElement", - "kind": "type", - "name": "htmlEmbedElement", - "docstrings": [], - "signature": "type htmlEmbedElement = htmlElement_like<_htmlEmbedElement>" - }, - { - "id": "Dom._htmlFieldSetElement", - "kind": "type", - "name": "_htmlFieldSetElement", - "docstrings": [], - "signature": "type _htmlFieldSetElement" - }, - { - "id": "Dom.htmlFieldSetElement", - "kind": "type", - "name": "htmlFieldSetElement", - "docstrings": [], - "signature": "type htmlFieldSetElement = htmlElement_like<\n _htmlFieldSetElement,\n>" - }, - { - "id": "Dom._htmlFormElement", - "kind": "type", - "name": "_htmlFormElement", - "docstrings": [], - "signature": "type _htmlFormElement" - }, - { - "id": "Dom.htmlFormElement", - "kind": "type", - "name": "htmlFormElement", - "docstrings": [], - "signature": "type htmlFormElement = htmlElement_like<_htmlFormElement>" - }, - { - "id": "Dom._htmlHeadElement", - "kind": "type", - "name": "_htmlHeadElement", - "docstrings": [], - "signature": "type _htmlHeadElement" - }, - { - "id": "Dom.htmlHeadElement", - "kind": "type", - "name": "htmlHeadElement", - "docstrings": [], - "signature": "type htmlHeadElement = htmlElement_like<_htmlHeadElement>" - }, - { - "id": "Dom._htmlHeadingElement", - "kind": "type", - "name": "_htmlHeadingElement", - "docstrings": [], - "signature": "type _htmlHeadingElement" - }, - { - "id": "Dom.htmlHeadingElement", - "kind": "type", - "name": "htmlHeadingElement", - "docstrings": [], - "signature": "type htmlHeadingElement = htmlElement_like<\n _htmlHeadingElement,\n>" - }, - { - "id": "Dom._htmlHrElement", - "kind": "type", - "name": "_htmlHrElement", - "docstrings": [], - "signature": "type _htmlHrElement" - }, - { - "id": "Dom.htmlHrElement", - "kind": "type", - "name": "htmlHrElement", - "docstrings": [], - "signature": "type htmlHrElement = htmlElement_like<_htmlHrElement>" - }, - { - "id": "Dom._htmlHtmlElement", - "kind": "type", - "name": "_htmlHtmlElement", - "docstrings": [], - "signature": "type _htmlHtmlElement" - }, - { - "id": "Dom.htmlHtmlElement", - "kind": "type", - "name": "htmlHtmlElement", - "docstrings": [], - "signature": "type htmlHtmlElement = htmlElement_like<_htmlHtmlElement>" - }, - { - "id": "Dom._htmlIframeElement", - "kind": "type", - "name": "_htmlIframeElement", - "docstrings": [], - "signature": "type _htmlIframeElement" - }, - { - "id": "Dom.htmlIframeElement", - "kind": "type", - "name": "htmlIframeElement", - "docstrings": [], - "signature": "type htmlIframeElement = htmlElement_like<\n _htmlIframeElement,\n>" - }, - { - "id": "Dom._htmlImageElement", - "kind": "type", - "name": "_htmlImageElement", - "docstrings": [], - "signature": "type _htmlImageElement" - }, - { - "id": "Dom.htmlImageElement", - "kind": "type", - "name": "htmlImageElement", - "docstrings": [], - "signature": "type htmlImageElement = htmlElement_like<_htmlImageElement>" - }, - { - "id": "Dom._htmlInputElement", - "kind": "type", - "name": "_htmlInputElement", - "docstrings": [], - "signature": "type _htmlInputElement" - }, - { - "id": "Dom.htmlInputElement", - "kind": "type", - "name": "htmlInputElement", - "docstrings": [], - "signature": "type htmlInputElement = htmlElement_like<_htmlInputElement>" - }, - { - "id": "Dom._htmlLabelElement", - "kind": "type", - "name": "_htmlLabelElement", - "docstrings": [], - "signature": "type _htmlLabelElement" - }, - { - "id": "Dom.htmlLabelElement", - "kind": "type", - "name": "htmlLabelElement", - "docstrings": [], - "signature": "type htmlLabelElement = htmlElement_like<_htmlLabelElement>" - }, - { - "id": "Dom._htmlLegendElement", - "kind": "type", - "name": "_htmlLegendElement", - "docstrings": [], - "signature": "type _htmlLegendElement" - }, - { - "id": "Dom.htmlLegendElement", - "kind": "type", - "name": "htmlLegendElement", - "docstrings": [], - "signature": "type htmlLegendElement = htmlElement_like<\n _htmlLegendElement,\n>" - }, - { - "id": "Dom._htmlLiElement", - "kind": "type", - "name": "_htmlLiElement", - "docstrings": [], - "signature": "type _htmlLiElement" - }, - { - "id": "Dom.htmlLiElement", - "kind": "type", - "name": "htmlLiElement", - "docstrings": [], - "signature": "type htmlLiElement = htmlElement_like<_htmlLiElement>" - }, - { - "id": "Dom._htmlLinkElement", - "kind": "type", - "name": "_htmlLinkElement", - "docstrings": [], - "signature": "type _htmlLinkElement" - }, - { - "id": "Dom.htmlLinkElement", - "kind": "type", - "name": "htmlLinkElement", - "docstrings": [], - "signature": "type htmlLinkElement = htmlElement_like<_htmlLinkElement>" - }, - { - "id": "Dom._htmlMapElement", - "kind": "type", - "name": "_htmlMapElement", - "docstrings": [], - "signature": "type _htmlMapElement" - }, - { - "id": "Dom.htmlMapElement", - "kind": "type", - "name": "htmlMapElement", - "docstrings": [], - "signature": "type htmlMapElement = htmlElement_like<_htmlMapElement>" - }, - { - "id": "Dom._htmlMediaElement", - "kind": "type", - "name": "_htmlMediaElement", - "docstrings": [], - "signature": "type _htmlMediaElement" - }, - { - "id": "Dom.htmlMediaElement", - "kind": "type", - "name": "htmlMediaElement", - "docstrings": [], - "signature": "type htmlMediaElement = htmlElement_like<_htmlMediaElement>" - }, - { - "id": "Dom._htmlMenuElement", - "kind": "type", - "name": "_htmlMenuElement", - "docstrings": [], - "signature": "type _htmlMenuElement" - }, - { - "id": "Dom.htmlMenuElement", - "kind": "type", - "name": "htmlMenuElement", - "docstrings": [], - "signature": "type htmlMenuElement = htmlElement_like<_htmlMenuElement>" - }, - { - "id": "Dom._htmlMetaElement", - "kind": "type", - "name": "_htmlMetaElement", - "docstrings": [], - "signature": "type _htmlMetaElement" - }, - { - "id": "Dom.htmlMetaElement", - "kind": "type", - "name": "htmlMetaElement", - "docstrings": [], - "signature": "type htmlMetaElement = htmlElement_like<_htmlMetaElement>" - }, - { - "id": "Dom._htmlMeterElement", - "kind": "type", - "name": "_htmlMeterElement", - "docstrings": [], - "signature": "type _htmlMeterElement" - }, - { - "id": "Dom.htmlMeterElement", - "kind": "type", - "name": "htmlMeterElement", - "docstrings": [], - "signature": "type htmlMeterElement = htmlElement_like<_htmlMeterElement>" - }, - { - "id": "Dom._htmlModElement", - "kind": "type", - "name": "_htmlModElement", - "docstrings": [], - "signature": "type _htmlModElement" - }, - { - "id": "Dom.htmlModElement", - "kind": "type", - "name": "htmlModElement", - "docstrings": [], - "signature": "type htmlModElement = htmlElement_like<_htmlModElement>" - }, - { - "id": "Dom._htmlOListElement", - "kind": "type", - "name": "_htmlOListElement", - "docstrings": [], - "signature": "type _htmlOListElement" - }, - { - "id": "Dom.htmlOListElement", - "kind": "type", - "name": "htmlOListElement", - "docstrings": [], - "signature": "type htmlOListElement = htmlElement_like<_htmlOListElement>" - }, - { - "id": "Dom._htmlObjectElement", - "kind": "type", - "name": "_htmlObjectElement", - "docstrings": [], - "signature": "type _htmlObjectElement" - }, - { - "id": "Dom.htmlObjectElement", - "kind": "type", - "name": "htmlObjectElement", - "docstrings": [], - "signature": "type htmlObjectElement = htmlElement_like<\n _htmlObjectElement,\n>" - }, - { - "id": "Dom._htmlOptGroupElement", - "kind": "type", - "name": "_htmlOptGroupElement", - "docstrings": [], - "signature": "type _htmlOptGroupElement" - }, - { - "id": "Dom.htmlOptGroupElement", - "kind": "type", - "name": "htmlOptGroupElement", - "docstrings": [], - "signature": "type htmlOptGroupElement = htmlElement_like<\n _htmlOptGroupElement,\n>" - }, - { - "id": "Dom._htmlOptionElement", - "kind": "type", - "name": "_htmlOptionElement", - "docstrings": [], - "signature": "type _htmlOptionElement" - }, - { - "id": "Dom.htmlOptionElement", - "kind": "type", - "name": "htmlOptionElement", - "docstrings": [], - "signature": "type htmlOptionElement = htmlElement_like<\n _htmlOptionElement,\n>" - }, - { - "id": "Dom._htmlOutputElement", - "kind": "type", - "name": "_htmlOutputElement", - "docstrings": [], - "signature": "type _htmlOutputElement" - }, - { - "id": "Dom.htmlOutputElement", - "kind": "type", - "name": "htmlOutputElement", - "docstrings": [], - "signature": "type htmlOutputElement = htmlElement_like<\n _htmlOutputElement,\n>" - }, - { - "id": "Dom._htmlParagraphElement", - "kind": "type", - "name": "_htmlParagraphElement", - "docstrings": [], - "signature": "type _htmlParagraphElement" - }, - { - "id": "Dom.htmlParagraphElement", - "kind": "type", - "name": "htmlParagraphElement", - "docstrings": [], - "signature": "type htmlParagraphElement = htmlElement_like<\n _htmlParagraphElement,\n>" - }, - { - "id": "Dom._htmlParamElement", - "kind": "type", - "name": "_htmlParamElement", - "docstrings": [], - "signature": "type _htmlParamElement" - }, - { - "id": "Dom.htmlParamElement", - "kind": "type", - "name": "htmlParamElement", - "docstrings": [], - "signature": "type htmlParamElement = htmlElement_like<_htmlParamElement>" - }, - { - "id": "Dom._htmlPreElement", - "kind": "type", - "name": "_htmlPreElement", - "docstrings": [], - "signature": "type _htmlPreElement" - }, - { - "id": "Dom.htmlPreElement", - "kind": "type", - "name": "htmlPreElement", - "docstrings": [], - "signature": "type htmlPreElement = htmlElement_like<_htmlPreElement>" - }, - { - "id": "Dom._htmlProgressElement", - "kind": "type", - "name": "_htmlProgressElement", - "docstrings": [], - "signature": "type _htmlProgressElement" - }, - { - "id": "Dom.htmlProgressElement", - "kind": "type", - "name": "htmlProgressElement", - "docstrings": [], - "signature": "type htmlProgressElement = htmlElement_like<\n _htmlProgressElement,\n>" - }, - { - "id": "Dom._htmlQuoteElement", - "kind": "type", - "name": "_htmlQuoteElement", - "docstrings": [], - "signature": "type _htmlQuoteElement" - }, - { - "id": "Dom.htmlQuoteElement", - "kind": "type", - "name": "htmlQuoteElement", - "docstrings": [], - "signature": "type htmlQuoteElement = htmlElement_like<_htmlQuoteElement>" - }, - { - "id": "Dom._htmlScriptElement", - "kind": "type", - "name": "_htmlScriptElement", - "docstrings": [], - "signature": "type _htmlScriptElement" - }, - { - "id": "Dom.htmlScriptElement", - "kind": "type", - "name": "htmlScriptElement", - "docstrings": [], - "signature": "type htmlScriptElement = htmlElement_like<\n _htmlScriptElement,\n>" - }, - { - "id": "Dom._htmlSelectElement", - "kind": "type", - "name": "_htmlSelectElement", - "docstrings": [], - "signature": "type _htmlSelectElement" - }, - { - "id": "Dom.htmlSelectElement", - "kind": "type", - "name": "htmlSelectElement", - "docstrings": [], - "signature": "type htmlSelectElement = htmlElement_like<\n _htmlSelectElement,\n>" - }, - { - "id": "Dom._htmlSlotElement", - "kind": "type", - "name": "_htmlSlotElement", - "docstrings": [], - "signature": "type _htmlSlotElement" - }, - { - "id": "Dom.htmlSlotElement", - "kind": "type", - "name": "htmlSlotElement", - "docstrings": [], - "signature": "type htmlSlotElement = htmlElement_like<_htmlSlotElement>" - }, - { - "id": "Dom._htmlSourceElement", - "kind": "type", - "name": "_htmlSourceElement", - "docstrings": [], - "signature": "type _htmlSourceElement" - }, - { - "id": "Dom.htmlSourceElement", - "kind": "type", - "name": "htmlSourceElement", - "docstrings": [], - "signature": "type htmlSourceElement = htmlElement_like<\n _htmlSourceElement,\n>" - }, - { - "id": "Dom._htmlSpanElement", - "kind": "type", - "name": "_htmlSpanElement", - "docstrings": [], - "signature": "type _htmlSpanElement" - }, - { - "id": "Dom.htmlSpanElement", - "kind": "type", - "name": "htmlSpanElement", - "docstrings": [], - "signature": "type htmlSpanElement = htmlElement_like<_htmlSpanElement>" - }, - { - "id": "Dom._htmlStyleElement", - "kind": "type", - "name": "_htmlStyleElement", - "docstrings": [], - "signature": "type _htmlStyleElement" - }, - { - "id": "Dom.htmlStyleElement", - "kind": "type", - "name": "htmlStyleElement", - "docstrings": [], - "signature": "type htmlStyleElement = htmlElement_like<_htmlStyleElement>" - }, - { - "id": "Dom._htmlTableCaptionElement", - "kind": "type", - "name": "_htmlTableCaptionElement", - "docstrings": [], - "signature": "type _htmlTableCaptionElement" - }, - { - "id": "Dom.htmlTableCaptionElement", - "kind": "type", - "name": "htmlTableCaptionElement", - "docstrings": [], - "signature": "type htmlTableCaptionElement = htmlElement_like<\n _htmlTableCaptionElement,\n>" - }, - { - "id": "Dom._htmlTableCellElement", - "kind": "type", - "name": "_htmlTableCellElement", - "docstrings": [], - "signature": "type _htmlTableCellElement" - }, - { - "id": "Dom.htmlTableCellElement", - "kind": "type", - "name": "htmlTableCellElement", - "docstrings": [], - "signature": "type htmlTableCellElement = htmlElement_like<\n _htmlTableCellElement,\n>" - }, - { - "id": "Dom._htmlTableColElement", - "kind": "type", - "name": "_htmlTableColElement", - "docstrings": [], - "signature": "type _htmlTableColElement" - }, - { - "id": "Dom.htmlTableColElement", - "kind": "type", - "name": "htmlTableColElement", - "docstrings": [], - "signature": "type htmlTableColElement = htmlElement_like<\n _htmlTableColElement,\n>" - }, - { - "id": "Dom._htmlTableDataCellElement", - "kind": "type", - "name": "_htmlTableDataCellElement", - "docstrings": [], - "signature": "type _htmlTableDataCellElement" - }, - { - "id": "Dom.htmlTableDataCellElement", - "kind": "type", - "name": "htmlTableDataCellElement", - "docstrings": [], - "signature": "type htmlTableDataCellElement = htmlElement_like<\n _htmlTableDataCellElement,\n>" - }, - { - "id": "Dom._htmlTableElement", - "kind": "type", - "name": "_htmlTableElement", - "docstrings": [], - "signature": "type _htmlTableElement" - }, - { - "id": "Dom.htmlTableElement", - "kind": "type", - "name": "htmlTableElement", - "docstrings": [], - "signature": "type htmlTableElement = htmlElement_like<_htmlTableElement>" - }, - { - "id": "Dom._htmlTableHeaderCellElement", - "kind": "type", - "name": "_htmlTableHeaderCellElement", - "docstrings": [], - "signature": "type _htmlTableHeaderCellElement" - }, - { - "id": "Dom.htmlTableHeaderCellElement", - "kind": "type", - "name": "htmlTableHeaderCellElement", - "docstrings": [], - "signature": "type htmlTableHeaderCellElement = htmlElement_like<\n _htmlTableHeaderCellElement,\n>" - }, - { - "id": "Dom._htmlTableRowElement", - "kind": "type", - "name": "_htmlTableRowElement", - "docstrings": [], - "signature": "type _htmlTableRowElement" - }, - { - "id": "Dom.htmlTableRowElement", - "kind": "type", - "name": "htmlTableRowElement", - "docstrings": [], - "signature": "type htmlTableRowElement = htmlElement_like<\n _htmlTableRowElement,\n>" - }, - { - "id": "Dom._htmlTableSectionElement", - "kind": "type", - "name": "_htmlTableSectionElement", - "docstrings": [], - "signature": "type _htmlTableSectionElement" - }, - { - "id": "Dom.htmlTableSectionElement", - "kind": "type", - "name": "htmlTableSectionElement", - "docstrings": [], - "signature": "type htmlTableSectionElement = htmlElement_like<\n _htmlTableSectionElement,\n>" - }, - { - "id": "Dom._htmlTextAreaElement", - "kind": "type", - "name": "_htmlTextAreaElement", - "docstrings": [], - "signature": "type _htmlTextAreaElement" - }, - { - "id": "Dom.htmlTextAreaElement", - "kind": "type", - "name": "htmlTextAreaElement", - "docstrings": [], - "signature": "type htmlTextAreaElement = htmlElement_like<\n _htmlTextAreaElement,\n>" - }, - { - "id": "Dom._htmlTimeElement", - "kind": "type", - "name": "_htmlTimeElement", - "docstrings": [], - "signature": "type _htmlTimeElement" - }, - { - "id": "Dom.htmlTimeElement", - "kind": "type", - "name": "htmlTimeElement", - "docstrings": [], - "signature": "type htmlTimeElement = htmlElement_like<_htmlTimeElement>" - }, - { - "id": "Dom._htmlTitleElement", - "kind": "type", - "name": "_htmlTitleElement", - "docstrings": [], - "signature": "type _htmlTitleElement" - }, - { - "id": "Dom.htmlTitleElement", - "kind": "type", - "name": "htmlTitleElement", - "docstrings": [], - "signature": "type htmlTitleElement = htmlElement_like<_htmlTitleElement>" - }, - { - "id": "Dom._htmlTrackElement", - "kind": "type", - "name": "_htmlTrackElement", - "docstrings": [], - "signature": "type _htmlTrackElement" - }, - { - "id": "Dom.htmlTrackElement", - "kind": "type", - "name": "htmlTrackElement", - "docstrings": [], - "signature": "type htmlTrackElement = htmlElement_like<_htmlTrackElement>" - }, - { - "id": "Dom._htmlUlistElement", - "kind": "type", - "name": "_htmlUlistElement", - "docstrings": [], - "signature": "type _htmlUlistElement" - }, - { - "id": "Dom.htmlUlistElement", - "kind": "type", - "name": "htmlUlistElement", - "docstrings": [], - "signature": "type htmlUlistElement = htmlElement_like<_htmlUlistElement>" - }, - { - "id": "Dom._htmlUnknownElement", - "kind": "type", - "name": "_htmlUnknownElement", - "docstrings": [], - "signature": "type _htmlUnknownElement" - }, - { - "id": "Dom.htmlUnknownElement", - "kind": "type", - "name": "htmlUnknownElement", - "docstrings": [], - "signature": "type htmlUnknownElement = htmlElement_like<\n _htmlUnknownElement,\n>" - }, - { - "id": "Dom._htmlVideoElement", - "kind": "type", - "name": "_htmlVideoElement", - "docstrings": [], - "signature": "type _htmlVideoElement" - }, - { - "id": "Dom.htmlVideoElement", - "kind": "type", - "name": "htmlVideoElement", - "docstrings": [], - "signature": "type htmlVideoElement = htmlElement_like<_htmlVideoElement>" - }, - { - "id": "Dom.location", - "kind": "type", - "name": "location", - "docstrings": [], - "signature": "type location" - }, - { - "id": "Dom.window", - "kind": "type", - "name": "window", - "docstrings": [], - "signature": "type window" - }, - { - "id": "Dom._xmlDocument", - "kind": "type", - "name": "_xmlDocument", - "docstrings": [], - "signature": "type _xmlDocument" - }, - { - "id": "Dom.xmlDocument", - "kind": "type", - "name": "xmlDocument", - "docstrings": [], - "signature": "type xmlDocument = document_like<_xmlDocument>" - }, - { - "id": "Dom.event_like", - "kind": "type", - "name": "event_like", - "docstrings": [], - "signature": "type event_like<'a>" - }, - { - "id": "Dom.event", - "kind": "type", - "name": "event", - "docstrings": [], - "signature": "type event = event_like<_baseClass>" - }, - { - "id": "Dom._uiEvent", - "kind": "type", - "name": "_uiEvent", - "docstrings": [], - "signature": "type _uiEvent<'a>" - }, - { - "id": "Dom.uiEvent_like", - "kind": "type", - "name": "uiEvent_like", - "docstrings": [], - "signature": "type uiEvent_like<'a> = event_like<_uiEvent<'a>>" - }, - { - "id": "Dom.uiEvent", - "kind": "type", - "name": "uiEvent", - "docstrings": [], - "signature": "type uiEvent = uiEvent_like<_baseClass>" - }, - { - "id": "Dom._animationEvent", - "kind": "type", - "name": "_animationEvent", - "docstrings": [], - "signature": "type _animationEvent" - }, - { - "id": "Dom.animationEvent", - "kind": "type", - "name": "animationEvent", - "docstrings": [], - "signature": "type animationEvent = event_like<_animationEvent>" - }, - { - "id": "Dom._beforeUnloadEvent", - "kind": "type", - "name": "_beforeUnloadEvent", - "docstrings": [], - "signature": "type _beforeUnloadEvent" - }, - { - "id": "Dom.beforeUnloadEvent", - "kind": "type", - "name": "beforeUnloadEvent", - "docstrings": [], - "signature": "type beforeUnloadEvent = event_like<_beforeUnloadEvent>" - }, - { - "id": "Dom._clipboardEvent", - "kind": "type", - "name": "_clipboardEvent", - "docstrings": [], - "signature": "type _clipboardEvent" - }, - { - "id": "Dom.clipboardEvent", - "kind": "type", - "name": "clipboardEvent", - "docstrings": [], - "signature": "type clipboardEvent = event_like<_clipboardEvent>" - }, - { - "id": "Dom._closeEvent", - "kind": "type", - "name": "_closeEvent", - "docstrings": [], - "signature": "type _closeEvent" - }, - { - "id": "Dom.closeEvent", - "kind": "type", - "name": "closeEvent", - "docstrings": [], - "signature": "type closeEvent = event_like<_closeEvent>" - }, - { - "id": "Dom._compositionEvent", - "kind": "type", - "name": "_compositionEvent", - "docstrings": [], - "signature": "type _compositionEvent" - }, - { - "id": "Dom.compositionEvent", - "kind": "type", - "name": "compositionEvent", - "docstrings": [], - "signature": "type compositionEvent = uiEvent_like<_compositionEvent>" - }, - { - "id": "Dom._customEvent", - "kind": "type", - "name": "_customEvent", - "docstrings": [], - "signature": "type _customEvent" - }, - { - "id": "Dom.customEvent", - "kind": "type", - "name": "customEvent", - "docstrings": [], - "signature": "type customEvent = event_like<_customEvent>" - }, - { - "id": "Dom._dragEvent", - "kind": "type", - "name": "_dragEvent", - "docstrings": [], - "signature": "type _dragEvent" - }, - { - "id": "Dom.dragEvent", - "kind": "type", - "name": "dragEvent", - "docstrings": [], - "signature": "type dragEvent = event_like<_dragEvent>" - }, - { - "id": "Dom._errorEvent", - "kind": "type", - "name": "_errorEvent", - "docstrings": [], - "signature": "type _errorEvent" - }, - { - "id": "Dom.errorEvent", - "kind": "type", - "name": "errorEvent", - "docstrings": [], - "signature": "type errorEvent = event_like<_errorEvent>" - }, - { - "id": "Dom._focusEvent", - "kind": "type", - "name": "_focusEvent", - "docstrings": [], - "signature": "type _focusEvent" - }, - { - "id": "Dom.focusEvent", - "kind": "type", - "name": "focusEvent", - "docstrings": [], - "signature": "type focusEvent = uiEvent_like<_focusEvent>" - }, - { - "id": "Dom._idbVersionChangeEvent", - "kind": "type", - "name": "_idbVersionChangeEvent", - "docstrings": [], - "signature": "type _idbVersionChangeEvent" - }, - { - "id": "Dom.idbVersionChangeEvent", - "kind": "type", - "name": "idbVersionChangeEvent", - "docstrings": [], - "signature": "type idbVersionChangeEvent = event_like<\n _idbVersionChangeEvent,\n>" - }, - { - "id": "Dom._inputEvent", - "kind": "type", - "name": "_inputEvent", - "docstrings": [], - "signature": "type _inputEvent" - }, - { - "id": "Dom.inputEvent", - "kind": "type", - "name": "inputEvent", - "docstrings": [], - "signature": "type inputEvent = uiEvent_like<_inputEvent>" - }, - { - "id": "Dom._keyboardEvent", - "kind": "type", - "name": "_keyboardEvent", - "docstrings": [], - "signature": "type _keyboardEvent" - }, - { - "id": "Dom.keyboardEvent", - "kind": "type", - "name": "keyboardEvent", - "docstrings": [], - "signature": "type keyboardEvent = uiEvent_like<_keyboardEvent>" - }, - { - "id": "Dom._mouseEvent", - "kind": "type", - "name": "_mouseEvent", - "docstrings": [], - "signature": "type _mouseEvent<'a>" - }, - { - "id": "Dom.mouseEvent_like", - "kind": "type", - "name": "mouseEvent_like", - "docstrings": [], - "signature": "type mouseEvent_like<'a> = uiEvent_like<_mouseEvent<'a>>" - }, - { - "id": "Dom.mouseEvent", - "kind": "type", - "name": "mouseEvent", - "docstrings": [], - "signature": "type mouseEvent = mouseEvent_like<_baseClass>" - }, - { - "id": "Dom._pageTransitionEvent", - "kind": "type", - "name": "_pageTransitionEvent", - "docstrings": [], - "signature": "type _pageTransitionEvent" - }, - { - "id": "Dom.pageTransitionEvent", - "kind": "type", - "name": "pageTransitionEvent", - "docstrings": [], - "signature": "type pageTransitionEvent = event_like<_pageTransitionEvent>" - }, - { - "id": "Dom._pointerEvent", - "kind": "type", - "name": "_pointerEvent", - "docstrings": [], - "signature": "type _pointerEvent" - }, - { - "id": "Dom.pointerEvent", - "kind": "type", - "name": "pointerEvent", - "docstrings": [], - "signature": "type pointerEvent = mouseEvent_like<_pointerEvent>" - }, - { - "id": "Dom._popStateEvent", - "kind": "type", - "name": "_popStateEvent", - "docstrings": [], - "signature": "type _popStateEvent" - }, - { - "id": "Dom.popStateEvent", - "kind": "type", - "name": "popStateEvent", - "docstrings": [], - "signature": "type popStateEvent = event_like<_popStateEvent>" - }, - { - "id": "Dom._progressEvent", - "kind": "type", - "name": "_progressEvent", - "docstrings": [], - "signature": "type _progressEvent" - }, - { - "id": "Dom.progressEvent", - "kind": "type", - "name": "progressEvent", - "docstrings": [], - "signature": "type progressEvent = event_like<_progressEvent>" - }, - { - "id": "Dom._relatedEvent", - "kind": "type", - "name": "_relatedEvent", - "docstrings": [], - "signature": "type _relatedEvent" - }, - { - "id": "Dom.relatedEvent", - "kind": "type", - "name": "relatedEvent", - "docstrings": [], - "signature": "type relatedEvent = event_like<_relatedEvent>" - }, - { - "id": "Dom._storageEvent", - "kind": "type", - "name": "_storageEvent", - "docstrings": [], - "signature": "type _storageEvent" - }, - { - "id": "Dom.storageEvent", - "kind": "type", - "name": "storageEvent", - "docstrings": [], - "signature": "type storageEvent = event_like<_storageEvent>" - }, - { - "id": "Dom._svgZoomEvent", - "kind": "type", - "name": "_svgZoomEvent", - "docstrings": [], - "signature": "type _svgZoomEvent" - }, - { - "id": "Dom.svgZoomEvent", - "kind": "type", - "name": "svgZoomEvent", - "docstrings": [], - "signature": "type svgZoomEvent = event_like<_svgZoomEvent>" - }, - { - "id": "Dom._timeEvent", - "kind": "type", - "name": "_timeEvent", - "docstrings": [], - "signature": "type _timeEvent" - }, - { - "id": "Dom.timeEvent", - "kind": "type", - "name": "timeEvent", - "docstrings": [], - "signature": "type timeEvent = event_like<_timeEvent>" - }, - { - "id": "Dom._touchEvent", - "kind": "type", - "name": "_touchEvent", - "docstrings": [], - "signature": "type _touchEvent" - }, - { - "id": "Dom.touchEvent", - "kind": "type", - "name": "touchEvent", - "docstrings": [], - "signature": "type touchEvent = uiEvent_like<_touchEvent>" - }, - { - "id": "Dom._trackEvent", - "kind": "type", - "name": "_trackEvent", - "docstrings": [], - "signature": "type _trackEvent" - }, - { - "id": "Dom.trackEvent", - "kind": "type", - "name": "trackEvent", - "docstrings": [], - "signature": "type trackEvent = event_like<_trackEvent>" - }, - { - "id": "Dom._transitionEvent", - "kind": "type", - "name": "_transitionEvent", - "docstrings": [], - "signature": "type _transitionEvent" - }, - { - "id": "Dom.transitionEvent", - "kind": "type", - "name": "transitionEvent", - "docstrings": [], - "signature": "type transitionEvent = event_like<_transitionEvent>" - }, - { - "id": "Dom._webGlContextEvent", - "kind": "type", - "name": "_webGlContextEvent", - "docstrings": [], - "signature": "type _webGlContextEvent" - }, - { - "id": "Dom.webGlContextEvent", - "kind": "type", - "name": "webGlContextEvent", - "docstrings": [], - "signature": "type webGlContextEvent = event_like<_webGlContextEvent>" - }, - { - "id": "Dom._wheelEvent", - "kind": "type", - "name": "_wheelEvent", - "docstrings": [], - "signature": "type _wheelEvent" - }, - { - "id": "Dom.wheelEvent", - "kind": "type", - "name": "wheelEvent", - "docstrings": [], - "signature": "type wheelEvent = uiEvent_like<_wheelEvent>" - }, - { - "id": "Dom.range", - "kind": "type", - "name": "range", - "docstrings": [], - "signature": "type range" - }, - { - "id": "Dom.selection", - "kind": "type", - "name": "selection", - "docstrings": [], - "signature": "type selection" - }, - { - "id": "Dom.domTokenList", - "kind": "type", - "name": "domTokenList", - "docstrings": [], - "signature": "type domTokenList" - }, - { - "id": "Dom.domSettableTokenList", - "kind": "type", - "name": "domSettableTokenList", - "docstrings": [], - "signature": "type domSettableTokenList" - }, - { - "id": "Dom.nodeFilter", - "kind": "type", - "name": "nodeFilter", - "docstrings": [], - "signature": "type nodeFilter = {acceptNode: element => int}" - }, - { - "id": "Dom.nodeIterator", - "kind": "type", - "name": "nodeIterator", - "docstrings": [], - "signature": "type nodeIterator" - }, - { - "id": "Dom.treeWalker", - "kind": "type", - "name": "treeWalker", - "docstrings": [], - "signature": "type treeWalker" - }, - { - "id": "Dom.svgRect", - "kind": "type", - "name": "svgRect", - "docstrings": [], - "signature": "type svgRect" - }, - { - "id": "Dom.svgPoint", - "kind": "type", - "name": "svgPoint", - "docstrings": [], - "signature": "type svgPoint" - }, - { - "id": "Dom.eventPointerId", - "kind": "type", - "name": "eventPointerId", - "docstrings": [], - "signature": "type eventPointerId" - } - ] - }, - "dom/storage2": { - "id": "Dom.Storage2", - "name": "Storage2", - "docstrings": [], - "items": [ - { - "id": "Dom.Storage2.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Dom.Storage2.getItem", - "kind": "value", - "name": "getItem", - "docstrings": [], - "signature": "let getItem: (t, string) => option" - }, - { - "id": "Dom.Storage2.setItem", - "kind": "value", - "name": "setItem", - "docstrings": [], - "signature": "let setItem: (t, string, string) => unit" - }, - { - "id": "Dom.Storage2.removeItem", - "kind": "value", - "name": "removeItem", - "docstrings": [], - "signature": "let removeItem: (t, string) => unit" - }, - { - "id": "Dom.Storage2.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Dom.Storage2.key", - "kind": "value", - "name": "key", - "docstrings": [], - "signature": "let key: (t, int) => option" - }, - { - "id": "Dom.Storage2.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int" - }, - { - "id": "Dom.Storage2.localStorage", - "kind": "value", - "name": "localStorage", - "docstrings": [], - "signature": "let localStorage: t" - }, - { - "id": "Dom.Storage2.sessionStorage", - "kind": "value", - "name": "sessionStorage", - "docstrings": [], - "signature": "let sessionStorage: t" - } - ] - }, - "dom/storage": { - "id": "Dom.Storage", - "name": "Storage", - "docstrings": [], - "items": [ - { - "id": "Dom.Storage.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Dom_storage2.t" - }, - { - "id": "Dom.Storage.getItem", - "kind": "value", - "name": "getItem", - "docstrings": [], - "signature": "let getItem: (string, t) => option" - }, - { - "id": "Dom.Storage.setItem", - "kind": "value", - "name": "setItem", - "docstrings": [], - "signature": "let setItem: (string, string, t) => unit" - }, - { - "id": "Dom.Storage.removeItem", - "kind": "value", - "name": "removeItem", - "docstrings": [], - "signature": "let removeItem: (string, t) => unit" - }, - { - "id": "Dom.Storage.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Dom.Storage.key", - "kind": "value", - "name": "key", - "docstrings": [], - "signature": "let key: (int, t) => option" - }, - { - "id": "Dom.Storage.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int" - }, - { - "id": "Dom.Storage.localStorage", - "kind": "value", - "name": "localStorage", - "docstrings": [], - "signature": "let localStorage: t" - }, - { - "id": "Dom.Storage.sessionStorage", - "kind": "value", - "name": "sessionStorage", - "docstrings": [], - "signature": "let sessionStorage: t" - } - ] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v12.0.1/js.json b/apps/docs/data/api/v12.0.1/js.json deleted file mode 100644 index b6d50b8ef..000000000 --- a/apps/docs/data/api/v12.0.1/js.json +++ /dev/null @@ -1,12866 +0,0 @@ -{ - "js": { - "id": "Js", - "name": "Js", - "docstrings": [ - "The Js module mostly contains ReScript bindings to _standard JavaScript APIs_\nlike [console.log](https://developer.mozilla.org/en-US/docs/Web/API/Console/log),\nor the JavaScript\n[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String),\n[Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date), and\n[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\nclasses.\n\nIt is meant as a zero-abstraction interop layer and directly exposes JavaScript functions as they are. If you can find your API in this module, prefer this over an equivalent Belt helper. For example, prefer [Js.Array2](js/array2) over [Belt.Array](belt/array)\n\n## Argument Order\n\nFor historical reasons, some APIs in the Js namespace (e.g. [Js.String](js/string)) are\nusing the data-last argument order whereas others (e.g. [Js.Date](js/date)) are using data-first.\n\nFor more information about these argument orders and the trade-offs between them, see\n[this blog post](https://www.javierchavarri.com/data-first-and-data-last-a-comparison/).\n\n_Eventually, all modules in the Js namespace are going to be migrated to data-first though._\n\n## Js.Xxx2 Modules\n\nPrefer `Js.Array2` over `Js.Array`, `Js.String2` over `Js.String`, etc. The latters are old modules." - ], - "items": [ - { - "id": "Js.t", - "kind": "type", - "name": "t", - "docstrings": [ - "JS object type" - ], - "signature": "type t<'a> = 'a\n constraint 'a = {..}", - "deprecated": "This has been deprecated and will be removed in v13. Use the `{..}` type directly instead." - }, - { - "id": "Js.globalThis", - "kind": "value", - "name": "globalThis", - "docstrings": [ - "JS global object reference" - ], - "signature": "let globalThis: t<{..}>", - "deprecated": "" - }, - { - "id": "Js.null", - "kind": "type", - "name": "null", - "docstrings": [], - "signature": "@unboxed\ntype null<'a> = Js_null.t<'a> = Value('a) | @as(null) Null", - "deprecated": "" - }, - { - "id": "Js.undefined", - "kind": "type", - "name": "undefined", - "docstrings": [], - "signature": "type undefined<'a> = Js_undefined.t<'a>", - "deprecated": "This has been deprecated and will be removed in v13." - }, - { - "id": "Js.nullable", - "kind": "type", - "name": "nullable", - "docstrings": [], - "signature": "@unboxed\ntype nullable<'a> = Js_null_undefined.t<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined", - "deprecated": "" - }, - { - "id": "Js.null_undefined", - "kind": "type", - "name": "null_undefined", - "docstrings": [], - "signature": "type null_undefined<'a> = nullable<'a>", - "deprecated": "" - }, - { - "id": "Js.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [], - "signature": "let toOption: nullable<'a> => option<'a>" - }, - { - "id": "Js.undefinedToOption", - "kind": "value", - "name": "undefinedToOption", - "docstrings": [], - "signature": "let undefinedToOption: undefined<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.nullToOption", - "kind": "value", - "name": "nullToOption", - "docstrings": [], - "signature": "let nullToOption: null<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [], - "signature": "let isNullable: nullable<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.import", - "kind": "value", - "name": "import", - "docstrings": [], - "signature": "let import: 'a => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.testAny", - "kind": "value", - "name": "testAny", - "docstrings": [ - "The same as {!test} except that it is more permissive on the types of input" - ], - "signature": "let testAny: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.promise", - "kind": "type", - "name": "promise", - "docstrings": [ - "The promise type, defined here for interoperation across packages." - ], - "signature": "type promise<+'a, +'e>", - "deprecated": "This is deprecated and will be removed in v13. Use the `promise` type directly instead." - }, - { - "id": "Js.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The same as empty in `Js.Null`. Compiles to `null`." - ], - "signature": "let null: null<'a>", - "deprecated": "" - }, - { - "id": "Js.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The same as empty `Js.Undefined`. Compiles to `undefined`." - ], - "signature": "let undefined: undefined<'a>", - "deprecated": "" - }, - { - "id": "Js.typeof", - "kind": "value", - "name": "typeof", - "docstrings": [ - "`typeof x` will be compiled as `typeof x` in JS. Please consider functions in\n`Js.Types` for a type safe way of reflection." - ], - "signature": "let typeof: 'a => string", - "deprecated": "" - }, - { - "id": "Js.log", - "kind": "value", - "name": "log", - "docstrings": [ - "Equivalent to console.log any value." - ], - "signature": "let log: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.log2", - "kind": "value", - "name": "log2", - "docstrings": [], - "signature": "let log2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.log3", - "kind": "value", - "name": "log3", - "docstrings": [], - "signature": "let log3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.log4", - "kind": "value", - "name": "log4", - "docstrings": [], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.logMany", - "kind": "value", - "name": "logMany", - "docstrings": [ - "A convenience function to console.log more than 4 arguments" - ], - "signature": "let logMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.eqNull", - "kind": "value", - "name": "eqNull", - "docstrings": [], - "signature": "let eqNull: ('a, null<'a>) => bool", - "deprecated": "" - }, - { - "id": "Js.eqUndefined", - "kind": "value", - "name": "eqUndefined", - "docstrings": [], - "signature": "let eqUndefined: ('a, undefined<'a>) => bool", - "deprecated": "" - }, - { - "id": "Js.eqNullable", - "kind": "value", - "name": "eqNullable", - "docstrings": [], - "signature": "let eqNullable: ('a, nullable<'a>) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_lt", - "kind": "value", - "name": "unsafe_lt", - "docstrings": [ - "`unsafe_lt(a, b)` will be compiled as `a < b`.\n It is marked as unsafe, since it is impossible\n to give a proper semantics for comparision which applies to any type" - ], - "signature": "let unsafe_lt: ('a, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_le", - "kind": "value", - "name": "unsafe_le", - "docstrings": [ - "`unsafe_le(a, b)` will be compiled as `a <= b`.\n See also `Js.unsafe_lt`." - ], - "signature": "let unsafe_le: ('a, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_gt", - "kind": "value", - "name": "unsafe_gt", - "docstrings": [ - "`unsafe_gt(a, b)` will be compiled as `a > b`.\n See also `Js.unsafe_lt`." - ], - "signature": "let unsafe_gt: ('a, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_ge", - "kind": "value", - "name": "unsafe_ge", - "docstrings": [ - "`unsafe_ge(a, b)` will be compiled as `a >= b`.\n See also `Js.unsafe_lt`." - ], - "signature": "let unsafe_ge: ('a, 'a) => bool", - "deprecated": "" - } - ] - }, - "js/typedarray2/dataview": { - "id": "Js.TypedArray2.DataView", - "name": "DataView", - "docstrings": [ - "The DataView view provides a low-level interface for reading and writing\nmultiple number types in an ArrayBuffer irrespective of the platform's endianness.\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)" - ], - "items": [ - { - "id": "Js.TypedArray2.DataView.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Js.TypedArray2.DataView.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array_buffer => t" - }, - { - "id": "Js.TypedArray2.DataView.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.DataView.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [], - "signature": "let fromBufferOffset: (array_buffer, int) => t" - }, - { - "id": "Js.TypedArray2.DataView.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t" - }, - { - "id": "Js.TypedArray2.DataView.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.DataView.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.DataView.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt8", - "kind": "value", - "name": "getInt8", - "docstrings": [], - "signature": "let getInt8: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint8", - "kind": "value", - "name": "getUint8", - "docstrings": [], - "signature": "let getUint8: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt16", - "kind": "value", - "name": "getInt16", - "docstrings": [], - "signature": "let getInt16: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt16LittleEndian", - "kind": "value", - "name": "getInt16LittleEndian", - "docstrings": [], - "signature": "let getInt16LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint16", - "kind": "value", - "name": "getUint16", - "docstrings": [], - "signature": "let getUint16: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint16LittleEndian", - "kind": "value", - "name": "getUint16LittleEndian", - "docstrings": [], - "signature": "let getUint16LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt32", - "kind": "value", - "name": "getInt32", - "docstrings": [], - "signature": "let getInt32: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt32LittleEndian", - "kind": "value", - "name": "getInt32LittleEndian", - "docstrings": [], - "signature": "let getInt32LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint32", - "kind": "value", - "name": "getUint32", - "docstrings": [], - "signature": "let getUint32: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint32LittleEndian", - "kind": "value", - "name": "getUint32LittleEndian", - "docstrings": [], - "signature": "let getUint32LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getFloat32", - "kind": "value", - "name": "getFloat32", - "docstrings": [], - "signature": "let getFloat32: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.getFloat32LittleEndian", - "kind": "value", - "name": "getFloat32LittleEndian", - "docstrings": [], - "signature": "let getFloat32LittleEndian: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.getFloat64", - "kind": "value", - "name": "getFloat64", - "docstrings": [], - "signature": "let getFloat64: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.getFloat64LittleEndian", - "kind": "value", - "name": "getFloat64LittleEndian", - "docstrings": [], - "signature": "let getFloat64LittleEndian: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.setInt8", - "kind": "value", - "name": "setInt8", - "docstrings": [], - "signature": "let setInt8: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint8", - "kind": "value", - "name": "setUint8", - "docstrings": [], - "signature": "let setUint8: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt16", - "kind": "value", - "name": "setInt16", - "docstrings": [], - "signature": "let setInt16: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt16LittleEndian", - "kind": "value", - "name": "setInt16LittleEndian", - "docstrings": [], - "signature": "let setInt16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint16", - "kind": "value", - "name": "setUint16", - "docstrings": [], - "signature": "let setUint16: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint16LittleEndian", - "kind": "value", - "name": "setUint16LittleEndian", - "docstrings": [], - "signature": "let setUint16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt32", - "kind": "value", - "name": "setInt32", - "docstrings": [], - "signature": "let setInt32: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt32LittleEndian", - "kind": "value", - "name": "setInt32LittleEndian", - "docstrings": [], - "signature": "let setInt32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint32", - "kind": "value", - "name": "setUint32", - "docstrings": [], - "signature": "let setUint32: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint32LittleEndian", - "kind": "value", - "name": "setUint32LittleEndian", - "docstrings": [], - "signature": "let setUint32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat32", - "kind": "value", - "name": "setFloat32", - "docstrings": [], - "signature": "let setFloat32: (t, int, float) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat32LittleEndian", - "kind": "value", - "name": "setFloat32LittleEndian", - "docstrings": [], - "signature": "let setFloat32LittleEndian: (t, int, float) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat64", - "kind": "value", - "name": "setFloat64", - "docstrings": [], - "signature": "let setFloat64: (t, int, float) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat64LittleEndian", - "kind": "value", - "name": "setFloat64LittleEndian", - "docstrings": [], - "signature": "let setFloat64LittleEndian: (t, int, float) => unit" - } - ] - }, - "js/typedarray2/float64array": { - "id": "Js.TypedArray2.Float64Array", - "name": "Float64Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Float64Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.TypedArray2.Float64Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Float64Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Float64Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Float64Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Float64Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Float64Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Float64Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Float64Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/float32array": { - "id": "Js.TypedArray2.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Float32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.TypedArray2.Float32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Float32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Float32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Float32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Float32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Float32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Float32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Float32Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/uint32array": { - "id": "Js.TypedArray2.Uint32Array", - "name": "Uint32Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint32Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/int32array": { - "id": "Js.TypedArray2.Int32Array", - "name": "Int32Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Int32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Int32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Int32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Int32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Int32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Int32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Int32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Int32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Int32Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/uint16array": { - "id": "Js.TypedArray2.Uint16Array", - "name": "Uint16Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t" - }, - { - "id": "Js.TypedArray2.Uint16Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t" - }, - { - "id": "Js.TypedArray2.Uint16Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>" - }, - { - "id": "Js.TypedArray2.Uint16Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b" - }, - { - "id": "Js.TypedArray2.Uint16Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b" - }, - { - "id": "Js.TypedArray2.Uint16Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b" - }, - { - "id": "Js.TypedArray2.Uint16Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/int16array": { - "id": "Js.TypedArray2.Int16Array", - "name": "Int16Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Int16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Int16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Int16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Int16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Int16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Int16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Int16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Int16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Int16Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int" - }, - { - "id": "Js.TypedArray2.Int16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t" - }, - { - "id": "Js.TypedArray2.Int16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t" - } - ] - }, - "js/typedarray2/uint8clampedarray": { - "id": "Js.TypedArray2.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint8ClampedArray.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/uint8array": { - "id": "Js.TypedArray2.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint8Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t" - }, - { - "id": "Js.TypedArray2.Uint8Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/int8array": { - "id": "Js.TypedArray2.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Int8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Int8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Int8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Int8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Int8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Int8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Int8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Int8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Int8Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Int8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/arraybuffer": { - "id": "Js.TypedArray2.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [ - "The underlying buffer that the typed arrays provide views of\n\n **see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)" - ], - "items": [ - { - "id": "Js.TypedArray2.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = array_buffer" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.make", - "kind": "value", - "name": "make", - "docstrings": [ - "takes length. initializes elements to 0" - ], - "signature": "let make: int => t" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (t, ~start: int, ~end_: int) => array_buffer", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => array_buffer", - "deprecated": "" - } - ] - }, - "js/typed_array/dataview": { - "id": "Js.Typed_array.DataView", - "name": "DataView", - "docstrings": [ - "The DataView view provides a low-level interface for reading and writing\nmultiple number types in an ArrayBuffer irrespective of the platform's endianness.\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)" - ], - "items": [ - { - "id": "Js.Typed_array.DataView.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Js_typed_array2.DataView.t" - }, - { - "id": "Js.Typed_array.DataView.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array_buffer => t" - }, - { - "id": "Js.Typed_array.DataView.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.DataView.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [], - "signature": "let fromBufferOffset: (array_buffer, int) => t" - }, - { - "id": "Js.Typed_array.DataView.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t" - }, - { - "id": "Js.Typed_array.DataView.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.DataView.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.DataView.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.DataView.getInt8", - "kind": "value", - "name": "getInt8", - "docstrings": [], - "signature": "let getInt8: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint8", - "kind": "value", - "name": "getUint8", - "docstrings": [], - "signature": "let getUint8: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt16", - "kind": "value", - "name": "getInt16", - "docstrings": [], - "signature": "let getInt16: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt16LittleEndian", - "kind": "value", - "name": "getInt16LittleEndian", - "docstrings": [], - "signature": "let getInt16LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint16", - "kind": "value", - "name": "getUint16", - "docstrings": [], - "signature": "let getUint16: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint16LittleEndian", - "kind": "value", - "name": "getUint16LittleEndian", - "docstrings": [], - "signature": "let getUint16LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt32", - "kind": "value", - "name": "getInt32", - "docstrings": [], - "signature": "let getInt32: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt32LittleEndian", - "kind": "value", - "name": "getInt32LittleEndian", - "docstrings": [], - "signature": "let getInt32LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint32", - "kind": "value", - "name": "getUint32", - "docstrings": [], - "signature": "let getUint32: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint32LittleEndian", - "kind": "value", - "name": "getUint32LittleEndian", - "docstrings": [], - "signature": "let getUint32LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getFloat32", - "kind": "value", - "name": "getFloat32", - "docstrings": [], - "signature": "let getFloat32: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.getFloat32LittleEndian", - "kind": "value", - "name": "getFloat32LittleEndian", - "docstrings": [], - "signature": "let getFloat32LittleEndian: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.getFloat64", - "kind": "value", - "name": "getFloat64", - "docstrings": [], - "signature": "let getFloat64: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.getFloat64LittleEndian", - "kind": "value", - "name": "getFloat64LittleEndian", - "docstrings": [], - "signature": "let getFloat64LittleEndian: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.setInt8", - "kind": "value", - "name": "setInt8", - "docstrings": [], - "signature": "let setInt8: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint8", - "kind": "value", - "name": "setUint8", - "docstrings": [], - "signature": "let setUint8: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt16", - "kind": "value", - "name": "setInt16", - "docstrings": [], - "signature": "let setInt16: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt16LittleEndian", - "kind": "value", - "name": "setInt16LittleEndian", - "docstrings": [], - "signature": "let setInt16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint16", - "kind": "value", - "name": "setUint16", - "docstrings": [], - "signature": "let setUint16: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint16LittleEndian", - "kind": "value", - "name": "setUint16LittleEndian", - "docstrings": [], - "signature": "let setUint16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt32", - "kind": "value", - "name": "setInt32", - "docstrings": [], - "signature": "let setInt32: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt32LittleEndian", - "kind": "value", - "name": "setInt32LittleEndian", - "docstrings": [], - "signature": "let setInt32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint32", - "kind": "value", - "name": "setUint32", - "docstrings": [], - "signature": "let setUint32: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint32LittleEndian", - "kind": "value", - "name": "setUint32LittleEndian", - "docstrings": [], - "signature": "let setUint32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat32", - "kind": "value", - "name": "setFloat32", - "docstrings": [], - "signature": "let setFloat32: (t, int, float) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat32LittleEndian", - "kind": "value", - "name": "setFloat32LittleEndian", - "docstrings": [], - "signature": "let setFloat32LittleEndian: (t, int, float) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat64", - "kind": "value", - "name": "setFloat64", - "docstrings": [], - "signature": "let setFloat64: (t, int, float) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat64LittleEndian", - "kind": "value", - "name": "setFloat64LittleEndian", - "docstrings": [], - "signature": "let setFloat64LittleEndian: (t, int, float) => unit" - } - ] - }, - "js/typed_array/float64_array": { - "id": "Js.Typed_array.Float64_array", - "name": "Float64_array", - "docstrings": [], - "items": [] - }, - "js/typed_array/float64array": { - "id": "Js.Typed_array.Float64Array", - "name": "Float64Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Float64Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.Typed_array.Float64Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Float64Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Float64Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Float64Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Float64Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Float64Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Float64Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Float64Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Float64Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.create", - "kind": "value", - "name": "create", - "docstrings": [], - "signature": "let create: array => t", - "deprecated": "use `make` instead" - }, - { - "id": "Js.Typed_array.Float64Array.of_buffer", - "kind": "value", - "name": "of_buffer", - "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" - } - ] - }, - "js/typed_array/float32_array": { - "id": "Js.Typed_array.Float32_array", - "name": "Float32_array", - "docstrings": [], - "items": [] - }, - "js/typed_array/float32array": { - "id": "Js.Typed_array.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Float32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.Typed_array.Float32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Float32Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Float32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Float32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Float32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Float32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Float32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Float32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Float32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.create", - "kind": "value", - "name": "create", - "docstrings": [], - "signature": "let create: array => t", - "deprecated": "use `make` instead" - }, - { - "id": "Js.Typed_array.Float32Array.of_buffer", - "kind": "value", - "name": "of_buffer", - "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" - } - ] - }, - "js/typed_array/uint32array": { - "id": "Js.Typed_array.Uint32Array", - "name": "Uint32Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint32Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/int32_array": { - "id": "Js.Typed_array.Int32_array", - "name": "Int32_array", - "docstrings": [], - "items": [] - }, - "js/typed_array/int32array": { - "id": "Js.Typed_array.Int32Array", - "name": "Int32Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Int32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Int32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int32Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Int32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Int32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Int32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Int32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Int32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Int32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Int32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.create", - "kind": "value", - "name": "create", - "docstrings": [], - "signature": "let create: array => t", - "deprecated": "use `make` instead" - }, - { - "id": "Js.Typed_array.Int32Array.of_buffer", - "kind": "value", - "name": "of_buffer", - "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" - } - ] - }, - "js/typed_array/uint16array": { - "id": "Js.Typed_array.Uint16Array", - "name": "Uint16Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint16Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/int16array": { - "id": "Js.Typed_array.Int16Array", - "name": "Int16Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Int16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Int16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int16Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Int16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Int16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Int16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Int16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Int16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Int16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Int16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/uint8clampedarray": { - "id": "Js.Typed_array.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint8ClampedArray.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint8ClampedArray.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/uint8array": { - "id": "Js.Typed_array.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint8Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.Uint8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/int8array": { - "id": "Js.Typed_array.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Int8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Int8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int8Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Int8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Int8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Int8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Int8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Int8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Int8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Int8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "Use `TypedArray.slice` instead." - }, - { - "id": "Js.Typed_array.Int8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "Use `TypedArray.sliceToEnd` instead." - }, - { - "id": "Js.Typed_array.Int8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.Int8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "throw Js.Exn.Error throw Js exception\n\n param offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "throw Js.Exn.Error throws Js exception\n\n param offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/s": { - "id": "Js.Typed_array.S", - "name": "S", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.S.elt", - "kind": "type", - "name": "elt", - "docstrings": [], - "signature": "type elt" - }, - { - "id": "Js.Typed_array.S.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.Typed_array.S.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.S.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.S.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.S.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.S.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.S.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.S.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int" - }, - { - "id": "Js.Typed_array.S.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t" - }, - { - "id": "Js.Typed_array.S.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: elt => bool", - "deprecated": "" - }, - { - "id": "Js.Typed_array.S.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "should we use `bool` or `boolean` seems they are intechangeable here" - ], - "signature": "let filter: (elt => bool) => t" - } - ] - }, - "js/typed_array/arraybuffer": { - "id": "Js.Typed_array.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [ - "The underlying buffer that the typed arrays provide views of\n\n **see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)" - ], - "items": [ - { - "id": "Js.Typed_array.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = array_buffer" - }, - { - "id": "Js.Typed_array.ArrayBuffer.make", - "kind": "value", - "name": "make", - "docstrings": [ - "takes length. initializes elements to 0" - ], - "signature": "let make: int => t" - }, - { - "id": "Js.Typed_array.ArrayBuffer.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - } - ] - }, - "js/typed_array/type": { - "id": "Js.Typed_array.Type", - "name": "Type", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Type.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - } - ] - }, - "js/json/kind": { - "id": "Js.Json.Kind", - "name": "Kind", - "docstrings": [], - "items": [ - { - "id": "Js.Json.Kind.json", - "kind": "type", - "name": "json", - "docstrings": [], - "signature": "type json = t" - }, - { - "id": "Js.Json.Kind.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Underlying type of a JSON value" - ], - "signature": "type t<_> =\n | String: t\n | Number: t\n | Object: t>\n | Array: t>\n | Boolean: t\n | Null: t" - } - ] - }, - "js/weakmap": { - "id": "Js.WeakMap", - "name": "WeakMap", - "docstrings": [ - "Provides bindings for ES6 WeakMap", - "ES6 WeakMap API" - ], - "items": [ - { - "id": "Js.WeakMap.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v> = WeakMap.t<'k, 'v>", - "deprecated": "" - } - ] - }, - "js/map": { - "id": "Js.Map", - "name": "Map", - "docstrings": [ - "Provides bindings for ES6 Map", - "ES6 Map API" - ], - "items": [ - { - "id": "Js.Map.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v> = Map.t<'k, 'v>", - "deprecated": "" - } - ] - }, - "js/weakset": { - "id": "Js.WeakSet", - "name": "WeakSet", - "docstrings": [ - "Provides bindings for ES6 WeakSet", - "ES6 WeakSet API" - ], - "items": [ - { - "id": "Js.WeakSet.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = WeakSet.t<'a>", - "deprecated": "" - } - ] - }, - "js/set": { - "id": "Js.Set", - "name": "Set", - "docstrings": [ - "Provides bindings for ES6 Set", - "ES6 Set API" - ], - "items": [ - { - "id": "Js.Set.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = Set.t<'a>", - "deprecated": "" - } - ] - }, - "js/console": { - "id": "Js.Console", - "name": "Console", - "docstrings": [ - "Provides bindings for console" - ], - "items": [ - { - "id": "Js.Console.log", - "kind": "value", - "name": "log", - "docstrings": [], - "signature": "let log: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.log2", - "kind": "value", - "name": "log2", - "docstrings": [], - "signature": "let log2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.log3", - "kind": "value", - "name": "log3", - "docstrings": [], - "signature": "let log3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.log4", - "kind": "value", - "name": "log4", - "docstrings": [], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.logMany", - "kind": "value", - "name": "logMany", - "docstrings": [], - "signature": "let logMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info", - "kind": "value", - "name": "info", - "docstrings": [], - "signature": "let info: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info2", - "kind": "value", - "name": "info2", - "docstrings": [], - "signature": "let info2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info3", - "kind": "value", - "name": "info3", - "docstrings": [], - "signature": "let info3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info4", - "kind": "value", - "name": "info4", - "docstrings": [], - "signature": "let info4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.infoMany", - "kind": "value", - "name": "infoMany", - "docstrings": [], - "signature": "let infoMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn", - "kind": "value", - "name": "warn", - "docstrings": [], - "signature": "let warn: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn2", - "kind": "value", - "name": "warn2", - "docstrings": [], - "signature": "let warn2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn3", - "kind": "value", - "name": "warn3", - "docstrings": [], - "signature": "let warn3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn4", - "kind": "value", - "name": "warn4", - "docstrings": [], - "signature": "let warn4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warnMany", - "kind": "value", - "name": "warnMany", - "docstrings": [], - "signature": "let warnMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error", - "kind": "value", - "name": "error", - "docstrings": [], - "signature": "let error: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error2", - "kind": "value", - "name": "error2", - "docstrings": [], - "signature": "let error2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error3", - "kind": "value", - "name": "error3", - "docstrings": [], - "signature": "let error3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error4", - "kind": "value", - "name": "error4", - "docstrings": [], - "signature": "let error4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.errorMany", - "kind": "value", - "name": "errorMany", - "docstrings": [], - "signature": "let errorMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.trace", - "kind": "value", - "name": "trace", - "docstrings": [], - "signature": "let trace: unit => unit", - "deprecated": "" - }, - { - "id": "Js.Console.timeStart", - "kind": "value", - "name": "timeStart", - "docstrings": [], - "signature": "let timeStart: string => unit", - "deprecated": "" - }, - { - "id": "Js.Console.timeEnd", - "kind": "value", - "name": "timeEnd", - "docstrings": [], - "signature": "let timeEnd: string => unit", - "deprecated": "" - }, - { - "id": "Js.Console.table", - "kind": "value", - "name": "table", - "docstrings": [], - "signature": "let table: 'a => unit", - "deprecated": "" - } - ] - }, - "js/result": { - "id": "Js.Result", - "name": "Result", - "docstrings": [ - "Define the interface for result" - ], - "items": [ - { - "id": "Js.Result.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'good, 'bad> = Ok('good) | Error('bad)", - "deprecated": "" - } - ] - }, - "js/option": { - "id": "Js.Option", - "name": "Option", - "docstrings": [ - "Provide utilities for option" - ], - "items": [ - { - "id": "Js.Option.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = option<'a>", - "deprecated": "" - }, - { - "id": "Js.Option.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: 'a => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Option.isSome", - "kind": "value", - "name": "isSome", - "docstrings": [], - "signature": "let isSome: option<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Option.isSomeValue", - "kind": "value", - "name": "isSomeValue", - "docstrings": [], - "signature": "let isSomeValue: (('a, 'a) => bool, 'a, option<'a>) => bool", - "deprecated": "Use `Option.equal` instead." - }, - { - "id": "Js.Option.isNone", - "kind": "value", - "name": "isNone", - "docstrings": [], - "signature": "let isNone: option<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Option.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: option<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Option.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (('a, 'b) => bool, option<'a>, option<'b>) => bool", - "deprecated": "" - }, - { - "id": "Js.Option.andThen", - "kind": "value", - "name": "andThen", - "docstrings": [], - "signature": "let andThen: ('a => option<'b>, option<'a>) => option<'b>", - "deprecated": "" - }, - { - "id": "Js.Option.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: ('a => 'b, option<'a>) => option<'b>", - "deprecated": "" - }, - { - "id": "Js.Option.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: ('a, option<'a>) => 'a", - "deprecated": "" - }, - { - "id": "Js.Option.default", - "kind": "value", - "name": "default", - "docstrings": [], - "signature": "let default: ('a, option<'a>) => 'a", - "deprecated": "" - }, - { - "id": "Js.Option.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: ('a => bool, option<'a>) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Option.firstSome", - "kind": "value", - "name": "firstSome", - "docstrings": [], - "signature": "let firstSome: (option<'a>, option<'a>) => option<'a>", - "deprecated": "" - } - ] - }, - "js/blob": { - "id": "Js.Blob", - "name": "Blob", - "docstrings": [ - "Provide utilities for Blob", - "JavaScript Blob API" - ], - "items": [ - { - "id": "Js.Blob.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - } - ] - }, - "js/file": { - "id": "Js.File", - "name": "File", - "docstrings": [ - "Provide utilities for File", - "JavaScript File API" - ], - "items": [ - { - "id": "Js.File.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - } - ] - }, - "js/bigint": { - "id": "Js.BigInt", - "name": "BigInt", - "docstrings": [ - "Provide utilities for bigint", - "JavaScript BigInt API" - ], - "items": [ - { - "id": "Js.BigInt.fromStringExn", - "kind": "value", - "name": "fromStringExn", - "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Return the\nnumber as a `bigint` if successfully parsed. Uncaught syntax exception otherwise.\n\n## Examples\n\n```rescript\n/* returns 123n */\nJs.BigInt.fromStringExn(\"123\")\n\n/* returns 0n */\nJs.BigInt.fromStringExn(\"\")\n\n/* returns 17n */\nJs.BigInt.fromStringExn(\"0x11\")\n\n/* returns 3n */\nJs.BigInt.fromStringExn(\"0b11\")\n\n/* returns 9n */\nJs.BigInt.fromStringExn(\"0o11\")\n\n/* catch exception */\ntry {\n Js.BigInt.fromStringExn(\"a\")\n} catch {\n| _ => Console.error(\"Error parsing bigint\")\n}\n```" - ], - "signature": "let fromStringExn: string => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.~-", - "kind": "value", - "name": "~-", - "docstrings": [], - "signature": "let ~-: bigint => bigint" - }, - { - "id": "Js.BigInt.~+", - "kind": "value", - "name": "~+", - "docstrings": [], - "signature": "let ~+: bigint => bigint" - }, - { - "id": "Js.BigInt.+", - "kind": "value", - "name": "+", - "docstrings": [], - "signature": "let +: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.-", - "kind": "value", - "name": "-", - "docstrings": [], - "signature": "let -: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.*", - "kind": "value", - "name": "*", - "docstrings": [], - "signature": "let *: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt./", - "kind": "value", - "name": "/", - "docstrings": [], - "signature": "let /: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.mod", - "kind": "value", - "name": "mod", - "docstrings": [], - "signature": "let mod: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.**", - "kind": "value", - "name": "**", - "docstrings": [], - "signature": "let **: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.land", - "kind": "value", - "name": "land", - "docstrings": [], - "signature": "let land: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lor", - "kind": "value", - "name": "lor", - "docstrings": [], - "signature": "let lor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lxor", - "kind": "value", - "name": "lxor", - "docstrings": [], - "signature": "let lxor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lnot", - "kind": "value", - "name": "lnot", - "docstrings": [], - "signature": "let lnot: bigint => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lsl", - "kind": "value", - "name": "lsl", - "docstrings": [], - "signature": "let lsl: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.asr", - "kind": "value", - "name": "asr", - "docstrings": [], - "signature": "let asr: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats a `bigint` as a string. Return a `string` representing the given value.\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123\" */\nJs.BigInt.toString(123n)->Js.log\n```" - ], - "signature": "let toString: bigint => string", - "deprecated": "" - }, - { - "id": "Js.BigInt.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Returns a string with a language-sensitive representation of this BigInt value.\n\n## Examples\n\n```rescript\n/* prints \"123\" */\nJs.BigInt.toString(123n)->Js.log\n```" - ], - "signature": "let toLocaleString: bigint => string", - "deprecated": "" - } - ] - }, - "js/int": { - "id": "Js.Int", - "name": "Int", - "docstrings": [ - "Provide utilities for int", - "Provide utilities for handling `int`." - ], - "items": [ - { - "id": "Js.Int.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "Formats an `int` using exponential (scientific) notation.\nReturns a `string` representing the given value in exponential notation.\nThrows `RangeError` if digits is not in the range \\[0, 20\\] (inclusive).\n\nSee [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.7e+1\" */\nJs.log(Js.Int.toExponential(77))\n```" - ], - "signature": "let toExponential: int => string", - "deprecated": "" - }, - { - "id": "Js.Int.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "Formats an `int` using exponential (scientific) notation.\n`digits` specifies how many digits should appear after the decimal point. The value must be in the range \\[0, 20\\] (inclusive).\n\nReturns a `string` representing the given value in exponential notation.\n\nThe output will be rounded or padded with zeroes if necessary.\nThrows `RangeError` if `digits` is not in the range \\[0, 20\\] (inclusive).\n\nSee [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.70e+1\" */\nJs.log(Js.Int.toExponentialWithPrecision(77, ~digits=2))\n\n/* prints \"5.68e+3\" */\nJs.log(Js.Int.toExponentialWithPrecision(5678, ~digits=2))\n```" - ], - "signature": "let toExponentialWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Int.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "Formats an `int` using some fairly arbitrary rules.\nReturns a `string` representing the given value in fixed-point (usually).\n\n`toPrecision` differs from `toFixed` in that the former will format the number with full precision, while the latter will not output any digits after the decimal point.\nThrows `RangeError` if `digits` is not in the range accepted by this function.\n\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123456789\" */\nJs.log(Js.Int.toPrecision(123456789))\n```" - ], - "signature": "let toPrecision: int => string", - "deprecated": "" - }, - { - "id": "Js.Int.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "Formats an `int` using some fairly arbitrary rules.\n`digits` specifies how many digits should appear in total. The value must between 0 and some arbitrary number that's hopefully at least larger than 20 (for Node it's 21. Why? Who knows).\n\nReturns a `string` representing the given value in fixed-point or scientific notation.\n\nThe output will be rounded or padded with zeroes if necessary.\n\n`toPrecisionWithPrecision` differs from `toFixedWithPrecision` in that the former will count all digits against the precision, while the latter will count only the digits after the decimal point.\n`toPrecisionWithPrecision` will also use scientific notation if the specified precision is less than the number of digits before the decimal point.\nThrows `RangeError` if `digits` is not in the range accepted by this function.\n\n\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"1.2e+8\" */\nJs.log(Js.Int.toPrecisionWithPrecision(123456789, ~digits=2))\n\n/* prints \"0.0\" */\nJs.log(Js.Int.toPrecisionWithPrecision(0, ~digits=2))\n```" - ], - "signature": "let toPrecisionWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Int.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats an `int` as a `string`. Returns a `string` representing the given value\nin fixed-point (usually).\n\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123456789\" */\nJs.log(Js.Int.toString(123456789))\n```" - ], - "signature": "let toString: int => string", - "deprecated": "" - }, - { - "id": "Js.Int.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "Formats an `int` as a `string`. `radix` specifies the radix base to use for the\nformatted number. The value must be in the range \\[2, 36\\] (inclusive). Returns\na `string` representing the given value in fixed-point (usually). Throws\n`RangeError` if `radix` is not in the range \\[2, 36\\] (inclusive).\n\n\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"110\" */\nJs.log(Js.Int.toStringWithRadix(6, ~radix=2))\n\n/* prints \"deadbeef\" */\nJs.log(Js.Int.toStringWithRadix(3735928559, ~radix=16))\n\n/* prints \"2n9c\" */\nJs.log(Js.Int.toStringWithRadix(123456, ~radix=36))\n```" - ], - "signature": "let toStringWithRadix: (int, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Js.Int.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [], - "signature": "let toFloat: int => float", - "deprecated": "" - }, - { - "id": "Js.Int.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (int, int) => bool", - "deprecated": "" - }, - { - "id": "Js.Int.max", - "kind": "value", - "name": "max", - "docstrings": [], - "signature": "let max: int" - }, - { - "id": "Js.Int.min", - "kind": "value", - "name": "min", - "docstrings": [], - "signature": "let min: int" - } - ] - }, - "js/float": { - "id": "Js.Float", - "name": "Float", - "docstrings": [ - "Provide utilities for JS float", - "Provide utilities for JS float." - ], - "items": [ - { - "id": "Js.Float._NaN", - "kind": "value", - "name": "_NaN", - "docstrings": [ - "The special value \"Not a Number\". See [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN) on MDN." - ], - "signature": "let _NaN: float", - "deprecated": "" - }, - { - "id": "Js.Float.isNaN", - "kind": "value", - "name": "isNaN", - "docstrings": [ - "Tests if the given value is `_NaN`\n\nNote that both `_NaN = _NaN` and `_NaN == _NaN` will return `false`. `isNaN` is\ntherefore necessary to test for `_NaN`. Return `true` if the given value is\n`_NaN`, `false` otherwise. See [`isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) on MDN." - ], - "signature": "let isNaN: float => bool", - "deprecated": "" - }, - { - "id": "Js.Float.isFinite", - "kind": "value", - "name": "isFinite", - "docstrings": [ - "Tests if the given value is finite. Return `true` if the given value is a finite\nnumber, `false` otherwise. See [`isFinite`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite) on MDN.\n\n## Examples\n\n```rescript\n/* returns [false] */\nJs.Float.isFinite(infinity)\n\n/* returns [false] */\nJs.Float.isFinite(neg_infinity)\n\n/* returns [false] */\nJs.Float.isFinite(Js.Float._NaN)\n\n/* returns [true] */\nJs.Float.isFinite(1234.)\n```" - ], - "signature": "let isFinite: float => bool", - "deprecated": "" - }, - { - "id": "Js.Float.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "Formats a `float` using exponential (scientific) notation. Return a\n`string` representing the given value in exponential notation. Throw\nRangeError if digits is not in the range \\[0, 20\\] (inclusive). See [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.71234e+1\" */\nJs.Float.toExponential(77.1234)->Js.log\n\n/* prints \"7.7e+1\" */\nJs.Float.toExponential(77.)->Js.log\n```" - ], - "signature": "let toExponential: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "Formats a `float` using exponential (scientific) notation. `digits` specifies\nhow many digits should appear after the decimal point. The value must be in\nthe range \\[0, 20\\] (inclusive). Return a `string` representing the given value\nin exponential notation. The output will be rounded or padded with zeroes if\nnecessary. Throw RangeError if `digits` is not in the range \\[0, 20\\] (inclusive).\nSee [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.71e+1\" */\nJs.Float.toExponentialWithPrecision(77.1234, ~digits=2)->Js.log\n```" - ], - "signature": "let toExponentialWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.toFixed", - "kind": "value", - "name": "toFixed", - "docstrings": [ - "Formats a `float` using fixed point notation. Return a `string` representing the\ngiven value in fixed-point notation (usually). Throw RangeError if digits is not\nin the range \\[0, 20\\] (inclusive). See [`toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"12346\" (note the rounding) */\nJs.Float.toFixed(12345.6789)->Js.log\n\n/* print \"1.2e+21\" */\nJs.Float.toFixed(1.2e21)->Js.log\n```" - ], - "signature": "let toFixed: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toFixedWithPrecision", - "kind": "value", - "name": "toFixedWithPrecision", - "docstrings": [ - "Formats a `float` using fixed point notation. `digits` specifies how many digits\nshould appear after the decimal point. The value must be in the range \\[0, 20\\]\n(inclusive). Defaults to `0`. Return a `string` representing the given value in\nfixed-point notation (usually). See [`toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\nThe output will be rounded or padded with zeroes if necessary.\n\nThrow RangeError if digits is not in the range \\[0, 20\\] (inclusive)\n\n## Examples\n\n```rescript\n/* prints \"12345.7\" (note the rounding) */\nJs.Float.toFixedWithPrecision(12345.6789, ~digits=1)->Js.log\n\n/* prints \"0.00\" (note the added zeroes) */\nJs.Float.toFixedWithPrecision(0., ~digits=2)->Js.log\n```" - ], - "signature": "let toFixedWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "Formats a `float` using some fairly arbitrary rules. Return a `string`\nrepresenting the given value in fixed-point (usually). `toPrecision` differs\nfrom `Js.Float.toFixed` in that the former will format the number with full\nprecision, while the latter will not output any digits after the decimal point.\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\nThrow RangeError if digits is not in the range accepted by this function (what do you mean \"vague\"?)\n\n## Examples\n\n```rescript\n/* prints \"12345.6789\" */\nJs.Float.toPrecision(12345.6789)->Js.log\n\n/* print \"1.2e+21\" */\nJs.Float.toPrecision(1.2e21)->Js.log\n```" - ], - "signature": "let toPrecision: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "Formats a `float` using some fairly arbitrary rules. `digits` specifies how many\ndigits should appear in total. The value must between 0 and some arbitrary number\nthat's hopefully at least larger than 20 (for Node it's 21. Why? Who knows).\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\nReturn a `string` representing the given value in fixed-point or scientific\nnotation. The output will be rounded or padded with zeroes if necessary.\n\n`toPrecisionWithPrecision` differs from `toFixedWithPrecision` in that the former\nwill count all digits against the precision, while the latter will count only\nthe digits after the decimal point. `toPrecisionWithPrecision` will also use\nscientific notation if the specified precision is less than the number for digits\nbefore the decimal point.\n\nThrow RangeError if digits is not in the range accepted by this function (what do you mean \"vague\"?)\n\n## Examples\n\n```rescript\n/* prints \"1e+4\" */\nJs.Float.toPrecisionWithPrecision(12345.6789, ~digits=1)->Js.log\n\n/* prints \"0.0\" */\nJs.Float.toPrecisionWithPrecision(0., ~digits=2)->Js.log\n```" - ], - "signature": "let toPrecisionWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats a `float` as a string. Return a `string` representing the given value in\nfixed-point (usually). See [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"12345.6789\" */\nJs.Float.toString(12345.6789)->Js.log\n```" - ], - "signature": "let toString: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "Formats a `float` as a string. `radix` specifies the radix base to use for the\nformatted number. The value must be in the range \\[2, 36\\] (inclusive). Return a\n`string` representing the given value in fixed-point (usually). See [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\nThrow RangeError if radix is not in the range \\[2, 36\\] (inclusive)\n\n## Examples\n\n```rescript\n/* prints \"110\" */\nJs.Float.toStringWithRadix(6., ~radix=2)->Js.log\n\n/* prints \"11.001000111101011100001010001111010111000010100011111\" */\nJs.Float.toStringWithRadix(3.14, ~radix=2)->Js.log\n\n/* prints \"deadbeef\" */\nJs.Float.toStringWithRadix(3735928559., ~radix=16)->Js.log\n\n/* prints \"3f.gez4w97ry0a18ymf6qadcxr\" */\nJs.Float.toStringWithRadix(123.456, ~radix=36)->Js.log\n```" - ], - "signature": "let toStringWithRadix: (float, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Parses the given `string` into a `float` using JavaScript semantics. Return the\nnumber as a `float` if successfully parsed, `_NaN` otherwise.\n\n## Examples\n\n```rescript\n/* returns 123 */\nJs.Float.fromString(\"123\")\n\n/* returns 12.3 */\nJs.Float.fromString(\"12.3\")\n\n/* returns 0 */\nJs.Float.fromString(\"\")\n\n/* returns 17 */\nJs.Float.fromString(\"0x11\")\n\n/* returns 3 */\nJs.Float.fromString(\"0b11\")\n\n/* returns 9 */\nJs.Float.fromString(\"0o11\")\n\n/* returns [_NaN] */\nJs.Float.fromString(\"hello\")\n\n/* returns [_NaN] */\nJs.Float.fromString(\"100a\")\n```" - ], - "signature": "let fromString: string => float", - "deprecated": "" - } - ] - }, - "js/types": { - "id": "Js.Types", - "name": "Types", - "docstrings": [ - "Provide utilities for manipulating JS types", - "Provide utilities for manipulating JS types." - ], - "items": [ - { - "id": "Js.Types.symbol", - "kind": "type", - "name": "symbol", - "docstrings": [ - "Js symbol type (only available in ES6)" - ], - "signature": "type symbol = Symbol.t", - "deprecated": "" - }, - { - "id": "Js.Types.obj_val", - "kind": "type", - "name": "obj_val", - "docstrings": [], - "signature": "type obj_val = \\\"Type.Classify\".object", - "deprecated": "" - }, - { - "id": "Js.Types.undefined_val", - "kind": "type", - "name": "undefined_val", - "docstrings": [ - "This type has only one value `undefined`" - ], - "signature": "type undefined_val", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.null_val", - "kind": "type", - "name": "null_val", - "docstrings": [ - "This type has only one value `null`" - ], - "signature": "type null_val", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.function_val", - "kind": "type", - "name": "function_val", - "docstrings": [], - "signature": "type function_val = \\\"Type.Classify\".function", - "deprecated": "" - }, - { - "id": "Js.Types.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<_> =\n | Undefined: t\n | Null: t\n | Boolean: t\n | Number: t\n | String: t\n | Function: t\n | Object: t\n | Symbol: t\n | BigInt: t", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.test", - "kind": "value", - "name": "test", - "docstrings": [ - "`test(value, t)` returns `true` if `value` is `typeof t`, otherwise `false`.\nThis is useful for doing runtime reflection on any given value.\n\n## Examples\n\n```rescript\ntest(\"test\", String) == true\ntest(() => true, Function) == true\ntest(\"test\", Boolean) == false\n```" - ], - "signature": "let test: ('a, t<'b>) => bool", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.tagged_t", - "kind": "type", - "name": "tagged_t", - "docstrings": [], - "signature": "type tagged_t =\n | JSFalse\n | JSTrue\n | JSNull\n | JSUndefined\n | JSNumber(float)\n | JSString(string)\n | JSFunction(function_val)\n | JSObject(obj_val)\n | JSSymbol(symbol)\n | JSBigInt(bigint)", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.classify", - "kind": "value", - "name": "classify", - "docstrings": [], - "signature": "let classify: 'a => tagged_t", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - } - ] - }, - "js/typedarray2": { - "id": "Js.TypedArray2", - "name": "TypedArray2", - "docstrings": [ - "Provide bindings for JS typed array", - "JavaScript Typed Array API\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)" - ], - "items": [ - { - "id": "Js.TypedArray2.array_buffer", - "kind": "type", - "name": "array_buffer", - "docstrings": [], - "signature": "type array_buffer = ArrayBuffer.t" - }, - { - "id": "Js.TypedArray2.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [], - "signature": "type array_like<'a>" - } - ] - }, - "js/typed_array": { - "id": "Js.Typed_array", - "name": "Typed_array", - "docstrings": [ - "Provide bindings for JS typed array", - "JavaScript Typed Array API\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)" - ], - "items": [ - { - "id": "Js.Typed_array.array_buffer", - "kind": "type", - "name": "array_buffer", - "docstrings": [], - "signature": "type array_buffer = Js_typed_array2.array_buffer", - "deprecated": "" - }, - { - "id": "Js.Typed_array.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [], - "signature": "type array_like<'a> = Js_typed_array2.array_like<'a>", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `TypedArray` module instead." - } - ] - }, - "js/obj": { - "id": "Js.Obj", - "name": "Obj", - "docstrings": [ - "Provide utilities for `Js.t`", - "Provides functions for inspecting and manipulating native JavaScript objects" - ], - "items": [ - { - "id": "Js.Obj.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "`empty()` returns the empty object `{}`" - ], - "signature": "let empty: unit => {..}", - "deprecated": "" - }, - { - "id": "Js.Obj.assign", - "kind": "value", - "name": "assign", - "docstrings": [ - "`assign(target, source)` copies properties from source to target.\nProperties in `target` will be overwritten by properties in `source` if they have the same key.\nReturns `target`.\n\n**See** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\n\n## Examples\n\n```rescript\n/* Copy an object */\n\nlet obj = {\"a\": 1}\n\nlet copy = Js.Obj.assign(Js.Obj.empty(), obj)\n\n/* prints \"{ a: 1 }\" */\nJs.log(copy)\n\n/* Merge objects with same properties */\n\nlet target = {\"a\": 1, \"b\": 1}\nlet source = {\"b\": 2}\n\nlet obj = Js.Obj.assign(target, source)\n\n/* prints \"{ a: 1, b: 2 }\" */\nJs.log(obj)\n\n/* prints \"{ a: 1, b: 2 }\", target is modified */\nJs.log(target)\n```" - ], - "signature": "let assign: ({..}, {..}) => {..}", - "deprecated": "" - }, - { - "id": "Js.Obj.keys", - "kind": "value", - "name": "keys", - "docstrings": [ - "`keys(obj)` returns an `array` of the keys of `obj`'s own enumerable properties." - ], - "signature": "let keys: {..} => array", - "deprecated": "" - } - ] - }, - "js/math": { - "id": "Js.Math", - "name": "Math", - "docstrings": [ - "Provide bindings for JS `Math` object", - "Provide utilities for JS Math. Note: The constants `_E`, `_LN10`, `_LN2`,\n`_LOG10E`, `_LOG2E`, `_PI`, `_SQRT1_2`, and `_SQRT2` begin with an underscore\nbecause ReScript variable names cannot begin with a capital letter. (Module\nnames begin with upper case.)" - ], - "items": [ - { - "id": "Js.Math._E", - "kind": "value", - "name": "_E", - "docstrings": [ - "Euler's number; ≈ 2.718281828459045. See\n[`Math.E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/E)\non MDN." - ], - "signature": "let _E: float", - "deprecated": "" - }, - { - "id": "Js.Math._LN2", - "kind": "value", - "name": "_LN2", - "docstrings": [ - "Natural logarithm of 2; ≈ 0.6931471805599453. See\n[`Math.LN2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN2)\non MDN." - ], - "signature": "let _LN2: float", - "deprecated": "" - }, - { - "id": "Js.Math._LN10", - "kind": "value", - "name": "_LN10", - "docstrings": [ - "Natural logarithm of 10; ≈ 2.302585092994046. See\n[`Math.LN10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN10)\non MDN." - ], - "signature": "let _LN10: float", - "deprecated": "" - }, - { - "id": "Js.Math._LOG2E", - "kind": "value", - "name": "_LOG2E", - "docstrings": [ - "Base 2 logarithm of E; ≈ 1.4426950408889634. See\n[`Math.LOG2E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG2E)\non MDN." - ], - "signature": "let _LOG2E: float", - "deprecated": "" - }, - { - "id": "Js.Math._LOG10E", - "kind": "value", - "name": "_LOG10E", - "docstrings": [ - "Base 10 logarithm of E; ≈ 0.4342944819032518. See\n[`Math.LOG10E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG10E)\non MDN." - ], - "signature": "let _LOG10E: float", - "deprecated": "" - }, - { - "id": "Js.Math._PI", - "kind": "value", - "name": "_PI", - "docstrings": [ - "Pi - ratio of the circumference to the diameter of a circle; ≈ 3.141592653589793. See\n[`Math.PI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/PI)\non MDN." - ], - "signature": "let _PI: float", - "deprecated": "" - }, - { - "id": "Js.Math._SQRT1_2", - "kind": "value", - "name": "_SQRT1_2", - "docstrings": [ - "Square root of 1/2; ≈ 0.7071067811865476. See\n[`Math.SQRT1_2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2)\non MDN." - ], - "signature": "let _SQRT1_2: float", - "deprecated": "" - }, - { - "id": "Js.Math._SQRT2", - "kind": "value", - "name": "_SQRT2", - "docstrings": [ - "Square root of 2; ≈ 1.4142135623730951. See\n[`Math.SQRT2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT2)\non MDN." - ], - "signature": "let _SQRT2: float", - "deprecated": "" - }, - { - "id": "Js.Math.abs_int", - "kind": "value", - "name": "abs_int", - "docstrings": [ - "Absolute value for integer argument. See\n[`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs)\non MDN." - ], - "signature": "let abs_int: int => int", - "deprecated": "" - }, - { - "id": "Js.Math.abs_float", - "kind": "value", - "name": "abs_float", - "docstrings": [ - "Absolute value for float argument. See\n[`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs)\non MDN." - ], - "signature": "let abs_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.acos", - "kind": "value", - "name": "acos", - "docstrings": [ - "Arccosine (in radians) of argument; returns `NaN` if the argument is outside\nthe range [-1.0, 1.0]. See\n[`Math.acos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acos)\non MDN." - ], - "signature": "let acos: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.acosh", - "kind": "value", - "name": "acosh", - "docstrings": [ - "Hyperbolic arccosine (in radians) of argument; returns `NaN` if the argument\nis less than 1.0. See\n[`Math.acosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acosh)\non MDN." - ], - "signature": "let acosh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.asin", - "kind": "value", - "name": "asin", - "docstrings": [ - "Arcsine (in radians) of argument; returns `NaN` if the argument is outside\nthe range [-1.0, 1.0]. See\n[`Math.asin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asin)\non MDN." - ], - "signature": "let asin: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.asinh", - "kind": "value", - "name": "asinh", - "docstrings": [ - "Hyperbolic arcsine (in radians) of argument. See\n[`Math.asinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh)\non MDN." - ], - "signature": "let asinh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.atan", - "kind": "value", - "name": "atan", - "docstrings": [ - "Arctangent (in radians) of argument. See\n[`Math.atan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan)\non MDN." - ], - "signature": "let atan: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.atanh", - "kind": "value", - "name": "atanh", - "docstrings": [ - "Hyperbolic arctangent (in radians) of argument; returns `NaN` if the argument\nis is outside the range [-1.0, 1.0]. Returns `-Infinity` and `Infinity` for\narguments -1.0 and 1.0. See\n[`Math.atanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh)\non MDN." - ], - "signature": "let atanh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.atan2", - "kind": "value", - "name": "atan2", - "docstrings": [ - "Returns the angle (in radians) of the quotient `y /. x`. It is also the angle\nbetween the *x*\\-axis and point (*x*, *y*). See\n[`Math.atan2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.atan2(~y=0.0, ~x=10.0, ()) == 0.0\nJs.Math.atan2(~x=5.0, ~y=5.0, ()) == Js.Math._PI /. 4.0\nJs.Math.atan2(~x=-5.0, ~y=5.0, ())\nJs.Math.atan2(~x=-5.0, ~y=5.0, ()) == 3.0 *. Js.Math._PI /. 4.0\nJs.Math.atan2(~x=-0.0, ~y=-5.0, ()) == -.Js.Math._PI /. 2.0\n```" - ], - "signature": "let atan2: (~y: float, ~x: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Math.cbrt", - "kind": "value", - "name": "cbrt", - "docstrings": [ - "Cube root. See\n[`Math.cbrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt)\non MDN" - ], - "signature": "let cbrt: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_ceil_int", - "kind": "value", - "name": "unsafe_ceil_int", - "docstrings": [ - "Returns the smallest integer greater than or equal to the argument. This\nfunction may return values not representable by `int`, whose range is\n\\-2147483648 to 2147483647. This is because, in JavaScript, there are only\n64-bit floating point numbers, which can represent integers in the range\n±(253\\-1) exactly. See\n[`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.unsafe_ceil_int(3.1) == 4\nJs.Math.unsafe_ceil_int(3.0) == 3\nJs.Math.unsafe_ceil_int(-3.1) == -3\nJs.Math.unsafe_ceil_int(1.0e15) // result is outside range of int datatype\n```" - ], - "signature": "let unsafe_ceil_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_ceil", - "kind": "value", - "name": "unsafe_ceil", - "docstrings": [], - "signature": "let unsafe_ceil: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.ceil_int", - "kind": "value", - "name": "ceil_int", - "docstrings": [ - "Returns the smallest `int` greater than or equal to the argument; the result\nis pinned to the range of the `int` data type: -2147483648 to 2147483647. See\n[`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.ceil_int(3.1) == 4\nJs.Math.ceil_int(3.0) == 3\nJs.Math.ceil_int(-3.1) == -3\nJs.Math.ceil_int(-1.0e15) == -2147483648\nJs.Math.ceil_int(1.0e15) == 2147483647\n```" - ], - "signature": "let ceil_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.ceil", - "kind": "value", - "name": "ceil", - "docstrings": [], - "signature": "let ceil: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.ceil_float", - "kind": "value", - "name": "ceil_float", - "docstrings": [ - "Returns the smallest integral value greater than or equal to the argument.\nThe result is a `float` and is not restricted to the `int` data type range.\nSee\n[`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.ceil_float(3.1) == 4.0\nJs.Math.ceil_float(3.0) == 3.0\nJs.Math.ceil_float(-3.1) == -3.0\nJs.Math.ceil_float(2_150_000_000.3) == 2_150_000_001.0\n```" - ], - "signature": "let ceil_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.clz32", - "kind": "value", - "name": "clz32", - "docstrings": [ - "Number of leading zero bits of the argument's 32 bit int representation. See\n[`Math.clz32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.clz32(0) == 32\nJs.Math.clz32(-1) == 0\nJs.Math.clz32(255) == 24\n```" - ], - "signature": "let clz32: int => int", - "deprecated": "" - }, - { - "id": "Js.Math.cos", - "kind": "value", - "name": "cos", - "docstrings": [ - "Cosine of argument, which must be specified in radians. See\n[`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos)\non MDN." - ], - "signature": "let cos: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.cosh", - "kind": "value", - "name": "cosh", - "docstrings": [ - "Hyperbolic cosine of argument, which must be specified in radians. See\n[`Math.cosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh)\non MDN." - ], - "signature": "let cosh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.exp", - "kind": "value", - "name": "exp", - "docstrings": [ - "Natural exponentional; returns *e* (the base of natural logarithms) to the\npower of the given argument. See\n[`Math.exp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/exp)\non MDN." - ], - "signature": "let exp: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.expm1", - "kind": "value", - "name": "expm1", - "docstrings": [ - "Returns *e* (the base of natural logarithms) to the power of the given\nargument minus 1. See\n[`Math.expm1`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1)\non MDN." - ], - "signature": "let expm1: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_floor_int", - "kind": "value", - "name": "unsafe_floor_int", - "docstrings": [ - "Returns the largest integer less than or equal to the argument. This function\nmay return values not representable by `int`, whose range is -2147483648 to\n2147483647. This is because, in JavaScript, there are only 64-bit floating\npoint numbers, which can represent integers in the range\n±(253\\-1) exactly. See\n[`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.unsafe_floor_int(3.7) == 3\nJs.Math.unsafe_floor_int(3.0) == 3\nJs.Math.unsafe_floor_int(-3.7) == -4\nJs.Math.unsafe_floor_int(1.0e15) // result is outside range of int datatype\n```" - ], - "signature": "let unsafe_floor_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_floor", - "kind": "value", - "name": "unsafe_floor", - "docstrings": [], - "signature": "let unsafe_floor: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.floor_int", - "kind": "value", - "name": "floor_int", - "docstrings": [ - "Returns the largest `int` less than or equal to the argument; the result is\npinned to the range of the `int` data type: -2147483648 to 2147483647. See\n[`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.floor_int(3.7) == 3\nJs.Math.floor_int(3.0) == 3\nJs.Math.floor_int(-3.1) == -4\nJs.Math.floor_int(-1.0e15) == -2147483648\nJs.Math.floor_int(1.0e15) == 2147483647\n```" - ], - "signature": "let floor_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.floor", - "kind": "value", - "name": "floor", - "docstrings": [], - "signature": "let floor: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.floor_float", - "kind": "value", - "name": "floor_float", - "docstrings": [ - "Returns the largest integral value less than or equal to the argument. The\nresult is a `float` and is not restricted to the `int` data type range. See\n[`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.floor_float(3.7) == 3.0\nJs.Math.floor_float(3.0) == 3.0\nJs.Math.floor_float(-3.1) == -4.0\nJs.Math.floor_float(2_150_000_000.3) == 2_150_000_000.0\n```" - ], - "signature": "let floor_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.fround", - "kind": "value", - "name": "fround", - "docstrings": [ - "Round to nearest single precision float. See\n[`Math.fround`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.fround(5.5) == 5.5\nJs.Math.fround(5.05) == 5.050000190734863\n```" - ], - "signature": "let fround: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.hypot", - "kind": "value", - "name": "hypot", - "docstrings": [ - "Returns the square root of the sum of squares of its two arguments (the\nPythagorean formula). See\n[`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot)\non MDN." - ], - "signature": "let hypot: (float, float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.hypotMany", - "kind": "value", - "name": "hypotMany", - "docstrings": [ - "Returns the square root of the sum of squares of the numbers in the array\nargument (generalized Pythagorean equation). Using an array allows you to\nhave more than two items. See\n[`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.hypotMany([3.0, 4.0, 12.0]) == 13.0\n```" - ], - "signature": "let hypotMany: array => float", - "deprecated": "" - }, - { - "id": "Js.Math.imul", - "kind": "value", - "name": "imul", - "docstrings": [ - "32-bit integer multiplication. Use this only when you need to optimize\nperformance of multiplication of numbers stored as 32-bit integers. See\n[`Math.imul`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul)\non MDN." - ], - "signature": "let imul: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.log", - "kind": "value", - "name": "log", - "docstrings": [ - "Returns the natural logarithm of its argument; this is the number *x* such\nthat *e**x* equals the argument. Returns `NaN` for negative\narguments. See\n[`Math.log`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log(Js.Math._E) == 1.0\nJs.Math.log(100.0) == 4.605170185988092\n```" - ], - "signature": "let log: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.log1p", - "kind": "value", - "name": "log1p", - "docstrings": [ - "Returns the natural logarithm of one plus the argument. Returns `NaN` for\narguments less than -1. See\n[`Math.log1p`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log1p)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log1p(Js.Math._E -. 1.0) == 1.0\nJs.Math.log1p(99.0) == 4.605170185988092\n```" - ], - "signature": "let log1p: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.log10", - "kind": "value", - "name": "log10", - "docstrings": [ - "Returns the base 10 logarithm of its argument. Returns `NaN` for negative\narguments. See\n[`Math.log10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log10)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log10(1000.0) == 3.0\nJs.Math.log10(0.01) == -2.0\nJs.Math.log10(Js.Math.sqrt(10.0)) == 0.5\n```" - ], - "signature": "let log10: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.log2", - "kind": "value", - "name": "log2", - "docstrings": [ - "Returns the base 2 logarithm of its argument. Returns `NaN` for negative\narguments. See\n[`Math.log2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log2(512.0) == 9.0\nJs.Math.log2(0.125) == -3.0\nJs.Math.log2(Js.Math._SQRT2) == 0.5000000000000001 // due to precision\n```" - ], - "signature": "let log2: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.max_int", - "kind": "value", - "name": "max_int", - "docstrings": [ - "Returns the maximum of its two integer arguments. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let max_int: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.maxMany_int", - "kind": "value", - "name": "maxMany_int", - "docstrings": [ - "Returns the maximum of the integers in the given array. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let maxMany_int: array => int", - "deprecated": "" - }, - { - "id": "Js.Math.max_float", - "kind": "value", - "name": "max_float", - "docstrings": [ - "Returns the maximum of its two floating point arguments. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let max_float: (float, float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.maxMany_float", - "kind": "value", - "name": "maxMany_float", - "docstrings": [ - "Returns the maximum of the floating point values in the given array. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let maxMany_float: array => float", - "deprecated": "" - }, - { - "id": "Js.Math.min_int", - "kind": "value", - "name": "min_int", - "docstrings": [ - "Returns the minimum of its two integer arguments. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let min_int: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.minMany_int", - "kind": "value", - "name": "minMany_int", - "docstrings": [ - "Returns the minimum of the integers in the given array. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let minMany_int: array => int", - "deprecated": "" - }, - { - "id": "Js.Math.min_float", - "kind": "value", - "name": "min_float", - "docstrings": [ - "Returns the minimum of its two floating point arguments. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let min_float: (float, float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.minMany_float", - "kind": "value", - "name": "minMany_float", - "docstrings": [ - "Returns the minimum of the floating point values in the given array. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let minMany_float: array => float", - "deprecated": "" - }, - { - "id": "Js.Math.pow_int", - "kind": "value", - "name": "pow_int", - "docstrings": [ - "Throws the given base to the given exponent. (Arguments and result are\nintegers.) See\n[`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.pow_int(~base=3, ~exp=4) == 81\n```" - ], - "signature": "let pow_int: (~base: int, ~exp: int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.pow_float", - "kind": "value", - "name": "pow_float", - "docstrings": [ - "Throws the given base to the given exponent. (Arguments and result are\nfloats.) Returns `NaN` if the result would be imaginary. See\n[`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.pow_float(~base=3.0, ~exp=4.0) == 81.0\nJs.Math.pow_float(~base=4.0, ~exp=-2.0) == 0.0625\nJs.Math.pow_float(~base=625.0, ~exp=0.5) == 25.0\nJs.Math.pow_float(~base=625.0, ~exp=-0.5) == 0.04\nJs.Float.isNaN(Js.Math.pow_float(~base=-2.0, ~exp=0.5)) == true\n```" - ], - "signature": "let pow_float: (~base: float, ~exp: float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.random", - "kind": "value", - "name": "random", - "docstrings": [ - "Returns a random number in the half-closed interval [0,1). See\n[`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\non MDN." - ], - "signature": "let random: unit => float", - "deprecated": "" - }, - { - "id": "Js.Math.random_int", - "kind": "value", - "name": "random_int", - "docstrings": [ - "A call to `random_int(minVal, maxVal)` returns a random number in the\nhalf-closed interval [minVal, maxVal). See\n[`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\non MDN." - ], - "signature": "let random_int: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_round", - "kind": "value", - "name": "unsafe_round", - "docstrings": [ - "Rounds its argument to nearest integer. For numbers with a fractional portion\nof exactly 0.5, the argument is rounded to the next integer in the direction\nof positive infinity. This function may return values not representable by\n`int`, whose range is -2147483648 to 2147483647. This is because, in\nJavaScript, there are only 64-bit floating point numbers, which can represent\nintegers in the range ±(253\\-1) exactly. See\n[`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.unsafe_round(3.7) == 4\nJs.Math.unsafe_round(-3.5) == -3\nJs.Math.unsafe_round(2_150_000_000_000.3) // out of range for int\n```" - ], - "signature": "let unsafe_round: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.round", - "kind": "value", - "name": "round", - "docstrings": [ - "Rounds to nearest integral value (expressed as a float). See\n[`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round)\non MDN." - ], - "signature": "let round: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sign_int", - "kind": "value", - "name": "sign_int", - "docstrings": [ - "Returns the sign of its integer argument: -1 if negative, 0 if zero, 1 if\npositive. See\n[`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign)\non MDN." - ], - "signature": "let sign_int: int => int", - "deprecated": "" - }, - { - "id": "Js.Math.sign_float", - "kind": "value", - "name": "sign_float", - "docstrings": [ - "Returns the sign of its float argument: -1.0 if negative, 0.0 if zero, 1.0 if\npositive. See\n[`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign)\non MDN." - ], - "signature": "let sign_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sin", - "kind": "value", - "name": "sin", - "docstrings": [ - "Sine of argument, which must be specified in radians. See\n[`Math.sin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin)\non MDN." - ], - "signature": "let sin: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sinh", - "kind": "value", - "name": "sinh", - "docstrings": [ - "Hyperbolic sine of argument, which must be specified in radians. See\n[`Math.sinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sinh)\non MDN." - ], - "signature": "let sinh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sqrt", - "kind": "value", - "name": "sqrt", - "docstrings": [ - "Square root. If the argument is negative, this function returns `NaN`. See\n[`Math.sqrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt)\non MDN." - ], - "signature": "let sqrt: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.tan", - "kind": "value", - "name": "tan", - "docstrings": [ - "Tangent of argument, which must be specified in radians. Returns `NaN` if the\nargument is positive infinity or negative infinity. See\n[`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos)\non MDN." - ], - "signature": "let tan: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.tanh", - "kind": "value", - "name": "tanh", - "docstrings": [ - "Hyperbolic tangent of argument, which must be specified in radians. See\n[`Math.tanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tanh)\non MDN." - ], - "signature": "let tanh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_trunc", - "kind": "value", - "name": "unsafe_trunc", - "docstrings": [ - "Truncates its argument; i.e., removes fractional digits. This function may\nreturn values not representable by `int`, whose range is -2147483648 to\n2147483647. This is because, in JavaScript, there are only 64-bit floating\npoint numbers, which can represent integers in the range ±(253-1)\nexactly. See\n[`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc)\non MDN." - ], - "signature": "let unsafe_trunc: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.trunc", - "kind": "value", - "name": "trunc", - "docstrings": [ - "Truncates its argument; i.e., removes fractional digits. See\n[`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc)\non MDN." - ], - "signature": "let trunc: float => float", - "deprecated": "" - } - ] - }, - "js/json": { - "id": "Js.Json", - "name": "Json", - "docstrings": [ - "Provide utilities for json", - "Efficient JSON encoding using JavaScript API\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON)" - ], - "items": [ - { - "id": "Js.Json.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The JSON data structure" - ], - "signature": "@unboxed\ntype t = JSON.t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)", - "deprecated": "" - }, - { - "id": "Js.Json.tagged_t", - "kind": "type", - "name": "tagged_t", - "docstrings": [], - "signature": "type tagged_t =\n | JSONFalse\n | JSONTrue\n | JSONNull\n | JSONString(string)\n | JSONNumber(float)\n | JSONObject(dict)\n | JSONArray(array)", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.classify", - "kind": "value", - "name": "classify", - "docstrings": [], - "signature": "let classify: t => tagged_t", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.test", - "kind": "value", - "name": "test", - "docstrings": [ - "`test(v, kind)` returns `true` if `v` is of `kind`." - ], - "signature": "let test: ('a, Kind.t<'b>) => bool", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.decodeString", - "kind": "value", - "name": "decodeString", - "docstrings": [ - "`decodeString(json)` returns `Some(s)` if `json` is a `string`, `None` otherwise." - ], - "signature": "let decodeString: t => option", - "deprecated": "" - }, - { - "id": "Js.Json.decodeNumber", - "kind": "value", - "name": "decodeNumber", - "docstrings": [ - "`decodeNumber(json)` returns `Some(n)` if `json` is a `number`, `None` otherwise." - ], - "signature": "let decodeNumber: t => option", - "deprecated": "" - }, - { - "id": "Js.Json.decodeObject", - "kind": "value", - "name": "decodeObject", - "docstrings": [ - "`decodeObject(json)` returns `Some(o)` if `json` is an `object`, `None` otherwise." - ], - "signature": "let decodeObject: t => option>", - "deprecated": "" - }, - { - "id": "Js.Json.decodeArray", - "kind": "value", - "name": "decodeArray", - "docstrings": [ - "`decodeArray(json)` returns `Some(a)` if `json` is an `array`, `None` otherwise." - ], - "signature": "let decodeArray: t => option>", - "deprecated": "" - }, - { - "id": "Js.Json.decodeBoolean", - "kind": "value", - "name": "decodeBoolean", - "docstrings": [ - "`decodeBoolean(json)` returns `Some(b)` if `json` is a `boolean`, `None` otherwise." - ], - "signature": "let decodeBoolean: t => option", - "deprecated": "" - }, - { - "id": "Js.Json.decodeNull", - "kind": "value", - "name": "decodeNull", - "docstrings": [ - "`decodeNull(json)` returns `Some(null)` if `json` is a `null`, `None` otherwise." - ], - "signature": "let decodeNull: t => option>", - "deprecated": "" - }, - { - "id": "Js.Json.null", - "kind": "value", - "name": "null", - "docstrings": [ - "`null` is the singleton null JSON value." - ], - "signature": "let null: t", - "deprecated": "" - }, - { - "id": "Js.Json.string", - "kind": "value", - "name": "string", - "docstrings": [ - "`string(s)` makes a JSON string of the `string` `s`." - ], - "signature": "let string: string => t", - "deprecated": "" - }, - { - "id": "Js.Json.number", - "kind": "value", - "name": "number", - "docstrings": [ - "`number(n)` makes a JSON number of the `float` `n`." - ], - "signature": "let number: float => t", - "deprecated": "" - }, - { - "id": "Js.Json.boolean", - "kind": "value", - "name": "boolean", - "docstrings": [ - "`boolean(b)` makes a JSON boolean of the `bool` `b`." - ], - "signature": "let boolean: bool => t", - "deprecated": "" - }, - { - "id": "Js.Json.object_", - "kind": "value", - "name": "object_", - "docstrings": [ - "`object_(dict)` makes a JSON object of the `dict`." - ], - "signature": "let object_: dict => t", - "deprecated": "" - }, - { - "id": "Js.Json.array", - "kind": "value", - "name": "array", - "docstrings": [ - "`array_(a)` makes a JSON array of the `Js.Json.t` array `a`." - ], - "signature": "let array: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.stringArray", - "kind": "value", - "name": "stringArray", - "docstrings": [ - "`stringArray(a)` makes a JSON array of the `string` array `a`." - ], - "signature": "let stringArray: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.numberArray", - "kind": "value", - "name": "numberArray", - "docstrings": [ - "`numberArray(a)` makes a JSON array of the `float` array `a`." - ], - "signature": "let numberArray: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.booleanArray", - "kind": "value", - "name": "booleanArray", - "docstrings": [ - "`booleanArray(a)` makes a JSON array of the `bool` array `a`." - ], - "signature": "let booleanArray: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.objectArray", - "kind": "value", - "name": "objectArray", - "docstrings": [ - "`objectArray(a) makes a JSON array of the `JsDict.t` array `a`." - ], - "signature": "let objectArray: array> => t", - "deprecated": "" - }, - { - "id": "Js.Json.parseExn", - "kind": "value", - "name": "parseExn", - "docstrings": [ - "`parseExn(s)` parses the `string` `s` into a JSON data structure.\nReturns a JSON data structure.\nThrows `SyntaxError` if the given string is not a valid JSON. Note: `SyntaxError` is a JavaScript exception.\n\nSee [`parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) on MDN.\n\n## Examples\n\n```rescript\n/* parse a simple JSON string */\n\nlet json = try Js.Json.parseExn(` \"hello\" `) catch {\n| _ => failwith(\"Error parsing JSON string\")\n}\n\nswitch Js.Json.classify(json) {\n| Js.Json.JSONString(value) => Js.log(value)\n| _ => failwith(\"Expected a string\")\n}\n```\n\n```rescript\n/* parse a complex JSON string */\n\nlet getIds = s => {\n let json = try Js.Json.parseExn(s) catch {\n | _ => failwith(\"Error parsing JSON string\")\n }\n\n switch Js.Json.classify(json) {\n | Js.Json.JSONObject(value) =>\n /* In this branch, compiler infer value : Js.Json.t dict */\n switch Js.Dict.get(value, \"ids\") {\n | Some(ids) =>\n switch Js.Json.classify(ids) {\n | Js.Json.JSONArray(ids) => /* In this branch compiler infer ids : Js.Json.t array */\n ids\n | _ => failwith(\"Expected an array\")\n }\n | None => failwith(\"Expected an `ids` property\")\n }\n | _ => failwith(\"Expected an object\")\n }\n}\n\n/* prints `1, 2, 3` */\nJs.log(getIds(` { \"ids\" : [1, 2, 3 ] } `))\n```" - ], - "signature": "let parseExn: string => t", - "deprecated": "" - }, - { - "id": "Js.Json.stringify", - "kind": "value", - "name": "stringify", - "docstrings": [ - "`stringify(json)` formats the JSON data structure as a `string`.\nReturns the string representation of a given JSON data structure.\n\nSee [`stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) on MDN.\n\n## Examples\n\n```rescript\n/* Creates and stringifies a simple JS object */\n\nlet dict = Js.Dict.empty()\nJs.Dict.set(dict, \"name\", Js.Json.string(\"John Doe\"))\nJs.Dict.set(dict, \"age\", Js.Json.number(30.0))\nJs.Dict.set(dict, \"likes\", Js.Json.stringArray([\"ReScript\", \"ocaml\", \"js\"]))\n\nJs.log(Js.Json.stringify(Js.Json.object_(dict)))\n```" - ], - "signature": "let stringify: t => string", - "deprecated": "" - }, - { - "id": "Js.Json.stringifyWithSpace", - "kind": "value", - "name": "stringifyWithSpace", - "docstrings": [ - "`stringifyWithSpace(json)` formats the JSON data structure as a `string`.\nReturns the string representation of a given JSON data structure with spacing.\n\nSee [`stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) on MDN.\n\n## Examples\n\n```rescript\n/* Creates and stringifies a simple JS object with spacing */\n\nlet dict = Js.Dict.empty()\nJs.Dict.set(dict, \"name\", Js.Json.string(\"John Doe\"))\nJs.Dict.set(dict, \"age\", Js.Json.number(30.0))\nJs.Dict.set(dict, \"likes\", Js.Json.stringArray([\"ReScript\", \"ocaml\", \"js\"]))\n\nJs.log(Js.Json.stringifyWithSpace(Js.Json.object_(dict), 2))\n```" - ], - "signature": "let stringifyWithSpace: (t, int) => string", - "deprecated": "" - }, - { - "id": "Js.Json.stringifyAny", - "kind": "value", - "name": "stringifyAny", - "docstrings": [ - "`stringifyAny(value)` formats any value into a JSON string.\n\n## Examples\n\n```rescript\n/* prints `[\"hello\", \"world\"]` */\nJs.log(Js.Json.stringifyAny([\"hello\", \"world\"]))\n```" - ], - "signature": "let stringifyAny: 'a => option", - "deprecated": "" - }, - { - "id": "Js.Json.deserializeUnsafe", - "kind": "value", - "name": "deserializeUnsafe", - "docstrings": [ - "Best-effort serialization, it tries to seralize as\nmany objects as possible and deserialize it back\n\nIt is unsafe in two aspects\n- It may throw during parsing\n- when you cast it to a specific type, it may have a type mismatch" - ], - "signature": "let deserializeUnsafe: string => 'a", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.serializeExn", - "kind": "value", - "name": "serializeExn", - "docstrings": [ - "It will throw in such situations:\n- The object can not be serlialized to a JSON\n- There are cycles\n- Some JS engines can not stringify deeply nested json objects" - ], - "signature": "let serializeExn: 'a => string", - "deprecated": "This functionality has been deprecated and will be removed in v13." - } - ] - }, - "js/global": { - "id": "Js.Global", - "name": "Global", - "docstrings": [ - "Provide bindings to JS global functions in global namespace", - "Contains functions available in the global scope (`window` in a browser context)" - ], - "items": [ - { - "id": "Js.Global.intervalId", - "kind": "type", - "name": "intervalId", - "docstrings": [ - "Identify an interval started by `Js.Global.setInterval`." - ], - "signature": "type intervalId = Global.intervalId", - "deprecated": "" - }, - { - "id": "Js.Global.timeoutId", - "kind": "type", - "name": "timeoutId", - "docstrings": [ - "Identify timeout started by `Js.Global.setTimeout`." - ], - "signature": "type timeoutId = Global.timeoutId", - "deprecated": "" - }, - { - "id": "Js.Global.clearInterval", - "kind": "value", - "name": "clearInterval", - "docstrings": [ - "Clear an interval started by `Js.Global.setInterval`\n\n## Examples\n\n```rescript\n/* API for a somewhat aggressive snoozing alarm clock */\n\nlet punchSleepyGuy = () => Js.log(\"Punch\")\n\nlet interval = ref(Js.Nullable.null)\n\nlet remind = () => {\n Js.log(\"Wake Up!\")\n punchSleepyGuy()\n}\n\nlet snooze = mins => interval := Js.Nullable.return(Js.Global.setInterval(remind, mins * 60 * 1000))\n\nlet cancel = () =>\n Js.Nullable.iter(interval.contents, intervalId => Js.Global.clearInterval(intervalId))\n```" - ], - "signature": "let clearInterval: intervalId => unit", - "deprecated": "" - }, - { - "id": "Js.Global.clearTimeout", - "kind": "value", - "name": "clearTimeout", - "docstrings": [ - "Clear a timeout started by `Js.Global.setTimeout`.\n\n## Examples\n\n```rescript\n/* A simple model of a code monkey's brain */\n\nlet closeHackerNewsTab = () => Js.log(\"close\")\n\nlet timer = ref(Js.Nullable.null)\n\nlet work = () => closeHackerNewsTab()\n\nlet procrastinate = mins => {\n Js.Nullable.iter(timer.contents, timer => Js.Global.clearTimeout(timer))\n timer := Js.Nullable.return(Js.Global.setTimeout(work, mins * 60 * 1000))\n}\n```" - ], - "signature": "let clearTimeout: timeoutId => unit", - "deprecated": "" - }, - { - "id": "Js.Global.setInterval", - "kind": "value", - "name": "setInterval", - "docstrings": [ - "Repeatedly executes a callback with a specified interval (in milliseconds)\nbetween calls. Returns a `Js.Global.intervalId` that can be passed to\n`Js.Global.clearInterval` to cancel the timeout.\n\n## Examples\n\n```rescript\n/* Will count up and print the count to the console every second */\n\nlet count = ref(0)\n\nlet tick = () => {\n count := count.contents + 1\n Js.log(Belt.Int.toString(count.contents))\n}\n\nJs.Global.setInterval(tick, 1000)\n```" - ], - "signature": "let setInterval: (unit => unit, int) => intervalId", - "deprecated": "" - }, - { - "id": "Js.Global.setIntervalFloat", - "kind": "value", - "name": "setIntervalFloat", - "docstrings": [ - "Repeatedly executes a callback with a specified interval (in milliseconds)\nbetween calls. Returns a `Js.Global.intervalId` that can be passed to\n`Js.Global.clearInterval` to cancel the timeout.\n\n## Examples\n\n```rescript\n/* Will count up and print the count to the console every second */\n\nlet count = ref(0)\n\nlet tick = () => {\n count := count.contents + 1\n Js.log(Belt.Int.toString(count.contents))\n}\n\nJs.Global.setIntervalFloat(tick, 1000.0)\n```" - ], - "signature": "let setIntervalFloat: (unit => unit, float) => intervalId", - "deprecated": "" - }, - { - "id": "Js.Global.setTimeout", - "kind": "value", - "name": "setTimeout", - "docstrings": [ - "Execute a callback after a specified delay (in milliseconds). Returns a\n`Js.Global.timeoutId` that can be passed to `Js.Global.clearTimeout` to cancel\nthe timeout.\n\n## Examples\n\n```rescript\n/* Prints \"Timed out!\" in the console after one second */\n\nlet message = \"Timed out!\"\n\nJs.Global.setTimeout(() => Js.log(message), 1000)\n```" - ], - "signature": "let setTimeout: (unit => unit, int) => timeoutId", - "deprecated": "" - }, - { - "id": "Js.Global.setTimeoutFloat", - "kind": "value", - "name": "setTimeoutFloat", - "docstrings": [ - "Execute a callback after a specified delay (in milliseconds). Returns a\n`Js.Global.timeoutId` that can be passed to `Js.Global.clearTimeout` to cancel\nthe timeout.\n\n## Examples\n\n```rescript\n/* Prints \"Timed out!\" in the console after one second */\n\nlet message = \"Timed out!\"\n\nJs.Global.setTimeoutFloat(() => Js.log(message), 1000.0)\n```" - ], - "signature": "let setTimeoutFloat: (unit => unit, float) => timeoutId", - "deprecated": "" - }, - { - "id": "Js.Global.encodeURI", - "kind": "value", - "name": "encodeURI", - "docstrings": [ - "URL-encodes a string.\n\nSee [`encodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI) on MDN." - ], - "signature": "let encodeURI: string => string", - "deprecated": "" - }, - { - "id": "Js.Global.decodeURI", - "kind": "value", - "name": "decodeURI", - "docstrings": [ - "Decodes a URL-enmcoded string produced by `encodeURI`\n\nSee [`decodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI) on MDN." - ], - "signature": "let decodeURI: string => string", - "deprecated": "" - }, - { - "id": "Js.Global.encodeURIComponent", - "kind": "value", - "name": "encodeURIComponent", - "docstrings": [ - "URL-encodes a string, including characters with special meaning in a URI.\n\nSee [`encodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) on MDN." - ], - "signature": "let encodeURIComponent: string => string", - "deprecated": "" - }, - { - "id": "Js.Global.decodeURIComponent", - "kind": "value", - "name": "decodeURIComponent", - "docstrings": [ - "Decodes a URL-enmcoded string produced by `encodeURIComponent`\n\nSee [`decodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) on MDN." - ], - "signature": "let decodeURIComponent: string => string", - "deprecated": "" - } - ] - }, - "js/dict": { - "id": "Js.Dict", - "name": "Dict", - "docstrings": [ - "Provide utilities for JS dictionary object", - "Provide utilities for JS dictionary object.\n\n**Note:** This module's examples will assume this predeclared dictionary:\n\n## Examples\n\n```rescript\nlet ages = Js.Dict.fromList(list{(\"Maria\", 30), (\"Vinh\", 22), (\"Fred\", 49)})\n```" - ], - "items": [ - { - "id": "Js.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = dict<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.key", - "kind": "type", - "name": "key", - "docstrings": [ - "The type for dictionary keys. This means that dictionaries *must* use `string`s as their keys." - ], - "signature": "type key = string", - "deprecated": "" - }, - { - "id": "Js.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`Js.Dict.get(key)` returns `None` if the key is not found in the dictionary,\n`Some(value)` otherwise.\n\n## Examples\n\n```rescript\nJs.Dict.get(ages, \"Vinh\") == Some(22)\nJs.Dict.get(ages, \"Paul\") == None\n```" - ], - "signature": "let get: (t<'a>, key) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.unsafeGet", - "kind": "value", - "name": "unsafeGet", - "docstrings": [ - "`Js.Dict.unsafeGet(key)` returns the value if the key exists, otherwise an `undefined` value is returned. Use this only when you are sure the key exists (i.e. when having used the `keys()` function to check that the key is valid).\n\n## Examples\n\n```rescript\nJs.Dict.unsafeGet(ages, \"Fred\") == 49\nJs.Dict.unsafeGet(ages, \"Paul\") // returns undefined\n```" - ], - "signature": "let unsafeGet: (t<'a>, key) => 'a", - "deprecated": "" - }, - { - "id": "Js.Dict.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`Js.Dict.set(dict, key, value)` sets the key/value in the dictionary `dict`. If\nthe key does not exist, and entry will be created for it.\n\n*This function modifies the original dictionary.*\n\n## Examples\n\n```rescript\nJs.Dict.set(ages, \"Maria\", 31)\nJs.log(ages == Js.Dict.fromList(list{(\"Maria\", 31), (\"Vinh\", 22), (\"Fred\", 49)}))\n\nJs.Dict.set(ages, \"David\", 66)\nJs.log(ages == Js.Dict.fromList(list{(\"Maria\", 31), (\"Vinh\", 22), (\"Fred\", 49), (\"David\", 66)}))\n```" - ], - "signature": "let set: (t<'a>, key, 'a) => unit", - "deprecated": "" - }, - { - "id": "Js.Dict.keys", - "kind": "value", - "name": "keys", - "docstrings": [ - "Returns all the keys in the dictionary `dict`.\n\n## Examples\n\n```rescript\nJs.Dict.keys(ages) == [\"Maria\", \"Vinh\", \"Fred\"]\n```" - ], - "signature": "let keys: t<'a> => array", - "deprecated": "" - }, - { - "id": "Js.Dict.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "Returns an empty dictionary." - ], - "signature": "let empty: unit => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.unsafeDeleteKey", - "kind": "value", - "name": "unsafeDeleteKey", - "docstrings": [ - "Experimental internal function" - ], - "signature": "let unsafeDeleteKey: (t, string) => unit", - "deprecated": "" - }, - { - "id": "Js.Dict.entries", - "kind": "value", - "name": "entries", - "docstrings": [ - "Returns an array of key/value pairs in the given dictionary (ES2017).\n\n## Examples\n\n```rescript\nJs.Dict.entries(ages) == [(\"Maria\", 30), (\"Vinh\", 22), (\"Fred\", 49)]\n```" - ], - "signature": "let entries: t<'a> => array<(key, 'a)>", - "deprecated": "" - }, - { - "id": "Js.Dict.values", - "kind": "value", - "name": "values", - "docstrings": [ - "Returns the values in the given dictionary (ES2017).\n\n## Examples\n\n```rescript\nJs.Dict.values(ages) == [30, 22, 49]\n```" - ], - "signature": "let values: t<'a> => array<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.fromList", - "kind": "value", - "name": "fromList", - "docstrings": [ - "Creates a new dictionary containing each (key, value) pair in its list\nargument.\n\n## Examples\n\n```rescript\nlet capitals = Js.Dict.fromList(list{(\"Japan\", \"Tokyo\"), (\"France\", \"Paris\"), (\"Egypt\", \"Cairo\")})\n```" - ], - "signature": "let fromList: list<(key, 'a)> => t<'a>", - "deprecated": "Use `Dict.fromArray(List.toArray(...))` instead." - }, - { - "id": "Js.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates a new dictionary containing each (key, value) pair in its array\nargument.\n\n## Examples\n\n```rescript\nlet capitals2 = Js.Dict.fromArray([(\"Germany\", \"Berlin\"), (\"Burkina Faso\", \"Ouagadougou\")])\n```" - ], - "signature": "let fromArray: array<(key, 'a)> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(f, dict)` maps `dict` to a new dictionary with the same keys, using the\nfunction `f` to map each value.\n\n## Examples\n\n```rescript\nlet prices = Js.Dict.fromList(list{(\"pen\", 1.00), (\"book\", 5.00), (\"stapler\", 7.00)})\n\nlet discount = price => price *. 0.90\nlet salePrices = Js.Dict.map(discount, prices)\n\nsalePrices == Js.Dict.fromList(list{(\"pen\", 0.90), (\"book\", 4.50), (\"stapler\", 6.30)})\n```" - ], - "signature": "let map: ('a => 'b, t<'a>) => t<'b>", - "deprecated": "" - } - ] - }, - "js/date": { - "id": "Js.Date", - "name": "Date", - "docstrings": [ - "Provide bindings for JS Date", - "Provide bindings to JS date. (See\n[`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)\non MDN.) JavaScript stores dates as the number of milliseconds since the UNIX\n*epoch*, midnight 1 January 1970, UTC." - ], - "items": [ - { - "id": "Js.Date.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Date.t", - "deprecated": "" - }, - { - "id": "Js.Date.valueOf", - "kind": "value", - "name": "valueOf", - "docstrings": [ - "Returns the primitive value of this date, equivalent to `getTime()`. (See\n[`Date.valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/valueOf)\non MDN.)\n\n## Examples\n\n```rescript\nJs.Date.valueOf(exampleDate) == 123456654321.0\n```" - ], - "signature": "let valueOf: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a date representing the current time. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nlet now = Js.Date.make()\n```" - ], - "signature": "let make: unit => t", - "deprecated": "" - }, - { - "id": "Js.Date.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "Returns a date representing the given argument, which is a number of\nmilliseconds since the epoch. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.fromFloat(123456654321.0) == exampleDate\n```" - ], - "signature": "let fromFloat: float => t", - "deprecated": "" - }, - { - "id": "Js.Date.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Returns a `Js.Date.t` represented by the given string. The string can be in\n“IETF-compliant RFC 2822 timestamps, and also strings in a version of ISO8601.”\nReturns `NaN` if given an invalid date string. According to the [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\ndocumentation on MDN, its use is discouraged.\n\n## Examples\n\n```rescript\nJs.Date.fromString(\"Thu, 29 Nov 1973 21:30:54.321 GMT\") == exampleDate\nJs.Date.fromString(\"1973-11-29T21:30:54.321Z00:00\") == exampleDate\nJs.Date.fromString(\"Thor, 32 Lok -19 60:70:80 XYZ\") // returns NaN\n```" - ], - "signature": "let fromString: string => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYM", - "kind": "value", - "name": "makeWithYM", - "docstrings": [ - "Returns a date representing midnight of the first day of the given month and\nyear in the current time zone. Fractional parts of arguments are ignored. See\n[`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nlet november1 = Js.Date.makeWithYM(~year=2020.0, ~month=10.0, ())\n```" - ], - "signature": "let makeWithYM: (~year: float, ~month: float, unit) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMD", - "kind": "value", - "name": "makeWithYMD", - "docstrings": [ - "Returns a date representing midnight of the given date of the given month and\nyear in the current time zone. Fractional parts of arguments are ignored. See\n[`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN." - ], - "signature": "let makeWithYMD: (~year: float, ~month: float, ~date: float, unit) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMDH", - "kind": "value", - "name": "makeWithYMDH", - "docstrings": [ - "Returns a date representing the given date of the given month and year, at zero\nminutes and zero seconds past the given `hours`, in the current time zone.\nFractional parts of arguments are ignored. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN. Fractional parts of the arguments are ignored." - ], - "signature": "let makeWithYMDH: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n unit,\n) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMDHM", - "kind": "value", - "name": "makeWithYMDHM", - "docstrings": [ - "Returns a date representing the given date of the given month and year, at zero\nseconds past the given time in hours and minutes in the current time zone.\nFractional parts of arguments are ignored. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN." - ], - "signature": "let makeWithYMDHM: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n unit,\n) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMDHMS", - "kind": "value", - "name": "makeWithYMDHMS", - "docstrings": [ - "Returns a date representing the given date of the given month and year, at the\ngiven time in hours, minutes, and seconds in the current time zone. Fractional\nparts of arguments are ignored. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.makeWithYMDHMS(\n ~year=1973.0,\n ~month=11.0,\n ~date=29.0,\n ~hours=21.0,\n ~minutes=30.0,\n ~seconds=54.321,\n (),\n) == exampleDate\n```" - ], - "signature": "let makeWithYMDHMS: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => t", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYM", - "kind": "value", - "name": "utcWithYM", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the first day of the given month and year in UTC. Fractional parts\nof arguments are ignored. See\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN.\n\n## Examples\n\n```rescript\nlet november1 = Js.Date.utcWithYM(~year=2020.0, ~month=10.0, ())\n```" - ], - "signature": "let utcWithYM: (~year: float, ~month: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMD", - "kind": "value", - "name": "utcWithYMD", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year in UTC. Fractional parts\nof arguments are ignored. See\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMD: (~year: float, ~month: float, ~date: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMDH", - "kind": "value", - "name": "utcWithYMDH", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year, at zero minutes and\nseconds past the given hours in UTC. Fractional parts of arguments are ignored.\nSee\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMDH: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMDHM", - "kind": "value", - "name": "utcWithYMDHM", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year, at zero seconds past\nthe given number of minutes past the given hours in UTC. Fractional parts of\narguments are ignored. See\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMDHM: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMDHMS", - "kind": "value", - "name": "utcWithYMDHMS", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year, at the given time in\nhours, minutes and seconds in UTC. Fractional parts of arguments are ignored.\n\nSee\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMDHMS: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.now", - "kind": "value", - "name": "now", - "docstrings": [ - "Returns the current time as number of milliseconds since Unix epoch." - ], - "signature": "let now: unit => float", - "deprecated": "" - }, - { - "id": "Js.Date.parse", - "kind": "value", - "name": "parse", - "docstrings": [], - "signature": "let parse: string => t", - "deprecated": "" - }, - { - "id": "Js.Date.parseAsFloat", - "kind": "value", - "name": "parseAsFloat", - "docstrings": [ - "Returns a float with the number of milliseconds past the epoch represented by\nthe given string. The string can be in “IETF-compliant RFC 2822 timestamps, and\nalso strings in a version of ISO8601.” Returns `NaN` if given an invalid date\nstring. According to the\n[`Date.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse)\ndocumentation on MDN, its use is discouraged. Returns `NaN` if passed invalid\ndate string." - ], - "signature": "let parseAsFloat: string => float", - "deprecated": "" - }, - { - "id": "Js.Date.getDate", - "kind": "value", - "name": "getDate", - "docstrings": [ - "Returns the day of the month for its argument. The argument is evaluated in the\ncurrent time zone. See\n[`Date.getDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDate)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getDate(exampleDate) == 29.0\n```" - ], - "signature": "let getDate: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getDay", - "kind": "value", - "name": "getDay", - "docstrings": [ - "Returns the day of the week (0.0-6.0) for its argument, where 0.0 represents\nSunday. The argument is evaluated in the current time zone. See\n[`Date.getDay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDay)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getDay(exampleDate) == 4.0\n```" - ], - "signature": "let getDay: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getFullYear", - "kind": "value", - "name": "getFullYear", - "docstrings": [ - "Returns the full year (as opposed to the range 0-99) for its argument. The\nargument is evaluated in the current time zone. See\n[`Date.getFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getFullYear)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getFullYear(exampleDate) == 1973.0\n```" - ], - "signature": "let getFullYear: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getHours", - "kind": "value", - "name": "getHours", - "docstrings": [ - "Returns the hours for its argument, evaluated in the current time zone. See\n[`Date.getHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getHours)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getHours(exampleDate) == 22.0 // Vienna is in GMT+01:00\n```" - ], - "signature": "let getHours: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getMilliseconds", - "kind": "value", - "name": "getMilliseconds", - "docstrings": [ - "Returns the number of milliseconds for its argument, evaluated in the current\ntime zone. See\n[`Date.getMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getMilliseconds(exampleDate) == 321.0\n```" - ], - "signature": "let getMilliseconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getMinutes", - "kind": "value", - "name": "getMinutes", - "docstrings": [ - "Returns the number of minutes for its argument, evaluated in the current time\nzone. See\n[`Date.getMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMinutes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getMinutes(exampleDate) == 30.0\n```" - ], - "signature": "let getMinutes: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getMonth", - "kind": "value", - "name": "getMonth", - "docstrings": [ - "Returns the month (0.0-11.0) for its argument, evaluated in the current time\nzone. January is month zero. See\n[`Date.getMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMonth)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getMonth(exampleDate) == 10.0\n```" - ], - "signature": "let getMonth: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getSeconds", - "kind": "value", - "name": "getSeconds", - "docstrings": [ - "Returns the seconds for its argument, evaluated in the current time zone. See\n[`Date.getSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getSeconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getSeconds(exampleDate) == 54.0\n```" - ], - "signature": "let getSeconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getTime", - "kind": "value", - "name": "getTime", - "docstrings": [ - "Returns the number of milliseconds since Unix epoch, evaluated in UTC. See\n[`Date.getTime`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getTime(exampleDate) == 123456654321.0\n```" - ], - "signature": "let getTime: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getTimezoneOffset", - "kind": "value", - "name": "getTimezoneOffset", - "docstrings": [ - "Returns the time zone offset in minutes from the current time zone to UTC. See\n[`Date.getTimezoneOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getTimezoneOffset(exampleDate) == -60.0\n```" - ], - "signature": "let getTimezoneOffset: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCDate", - "kind": "value", - "name": "getUTCDate", - "docstrings": [ - "Returns the day of the month of the argument, evaluated in UTC. See\n[`Date.getUTCDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCDate)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCDate(exampleDate) == 29.0\n```" - ], - "signature": "let getUTCDate: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCDay", - "kind": "value", - "name": "getUTCDay", - "docstrings": [ - "Returns the day of the week of the argument, evaluated in UTC. The range of the\nreturn value is 0.0-6.0, where Sunday is zero. See\n[`Date.getUTCDay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCDay)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCDay(exampleDate) == 4.0\n```" - ], - "signature": "let getUTCDay: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCFullYear", - "kind": "value", - "name": "getUTCFullYear", - "docstrings": [ - "Returns the full year (as opposed to the range 0-99) for its argument. The\nargument is evaluated in UTC. See\n[`Date.getUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCFullYear(exampleDate) == 1973.0\n```" - ], - "signature": "let getUTCFullYear: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCHours", - "kind": "value", - "name": "getUTCHours", - "docstrings": [ - "Returns the hours for its argument, evaluated in the current time zone. See\n[`Date.getUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCHours(exampleDate) == 21.0\n```" - ], - "signature": "let getUTCHours: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCMilliseconds", - "kind": "value", - "name": "getUTCMilliseconds", - "docstrings": [ - "Returns the number of milliseconds for its argument, evaluated in UTC. See\n[`Date.getUTCMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCMilliseconds(exampleDate) == 321.0\n```" - ], - "signature": "let getUTCMilliseconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCMinutes", - "kind": "value", - "name": "getUTCMinutes", - "docstrings": [ - "Returns the number of minutes for its argument, evaluated in UTC. See\n[`Date.getUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCMinutes(exampleDate) == 30.0\n```" - ], - "signature": "let getUTCMinutes: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCMonth", - "kind": "value", - "name": "getUTCMonth", - "docstrings": [ - "Returns the month (0.0-11.0) for its argument, evaluated in UTC. January is\nmonth zero. See\n[`Date.getUTCMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMonth)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCMonth(exampleDate) == 10.0\n```" - ], - "signature": "let getUTCMonth: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCSeconds", - "kind": "value", - "name": "getUTCSeconds", - "docstrings": [ - "Returns the seconds for its argument, evaluated in UTC. See\n[`Date.getUTCSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCSeconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCSeconds(exampleDate) == 54.0\n```" - ], - "signature": "let getUTCSeconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getYear", - "kind": "value", - "name": "getYear", - "docstrings": [], - "signature": "let getYear: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.setDate", - "kind": "value", - "name": "setDate", - "docstrings": [ - "Sets the given `Date`’s day of month to the value in the second argument\naccording to the current time zone. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setDate)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet twoWeeksBefore = Js.Date.setDate(date1, 15.0)\ndate1 == Js.Date.fromString(\"1973-11-15T21:30:54.321Z00:00\")\ntwoWeeksBefore == Js.Date.getTime(date1)\n```" - ], - "signature": "let setDate: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setFullYear", - "kind": "value", - "name": "setFullYear", - "docstrings": [ - "Sets the given `Date`’s year to the value in the second argument according to\nthe current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextYear = Js.Date.setFullYear(date1, 1974.0)\ndate1 == Js.Date.fromString(\"1974-11-15T21:30:54.321Z00:00\")\nnextYear == Js.Date.getTime(date1)\n```" - ], - "signature": "let setFullYear: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setFullYearM", - "kind": "value", - "name": "setFullYearM", - "docstrings": [ - "Sets the given `Date`’s year and month to the values in the labeled arguments\naccording to the current time zone. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setFullYearM(date1, ~year=1974.0, ~month=0.0, ())\ndate1 == Js.Date.fromString(\"1974-01-22T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setFullYearM: (t, ~year: float, ~month: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setFullYearMD", - "kind": "value", - "name": "setFullYearMD", - "docstrings": [ - "Sets the given `Date`’s year, month, and day of month to the values in the\nlabeled arguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setFullYearMD(date1, ~year=1974.0, ~month=0.0, ~date=7.0, ())\ndate1 == Js.Date.fromString(\"1974-01-07T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setFullYearMD: (\n t,\n ~year: float,\n ~month: float,\n ~date: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHours", - "kind": "value", - "name": "setHours", - "docstrings": [ - "Sets the given `Date`’s hours to the value in the second argument according to\nthe current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextHour = Js.Date.setHours(date1, 22.0)\ndate1 == Js.Date.fromString(\"1973-11-29T22:30:54.321Z00:00\")\nnextHour == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHours: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHoursM", - "kind": "value", - "name": "setHoursM", - "docstrings": [ - "Sets the given `Date`’s hours and minutes to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setHoursM(date1, ~hours=22.0, ~minutes=46.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:54.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHoursM: (t, ~hours: float, ~minutes: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHoursMS", - "kind": "value", - "name": "setHoursMS", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, and seconds to the values in the\nlabeled arguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setHoursMS(date1, ~hours=22.0, ~minutes=46.0, ~seconds=37.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHoursMS: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHoursMSMs", - "kind": "value", - "name": "setHoursMSMs", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, seconds, and milliseconds to the values\nin the labeled arguments according to the current time zone. Returns the number\nof milliseconds since the epoch of the updated `Date`. *This function modifies\nthe original `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setHoursMSMs(\n date1,\n ~hours=22.0,\n ~minutes=46.0,\n ~seconds=37.0,\n ~milliseconds=494.0,\n (),\n)\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHoursMSMs: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMilliseconds", - "kind": "value", - "name": "setMilliseconds", - "docstrings": [ - "Sets the given `Date`’s milliseconds to the value in the second argument\naccording to the current time zone. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMilliseconds(date1, 494.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:30:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMilliseconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMinutes", - "kind": "value", - "name": "setMinutes", - "docstrings": [ - "Sets the given `Date`’s minutes to the value in the second argument according\nto the current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMinutes(date1, 34.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMinutes: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMinutesS", - "kind": "value", - "name": "setMinutesS", - "docstrings": [ - "Sets the given `Date`’s minutes and seconds to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMinutesS(date1, ~minutes=34.0, ~seconds=56.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMinutesS: (t, ~minutes: float, ~seconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMinutesSMs", - "kind": "value", - "name": "setMinutesSMs", - "docstrings": [ - "Sets the given `Date`’s minutes, seconds, and milliseconds to the values in the\nlabeled arguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMinutesSMs(date1, ~minutes=34.0, ~seconds=56.0, ~milliseconds=789.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMinutesSMs: (\n t,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMonth", - "kind": "value", - "name": "setMonth", - "docstrings": [ - "Sets the given `Date`’s month to the value in the second argument according to\nthe current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMonth(date1, 11.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMonth: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMonthD", - "kind": "value", - "name": "setMonthD", - "docstrings": [ - "Sets the given `Date`’s month and day of month to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMonthD(date1, ~month=11.0, ~date=8.0, ())\ndate1 == Js.Date.fromString(\"1973-12-08T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMonthD: (t, ~month: float, ~date: float, unit) => float", - "deprecated": "Use `Date.setMonth` then `Date.setDate`. No direct 1:1 migration available." - }, - { - "id": "Js.Date.setSeconds", - "kind": "value", - "name": "setSeconds", - "docstrings": [ - "Sets the given `Date`’s seconds to the value in the second argument according\nto the current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setSeconds(date1, 56.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setSeconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setSecondsMs", - "kind": "value", - "name": "setSecondsMs", - "docstrings": [ - "Sets the given `Date`’s seconds and milliseconds to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setSecondsMs(date1, ~seconds=56.0, ~milliseconds=789.0, ())\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setSecondsMs: (t, ~seconds: float, ~milliseconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setTime", - "kind": "value", - "name": "setTime", - "docstrings": [ - "Sets the given `Date`’s value in terms of milliseconds since the epoch. Returns\nthe number of milliseconds since the epoch of the updated `Date`. *This\nfunction modifies the original `Date`.* See\n[`Date.setTime`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setTime)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setTime(date1, 198765432101.0)\n\ndate1 == Js.Date.fromString(\"1976-04-19T12:37:12.101Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setTime: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCDate", - "kind": "value", - "name": "setUTCDate", - "docstrings": [ - "Sets the given `Date`’s day of month to the value in the second argument\naccording to UTC. Returns the number of milliseconds since the epoch of the\nupdated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCDate)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet twoWeeksBefore = Js.Date.setUTCDate(date1, 15.0)\ndate1 == Js.Date.fromString(\"1973-11-15T21:30:54.321Z00:00\")\ntwoWeeksBefore == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCDate: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCFullYear", - "kind": "value", - "name": "setUTCFullYear", - "docstrings": [ - "Sets the given `Date`’s year to the value in the second argument according to\nUTC. Returns the number of milliseconds since the epoch of the updated `Date`.\n*This function modifies the original `Date`.* See\n[`Date.setUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextYear = Js.Date.setUTCFullYear(date1, 1974.0)\ndate1 == Js.Date.fromString(\"1974-11-15T21:30:54.321Z00:00\")\nnextYear == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCFullYear: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCFullYearM", - "kind": "value", - "name": "setUTCFullYearM", - "docstrings": [ - "Sets the given `Date`’s year and month to the values in the labeled arguments\naccording to UTC. Returns the number of milliseconds since the epoch of the\nupdated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setUTCFullYearM(date1, ~year=1974.0, ~month=0.0, ())\ndate1 == Js.Date.fromString(\"1974-01-22T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCFullYearM: (t, ~year: float, ~month: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCFullYearMD", - "kind": "value", - "name": "setUTCFullYearMD", - "docstrings": [ - "Sets the given `Date`’s year, month, and day of month to the values in the\nlabeled arguments according to UTC. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setUTCFullYearMD(date1, ~year=1974.0, ~month=0.0, ~date=7.0, ())\ndate1 == Js.Date.fromString(\"1974-01-07T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCFullYearMD: (\n t,\n ~year: float,\n ~month: float,\n ~date: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHours", - "kind": "value", - "name": "setUTCHours", - "docstrings": [ - "Sets the given `Date`’s hours to the value in the second argument according to\nUTC. Returns the number of milliseconds since the epoch of the updated `Date`.\n*This function modifies the original `Date`.* See\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextHour = Js.Date.setUTCHours(date1, 22.0)\ndate1 == Js.Date.fromString(\"1973-11-29T22:30:54.321Z00:00\")\nnextHour == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHours: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHoursM", - "kind": "value", - "name": "setUTCHoursM", - "docstrings": [ - "Sets the given `Date`’s hours and minutes to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCHoursM(date1, ~hours=22.0, ~minutes=46.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:54.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHoursM: (t, ~hours: float, ~minutes: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHoursMS", - "kind": "value", - "name": "setUTCHoursMS", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, and seconds to the values in the\nlabeled arguments according to UTC. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\n\nSee\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCHoursMS(date1, ~hours=22.0, ~minutes=46.0, ~seconds=37.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHoursMS: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHoursMSMs", - "kind": "value", - "name": "setUTCHoursMSMs", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, seconds, and milliseconds to the values\nin the labeled arguments according to UTC. Returns the number of milliseconds\nsince the epoch of the updated `Date`. *This function modifies the original\n`Date`.* See\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCHoursMSMs(\n date1,\n ~hours=22.0,\n ~minutes=46.0,\n ~seconds=37.0,\n ~milliseconds=494.0,\n (),\n)\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHoursMSMs: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMilliseconds", - "kind": "value", - "name": "setUTCMilliseconds", - "docstrings": [ - "Sets the given `Date`’s milliseconds to the value in the second argument\naccording to UTC. Returns the number of milliseconds since the epoch of the\nupdated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMilliseconds(date1, 494.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:30:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMilliseconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMinutes", - "kind": "value", - "name": "setUTCMinutes", - "docstrings": [ - "Sets the given `Date`’s minutes to the value in the second argument according\nto the current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMinutes(date1, 34.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMinutes: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMinutesS", - "kind": "value", - "name": "setUTCMinutesS", - "docstrings": [ - "Sets the given `Date`’s minutes and seconds to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMinutesS(date1, ~minutes=34.0, ~seconds=56.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMinutesS: (t, ~minutes: float, ~seconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMinutesSMs", - "kind": "value", - "name": "setUTCMinutesSMs", - "docstrings": [ - "Sets the given `Date`’s minutes, seconds, and milliseconds to the values in the\nlabeled arguments according to UTC. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMinutesSMs(\n date1,\n ~minutes=34.0,\n ~seconds=56.0,\n ~milliseconds=789.0,\n (),\n)\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMinutesSMs: (\n t,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMonth", - "kind": "value", - "name": "setUTCMonth", - "docstrings": [ - "Sets the given `Date`’s month to the value in the second argument according to\nUTC. Returns the number of milliseconds since the epoch of the updated `Date`.\n*This function modifies the original `Date`.* See\n[`Date.setUTCMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMonth(date1, 11.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMonth: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMonthD", - "kind": "value", - "name": "setUTCMonthD", - "docstrings": [ - "Sets the given `Date`’s month and day of month to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMonthD(date1, ~month=11.0, ~date=8.0, ())\ndate1 == Js.Date.fromString(\"1973-12-08T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMonthD: (t, ~month: float, ~date: float, unit) => float", - "deprecated": "Use `Date.setUTCMonth` then `Date.setUTCDate`. No direct 1:1 migration available." - }, - { - "id": "Js.Date.setUTCSeconds", - "kind": "value", - "name": "setUTCSeconds", - "docstrings": [ - "Sets the given `Date`’s seconds to the value in the second argument according\nto UTC. Returns the number of milliseconds since the epoch of the updated\n`Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCSeconds(date1, 56.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCSeconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCSecondsMs", - "kind": "value", - "name": "setUTCSecondsMs", - "docstrings": [ - "Sets the given `Date`’s seconds and milliseconds to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCSecondsMs(date1, ~seconds=56.0, ~milliseconds=789.0, ())\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCSecondsMs: (t, ~seconds: float, ~milliseconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCTime", - "kind": "value", - "name": "setUTCTime", - "docstrings": [ - "Same as [`setTime()`](#settime)." - ], - "signature": "let setUTCTime: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setYear", - "kind": "value", - "name": "setYear", - "docstrings": [], - "signature": "let setYear: (t, float) => float", - "deprecated": "Use `setFullYear` instead" - }, - { - "id": "Js.Date.toDateString", - "kind": "value", - "name": "toDateString", - "docstrings": [ - "Returns the date (day of week, year, month, and day of month) portion of a\n`Date` in English. See\n[`Date.toDateString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toDateString(exampleDate) == \"Thu Nov 29 1973\"\n```" - ], - "signature": "let toDateString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toGMTString", - "kind": "value", - "name": "toGMTString", - "docstrings": [], - "signature": "let toGMTString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toISOString", - "kind": "value", - "name": "toISOString", - "docstrings": [ - "Returns a simplified version of the ISO 8601 format for the date. See\n[`Date.toISOString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toISOString(exampleDate) == \"1973-11-29T21:30:54.321Z\"\n```" - ], - "signature": "let toISOString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toJSON", - "kind": "value", - "name": "toJSON", - "docstrings": [], - "signature": "let toJSON: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toJSONUnsafe", - "kind": "value", - "name": "toJSONUnsafe", - "docstrings": [ - "Returns a string representation of the given date. See\n[`Date.toJSON`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON)\non MDN." - ], - "signature": "let toJSONUnsafe: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toLocaleDateString", - "kind": "value", - "name": "toLocaleDateString", - "docstrings": [ - "Returns the year, month, and day for the given `Date` in the current locale\nformat. See\n[`Date.toLocaleDateString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toLocaleDateString(exampleDate) == \"11/29/1973\" // for en_US.utf8\nJs.Date.toLocaleDateString(exampleDate) == \"29.11.73\" // for de_DE.utf8\n```" - ], - "signature": "let toLocaleDateString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Returns the time and date for the given `Date` in the current locale format.\nSee\n[`Date.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toLocaleString(exampleDate) == \"11/29/1973, 10:30:54 PM\" // for en_US.utf8\nJs.Date.toLocaleString(exampleDate) == \"29.11.1973, 22:30:54\" // for de_DE.utf8\n```" - ], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toLocaleTimeString", - "kind": "value", - "name": "toLocaleTimeString", - "docstrings": [ - "Returns the time of day for the given `Date` in the current locale format. See\n[`Date.toLocaleTimeString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toLocaleString(exampleDate) == \"10:30:54 PM\" // for en_US.utf8\nJs.Date.toLocaleString(exampleDate) == \"22:30:54\" // for de_DE.utf8\n```" - ], - "signature": "let toLocaleTimeString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Returns a string representing the date and time of day for the given `Date` in\nthe current locale and time zone. See\n[`Date.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toString(\n exampleDate,\n) == \"Thu Nov 29 1973 22:30:54 GMT+0100 (Central European Standard Time)\"\n```" - ], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toTimeString", - "kind": "value", - "name": "toTimeString", - "docstrings": [ - "Returns a string representing the time of day for the given `Date` in the\ncurrent locale and time zone. See\n[`Date.toTimeString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toTimeString(exampleDate) == \"22:30:54 GMT+0100 (Central European Standard Time)\"\n```" - ], - "signature": "let toTimeString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toUTCString", - "kind": "value", - "name": "toUTCString", - "docstrings": [ - "Returns a string representing the date and time of day for the given `Date` in\nthe current locale and UTC (GMT time zone). See\n[`Date.toUTCString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toUTCString(exampleDate) == \"Thu, 29 Nov 1973 21:30:54 GMT\"\n```" - ], - "signature": "let toUTCString: t => string", - "deprecated": "" - } - ] - }, - "js/promise2": { - "id": "Js.Promise2", - "name": "Promise2", - "docstrings": [ - "Provide bindings to JS Promise" - ], - "items": [ - { - "id": "Js.Promise2.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.error", - "kind": "type", - "name": "error", - "docstrings": [], - "signature": "type error" - }, - { - "id": "Js.Promise2.then", - "kind": "value", - "name": "then", - "docstrings": [ - "Type-safe t-first then" - ], - "signature": "let then: (promise<'a>, 'a => promise<'b>) => promise<'b>", - "deprecated": "" - }, - { - "id": "Js.Promise2.catch", - "kind": "value", - "name": "catch", - "docstrings": [ - "Type-safe t-first catch" - ], - "signature": "let catch: (promise<'a>, error => promise<'a>) => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (\n (~resolve: 'a => unit, ~reject: exn => unit) => unit,\n) => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.resolve", - "kind": "value", - "name": "resolve", - "docstrings": [], - "signature": "let resolve: 'a => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.reject", - "kind": "value", - "name": "reject", - "docstrings": [], - "signature": "let reject: exn => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all", - "kind": "value", - "name": "all", - "docstrings": [], - "signature": "let all: array> => promise>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all2", - "kind": "value", - "name": "all2", - "docstrings": [], - "signature": "let all2: ((promise<'a0>, promise<'a1>)) => promise<('a0, 'a1)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all3", - "kind": "value", - "name": "all3", - "docstrings": [], - "signature": "let all3: (\n (promise<'a0>, promise<'a1>, promise<'a2>),\n) => promise<('a0, 'a1, 'a2)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all4", - "kind": "value", - "name": "all4", - "docstrings": [], - "signature": "let all4: (\n (promise<'a0>, promise<'a1>, promise<'a2>, promise<'a3>),\n) => promise<('a0, 'a1, 'a2, 'a3)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all5", - "kind": "value", - "name": "all5", - "docstrings": [], - "signature": "let all5: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all6", - "kind": "value", - "name": "all6", - "docstrings": [], - "signature": "let all6: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n promise<'a5>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4, 'a5)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.race", - "kind": "value", - "name": "race", - "docstrings": [], - "signature": "let race: array> => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.unsafe_async", - "kind": "value", - "name": "unsafe_async", - "docstrings": [], - "signature": "let unsafe_async: 'a => promise<'a>" - }, - { - "id": "Js.Promise2.unsafe_await", - "kind": "value", - "name": "unsafe_await", - "docstrings": [], - "signature": "let unsafe_await: promise<'a> => 'a" - } - ] - }, - "js/promise": { - "id": "Js.Promise", - "name": "Promise", - "docstrings": [ - "Provide bindings to JS Promise", - "Deprecation note: These bindings are pretty outdated and cannot be used properly\nwith the `->` operator.\n\nMore details on proper Promise usage can be found here:\nhttps://rescript-lang.org/docs/manual/latest/promise#promise-legacy" - ], - "items": [ - { - "id": "Js.Promise.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.error", - "kind": "type", - "name": "error", - "docstrings": [], - "signature": "type error = Js_promise2.error", - "deprecated": "" - }, - { - "id": "Js.Promise.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (\n (~resolve: 'a => unit, ~reject: exn => unit) => unit,\n) => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.resolve", - "kind": "value", - "name": "resolve", - "docstrings": [], - "signature": "let resolve: 'a => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.reject", - "kind": "value", - "name": "reject", - "docstrings": [], - "signature": "let reject: exn => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.all", - "kind": "value", - "name": "all", - "docstrings": [], - "signature": "let all: array> => promise>", - "deprecated": "" - }, - { - "id": "Js.Promise.all2", - "kind": "value", - "name": "all2", - "docstrings": [], - "signature": "let all2: ((promise<'a0>, promise<'a1>)) => promise<('a0, 'a1)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all3", - "kind": "value", - "name": "all3", - "docstrings": [], - "signature": "let all3: (\n (promise<'a0>, promise<'a1>, promise<'a2>),\n) => promise<('a0, 'a1, 'a2)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all4", - "kind": "value", - "name": "all4", - "docstrings": [], - "signature": "let all4: (\n (promise<'a0>, promise<'a1>, promise<'a2>, promise<'a3>),\n) => promise<('a0, 'a1, 'a2, 'a3)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all5", - "kind": "value", - "name": "all5", - "docstrings": [], - "signature": "let all5: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all6", - "kind": "value", - "name": "all6", - "docstrings": [], - "signature": "let all6: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n promise<'a5>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4, 'a5)>", - "deprecated": "" - }, - { - "id": "Js.Promise.race", - "kind": "value", - "name": "race", - "docstrings": [], - "signature": "let race: array> => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.then_", - "kind": "value", - "name": "then_", - "docstrings": [], - "signature": "let then_: ('a => promise<'b>, promise<'a>) => promise<'b>", - "deprecated": "" - }, - { - "id": "Js.Promise.catch", - "kind": "value", - "name": "catch", - "docstrings": [], - "signature": "let catch: (error => promise<'a>, promise<'a>) => promise<'a>", - "deprecated": "" - } - ] - }, - "js/re": { - "id": "Js.Re", - "name": "Re", - "docstrings": [ - "Provide bindings to JS regex expression", - "Provide bindings to JS regular expressions (RegExp).\n\n**Note:** This is not an immutable API. A RegExp object with the `global` (\"g\")\nflag set will modify the [`lastIndex`]() property when the RegExp object is used,\nand subsequent uses will continue the search from the previous [`lastIndex`]()." - ], - "items": [ - { - "id": "Js.Re.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The RegExp object." - ], - "signature": "type t = RegExp.t", - "deprecated": "" - }, - { - "id": "Js.Re.result", - "kind": "type", - "name": "result", - "docstrings": [ - "The result of a executing a RegExp on a string." - ], - "signature": "type result" - }, - { - "id": "Js.Re.captures", - "kind": "value", - "name": "captures", - "docstrings": [ - "An `array` of the match and captures, the first is the full match and the\nremaining are the substring captures." - ], - "signature": "let captures: result => array>", - "deprecated": "" - }, - { - "id": "Js.Re.matches", - "kind": "value", - "name": "matches", - "docstrings": [], - "signature": "let matches: result => array", - "deprecated": "" - }, - { - "id": "Js.Re.index", - "kind": "value", - "name": "index", - "docstrings": [ - "0-based index of the match in the input string." - ], - "signature": "let index: result => int", - "deprecated": "" - }, - { - "id": "Js.Re.input", - "kind": "value", - "name": "input", - "docstrings": [ - "The original input string." - ], - "signature": "let input: result => string", - "deprecated": "" - }, - { - "id": "Js.Re.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Constructs a RegExp object (Js.Re.t) from a `string`.\nRegex literals `/.../` should generally be preferred, but `fromString`\nis useful when you need to dynamically construct a regex using strings,\nexactly like when you do so in JavaScript.\n\n## Examples\n\n```rescript\nlet firstReScriptFileExtension = (filename, content) => {\n let result = Js.Re.fromString(filename ++ \"\\.(res|resi)\")->Js.Re.exec_(content)\n switch result {\n | Some(r) => Js.Nullable.toOption(Js.Re.captures(r)[1])\n | None => None\n }\n}\n\n// outputs \"res\"\nfirstReScriptFileExtension(\"School\", \"School.res School.resi Main.js School.bs.js\")\n```" - ], - "signature": "let fromString: string => t", - "deprecated": "" - }, - { - "id": "Js.Re.fromStringWithFlags", - "kind": "value", - "name": "fromStringWithFlags", - "docstrings": [ - "Constructs a RegExp object (`Js.Re.t`) from a string with the given flags.\nSee `Js.Re.fromString`.\n\nValid flags:\n\n- **g** global\n- **i** ignore case\n- **m** multiline\n- **u** unicode (es2015)\n- **y** sticky (es2015)" - ], - "signature": "let fromStringWithFlags: (string, ~flags: string) => t", - "deprecated": "" - }, - { - "id": "Js.Re.flags", - "kind": "value", - "name": "flags", - "docstrings": [ - "Returns the enabled flags as a string." - ], - "signature": "let flags: t => string", - "deprecated": "" - }, - { - "id": "Js.Re.global", - "kind": "value", - "name": "global", - "docstrings": [ - "Returns a `bool` indicating whether the global flag is set." - ], - "signature": "let global: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.ignoreCase", - "kind": "value", - "name": "ignoreCase", - "docstrings": [ - "Returns a `bool` indicating whether the ignoreCase flag is set." - ], - "signature": "let ignoreCase: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.lastIndex", - "kind": "value", - "name": "lastIndex", - "docstrings": [ - "Returns the index where the next match will start its search. This property\nwill be modified when the RegExp object is used, if the global (\"g\") flag is\nset.\n\n## Examples\n\n```rescript\nlet re = /ab*TODO/g\nlet str = \"abbcdefabh\"\n\nlet break = ref(false)\nwhile !break.contents {\n switch Js.Re.exec_(re, str) {\n | Some(result) =>\n Js.Nullable.iter(Js.Re.captures(result)[0], match_ => {\n let next = Belt.Int.toString(Js.Re.lastIndex(re))\n Js.log(\"Found \" ++ (match_ ++ (\". Next match starts at \" ++ next)))\n })\n | None => break := true\n }\n}\n```\n\nSee\n[`RegExp: lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex)\non MDN." - ], - "signature": "let lastIndex: t => int", - "deprecated": "" - }, - { - "id": "Js.Re.setLastIndex", - "kind": "value", - "name": "setLastIndex", - "docstrings": [ - "Sets the index at which the next match will start its search from." - ], - "signature": "let setLastIndex: (t, int) => unit", - "deprecated": "" - }, - { - "id": "Js.Re.multiline", - "kind": "value", - "name": "multiline", - "docstrings": [ - "Returns a `bool` indicating whether the multiline flag is set." - ], - "signature": "let multiline: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.source", - "kind": "value", - "name": "source", - "docstrings": [ - "Returns the pattern as a `string`." - ], - "signature": "let source: t => string", - "deprecated": "" - }, - { - "id": "Js.Re.sticky", - "kind": "value", - "name": "sticky", - "docstrings": [ - "Returns a `bool` indicating whether the sticky flag is set." - ], - "signature": "let sticky: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.unicode", - "kind": "value", - "name": "unicode", - "docstrings": [ - "Returns a `bool` indicating whether the unicode flag is set." - ], - "signature": "let unicode: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.exec_", - "kind": "value", - "name": "exec_", - "docstrings": [ - "Executes a search on a given string using the given RegExp object.\nReturns `Some(Js.Re.result)` if a match is found, `None` otherwise.\n\n## Examples\n\n```rescript\n/* Match \"quick brown\" followed by \"jumps\", ignoring characters in between\n * Remember \"brown\" and \"jumps\"\n * Ignore case\n */\n\nlet re = /quick\\s(brown).+?(jumps)/ig\nlet result = Js.Re.exec_(re, \"The Quick Brown Fox Jumps Over The Lazy Dog\")\n```\n\nSee [`RegExp.prototype.exec()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec)\non MDN." - ], - "signature": "let exec_: (t, string) => option", - "deprecated": "" - }, - { - "id": "Js.Re.test_", - "kind": "value", - "name": "test_", - "docstrings": [ - "Tests whether the given RegExp object will match a given `string`.\nReturns true if a match is found, false otherwise.\n\n## Examples\n\n```rescript\n/* A simple implementation of Js.String.startsWith */\n\nlet str = \"hello world!\"\n\nlet startsWith = (target, substring) => Js.Re.fromString(\"^\" ++ substring)->Js.Re.test_(target)\n\nJs.log(str->startsWith(\"hello\")) /* prints \"true\" */\n```\n\nSee [`RegExp.prototype.test()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test)\non MDN." - ], - "signature": "let test_: (t, string) => bool", - "deprecated": "" - } - ] - }, - "js/string2": { - "id": "Js.String2", - "name": "String2", - "docstrings": [ - "Provide bindings to JS string", - "Provide bindings to JS string. Optimized for pipe-first." - ], - "items": [ - { - "id": "Js.String2.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = string", - "deprecated": "" - }, - { - "id": "Js.String2.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nJs.String2.make(3.5) == \"3.5\"\nJs.String2.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCharCode", - "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to\nthat number; `n` ranges from 0 to 65535.If out of range, the lower 16 bits of\nthe value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as\n`fromCharCode(0xF63A)`.\n\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCharCode(65) == \"A\"\nJs.String2.fromCharCode(0x3c8) == `ψ`\nJs.String2.fromCharCode(0xd55c) == `한`\nJs.String2.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCharCodeMany", - "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`.\n\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)\non MDN." - ], - "signature": "let fromCharCodeMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCodePoint", - "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point. If the number is not a valid code point, it throws\n`RangeError`. Thus, `fromCodePoint(0x1F63A)` will produce a correct value,\nunlike `fromCharCode(0x1F63A)`, and `fromCodePoint(-5)` will throw a\n`RangeError`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePoint(65) == \"A\"\nJs.String2.fromCodePoint(0x3c8) == `ψ`\nJs.String2.fromCodePoint(0xd55c) == `한`\nJs.String2.fromCodePoint(0x1f63a) == `😺`\n```" - ], - "signature": "let fromCodePoint: int => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCodePointMany", - "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```" - ], - "signature": "let fromCodePointMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String2.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(s)` returns the length of the given `string`.\n\nSee [`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.length(\"abcd\") == 4\n```" - ], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.String2.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(s, n)` returns as a `string` the character at the given index number. If\n`n` is out of range, this function returns `undefined`,so at some point this\nfunction may be modified to return `option`.\n\n## Examples\n\n```rescript\nJs.String2.get(\"Reason\", 0) == \"R\"\nJs.String2.get(\"Reason\", 4) == \"o\"\nJs.String2.get(`Rẽasöń`, 5) == `ń`\n```" - ], - "signature": "let get: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.charAt", - "kind": "value", - "name": "charAt", - "docstrings": [ - "`charAt(s, n)` gets the character at index `n` within string `s`. If `n` is\nnegative or greater than the length of `s`, it returns the empty string. If the\nstring contains characters outside the range \\\\u0000-\\\\uffff, it will return the\nfirst 16-bit value at that position in the string.\n\nSee [`String.charAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.charAt(\"Reason\", 0) == \"R\"\nJs.String2.charAt(\"Reason\", 12) == \"\"\nJs.String2.charAt(`Rẽasöń`, 5) == `ń`\n```" - ], - "signature": "let charAt: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.charCodeAt", - "kind": "value", - "name": "charCodeAt", - "docstrings": [ - "`charCodeAt(s, n)` returns the character code at position `n` in string `s`;\nthe result is in the range 0-65535, unlke `codePointAt`, so it will not work\ncorrectly for characters with code points greater than or equal to 0x10000. The\nreturn type is `float` because this function returns NaN if `n` is less than\nzero or greater than the length of the string.\n\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.charCodeAt(`😺`, 0) == 0xd83d->Belt.Int.toFloat\nJs.String2.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" - ], - "signature": "let charCodeAt: (t, int) => float", - "deprecated": "" - }, - { - "id": "Js.String2.codePointAt", - "kind": "value", - "name": "codePointAt", - "docstrings": [ - "`codePointAt(s, n)` returns the code point at position `n` within string `s` as\na `Some(value)`. The return value handles code points greater than or equal to\n0x10000. If there is no code point at the given position, the function returns\n`None`.\n\nSee [`String.codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.codePointAt(`¿😺?`, 1) == Some(0x1f63a)\nJs.String2.codePointAt(\"abc\", 5) == None\n```" - ], - "signature": "let codePointAt: (t, int) => option", - "deprecated": "" - }, - { - "id": "Js.String2.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(original, append)` returns a new `string` with `append` added after\n`original`.\n\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.concat(\"cow\", \"bell\") == \"cowbell\"\n```" - ], - "signature": "let concat: (t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(original, arr)` returns a new `string` consisting of each item of an\narray of strings added to the `original` string.\n\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.concatMany(\"1st\", [\"2nd\", \"3rd\", \"4th\"]) == \"1st2nd3rd4th\"\n```" - ], - "signature": "let concatMany: (t, array) => t", - "deprecated": "" - }, - { - "id": "Js.String2.endsWith", - "kind": "value", - "name": "endsWith", - "docstrings": [ - "ES2015: `endsWith(str, substr)` returns `true` if the `str` ends with `substr`,\n`false` otherwise.\n\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.endsWith(\"ReScript\", \"Script\") == true\nJs.String2.endsWith(\"C++\", \"Script\") == false\n```" - ], - "signature": "let endsWith: (t, t) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.endsWithFrom", - "kind": "value", - "name": "endsWithFrom", - "docstrings": [ - "`endsWithFrom(str, ending, len)` returns `true` if the first len characters of\n`str` end with `ending`, `false` otherwise. If `len` is greater than or equal\nto the length of `str`, then it works like `endsWith`. (Honestly, this should\nhave been named endsWithAt, but oh well).\n\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.endsWithFrom(\"abcd\", \"cd\", 4) == true\nJs.String2.endsWithFrom(\"abcde\", \"cd\", 3) == false\nJs.String2.endsWithFrom(\"abcde\", \"cde\", 99) == true\nJs.String2.endsWithFrom(\"example.dat\", \"ple\", 7) == true\n```" - ], - "signature": "let endsWithFrom: (t, t, int) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "ES2015: `includes(str, searchValue)` returns `true` if `searchValue` is found\nanywhere within `str`, false otherwise.\n\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.includes(\"programmer\", \"gram\") == true\nJs.String2.includes(\"programmer\", \"er\") == true\nJs.String2.includes(\"programmer\", \"pro\") == true\nJs.String2.includes(\"programmer.dat\", \"xyz\") == false\n```" - ], - "signature": "let includes: (t, t) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.includesFrom", - "kind": "value", - "name": "includesFrom", - "docstrings": [ - "ES2015: `includes(str, searchValue start)` returns `true` if `searchValue` is\nfound anywhere within `str` starting at character number `start` (where 0 is\nthe first character), `false` otherwise.\n\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.includesFrom(\"programmer\", \"gram\", 1) == true\nJs.String2.includesFrom(\"programmer\", \"gram\", 4) == false\nJs.String2.includesFrom(`대한민국`, `한`, 1) == true\n```" - ], - "signature": "let includesFrom: (t, t, int) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "ES2015: `indexOf(str, searchValue)` returns the position at which `searchValue`\nwas first found within `str`, or -1 if `searchValue` is not in `str`.\n\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.indexOf(\"bookseller\", \"ok\") == 2\nJs.String2.indexOf(\"bookseller\", \"sell\") == 4\nJs.String2.indexOf(\"beekeeper\", \"ee\") == 1\nJs.String2.indexOf(\"bookseller\", \"xyz\") == -1\n```" - ], - "signature": "let indexOf: (t, t) => int", - "deprecated": "" - }, - { - "id": "Js.String2.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "`indexOfFrom(str, searchValue, start)` returns the position at which\n`searchValue` was found within `str` starting at character position `start`, or\n\\-1 if `searchValue` is not found in that portion of `str`. The return value is\nrelative to the beginning of the string, no matter where the search started\nfrom.\n\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.indexOfFrom(\"bookseller\", \"ok\", 1) == 2\nJs.String2.indexOfFrom(\"bookseller\", \"sell\", 2) == 4\nJs.String2.indexOfFrom(\"bookseller\", \"sell\", 5) == -1\n```" - ], - "signature": "let indexOfFrom: (t, t, int) => int", - "deprecated": "" - }, - { - "id": "Js.String2.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(str, searchValue)` returns the position of the last occurrence of\n`searchValue` within `str`, searching backwards from the end of the string.\nReturns -1 if `searchValue` is not in `str`. The return value is always\nrelative to the beginning of the string.\n\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.lastIndexOf(\"bookseller\", \"ok\") == 2\nJs.String2.lastIndexOf(\"beekeeper\", \"ee\") == 4\nJs.String2.lastIndexOf(\"abcdefg\", \"xyz\") == -1\n```" - ], - "signature": "let lastIndexOf: (t, t) => int", - "deprecated": "" - }, - { - "id": "Js.String2.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "`lastIndexOfFrom(str, searchValue, start)` returns the position of the last\noccurrence of `searchValue` within `str`, searching backwards from the given\nstart position. Returns -1 if `searchValue` is not in `str`. The return value\nis always relative to the beginning of the string.\n\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.lastIndexOfFrom(\"bookseller\", \"ok\", 6) == 2\nJs.String2.lastIndexOfFrom(\"beekeeper\", \"ee\", 8) == 4\nJs.String2.lastIndexOfFrom(\"beekeeper\", \"ee\", 3) == 1\nJs.String2.lastIndexOfFrom(\"abcdefg\", \"xyz\", 4) == -1\n```" - ], - "signature": "let lastIndexOfFrom: (t, t, int) => int", - "deprecated": "" - }, - { - "id": "Js.String2.localeCompare", - "kind": "value", - "name": "localeCompare", - "docstrings": [ - "`localeCompare(reference, comparison)` returns\n- a negative value if reference comes before comparison in sort order\n- zero if reference and comparison have the same sort order\n- a positive value if reference comes after comparison in sort order\n\nSee [`String.localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.localeCompare(\"zebra\", \"ant\") > 0.0\nJs.String2.localeCompare(\"ant\", \"zebra\") < 0.0\nJs.String2.localeCompare(\"cat\", \"cat\") == 0.0\nJs.String2.localeCompare(\"CAT\", \"cat\") > 0.0\n```" - ], - "signature": "let localeCompare: (t, t) => float", - "deprecated": "" - }, - { - "id": "Js.String2.match_", - "kind": "value", - "name": "match_", - "docstrings": [ - "`match(str, regexp)` matches a `string` against the given `regexp`. If there is\nno match, it returns `None`. For regular expressions without the g modifier, if\nthere is a match, the return value is `Some(array)` where the array contains:\n- The entire matched string\n- Any capture groups if the regexp had parentheses\n For regular expressions with the g modifier, a matched expression returns\n `Some(array)` with all the matched substrings and no capture groups.\n\nSee [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.match_(\"The better bats\", /b[aeiou]t/) == Some([\"bet\"])\nJs.String2.match_(\"The better bats\", /b[aeiou]t/g) == Some([\"bet\", \"bat\"])\nJs.String2.match_(\"Today is 2018-04-05.\", /(\\d+)-(\\d+)-(\\d+)/) ==\n Some([\"2018-04-05\", \"2018\", \"04\", \"05\"])\nJs.String2.match_(\"The large container.\", /b[aeiou]g/) == None\n```" - ], - "signature": "let match_: (t, Js_re.t) => option>>", - "deprecated": "" - }, - { - "id": "Js.String2.normalize", - "kind": "value", - "name": "normalize", - "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\u00e3 or the combination of a lower case letter A\n\\u0061 and a combining tilde \\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)\non MDN. See also [Unicode technical report\n#15](https://unicode.org/reports/tr15/) for details." - ], - "signature": "let normalize: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.normalizeByForm", - "kind": "value", - "name": "normalizeByForm", - "docstrings": [ - "ES2015: `normalize(str, form)` returns the normalized Unicode string using the\nspecified form of normalization, which may be one of:\n- \"NFC\" — Normalization Form Canonical Composition.\n- \"NFD\" — Normalization Form Canonical Decomposition.\n- \"NFKC\" — Normalization Form Compatibility Composition.\n- \"NFKD\" — Normalization Form Compatibility Decomposition.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\nSee also [Unicode technical report #15](https://unicode.org/reports/tr15/) for details." - ], - "signature": "let normalizeByForm: (t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.repeat", - "kind": "value", - "name": "repeat", - "docstrings": [ - "`repeat(str, n)` returns a `string` that consists of `n` repetitions of `str`.\nThrows `RangeError` if `n` is negative.\n\nSee [`String.repeat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.repeat(\"ha\", 3) == \"hahaha\"\nJs.String2.repeat(\"empty\", 0) == \"\"\n```" - ], - "signature": "let repeat: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.replace", - "kind": "value", - "name": "replace", - "docstrings": [ - "ES2015: `replace(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with the first matching instance of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.replace(\"old string\", \"old\", \"new\") == \"new string\"\nJs.String2.replace(\"the cat and the dog\", \"the\", \"this\") == \"this cat and the dog\"\n```" - ], - "signature": "let replace: (t, t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.replaceByRe", - "kind": "value", - "name": "replaceByRe", - "docstrings": [ - "`replaceByRe(str, regex, replacement)` returns a new `string` where occurrences\nmatching regex have been replaced by `replacement`.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.replaceByRe(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nJs.String2.replaceByRe(\"Juan Fulano\", /(\\w+) (\\w+)/, \"$2, $1\") == \"Fulano, Juan\"\n```" - ], - "signature": "let replaceByRe: (t, Js_re.t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy0", - "kind": "value", - "name": "unsafeReplaceBy0", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with no capturing\nparentheses replaced by the value returned from the given function. The\nfunction receives as its parameters the matched string, the offset at which the\nmatch begins, and the whole string being matched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (matchPart, _offset, _wholeString) => Js.String2.toUpperCase(matchPart)\n\nJs.String2.unsafeReplaceBy0(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" - ], - "signature": "let unsafeReplaceBy0: (t, Js_re.t, (t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy1", - "kind": "value", - "name": "unsafeReplaceBy1", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with one set of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstring, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (_match, part1, _offset, _wholeString) => {\n part1 ++ \"41\"\n}\n\nJs.String2.unsafeReplaceBy1(str, re, matchFn) == \"Jony is 41\"\n```" - ], - "signature": "let unsafeReplaceBy1: (t, Js_re.t, (t, t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy2", - "kind": "value", - "name": "unsafeReplaceBy2", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with two sets of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstrings, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (_match, p1, p2, _offset, _wholeString) => {\n switch (Belt.Int.fromString(p1), Belt.Int.fromString(p2)) {\n | (Some(x), Some(y)) => Belt.Int.toString(x * y)\n | _ => \"???\"\n }\n}\n\nJs.String2.unsafeReplaceBy2(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let unsafeReplaceBy2: (t, Js_re.t, (t, t, t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy3", - "kind": "value", - "name": "unsafeReplaceBy3", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with three sets of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstrings, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN." - ], - "signature": "let unsafeReplaceBy3: (t, Js_re.t, (t, t, t, t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.search", - "kind": "value", - "name": "search", - "docstrings": [ - "`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\n\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.search(\"testing 1 2 3\", /\\d+/) == 8\nJs.String2.search(\"no numbers\", /\\d+/) == -1\n```" - ], - "signature": "let search: (t, Js_re.t) => int", - "deprecated": "" - }, - { - "id": "Js.String2.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(str, from:n1, to_:n2)` returns the substring of `str` starting at\ncharacter `n1` up to but not including `n2`.\n- If either `n1` or `n2` is negative, then it is evaluated as `length(str - n1)` or `length(str - n2)`.\n- If `n2` is greater than the length of `str`, then it is treated as `length(str)`.\n- If `n1` is greater than `n2`, slice returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=5) == \"cde\"\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=9) == \"cdefg\"\nJs.String2.slice(\"abcdefg\", ~from=-4, ~to_=-2) == \"de\"\nJs.String2.slice(\"abcdefg\", ~from=5, ~to_=1) == \"\"\n```" - ], - "signature": "let slice: (t, ~from: int, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(str, from:n)` returns the substring of `str` starting at character\n`n` to the end of the string.\n- If `n` is negative, then it is evaluated as `length(str - n)`.\n- If `n` is greater than the length of `str`, then sliceToEnd returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.sliceToEnd(\"abcdefg\", ~from=4) == \"efg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=-2) == \"fg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=7) == \"\"\n```" - ], - "signature": "let sliceToEnd: (t, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nJs.String2.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nJs.String2.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nJs.String2.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```" - ], - "signature": "let split: (t, t) => array", - "deprecated": "" - }, - { - "id": "Js.String2.splitAtMost", - "kind": "value", - "name": "splitAtMost", - "docstrings": [ - "`splitAtMost delimiter ~limit: n str` splits the given `str` at every occurrence of `delimiter` and returns an array of the first `n` resulting substrings. If `n` is negative or greater than the number of substrings, the array will contain all the substrings.\n\n```\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 3 = [|\"ant\"; \"bee\"; \"cat\"|];;\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 0 = [| |];;\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 9 = [|\"ant\"; \"bee\"; \"cat\"; \"dog\"; \"elk\"|];;\n```" - ], - "signature": "let splitAtMost: (t, t, ~limit: int) => array", - "deprecated": "" - }, - { - "id": "Js.String2.splitByRe", - "kind": "value", - "name": "splitByRe", - "docstrings": [ - "`splitByRe(str, regex)` splits the given `str` at every occurrence of `regex`\nand returns an array of the resulting substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.splitByRe(\"art; bed , cog ;dad\", /\\s*[,;]\\s*TODO/) == [\n Some(\"art\"),\n Some(\"bed\"),\n Some(\"cog\"),\n Some(\"dad\"),\n ]\n```" - ], - "signature": "let splitByRe: (t, Js_re.t) => array>", - "deprecated": "" - }, - { - "id": "Js.String2.splitByReAtMost", - "kind": "value", - "name": "splitByReAtMost", - "docstrings": [ - "`splitByReAtMost(str, regex, ~limit:n)` splits the given `str` at every\noccurrence of `regex` and returns an array of the first `n` resulting\nsubstrings. If `n` is negative or greater than the number of substrings, the\narray will contain all the substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=3) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n ]\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=0) == []\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=8) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n Some(\"four\"),\n ]\n```" - ], - "signature": "let splitByReAtMost: (t, Js_re.t, ~limit: int) => array>", - "deprecated": "" - }, - { - "id": "Js.String2.startsWith", - "kind": "value", - "name": "startsWith", - "docstrings": [ - "ES2015: `startsWith(str, substr)` returns `true` if the `str` starts with\n`substr`, `false` otherwise.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWith(\"ReScript\", \"Re\") == true\nJs.String2.startsWith(\"ReScript\", \"\") == true\nJs.String2.startsWith(\"JavaScript\", \"Re\") == false\n```" - ], - "signature": "let startsWith: (t, t) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.startsWithFrom", - "kind": "value", - "name": "startsWithFrom", - "docstrings": [ - "ES2015: `startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, false otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWithFrom(\"ReScript\", \"Scri\", 2) == true\nJs.String2.startsWithFrom(\"ReScript\", \"\", 2) == true\nJs.String2.startsWithFrom(\"JavaScript\", \"Scri\", 2) == false\n```" - ], - "signature": "let startsWithFrom: (t, t, int) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.substr", - "kind": "value", - "name": "substr", - "docstrings": [ - "`substr(str, ~from:n)` returns the substring of `str` from position `n` to the\nend of the string.\n- If `n` is less than zero, the starting position is the length of `str - n`.\n- If `n` is greater than or equal to the length of `str`, returns the empty string.\n\nJavaScript’s `String.substr()` is a legacy function. When possible, use\n`substring()` instead.\n\nSee [`String.substr`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.substr(\"abcdefghij\", ~from=3) == \"defghij\"\nJs.String2.substr(\"abcdefghij\", ~from=-3) == \"hij\"\nJs.String2.substr(\"abcdefghij\", ~from=12) == \"\"\n```" - ], - "signature": "let substr: (t, ~from: int) => t", - "deprecated": "Use `String.substring` instead" - }, - { - "id": "Js.String2.substrAtMost", - "kind": "value", - "name": "substrAtMost", - "docstrings": [ - "`substrAtMost(str, ~from: pos, ~length: n)` returns the substring of `str` of\nlength `n` starting at position `pos`.\n- If `pos` is less than zero, the starting position is the length of `str - pos`.\n- If `pos` is greater than or equal to the length of `str`, returns the empty string.\n- If `n` is less than or equal to zero, returns the empty string.\n\nJavaScript’s `String.substr()` is a legacy function. When possible, use\n`substring()` instead.\n\nSee [`String.substr`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.substrAtMost(\"abcdefghij\", ~from=3, ~length=4) == \"defg\"\nJs.String2.substrAtMost(\"abcdefghij\", ~from=-3, ~length=4) == \"hij\"\nJs.String2.substrAtMost(\"abcdefghij\", ~from=12, ~length=2) == \"\"\n```" - ], - "signature": "let substrAtMost: (t, ~from: int, ~length: int) => t", - "deprecated": "Use `String.substringAtMost` instead" - }, - { - "id": "Js.String2.substring", - "kind": "value", - "name": "substring", - "docstrings": [ - "`substring(str, ~from: start, ~to_: finish)` returns characters `start` up to\nbut not including finish from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `finish` is zero or negative, the empty string is returned.\n- If `start` is greater than `finish`, the `start` and `finish` points are swapped.\n\nSee [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.substring(\"playground\", ~from=3, ~to_=6) == \"ygr\"\nJs.String2.substring(\"playground\", ~from=6, ~to_=3) == \"ygr\"\nJs.String2.substring(\"playground\", ~from=4, ~to_=12) == \"ground\"\n```" - ], - "signature": "let substring: (t, ~from: int, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.substringToEnd", - "kind": "value", - "name": "substringToEnd", - "docstrings": [ - "`substringToEnd(str, ~from: start)` returns the substring of `str` from\nposition `start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string is returned.\n\nSee [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.substringToEnd(\"playground\", ~from=4) == \"ground\"\nJs.String2.substringToEnd(\"playground\", ~from=-3) == \"playground\"\nJs.String2.substringToEnd(\"playground\", ~from=12) == \"\"\n```" - ], - "signature": "let substringToEnd: (t, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.toLowerCase", - "kind": "value", - "name": "toLowerCase", - "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms; one when it is the last\ncharacter in a string and another when it is not.\n\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.toLowerCase(\"ABC\") == \"abc\"\nJs.String2.toLowerCase(`ΣΠ`) == `σπ`\nJs.String2.toLowerCase(`ΠΣ`) == `πς`\n```" - ], - "signature": "let toLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.toLocaleLowerCase", - "kind": "value", - "name": "toLocaleLowerCase", - "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase)\non MDN." - ], - "signature": "let toLocaleLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.toUpperCase", - "kind": "value", - "name": "toUpperCase", - "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result; for example the German ß\ncapitalizes to two Ses in a row.\n\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.toUpperCase(\"abc\") == \"ABC\"\nJs.String2.toUpperCase(`Straße`) == `STRASSE`\nJs.String2.toUpperCase(`πς`) == `ΠΣ`\n```" - ], - "signature": "let toUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.toLocaleUpperCase", - "kind": "value", - "name": "toLocaleUpperCase", - "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\nSee [`String.to:LocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\non MDN." - ], - "signature": "let toLocaleUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.trim", - "kind": "value", - "name": "trim", - "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\n\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.trim(\" abc def \") == \"abc def\"\nJs.String2.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" - ], - "signature": "let trim: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.anchor", - "kind": "value", - "name": "anchor", - "docstrings": [ - "`anchor(anchorText, anchorName)` creates a string with an HTML `` element\nwith name attribute of `anchorName` and `anchorText` as its content. Please do\nnot use this method, as it has been removed from the relevant web standards.\n\nSee [`String.anchor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/anchor)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.anchor(\"Page One\", \"page1\") == \"Page One\"\n```" - ], - "signature": "let anchor: (t, t) => t", - "deprecated": "This function has been removed from the relevant web standards." - }, - { - "id": "Js.String2.link", - "kind": "value", - "name": "link", - "docstrings": [ - "ES2015: `link(linkText, urlText)` creates a string with an HTML `` element\nwith href attribute of `urlText` and `linkText` as its content. Please do not\nuse this method, as it has been removed from the relevant web standards. See\n[`String.link`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/link)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.link(\"Go to page two\", \"page2.html\") == \"Go to page two\"\n```" - ], - "signature": "let link: (t, t) => t", - "deprecated": "This function has been removed from the relevant web standards." - }, - { - "id": "Js.String2.castToArrayLike", - "kind": "value", - "name": "castToArrayLike", - "docstrings": [ - "Casts its argument to an `array_like` entity that can be processed by functions\nsuch as `Js.Array2.fromMap()`\n\n## Examples\n\n```rescript\nlet s = \"abcde\"\nlet arr = Js.Array2.fromMap(Js.String2.castToArrayLike(s), x => x)\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let castToArrayLike: t => Js_array2.array_like", - "deprecated": "" - } - ] - }, - "js/string": { - "id": "Js.String", - "name": "String", - "docstrings": [ - "Provide bindings to JS string", - "JavaScript String API" - ], - "items": [ - { - "id": "Js.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = string", - "deprecated": "" - }, - { - "id": "Js.String.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nJs.String2.make(3.5) == \"3.5\"\nJs.String2.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCharCode", - "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to that number; `n` ranges from 0 to 65535.\nIf out of range, the lower 16 bits of the value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as `fromCharCode(0xF63A)`. See [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCharCode(65) == \"A\"\nJs.String2.fromCharCode(0x3c8) == `ψ`\nJs.String2.fromCharCode(0xd55c) == `한`\nJs.String2.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCharCodeMany", - "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`. See\n[`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)\non MDN." - ], - "signature": "let fromCharCodeMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCodePoint", - "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point. If the number is not a valid code point, it throws\n`RangeError`.Thus, `fromCodePoint(0x1F63A)` will produce a correct value,\nunlike `fromCharCode(0x1F63A)`, and `fromCodePoint(-5)` will throw a\n`RangeError`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePoint(65) == \"A\"\nJs.String2.fromCodePoint(0x3c8) == `ψ`\nJs.String2.fromCodePoint(0xd55c) == `한`\nJs.String2.fromCodePoint(0x1f63a) == `😺`\n```" - ], - "signature": "let fromCodePoint: int => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCodePointMany", - "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```" - ], - "signature": "let fromCodePointMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(s)` returns the length of the given `string`. See\n[`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.length(\"abcd\") == 4\n```" - ], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.String.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(s, n)` returns as a `string` the character at the given index number. If\n`n` is out of range, this function returns `undefined`, so at some point this\nfunction may be modified to return `option`.\n\n## Examples\n\n```rescript\nJs.String2.get(\"Reason\", 0) == \"R\"\nJs.String2.get(\"Reason\", 4) == \"o\"\nJs.String2.get(`Rẽasöń`, 5) == `ń`\n```" - ], - "signature": "let get: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String.charAt", - "kind": "value", - "name": "charAt", - "docstrings": [], - "signature": "let charAt: (int, t) => t" - }, - { - "id": "Js.String.charCodeAt", - "kind": "value", - "name": "charCodeAt", - "docstrings": [], - "signature": "let charCodeAt: (int, t) => float" - }, - { - "id": "Js.String.codePointAt", - "kind": "value", - "name": "codePointAt", - "docstrings": [], - "signature": "let codePointAt: (int, t) => option" - }, - { - "id": "Js.String.concat", - "kind": "value", - "name": "concat", - "docstrings": [], - "signature": "let concat: (t, t) => t" - }, - { - "id": "Js.String.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [], - "signature": "let concatMany: (array, t) => t" - }, - { - "id": "Js.String.endsWith", - "kind": "value", - "name": "endsWith", - "docstrings": [], - "signature": "let endsWith: (t, t) => bool" - }, - { - "id": "Js.String.endsWithFrom", - "kind": "value", - "name": "endsWithFrom", - "docstrings": [], - "signature": "let endsWithFrom: (t, int, t) => bool" - }, - { - "id": "Js.String.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, t) => bool" - }, - { - "id": "Js.String.includesFrom", - "kind": "value", - "name": "includesFrom", - "docstrings": [], - "signature": "let includesFrom: (t, int, t) => bool" - }, - { - "id": "Js.String.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, t) => int" - }, - { - "id": "Js.String.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, int, t) => int" - }, - { - "id": "Js.String.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, t) => int" - }, - { - "id": "Js.String.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, int, t) => int" - }, - { - "id": "Js.String.localeCompare", - "kind": "value", - "name": "localeCompare", - "docstrings": [], - "signature": "let localeCompare: (t, t) => float" - }, - { - "id": "Js.String.match_", - "kind": "value", - "name": "match_", - "docstrings": [], - "signature": "let match_: (Js_re.t, t) => option>>" - }, - { - "id": "Js.String.normalize", - "kind": "value", - "name": "normalize", - "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\u00e3 or the combination of a lower case letter A\n\\u0061 and a combining tilde \\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)\non MDN.\n\nSee also [Unicode technical report #15](https://unicode.org/reports/tr15/) for\ndetails." - ], - "signature": "let normalize: t => t", - "deprecated": "" - }, - { - "id": "Js.String.normalizeByForm", - "kind": "value", - "name": "normalizeByForm", - "docstrings": [], - "signature": "let normalizeByForm: (t, t) => t" - }, - { - "id": "Js.String.repeat", - "kind": "value", - "name": "repeat", - "docstrings": [], - "signature": "let repeat: (int, t) => t" - }, - { - "id": "Js.String.replace", - "kind": "value", - "name": "replace", - "docstrings": [], - "signature": "let replace: (t, t, t) => t" - }, - { - "id": "Js.String.replaceByRe", - "kind": "value", - "name": "replaceByRe", - "docstrings": [], - "signature": "let replaceByRe: (Js_re.t, t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy0", - "kind": "value", - "name": "unsafeReplaceBy0", - "docstrings": [], - "signature": "let unsafeReplaceBy0: (Js_re.t, (t, int, t) => t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy1", - "kind": "value", - "name": "unsafeReplaceBy1", - "docstrings": [], - "signature": "let unsafeReplaceBy1: (Js_re.t, (t, t, int, t) => t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy2", - "kind": "value", - "name": "unsafeReplaceBy2", - "docstrings": [], - "signature": "let unsafeReplaceBy2: (Js_re.t, (t, t, t, int, t) => t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy3", - "kind": "value", - "name": "unsafeReplaceBy3", - "docstrings": [], - "signature": "let unsafeReplaceBy3: (Js_re.t, (t, t, t, t, int, t) => t, t) => t" - }, - { - "id": "Js.String.search", - "kind": "value", - "name": "search", - "docstrings": [], - "signature": "let search: (Js_re.t, t) => int" - }, - { - "id": "Js.String.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~from: int, ~to_: int, t) => t" - }, - { - "id": "Js.String.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [], - "signature": "let sliceToEnd: (~from: int, t) => t" - }, - { - "id": "Js.String.split", - "kind": "value", - "name": "split", - "docstrings": [], - "signature": "let split: (t, t) => array" - }, - { - "id": "Js.String.splitAtMost", - "kind": "value", - "name": "splitAtMost", - "docstrings": [], - "signature": "let splitAtMost: (t, ~limit: int, t) => array" - }, - { - "id": "Js.String.splitByRe", - "kind": "value", - "name": "splitByRe", - "docstrings": [], - "signature": "let splitByRe: (Js_re.t, t) => array>" - }, - { - "id": "Js.String.splitByReAtMost", - "kind": "value", - "name": "splitByReAtMost", - "docstrings": [], - "signature": "let splitByReAtMost: (Js_re.t, ~limit: int, t) => array>" - }, - { - "id": "Js.String.startsWith", - "kind": "value", - "name": "startsWith", - "docstrings": [], - "signature": "let startsWith: (t, t) => bool" - }, - { - "id": "Js.String.startsWithFrom", - "kind": "value", - "name": "startsWithFrom", - "docstrings": [], - "signature": "let startsWithFrom: (t, int, t) => bool" - }, - { - "id": "Js.String.substr", - "kind": "value", - "name": "substr", - "docstrings": [], - "signature": "let substr: (~from: int, t) => t" - }, - { - "id": "Js.String.substrAtMost", - "kind": "value", - "name": "substrAtMost", - "docstrings": [], - "signature": "let substrAtMost: (~from: int, ~length: int, t) => t" - }, - { - "id": "Js.String.substring", - "kind": "value", - "name": "substring", - "docstrings": [], - "signature": "let substring: (~from: int, ~to_: int, t) => t" - }, - { - "id": "Js.String.substringToEnd", - "kind": "value", - "name": "substringToEnd", - "docstrings": [], - "signature": "let substringToEnd: (~from: int, t) => t" - }, - { - "id": "Js.String.toLowerCase", - "kind": "value", - "name": "toLowerCase", - "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms; one when it is the last\ncharacter in a string and another when it is not.\n\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.toLowerCase(\"ABC\") == \"abc\"\nJs.String.toLowerCase(`ΣΠ`) == `σπ`\nJs.String.toLowerCase(`ΠΣ`) == `πς`\n```" - ], - "signature": "let toLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.toLocaleLowerCase", - "kind": "value", - "name": "toLocaleLowerCase", - "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\n\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase)\non MDN." - ], - "signature": "let toLocaleLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.toUpperCase", - "kind": "value", - "name": "toUpperCase", - "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result; for example the German ß\ncapitalizes to two Ses in a row.\n\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.toUpperCase(\"abc\") == \"ABC\"\nJs.String.toUpperCase(`Straße`) == `STRASSE`\nJs.String.toUpperCase(`πς`) == `ΠΣ`\n```" - ], - "signature": "let toUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.toLocaleUpperCase", - "kind": "value", - "name": "toLocaleUpperCase", - "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\n\nSee [`String.to:LocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\non MDN." - ], - "signature": "let toLocaleUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.trim", - "kind": "value", - "name": "trim", - "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\n\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.trim(\" abc def \") == \"abc def\"\nJs.String.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" - ], - "signature": "let trim: t => t", - "deprecated": "" - }, - { - "id": "Js.String.anchor", - "kind": "value", - "name": "anchor", - "docstrings": [], - "signature": "let anchor: (t, t) => t" - }, - { - "id": "Js.String.link", - "kind": "value", - "name": "link", - "docstrings": [], - "signature": "let link: (t, t) => t" - }, - { - "id": "Js.String.castToArrayLike", - "kind": "value", - "name": "castToArrayLike", - "docstrings": [ - "Casts its argument to an `array_like` entity that can be processed by functions\nsuch as `Js.Array2.fromMap()`\n\n## Examples\n\n```rescript\nlet s = \"abcde\"\nlet arr = Js.Array2.fromMap(Js.String.castToArrayLike(s), x => x)\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let castToArrayLike: t => Js_array2.array_like", - "deprecated": "This has been deprecated and will be removed in v13. Use functions from the `String` module instead." - } - ] - }, - "js/array2": { - "id": "Js.Array2", - "name": "Array2", - "docstrings": [ - "Provide bindings to JS array", - "Provides bindings to JavaScript’s `Array` functions. These bindings are optimized for pipe-first (`->`), where the array to be processed is the first parameter in the function.\n\nHere is an example to find the sum of squares of all even numbers in an array.\nWithout pipe first, we must call the functions in reverse order:\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nlet square = x => x * x\nlet result = {\n open Js.Array2\n reduce(map(filter([5, 2, 3, 4, 1], isEven), square), \"+\", 0)\n}\n```\n\nWith pipe first, we call the functions in the “natural” order:\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nlet square = x => x * x\nlet result = {\n open Js.Array2\n [5, 2, 3, 4, 1]->filter(isEven)->map(square)->reduce(\"+\", 0)\n}\n```" - ], - "items": [ - { - "id": "Js.Array2.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type used to describe a JavaScript array." - ], - "signature": "type t<'a> = array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [ - "A type used to describe JavaScript objects that are like an array or are iterable." - ], - "signature": "type array_like<'a> = Array.arrayLike<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.from", - "kind": "value", - "name": "from", - "docstrings": [ - "Creates a shallow copy of an array from an array-like object. See\n[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\non MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nJs.Array2.from(strArr) == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let from: array_like<'a> => array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fromMap", - "kind": "value", - "name": "fromMap", - "docstrings": [ - "Creates a new array by applying a function (the second argument) to each item\nin the `array_like` first argument. See\n[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\non MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nlet code = s => Js.String.charCodeAt(0, s)\nJs.Array2.fromMap(strArr, code) == [97.0, 98.0, 99.0, 100.0]\n```" - ], - "signature": "let fromMap: (array_like<'a>, 'a => 'b) => array<'b>", - "deprecated": "" - }, - { - "id": "Js.Array2.isArray", - "kind": "value", - "name": "isArray", - "docstrings": [ - "Returns `true` if its argument is an array; `false` otherwise. This is a runtime check, which is why the second example returns `true`\\---a list is internally represented as a nested JavaScript array.\n\n## Examples\n\n```rescript\nJs.Array2.isArray([5, 2, 3, 1, 4]) == true\nJs.Array2.isArray(list{5, 2, 3, 1, 4}) == true\nJs.Array2.isArray(\"abcd\") == false\n```" - ], - "signature": "let isArray: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Returns the number of elements in the array. See\n[`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length)\non MDN." - ], - "signature": "let length: array<'a> => int", - "deprecated": "" - }, - { - "id": "Js.Array2.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [ - "Copies from the first element in the given array to the designated `~to_`\nposition, returning the resulting array. *This function modifies the original\narray.* See\n[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.copyWithin(arr, ~to_=2) == [100, 101, 100, 101, 102]\narr == [100, 101, 100, 101, 102]\n```" - ], - "signature": "let copyWithin: (t<'a>, ~to_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [ - "Copies starting at element `~from` in the given array to the designated `~to_`\nposition, returning the resulting array. *This function modifies the original\narray.* See\n[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.copyWithinFrom(arr, ~from=2, ~to_=0) == [102, 103, 104, 103, 104]\narr == [102, 103, 104, 103, 104]\n```" - ], - "signature": "let copyWithinFrom: (t<'a>, ~to_: int, ~from: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [ - "Copies starting at element `~start` in the given array up to but not including\n`~end_` to the designated `~to_` position, returning the resulting array. *This\nfunction modifies the original array.* See\n[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105]\nJs.Array2.copyWithinFromRange(arr, ~start=2, ~end_=5, ~to_=1) == [100, 102, 103, 104, 104, 105]\narr == [100, 102, 103, 104, 104, 105]\n```" - ], - "signature": "let copyWithinFromRange: (t<'a>, ~to_: int, ~start: int, ~end_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [ - "Sets all elements of the given array (the first arumgent) to the designated\nvalue (the secon argument), returning the resulting array. *This function\nmodifies the original array.*\n\nSee\n[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.fillInPlace(arr, 99) == [99, 99, 99, 99, 99]\narr == [99, 99, 99, 99, 99]\n```" - ], - "signature": "let fillInPlace: (t<'a>, 'a) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [ - "Sets all elements of the given array (the first arumgent) from position `~from`\nto the end to the designated value (the second argument), returning the\nresulting array. *This function modifies the original array.* See\n[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.fillFromInPlace(arr, 99, ~from=2) == [100, 101, 99, 99, 99]\narr == [100, 101, 99, 99, 99]\n```" - ], - "signature": "let fillFromInPlace: (t<'a>, 'a, ~from: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [ - "Sets the elements of the given array (the first arumgent) from position\n`~start` up to but not including position `~end_` to the designated value (the\nsecond argument), returning the resulting array. *This function modifies the\noriginal array.* See\n[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.fillRangeInPlace(arr, 99, ~start=1, ~end_=4) == [100, 99, 99, 99, 104]\narr == [100, 99, 99, 99, 104]\n```" - ], - "signature": "let fillRangeInPlace: (t<'a>, 'a, ~start: int, ~end_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "If the array is not empty, removes the last element and returns it as\n`Some(value)`; returns `None` if the array is empty. *This function modifies\nthe original array.* See\n[`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.pop(arr) == Some(104)\narr == [100, 101, 102, 103]\n\nlet empty: array = []\nJs.Array2.pop(empty) == None\n```" - ], - "signature": "let pop: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.push", - "kind": "value", - "name": "push", - "docstrings": [ - "Appends the given value to the array, returning the number of elements in the\nupdated array. *This function modifies the original array.* See\n[`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array2.push(arr, \"dog\") == 4\narr == [\"ant\", \"bee\", \"cat\", \"dog\"]\n```" - ], - "signature": "let push: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.pushMany", - "kind": "value", - "name": "pushMany", - "docstrings": [ - "Appends the values from one array (the second argument) to another (the first\nargument), returning the number of elements in the updated array. *This\nfunction modifies the original array.* See\n[`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array2.pushMany(arr, [\"dog\", \"elk\"]) == 5\narr == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```" - ], - "signature": "let pushMany: (t<'a>, array<'a>) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [ - "Returns an array with the elements of the input array in reverse order. *This\nfunction modifies the original array.* See\n[`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array2.reverseInPlace(arr) == [\"cat\", \"bee\", \"ant\"]\narr == [\"cat\", \"bee\", \"ant\"]\n```" - ], - "signature": "let reverseInPlace: t<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.shift", - "kind": "value", - "name": "shift", - "docstrings": [ - "If the array is not empty, removes the first element and returns it as\n`Some(value)`; returns `None` if the array is empty. *This function modifies\nthe original array.* See\n[`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.shift(arr) == Some(100)\narr == [101, 102, 103, 104]\n\nlet empty: array = []\nJs.Array2.shift(empty) == None\n```" - ], - "signature": "let shift: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [ - "Sorts the given array in place and returns the sorted array. JavaScript sorts\nthe array by converting the arguments to UTF-16 strings and sorting them. See\nthe second example with sorting numbers, which does not do a numeric sort.\n*This function modifies the original array.* See\n[`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\non MDN.\n\n## Examples\n\n```rescript\nlet words = [\"bee\", \"dog\", \"ant\", \"cat\"]\nJs.Array2.sortInPlace(words) == [\"ant\", \"bee\", \"cat\", \"dog\"]\nwords == [\"ant\", \"bee\", \"cat\", \"dog\"]\n\nlet numbers = [3, 30, 10, 1, 20, 2]\nJs.Array2.sortInPlace(numbers) == [1, 10, 2, 20, 3, 30]\nnumbers == [1, 10, 2, 20, 3, 30]\n```" - ], - "signature": "let sortInPlace: t<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [ - "Sorts the given array in place and returns the sorted array. *This function\nmodifies the original array.*\n\nThe first argument to `sortInPlaceWith()` is a function that compares two items\nfrom the array and returns:\n\n* an integer less than zero if the first item is less than the second item \\*\n zero if the items are equal \\* an integer greater than zero if the first item is\n greater than the second item\n\nSee\n[`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\non MDN.\n\n## Examples\n\n```rescript\n// sort by word length\nlet words = [\"horse\", \"aardvark\", \"dog\", \"camel\"]\nlet byLength = (s1, s2) => Js.String.length(s1) - Js.String.length(s2)\n\nJs.Array2.sortInPlaceWith(words, byLength) == [\"dog\", \"horse\", \"camel\", \"aardvark\"]\n\n// sort in reverse numeric order\nlet numbers = [3, 30, 10, 1, 20, 2]\nlet reverseNumeric = (n1, n2) => n2 - n1\nJs.Array2.sortInPlaceWith(numbers, reverseNumeric) == [30, 20, 10, 3, 2, 1]\n```" - ], - "signature": "let sortInPlaceWith: (t<'a>, ('a, 'a) => int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.spliceInPlace", - "kind": "value", - "name": "spliceInPlace", - "docstrings": [ - "Starting at position `~pos`, remove `~remove` elements and then add the\nelements from the `~add` array. Returns an array consisting of the removed\nitems. *This function modifies the original array.* See\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.spliceInPlace(arr, ~pos=2, ~remove=2, ~add=[\"x\", \"y\", \"z\"]) == [\"c\", \"d\"]\narr == [\"a\", \"b\", \"x\", \"y\", \"z\", \"e\", \"f\"]\n\nlet arr2 = [\"a\", \"b\", \"c\", \"d\"]\nJs.Array2.spliceInPlace(arr2, ~pos=3, ~remove=0, ~add=[\"x\", \"y\"]) == []\narr2 == [\"a\", \"b\", \"c\", \"x\", \"y\", \"d\"]\n\nlet arr3 = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.spliceInPlace(arr3, ~pos=9, ~remove=2, ~add=[\"x\", \"y\", \"z\"]) == []\narr3 == [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"x\", \"y\", \"z\"]\n```" - ], - "signature": "let spliceInPlace: (t<'a>, ~pos: int, ~remove: int, ~add: array<'a>) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.removeFromInPlace", - "kind": "value", - "name": "removeFromInPlace", - "docstrings": [ - "Removes elements from the given array starting at position `~pos` to the end of\nthe array, returning the removed elements. *This function modifies the original\narray.* See\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.removeFromInPlace(arr, ~pos=4) == [\"e\", \"f\"]\narr == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let removeFromInPlace: (t<'a>, ~pos: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.removeCountInPlace", - "kind": "value", - "name": "removeCountInPlace", - "docstrings": [ - "Removes `~count` elements from the given array starting at position `~pos`,\nreturning the removed elements. *This function modifies the original array.*\nSee\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.removeCountInPlace(arr, ~pos=2, ~count=3) == [\"c\", \"d\", \"e\"]\narr == [\"a\", \"b\", \"f\"]\n```" - ], - "signature": "let removeCountInPlace: (t<'a>, ~pos: int, ~count: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.unshift", - "kind": "value", - "name": "unshift", - "docstrings": [ - "Adds the given element to the array, returning the new number of elements in\nthe array. *This function modifies the original array.* See\n[`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"b\", \"c\", \"d\"]\nJs.Array2.unshift(arr, \"a\") == 4\narr == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let unshift: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.unshiftMany", - "kind": "value", - "name": "unshiftMany", - "docstrings": [ - "Adds the elements in the second array argument at the beginning of the first\narray argument, returning the new number of elements in the array. *This\nfunction modifies the original array.* See\n[`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"d\", \"e\"]\nJs.Array2.unshiftMany(arr, [\"a\", \"b\", \"c\"]) == 5\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let unshiftMany: (t<'a>, array<'a>) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.append", - "kind": "value", - "name": "append", - "docstrings": [], - "signature": "let append: (t<'a>, 'a) => t<'a>", - "deprecated": "`append` is not type-safe. Use `concat` instead." - }, - { - "id": "Js.Array2.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "Concatenates the second array argument to the first array argument, returning a\nnew array. The original arrays are not modified. See\n[`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.concat([\"a\", \"b\"], [\"c\", \"d\", \"e\"]) == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "The second argument to `concatMany()` is an array of arrays; these are added at\nthe end of the first argument, returning a new array. See\n[`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.concatMany([\"a\", \"b\", \"c\"], [[\"d\", \"e\"], [\"f\", \"g\", \"h\"]]) == [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n ]\n```" - ], - "signature": "let concatMany: (t<'a>, array>) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "Returns true if the given value is in the array, `false` otherwise. See\n[`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.includes([\"a\", \"b\", \"c\"], \"b\") == true\nJs.Array2.includes([\"a\", \"b\", \"c\"], \"x\") == false\n```" - ], - "signature": "let includes: (t<'a>, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "Returns the index of the first element in the array that has the given value.\nIf the value is not in the array, returns -1. See\n[`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.indexOf([100, 101, 102, 103], 102) == 2\nJs.Array2.indexOf([100, 101, 102, 103], 999) == -1\n```" - ], - "signature": "let indexOf: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "Returns the index of the first element in the array with the given value. The\nsearch starts at position `~from`. See\n[`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.indexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\"], \"a\", ~from=2) == 2\nJs.Array2.indexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\"], \"a\", ~from=3) == 4\nJs.Array2.indexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\"], \"b\", ~from=2) == -1\n```" - ], - "signature": "let indexOfFrom: (t<'a>, 'a, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "This function converts each element of the array to a string (via JavaScript)\nand concatenates them, separated by the string given in the first argument,\ninto a single string. See\n[`Array.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.joinWith([\"ant\", \"bee\", \"cat\"], \"--\") == \"ant--bee--cat\"\nJs.Array2.joinWith([\"door\", \"bell\"], \"\") == \"doorbell\"\nJs.Array2.joinWith([2020, 9, 4], \"/\") == \"2020/9/4\"\nJs.Array2.joinWith([2.5, 3.6, 3e-2], \";\") == \"2.5;3.6;0.03\"\n```" - ], - "signature": "let joinWith: (t<'a>, string) => string", - "deprecated": "" - }, - { - "id": "Js.Array2.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "Returns the index of the last element in the array that has the given value. If\nthe value is not in the array, returns -1. See\n[`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.lastIndexOf([\"a\", \"b\", \"a\", \"c\"], \"a\") == 2\nJs.Array2.lastIndexOf([\"a\", \"b\", \"a\", \"c\"], \"x\") == -1\n```" - ], - "signature": "let lastIndexOf: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "Returns the index of the last element in the array that has the given value,\nsearching from position `~from` down to the start of the array. If the value is\nnot in the array, returns -1. See\n[`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.lastIndexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\", \"d\"], \"a\", ~from=3) == 2\nJs.Array2.lastIndexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\", \"d\"], \"c\", ~from=2) == -1\n```" - ], - "signature": "let lastIndexOfFrom: (t<'a>, 'a, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "Returns a shallow copy of the given array from the `~start` index up to but not\nincluding the `~end_` position. Negative numbers indicate an offset from the\nend of the array. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105, 106]\nJs.Array2.slice(arr, ~start=2, ~end_=5) == [102, 103, 104]\nJs.Array2.slice(arr, ~start=-3, ~end_=-1) == [104, 105]\nJs.Array2.slice(arr, ~start=9, ~end_=10) == []\n```" - ], - "signature": "let slice: (t<'a>, ~start: int, ~end_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Returns a copy of the entire array. Same as `Js.Array2.Slice(arr, ~start=0,\n~end_=Js.Array2.length(arr))`. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." - ], - "signature": "let copy: t<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [ - "Returns a shallow copy of the given array from the given index to the end. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." - ], - "signature": "let sliceFrom: (t<'a>, int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts the array to a string. Each element is converted to a string using\nJavaScript. Unlike the JavaScript `Array.toString()`, all elements in a\nReasonML array must have the same type. See\n[`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.toString([3.5, 4.6, 7.8]) == \"3.5,4.6,7.8\"\nJs.Array2.toString([\"a\", \"b\", \"c\"]) == \"a,b,c\"\n```" - ], - "signature": "let toString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array2.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Converts the array to a string using the conventions of the current locale.\nEach element is converted to a string using JavaScript. Unlike the JavaScript\n`Array.toLocaleString()`, all elements in a ReasonML array must have the same\ntype. See\n[`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.toLocaleString([Js.Date.make()])\n// returns \"3/19/2020, 10:52:11 AM\" for locale en_US.utf8\n// returns \"2020-3-19 10:52:11\" for locale de_DE.utf8\n```" - ], - "signature": "let toLocaleString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array2.every", - "kind": "value", - "name": "every", - "docstrings": [ - "The first argument to `every()` is an array. The second argument is a predicate\nfunction that returns a boolean. The `every()` function returns `true` if the\npredicate function is true for all items in the given array. If given an empty\narray, returns `true`. See\n[`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every)\non MDN.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nJs.Array2.every([6, 22, 8, 4], isEven) == true\nJs.Array2.every([6, 22, 7, 4], isEven) == false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [ - "The first argument to `everyi()` is an array. The second argument is a\npredicate function with two arguments: an array element and that element’s\nindex; it returns a boolean. The `everyi()` function returns `true` if the\npredicate function is true for all items in the given array. If given an empty\narray, returns `true`. See\n[`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every)\non MDN.\n\n## Examples\n\n```rescript\n// determine if all even-index items are positive\nlet evenIndexPositive = (item, index) => mod(index, 2) == 0 ? item > 0 : true\n\nJs.Array2.everyi([6, -3, 5, 8], evenIndexPositive) == true\nJs.Array2.everyi([6, 3, -5, 8], evenIndexPositive) == false\n```" - ], - "signature": "let everyi: (t<'a>, ('a, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "Applies the given predicate function (the second argument) to each element in\nthe array; the result is an array of those elements for which the predicate\nfunction returned `true`. See\n[`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\non MDN.\n\n## Examples\n\n```rescript\nlet nonEmpty = s => s != \"\"\nJs.Array2.filter([\"abc\", \"\", \"\", \"def\", \"ghi\"], nonEmpty) == [\"abc\", \"def\", \"ghi\"]\n```" - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [ - "Each element of the given array are passed to the predicate function. The\nreturn value is an array of all those elements for which the predicate function\nreturned `true`.\n\nSee\n[`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\non MDN.\n\n## Examples\n\n```rescript\n// keep only positive elements at odd indices\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array2.filteri([6, 3, 5, 8, 7, -4, 1], positiveOddElement) == [3, 8]\n```" - ], - "signature": "let filteri: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.find", - "kind": "value", - "name": "find", - "docstrings": [ - "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find first negative element\nJs.Array2.find([33, 22, -55, 77, -44], x => x < 0) == Some(-55)\nJs.Array2.find([33, 22, 55, 77, 44], x => x < 0) == None\n```" - ], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.findi", - "kind": "value", - "name": "findi", - "docstrings": [ - "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate. The\npredicate function takes an array element and an index as its parameters. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find first positive item at an odd index\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array2.findi([66, -33, 55, 88, 22], positiveOddElement) == Some(88)\nJs.Array2.findi([66, -33, 55, -88, 22], positiveOddElement) == None\n```" - ], - "signature": "let findi: (t<'a>, ('a, int) => bool) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [ - "Returns the index of the first element in the array that satisifies the given\npredicate function, or -1 if no element satisifies the predicate. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.findIndex([33, 22, -55, 77, -44], x => x < 0) == 2\nJs.Array2.findIndex([33, 22, 55, 77, 44], x => x < 0) == -1\n```" - ], - "signature": "let findIndex: (t<'a>, 'a => bool) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [ - "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate. The\npredicate function takes an array element and an index as its parameters. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find index of first positive item at an odd index\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array2.findIndexi([66, -33, 55, 88, 22], positiveOddElement) == 3\nJs.Array2.findIndexi([66, -33, 55, -88, 22], positiveOddElement) == -1\n```" - ], - "signature": "let findIndexi: (t<'a>, ('a, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "The `forEach()` function applies the function given as the second argument to\neach element in the array. The function you provide returns `unit`, and the\n`forEach()` function also returns `unit`. You use `forEach()` when you need to\nprocess each element in the array but not return any new array or value; for\nexample, to print the items in an array. See\n[`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\non MDN.\n\n## Examples\n\n```rescript\n// display all elements in an array\nJs.Array2.forEach([\"a\", \"b\", \"c\"], x => Js.log(x)) == ()\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Array2.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [ - "The `forEachi()` function applies the function given as the second argument to\neach element in the array. The function you provide takes an item in the array\nand its index number, and returns `unit`. The `forEachi()` function also\nreturns `unit`. You use `forEachi()` when you need to process each element in\nthe array but not return any new array or value; for example, to print the\nitems in an array. See\n[`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\non MDN.\n\n## Examples\n\n```rescript\n// display all elements in an array as a numbered list\nJs.Array2.forEachi([\"a\", \"b\", \"c\"], (item, index) => Js.log2(index + 1, item)) == ()\n```" - ], - "signature": "let forEachi: (t<'a>, ('a, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Array2.map", - "kind": "value", - "name": "map", - "docstrings": [ - "Applies the function (the second argument) to each item in the array, returning\na new array. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]\nJs.Array2.map([\"animal\", \"vegetable\", \"mineral\"], Js.String.length) == [6, 9, 7]\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Array2.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [ - "Applies the function (the second argument) to each item in the array, returning\na new array. The function acceps two arguments: an item from the array and its\nindex number. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array2.mapi([10, 11, 12], product) == [0, 11, 24]\n```" - ], - "signature": "let mapi: (t<'a>, ('a, int) => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Array2.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "The `reduce()` function takes three parameters: an array, a *reducer function*,\nand a beginning accumulator value. The reducer function has two parameters: an\naccumulated value and an element of the array.\n\n`reduce()` first calls the reducer function with the beginning value and the\nfirst element in the array. The result becomes the new accumulator value, which\nis passed in to the reducer function along with the second element in the\narray. `reduce()` proceeds through the array, passing in the result of each\nstage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduce()`. See\n[`Array.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\non MDN.\n\n## Examples\n\n```rescript\nlet sumOfSquares = (accumulator, item) => accumulator + item * item\n\nJs.Array2.reduce([10, 2, 4], sumOfSquares, 0) == 120\nJs.Array2.reduce([10, 2, 4], \"*\", 1) == 80\nJs.Array2.reduce(\n [\"animal\", \"vegetable\", \"mineral\"],\n (acc, item) => acc + Js.String.length(item),\n 0,\n) == 22 // 6 + 9 + 7\nJs.Array2.reduce([2.0, 4.0], (acc, item) => item /. acc, 1.0) == 2.0 // 4.0 / (2.0 / 1.0)\n```" - ], - "signature": "let reduce: (t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [ - "The `reducei()` function takes three parameters: an array, a *reducer\nfunction*, and a beginning accumulator value. The reducer function has three\nparameters: an accumulated value, an element of the array, and the index of\nthat element.\n\n`reducei()` first calls the reducer function with the beginning value, the\nfirst element in the array, and zero (its index). The result becomes the new\naccumulator value, which is passed to the reducer function along with the\nsecond element in the array and one (its index). `reducei()` proceeds from left\nto right through the array, passing in the result of each stage as the\naccumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reducei()`. See\n[`Array.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\non MDN.\n\n## Examples\n\n```rescript\n// find sum of even-index elements in array\nlet sumOfEvens = (accumulator, item, index) =>\n if mod(index, 2) == 0 {\n accumulator + item\n } else {\n accumulator\n }\n\nJs.Array2.reducei([2, 5, 1, 4, 3], sumOfEvens, 0) == 6\n```" - ], - "signature": "let reducei: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [ - "The `reduceRight()` function takes three parameters: an array, a *reducer\nfunction*, and a beginning accumulator value. The reducer function has two\nparameters: an accumulated value and an element of the array.\n\n`reduceRight()` first calls the reducer function with the beginning value and\nthe last element in the array. The result becomes the new accumulator value,\nwhich is passed in to the reducer function along with the next-to-last element\nin the array. `reduceRight()` proceeds from right to left through the array,\npassing in the result of each stage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduceRight()`. See\n[`Array.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight)\non MDN.\n\n**NOTE:** In many cases, `reduce()` and `reduceRight()` give the same result.\nHowever, see the last example here and compare it to the example from\n`reduce()`, where order makes a difference.\n\n## Examples\n\n```rescript\nlet sumOfSquares = (accumulator, item) => accumulator + item * item\n\nJs.Array2.reduceRight([10, 2, 4], sumOfSquares, 0) == 120\nJs.Array2.reduceRight([2.0, 4.0], (acc, item) => item /. acc, 1.0) == 0.5 // 2.0 / (4.0 / 1.0)\n```" - ], - "signature": "let reduceRight: (t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [ - "The `reduceRighti()` function takes three parameters: an array, a *reducer\nfunction*, and a beginning accumulator value. The reducer function has three\nparameters: an accumulated value, an element of the array, and the index of\nthat element. `reduceRighti()` first calls the reducer function with the\nbeginning value, the last element in the array, and its index (length of array\nminus one). The result becomes the new accumulator value, which is passed in to\nthe reducer function along with the second element in the array and one (its\nindex). `reduceRighti()` proceeds from right to left through the array, passing\nin the result of each stage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduceRighti()`. See\n[`Array.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight)\non MDN.\n\n**NOTE:** In many cases, `reducei()` and `reduceRighti()` give the same result.\nHowever, there are cases where the order in which items are processed makes a\ndifference.\n\n## Examples\n\n```rescript\n// find sum of even-index elements in array\nlet sumOfEvens = (accumulator, item, index) =>\n if mod(index, 2) == 0 {\n accumulator + item\n } else {\n accumulator\n }\n\nJs.Array2.reduceRighti([2, 5, 1, 4, 3], sumOfEvens, 0) == 6\n```" - ], - "signature": "let reduceRighti: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Returns `true` if the predicate function given as the second argument to\n`some()` returns `true` for any element in the array; `false` otherwise.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nJs.Array2.some([3, 7, 5, 2, 9], isEven) == true\nJs.Array2.some([3, 7, 5, 1, 9], isEven) == false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.somei", - "kind": "value", - "name": "somei", - "docstrings": [ - "Returns `true` if the predicate function given as the second argument to\n`somei()` returns `true` for any element in the array; `false` otherwise. The\npredicate function has two arguments: an item from the array and the index\nvalue\n\n## Examples\n\n```rescript\n// Does any string in the array\n// have the same length as its index?\n\nlet sameLength = (str, index) => Js.String.length(str) == index\n\n// \"ef\" has length 2 and is it at index 2\nJs.Array2.somei([\"ab\", \"cd\", \"ef\", \"gh\"], sameLength) == true\n// no item has the same length as its index\nJs.Array2.somei([\"a\", \"bc\", \"def\", \"gh\"], sameLength) == false\n```" - ], - "signature": "let somei: (t<'a>, ('a, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [ - "Returns the value at the given position in the array if the position is in\nbounds; returns the JavaScript value `undefined` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array2.unsafe_get(arr, 3) == 103\nJs.Array2.unsafe_get(arr, 4) // returns undefined\n```" - ], - "signature": "let unsafe_get: (array<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Js.Array2.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [ - "Sets the value at the given position in the array if the position is in bounds.\nIf the index is out of bounds, well, “here there be dragons.“\n\n*This function modifies the original array.*\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array2.unsafe_set(arr, 3, 99)\n// result is [100, 101, 102, 99];\n\nJs.Array2.unsafe_set(arr, 4, 88)\n// result is [100, 101, 102, 99, 88]\n\nJs.Array2.unsafe_set(arr, 6, 77)\n// result is [100, 101, 102, 99, 88, <1 empty item>, 77]\n\nJs.Array2.unsafe_set(arr, -1, 66)\n// you don't want to know.\n```" - ], - "signature": "let unsafe_set: (array<'a>, int, 'a) => unit", - "deprecated": "" - } - ] - }, - "js/array": { - "id": "Js.Array", - "name": "Array", - "docstrings": [ - "Provide bindings to JS array", - "Provides bindings to JavaScript’s `Array` functions. These bindings are\noptimized for pipe-last (`|>`), where the array to be processed is the last\nparameter in the function." - ], - "items": [ - { - "id": "Js.Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type used to describe a JavaScript array." - ], - "signature": "type t<'a> = array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [ - "A type used to describe JavaScript objects that are like an array or are iterable." - ], - "signature": "type array_like<'a> = Js_array2.array_like<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.from", - "kind": "value", - "name": "from", - "docstrings": [ - "Creates a shallow copy of an array from an array-like object. See [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nJs.Array.from(strArr) == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let from: array_like<'a> => array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.fromMap", - "kind": "value", - "name": "fromMap", - "docstrings": [ - "Creates a new array by applying a function (the second argument) to each item\nin the `array_like` first argument. See\n[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\non MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nlet code = s => Js.String.charCodeAt(0, s)\nJs.Array.fromMap(strArr, code) == [97.0, 98.0, 99.0, 100.0]\n```" - ], - "signature": "let fromMap: (array_like<'a>, 'a => 'b) => array<'b>", - "deprecated": "" - }, - { - "id": "Js.Array.isArray", - "kind": "value", - "name": "isArray", - "docstrings": [], - "signature": "let isArray: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.Array.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Returns the number of elements in the array. See [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN." - ], - "signature": "let length: array<'a> => int", - "deprecated": "" - }, - { - "id": "Js.Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (~to_: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (~to_: int, ~from: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: ('a, t<'a>) => 'b" - }, - { - "id": "Js.Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: ('a, ~from: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: ('a, ~start: int, ~end_: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "If the array is not empty, removes the last element and returns it as `Some(value)`; returns `None` if the array is empty. *This function modifies the original array.* See [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array.pop(arr) == Some(104)\narr == [100, 101, 102, 103]\n\nlet empty: array = []\nJs.Array.pop(empty) == None\n```" - ], - "signature": "let pop: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.push", - "kind": "value", - "name": "push", - "docstrings": [], - "signature": "let push: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.pushMany", - "kind": "value", - "name": "pushMany", - "docstrings": [], - "signature": "let pushMany: (array<'a>, t<'a>) => int" - }, - { - "id": "Js.Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [ - "Returns an array with the elements of the input array in reverse order. *This function modifies the original array.* See [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array.reverseInPlace(arr) == [\"cat\", \"bee\", \"ant\"]\narr == [\"cat\", \"bee\", \"ant\"]\n```" - ], - "signature": "let reverseInPlace: t<'a> => 'this", - "deprecated": "" - }, - { - "id": "Js.Array.shift", - "kind": "value", - "name": "shift", - "docstrings": [ - "If the array is not empty, removes the first element and returns it as `Some(value)`; returns `None` if the array is empty. *This function modifies the original array.* See [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array.shift(arr) == Some(100)\narr == [101, 102, 103, 104]\n\nlet empty: array = []\nJs.Array.shift(empty) == None\n```" - ], - "signature": "let shift: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [ - "Sorts the given array in place and returns the sorted array. JavaScript sorts the array by converting the arguments to UTF-16 strings and sorting them. See the second example with sorting numbers, which does not do a numeric sort. *This function modifies the original array.* See [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet words = [\"bee\", \"dog\", \"ant\", \"cat\"]\nJs.Array.sortInPlace(words) == [\"ant\", \"bee\", \"cat\", \"dog\"]\nwords == [\"ant\", \"bee\", \"cat\", \"dog\"]\n\nlet numbers = [3, 30, 10, 1, 20, 2]\nJs.Array.sortInPlace(numbers) == [1, 10, 2, 20, 3, 30]\nnumbers == [1, 10, 2, 20, 3, 30]\n```" - ], - "signature": "let sortInPlace: t<'a> => 'this", - "deprecated": "This has been deprecated and will be removed in v13. Use functions from the `Array` module instead." - }, - { - "id": "Js.Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (('a, 'a) => int, t<'a>) => 'b" - }, - { - "id": "Js.Array.spliceInPlace", - "kind": "value", - "name": "spliceInPlace", - "docstrings": [], - "signature": "let spliceInPlace: (~pos: int, ~remove: int, ~add: array<'a>, t<'a>) => 'b" - }, - { - "id": "Js.Array.removeFromInPlace", - "kind": "value", - "name": "removeFromInPlace", - "docstrings": [], - "signature": "let removeFromInPlace: (~pos: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.removeCountInPlace", - "kind": "value", - "name": "removeCountInPlace", - "docstrings": [], - "signature": "let removeCountInPlace: (~pos: int, ~count: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.unshift", - "kind": "value", - "name": "unshift", - "docstrings": [], - "signature": "let unshift: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.unshiftMany", - "kind": "value", - "name": "unshiftMany", - "docstrings": [], - "signature": "let unshiftMany: (array<'a>, t<'a>) => int" - }, - { - "id": "Js.Array.concat", - "kind": "value", - "name": "concat", - "docstrings": [], - "signature": "let concat: ('a, t<'b>) => 'a" - }, - { - "id": "Js.Array.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [], - "signature": "let concatMany: (array<'a>, t<'b>) => 'a" - }, - { - "id": "Js.Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: ('a, t<'a>) => bool" - }, - { - "id": "Js.Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: ('a, ~from: int, t<'a>) => int" - }, - { - "id": "Js.Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (string, t<'a>) => string" - }, - { - "id": "Js.Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: ('a, ~from: int, t<'a>) => int" - }, - { - "id": "Js.Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (int, ~end_: int, ~obj: t<'a>) => 'b" - }, - { - "id": "Js.Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Returns a copy of the entire array. Same as `Js.Array.Slice(~start=0,\n~end_=Js.Array.length(arr), arr)`. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." - ], - "signature": "let copy: t<'a> => 'this", - "deprecated": "" - }, - { - "id": "Js.Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (int, t<'a>) => 'b" - }, - { - "id": "Js.Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts the array to a string. Each element is converted to a string using\nJavaScript. Unlike the JavaScript `Array.toString()`, all elements in a\nReasonML array must have the same type. See\n[`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.toString([3.5, 4.6, 7.8]) == \"3.5,4.6,7.8\"\nJs.Array.toString([\"a\", \"b\", \"c\"]) == \"a,b,c\"\n```" - ], - "signature": "let toString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Converts the array to a string using the conventions of the current locale.\nEach element is converted to a string using JavaScript. Unlike the JavaScript\n`Array.toLocaleString()`, all elements in a ReasonML array must have the same\ntype. See\n[`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.toLocaleString([Js.Date.make()])\n// returns \"3/19/2020, 10:52:11 AM\" for locale en_US.utf8\n// returns \"2020-3-19 10:52:11\" for locale de_DE.utf8\n```" - ], - "signature": "let toLocaleString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: ('a => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (('a, int) => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: ('a => bool, t<'a>) => 'b" - }, - { - "id": "Js.Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (('a, int) => bool, t<'a>) => 'b" - }, - { - "id": "Js.Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: ('a => bool, t<'a>) => option<'a>" - }, - { - "id": "Js.Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (('a, int) => bool, t<'a>) => option<'a>" - }, - { - "id": "Js.Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: ('a => bool, t<'a>) => int" - }, - { - "id": "Js.Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (('a, int) => bool, t<'a>) => int" - }, - { - "id": "Js.Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: ('a => unit, t<'a>) => unit" - }, - { - "id": "Js.Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (('a, int) => unit, t<'a>) => unit" - }, - { - "id": "Js.Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: ('a => 'b, t<'a>) => t<'b>" - }, - { - "id": "Js.Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (('a, int) => 'b, t<'a>) => t<'b>" - }, - { - "id": "Js.Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (('a, 'b) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (('a, 'b, int) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (('a, 'b) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (('a, 'b, int) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: ('a => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (('a, int) => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [ - "Returns the value at the given position in the array if the position is in\nbounds; returns the JavaScript value `undefined` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array.unsafe_get(arr, 3) == 103\nJs.Array.unsafe_get(arr, 4) // returns undefined\n```" - ], - "signature": "let unsafe_get: (array<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Js.Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [ - "Sets the value at the given position in the array if the position is in bounds.\nIf the index is out of bounds, well, “here there be dragons.“ *This function\nmodifies the original array.*\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array.unsafe_set(arr, 3, 99)\n// result is [100, 101, 102, 99]\n\nJs.Array.unsafe_set(arr, 4, 88)\n// result is [100, 101, 102, 99, 88]\n\nJs.Array.unsafe_set(arr, 6, 77)\n// result is [100, 101, 102, 99, 88, <1 empty item>, 77]\n\nJs.Array.unsafe_set(arr, -1, 66)\n// you don't want to know.\n```" - ], - "signature": "let unsafe_set: (array<'a>, int, 'a) => unit", - "deprecated": "" - } - ] - }, - "js/exn": { - "id": "Js.Exn", - "name": "Exn", - "docstrings": [ - "Provide utilities for dealing with Js exceptions", - "Provide utilities for dealing with JS exceptions." - ], - "items": [ - { - "id": "Js.Exn.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JS exception" - ], - "signature": "type t", - "deprecated": "" - }, - { - "id": "Js.Exn.asJsExn", - "kind": "value", - "name": "asJsExn", - "docstrings": [], - "signature": "let asJsExn: exn => option", - "deprecated": "" - }, - { - "id": "Js.Exn.stack", - "kind": "value", - "name": "stack", - "docstrings": [], - "signature": "let stack: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.message", - "kind": "value", - "name": "message", - "docstrings": [], - "signature": "let message: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.name", - "kind": "value", - "name": "name", - "docstrings": [], - "signature": "let name: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [], - "signature": "let fileName: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.anyToExnInternal", - "kind": "value", - "name": "anyToExnInternal", - "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a Exn.Error if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." - ], - "signature": "let anyToExnInternal: 'a => exn", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseError", - "kind": "value", - "name": "raiseError", - "docstrings": [ - "Raise Js exception Error object with stacktrace" - ], - "signature": "let raiseError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseEvalError", - "kind": "value", - "name": "raiseEvalError", - "docstrings": [], - "signature": "let raiseEvalError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseRangeError", - "kind": "value", - "name": "raiseRangeError", - "docstrings": [], - "signature": "let raiseRangeError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseReferenceError", - "kind": "value", - "name": "raiseReferenceError", - "docstrings": [], - "signature": "let raiseReferenceError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseSyntaxError", - "kind": "value", - "name": "raiseSyntaxError", - "docstrings": [], - "signature": "let raiseSyntaxError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseTypeError", - "kind": "value", - "name": "raiseTypeError", - "docstrings": [], - "signature": "let raiseTypeError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseUriError", - "kind": "value", - "name": "raiseUriError", - "docstrings": [], - "signature": "let raiseUriError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(exn)` ignores the provided exn and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit", - "deprecated": "" - } - ] - }, - "js/null_undefined": { - "id": "Js.Null_undefined", - "name": "Null_undefined", - "docstrings": [ - "Contains functionality for dealing with values that can be both `null` and `undefined`" - ], - "items": [ - { - "id": "Js.Null_undefined.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.null_undefined<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [ - "Returns `true` if the given value is null or undefined, `false` otherwise." - ], - "signature": "let isNullable: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The null value of type `Js.null_undefined<'a>`." - ], - "signature": "let null: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The undefined value of type `Js.null_undefined<'a>`." - ], - "signature": "let undefined: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\n\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped, mapped to\na `'b` using the given function `a' => 'b`, then wrapped back up and returned\nas `Js.null_undefined<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.null_undefined) =>\n Js.Null_undefined.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function.\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped and applied to the given function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.null_undefined) =>\n Js.Null_undefined.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.null_undefined<'a>`.\n`Some(a)` => `a`\n`None` => `undefined`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.null_undefined<'a>` to `option<'a>`.\n`a` => `Some(a)`\n`undefined` => `None`\n`null` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - }, - "js/nullable": { - "id": "Js.Nullable", - "name": "Nullable", - "docstrings": [ - "Provide utilities for `Js.null_undefined`", - "Contains functionality for dealing with values that can be both `null` and `undefined`" - ], - "items": [ - { - "id": "Js.Nullable.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined", - "deprecated": "" - }, - { - "id": "Js.Nullable.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.null_undefined<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [ - "Returns `true` if the given value is null or undefined, `false` otherwise." - ], - "signature": "let isNullable: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Nullable.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The null value of type `Js.null_undefined<'a>`." - ], - "signature": "let null: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The undefined value of type `Js.null_undefined<'a>`." - ], - "signature": "let undefined: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\n\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped, mapped to\na `'b` using the given function `a' => 'b`, then wrapped back up and returned\nas `Js.null_undefined<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.null_undefined) =>\n Js.Null_undefined.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Nullable.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function.\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped and applied to the given function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.null_undefined) =>\n Js.Null_undefined.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Nullable.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.null_undefined<'a>`.\n`Some(a)` => `a`\n`None` => `undefined`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.null_undefined<'a>` to `option<'a>`.\n`a` => `Some(a)`\n`undefined` => `None`\n`null` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - }, - "js/undefined": { - "id": "Js.Undefined", - "name": "Undefined", - "docstrings": [ - "Provide utilities for `Js.undefined<'a>`", - "Provides functionality for dealing with the `Js.undefined<'a>` type" - ], - "items": [ - { - "id": "Js.Undefined.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Local alias for `Js.undefined<'a>`" - ], - "signature": "type t<'a> = undefined<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.undefined<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.test", - "kind": "value", - "name": "test", - "docstrings": [ - "Returns `true` if the given value is empty (undefined), `false` otherwise." - ], - "signature": "let test: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Undefined.testAny", - "kind": "value", - "name": "testAny", - "docstrings": [ - "Returns `true` if the given value is empty (undefined).\n\n**since 1.6.1**" - ], - "signature": "let testAny: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.Undefined.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "The empty value, `undefined`" - ], - "signature": "let empty: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [], - "signature": "let getUnsafe: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Undefined.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Undefined.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\nIf `Js.undefined<'a>` contains a value, that value is unwrapped, mapped to a\n`'b` using the given function `a' => 'b`, then wrapped back up and returned as\n`Js.undefined<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.undefined) =>\n Js.Undefined.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Undefined.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function. If\n`Js.undefined<'a>` contains a value, that value is unwrapped and applied to the\ngiven function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.undefined) =>\n Js.Undefined.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Undefined.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.undefined<'a>`.\n`Some(a)` => `a`\n`None` => `empty`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.undefined<'a>` to `option<'a>`\n`a` => `Some(a)`\n`empty` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - }, - "js/null": { - "id": "Js.Null", - "name": "Null", - "docstrings": [ - "Provide utilities for `Js.null<'a>`", - "Provides functionality for dealing with the `Js.null<'a>` type" - ], - "items": [ - { - "id": "Js.Null.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "@unboxed\ntype t<'a> = null<'a> =\n | Value('a)\n | @as(null) Null", - "deprecated": "" - }, - { - "id": "Js.Null.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.null<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.test", - "kind": "value", - "name": "test", - "docstrings": [ - "Returns `true` if the given value is empty (`null`), `false` otherwise." - ], - "signature": "let test: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Null.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "The empty value, `null`" - ], - "signature": "let empty: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [], - "signature": "let getUnsafe: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Null.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Null.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\n\nIf `Js.null<'a>` contains a value, that value is unwrapped, mapped to a `'b`\nusing the given function `'a => 'b`, then wrapped back up and returned as\n`Js.null<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.null) =>\n Js.Null.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Null.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function.\nIf `Js.null<'a>` contains a value, that value is unwrapped and applied to the given function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.null) =>\n Js.Null.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Null.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.null<'a>`.\n`Some(a)` => `a`\n`None` => `empty`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.null<'a>` to `option<'a>`.\n`a` => `Some(a)`\n`empty` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v12.0.1/stdlib.json b/apps/docs/data/api/v12.0.1/stdlib.json deleted file mode 100644 index 45b9433a0..000000000 --- a/apps/docs/data/api/v12.0.1/stdlib.json +++ /dev/null @@ -1,12742 +0,0 @@ -{ - "stdlib": { - "id": "Stdlib", - "name": "Stdlib", - "docstrings": [], - "items": [ - { - "id": "Stdlib.timeoutId", - "kind": "type", - "name": "timeoutId", - "docstrings": [ - "An `id` representing a timeout started via `setTimeout`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN." - ], - "signature": "type timeoutId = Global.timeoutId" - }, - { - "id": "Stdlib.setTimeout", - "kind": "value", - "name": "setTimeout", - "docstrings": [ - "`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200)\n```" - ], - "signature": "let setTimeout: (unit => unit, int) => timeoutId" - }, - { - "id": "Stdlib.setTimeoutFloat", - "kind": "value", - "name": "setTimeoutFloat", - "docstrings": [ - "`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200.)\n```" - ], - "signature": "let setTimeoutFloat: (unit => unit, float) => timeoutId" - }, - { - "id": "Stdlib.clearTimeout", - "kind": "value", - "name": "clearTimeout", - "docstrings": [ - "`clearTimeout(timeoutId)` clears a scheduled timeout if it hasn't already executed.\n\nSee [`clearTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout) on MDN.\n\n## Examples\n\n```rescript\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 2 seconds.\")\n}, 2000)\n\n// Clearing the timeout right away, before 2 seconds has passed, means that the above callback logging to the console will never run.\nclearTimeout(timeoutId)\n```" - ], - "signature": "let clearTimeout: timeoutId => unit" - }, - { - "id": "Stdlib.intervalId", - "kind": "type", - "name": "intervalId", - "docstrings": [ - "An `id` representing an interval started via `setInterval`.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN." - ], - "signature": "type intervalId = Global.intervalId" - }, - { - "id": "Stdlib.setInterval", - "kind": "value", - "name": "setInterval", - "docstrings": [ - "`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 200 ms (200 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 200 ms.\")\n}, 200)\n\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```" - ], - "signature": "let setInterval: (unit => unit, int) => intervalId" - }, - { - "id": "Stdlib.setIntervalFloat", - "kind": "value", - "name": "setIntervalFloat", - "docstrings": [ - "`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 2 seconds (200 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 200 ms\")\n}, 200.)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeoutFloat(() => {\n clearInterval(intervalId)\n}, 500.0)\n```" - ], - "signature": "let setIntervalFloat: (unit => unit, float) => intervalId" - }, - { - "id": "Stdlib.clearInterval", - "kind": "value", - "name": "clearInterval", - "docstrings": [ - "`clearInterval(intervalId)` clears a scheduled interval.\n\nSee [`clearInterval`](https://developer.mozilla.org/en-US/docs/Web/API/clearInterval) on MDN.\n\n## Examples\n\n```rescript\nlet intervalId = setInterval(() => {\n Console.log(\"This prints in 100 ms\")\n}, 100)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```" - ], - "signature": "let clearInterval: intervalId => unit" - }, - { - "id": "Stdlib.encodeURI", - "kind": "value", - "name": "encodeURI", - "docstrings": [ - "Encodes a URI by replacing characters in the provided string that aren't valid in a URL.\n\nThis is intended to operate on full URIs, so it encodes fewer characters than what `encodeURIComponent` does.\nIf you're looking to encode just parts of a URI, like a query parameter, prefer `encodeURIComponent`.\n\nSee [`encodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI) on MDN.\n\n## Examples\n```rescript\nConsole.log(encodeURI(\"https://rescript-lang.org?array=[someValue]\"))\n// Logs \"https://rescript-lang.org?array=%5BsomeValue%5D\" to the console.\n```" - ], - "signature": "let encodeURI: string => string" - }, - { - "id": "Stdlib.decodeURI", - "kind": "value", - "name": "decodeURI", - "docstrings": [ - "Decodes a previously encoded URI back to a regular string.\n\nThis is intended to operate on full URIs, so it decodes fewer characters than what `decodeURIComponent` does.\nIf you're looking to decode just parts of a URI, like a query parameter, prefer `decodeURIComponent`.\n\nSee [`decodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI) on MDN.\n\n## Examples\n```rescript\nConsole.log(decodeURI(\"https://rescript-lang.org?array=%5BsomeValue%5D\"))\n// Logs \"https://rescript-lang.org?array=[someValue]\" to the console.\n```" - ], - "signature": "let decodeURI: string => string" - }, - { - "id": "Stdlib.encodeURIComponent", - "kind": "value", - "name": "encodeURIComponent", - "docstrings": [ - "Encodes a string so it can be used as part of a URI.\n\nSee [`encodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) on MDN.\n\n## Examples\n```rescript\nConsole.log(encodeURIComponent(\"array=[someValue]\"))\n// Logs \"array%3D%5BsomeValue%5D\" to the console.\n```" - ], - "signature": "let encodeURIComponent: string => string" - }, - { - "id": "Stdlib.decodeURIComponent", - "kind": "value", - "name": "decodeURIComponent", - "docstrings": [ - "Decodes a previously URI encoded string back to its original form.\n\nSee [`decodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) on MDN.\n\n## Examples\n```rescript\nConsole.log(decodeURIComponent(\"array%3D%5BsomeValue%5D\"))\n// Logs \"array=[someValue]\" to the console.\n```" - ], - "signature": "let decodeURIComponent: string => string" - }, - { - "id": "Stdlib.date", - "kind": "type", - "name": "date", - "docstrings": [], - "signature": "type date = Date.t" - }, - { - "id": "Stdlib.null", - "kind": "type", - "name": "null", - "docstrings": [], - "signature": "type null<'a> = null<'a>" - }, - { - "id": "Stdlib.undefined", - "kind": "type", - "name": "undefined", - "docstrings": [], - "signature": "type undefined<'a> = undefined<'a>" - }, - { - "id": "Stdlib.nullable", - "kind": "type", - "name": "nullable", - "docstrings": [], - "signature": "type nullable<'a> = nullable<'a>" - }, - { - "id": "Stdlib.lazy_t", - "kind": "type", - "name": "lazy_t", - "docstrings": [], - "signature": "type lazy_t<'a> = Lazy.t<'a>", - "deprecated": "Use Lazy.t instead" - }, - { - "id": "Stdlib.window", - "kind": "value", - "name": "window", - "docstrings": [], - "signature": "let window: Dom.window", - "deprecated": "Use rescript-webapi instead" - }, - { - "id": "Stdlib.document", - "kind": "value", - "name": "document", - "docstrings": [], - "signature": "let document: Dom.document", - "deprecated": "Use rescript-webapi instead" - }, - { - "id": "Stdlib.globalThis", - "kind": "value", - "name": "globalThis", - "docstrings": [ - "`globalThis` gives you the host global object (`window` in browsers, `global` in Node, etc.).\nYou can reach shared globals from any runtime without special checks.\n\n## Examples\n\n**Note:** These are demonstrative examples. In real code, prefer writing your own type-safe bindings.\nSee [`Bind to Global JS Values`](https://rescript-lang.org/docs/manual/v12.0.0/bind-to-global-js-values).\n\n\n```rescript\ntypeof(globalThis[\"setTimeout\"]) == #function\n\nglobalThis[\"myAppName\"] = \"SuperApp\";\nglobalThis[\"myAppName\"] == \"SuperApp\"\n```" - ], - "signature": "let globalThis: {..}" - }, - { - "id": "Stdlib.import", - "kind": "value", - "name": "import", - "docstrings": [ - "`import(value)` dynamically import a value or function from a ReScript\nmodule. The import call will return a `promise`, resolving to the dynamically loaded\nvalue.\n\n## Examples\n\n`Array.res` file:\n\n```rescript\n@send external indexOf: (array<'a>, 'a) => int = \"indexOf\"\n\nlet indexOfOpt = (arr, item) =>\n switch arr->indexOf(item) {\n | -1 => None\n | index => Some(index)\n }\n```\nIn other file you can import the `indexOfOpt` value defined in `Array.res`\n\n```rescript\nlet main = async () => {\n let indexOfOpt = await import(Array.indexOfOpt)\n let index = indexOfOpt([1, 2], 2)\n Console.log(index)\n}\n```\n\nCompiles to:\n\n```javascript\nasync function main() {\n var add = await import(\"./Array.mjs\").then(function(m) {\n return m.indexOfOpt;\n });\n var index = indexOfOpt([1, 2], 2);\n console.log(index);\n}\n```" - ], - "signature": "let import: 'a => promise<'a>" - }, - { - "id": "Stdlib.panic", - "kind": "value", - "name": "panic", - "docstrings": [ - "`panic(message)` throws a JavaScript `Error` prefixed with `Panic!`.\nCall it when something went wrong and the program should stop right away.\n\n## Examples\n\n```rescript\nlet caught = try panic(\"Invariant violated\") catch {\n| JsExn(err) => JsExn.message(err)->Option.getOrThrow\n}\n\ncaught == \"Panic! Invariant violated\"\n```" - ], - "signature": "let panic: string => 'a" - }, - { - "id": "Stdlib.assertEqual", - "kind": "value", - "name": "assertEqual", - "docstrings": [ - "`assertEqual(a, b)` check if `a` is equal `b`. If not throw a panic exception\n\n## Examples\n\n```rescript\nlist{1, 2}->List.tailExn == list{2}\n```" - ], - "signature": "let assertEqual: ('a, 'a) => unit" - }, - { - "id": "Stdlib.null", - "kind": "value", - "name": "null", - "docstrings": [ - "`null` returns the JavaScript `null` value as a `nullable<'a>`.\nUse the `Nullable` helpers to convert it into an `option` or to read the value.\n\n## Examples\n\n```rescript\nnull->Nullable.toOption == None\n```" - ], - "signature": "let null: nullable<'a>" - }, - { - "id": "Stdlib.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "`undefined` returns the JavaScript `undefined` value as a `nullable<'a>`.\nUse the `Nullable` helpers to convert it into an `option` or to read the value.\n\n## Examples\n\n```rescript\nundefined->Nullable.toOption == None\n```" - ], - "signature": "let undefined: nullable<'a>" - }, - { - "id": "Stdlib.typeof", - "kind": "value", - "name": "typeof", - "docstrings": [ - "`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```" - ], - "signature": "let typeof: 'a => Type.t" - } - ] - }, - "stdlib/intl/numberformat/grouping": { - "id": "Stdlib.Intl.NumberFormat.Grouping", - "name": "Grouping", - "docstrings": [ - "Represents the `useGrouping` option accepted by `Intl.NumberFormat`.\n\nSee [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) on MDN for full option details." - ], - "items": [ - { - "id": "Stdlib.Intl.NumberFormat.Grouping.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.parsed", - "kind": "type", - "name": "parsed", - "docstrings": [], - "signature": "type parsed = [#always | #auto | #bool(bool) | #min2]" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.fromBool", - "kind": "value", - "name": "fromBool", - "docstrings": [ - "Constructs a grouping setting from a boolean.\n\n## Examples\n\n```rescript\nlet formatter =\n Intl.NumberFormat.make(\n ~locales=[\"en-US\"],\n ~options={useGrouping: Intl.NumberFormat.Grouping.fromBool(false)},\n )\nformatter->Intl.NumberFormat.format(1234.) == \"1234\"\n```" - ], - "signature": "let fromBool: bool => t" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Constructs a grouping setting from a string literal.\n\n## Examples\n\n```rescript\nlet formatter =\n Intl.NumberFormat.make(\n ~locales=[\"en-US\"],\n ~options={useGrouping: Intl.NumberFormat.Grouping.fromString(#always)},\n )\nformatter->Intl.NumberFormat.format(1234.) == \"1,234\"\n```" - ], - "signature": "let fromString: [#always | #auto | #min2] => t" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.parseJsValue", - "kind": "value", - "name": "parseJsValue", - "docstrings": [ - "`parseJsValue(value)` attempts to interpret a JavaScript `value` as a grouping setting.\n\n## Examples\n\n```rescript\nIntl.NumberFormat.Grouping.parseJsValue(Js.Json.string(\"auto\")) == Some(#auto)\n```" - ], - "signature": "let parseJsValue: 'a => option<[> #always | #auto | #bool(bool) | #min2]>" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(grouping)` ignores the provided grouping and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/biguint64array/constants": { - "id": "Stdlib.BigUint64Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigUint64Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/bigint64array/constants": { - "id": "Stdlib.BigInt64Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigInt64Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint8clampedarray/constants": { - "id": "Stdlib.Uint8ClampedArray.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8ClampedArray.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint32array/constants": { - "id": "Stdlib.Uint32Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint32Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint16array/constants": { - "id": "Stdlib.Uint16Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint16Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint8array/constants": { - "id": "Stdlib.Uint8Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/int32array/constants": { - "id": "Stdlib.Int32Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int32Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/int16array/constants": { - "id": "Stdlib.Int16Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int16Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/int8array/constants": { - "id": "Stdlib.Int8Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int8Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/float64array/constants": { - "id": "Stdlib.Float64Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float64Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/float32array/constants": { - "id": "Stdlib.Float32Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float32Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/type/classify": { - "id": "Stdlib.Type.Classify", - "name": "Classify", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Type.Classify.function", - "kind": "type", - "name": "function", - "docstrings": [ - "An abstract type representing a JavaScript function.\n\n See [`function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) on MDN." - ], - "signature": "type function" - }, - { - "id": "Stdlib.Type.Classify.object", - "kind": "type", - "name": "object", - "docstrings": [ - "An abstract type representing a JavaScript object.\n\n See [`object`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) on MDN." - ], - "signature": "type object" - }, - { - "id": "Stdlib.Type.Classify.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type representing a classified JavaScript value." - ], - "signature": "type t =\n | Bool(bool)\n | Null\n | Undefined\n | String(string)\n | Number(float)\n | Object(object)\n | Function(function)\n | Symbol(Symbol.t)\n | BigInt(bigint)" - }, - { - "id": "Stdlib.Type.Classify.classify", - "kind": "value", - "name": "classify", - "docstrings": [ - "`classify(anyValue)`\nClassifies a JavaScript value.\n\n## Examples\n```rescript\nswitch %raw(`null`)->Type.Classify.classify {\n| Null => Console.log(\"Yup, that's null.\")\n| _ => Console.log(\"This doesn't actually appear to be null...\")\n}\n```" - ], - "signature": "let classify: 'a => t" - } - ] - }, - "stdlib/regexp/result": { - "id": "Stdlib.RegExp.Result", - "name": "Result", - "docstrings": [], - "items": [ - { - "id": "Stdlib.RegExp.Result.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing the result of a `RegExp` execution." - ], - "signature": "type t = array>" - }, - { - "id": "Stdlib.RegExp.Result.fullMatch", - "kind": "value", - "name": "fullMatch", - "docstrings": [ - "`fullMatch(regExpResult)` returns the full string that matched in this result.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n \n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints the full string that matched, \"ReScript is\"\n }\n ```" - ], - "signature": "let fullMatch: t => string" - }, - { - "id": "Stdlib.RegExp.Result.matches", - "kind": "value", - "name": "matches", - "docstrings": [ - "`matches(regExpResult)` returns all matches for `regExpResult`.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n \n // This below will log \"ReScript\" and \"is\" to the console.\n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) =>\n switch result->RegExp.Result.matches->Array.keepSome {\n | [firstWord, secondWord] => Console.log2(firstWord, secondWord)\n | _ => Console.log(\"Didn't find exactly two words...\")\n }\n }\n ```" - ], - "signature": "let matches: t => array>" - }, - { - "id": "Stdlib.RegExp.Result.index", - "kind": "value", - "name": "index", - "docstrings": [], - "signature": "let index: t => int" - }, - { - "id": "Stdlib.RegExp.Result.input", - "kind": "value", - "name": "input", - "docstrings": [ - "`input(regExpResult)` returns the full input string that was passed to what produced the `RegExp.Result.t`.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n \n // This below will log the full input string \"ReScript is pretty cool, right?\" to the console.\n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) => Console.log(result->RegExp.Result.input)\n }\n ```" - ], - "signature": "let input: t => string" - } - ] - }, - "stdlib/math/int": { - "id": "Stdlib.Math.Int", - "name": "Int", - "docstrings": [ - "Provide Math utilities for `int`" - ], - "items": [ - { - "id": "Stdlib.Math.Int.abs", - "kind": "value", - "name": "abs", - "docstrings": [ - "`abs(v)` returns absolute value of `v`.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.abs(-2) == 2\n Math.Int.abs(3) == 3\n ```" - ], - "signature": "let abs: int => int" - }, - { - "id": "Stdlib.Math.Int.clz32", - "kind": "value", - "name": "clz32", - "docstrings": [ - "`clz32(v)` returns the number of leading zero bits of the argument's 32 bit\nint representation.\nSee [`Math.clz32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32) on MDN.\n\n ## Examples\n\n ```rescript\n // 00000000000000000000000000000001\n Math.Int.clz32(1) == 31\n // 00000000000000000000000000000100\n Math.Int.clz32(4) == 29\n ```" - ], - "signature": "let clz32: int => int" - }, - { - "id": "Stdlib.Math.Int.imul", - "kind": "value", - "name": "imul", - "docstrings": [ - "`imul(a, b)` returns 32-bit integer multiplication. Use this only when you\nneed to optimize performance of multiplication of numbers stored as 32-bit\nintegers.\nSee [`Math.imul`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.imul(3, 4) == 12\n Math.Int.imul(-5, 12) == -60\n ```" - ], - "signature": "let imul: (int, int) => int" - }, - { - "id": "Stdlib.Math.Int.min", - "kind": "value", - "name": "min", - "docstrings": [ - "`min(a, b)` returns the minimum of its two integer arguments.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.min(1, 2) == 1\n Math.Int.min(-1, -2) == -2\n ```" - ], - "signature": "let min: (int, int) => int" - }, - { - "id": "Stdlib.Math.Int.minMany", - "kind": "value", - "name": "minMany", - "docstrings": [ - "`minMany(arr)` returns the minimum of the integers in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.minMany([1, 2]) == 1\n Math.Int.minMany([-1, -2]) == -2\n Math.Int.minMany([])->Int.toFloat->Float.isFinite == false\n ```" - ], - "signature": "let minMany: array => int" - }, - { - "id": "Stdlib.Math.Int.max", - "kind": "value", - "name": "max", - "docstrings": [ - "`max(a, b)` returns the maximum of its two integer arguments.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.max(1, 2) == 2\n Math.Int.max(-1, -2) == -1\n ```" - ], - "signature": "let max: (int, int) => int" - }, - { - "id": "Stdlib.Math.Int.maxMany", - "kind": "value", - "name": "maxMany", - "docstrings": [ - "`maxMany(arr)` returns the maximum of the integers in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.maxMany([1, 2]) == 2\n Math.Int.maxMany([-1, -2]) == -1\n Math.Int.maxMany([])->Int.toFloat->Float.isFinite == false\n ```" - ], - "signature": "let maxMany: array => int" - }, - { - "id": "Stdlib.Math.Int.pow", - "kind": "value", - "name": "pow", - "docstrings": [ - "`pow(a, ~exp)` throws the given base `a` to the given exponent `exp`.\nSee [`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.pow(2, ~exp=4) == 16\n Math.Int.pow(3, ~exp=4) == 81\n ```" - ], - "signature": "let pow: (int, ~exp: int) => int" - }, - { - "id": "Stdlib.Math.Int.sign", - "kind": "value", - "name": "sign", - "docstrings": [ - "`sign(v)` returns the sign of its integer argument: `-1` if negative, `0` if\nzero, `1` if positive.\nSee [`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.sign(3) == 1\n Math.Int.sign(-3) == -1\n Math.Int.sign(0) == 0\n ```" - ], - "signature": "let sign: int => int" - }, - { - "id": "Stdlib.Math.Int.floor", - "kind": "value", - "name": "floor", - "docstrings": [ - "floor(v) returns the largest `int` less than or equal to the argument;\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.floor(3.7) == 3\n Math.Int.floor(3.0) == 3\n Math.Int.floor(-3.1) == -4\n ```" - ], - "signature": "let floor: float => int" - }, - { - "id": "Stdlib.Math.Int.ceil", - "kind": "value", - "name": "ceil", - "docstrings": [ - "ceil(v) returns the smallest `int` greater than or equal to the argument;\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.ceil(3.7) == 4\n Math.Int.ceil(3.0) == 3\n Math.Int.ceil(-3.1) == -3\n ```" - ], - "signature": "let ceil: float => int" - }, - { - "id": "Stdlib.Math.Int.random", - "kind": "value", - "name": "random", - "docstrings": [ - "`random(minVal, maxVal)` returns a random integer number in the half-closed interval \\[minVal, maxVal).\nSee [`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\non MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.random(2, 5)\n Math.Int.random(505, 2000)\n Math.Int.random(-7, -2)\n ```" - ], - "signature": "let random: (int, int) => int" - } - ] - }, - "stdlib/math/constants": { - "id": "Stdlib.Math.Constants", - "name": "Constants", - "docstrings": [ - "Mathematical Constants" - ], - "items": [ - { - "id": "Stdlib.Math.Constants.e", - "kind": "value", - "name": "e", - "docstrings": [ - "`Math.Constants.e` returns Euler's number, ≈ 2.718281828459045.\nSee [`Math.E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.e\n ```" - ], - "signature": "let e: float" - }, - { - "id": "Stdlib.Math.Constants.ln2", - "kind": "value", - "name": "ln2", - "docstrings": [ - "`Math.Constants.ln2` returns Natural logarithm of 2, ≈ 0.6931471805599453.\nSee [`Math.LN2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN2) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.ln2\n ```" - ], - "signature": "let ln2: float" - }, - { - "id": "Stdlib.Math.Constants.ln10", - "kind": "value", - "name": "ln10", - "docstrings": [ - "`Math.Constants.ln10` returns Natural logarithm of 10, ≈ 2.302585092994046.\nSee [`Math.LN10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN10) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.ln10\n ```" - ], - "signature": "let ln10: float" - }, - { - "id": "Stdlib.Math.Constants.log2e", - "kind": "value", - "name": "log2e", - "docstrings": [ - "`Math.Constants.log2e` returns Base 2 logarithm of E, ≈ 1.4426950408889634.\nSee [`Math.LOG2E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG2E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.log2e\n ```" - ], - "signature": "let log2e: float" - }, - { - "id": "Stdlib.Math.Constants.log10e", - "kind": "value", - "name": "log10e", - "docstrings": [ - "`Math.Constants.log10e` returns Base 10 logarithm of E, ≈ 0.4342944819032518.\nSee [`Math.LOG10E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG10E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.log10e\n ```" - ], - "signature": "let log10e: float" - }, - { - "id": "Stdlib.Math.Constants.pi", - "kind": "value", - "name": "pi", - "docstrings": [ - "`Math.Constants.pi` returns Pi - ratio of the circumference to the diameter\nof a circle, ≈ 3.141592653589793.\nSee [`Math.PI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/PI) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.pi\n ```" - ], - "signature": "let pi: float" - }, - { - "id": "Stdlib.Math.Constants.sqrt1_2", - "kind": "value", - "name": "sqrt1_2", - "docstrings": [ - "`Math.Constants.sqrt1_2` returns Square root of 1/2, ≈ 0.7071067811865476.\nSee [`Math.SQRT1_2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.sqrt1_2\n ```" - ], - "signature": "let sqrt1_2: float" - }, - { - "id": "Stdlib.Math.Constants.sqrt2", - "kind": "value", - "name": "sqrt2", - "docstrings": [ - "`Math.Constants.e` returns Absolute value for integer argument.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.sqrt2\n ```" - ], - "signature": "let sqrt2: float" - } - ] - }, - "stdlib/json/decode": { - "id": "Stdlib.JSON.Decode", - "name": "Decode", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JSON.Decode.bool", - "kind": "value", - "name": "bool", - "docstrings": [ - "Decodes a single JSON value. If the value is a bool, it will return `Some(bool)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`true`)->JSON.Decode.bool\n // Some(true)\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.bool\n // None\n ```" - ], - "signature": "let bool: t => option" - }, - { - "id": "Stdlib.JSON.Decode.null", - "kind": "value", - "name": "null", - "docstrings": [ - "Decodes a single JSON value. If the value is null, it will return `Some(Null.t)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`null`)->JSON.Decode.null\n // Some(null)\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.null\n // None\n ```" - ], - "signature": "let null: t => option>" - }, - { - "id": "Stdlib.JSON.Decode.string", - "kind": "value", - "name": "string", - "docstrings": [ - "Decodes a single JSON value. If the value is a string, it will return `Some(string)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.string\n // Some(\"hello world\")\n \n JSON.parseOrThrow(`42`)->JSON.Decode.string\n // None\n ```" - ], - "signature": "let string: t => option" - }, - { - "id": "Stdlib.JSON.Decode.float", - "kind": "value", - "name": "float", - "docstrings": [ - "Decodes a single JSON value. If the value is a float, it will return `Some(float)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`42.0`)->JSON.Decode.float\n // Some(42.0)\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.float\n // None\n ```" - ], - "signature": "let float: t => option" - }, - { - "id": "Stdlib.JSON.Decode.object", - "kind": "value", - "name": "object", - "docstrings": [ - "Decodes a single JSON value. If the value is an object, it will return `Some(dict)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`{\"foo\":\"bar\"}`)->JSON.Decode.object\n // Some({ foo: 'bar' })\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.object\n // None\n ```" - ], - "signature": "let object: t => option>" - }, - { - "id": "Stdlib.JSON.Decode.array", - "kind": "value", - "name": "array", - "docstrings": [ - "Decodes a single JSON value. If the value is an array, it will return `Some(array)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`[\"foo\", \"bar\"]`)->JSON.Decode.array\n // Some([ 'foo', 'bar' ])\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.array\n // None\n ```" - ], - "signature": "let array: t => option>" - } - ] - }, - "stdlib/json/encode": { - "id": "Stdlib.JSON.Encode", - "name": "Encode", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JSON.Encode.bool", - "kind": "value", - "name": "bool", - "docstrings": [ - "Returns a boolean as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.bool(true)\n ```" - ], - "signature": "let bool: bool => t" - }, - { - "id": "Stdlib.JSON.Encode.null", - "kind": "value", - "name": "null", - "docstrings": [ - "Returns null as a JSON value.\n\n ## Examples\n ```rescript\n JSON.Encode.null\n ```" - ], - "signature": "let null: t" - }, - { - "id": "Stdlib.JSON.Encode.string", - "kind": "value", - "name": "string", - "docstrings": [ - "Returns a string as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.string(\"hello world\")\n ```" - ], - "signature": "let string: string => t" - }, - { - "id": "Stdlib.JSON.Encode.int", - "kind": "value", - "name": "int", - "docstrings": [ - "Returns an int as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.int(42)\n ```" - ], - "signature": "let int: int => t" - }, - { - "id": "Stdlib.JSON.Encode.float", - "kind": "value", - "name": "float", - "docstrings": [ - "Returns a float as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.float(42.0)\n ```" - ], - "signature": "let float: float => t" - }, - { - "id": "Stdlib.JSON.Encode.object", - "kind": "value", - "name": "object", - "docstrings": [ - "Returns a dict as a JSON object.\n\n ## Examples\n ```rescript\n let dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n ])\n \n JSON.Encode.object(dict)\n ```" - ], - "signature": "let object: dict => t" - }, - { - "id": "Stdlib.JSON.Encode.array", - "kind": "value", - "name": "array", - "docstrings": [ - "Returns an array as JSON.\n\n ## Examples\n ```rescript\n let array = [JSON.Encode.string(\"hello world\"), JSON.Encode.int(42)]\n \n JSON.Encode.array(array)\n ```" - ], - "signature": "let array: array => t" - }, - { - "id": "Stdlib.JSON.Encode.stringArray", - "kind": "value", - "name": "stringArray", - "docstrings": [ - "Returns an array of strings as a JSON object." - ], - "signature": "let stringArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.floatArray", - "kind": "value", - "name": "floatArray", - "docstrings": [ - "Returns an array of floats as a JSON object." - ], - "signature": "let floatArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.intArray", - "kind": "value", - "name": "intArray", - "docstrings": [ - "Returns an array of integers as a JSON object." - ], - "signature": "let intArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.boolArray", - "kind": "value", - "name": "boolArray", - "docstrings": [ - "Returns an array of booleans as a JSON object." - ], - "signature": "let boolArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.objectArray", - "kind": "value", - "name": "objectArray", - "docstrings": [ - "Returns an array of objects as a JSON object." - ], - "signature": "let objectArray: array> => t" - } - ] - }, - "stdlib/json/classify": { - "id": "Stdlib.JSON.Classify", - "name": "Classify", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JSON.Classify.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a JavaScript type." - ], - "signature": "type t =\n | Bool(bool)\n | Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)" - }, - { - "id": "Stdlib.JSON.Classify.classify", - "kind": "value", - "name": "classify", - "docstrings": [ - "Returns the JSON type of any value.\n\n ## Examples\n ```rescript\n JSON.Classify.classify(\"hello world\")\n // String(\"hello world\")\n \n JSON.Classify.classify(42)\n // Number(42)\n ```" - ], - "signature": "let classify: 'a => t", - "deprecated": "Directly switch on the JSON object instead" - } - ] - }, - "stdlib/jserror/urierror": { - "id": "Stdlib.JsError.URIError", - "name": "URIError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.URIError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `URIError` with the provided `message`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.URIError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `URIError` with the provided `message` and throws it.\n\n `JsError.URIError.throwWithMessage(\"message\")` is equivalent to `JsError.URIError.make(\"message\")->JsError.throw`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/typeerror": { - "id": "Stdlib.JsError.TypeError", - "name": "TypeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.TypeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `TypeError` with the provided `message`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.TypeError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `TypeError` with the provided `message` and throws it.\n\n `JsError.TypeError.throwWithMessage(\"message\")` is equivalent to `JsError.TypeError.make(\"message\")->JsError.throw`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/syntaxerror": { - "id": "Stdlib.JsError.SyntaxError", - "name": "SyntaxError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.SyntaxError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `SyntaxError` with the provided `message`.\n\n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.SyntaxError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `SyntaxError` with the provided `message` and throws it.\n \n `JsError.SyntaxError.throwWithMessage(\"message\")` is equivalent to `JsError.SyntaxError.make(\"message\")->JsError.throw`.\n \n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/referenceerror": { - "id": "Stdlib.JsError.ReferenceError", - "name": "ReferenceError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.ReferenceError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `ReferenceError` with the provided `message`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.ReferenceError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `ReferenceError` with the provided `message` and throws it.\n\n `JsError.ReferenceError.throwWithMessage(\"message\")` is equivalent to `JsError.ReferenceError.make(\"message\")->JsError.throw`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/rangeerror": { - "id": "Stdlib.JsError.RangeError", - "name": "RangeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.RangeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `RangeError` with the provided `message`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.RangeError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `RangeError` with the provided `message` and throws it.\n \n `JsError.RangeError.throwWithMessage(\"message\")` is equivalent to `JsError.RangeError.make(\"message\")->JsError.throw`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/evalerror": { - "id": "Stdlib.JsError.EvalError", - "name": "EvalError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.EvalError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `EvalError` with the provided `message`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.EvalError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `EvalError` with the provided `message` and throws it.\n\n `JsError.EvalError.throwWithMessage(\"message\")` is equivalent to `JsError.EvalError.make(\"message\")->JsError.throw`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/intl/segments": { - "id": "Stdlib.Intl.Segments", - "name": "Segments", - "docstrings": [ - "Bindings to `Segments` objects produced by `Intl.Segmenter.segment`.\n A Segments instance is an object that represents the segments of a specific string, subject to the locale and options of its constructing Intl.Segmenter instance.\nhttps://tc39.es/ecma402/#sec-segments-objects.\n\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment) for API details and the [ECMA-402 specification](https://tc39.es/ecma402/#sec-segments-objects) for the object shape." - ], - "items": [ - { - "id": "Stdlib.Intl.Segments.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Segments.segmentData", - "kind": "type", - "name": "segmentData", - "docstrings": [], - "signature": "type segmentData = {\n segment: string,\n index: int,\n isWordLike: option,\n input: string,\n}" - }, - { - "id": "Stdlib.Intl.Segments.containing", - "kind": "value", - "name": "containing", - "docstrings": [ - "`containing(segments)` returns the segment data for the index supplied when iterating.\n\nUse this when consuming `Segments` via iteration helpers where the index is already implied." - ], - "signature": "let containing: t => segmentData" - }, - { - "id": "Stdlib.Intl.Segments.containingWithIndex", - "kind": "value", - "name": "containingWithIndex", - "docstrings": [ - "`containingWithIndex(segments, index)` returns the segment that contains `index` within the original string.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #word})\nlet segments = segmenter->Intl.Segmenter.segment(\"Hello world\")\nIntl.Segments.containingWithIndex(segments, 0).segment == \"Hello\"\n```" - ], - "signature": "let containingWithIndex: (t, int) => segmentData" - }, - { - "id": "Stdlib.Intl.Segments.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(segments)` ignores the provided segments and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/segmenter": { - "id": "Stdlib.Intl.Segmenter", - "name": "Segmenter", - "docstrings": [ - "Bindings to JavaScript's `Intl.Segmenter`.\n\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter) for API details." - ], - "items": [ - { - "id": "Stdlib.Intl.Segmenter.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Segmenter.granularity", - "kind": "type", - "name": "granularity", - "docstrings": [], - "signature": "type granularity = [#grapheme | #sentence | #word]" - }, - { - "id": "Stdlib.Intl.Segmenter.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n granularity?: granularity,\n}" - }, - { - "id": "Stdlib.Intl.Segmenter.pluralCategories", - "kind": "type", - "name": "pluralCategories", - "docstrings": [], - "signature": "type pluralCategories = [\n | #few\n | #many\n | #one\n | #other\n | #two\n | #zero\n]" - }, - { - "id": "Stdlib.Intl.Segmenter.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n granularity: granularity,\n}" - }, - { - "id": "Stdlib.Intl.Segmenter.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.Segmenter.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.Segmenter` instance for segmenting strings.\n\nSee [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter) on MDN.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #word})\nIntl.Segmenter.resolvedOptions(segmenter).granularity == #word\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.Segmenter.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for segmentation.\n\nSee [`Intl.Segmenter.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.Segmenter.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.Segmenter.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(segmenter)` returns the locale and granularity currently in use.\n\nSee [`Intl.Segmenter.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #sentence})\nIntl.Segmenter.resolvedOptions(segmenter).granularity == #sentence\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.Segmenter.segment", - "kind": "value", - "name": "segment", - "docstrings": [ - "`segment(segmenter, input)` returns a `Segments` object describing `input`.\n\nSee [`Intl.Segmenter.prototype.segment`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment) on MDN.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #word})\nlet segments = segmenter->Intl.Segmenter.segment(\"Hello world\")\nIntl.Segments.containingWithIndex(segments, 0).segment == \"Hello\"\n```" - ], - "signature": "let segment: (t, string) => Intl_Segments.t" - }, - { - "id": "Stdlib.Intl.Segmenter.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(segmenter)` ignores the provided segmenter and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/relativetimeformat": { - "id": "Stdlib.Intl.RelativeTimeFormat", - "name": "RelativeTimeFormat", - "docstrings": [ - "Bindings to JavaScript's `Intl.RelativeTimeFormat`.\n\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) for API details." - ], - "items": [ - { - "id": "Stdlib.Intl.RelativeTimeFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.numeric", - "kind": "type", - "name": "numeric", - "docstrings": [], - "signature": "type numeric = [#always | #auto]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.style", - "kind": "type", - "name": "style", - "docstrings": [], - "signature": "type style = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.timeUnit", - "kind": "type", - "name": "timeUnit", - "docstrings": [], - "signature": "type timeUnit = [\n | #day\n | #hour\n | #minute\n | #month\n | #quarter\n | #second\n | #week\n | #year\n]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n numeric?: numeric,\n style?: style,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n numeric: numeric,\n style: style,\n numberingSystem: string,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.relativeTimePartComponent", - "kind": "type", - "name": "relativeTimePartComponent", - "docstrings": [], - "signature": "type relativeTimePartComponent = [#integer | #literal]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.relativeTimePart", - "kind": "type", - "name": "relativeTimePart", - "docstrings": [], - "signature": "type relativeTimePart = {\n \\\"type\": relativeTimePartComponent,\n value: string,\n unit?: timeUnit,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.RelativeTimeFormat` instance for formatting relative time strings.\n\nSee [`Intl.RelativeTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en-US\"])\nformatter->Intl.RelativeTimeFormat.format(1, #day)->String.length > 0\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for relative time formatting.\n\nSee [`Intl.RelativeTimeFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.RelativeTimeFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the locale and options currently in use.\n\nSee [`Intl.RelativeTimeFormat.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en-US\"])\nIntl.RelativeTimeFormat.resolvedOptions(formatter).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, value, unit)` returns the formatted string for `value` expressed in `unit`.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en\"])\nformatter->Intl.RelativeTimeFormat.format(-1, #day)->String.length > 0\n```" - ], - "signature": "let format: (t, int, timeUnit) => string" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, value, unit)` returns an array describing how the output string is assembled.\n\nSee [`Intl.RelativeTimeFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en\"])\nformatter->Intl.RelativeTimeFormat.formatToParts(-1, #day)->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, int, timeUnit) => array" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(relativeTimeFormat)` ignores the provided relativeTimeFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/pluralrules": { - "id": "Stdlib.Intl.PluralRules", - "name": "PluralRules", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.PluralRules.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.PluralRules.localeType", - "kind": "type", - "name": "localeType", - "docstrings": [], - "signature": "type localeType = [#cardinal | #ordinal]" - }, - { - "id": "Stdlib.Intl.PluralRules.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n \\\"type\"?: localeType,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" - }, - { - "id": "Stdlib.Intl.PluralRules.pluralCategories", - "kind": "type", - "name": "pluralCategories", - "docstrings": [], - "signature": "type pluralCategories = [\n | #few\n | #many\n | #one\n | #other\n | #two\n | #zero\n]" - }, - { - "id": "Stdlib.Intl.PluralRules.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n pluralCategories: array,\n \\\"type\": localeType,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" - }, - { - "id": "Stdlib.Intl.PluralRules.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.PluralRules.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.PluralRules` instance to determine plural categories.\n\nSee [`Intl.PluralRules`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules) on MDN.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nlet category = rules->Intl.PluralRules.select(1.0)\ncategory == #one\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.PluralRules.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for plural rules.\n\nSee [`Intl.PluralRules.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.PluralRules.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.PluralRules.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(rules)` returns the plural rule configuration in use.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nIntl.PluralRules.resolvedOptions(rules).locale == \"en\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.PluralRules.rule", - "kind": "type", - "name": "rule", - "docstrings": [], - "signature": "type rule = [#few | #many | #one | #other | #two | #zero]" - }, - { - "id": "Stdlib.Intl.PluralRules.select", - "kind": "value", - "name": "select", - "docstrings": [ - "`select(rules, value)` returns the plural category for the given number.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.select(1.) == #one\n```" - ], - "signature": "let select: (t, float) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.selectInt", - "kind": "value", - "name": "selectInt", - "docstrings": [ - "`selectInt(rules, value)` is like `select` but accepts an integer.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.selectInt(2) == #other\n```" - ], - "signature": "let selectInt: (t, int) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.selectRange", - "kind": "value", - "name": "selectRange", - "docstrings": [ - "`selectRange(rules, ~start, ~end)` returns the category for numbers in the range.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.selectRange(~start=1., ~end=2.) == #other\n```" - ], - "signature": "let selectRange: (t, ~start: float, ~end: float) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.selectRangeInt", - "kind": "value", - "name": "selectRangeInt", - "docstrings": [ - "`selectRangeInt(rules, ~start, ~end)` is the integer version of `selectRange`.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.selectRangeInt(~start=1, ~end=1) == #other\n```" - ], - "signature": "let selectRangeInt: (t, ~start: int, ~end: int) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(pluralRules)` ignores the provided pluralRules and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/numberformat": { - "id": "Stdlib.Intl.NumberFormat", - "name": "NumberFormat", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.NumberFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.NumberFormat.currency", - "kind": "type", - "name": "currency", - "docstrings": [ - "An ISO 4217 currency code. e.g. USD, EUR, CNY" - ], - "signature": "type currency = string" - }, - { - "id": "Stdlib.Intl.NumberFormat.currencyDisplay", - "kind": "type", - "name": "currencyDisplay", - "docstrings": [], - "signature": "type currencyDisplay = [\n | #code\n | #name\n | #narrowSymbol\n | #symbol\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.currencySign", - "kind": "type", - "name": "currencySign", - "docstrings": [], - "signature": "type currencySign = [#accounting | #standard]" - }, - { - "id": "Stdlib.Intl.NumberFormat.notation", - "kind": "type", - "name": "notation", - "docstrings": [], - "signature": "type notation = [\n | #compact\n | #engineering\n | #scientific\n | #standard\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.compactDisplay", - "kind": "type", - "name": "compactDisplay", - "docstrings": [ - "Used only when notation is #compact" - ], - "signature": "type compactDisplay = [#long | #short]" - }, - { - "id": "Stdlib.Intl.NumberFormat.signDisplay", - "kind": "type", - "name": "signDisplay", - "docstrings": [], - "signature": "type signDisplay = [\n | #always\n | #auto\n | #exceptZero\n | #negative\n | #never\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.style", - "kind": "type", - "name": "style", - "docstrings": [], - "signature": "type style = [#currency | #decimal | #percent | #unit]" - }, - { - "id": "Stdlib.Intl.NumberFormat.unitSystem", - "kind": "type", - "name": "unitSystem", - "docstrings": [ - "Defined in https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier\nOnly used when style is #unit" - ], - "signature": "type unitSystem = string" - }, - { - "id": "Stdlib.Intl.NumberFormat.unitDisplay", - "kind": "type", - "name": "unitDisplay", - "docstrings": [ - "Only used when style is #unit" - ], - "signature": "type unitDisplay = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.NumberFormat.rounding", - "kind": "type", - "name": "rounding", - "docstrings": [], - "signature": "type rounding = [\n | #ceil\n | #expand\n | #floor\n | #halfCeil\n | #halfEven\n | #halfExpand\n | #halfFloor\n | #halfTrunc\n | #trunc\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.roundingPriority", - "kind": "type", - "name": "roundingPriority", - "docstrings": [], - "signature": "type roundingPriority = [\n | #auto\n | #lessPrecision\n | #morePrecision\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.roundingIncrement", - "kind": "type", - "name": "roundingIncrement", - "docstrings": [], - "signature": "type roundingIncrement = [\n | #1\n | #10\n | #100\n | #1000\n | #2\n | #20\n | #200\n | #2000\n | #25\n | #250\n | #2500\n | #5\n | #50\n | #500\n | #5000\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.trailingZeroDisplay", - "kind": "type", - "name": "trailingZeroDisplay", - "docstrings": [], - "signature": "type trailingZeroDisplay = [\n | #auto\n | #lessPrecision\n | #stripIfInteger\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n compactDisplay?: compactDisplay,\n numberingSystem?: Intl_Common.numberingSystem,\n currency?: currency,\n currencyDisplay?: currencyDisplay,\n currencySign?: currencySign,\n localeMatcher?: Intl_Common.localeMatcher,\n notation?: notation,\n signDisplay?: signDisplay,\n style?: style,\n unit?: unitSystem,\n unitDisplay?: unitDisplay,\n useGrouping?: Grouping.t,\n roundingMode?: rounding,\n roundingPriority?: roundingPriority,\n roundingIncrement?: roundingIncrement,\n trailingZeroDisplay?: trailingZeroDisplay,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n currency?: currency,\n currencyDisplay?: currencyDisplay,\n currencySign?: currencySign,\n compactDisplay?: compactDisplay,\n unit: unitSystem,\n unitDisplay: unitDisplay,\n roundingMode?: rounding,\n roundingPriority?: roundingPriority,\n roundingIncrement?: roundingIncrement,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n locale: string,\n notation: notation,\n numberingSystem: Intl_Common.numberingSystem,\n signDisplay: signDisplay,\n style: style,\n useGrouping: Grouping.t,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.numberFormatPartType", - "kind": "type", - "name": "numberFormatPartType", - "docstrings": [], - "signature": "type numberFormatPartType = [\n | #compact\n | #currency\n | #decimal\n | #exponentInteger\n | #exponentMinusSign\n | #exponentSeparator\n | #fraction\n | #group\n | #infinity\n | #integer\n | #literal\n | #minusSign\n | #nan\n | #percentSign\n | #plusSign\n | #unit\n | #unknown\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.numberFormatPart", - "kind": "type", - "name": "numberFormatPart", - "docstrings": [], - "signature": "type numberFormatPart = {\n \\\"type\": numberFormatPartType,\n value: string,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.rangeSource", - "kind": "type", - "name": "rangeSource", - "docstrings": [], - "signature": "type rangeSource = [#endRange | #shared | #startRange]" - }, - { - "id": "Stdlib.Intl.NumberFormat.numberFormatRangePart", - "kind": "type", - "name": "numberFormatRangePart", - "docstrings": [], - "signature": "type numberFormatRangePart = {\n \\\"type\": numberFormatPartType,\n value: string,\n source: rangeSource,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.NumberFormat` instance for locale-aware number formatting.\n\nSee [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"], ~options={style: #currency, currency: \"USD\"})\nformatter->Intl.NumberFormat.format(1234.5) == \"$1,234.50\"\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.NumberFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for number formatting.\n\nSee [`Intl.NumberFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.NumberFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the actual options being used.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nIntl.NumberFormat.resolvedOptions(formatter).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.NumberFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, value)` returns the formatted representation of `value`.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.format(1234.5) == \"1,234.5\"\n```" - ], - "signature": "let format: (t, float) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatRange", - "kind": "value", - "name": "formatRange", - "docstrings": [ - "`formatRange(formatter, ~start, ~end)` formats numbers representing a range.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.formatRange(~start=1., ~end=2.)->String.length > 0\n```" - ], - "signature": "let formatRange: (t, ~start: float, ~end: float) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, value)` breaks the formatted result into parts.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.formatToParts(123)->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, float) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatRangeToParts", - "kind": "value", - "name": "formatRangeToParts", - "docstrings": [ - "`formatRangeToParts(formatter, ~start, ~end)` returns how the range would be rendered.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.formatRangeToParts(~start=1., ~end=2.)->Array.length > 0\n```" - ], - "signature": "let formatRangeToParts: (\n t,\n ~start: float,\n ~end: float,\n) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatInt", - "kind": "value", - "name": "formatInt", - "docstrings": [ - "`formatInt(formatter, value)` formats integer values.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatInt(42) == \"42\"\n```" - ], - "signature": "let formatInt: (t, int) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatIntRange", - "kind": "value", - "name": "formatIntRange", - "docstrings": [ - "`formatIntRange(formatter, ~start, ~end)` formats integer ranges.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatIntRange(~start=1, ~end=3)->String.length > 0\n```" - ], - "signature": "let formatIntRange: (t, ~start: int, ~end: int) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatIntToParts", - "kind": "value", - "name": "formatIntToParts", - "docstrings": [ - "`formatIntToParts(formatter, value)` returns formatting parts for an integer.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatIntToParts(123)->Array.length > 0\n```" - ], - "signature": "let formatIntToParts: (t, int) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatIntRangeToParts", - "kind": "value", - "name": "formatIntRangeToParts", - "docstrings": [ - "`formatIntRangeToParts(formatter, ~start, ~end)` returns how the integer range would be rendered.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatIntRangeToParts(~start=1, ~end=1)->Array.length > 0\n```" - ], - "signature": "let formatIntRangeToParts: (t, ~start: int, ~end: int) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigInt", - "kind": "value", - "name": "formatBigInt", - "docstrings": [ - "`formatBigInt(formatter, value)` formats bigint values." - ], - "signature": "let formatBigInt: (t, bigint) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigIntRange", - "kind": "value", - "name": "formatBigIntRange", - "docstrings": [ - "`formatBigIntRange(formatter, ~start, ~end)` formats a range of bigint values.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatBigIntRange(~start=1n, ~end=2n) == \"1–2\"\n```" - ], - "signature": "let formatBigIntRange: (t, ~start: bigint, ~end: bigint) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigIntToParts", - "kind": "value", - "name": "formatBigIntToParts", - "docstrings": [ - "`formatBigIntToParts(formatter, value)` returns the bigint formatting broken into parts.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatBigIntToParts(5n)->Array.length > 0\n```" - ], - "signature": "let formatBigIntToParts: (t, bigint) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigIntRangeToParts", - "kind": "value", - "name": "formatBigIntRangeToParts", - "docstrings": [ - "`formatBigIntRangeToParts(formatter, ~start, ~end)` describes how the bigint range would be rendered.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatBigIntRangeToParts(~start=3n, ~end=4n)->Array.length > 0\n```" - ], - "signature": "let formatBigIntRangeToParts: (\n t,\n ~start: bigint,\n ~end: bigint,\n) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatString", - "kind": "value", - "name": "formatString", - "docstrings": [ - "`formatString(formatter, value)` interprets `value` as a number string and formats it.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatString(\"1234\") == \"1,234\"\n```" - ], - "signature": "let formatString: (t, string) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatStringToParts", - "kind": "value", - "name": "formatStringToParts", - "docstrings": [ - "`formatStringToParts(formatter, value)` returns formatting parts for a numeric string.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatStringToParts(\"123\")->Array.length > 0\n```" - ], - "signature": "let formatStringToParts: (t, string) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(numberFormat)` ignores the provided numberFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/locale": { - "id": "Stdlib.Intl.Locale", - "name": "Locale", - "docstrings": [ - "Bindings to JavaScript's `Intl.Locale`." - ], - "items": [ - { - "id": "Stdlib.Intl.Locale.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Locale.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n baseName?: string,\n calendar?: Intl_Common.calendar,\n collation?: Intl_Common.collation,\n hourCycle?: [#h11 | #h12 | #h23 | #h24],\n caseFirst?: [#\"false\" | #lower | #upper],\n numberingSystem?: Intl_Common.numberingSystem,\n numeric?: bool,\n language?: string,\n script?: string,\n region?: string,\n}" - }, - { - "id": "Stdlib.Intl.Locale.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.Locale` object from a locale identifier and optional modifiers.\n\nSee [`Intl.Locale`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en-US\")\nlocale->Intl.Locale.language == \"en\"\n```" - ], - "signature": "let make: (string, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.Locale.baseName", - "kind": "value", - "name": "baseName", - "docstrings": [ - "`baseName(locale)` returns the canonical base name (without Unicode extensions).\n\nSee [`Intl.Locale.prototype.baseName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/baseName) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"fr-CA\")\nlocale->Intl.Locale.baseName == \"fr-CA\"\n```" - ], - "signature": "let baseName: t => string" - }, - { - "id": "Stdlib.Intl.Locale.calendar", - "kind": "value", - "name": "calendar", - "docstrings": [ - "`calendar(locale)` returns the specified calendar, if present.\n\nSee [`Intl.Locale.prototype.calendar`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/calendar) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={calendar: #gregory})\nlocale->Intl.Locale.calendar == Some(\"gregory\")\n```" - ], - "signature": "let calendar: t => option" - }, - { - "id": "Stdlib.Intl.Locale.caseFirst", - "kind": "value", - "name": "caseFirst", - "docstrings": [ - "`caseFirst(locale)` returns the case-first ordering setting, if present.\n\nSee [`Intl.Locale.prototype.caseFirst`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/caseFirst) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={caseFirst: #upper})\nlocale->Intl.Locale.caseFirst == Some(\"upper\")\n```" - ], - "signature": "let caseFirst: t => option" - }, - { - "id": "Stdlib.Intl.Locale.collation", - "kind": "value", - "name": "collation", - "docstrings": [ - "`collation(locale)` returns the collation type, if present.\n\nSee [`Intl.Locale.prototype.collation`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/collation) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={collation: #phonebk})\nlocale->Intl.Locale.collation == Some(\"phonebk\")\n```" - ], - "signature": "let collation: t => option" - }, - { - "id": "Stdlib.Intl.Locale.hourCycle", - "kind": "value", - "name": "hourCycle", - "docstrings": [ - "`hourCycle(locale)` returns the preferred hour cycle, if present.\n\nSee [`Intl.Locale.prototype.hourCycle`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={hourCycle: #h12})\nlocale->Intl.Locale.hourCycle == Some(\"h12\")\n```" - ], - "signature": "let hourCycle: t => option" - }, - { - "id": "Stdlib.Intl.Locale.language", - "kind": "value", - "name": "language", - "docstrings": [ - "`language(locale)` returns the primary language subtag.\n\nSee [`Intl.Locale.prototype.language`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/language) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"pt-BR\")\nlocale->Intl.Locale.language == \"pt\"\n```" - ], - "signature": "let language: t => string" - }, - { - "id": "Stdlib.Intl.Locale.numberingSystem", - "kind": "value", - "name": "numberingSystem", - "docstrings": [ - "`numberingSystem(locale)` returns the numbering system identifier, if present.\n\nSee [`Intl.Locale.prototype.numberingSystem`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/numberingSystem) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={numberingSystem: #latn})\nlocale->Intl.Locale.numberingSystem == Some(\"latn\")\n```" - ], - "signature": "let numberingSystem: t => option" - }, - { - "id": "Stdlib.Intl.Locale.numeric", - "kind": "value", - "name": "numeric", - "docstrings": [ - "`numeric(locale)` indicates whether numeric ordering should be used for region subtags.\n\nSee [`Intl.Locale.prototype.numeric`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/numeric) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={numeric: true})\nlocale->Intl.Locale.numeric == true\n```" - ], - "signature": "let numeric: t => bool" - }, - { - "id": "Stdlib.Intl.Locale.region", - "kind": "value", - "name": "region", - "docstrings": [ - "`region(locale)` returns the region subtag, if present.\n\nSee [`Intl.Locale.prototype.region`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/region) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en-US\")\nlocale->Intl.Locale.region == Some(\"US\")\n```" - ], - "signature": "let region: t => option" - }, - { - "id": "Stdlib.Intl.Locale.script", - "kind": "value", - "name": "script", - "docstrings": [ - "`script(locale)` returns the script subtag, if present.\n\nSee [`Intl.Locale.prototype.script`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/script) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"sr-Cyrl\")\nlocale->Intl.Locale.script == Some(\"Cyrl\")\n```" - ], - "signature": "let script: t => option" - }, - { - "id": "Stdlib.Intl.Locale.maximize", - "kind": "value", - "name": "maximize", - "docstrings": [ - "`maximize(locale)` adds likely subtags to produce the most specific locale.\n\nSee [`Intl.Locale.prototype.maximize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/maximize) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\")\nlocale->Intl.Locale.maximize->Intl.Locale.region == Some(\"US\")\n```" - ], - "signature": "let maximize: t => t" - }, - { - "id": "Stdlib.Intl.Locale.minimize", - "kind": "value", - "name": "minimize", - "docstrings": [ - "`minimize(locale)` removes unnecessary subtags while preserving semantics.\n\nSee [`Intl.Locale.prototype.minimize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/minimize) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en-Latn-US\")\nlocale->Intl.Locale.minimize->Intl.Locale.baseName == \"en\"\n```" - ], - "signature": "let minimize: t => t" - }, - { - "id": "Stdlib.Intl.Locale.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(locale)` ignores the provided locale and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/listformat": { - "id": "Stdlib.Intl.ListFormat", - "name": "ListFormat", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.ListFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.ListFormat.listType", - "kind": "type", - "name": "listType", - "docstrings": [], - "signature": "type listType = [#conjunction | #disjunction | #unit]" - }, - { - "id": "Stdlib.Intl.ListFormat.style", - "kind": "type", - "name": "style", - "docstrings": [], - "signature": "type style = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.ListFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n \\\"type\"?: listType,\n style?: style,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.listPartComponentType", - "kind": "type", - "name": "listPartComponentType", - "docstrings": [], - "signature": "type listPartComponentType = [#element | #literal]" - }, - { - "id": "Stdlib.Intl.ListFormat.listPart", - "kind": "type", - "name": "listPart", - "docstrings": [], - "signature": "type listPart = {\n \\\"type\": listPartComponentType,\n value: string,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n style: style,\n \\\"type\": listType,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.ListFormat` instance for formatting lists.\n\nSee [`Intl.ListFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"], ~options={\\\"type\": #conjunction})\nformatter->Intl.ListFormat.format([\"apples\", \"bananas\", \"cherries\"]) == \"apples, bananas, and cherries\"\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.ListFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for list formatting.\n\nSee [`Intl.ListFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.ListFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.ListFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the actual options being used.\n\nSee [`Intl.ListFormat.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"])\nIntl.ListFormat.resolvedOptions(formatter).locale == \"en\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.ListFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, items)` returns the formatted list string.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"])\nformatter->Intl.ListFormat.format([\"a\", \"b\"]) == \"a and b\"\n```" - ], - "signature": "let format: (t, array) => string" - }, - { - "id": "Stdlib.Intl.ListFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, items)` returns the list as an array of parts describing how it would be rendered.\n\nSee [`Intl.ListFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/formatToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"])\nformatter->Intl.ListFormat.formatToParts([\"a\", \"b\"])->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, array) => array" - }, - { - "id": "Stdlib.Intl.ListFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(listFormat)` ignores the provided listFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/datetimeformat": { - "id": "Stdlib.Intl.DateTimeFormat", - "name": "DateTimeFormat", - "docstrings": [ - "Bindings to JavaScript's `Intl.DateTimeFormat`." - ], - "items": [ - { - "id": "Stdlib.Intl.DateTimeFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateStyle", - "kind": "type", - "name": "dateStyle", - "docstrings": [], - "signature": "type dateStyle = [#full | #long | #medium | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.timeStyle", - "kind": "type", - "name": "timeStyle", - "docstrings": [], - "signature": "type timeStyle = [#full | #long | #medium | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dayPeriod", - "kind": "type", - "name": "dayPeriod", - "docstrings": [], - "signature": "type dayPeriod = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.weekday", - "kind": "type", - "name": "weekday", - "docstrings": [], - "signature": "type weekday = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.era", - "kind": "type", - "name": "era", - "docstrings": [], - "signature": "type era = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.year", - "kind": "type", - "name": "year", - "docstrings": [], - "signature": "type year = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.month", - "kind": "type", - "name": "month", - "docstrings": [], - "signature": "type month = [\n | #\"2-digit\"\n | #long\n | #narrow\n | #numeric\n | #short\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.day", - "kind": "type", - "name": "day", - "docstrings": [], - "signature": "type day = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.hour", - "kind": "type", - "name": "hour", - "docstrings": [], - "signature": "type hour = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.minute", - "kind": "type", - "name": "minute", - "docstrings": [], - "signature": "type minute = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.second", - "kind": "type", - "name": "second", - "docstrings": [], - "signature": "type second = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.timeZoneName", - "kind": "type", - "name": "timeZoneName", - "docstrings": [ - "Firefox also supports IANA time zone names here\nNode v19+ supports \"shortOffset\", \"shortGeneric\", \"longOffset\", and \"longGeneric\"." - ], - "signature": "type timeZoneName = [\n | #long\n | #longGeneric\n | #longOffset\n | #short\n | #shortGeneric\n | #shortOffset\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.hourCycle", - "kind": "type", - "name": "hourCycle", - "docstrings": [], - "signature": "type hourCycle = [#h11 | #h12 | #h23 | #h24]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatMatcher", - "kind": "type", - "name": "formatMatcher", - "docstrings": [], - "signature": "type formatMatcher = [#basic | #\"best fit\"]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.fractionalSecondDigits", - "kind": "type", - "name": "fractionalSecondDigits", - "docstrings": [], - "signature": "type fractionalSecondDigits = [#0 | #1 | #2 | #3]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n dateStyle?: dateStyle,\n timeStyle?: timeStyle,\n calendar?: Intl_Common.calendar,\n dayPeriod?: dayPeriod,\n numberingSystem?: Intl_Common.numberingSystem,\n localeMatcher?: Intl_Common.localeMatcher,\n timeZone?: string,\n hour12?: bool,\n hourCycle?: hourCycle,\n formatMatcher?: formatMatcher,\n weekday?: weekday,\n era?: era,\n year?: year,\n month?: month,\n day?: day,\n hour?: hour,\n minute?: minute,\n second?: second,\n fractionalSecondDigits?: fractionalSecondDigits,\n timeZoneName?: timeZoneName,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n dateStyle?: dateStyle,\n timeStyle?: timeStyle,\n weekday?: weekday,\n era?: era,\n year?: year,\n month?: month,\n day?: day,\n hour?: hour,\n minute?: minute,\n second?: second,\n fractionalSecondDigits?: fractionalSecondDigits,\n timeZoneName?: timeZoneName,\n calendar: Intl_Common.calendar,\n hour12: bool,\n hourCycle: hourCycle,\n locale: string,\n numberingSystem: Intl_Common.numberingSystem,\n timeZone: string,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimeComponent", - "kind": "type", - "name": "dateTimeComponent", - "docstrings": [], - "signature": "type dateTimeComponent = [\n | #day\n | #dayPeriod\n | #era\n | #fractionalSecond\n | #hour\n | #literal\n | #minute\n | #month\n | #relatedYear\n | #second\n | #timeZone\n | #weekday\n | #year\n | #yearName\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimePart", - "kind": "type", - "name": "dateTimePart", - "docstrings": [], - "signature": "type dateTimePart = {\n \\\"type\": dateTimeComponent,\n value: string,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimeRangeSource", - "kind": "type", - "name": "dateTimeRangeSource", - "docstrings": [], - "signature": "type dateTimeRangeSource = [\n | #endRange\n | #shared\n | #startRange\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimeRangePart", - "kind": "type", - "name": "dateTimeRangePart", - "docstrings": [], - "signature": "type dateTimeRangePart = {\n \\\"type\": dateTimeComponent,\n value: string,\n source: dateTimeRangeSource,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.DateTimeFormat` instance for formatting date values.\n\nSee [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"], ~options={timeStyle: #short})\nlet sampleDate = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nformatter->Intl.DateTimeFormat.format(sampleDate)->String.length > 0\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported by the runtime for date/time formatting.\n\nSee [`Intl.DateTimeFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.DateTimeFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the actual locale and formatting options in use.\n\nSee [`Intl.DateTimeFormat.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"])\nIntl.DateTimeFormat.resolvedOptions(formatter).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, date)` returns the formatted string for `date`.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en\"])\nlet date = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nformatter->Intl.DateTimeFormat.format(date)->String.length > 0\n```" - ], - "signature": "let format: (t, Date.t) => string" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, date)` breaks the formatted output into an array of parts.\n\nSee [`Intl.DateTimeFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en\"])\nlet date = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nformatter->Intl.DateTimeFormat.formatToParts(date)->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, Date.t) => array" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatRange", - "kind": "value", - "name": "formatRange", - "docstrings": [ - "`formatRange(formatter, ~startDate, ~endDate)` formats the range between `startDate` and `endDate`.\n\nSee [`Intl.DateTimeFormat.prototype.formatRange`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatRange) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"], ~options={dateStyle: #short})\nlet startDate = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nlet endDate = Js.Date.makeWithYMD(~year=2024, ~month=1, ~date=1)\nformatter->Intl.DateTimeFormat.formatRange(~startDate=startDate, ~endDate=endDate)->String.length > 0\n```" - ], - "signature": "let formatRange: (t, ~startDate: Date.t, ~endDate: Date.t) => string" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatRangeToParts", - "kind": "value", - "name": "formatRangeToParts", - "docstrings": [ - "`formatRangeToParts(formatter, ~startDate, ~endDate)` returns an array describing how the range would be rendered.\n\nSee [`Intl.DateTimeFormat.prototype.formatRangeToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatRangeToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"], ~options={dateStyle: #short})\nlet startDate = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nlet endDate = Js.Date.makeWithYMD(~year=2024, ~month=1, ~date=1)\nformatter->Intl.DateTimeFormat.formatRangeToParts(~startDate=startDate, ~endDate=endDate)->Array.length > 0\n```" - ], - "signature": "let formatRangeToParts: (\n t,\n ~startDate: Date.t,\n ~endDate: Date.t,\n) => array" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(dateTimeFormat)` ignores the provided dateTimeFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/collator": { - "id": "Stdlib.Intl.Collator", - "name": "Collator", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.Collator.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Collator.usage", - "kind": "type", - "name": "usage", - "docstrings": [], - "signature": "type usage = [#search | #sort]" - }, - { - "id": "Stdlib.Intl.Collator.sensitivity", - "kind": "type", - "name": "sensitivity", - "docstrings": [], - "signature": "type sensitivity = [#accent | #base | #case | #variant]" - }, - { - "id": "Stdlib.Intl.Collator.caseFirst", - "kind": "type", - "name": "caseFirst", - "docstrings": [], - "signature": "type caseFirst = [#\"false\" | #lower | #upper]" - }, - { - "id": "Stdlib.Intl.Collator.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n usage?: usage,\n sensitivity?: sensitivity,\n ignorePunctuation?: bool,\n numeric?: bool,\n caseFirst?: caseFirst,\n}" - }, - { - "id": "Stdlib.Intl.Collator.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n usage: usage,\n sensitivity: sensitivity,\n ignorePunctuation: bool,\n collation: [\n | #compat\n | #default\n | #dict\n | #emoji\n | #eor\n | #phonebk\n | #phonetic\n | #pinyin\n | #stroke\n | #trad\n | #unihan\n | #zhuyin\n ],\n numeric?: bool,\n caseFirst?: caseFirst,\n}" - }, - { - "id": "Stdlib.Intl.Collator.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.Collator.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.Collator` instance that can compare strings using locale-aware rules.\n\nSee [`Intl.Collator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) on MDN.\n\n## Examples\n\n```rescript\nlet collator = Intl.Collator.make(~locales=[\"en\"])\ncollator->Intl.Collator.compare(\"apple\", \"banana\") < 0\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.Collator.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported by the runtime for collation.\n\nSee [`Intl.Collator.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.Collator.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.Collator.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(collator)` returns the locale and collation settings in use.\n\nSee [`Intl.Collator.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet collator = Intl.Collator.make(~locales=[\"en-US\"])\nIntl.Collator.resolvedOptions(collator).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.Collator.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(collator, a, b)` compares two strings using the rules of `collator`. Returns a negative number when `a` comes before `b`, `0` when equal, and a positive number otherwise.\n\n## Examples\n\n```rescript\nlet collator = Intl.Collator.make(~locales=[\"en-US\"])\ncollator->Intl.Collator.compare(\"apple\", \"banana\") < 0\n```" - ], - "signature": "let compare: (t, string, string) => int" - }, - { - "id": "Stdlib.Intl.Collator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(collator)` ignores the provided collator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/common": { - "id": "Stdlib.Intl.Common", - "name": "Common", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.Common.localeMatcher", - "kind": "type", - "name": "localeMatcher", - "docstrings": [], - "signature": "type localeMatcher = [#\"best fit\" | #lookup]" - }, - { - "id": "Stdlib.Intl.Common.calendar", - "kind": "type", - "name": "calendar", - "docstrings": [], - "signature": "type calendar = [\n | #buddhist\n | #chinese\n | #coptic\n | #dangi\n | #ethioaa\n | #ethiopic\n | #gregory\n | #hebrew\n | #indian\n | #islamic\n | #\"islamic-civil\"\n | #\"islamic-rgsa\"\n | #\"islamic-tbla\"\n | #\"islamic-umalqura\"\n | #iso8601\n | #japanese\n | #persian\n | #roc\n]" - }, - { - "id": "Stdlib.Intl.Common.collation", - "kind": "type", - "name": "collation", - "docstrings": [], - "signature": "type collation = [\n | #compat\n | #dict\n | #emoji\n | #eor\n | #phonebk\n | #phonetic\n | #pinyin\n | #stroke\n | #trad\n | #unihan\n | #zhuyin\n]" - }, - { - "id": "Stdlib.Intl.Common.numberingSystem", - "kind": "type", - "name": "numberingSystem", - "docstrings": [], - "signature": "type numberingSystem = [\n | #adlm\n | #ahom\n | #arab\n | #arabext\n | #bali\n | #beng\n | #bhks\n | #brah\n | #cakm\n | #cham\n | #deva\n | #diak\n | #fullwide\n | #gong\n | #gonm\n | #gujr\n | #guru\n | #hanidec\n | #hmng\n | #hmnp\n | #java\n | #kali\n | #kawi\n | #khmr\n | #knda\n | #lana\n | #lanatham\n | #laoo\n | #latn\n | #lepc\n | #limb\n | #mathbold\n | #mathdbl\n | #mathmono\n | #mathsanb\n | #mathsans\n | #mlym\n | #modi\n | #mong\n | #mroo\n | #mtei\n | #mymr\n | #mymrshan\n | #mymrtlng\n | #nagm\n | #newa\n | #nkoo\n | #olck\n | #orya\n | #osma\n | #rohg\n | #saur\n | #segment\n | #shrd\n | #sind\n | #sinh\n | #sora\n | #sund\n | #takr\n | #talu\n | #tamldec\n | #telu\n | #thai\n | #tibt\n | #tirh\n | #tnsa\n | #vaii\n | #wara\n | #wcho\n]" - }, - { - "id": "Stdlib.Intl.Common.oneTo21", - "kind": "type", - "name": "oneTo21", - "docstrings": [], - "signature": "type oneTo21 = [\n | #1\n | #10\n | #11\n | #12\n | #13\n | #14\n | #15\n | #16\n | #17\n | #18\n | #19\n | #2\n | #20\n | #21\n | #3\n | #4\n | #5\n | #6\n | #7\n | #8\n | #9\n]" - }, - { - "id": "Stdlib.Intl.Common.zeroTo20", - "kind": "type", - "name": "zeroTo20", - "docstrings": [], - "signature": "type zeroTo20 = [\n | #0\n | #1\n | #10\n | #11\n | #12\n | #13\n | #14\n | #15\n | #16\n | #17\n | #18\n | #19\n | #2\n | #20\n | #3\n | #4\n | #5\n | #6\n | #7\n | #8\n | #9\n]" - } - ] - }, - "stdlib/int/ref": { - "id": "Stdlib.Int.Ref", - "name": "Ref", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int.Ref.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = ref" - }, - { - "id": "Stdlib.Int.Ref.increment", - "kind": "value", - "name": "increment", - "docstrings": [ - "`increment(intRef)` increments the value of the provided reference by 1.\n\n ## Examples\n\n ```rescript\n let myRef = ref(4)\n Int.Ref.increment(myRef)\n myRef.contents == 5\n ```" - ], - "signature": "let increment: ref => unit" - }, - { - "id": "Stdlib.Int.Ref.decrement", - "kind": "value", - "name": "decrement", - "docstrings": [ - "`decrement(intRef)` decrements the value of the provided reference by 1.\n\n ## Examples\n\n ```rescript\n let myRef = ref(4)\n Int.Ref.decrement(myRef)\n myRef.contents == 3\n ```" - ], - "signature": "let decrement: ref => unit" - } - ] - }, - "stdlib/int/bitwise": { - "id": "Stdlib.Int.Bitwise", - "name": "Bitwise", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int.Bitwise.land", - "kind": "value", - "name": "land", - "docstrings": [], - "signature": "let land: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lor", - "kind": "value", - "name": "lor", - "docstrings": [], - "signature": "let lor: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lxor", - "kind": "value", - "name": "lxor", - "docstrings": [], - "signature": "let lxor: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lsl", - "kind": "value", - "name": "lsl", - "docstrings": [], - "signature": "let lsl: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lsr", - "kind": "value", - "name": "lsr", - "docstrings": [], - "signature": "let lsr: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.asr", - "kind": "value", - "name": "asr", - "docstrings": [], - "signature": "let asr: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lnot", - "kind": "value", - "name": "lnot", - "docstrings": [], - "signature": "let lnot: int => int", - "deprecated": "" - } - ] - }, - "stdlib/int/constants": { - "id": "Stdlib.Int.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int.Constants.minValue", - "kind": "value", - "name": "minValue", - "docstrings": [ - "The smallest positive number represented in JavaScript.\nSee [`Number.MIN_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE)\non MDN.\n\n ## Examples\n\n ```rescript\n Console.log(Int.Constants.minValue)\n ```" - ], - "signature": "let minValue: int" - }, - { - "id": "Stdlib.Int.Constants.maxValue", - "kind": "value", - "name": "maxValue", - "docstrings": [ - "The largest positive number represented in JavaScript.\nSee [`Number.MAX_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE)\non MDN.\n\n ## Examples\n\n ```rescript\n Console.log(Int.Constants.maxValue)\n ```" - ], - "signature": "let maxValue: int" - } - ] - }, - "stdlib/float/constants": { - "id": "Stdlib.Float.Constants", - "name": "Constants", - "docstrings": [ - "Float constants." - ], - "items": [ - { - "id": "Stdlib.Float.Constants.nan", - "kind": "value", - "name": "nan", - "docstrings": [ - "The special value \"Not a Number\"\nSee [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.nan\n ```" - ], - "signature": "let nan: float" - }, - { - "id": "Stdlib.Float.Constants.epsilon", - "kind": "value", - "name": "epsilon", - "docstrings": [ - "Represents the difference between 1 and the smallest floating point number greater than 1.\nSee [`Number.EPSILON`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.epsilon\n ```" - ], - "signature": "let epsilon: float" - }, - { - "id": "Stdlib.Float.Constants.positiveInfinity", - "kind": "value", - "name": "positiveInfinity", - "docstrings": [ - "The positive Infinity value\nSee [`Number.POSITIVE_INFINITY`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/POSITIVE_INFINITY) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.positiveInfinity\n ```" - ], - "signature": "let positiveInfinity: float" - }, - { - "id": "Stdlib.Float.Constants.negativeInfinity", - "kind": "value", - "name": "negativeInfinity", - "docstrings": [ - "The negative Infinity value\nSee [`Number.NEGATIVE_INFINITY`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.negativeInfinity\n ```" - ], - "signature": "let negativeInfinity: float" - }, - { - "id": "Stdlib.Float.Constants.minValue", - "kind": "value", - "name": "minValue", - "docstrings": [ - "The smallest positive numeric value representable in JavaScript.\nSee [`Number.MIN_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.minValue\n ```" - ], - "signature": "let minValue: float" - }, - { - "id": "Stdlib.Float.Constants.maxValue", - "kind": "value", - "name": "maxValue", - "docstrings": [ - "The maximum positive numeric value representable in JavaScript.\nSee [`Number.MAX_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.minValue\n ```" - ], - "signature": "let maxValue: float" - } - ] - }, - "stdlib/error/urierror": { - "id": "Stdlib.Error.URIError", - "name": "URIError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.URIError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `URIError` with the provided `message`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/typeerror": { - "id": "Stdlib.Error.TypeError", - "name": "TypeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.TypeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `TypeError` with the provided `message`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/syntaxerror": { - "id": "Stdlib.Error.SyntaxError", - "name": "SyntaxError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.SyntaxError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `SyntaxError` with the provided `message`.\n\n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/referenceerror": { - "id": "Stdlib.Error.ReferenceError", - "name": "ReferenceError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.ReferenceError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `ReferenceError` with the provided `message`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/rangeerror": { - "id": "Stdlib.Error.RangeError", - "name": "RangeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.RangeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `RangeError` with the provided `message`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/evalerror": { - "id": "Stdlib.Error.EvalError", - "name": "EvalError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.EvalError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `EvalError` with the provided `message`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/date/utc": { - "id": "Stdlib.Date.UTC", - "name": "UTC", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Date.UTC.makeWithYM", - "kind": "value", - "name": "makeWithYM", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYM(~year=2023, ~month=0)\n // 1672531200000\n \n Date.UTC.makeWithYM(~year=2023, ~month=11)\n // 1701388800000\n \n Date.UTC.makeWithYM(~year=2023, ~month=12)\n // 1704067200000\n \n Date.UTC.makeWithYM(~year=2023, ~month=-1)\n // 1669852800000\n ```" - ], - "signature": "let makeWithYM: (~year: int, ~month: int) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMD", - "kind": "value", - "name": "makeWithYMD", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=20)\n // 1676851200000\n \n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=-1)\n // 1675036800000\n \n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=29)\n // 1677628800000\n ```" - ], - "signature": "let makeWithYMD: (~year: int, ~month: int, ~day: int) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDH", - "kind": "value", - "name": "makeWithYMDH", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=16)\n // 1676908800000\n \n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=24)\n // 1676937600000\n \n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=-1)\n // 1676847600000\n ```" - ], - "signature": "let makeWithYMDH: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDHM", - "kind": "value", - "name": "makeWithYMDHM", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40)\n // 1676911200000\n \n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=60)\n // 1676912400000\n \n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=-1)\n // 1676908740000\n ```" - ], - "signature": "let makeWithYMDHM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDHMS", - "kind": "value", - "name": "makeWithYMDHMS", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0)\n // 1676911200000\n \n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=60)\n // 1676911260000\n \n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=-1)\n // 1676911199000\n ```" - ], - "signature": "let makeWithYMDHMS: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDHMSM", - "kind": "value", - "name": "makeWithYMDHMSM", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=0,\n )->Console.log\n // 1676911200000\n \n Date.UTC.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=1000,\n )->Console.log\n // 1676911201000\n \n Date.UTC.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=-1,\n )->Console.log\n // 1676911199999\n ```" - ], - "signature": "let makeWithYMDHMSM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => msSinceEpoch" - } - ] - }, - "stdlib/biguint64array": { - "id": "Stdlib.BigUint64Array", - "name": "BigUint64Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigUint64Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `BigUint64Array` typed array represents an array of 64-bit unsigned integers in platform byte order. See [BigUint64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.BigUint64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `BigUint64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.BigUint64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `BigUint64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.BigUint64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigUint64Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigUint64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `BigUint64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.BigUint64Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `BigUint64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => bigint=?) => t" - }, - { - "id": "Stdlib.BigUint64Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `BigUint64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigUint64Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bigUintArray)` ignores the provided bigUintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/bigint64array": { - "id": "Stdlib.BigInt64Array", - "name": "BigInt64Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigInt64Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `BigInt64Array` typed array represents an array of 64-bit signed integers in platform byte order. See [BigInt64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.BigInt64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `BigInt64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.BigInt64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `BigInt64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.BigInt64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt64Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `BigInt64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.BigInt64Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `BigInt64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => bigint=?) => t" - }, - { - "id": "Stdlib.BigInt64Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `BigInt64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt64Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bigIntArray)` ignores the provided bigIntArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint8clampedarray": { - "id": "Stdlib.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8ClampedArray.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint8ClampedArray` typed array represents an array of 8-bit unsigned integers clamped to 0-255. See [Uint8ClampedArray on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint8ClampedArray` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint8ClampedArray` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint8ClampedArray` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint8ClampedArray` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8ClampedArray.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint32array": { - "id": "Stdlib.Uint32Array", - "name": "Uint32Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint32Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint32Array` typed array represents an array of 32-bit unsigned integers in platform byte order. See [Uint32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint32Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint32Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint32Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint32Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint32Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint16array": { - "id": "Stdlib.Uint16Array", - "name": "Uint16Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint16Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint16Array` typed array represents an array of 16-bit unsigned integers in platform byte order. See [Uint16Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint16Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint16Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint16Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint16Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint16Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint16Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint16Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint16Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint16Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint16Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint16Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint16Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint8array": { - "id": "Stdlib.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint8Array` typed array represents an array of 8-bit unsigned integers. See [Uint8Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint8Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint8Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint8Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint8Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint8Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint8Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint8Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint8Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint8Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint8Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/int32array": { - "id": "Stdlib.Int32Array", - "name": "Int32Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int32Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Int32Array` typed array represents an array of twos-complemenet 32-bit signed integers in platform byte order. See [Int32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Int32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Int32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Int32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Int32Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Int32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int32Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Int32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Int32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Int32Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Int32Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int32Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/int16array": { - "id": "Stdlib.Int16Array", - "name": "Int16Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int16Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Int16Array` typed array represents an array of twos-complement 16-bit signed integers in platform byte order. See [Int16Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Int16Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int16Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Int16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Int16Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Int16Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int16Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Int16Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Int16Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int16Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Int16Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int16Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int16Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/int8array": { - "id": "Stdlib.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int8Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Int8Array` typed array represents an array of twos-complement 8-bit signed integers. See [Int8Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Int8Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int8Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Int8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Int8Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Int8Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int8Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Int8Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Int8Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int8Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Int8Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int8Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int8Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/float64array": { - "id": "Stdlib.Float64Array", - "name": "Float64Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float64Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Float64Array` typed array represents an array of 64-bit floating point numbers in platform byte order. See [Float64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Float64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Float64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Float64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Float64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Float64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float64Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Float64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Float64Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Float64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => float=?) => t" - }, - { - "id": "Stdlib.Float64Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Float64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float64Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/float32array": { - "id": "Stdlib.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float32Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Float32Array` typed array represents an array of 32-bit floating point numbers in platform byte order. See [Float32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Float32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Float32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Float32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Float32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Float32Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float32Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Float32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Float32Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Float32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => float=?) => t" - }, - { - "id": "Stdlib.Float32Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Float32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float32Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/typedarray": { - "id": "Stdlib.TypedArray", - "name": "TypedArray", - "docstrings": [], - "items": [ - { - "id": "Stdlib.TypedArray.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.TypedArray.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```" - ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```" - ], - "signature": "let set: (t<'a>, int, 'a) => unit" - }, - { - "id": "Stdlib.TypedArray.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [ - "`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN." - ], - "signature": "let buffer: t<'a> => ArrayBuffer.t" - }, - { - "id": "Stdlib.TypedArray.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [ - "`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```" - ], - "signature": "let byteLength: t<'a> => int" - }, - { - "id": "Stdlib.TypedArray.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [ - "`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN." - ], - "signature": "let byteOffset: t<'a> => int" - }, - { - "id": "Stdlib.TypedArray.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [ - "`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```" - ], - "signature": "let setArray: (t<'a>, array<'a>) => unit" - }, - { - "id": "Stdlib.TypedArray.setArrayFrom", - "kind": "value", - "name": "setArrayFrom", - "docstrings": [ - "`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```" - ], - "signature": "let setArrayFrom: (t<'a>, array<'a>, int) => unit" - }, - { - "id": "Stdlib.TypedArray.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```" - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Stdlib.TypedArray.copyAllWithin", - "kind": "value", - "name": "copyAllWithin", - "docstrings": [ - "`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```" - ], - "signature": "let copyAllWithin: (t<'a>, ~target: int) => array<'a>" - }, - { - "id": "Stdlib.TypedArray.copyWithinToEnd", - "kind": "value", - "name": "copyWithinToEnd", - "docstrings": [ - "`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```" - ], - "signature": "let copyWithinToEnd: (t<'a>, ~target: int, ~start: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [ - "`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```" - ], - "signature": "let copyWithin: (t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>" - }, - { - "id": "Stdlib.TypedArray.fillAll", - "kind": "value", - "name": "fillAll", - "docstrings": [ - "`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```" - ], - "signature": "let fillAll: (t<'a>, 'a) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.fillToEnd", - "kind": "value", - "name": "fillToEnd", - "docstrings": [ - "`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array." - ], - "signature": "let fillToEnd: (t<'a>, 'a, ~start: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.fill", - "kind": "value", - "name": "fill", - "docstrings": [ - "`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```" - ], - "signature": "let fill: (t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN." - ], - "signature": "let reverse: t<'a> => unit" - }, - { - "id": "Stdlib.TypedArray.toReversed", - "kind": "value", - "name": "toReversed", - "docstrings": [ - "`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```" - ], - "signature": "let toReversed: t<'a> => t<'a>" - }, - { - "id": "Stdlib.TypedArray.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN." - ], - "signature": "let sort: (t<'a>, ('a, 'a) => Ordering.t) => unit" - }, - { - "id": "Stdlib.TypedArray.toSorted", - "kind": "value", - "name": "toSorted", - "docstrings": [ - "`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```" - ], - "signature": "let toSorted: (t<'a>, ('a, 'a) => Ordering.t) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.with", - "kind": "value", - "name": "with", - "docstrings": [ - "`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```" - ], - "signature": "let with: (t<'a>, int, 'a) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```" - ], - "signature": "let includes: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.TypedArray.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN." - ], - "signature": "let indexOf: (t<'a>, 'a) => int" - }, - { - "id": "Stdlib.TypedArray.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`." - ], - "signature": "let indexOfFrom: (t<'a>, 'a, int) => int" - }, - { - "id": "Stdlib.TypedArray.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```" - ], - "signature": "let joinWith: (t<'a>, string) => string" - }, - { - "id": "Stdlib.TypedArray.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN." - ], - "signature": "let lastIndexOf: (t<'a>, 'a) => int" - }, - { - "id": "Stdlib.TypedArray.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`." - ], - "signature": "let lastIndexOfFrom: (t<'a>, 'a, int) => int" - }, - { - "id": "Stdlib.TypedArray.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN." - ], - "signature": "let slice: (t<'a>, ~start: int, ~end: int=?) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array." - ], - "signature": "let sliceToEnd: (t<'a>, ~start: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(typedArray)` produces a shallow copy of the typed array." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Stdlib.TypedArray.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN." - ], - "signature": "let subarray: (t<'a>, ~start: int, ~end: int=?) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.subarrayToEnd", - "kind": "value", - "name": "subarrayToEnd", - "docstrings": [ - "`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer." - ], - "signature": "let subarrayToEnd: (t<'a>, ~start: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```" - ], - "signature": "let toString: t<'a> => string" - }, - { - "id": "Stdlib.TypedArray.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN." - ], - "signature": "let toLocaleString: t<'a> => string" - }, - { - "id": "Stdlib.TypedArray.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN." - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.everyWithIndex", - "kind": "value", - "name": "everyWithIndex", - "docstrings": [ - "`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`." - ], - "signature": "let everyWithIndex: (t<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN." - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`." - ], - "signature": "let filterWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN." - ], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findWithIndex", - "kind": "value", - "name": "findWithIndex", - "docstrings": [ - "`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index." - ], - "signature": "let findWithIndex: (t<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findLast", - "kind": "value", - "name": "findLast", - "docstrings": [ - "`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN." - ], - "signature": "let findLast: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findLastWithIndex", - "kind": "value", - "name": "findLastWithIndex", - "docstrings": [ - "`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`." - ], - "signature": "let findLastWithIndex: (t<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [ - "`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN." - ], - "signature": "let findIndex: (t<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.TypedArray.findIndexWithIndex", - "kind": "value", - "name": "findIndexWithIndex", - "docstrings": [ - "`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`." - ], - "signature": "let findIndexWithIndex: (t<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.TypedArray.findLastIndex", - "kind": "value", - "name": "findLastIndex", - "docstrings": [ - "`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN." - ], - "signature": "let findLastIndex: (t<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.TypedArray.findLastIndexWithIndex", - "kind": "value", - "name": "findLastIndexWithIndex", - "docstrings": [ - "`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`." - ], - "signature": "let findLastIndexWithIndex: (t<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.TypedArray.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN." - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.TypedArray.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index." - ], - "signature": "let forEachWithIndex: (t<'a>, ('a, int) => unit) => unit" - }, - { - "id": "Stdlib.TypedArray.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.TypedArray.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index." - ], - "signature": "let mapWithIndex: (t<'a>, ('a, int) => 'b) => t<'b>" - }, - { - "id": "Stdlib.TypedArray.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN." - ], - "signature": "let reduce: (t<'a>, ('b, 'a) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`." - ], - "signature": "let reduceWithIndex: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [ - "`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN." - ], - "signature": "let reduceRight: (t<'a>, ('b, 'a) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.reduceRightWithIndex", - "kind": "value", - "name": "reduceRightWithIndex", - "docstrings": [ - "`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`." - ], - "signature": "let reduceRightWithIndex: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN." - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.someWithIndex", - "kind": "value", - "name": "someWithIndex", - "docstrings": [ - "`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index." - ], - "signature": "let someWithIndex: (t<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/arraybuffer": { - "id": "Stdlib.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [ - "Functions for interacting with JavaScript ArrayBuffer.\nSee: [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)." - ], - "items": [ - { - "id": "Stdlib.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an ArrayBuffer object used to represent a generic raw binary data buffer." - ], - "signature": "type t" - }, - { - "id": "Stdlib.ArrayBuffer.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(length)` creates a new ArrayBuffer with the specified length in bytes.\nSee [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/ArrayBuffer) on MDN.\n\n## Examples\n\n```rescript\nlet buffer = ArrayBuffer.make(8)\nArrayBuffer.byteLength(buffer) == 8\n```\n\n## Exceptions\n\n- `RangeError`: If `length` is larger than `Number.MAX_SAFE_INTEGER` or negative." - ], - "signature": "let make: int => t" - }, - { - "id": "Stdlib.ArrayBuffer.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [ - "`byteLength(arrayBuffer)` returns the size, in bytes, of the ArrayBuffer.\nSee [`ArrayBuffer.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet buffer = ArrayBuffer.make(16)\nArrayBuffer.byteLength(buffer) == 16\n```" - ], - "signature": "let byteLength: t => int" - }, - { - "id": "Stdlib.ArrayBuffer.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(arrayBuffer, ~start, ~end)` returns a new ArrayBuffer whose contents are a copy of this ArrayBuffer's bytes from `start`, inclusive, up to `end`, exclusive.\nSee [`ArrayBuffer.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/slice) on MDN.\n\n## Examples\n\n```rescript\nlet buffer = ArrayBuffer.make(16)\nlet sliced = buffer->ArrayBuffer.slice(~start=4, ~end=12)\nArrayBuffer.byteLength(sliced) == 8\n```" - ], - "signature": "let slice: (t, ~start: int=?, ~end: int=?) => t" - }, - { - "id": "Stdlib.ArrayBuffer.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [], - "signature": "let sliceToEnd: (t, ~start: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.ArrayBuffer.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(arrayBuffer)` ignores the provided arrayBuffer and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/weakset": { - "id": "Stdlib.WeakSet", - "name": "WeakSet", - "docstrings": [ - "Bindings to JavaScript's `WeakSet`.\n\nWeak sets store references to objects without preventing those objects from being garbage collected." - ], - "items": [ - { - "id": "Stdlib.WeakSet.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Mutable weak set storing object references of type `'a`." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.WeakSet.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates an empty weak set.\n\nSee [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) on MDN.\n\n## Examples\n\n```rescript\nlet visited = WeakSet.make()\nWeakSet.has(visited, Object.make()) == false\n```" - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Stdlib.WeakSet.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(set, value)` inserts `value` into the weak set and returns the set for chaining.\n\nSee [`WeakSet.prototype.add`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/add) on MDN.\n\n## Examples\n\n```rescript\nlet set = WeakSet.make()\nlet node = Object.make()\nWeakSet.add(set, node)\nWeakSet.has(set, node) == true\n```" - ], - "signature": "let add: (t<'a>, 'a) => t<'a>" - }, - { - "id": "Stdlib.WeakSet.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "`delete(set, value)` removes `value` and returns `true` if an entry existed.\n\nSee [`WeakSet.prototype.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/delete) on MDN.\n\n## Examples\n\n```rescript\nlet set = WeakSet.make()\nlet node = Object.make()\nlet _ = WeakSet.add(set, node)\nWeakSet.delete(set, node) == true\nWeakSet.delete(set, node) == false\n```" - ], - "signature": "let delete: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.WeakSet.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(set, value)` checks whether `value` exists in the weak set.\n\nSee [`WeakSet.prototype.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/has) on MDN.\n\n## Examples\n\n```rescript\nlet set = WeakSet.make()\nlet node = Object.make()\nWeakSet.has(set, node) == false\nlet _ = WeakSet.add(set, node)\nWeakSet.has(set, node) == true\n```" - ], - "signature": "let has: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.WeakSet.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(weakSet)` ignores the provided weakSet and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/set": { - "id": "Stdlib.Set", - "name": "Set", - "docstrings": [ - "Bindings to the mutable JavaScript `Set`.\n\nSee [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) on MDN." - ], - "items": [ - { - "id": "Stdlib.Set.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an instance of `Set`." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.Set.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new, mutable JavaScript `Set`. A `Set` is a collection of unique values.\n\nSee [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) on MDN.\n\n\n\n## Examples\n```rescript\n// You can annotate the type of your set if you want to\nlet mySet: Set.t = Set.make()\n\n// Or you can let ReScript infer what's in your Set\nlet set = Set.make()\nset->Set.add(\"Fine name\") // Inferred as Set.t\n```\n\n## Alternatives\nA JavaScript `Set` is mutable. If you're looking for an immutable alternative, check out `Belt.Set`." - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Stdlib.Set.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Turns an array of values into a Set. Meaning only unique values are preserved.\n\n## Examples\n```rescript\ntype languages = ReScript | JavaScript | TypeScript\nlet languageRank = [ReScript, JavaScript, TypeScript]\n\nlet set = Set.fromArray(languageRank) // Set.t\n\nswitch set->Set.has(ReScript) {\n| true => Console.log(\"Yay, ReScript is in there!\")\n| false => Console.log(\"Uh-oh, something is _terribly_ wrong with this program... abort.\")\n}\n```" - ], - "signature": "let fromArray: array<'a> => t<'a>" - }, - { - "id": "Stdlib.Set.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "Turns an iterator into a `Set`.\n\n## Examples\n\n```rescript\n// Let's pretend we have an interator\nlet iterator: Iterator.t = %raw(`\n (() => {\n var array1 = ['a', 'b', 'c'];\n var iterator1 = array1[Symbol.iterator]();\n return iterator1\n })()\n`)\n\niterator\n->Set.fromIterator\n->Set.size == 3\n```" - ], - "signature": "let fromIterator: Iterator.t<'a> => t<'a>" - }, - { - "id": "Stdlib.Set.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns the size, the number of unique values, of the set.\n\nSee [`Set.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/size) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\n\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue2\")\n\nlet size = set->Set.size // 2\n```" - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Stdlib.Set.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(set)` returns `true` if the set has no values, `false` otherwise.\n\n## Examples\n```rescript\nlet emptySet = Set.make()\nemptySet->Set.isEmpty->assertEqual(true)\n\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.isEmpty->assertEqual(false)\n\n// After clearing the set\nset->Set.clear\nset->Set.isEmpty->assertEqual(true)\n```" - ], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Stdlib.Set.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Clears all entries in the set.\n\nSee [`Set.clear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/clear) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\n\nset->Set.add(\"someKey\")\nset->Set.size // 1\n\nset->Set.clear\nset->Set.size // 0\n```" - ], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Stdlib.Set.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds a new value to the set.\n\nSee [`Set.add`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/add) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\n```" - ], - "signature": "let add: (t<'a>, 'a) => unit" - }, - { - "id": "Stdlib.Set.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "Deletes the provided `value` from the set. Returns a `bool` for whether the value existed, and was deleted.\n\nSee [`Set.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nlet didDeleteValue = set->Set.delete(\"someValue\")\nConsole.log(didDeleteValue) // Logs `true` to the console, becuase the set had the value, so it was successfully deleted\n\nlet didDeleteValue = set->Set.delete(\"someNonExistantKey\")\nConsole.log(didDeleteValue) // Logs `false` to the console, becuase the value did not exist in the set\n```" - ], - "signature": "let delete: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.Set.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks whether the set has a specific value.\n\nSee [`Set.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/has) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\n\nswitch set->Set.has(\"someValue\") {\n| false => Console.log(\"Nope, didn't have it.\")\n| true => Console.log(\"Yay, we have the value!\")\n}\n```" - ], - "signature": "let has: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.Set.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Iterates through all values of the set.\n\nSee [`Set.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/forEach) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue2\")\n\nset->Set.forEach(value => {\n Console.log(value)\n})\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Set.values", - "kind": "value", - "name": "values", - "docstrings": [ - "Returns an iterator that holds all values of the set.\n\nSee [`Set.values`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/values) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.add(\"anotherValue\")\n\nlet values = set->Set.values\n\n// Logs the first value\nConsole.log(Iterator.next(values).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh values iterator to get an array of all values, since we consumed a value via `next` above already.\nConsole.log(set->Set.values->Iterator.toArray)\n```" - ], - "signature": "let values: t<'a> => Iterator.t<'a>" - }, - { - "id": "Stdlib.Set.difference", - "kind": "value", - "name": "difference", - "docstrings": [ - "Returns a new set with the values of the set that are not in the other set.\n\nSee [`Set.difference`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/difference) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.difference(set2) // Set.fromArray([\"orange\"])\n```" - ], - "signature": "let difference: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.symmetricDifference", - "kind": "value", - "name": "symmetricDifference", - "docstrings": [ - "Returns a new set with the values containing the values which are in either the set, but not in both.\n\nSee [`Set.symmetricDifference`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/symmetricDifference) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.symmetricDifference(set2) // Set.fromArray([\"orange\", \"pear\"])\n```" - ], - "signature": "let symmetricDifference: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.intersection", - "kind": "value", - "name": "intersection", - "docstrings": [ - "Returns a new set with the values containing the values which are in both the set and the other set.\n\nSee [`Set.intersection`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/intersection) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.intersection(set2) // Set.fromArray([\"apple\", \"banana\"])\n```" - ], - "signature": "let intersection: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.isDisjointFrom", - "kind": "value", - "name": "isDisjointFrom", - "docstrings": [ - "Returns a bool indicating if this set has no elements in common with the given set.\n\nSee [`Set.isDisjointFrom`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isDisjointFrom) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"kiwi\", \"melon\", \"pear\"])\nset1->Set.isDisjointFrom(set2) // true\n```" - ], - "signature": "let isDisjointFrom: (t<'a>, t<'a>) => bool" - }, - { - "id": "Stdlib.Set.isSubsetOf", - "kind": "value", - "name": "isSubsetOf", - "docstrings": [ - "Returns a bool indicating if the all values in the set are in the given set.\n\nSee [`Set.isSubsetOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isSubsetOf) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.isSubsetOf(set2) // true\n```" - ], - "signature": "let isSubsetOf: (t<'a>, t<'a>) => bool" - }, - { - "id": "Stdlib.Set.isSupersetOf", - "kind": "value", - "name": "isSupersetOf", - "docstrings": [ - "Returns a bool indicating if the all values in the given set are in the set.\n\nSee [`Set.isSupersetOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isSupersetOf) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\"])\nset1->Set.isSupersetOf(set2) // true\n```" - ], - "signature": "let isSupersetOf: (t<'a>, t<'a>) => bool" - }, - { - "id": "Stdlib.Set.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns a new set with the values of the set that are in both the set and the other set.\n\nSee [`Set.union`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/union) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.union(set2) // Set.fromArray([\"apple\", \"orange\", \"banana\", \"pear\"])\n```" - ], - "signature": "let union: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(set)` returns an array of all values of the set.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n```rescript\nlet set = Set.fromArray([\"apple\", \"orange\", \"apple\", \"banana\"])\nset->Set.toArray // [\"apple\", \"orange\", \"banana\"]\n```" - ], - "signature": "let toArray: t<'a> => array<'a>" - }, - { - "id": "Stdlib.Set.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(set)` ignores the provided set and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/weakmap": { - "id": "Stdlib.WeakMap", - "name": "WeakMap", - "docstrings": [ - "Bindings to JavaScript's `WeakMap`.\n\nWeak maps keep key/value pairs where keys must be objects and the references do not prevent garbage collection." - ], - "items": [ - { - "id": "Stdlib.WeakMap.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Mutable weak map storing values of type `'v` with object keys `'k`." - ], - "signature": "type t<'k, 'v>" - }, - { - "id": "Stdlib.WeakMap.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates an empty weak map.\n\nSee [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nWeakMap.get(cache, Object.make()) == None\n```" - ], - "signature": "let make: unit => t<'k, 'v>" - }, - { - "id": "Stdlib.WeakMap.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(map, key)` returns `Some(value)` when `key` exists, otherwise `None`.\n\nSee [`WeakMap.prototype.get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/get) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nWeakMap.get(cache, key) == None\nlet _ = WeakMap.set(cache, key, \"user\")\nWeakMap.get(cache, key) == Some(\"user\")\n```" - ], - "signature": "let get: (t<'k, 'v>, 'k) => option<'v>" - }, - { - "id": "Stdlib.WeakMap.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(map, key)` checks whether `key` exists in the weak map.\n\nSee [`WeakMap.prototype.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/has) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nWeakMap.has(cache, key) == false\nlet _ = WeakMap.set(cache, key, ())\nWeakMap.has(cache, key) == true\n```" - ], - "signature": "let has: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.WeakMap.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(map, key, value)` stores `value` for `key` and returns the map for chaining.\n\nSee [`WeakMap.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/set) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nlet _ = WeakMap.set(cache, key, 42)\nWeakMap.get(cache, key) == Some(42)\n```" - ], - "signature": "let set: (t<'k, 'v>, 'k, 'v) => t<'k, 'v>" - }, - { - "id": "Stdlib.WeakMap.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "`delete(map, key)` removes `key` and returns `true` if an entry existed.\n\nSee [`WeakMap.prototype.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/delete) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nWeakMap.delete(cache, key) == false\nlet _ = WeakMap.set(cache, key, 1)\nWeakMap.delete(cache, key) == true\n```" - ], - "signature": "let delete: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.WeakMap.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(weakMap)` ignores the provided weakMap and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'k, 'v> => unit" - } - ] - }, - "stdlib/map": { - "id": "Stdlib.Map", - "name": "Map", - "docstrings": [ - "Bindings to the mutable JavaScript `Map`.\n\nSee [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) on MDN." - ], - "items": [ - { - "id": "Stdlib.Map.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an instance of `Map`." - ], - "signature": "type t<'k, 'v>" - }, - { - "id": "Stdlib.Map.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new, mutable JavaScript `Map`. A `Map` can have any values as both keys and values.\n\nSee [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) on MDN.\n\n\n\n## Examples\n```rescript\n`make()`\n// You can annotate the type of your map if you want to\nlet myMap: Map.t = Map.make()\n\n// Or you can let ReScript infer what's in your map\nlet map = Map.make()\nmap->Map.set(\"lang\", \"ReScript\") // Inferred as Map.t\n```\n\n## Alternatives\nA JavaScript `Map` is mutable. If you're looking for an immutable alternative, check out`Belt.Map`." - ], - "signature": "let make: unit => t<'k, 'v>" - }, - { - "id": "Stdlib.Map.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Turns an array of key/value pairs into a Map.\n\n## Examples\n```rescript\ntype languages = ReScript | JavaScript | TypeScript\nlet languageRank = [(ReScript, 1), (JavaScript, 2), (TypeScript, 3)]\n\nlet map = Map.fromArray(languageRank) // Map.t\n\nswitch map->Map.get(ReScript) {\n| Some(1) => Console.log(\"Yay, ReScript is #1!\")\n| _ => Console.log(\"Uh-oh, something is _terribly_ wrong with this program... abort.\")\n}\n```" - ], - "signature": "let fromArray: array<('k, 'v)> => t<'k, 'v>" - }, - { - "id": "Stdlib.Map.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "Turns an iterator in the shape of `('key, 'value)` into a `Map`.\n\n## Examples\n\n```rescript\n// Let's pretend we have an interator in the correct shape\nlet iterator: Iterator.t<(string, string)> = %raw(`\n (() => {\n var map1 = new Map();\n\n map1.set('first', '1');\n map1.set('second', '2');\n\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\n\niterator\n->Map.fromIterator\n->Map.size == 2\n```" - ], - "signature": "let fromIterator: Iterator.t<('k, 'v)> => t<'k, 'v>" - }, - { - "id": "Stdlib.Map.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns the size, the number of key/value pairs, of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\n\nmap->Map.set(\"someKey\", \"someValue\")\n\nlet size = map->Map.size // 1\n```" - ], - "signature": "let size: t<'k, 'v> => int" - }, - { - "id": "Stdlib.Map.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(map)` returns `true` if the map has no key/value pairs, `false` otherwise.\n\n## Examples\n```rescript\nlet emptyMap = Map.make()\nemptyMap->Map.isEmpty->assertEqual(true)\n\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.isEmpty->assertEqual(false)\n\n// After clearing the map\nmap->Map.clear\nmap->Map.isEmpty->assertEqual(true)\n```" - ], - "signature": "let isEmpty: t<'k, 'v> => bool" - }, - { - "id": "Stdlib.Map.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Clears all entries in the map.\n\n## Examples\n```rescript\nlet map = Map.make()\n\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.size // 1\n\nmap->Map.clear\nmap->Map.size // 0\n```" - ], - "signature": "let clear: t<'k, 'v> => unit" - }, - { - "id": "Stdlib.Map.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Iterates through all values of the map.\n\n> Please note that this is *without the keys*, just the values. If you need the key as well, use `Map.forEachWithKey`.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\nmap->Map.forEach(value => {\n Console.log(value)\n})\n```" - ], - "signature": "let forEach: (t<'k, 'v>, 'v => unit) => unit" - }, - { - "id": "Stdlib.Map.forEachWithKey", - "kind": "value", - "name": "forEachWithKey", - "docstrings": [ - "Iterates through all values of the map, including the key for each value.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\nmap->Map.forEachWithKey((value, key) => {\n Console.log2(value, key)\n})\n```" - ], - "signature": "let forEachWithKey: (t<'k, 'v>, ('v, 'k) => unit) => unit" - }, - { - "id": "Stdlib.Map.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the value for a key, if a value exists at that key.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n\nswitch map->Map.get(\"someKey\") {\n| None => Console.log(\"Nope, didn't have it.\")\n| Some(value) => Console.log2(\"Yay, had the value, and it's:\", value)\n}\n```" - ], - "signature": "let get: (t<'k, 'v>, 'k) => option<'v>" - }, - { - "id": "Stdlib.Map.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks whether the map has a specific key.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n\nswitch map->Map.has(\"someKey\") {\n| false => Console.log(\"Nope, didn't have it.\")\n| true => Console.log(\"Yay, we have the value!\")\n}\n```" - ], - "signature": "let has: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.Map.set", - "kind": "value", - "name": "set", - "docstrings": [ - "Sets the provided `value` to the provided `key`.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n```" - ], - "signature": "let set: (t<'k, 'v>, 'k, 'v) => unit" - }, - { - "id": "Stdlib.Map.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "Deletes the provided `key` and its value from the map. Returns a `bool` for whether the key existed, and was deleted.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nlet didDeleteKey = map->Map.delete(\"someKey\")\nConsole.log(didDeleteKey) // Logs `true` to the console, becuase the map had the key, so it was successfully deleted\n\nlet didDeleteKey = map->Map.delete(\"someNonExistantKey\")\nConsole.log(didDeleteKey) // Logs `false` to the console, becuase the key did not exist\n```" - ], - "signature": "let delete: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.Map.keys", - "kind": "value", - "name": "keys", - "docstrings": [ - "Returns an iterator that holds all keys of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet keys = map->Map.keys\n\n// Logs the first key\nConsole.log(Iterator.next(keys).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh keys iterator to get an array of all keys, since we consumed a value via `next` above already.\nConsole.log(map->Map.keys->Iterator.toArray)\n```" - ], - "signature": "let keys: t<'k, 'v> => Iterator.t<'k>" - }, - { - "id": "Stdlib.Map.values", - "kind": "value", - "name": "values", - "docstrings": [ - "Returns an iterator that holds all values of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet values = map->Map.values\n\n// Logs the first value\nConsole.log(Iterator.next(values).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh values iterator to get an array of all values, since we consumed a value via `next` above already.\nConsole.log(map->Map.values->Iterator.toArray)\n```" - ], - "signature": "let values: t<'k, 'v> => Iterator.t<'v>" - }, - { - "id": "Stdlib.Map.entries", - "kind": "value", - "name": "entries", - "docstrings": [ - "Returns an iterator that holds all entries of the map.\nAn entry is represented as a tuple of `('key, 'value)`,\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet entries = map->Map.entries\n\n// Logs the first value\nConsole.log(Iterator.next(entries).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes entries. We'll need a fresh entries iterator to get an array of all entries, since we consumed a value via `next` above already.\nConsole.log(map->Map.entries->Iterator.toArray)\n```" - ], - "signature": "let entries: t<'k, 'v> => Iterator.t<('k, 'v)>" - }, - { - "id": "Stdlib.Map.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(map)` ignores the provided map and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'k, 'v> => unit" - } - ] - }, - "stdlib/asynciterator": { - "id": "Stdlib.AsyncIterator", - "name": "AsyncIterator", - "docstrings": [ - "Bindings to async iterators, a way to do async iteration in JavaScript.\n\nSee [async iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) on MDN." - ], - "items": [ - { - "id": "Stdlib.AsyncIterator.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type representing an async iterator." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.AsyncIterator.value", - "kind": "type", - "name": "value", - "docstrings": [], - "signature": "type value<'a> = {done: bool, value: option<'a>}" - }, - { - "id": "Stdlib.AsyncIterator.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(nextFn)`\n\nCreates an async iterator from a function that returns the next value of the iterator.\n\n## Examples\n\n- A simple example, creating an async iterator that returns 1, 2, 3:\n\n```rescript\nlet context = ref(0)\n\nlet asyncIterator = AsyncIterator.make(async () => {\n let currentValue = context.contents\n // Increment current value\n context := currentValue + 1\n\n {\n AsyncIterator.value: Some(currentValue),\n done: currentValue >= 3,\n }\n})\n\n// This will log 1, 2, 3\nlet main = async () =>\n await asyncIterator->AsyncIterator.forEach(value =>\n switch value {\n | Some(value) => Console.log(value)\n | None => ()\n }\n )\n\nmain()->ignore\n```" - ], - "signature": "let make: (unit => promise>) => t<'value>" - }, - { - "id": "Stdlib.AsyncIterator.value", - "kind": "value", - "name": "value", - "docstrings": [ - "`value(value)`\n\nShorthand for creating a value object with the provided value, and the `done` property set to false.\n\n## Examples\n\n```rescript\nlet context = ref(0)\n\nlet asyncIterator = AsyncIterator.make(async () => {\n let currentValue = context.contents\n // Increment current value\n context := currentValue + 1\n\n if currentValue >= 3 {\n AsyncIterator.done()\n } else {\n AsyncIterator.value(currentValue)\n }\n})\n```" - ], - "signature": "let value: 'value => value<'value>" - }, - { - "id": "Stdlib.AsyncIterator.done", - "kind": "value", - "name": "done", - "docstrings": [ - "`done(~finalValue=?)`\n\n Shorthand for creating a value object with the `done` property set to true, and the provided value as the final value, if any.\n\n ## Examples\n ```rescript\n let context = ref(0)\n \n let asyncIterator = AsyncIterator.make(async () => {\n let currentValue = context.contents\n // Increment current value\n context := currentValue + 1\n \n if currentValue >= 3 {\n AsyncIterator.done()\n } else {\n AsyncIterator.value(currentValue)\n }\n })\n ```" - ], - "signature": "let done: (~finalValue: 'value=?) => value<'value>" - }, - { - "id": "Stdlib.AsyncIterator.next", - "kind": "value", - "name": "next", - "docstrings": [ - "`next(asyncIterator)`\n\nReturns the next value of the iterator, if any.\n\nSee [async iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) on MDN.\n\n## Examples\n\n- A simple example, getting the next value:\n\n```rescript\nlet asyncIterator: AsyncIterator.t<(string, string)> = %raw(`\n (() => {\n var map1 = new Map();\n\n map1.set('first', '1');\n map1.set('second', '2');\n\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\n\nlet processMyAsyncIterator = async () => {\n // ReScript doesn't have `for ... of` loops, but it's easy to mimic using a while loop.\n let break = ref(false)\n\n while !break.contents {\n // Await the next iterator value\n let {value, done} = await asyncIterator->AsyncIterator.next\n\n // Exit the while loop if the iterator says it's done\n break := done\n\n if done {\n value->Option.isNone == true\n }\n }\n}\n\nprocessMyAsyncIterator()->ignore\n```" - ], - "signature": "let next: t<'a> => promise>" - }, - { - "id": "Stdlib.AsyncIterator.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(iterator, fn)` consumes all values in the async iterator and runs the callback `fn` for each value.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n\n```rescript\n// Let's pretend we get an async iterator returning ints from somewhere.\nlet asyncIterator: AsyncIterator.t<(string, string)> = %raw(`\n (() => {\n var map1 = new Map();\n\n map1.set('first', '1');\n map1.set('second', '2');\n\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\n\nlet main = async () =>\n await asyncIterator->AsyncIterator.forEach(v => {\n switch v {\n | Some((\"second\", value)) => value == \"2\"\n | _ => ()\n }\n })\n\nmain()->ignore\n```" - ], - "signature": "let forEach: (t<'a>, option<'a> => unit) => promise" - }, - { - "id": "Stdlib.AsyncIterator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(iterator)` ignores the provided async iterator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/iterator": { - "id": "Stdlib.Iterator", - "name": "Iterator", - "docstrings": [ - "Bindings to JavaScript iterators.\n\nSee [`Iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) on MDN." - ], - "items": [ - { - "id": "Stdlib.Iterator.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type representing an iterator." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.Iterator.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The current value of an iterator." - ], - "signature": "type value<'a> = {done: bool, value: option<'a>}" - }, - { - "id": "Stdlib.Iterator.next", - "kind": "value", - "name": "next", - "docstrings": [ - "Returns the next value of the iterator, if any.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n\n```rescript\nlet iterator: Iterator.t = %raw(`\n (() => {\n var array1 = ['a'];\n var iterator1 = array1[Symbol.iterator]();\n return iterator1\n })()\n`)\n(iterator->Iterator.next).done == false\n(iterator->Iterator.next).done == true\n```" - ], - "signature": "let next: t<'a> => value<'a>" - }, - { - "id": "Stdlib.Iterator.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Turns an iterator into an array of the remaining values.\nRemember that each invocation of `next` of an iterator consumes a value. `Iterator.toArray` will consume all remaining values of the iterator and return them in an array to you.\n\nSee [Iterator.prototype.toArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/toArray) on MDN.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\n// `Map.keys` returns all keys of the map as an iterator.\nlet mapKeysAsArray = map->Map.keys->Iterator.toArray\n\nmapKeysAsArray == [\"someKey\", \"someKey2\"]\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let toArray: t<'a> => array<'a>" - }, - { - "id": "Stdlib.Iterator.toArrayWithMapper", - "kind": "value", - "name": "toArrayWithMapper", - "docstrings": [ - "`toArray(iterator)` turns `iterator` into an array of its remaining values, applying the provided mapper function on each item.\nRemember that each invocation of `next` of an iterator consumes a value. `Iterator.toArrayWithMapper` will consume all remaining values of the iterator and return them in an array to you.\n\nSee [Iterator.prototype.toArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/toArray) on MDN.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\n// `Map.keys` returns all keys of the map as an iterator.\nlet mapKeysAsArray =\n map\n ->Map.keys\n ->Iterator.toArrayWithMapper(key => key->String.length)\n\nmapKeysAsArray == [7, 8]\n```" - ], - "signature": "let toArrayWithMapper: (t<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Stdlib.Iterator.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(iterator, fn)` consumes all values in the iterator and runs the callback `fn` for each value.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n```rescript\nlet iterator: Iterator.t = [\"a\", \"b\", \"c\"]->Array.values\nlet acc = ref(\"\")\niterator->Iterator.forEach(v => {\n acc := acc.contents ++ v\n})\n\nacc.contents == \"abc\"\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Iterator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(iterator)` ignores the provided iterator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - }, - { - "id": "Stdlib.Iterator.drop", - "kind": "value", - "name": "drop", - "docstrings": [ - "`drop(iterator, n)` returns a new iterator helper object that skips the given number of elements at the start of this iterator.\n\nSee [Iterator.prototype.drop](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/drop) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.drop(2)\nseq->Iterator.next == {done: false, value: Some(2)}\nseq->Iterator.next == {done: false, value: Some(3)}\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let drop: (t<'a>, int) => t<'a>" - }, - { - "id": "Stdlib.Iterator.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(iterator, fn)` tests whether all elements in the iterator pass the test implemented by the provided function.\n\nSee [Iterator.prototype.every](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/every) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet areAllEven = fibonacci->Iterator.every(n => n % 2 == 0)\nareAllEven == false\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Iterator.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(iterator, fn)` returns a new iterator helper object that contains the elements of the original iterator that pass the test implemented by the provided function.\n\nSee [Iterator.prototype.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/filter) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.filter(n => n % 2 == 0)\nseq->Iterator.next == {done: false, value: Some(2)}\nseq->Iterator.next == {done: false, value: Some(8)}\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Stdlib.Iterator.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(iterator, fn)` returns the value of the first element in the iterator that satisfies the provided testing function.\n\nSee [Iterator.prototype.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/find) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.find(n => n % 2 == 0)\nseq == Some(2)\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Iterator.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(iterator, fn)` returns a new iterator helper object that contains the elements of the original iterator that pass the test implemented by the provided function.\n\nSee [Iterator.prototype.flatMap](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/flatMap) on MDN.\n\n## Examples\n```rescript\nlet map1 = Map.fromArray([(\"a\", 1), (\"b\", 2), (\"c\", 3)])\nlet map2 = Map.fromArray([(\"d\", 4), (\"e\", 5), (\"f\", 6)])\n\nlet letters =\n [map1, map2]\n ->Array.values\n ->Iterator.flatMap(m => Map.keys(m))\n ->Array.fromIterator\nletters == [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Iterator.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(iterator, fn)` returns a new iterator helper object that yields elements of the iterator, each transformed by a mapping function.\n\nSee [Iterator.prototype.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/map) on MDN.\n\n## Examples\n```rescript\nlet map = Map.fromArray([(\"a\", 1), (\"b\", 2), (\"c\", 3)])\nlet letters = map->Map.keys->Iterator.map(v => v->String.toUpperCase)->Array.fromIterator\nletters == [\"A\", \"B\", \"C\"]\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Iterator.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(iterator, fn, initialValue)` applies a function against an accumulator and each element in the iterator (from left to right) to reduce it to a single value.\n\nSee [Iterator.prototype.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/reduce) on MDN.\n\n## Examples\n```rescript\nlet numbers: Iterator.t = [1, 2, 3]->Array.values\n\nlet sum = numbers->Iterator.reduce((acc, n) => acc + n, ~initialValue=0)\nsum == 6\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let reduce: (t<'a>, ('acc, 'a) => 'acc, ~initialValue: 'acc=?) => 'acc" - }, - { - "id": "Stdlib.Iterator.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(iterator, fn)` The some() method of Iterator instances is similar to Array.some:\nit tests whether at least one element produced by the iterator passes the test implemented by the provided function.\nIt returns a boolean value.\n\nSee [Iterator.prototype.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/some) on MDN.\n\n## Examples\n```rescript\nlet numbers: Iterator.t = [1, 2, 3]->Array.values\n\nlet hasEven = numbers->Iterator.some(n => n % 2 == 0)\nhasEven == true\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Iterator.take", - "kind": "value", - "name": "take", - "docstrings": [ - "`take((iterator, n))` returns a new iterator helper object that contains the first `n` elements of this iterator.\n\nSee [Iterator.prototype.take](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/take) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.take(2)\nseq->Iterator.next == {done: false, value: Some(1)}\nseq->Iterator.next == {done: false, value: Some(1)}\nseq->Iterator.next == {done: true, value: None}\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let take: (t<'a>, int) => t<'a>" - } - ] - }, - "stdlib/type": { - "id": "Stdlib.Type", - "name": "Type", - "docstrings": [ - "Utilities for classifying the type of JavaScript values at runtime." - ], - "items": [ - { - "id": "Stdlib.Type.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The possible types of JavaScript values." - ], - "signature": "type t = [\n | #bigint\n | #boolean\n | #function\n | #number\n | #object\n | #string\n | #symbol\n | #undefined\n]" - }, - { - "id": "Stdlib.Type.typeof", - "kind": "value", - "name": "typeof", - "docstrings": [ - "`typeof(someValue)`\n\nReturns the underlying JavaScript type of any runtime value.\n\nSee [`typeof`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof) on MDN.\n\n## Examples\n```rescript\nConsole.log(Type.typeof(\"Hello\")) // Logs \"string\" to the console.\n\nlet someVariable = true\n\nswitch someVariable->Type.typeof {\n| #boolean => Console.log(\"This is a bool, yay!\")\n| _ => Console.log(\"Oh, not a bool sadly...\")\n}\n```" - ], - "signature": "let typeof: 'a => t" - }, - { - "id": "Stdlib.Type.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(type)` ignores the provided type and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/symbol": { - "id": "Stdlib.Symbol", - "name": "Symbol", - "docstrings": [ - "A built-in object that serves as a namespace for globally-unique identifiers.\n\nCompiles to a regular JavaScript Symbol." - ], - "items": [ - { - "id": "Stdlib.Symbol.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a Symbol." - ], - "signature": "type t" - }, - { - "id": "Stdlib.Symbol.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(key)`\n\nMakes a new unique Symbol value.\n\n## Examples\n\n```rescript\nSymbol.make(\"sym1\")->Symbol.description == Some(\"sym1\")\n```" - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.Symbol.getFor", - "kind": "value", - "name": "getFor", - "docstrings": [ - "`getFor(key)`\n\nSearches for existing registered Symbols in the global Symbol registry with the given key and returns it if found.\nOtherwise a new Symbol gets created and registered with key.\n\n## Examples\n\n```rescript\nSymbol.getFor(\"sym1\") == Symbol.getFor(\"sym1\")\n```" - ], - "signature": "let getFor: string => option" - }, - { - "id": "Stdlib.Symbol.keyFor", - "kind": "value", - "name": "keyFor", - "docstrings": [ - "`keyFor(key)`\n\nRetrieves a shared Symbol key from the global Symbol registry for the given Symbol.\n\n## Examples\n\n```rescript\nlet globalSym = Symbol.getFor(\"sym1\") // Global symbol\n\nglobalSym->Option.flatMap(Symbol.description) == Some(\"sym1\")\n```" - ], - "signature": "let keyFor: t => option" - }, - { - "id": "Stdlib.Symbol.description", - "kind": "value", - "name": "description", - "docstrings": [ - "`description`\n\nReturns `Some(string)` containing the description of this symbol, or `None` if the symbol has no description.\n## Examples\n\n```rescript\nlet sym = Symbol.make(\"sym1\")\nSymbol.description(sym) == Some(\"sym1\")\n```" - ], - "signature": "let description: t => option" - }, - { - "id": "Stdlib.Symbol.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString`\n\n// Returns a string representing this symbol value.\n\n## Examples\n\n```rescript\nlet sym = Symbol.make(\"sym1\")\n\nSymbol.toString(sym) == \"Symbol(sym1)\"\n```" - ], - "signature": "let toString: t => string" - }, - { - "id": "Stdlib.Symbol.asyncIterator", - "kind": "value", - "name": "asyncIterator", - "docstrings": [ - "`asyncIterator` is the well-known symbol used by asynchronous iterables.\n\nSee [`Symbol.asyncIterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator) on MDN." - ], - "signature": "let asyncIterator: t" - }, - { - "id": "Stdlib.Symbol.hasInstance", - "kind": "value", - "name": "hasInstance", - "docstrings": [ - "`hasInstance` is used by custom `instanceof` checks.\n\nSee [`Symbol.hasInstance`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance) on MDN." - ], - "signature": "let hasInstance: t" - }, - { - "id": "Stdlib.Symbol.isConcatSpreadable", - "kind": "value", - "name": "isConcatSpreadable", - "docstrings": [ - "`isConcatSpreadable` controls whether objects are flattened when passed to `Array.concat`.\n\nSee [`Symbol.isConcatSpreadable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/isConcatSpreadable) on MDN." - ], - "signature": "let isConcatSpreadable: t" - }, - { - "id": "Stdlib.Symbol.iterator", - "kind": "value", - "name": "iterator", - "docstrings": [ - "`iterator` is returned by objects that can be iterated with `for..of`.\n\nSee [`Symbol.iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/iterator) on MDN." - ], - "signature": "let iterator: t" - }, - { - "id": "Stdlib.Symbol.match", - "kind": "value", - "name": "match", - "docstrings": [ - "`match` customises how values respond to `String.prototype.match`.\n\nSee [`Symbol.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/match) on MDN." - ], - "signature": "let match: t" - }, - { - "id": "Stdlib.Symbol.matchAll", - "kind": "value", - "name": "matchAll", - "docstrings": [ - "`matchAll` customises how values respond to `String.prototype.matchAll`.\n\nSee [`Symbol.matchAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/matchAll) on MDN." - ], - "signature": "let matchAll: t" - }, - { - "id": "Stdlib.Symbol.replace", - "kind": "value", - "name": "replace", - "docstrings": [ - "`replace` customises how values respond to `String.prototype.replace`.\n\nSee [`Symbol.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/replace) on MDN." - ], - "signature": "let replace: t" - }, - { - "id": "Stdlib.Symbol.search", - "kind": "value", - "name": "search", - "docstrings": [ - "`search` customises how values respond to `String.prototype.search`.\n\nSee [`Symbol.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) on MDN." - ], - "signature": "let search: t" - }, - { - "id": "Stdlib.Symbol.species", - "kind": "value", - "name": "species", - "docstrings": [ - "`species` lets constructors return a different derived constructor when methods create new instances.\n\nSee [`Symbol.species`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/species) on MDN." - ], - "signature": "let species: t" - }, - { - "id": "Stdlib.Symbol.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split` customises how values respond to `String.prototype.split`.\n\nSee [`Symbol.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/split) on MDN." - ], - "signature": "let split: t" - }, - { - "id": "Stdlib.Symbol.toPrimitive", - "kind": "value", - "name": "toPrimitive", - "docstrings": [ - "`toPrimitive` customises how objects convert to primitive values.\n\nSee [`Symbol.toPrimitive`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toPrimitive) on MDN." - ], - "signature": "let toPrimitive: t" - }, - { - "id": "Stdlib.Symbol.toStringTag", - "kind": "value", - "name": "toStringTag", - "docstrings": [ - "`toStringTag` customises the default tag shown by `Object.prototype.toString`.\n\nSee [`Symbol.toStringTag`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag) on MDN." - ], - "signature": "let toStringTag: t" - }, - { - "id": "Stdlib.Symbol.unscopables", - "kind": "value", - "name": "unscopables", - "docstrings": [ - "`unscopables` marks properties that should be skipped by `with`.\n\nSee [`Symbol.unscopables`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/unscopables) on MDN." - ], - "signature": "let unscopables: t" - }, - { - "id": "Stdlib.Symbol.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(symbol)` ignores the provided symbol and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/string": { - "id": "Stdlib.String", - "name": "String", - "docstrings": [ - "Functions for interacting with JavaScript strings.\nSee: [`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)." - ], - "items": [ - { - "id": "Stdlib.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a string." - ], - "signature": "type t = string" - }, - { - "id": "Stdlib.String.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nString.make(3.5) == \"3.5\"\nString.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => string" - }, - { - "id": "Stdlib.String.fromCharCode", - "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to\nthat number, `n` ranges from 0 to 65535. If out of range, the lower 16 bits of\nthe value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as\n`fromCharCode(0xF63A)`.\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nString.fromCharCode(65) == \"A\"\nString.fromCharCode(0x3c8) == `ψ`\nString.fromCharCode(0xd55c) == `한`\nString.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => string" - }, - { - "id": "Stdlib.String.fromCharCodeMany", - "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`.\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nString.fromCharCodeMany([189, 43, 190, 61]) == \"½+¾=\"\nString.fromCharCodeMany([65, 66, 67]) == \"ABC\"\n```" - ], - "signature": "let fromCharCodeMany: array => string" - }, - { - "id": "Stdlib.String.fromCodePoint", - "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point.\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint) on MDN.\n\n## Examples\n\n```rescript\nString.fromCodePoint(65) == \"A\"\nString.fromCodePoint(0x3c8) == `ψ`\nString.fromCodePoint(0xd55c) == `한`\nString.fromCodePoint(0x1f63a) == `😺`\n```\n\n## Exceptions\n\n- `RangeError`: If the number is not a valid code point, like `fromCharCode(-5)`." - ], - "signature": "let fromCodePoint: int => string" - }, - { - "id": "Stdlib.String.fromCodePointMany", - "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint) on MDN.\n\n## Examples\n\n```rescript\nString.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```\n\n## Exceptions\n\n- `RangeError`: If one of the number is not a valid code point, like\n `fromCharCode([1, -5])`." - ], - "signature": "let fromCodePointMany: array => string" - }, - { - "id": "Stdlib.String.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(str1, str2)` checks if two strings are equal.\n\n## Examples\n\n```rescript\nString.equal(\"hello\", \"hello\") == true\nString.equal(\"hello\", \"world\") == false\nString.equal(\"\", \"\") == true\n```" - ], - "signature": "let equal: (string, string) => bool" - }, - { - "id": "Stdlib.String.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(str1, str2)` compares two strings, returns an `Ordering.t` value.\n\n## Examples\n\n```rescript\nString.compare(\"hello\", \"hello\") == Ordering.equal\nString.compare(\"apple\", \"banana\") == Ordering.less\nString.compare(\"zebra\", \"apple\") == Ordering.greater\n```" - ], - "signature": "let compare: (string, string) => Ordering.t" - }, - { - "id": "Stdlib.String.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(str)` returns the length of the given `string`.\nSee [`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length) on MDN.\n\n## Examples\n\n```rescript\nString.length(\"abcd\") == 4\n```" - ], - "signature": "let length: string => int" - }, - { - "id": "Stdlib.String.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(str, index)` returns an `option` at the given `index` number. If\n`index` is out of range, this function returns `None`.\n\n## Examples\n\n```rescript\nString.get(\"ReScript\", 0) == Some(\"R\")\nString.get(\"Hello\", 4) == Some(\"o\")\nString.get(`JS`, 4) == None\n```" - ], - "signature": "let get: (string, int) => option" - }, - { - "id": "Stdlib.String.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(str, index)` returns an `string` at the given `index` number.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `string`.\n\nUse `String.getUnsafe` only when you are sure the `index` exists.\n## Examples\n\n```rescript\nString.getUnsafe(\"ReScript\", 0) == \"R\"\nString.getUnsafe(\"Hello\", 4) == \"o\"\n```" - ], - "signature": "let getUnsafe: (string, int) => string" - }, - { - "id": "Stdlib.String.charAt", - "kind": "value", - "name": "charAt", - "docstrings": [ - "`charAt(str, index)` gets the character at `index` within string `str`. If\n`index` is negative or greater than the length of `str`, it returns the empty\nstring. If the string contains characters outside the range \\\\u0000-\\\\uffff, it\nwill return the first 16-bit value at that position in the string.\nSee [`String.charAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt) on MDN.\n\n## Examples\n\n```rescript\nString.charAt(\"ReScript\", 0) == \"R\"\nString.charAt(\"Hello\", 12) == \"\"\nString.charAt(`JS`, 5) == \"\"\n```" - ], - "signature": "let charAt: (string, int) => string" - }, - { - "id": "Stdlib.String.charCodeAt", - "kind": "value", - "name": "charCodeAt", - "docstrings": [ - "`charCodeAt(str, index)` returns the character code at position `index` in\nstring `str` the result is in the range 0-65535, unlike `codePointAt`, so it\nwill not work correctly for characters with code points greater than or equal\nto 0x10000.\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt) on MDN.\n\n## Examples\n\n```rescript\nString.charCodeAt(`😺`, 0) == Some(0xd83d)\nString.charCodeAt(\"\", 0) == None\nString.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" - ], - "signature": "let charCodeAt: (string, int) => option" - }, - { - "id": "Stdlib.String.charCodeAtUnsafe", - "kind": "value", - "name": "charCodeAtUnsafe", - "docstrings": [ - "`charCodeAtUnsafe(str, index)` returns the character code at position `index` in\nstring `str` the result is in the range 0-65535, unlike `codePointAt`, so it\nwill not work correctly for characters with code points greater than or equal\nto 0x10000.\nBeware: If the index is out of range, it will return `NaN` which is not actually a valid int.\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt) on MDN.\n\n## Examples\n\n```rescript\nString.charCodeAtUnsafe(`😺`, 0) == 0xd83d\nString.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" - ], - "signature": "let charCodeAtUnsafe: (string, int) => int" - }, - { - "id": "Stdlib.String.codePointAt", - "kind": "value", - "name": "codePointAt", - "docstrings": [ - "`codePointAt(str, index)` returns the code point at position `index` within\nstring `str` as a `Some(value)`. The return value handles code points greater\nthan or equal to 0x10000. If there is no code point at the given position, the\nfunction returns `None`.\nSee [`String.codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) on MDN.\n\n## Examples\n\n```rescript\nString.codePointAt(`¿😺?`, 1) == Some(0x1f63a)\nString.codePointAt(\"abc\", 5) == None\n```" - ], - "signature": "let codePointAt: (string, int) => option" - }, - { - "id": "Stdlib.String.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(original, append)` returns a new `string` with `append` added after\n`original`.\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat) on MDN.\n\n## Examples\n\n```rescript\nString.concat(\"cow\", \"bell\") == \"cowbell\"\nString.concat(\"Re\", \"Script\") == \"ReScript\"\n```" - ], - "signature": "let concat: (string, string) => string" - }, - { - "id": "Stdlib.String.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(original, arr)` returns a new `string` consisting of each item of an\narray of strings added to the `original` string.\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat) on MDN.\n\n## Examples\n\n```rescript\nString.concatMany(\"1st\", [\"2nd\", \"3rd\", \"4th\"]) == \"1st2nd3rd4th\"\n```" - ], - "signature": "let concatMany: (string, array) => string" - }, - { - "id": "Stdlib.String.endsWith", - "kind": "value", - "name": "endsWith", - "docstrings": [ - "`endsWith(str, substr)` returns `true` if the `str` ends with `substr`, `false`\notherwise.\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith) on MDN.\n\n## Examples\n\n```rescript\nString.endsWith(\"BuckleScript\", \"Script\") == true\nString.endsWith(\"BuckleShoes\", \"Script\") == false\n```" - ], - "signature": "let endsWith: (string, string) => bool" - }, - { - "id": "Stdlib.String.endsWithFrom", - "kind": "value", - "name": "endsWithFrom", - "docstrings": [ - "`endsWithFrom(str, ending, len)` returns `true` if the first len characters of\n`str` end with `ending`, `false` otherwise. If `len` is greater than or equal\nto the length of `str`, then it works like `endsWith`.\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith) on MDN.\n\n## Examples\n\n```rescript\nString.endsWithFrom(\"abcd\", \"cd\", 4) == true\nString.endsWithFrom(\"abcde\", \"cd\", 3) == false\nString.endsWithFrom(\"abcde\", \"cde\", 99) == true\nString.endsWithFrom(\"example.dat\", \"ple\", 7) == true\n```" - ], - "signature": "let endsWithFrom: (string, string, int) => bool" - }, - { - "id": "Stdlib.String.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "`includes(str, searchValue)` returns `true` if `searchValue` is found anywhere\nwithin `str`, `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includes(\"programmer\", \"gram\") == true\nString.includes(\"programmer\", \"er\") == true\nString.includes(\"programmer\", \"pro\") == true\nString.includes(\"programmer.dat\", \"xyz\") == false\n```" - ], - "signature": "let includes: (string, string) => bool" - }, - { - "id": "Stdlib.String.includesFrom", - "kind": "value", - "name": "includesFrom", - "docstrings": [ - "`includesFrom(str, searchValue, start)` returns `true` if `searchValue` is found\nanywhere within `str` starting at character number `start` (where 0 is the\nfirst character), `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includesFrom(\"programmer\", \"gram\", 1) == true\nString.includesFrom(\"programmer\", \"gram\", 4) == false\nString.includesFrom(`대한민국`, `한`, 1) == true\n```" - ], - "signature": "let includesFrom: (string, string, int) => bool" - }, - { - "id": "Stdlib.String.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "`indexOf(str, searchValue)` returns the position at which `searchValue` was\nfirst found within `str`, or `-1` if `searchValue` is not in `str`.\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) on MDN.\n\n## Examples\n\n```rescript\nString.indexOf(\"bookseller\", \"ok\") == 2\nString.indexOf(\"bookseller\", \"sell\") == 4\nString.indexOf(\"beekeeper\", \"ee\") == 1\nString.indexOf(\"bookseller\", \"xyz\") == -1\n```" - ], - "signature": "let indexOf: (string, string) => int" - }, - { - "id": "Stdlib.String.indexOfOpt", - "kind": "value", - "name": "indexOfOpt", - "docstrings": [ - "`indexOfOpt(str, searchValue)`. Like `indexOf`, but return an `option`.\n\n## Examples\n\n```rescript\nString.indexOfOpt(\"bookseller\", \"ok\") == Some(2)\nString.indexOfOpt(\"bookseller\", \"xyz\") == None\n```" - ], - "signature": "let indexOfOpt: (string, string) => option" - }, - { - "id": "Stdlib.String.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "`indexOfFrom(str, searchValue, start)` returns the position at which\n`searchValue` was found within `str` starting at character position `start`, or\n`-1` if `searchValue` is not found in that portion of `str`. The return value is\nrelative to the beginning of the string, no matter where the search started\nfrom.\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) on MDN.\n\n## Examples\n\n```rescript\nString.indexOfFrom(\"bookseller\", \"ok\", 1) == 2\nString.indexOfFrom(\"bookseller\", \"sell\", 2) == 4\nString.indexOfFrom(\"bookseller\", \"sell\", 5) == -1\n```" - ], - "signature": "let indexOfFrom: (string, string, int) => int" - }, - { - "id": "Stdlib.String.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(str, searchValue)` returns the position of the last occurrence of\n`searchValue` within `str`, searching backwards from the end of the string.\nReturns `-1` if `searchValue` is not in `str`. The return value is always\nrelative to the beginning of the string.\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\nString.lastIndexOf(\"bookseller\", \"ok\") == 2\nString.lastIndexOf(\"beekeeper\", \"ee\") == 4\nString.lastIndexOf(\"abcdefg\", \"xyz\") == -1\n```" - ], - "signature": "let lastIndexOf: (string, string) => int" - }, - { - "id": "Stdlib.String.lastIndexOfOpt", - "kind": "value", - "name": "lastIndexOfOpt", - "docstrings": [ - "`lastIndexOfOpt(str, searchValue)`. Like `lastIndexOfOpt`, but return an\n`option`.\n\n## Examples\n\n```rescript\nString.lastIndexOfOpt(\"bookseller\", \"ok\") == Some(2)\nString.lastIndexOfOpt(\"beekeeper\", \"ee\") == Some(4)\nString.lastIndexOfOpt(\"abcdefg\", \"xyz\") == None\n```" - ], - "signature": "let lastIndexOfOpt: (string, string) => option" - }, - { - "id": "Stdlib.String.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "`lastIndexOfFrom(str, searchValue, start)` returns the position of the last\noccurrence of `searchValue` within `str`, searching backwards from the given\nstart position. Returns `-1` if `searchValue` is not in `str`. The return value\nis always relative to the beginning of the string.\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\nString.lastIndexOfFrom(\"bookseller\", \"ok\", 6) == 2\nString.lastIndexOfFrom(\"beekeeper\", \"ee\", 8) == 4\nString.lastIndexOfFrom(\"beekeeper\", \"ee\", 3) == 1\nString.lastIndexOfFrom(\"abcdefg\", \"xyz\", 4) == -1\n```" - ], - "signature": "let lastIndexOfFrom: (string, string, int) => int" - }, - { - "id": "Stdlib.String.match", - "kind": "value", - "name": "match", - "docstrings": [ - "`match(str, regexp)` matches a `string` against the given `regexp`. If there is\nno match, it returns `None`. For regular expressions without the g modifier, if\nthere is a match, the return value is `Some(array)` where the array contains:\n- The entire matched string\n- Any capture groups if the regexp had parentheses\n For regular expressions with the g modifier, a matched expression returns\n `Some(array)` with all the matched substrings and no capture groups.\n See [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match) on MDN.\n\n## Examples\n\n```rescript\nString.match(\"The better bats\", /b[aeiou]t/) == Some([Some(\"bet\")])\nString.match(\"The better bats\", /b[aeiou]t/g) == Some([Some(\"bet\"), Some(\"bat\")])\nString.match(\"Today is 2018-04-05.\", /(\\d+)-(\\d+)-(\\d+)/) ==\n Some([Some(\"2018-04-05\"), Some(\"2018\"), Some(\"04\"), Some(\"05\")])\nString.match(\"The optional example\", /(foo)?(example)/) ==\n Some([Some(\"example\"), None, Some(\"example\")])\nString.match(\"The large container.\", /b[aeiou]g/) == None\n```" - ], - "signature": "let match: (string, RegExp.t) => option<\\\"RegExp.Result\".t>" - }, - { - "id": "Stdlib.String.normalize", - "kind": "value", - "name": "normalize", - "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\\\u00e3 or the combination of a lower case letter A\n\\\\u0061 and a combining tilde \\\\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\nSee also [Unicode technical report \\#15](https://unicode.org/reports/tr15/) for details.\n\n## Examples\n\n```rescript\nlet string1 = \"\\u00F1\"\nlet string2 = \"\\u006E\\u0303\"\n\nassert(string1 != string2) // true\nString.normalize(string1) == String.normalize(string2)\n```" - ], - "signature": "let normalize: string => string" - }, - { - "id": "Stdlib.String.normalizeForm", - "kind": "type", - "name": "normalizeForm", - "docstrings": [ - "`normalizeByForm(str, form)` returns the normalized Unicode string using the\nspecified form of normalization, which may be one of:\n- \"NFC\" — Normalization Form Canonical Composition.\n- \"NFD\" — Normalization Form Canonical Decomposition.\n- \"NFKC\" — Normalization Form Compatibility Composition.\n- \"NFKD\" — Normalization Form Compatibility Decomposition.\n See [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\n See also [Unicode technical report \\#15](https://unicode.org/reports/tr15/) for\n details.\n\n## Examples\n\n```rescript\nlet string1 = \"\\uFB00\"\nlet string2 = \"\\u0066\\u0066\"\nConsole.log(string1 == string2) // false\n\nlet normalizeString1 = String.normalizeByForm(string1, #NFKD)\nlet normalizeString2 = String.normalizeByForm(string2, #NFKD)\nConsole.log(normalizeString1 == normalizeString2) // true\n```" - ], - "signature": "type normalizeForm = [#NFC | #NFD | #NFKC | #NFKD]" - }, - { - "id": "Stdlib.String.normalizeByForm", - "kind": "value", - "name": "normalizeByForm", - "docstrings": [], - "signature": "let normalizeByForm: (string, normalizeForm) => string" - }, - { - "id": "Stdlib.String.repeat", - "kind": "value", - "name": "repeat", - "docstrings": [ - "`repeat(str, n)` returns a `string` that consists of `n` repetitions of `str`.\nSee [`String.repeat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat) on MDN.\n\n## Examples\n\n```rescript\nString.repeat(\"ha\", 3) == \"hahaha\"\nString.repeat(\"empty\", 0) == \"\"\n```\n\n## Exceptions\n\n- `RangeError`: if `n` is negative." - ], - "signature": "let repeat: (string, int) => string" - }, - { - "id": "Stdlib.String.replace", - "kind": "value", - "name": "replace", - "docstrings": [ - "`replace(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with the first matching instance of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nString.replace(\"old string\", \"old\", \"new\") == \"new string\"\nString.replace(\"the cat and the dog\", \"the\", \"this\") == \"this cat and the dog\"\n```" - ], - "signature": "let replace: (string, string, string) => string" - }, - { - "id": "Stdlib.String.replaceRegExp", - "kind": "value", - "name": "replaceRegExp", - "docstrings": [ - "`replaceRegExp(str, regex, replacement)` returns a new `string` where\noccurrences matching regex have been replaced by `replacement`.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nString.replaceRegExp(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nString.replaceRegExp(\"Juan Fulano\", /(\\w+) (\\w+)/, \"$2, $1\") == \"Fulano, Juan\"\n```" - ], - "signature": "let replaceRegExp: (string, RegExp.t, string) => string" - }, - { - "id": "Stdlib.String.replaceAll", - "kind": "value", - "name": "replaceAll", - "docstrings": [ - "`replaceAll(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with all matching instances of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\nSee [`String.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) on MDN.\n\n## Examples\n\n```rescript\nString.replaceAll(\"old old string\", \"old\", \"new\") == \"new new string\"\nString.replaceAll(\"the cat and the dog\", \"the\", \"this\") == \"this cat and this dog\"\n```" - ], - "signature": "let replaceAll: (string, string, string) => string" - }, - { - "id": "Stdlib.String.replaceAllRegExp", - "kind": "value", - "name": "replaceAllRegExp", - "docstrings": [ - "`replaceAllRegExp(str, regex, replacement)` returns a new `string` where\nall occurrences matching regex have been replaced by `replacement`.\nThe pattern must include the global (`g`) flag or a runtime TypeError will be thrown.\nSee [`String.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) on MDN.\n\n## Examples\n\n```rescript\nString.replaceAllRegExp(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nString.replaceAllRegExp(\"aabbcc\", /b/g, \".\") == \"aa..cc\"\n```" - ], - "signature": "let replaceAllRegExp: (string, RegExp.t, string) => string" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy0", - "kind": "value", - "name": "unsafeReplaceRegExpBy0", - "docstrings": [ - "`unsafeReplaceRegExpBy0(str, regex, f)` returns a new `string` with some or all\nmatches of a pattern with no capturing parentheses replaced by the value\nreturned from the given function. The function receives as its parameters the\nmatched string, the offset at which the match begins, and the whole string being\nmatched.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (~match, ~offset as _, ~input as _) => String.toUpperCase(match)\nString.unsafeReplaceRegExpBy0(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy0: (\n string,\n RegExp.t,\n (~match: string, ~offset: int, ~input: string) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy1", - "kind": "value", - "name": "unsafeReplaceRegExpBy1", - "docstrings": [ - "`unsafeReplaceRegExpBy1(str, regexp, f)`. Like `unsafeReplaceRegExpBy0`, but `f`\nhas `group1` parameter.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (~match as _, ~group1, ~offset as _, ~input as _) => {\n group1 ++ \"41\"\n}\nString.unsafeReplaceRegExpBy1(str, re, matchFn) == \"Jony is 41\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy1: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy2", - "kind": "value", - "name": "unsafeReplaceRegExpBy2", - "docstrings": [ - "`unsafeReplaceRegExpBy2(str, regexp, f)`. Like `unsafeReplaceRegExpBy1`, but `f`\nhas two group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (~match as _, ~group1, ~group2, ~offset as _, ~input as _) => {\n switch (Int.fromString(group1), Int.fromString(group2)) {\n | (Some(x), Some(y)) => Int.toString(x * y)\n | _ => \"???\"\n }\n}\nString.unsafeReplaceRegExpBy2(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy2: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy3", - "kind": "value", - "name": "unsafeReplaceRegExpBy3", - "docstrings": [ - "`unsafeReplaceRegExpBy3(str, regexp, f)`. Like `unsafeReplaceRegExpBy2`, but `f`\nhas three group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN." - ], - "signature": "let unsafeReplaceRegExpBy3: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~group3: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.replaceRegExpBy0Unsafe", - "kind": "value", - "name": "replaceRegExpBy0Unsafe", - "docstrings": [ - "`replaceRegExpBy0Unsafe(str, regex, f)` returns a new `string` with some or all\nmatches of a pattern with no capturing parentheses replaced by the value\nreturned from the given function. The function receives as its parameters the\nmatched string, the offset at which the match begins, and the whole string being\nmatched.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (~match, ~offset as _, ~input as _) => String.toUpperCase(match)\nString.replaceRegExpBy0Unsafe(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" - ], - "signature": "let replaceRegExpBy0Unsafe: (\n string,\n RegExp.t,\n (~match: string, ~offset: int, ~input: string) => string,\n) => string" - }, - { - "id": "Stdlib.String.replaceRegExpBy1Unsafe", - "kind": "value", - "name": "replaceRegExpBy1Unsafe", - "docstrings": [ - "`replaceRegExpBy1Unsafe(str, regexp, f)`. Like `replaceRegExpBy0Unsafe`, but `f`\nhas `group1` parameter.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (~match as _, ~group1, ~offset as _, ~input as _) => {\n group1 ++ \"41\"\n}\nString.replaceRegExpBy1Unsafe(str, re, matchFn) == \"Jony is 41\"\n```" - ], - "signature": "let replaceRegExpBy1Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" - }, - { - "id": "Stdlib.String.replaceRegExpBy2Unsafe", - "kind": "value", - "name": "replaceRegExpBy2Unsafe", - "docstrings": [ - "`replaceRegExpBy2Unsafe(str, regexp, f)`. Like `replaceRegExpBy1Unsafe`, but `f`\nhas two group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (~match as _, ~group1, ~group2, ~offset as _, ~input as _) => {\n switch (Int.fromString(group1), Int.fromString(group2)) {\n | (Some(x), Some(y)) => Int.toString(x * y)\n | _ => \"???\"\n }\n}\nString.replaceRegExpBy2Unsafe(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let replaceRegExpBy2Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" - }, - { - "id": "Stdlib.String.replaceRegExpBy3Unsafe", - "kind": "value", - "name": "replaceRegExpBy3Unsafe", - "docstrings": [ - "`replaceRegExpBy3Unsafe(str, regexp, f)`. Like `replaceRegExpBy2Unsafe`, but `f`\nhas three group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN." - ], - "signature": "let replaceRegExpBy3Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~group3: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" - }, - { - "id": "Stdlib.String.search", - "kind": "value", - "name": "search", - "docstrings": [ - "`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search) on MDN.\n\n## Examples\n\n```rescript\nString.search(\"testing 1 2 3\", /\\d+/) == 8\nString.search(\"no numbers\", /\\d+/) == -1\n```" - ], - "signature": "let search: (string, RegExp.t) => int" - }, - { - "id": "Stdlib.String.searchOpt", - "kind": "value", - "name": "searchOpt", - "docstrings": [ - "`searchOpt(str, regexp)`. Like `search`, but return an `option`.\n\n## Examples\n\n```rescript\nString.searchOpt(\"testing 1 2 3\", /\\d+/) == Some(8)\nString.searchOpt(\"no numbers\", /\\d+/) == None\n```" - ], - "signature": "let searchOpt: (string, RegExp.t) => option" - }, - { - "id": "Stdlib.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(str)` returns `true` if the string is empty (has zero length), \n`false` otherwise.\n\n## Examples\n\n```rescript\nString.isEmpty(\"\") == true\nString.isEmpty(\"hello\") == false\nString.isEmpty(\" \") == false\n```" - ], - "signature": "let isEmpty: string => bool" - }, - { - "id": "Stdlib.String.capitalize", - "kind": "value", - "name": "capitalize", - "docstrings": [ - "`capitalize(str)` returns a new string with the first character converted to \nuppercase and the remaining characters unchanged. If the string is empty, \nreturns the empty string.\n\n## Examples\n\n```rescript\nString.capitalize(\"hello\") == \"Hello\"\nString.capitalize(\"HELLO\") == \"HELLO\"\nString.capitalize(\"hello world\") == \"Hello world\"\nString.capitalize(\"\") == \"\"\n```" - ], - "signature": "let capitalize: string => string" - }, - { - "id": "Stdlib.String.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```" - ], - "signature": "let slice: (string, ~start: int, ~end: int=?) => string" - }, - { - "id": "Stdlib.String.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```" - ], - "signature": "let sliceToEnd: (string, ~start: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nString.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nString.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nString.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```" - ], - "signature": "let split: (string, string) => array" - }, - { - "id": "Stdlib.String.splitAtMost", - "kind": "value", - "name": "splitAtMost", - "docstrings": [ - "`splitAtMost(str, delimiter, ~limit)` splits the given `str` at every\noccurrence of `delimiter` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings,\nthe array will contain all the substrings.\n\n## Examples\n\n```rescript\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=3) == [\"ant\", \"bee\", \"cat\"]\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=0) == []\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=9) == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```" - ], - "signature": "let splitAtMost: (string, string, ~limit: int) => array" - }, - { - "id": "Stdlib.String.splitByRegExp", - "kind": "value", - "name": "splitByRegExp", - "docstrings": [ - "`splitByRegExp(str, regexp)` splits the given `str` at every occurrence of\n`regexp` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExp(\"Jan,Feb,Mar\", /,/) == [Some(\"Jan\"), Some(\"Feb\"), Some(\"Mar\")]\n```" - ], - "signature": "let splitByRegExp: (string, RegExp.t) => array>" - }, - { - "id": "Stdlib.String.splitByRegExpAtMost", - "kind": "value", - "name": "splitByRegExpAtMost", - "docstrings": [ - "`splitByRegExpAtMost(str, regexp, ~limit)` splits the given `str` at every\noccurrence of `regexp` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings, the\narray will contain all the substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExpAtMost(\"Hello World. How are you doing?\", / /, ~limit=3) == [\n Some(\"Hello\"),\n Some(\"World.\"),\n Some(\"How\"),\n ]\n```" - ], - "signature": "let splitByRegExpAtMost: (string, RegExp.t, ~limit: int) => array>" - }, - { - "id": "Stdlib.String.startsWith", - "kind": "value", - "name": "startsWith", - "docstrings": [ - "`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```" - ], - "signature": "let startsWith: (string, string) => bool" - }, - { - "id": "Stdlib.String.startsWithFrom", - "kind": "value", - "name": "startsWithFrom", - "docstrings": [ - "`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```" - ], - "signature": "let startsWithFrom: (string, string, int) => bool" - }, - { - "id": "Stdlib.String.substring", - "kind": "value", - "name": "substring", - "docstrings": [ - "`substring(str, ~start, ~end)` returns characters `start` up to but not\nincluding end from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `end` is zero or negative, the empty string is returned.\n- If `start` is greater than `end`, the `start` and `end` points are swapped.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substring(\"playground\", ~start=3, ~end=6) == \"ygr\"\nString.substring(\"playground\", ~start=6, ~end=3) == \"ygr\"\nString.substring(\"playground\", ~start=4, ~end=12) == \"ground\"\nString.substring(\"playground\", ~start=4) == \"ground\"\nString.substring(\"Hello World\", ~start=6) == \"World\"\n```" - ], - "signature": "let substring: (string, ~start: int, ~end: int=?) => string" - }, - { - "id": "Stdlib.String.substringToEnd", - "kind": "value", - "name": "substringToEnd", - "docstrings": [ - "`substringToEnd(str, ~start)` returns the substring of `str` from position\n`start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string\n is returned.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substringToEnd(\"playground\", ~start=4) == \"ground\"\nString.substringToEnd(\"playground\", ~start=-3) == \"playground\"\nString.substringToEnd(\"playground\", ~start=12) == \"\"\n```" - ], - "signature": "let substringToEnd: (string, ~start: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.toLowerCase", - "kind": "value", - "name": "toLowerCase", - "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms, one when it is the last\ncharacter in a string and another when it is not.\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase) on MDN.\n\n## Examples\n\n```rescript\nString.toLowerCase(\"ABC\") == \"abc\"\nString.toLowerCase(`ΣΠ`) == `σπ`\nString.toLowerCase(`ΠΣ`) == `πς`\n```" - ], - "signature": "let toLowerCase: string => string" - }, - { - "id": "Stdlib.String.toLocaleLowerCase", - "kind": "value", - "name": "toLocaleLowerCase", - "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase) on MDN." - ], - "signature": "let toLocaleLowerCase: string => string" - }, - { - "id": "Stdlib.String.toUpperCase", - "kind": "value", - "name": "toUpperCase", - "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result, for example the German ß\ncapitalizes to two Ses in a row.\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) on MDN.\n\n## Examples\n\n```rescript\nString.toUpperCase(\"abc\") == \"ABC\"\nString.toUpperCase(`Straße`) == `STRASSE`\nString.toUpperCase(`πς`) == `ΠΣ`\n```" - ], - "signature": "let toUpperCase: string => string" - }, - { - "id": "Stdlib.String.toLocaleUpperCase", - "kind": "value", - "name": "toLocaleUpperCase", - "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\nSee [`String.toLocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase) on MDN." - ], - "signature": "let toLocaleUpperCase: string => string" - }, - { - "id": "Stdlib.String.trim", - "kind": "value", - "name": "trim", - "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim) on MDN.\n\n## Examples\n\n```rescript\nString.trim(\" abc def \") == \"abc def\"\nString.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" - ], - "signature": "let trim: string => string" - }, - { - "id": "Stdlib.String.trimStart", - "kind": "value", - "name": "trimStart", - "docstrings": [ - "`trimStart(str)` returns a string that is `str` with whitespace stripped from\nthe beginning of a string. Internal whitespace is not removed.\nSee [`String.trimStart`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimStart) on MDN.\n\n## Examples\n\n```rescript\nString.trimStart(\" Hello world! \") == \"Hello world! \"\nString.trimStart(\" Hello world! \") == \"Hello world! \"\n```" - ], - "signature": "let trimStart: string => string" - }, - { - "id": "Stdlib.String.trimEnd", - "kind": "value", - "name": "trimEnd", - "docstrings": [ - "`trimEnd(str)` returns a string that is `str` with whitespace stripped from the\nend of a string. Internal whitespace is not removed.\nSee [`String.trimEnd`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd) on MDN.\n\n## Examples\n\n```rescript\nString.trimEnd(\" Hello world! \") == \" Hello world!\"\nString.trimEnd(\" Hello world! \") == \" Hello world!\"\n```" - ], - "signature": "let trimEnd: string => string" - }, - { - "id": "Stdlib.String.padStart", - "kind": "value", - "name": "padStart", - "docstrings": [ - "`padStart(str, n, padStr)` returns a string that has been padded with `padStr`\n(multiple times, if needed) until the resulting string reaches the given `n`\nlength. The padding is applied from the start of the current string.\nSee [`String.padStart`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart) on MDN.\n\n## Examples\n\n```rescript\nString.padStart(\"abc\", 5, \" \") == \" abc\"\nString.padStart(\"abc\", 6, \"123465\") == \"123abc\"\n```" - ], - "signature": "let padStart: (string, int, string) => string" - }, - { - "id": "Stdlib.String.padEnd", - "kind": "value", - "name": "padEnd", - "docstrings": [ - "`padEnd(str, n, padStr)` returns a string that has been padded with `padStr`\n(multiple times, if needed) until the resulting string reaches the given `n`\nlength. The padding is applied from the end of the current string.\nSee [`String.padEnd`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd) on MDN.\n\n## Examples\n\n```rescript\nString.padEnd(\"Hello\", 10, \".\") == \"Hello.....\"\nString.padEnd(\"abc\", 1, \"\") == \"abc\"\n```" - ], - "signature": "let padEnd: (string, int, string) => string" - }, - { - "id": "Stdlib.String.localeCompare", - "kind": "value", - "name": "localeCompare", - "docstrings": [ - "`localeCompare(referenceStr, compareStr)` returns a float than indicatings\nwhether a reference string comes before or after, or is the same as the given\nstring in sort order. If `referenceStr` occurs before `compareStr` positive if\nthe `referenceStr` occurs after `compareStr`, `0` if they are equivalent.\nDo not rely on exact return values of `-1` or `1`\nSee [`String.localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare) on MDN.\n\n## Examples\n\n```rescript\nString.localeCompare(\"a\", \"c\") < 0.0 == true\nString.localeCompare(\"a\", \"a\") == 0.0\n```" - ], - "signature": "let localeCompare: (string, string) => float" - }, - { - "id": "Stdlib.String.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(string)` ignores the provided string and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: string => unit" - }, - { - "id": "Stdlib.String.getSymbolUnsafe", - "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [ - "`getSymbolUnsafe(str, symbol)` returns the value of the symbol property of a string.\n\n## Examples\n\n```rescript\nlet it: Iterator.t = (\"foo\"->String.getSymbolUnsafe(Symbol.iterator))()\nNullable.make(it)->Nullable.isNullable == false\n```" - ], - "signature": "let getSymbolUnsafe: (string, Symbol.t) => 'a" - } - ] - }, - "stdlib/result": { - "id": "Stdlib.Result", - "name": "Result", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Result.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Result types are really useful to describe the result of a certain operation\n without relying on exceptions or `option` types.\n\n This module gives you useful utilities to create and combine `Result` data." - ], - "signature": "type t<'res, 'err> = result<'res, 'err> =\n | Ok('res)\n | Error('err)" - }, - { - "id": "Stdlib.Result.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getExn(Result.Ok(42)) == 42\n \n switch Result.getExn(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getExn(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```" - ], - "signature": "let getExn: (result<'a, 'b>, ~message: string=?) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Result.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getOrThrow(Result.Ok(42)) == 42\n \n switch Result.getOrThrow(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getOrThrow(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```" - ], - "signature": "let getOrThrow: (result<'a, 'b>, ~message: string=?) => 'a" - }, - { - "id": "Stdlib.Result.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(res, default, f)`: When res is `Ok(n)`, returns `f(n)`, otherwise `default`.\n\n## Examples\n\n```rescript\nlet ok = Ok(42)\nResult.mapOr(ok, 0, x => x / 2) == 21\n\nlet error = Error(\"Invalid data\")\nResult.mapOr(error, 0, x => x / 2) == 0\n```" - ], - "signature": "let mapOr: (result<'a, 'c>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Result.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (result<'a, 'c>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Result.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(res, f)`: When res is `Ok(n)`, returns `Ok(f(n))`. Otherwise returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns an\nordinary value.\n\n## Examples\n\n```rescript\nlet f = x => sqrt(Int.toFloat(x))\n\nResult.map(Ok(64), f) == Ok(8.0)\n\nResult.map(Error(\"Invalid data\"), f) == Error(\"Invalid data\")\n```" - ], - "signature": "let map: (result<'a, 'c>, 'a => 'b) => result<'b, 'c>" - }, - { - "id": "Stdlib.Result.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(res, f)`: When res is `Ok(n)`, returns `f(n)`. Otherwise, returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns a\n`Result`.\n\n## Examples\n\n```rescript\nlet recip = x =>\n if x !== 0.0 {\n Ok(1.0 /. x)\n } else {\n Error(\"Divide by zero\")\n }\n\nResult.flatMap(Ok(2.0), recip) == Ok(0.5)\n\nResult.flatMap(Ok(0.0), recip) == Error(\"Divide by zero\")\n\nResult.flatMap(Error(\"Already bad\"), recip) == Error(\"Already bad\")\n```" - ], - "signature": "let flatMap: (result<'a, 'c>, 'a => result<'b, 'c>) => result<'b, 'c>" - }, - { - "id": "Stdlib.Result.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`, otherwise `default`\n\n## Examples\n\n```rescript\nResult.getOr(Ok(42), 0) == 42\n\nResult.getOr(Error(\"Invalid Data\"), 0) == 0\n```" - ], - "signature": "let getOr: (result<'a, 'b>, 'a) => 'a" - }, - { - "id": "Stdlib.Result.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (result<'a, 'b>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Result.isOk", - "kind": "value", - "name": "isOk", - "docstrings": [ - "`isOk(res)`: Returns `true` if `res` is of the form `Ok(n)`, `false` if it is the `Error(e)` variant." - ], - "signature": "let isOk: result<'a, 'b> => bool" - }, - { - "id": "Stdlib.Result.isError", - "kind": "value", - "name": "isError", - "docstrings": [ - "`isError(res)`: Returns `true` if `res` is of the form `Error(e)`, `false` if it is the `Ok(n)` variant." - ], - "signature": "let isError: result<'a, 'b> => bool" - }, - { - "id": "Stdlib.Result.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(res1, res2, eqOk, eqError)`: Determine if two `Result` variables are equal with\nrespect to equality functions. If `res1` and `res2` are of the form `Ok(n)`\nand `Ok(m)`, return the result of `eqOk(n, m)`. If one of `res1` and `res2` are of\nthe form `Error(e)`, return false If both `res1` and `res2` are of the form\n`Error(e)`, return the result of `eqError(e1, e2)`.\n\n## Examples\n\n```rescript\nlet good1 = Ok(42)\n\nlet good2 = Ok(32)\n\nlet bad1 = Error(\"invalid\")\n\nlet bad2 = Error(\"really invalid\")\n\nlet mod10equal = (a, b) => mod(a, 10) === mod(b, 10)\n\nResult.equal(good1, good2, mod10equal, String.equal) == true\n\nResult.equal(good1, bad1, mod10equal, String.equal) == false\n\nResult.equal(bad2, good2, mod10equal, String.equal) == false\n\nResult.equal(bad1, bad2, mod10equal, String.equal) == false\n```" - ], - "signature": "let equal: (\n result<'a, 'c>,\n result<'b, 'd>,\n ('a, 'b) => bool,\n ('c, 'd) => bool,\n) => bool" - }, - { - "id": "Stdlib.Result.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(res1, res2, cmpOk, cmpError)`: Compare two `Result` variables with respect to a\ncomparison function. The comparison function returns -1. if the first variable\nis \"less than\" the second, 0. if the two variables are equal, and 1. if the first\nis \"greater than\" the second.\n\nIf `res1` and `res2` are of the form `Ok(n)` and `Ok(m)`, return the result of\n`cmpOk(n, m)`. If `res1` is of the form `Error(e)` and `res2` of the form `Ok(n)`,\nreturn -1. (nothing is less than something) If `res1` is of the form `Ok(n)` and\n`res2` is of the form `Error(e)`, return 1. (something is greater than nothing) If\nboth `res1` and `res2` are of the form `Error(e)`, return cmpError(e1, e2).\n\n## Examples\n\n```rescript\nlet good1 = Ok(59)\n\nlet good2 = Ok(37)\n\nlet bad1 = Error(\"invalid\")\n\nlet bad2 = Error(\"really invalid\")\n\nlet mod10cmp = (a, b) => Int.compare(mod(a, 10), mod(b, 10))\n\nResult.compare(Ok(39), Ok(57), mod10cmp, String.compare) == 1.\n\nResult.compare(Ok(57), Ok(39), mod10cmp, String.compare) == -1.\n\nResult.compare(Ok(39), Error(\"y\"), mod10cmp, String.compare) == 1.\n\nResult.compare(Error(\"x\"), Ok(57), mod10cmp, String.compare) == -1.\n\nResult.compare(Error(\"x\"), Error(\"y\"), mod10cmp, String.compare) == -1.\n```" - ], - "signature": "let compare: (\n result<'a, 'c>,\n result<'b, 'd>,\n ('a, 'b) => Ordering.t,\n ('c, 'd) => Ordering.t,\n) => Ordering.t" - }, - { - "id": "Stdlib.Result.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(res, f)` runs the provided function `f` on the `Ok` value. If `res` is `Error`, nothing happens.\n\n## Examples\n\n```rescript\nResult.forEach(Ok(3), Console.log) // Logs \"3\", returns ()\nResult.forEach(Error(\"x\"), Console.log) // Does nothing, returns ()\n```" - ], - "signature": "let forEach: (result<'a, 'b>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Result.mapError", - "kind": "value", - "name": "mapError", - "docstrings": [ - "`mapError(r, f)` generates a new `result` by applying the function `f` to the `Error` value. If the source is `Ok`, return it as-is.\n\n## Examples\n\n```rescript\nlet format = n => `Error code: ${n->Int.toString}`\nResult.mapError(Error(14), format) == Error(\"Error code: 14\")\nResult.mapError(Ok(\"abc\"), format) == Ok(\"abc\")\n```" - ], - "signature": "let mapError: (result<'a, 'b>, 'b => 'c) => result<'a, 'c>" - }, - { - "id": "Stdlib.Result.all", - "kind": "value", - "name": "all", - "docstrings": [ - "`all(results)` returns a result of array if all options are Ok, otherwise returns Error.\n## Examples\n```rescript\nResult.all([Ok(1), Ok(2), Ok(3)]) == Ok([1, 2, 3])\nResult.all([Ok(1), Error(1)]) == Error(1)\n```" - ], - "signature": "let all: array> => result, 'b>" - }, - { - "id": "Stdlib.Result.all2", - "kind": "value", - "name": "all2", - "docstrings": [ - "`all2((r1, r2))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all2: (\n (result<'r1, 'e>, result<'r2, 'e>),\n) => result<('r1, 'r2), 'e>" - }, - { - "id": "Stdlib.Result.all3", - "kind": "value", - "name": "all3", - "docstrings": [ - "`all3((r1, r2, r3))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all3: (\n (result<'r1, 'e>, result<'r2, 'e>, result<'r3, 'e>),\n) => result<('r1, 'r2, 'r3), 'e>" - }, - { - "id": "Stdlib.Result.all4", - "kind": "value", - "name": "all4", - "docstrings": [ - "`all4((r1, r2, r3, r4))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all4: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4), 'e>" - }, - { - "id": "Stdlib.Result.all5", - "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((r1, r2, r3, r4, r5))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all5: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n result<'r5, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4, 'r5), 'e>" - }, - { - "id": "Stdlib.Result.all6", - "kind": "value", - "name": "all6", - "docstrings": [ - "`all6((r1, r2, r3, r4, r5, r6))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all6: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n result<'r5, 'e>,\n result<'r6, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4, 'r5, 'r6), 'e>" - }, - { - "id": "Stdlib.Result.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(result)` ignores the provided result and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: result<'res, 'err> => unit" - }, - { - "id": "Stdlib.Result.mapOkAsync", - "kind": "value", - "name": "mapOkAsync", - "docstrings": [ - "`mapOkAsync(res, f)`: Asynchronously maps over the Ok value of a Result. When `res` is `Ok(n)`, \napplies the async function `f` to `n` and wraps the result in `Ok`. \nWhen `res` is `Error`, returns the error unchanged.\n\n## Examples\n\n```rescript\n let square = x => x * x\n\n let result1 = await Result.mapOkAsync(Promise.resolve(Ok(4)), square)\n result1 == Ok(16)\n\n let result2 = await Result.mapOkAsync(\n Promise.resolve(Error(\"invalid\")),\n square,\n )\n result2 == Error(\"invalid\")\n```" - ], - "signature": "let mapOkAsync: (\n promise>,\n 'ok => 'mappedOk,\n) => promise>" - }, - { - "id": "Stdlib.Result.mapErrorAsync", - "kind": "value", - "name": "mapErrorAsync", - "docstrings": [ - "`mapErrorAsync(res, f)`: Asynchronously maps over the Error value of a Result. When `res` is `Error(e)`, \napplies the async function `f` to `e` and wraps the result in `Error`. \nWhen `res` is `Ok`, returns the ok value unchanged.\n\n## Examples\n\n```rescript\nlet formatError = e => `Error: ${e}`\n\nlet result1 = await Result.mapErrorAsync(Promise.resolve(Ok(42)), formatError)\nresult1 == Ok(42)\n\nlet result2 = await Result.mapErrorAsync(Promise.resolve(Error(\"invalid\")), formatError)\nresult2 == Error(\"Error: invalid\")\n```" - ], - "signature": "let mapErrorAsync: (\n promise>,\n 'error => 'mappedError,\n) => promise>" - }, - { - "id": "Stdlib.Result.flatMapOkAsync", - "kind": "value", - "name": "flatMapOkAsync", - "docstrings": [ - "`flatMapOkAsync(res, f)`: Asynchronously flat-maps over the Ok value of a Result. When `res` is `Ok(n)`, \napplies the async function `f` to `n` which returns a Promise of a Result. \nWhen `res` is `Error`, returns the error unchanged.\n\n## Examples\n\n```rescript\nlet asyncValidate = async x =>\n if x > 0 {\n Ok(x * 2)\n } else {\n Error(\"Must be positive\")\n }\n\nlet result1 = await Result.flatMapOkAsync(Promise.resolve(Ok(5)), asyncValidate)\nresult1 == Ok(10)\n\nlet result2 = await Result.flatMapOkAsync(\n Promise.resolve(Error(\"Already failed\")),\n asyncValidate,\n)\nresult2 == Error(\"Already failed\")\n```" - ], - "signature": "let flatMapOkAsync: (\n promise>,\n 'ok => promise>,\n) => promise>" - }, - { - "id": "Stdlib.Result.flatMapErrorAsync", - "kind": "value", - "name": "flatMapErrorAsync", - "docstrings": [ - "`flatMapErrorAsync(res, f)`: Asynchronously flat-maps over the Error value of a Result. When `res` is `Error(e)`, \napplies the async function `f` to `e` which returns a Promise of a Result. \nWhen `res` is `Ok`, returns the ok value unchanged.\n\n## Examples\n\n```rescript\nlet asyncRecover = async error =>\n if error === \"timeout\" {\n Ok(\"default\")\n } else {\n Error(error)\n }\n\nlet result1 = await Result.flatMapErrorAsync(\n Promise.resolve(Error(\"timeout\")),\n asyncRecover,\n)\nresult1 == Ok(\"default\")\n\nlet result2 = await Result.flatMapErrorAsync(\n Promise.resolve(Ok(\"default\")),\n asyncRecover,\n)\nresult2 == Ok(\"default\")\n```" - ], - "signature": "let flatMapErrorAsync: (\n promise>,\n 'error => promise>,\n) => promise>" - } - ] - }, - "stdlib/regexp": { - "id": "Stdlib.RegExp", - "name": "RegExp", - "docstrings": [ - "Functions for handling RegExp's in ReScript.\n\nSee [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) on MDN." - ], - "items": [ - { - "id": "Stdlib.RegExp.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an instantiated `RegExp`." - ], - "signature": "type t" - }, - { - "id": "Stdlib.RegExp.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(string)` creates a `RegExp.t` from the provided string. This can then be used to match on strings using `RegExp.exec`.\n\nSee [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n\n// Match 'foo' with case insensitive flag\nlet regexp = RegExp.fromString(\"foo\", ~flags=\"i\")\n\nswitch regexp->RegExp.exec(\"FOO\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"FOO\"\n}\n```" - ], - "signature": "let fromString: (string, ~flags: string=?) => t" - }, - { - "id": "Stdlib.RegExp.fromStringWithFlags", - "kind": "value", - "name": "fromStringWithFlags", - "docstrings": [ - "`fromStringWithFlags(string)` creates a `RegExp.t` from the provided string, using the provided `flags`. This can then be used to match on strings using `RegExp.exec`.\n\nSee [`RegExp parameters`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp#parameters) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```" - ], - "signature": "let fromStringWithFlags: (string, ~flags: string) => t", - "deprecated": "" - }, - { - "id": "Stdlib.RegExp.escape", - "kind": "value", - "name": "escape", - "docstrings": [ - "`escape(string)` escapes any potential regex syntax characters in a string.\n\nSee [`RegExp.escape`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/escape) on MDN.\n\n## Examples\n```rescript\nlet literal = \"foo[bar]\"\nlet regexp = literal->RegExp.escape->RegExp.fromString\nregexp->RegExp.test(\"foo[bar]\") == true\n```\n\n## Remark\n\nSince May 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let escape: string => string" - }, - { - "id": "Stdlib.RegExp.test", - "kind": "value", - "name": "test", - "docstrings": [ - "`test(regexp, string)` tests whether the provided `regexp` matches on the provided string.\n\nSee [`RegExp.test`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nif regexp->RegExp.test(\"ReScript is cool!\") {\n Console.log(\"Yay, there's a word in there.\")\n}\n```" - ], - "signature": "let test: (t, string) => bool" - }, - { - "id": "Stdlib.RegExp.exec", - "kind": "value", - "name": "exec", - "docstrings": [ - "`exec(regexp, string)` executes the provided regexp on the provided string, optionally returning a `RegExp.Result.t` if the regexp matches on the string.\n\nSee [`RegExp.exec`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```" - ], - "signature": "let exec: (t, string) => option" - }, - { - "id": "Stdlib.RegExp.lastIndex", - "kind": "value", - "name": "lastIndex", - "docstrings": [ - "`lastIndex(regexp)` returns the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `0` to the console\n\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `4` to the console\n```" - ], - "signature": "let lastIndex: t => int" - }, - { - "id": "Stdlib.RegExp.setLastIndex", - "kind": "value", - "name": "setLastIndex", - "docstrings": [ - "`setLastIndex(regexp, index)` set the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nregexp->RegExp.setLastIndex(4)\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `10` to the console\n```" - ], - "signature": "let setLastIndex: (t, int) => unit" - }, - { - "id": "Stdlib.RegExp.ignoreCase", - "kind": "value", - "name": "ignoreCase", - "docstrings": [ - "`ignoreCase(regexp)` returns whether the ignore case (`i`) flag is set on this `RegExp`.\n\nSee [`RegExp.ignoreCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/ignoreCase) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.ignoreCase) // Logs `false`, since `i` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.ignoreCase) // Logs `true`, since `i` is set\n```" - ], - "signature": "let ignoreCase: t => bool" - }, - { - "id": "Stdlib.RegExp.global", - "kind": "value", - "name": "global", - "docstrings": [ - "`global(regexp)` returns whether the global (`g`) flag is set on this `RegExp`.\n\nSee [`RegExp.global`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/global) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.global) // Logs `true`, since `g` is set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.global) // Logs `false`, since `g` is not set\n```" - ], - "signature": "let global: t => bool" - }, - { - "id": "Stdlib.RegExp.multiline", - "kind": "value", - "name": "multiline", - "docstrings": [ - "`multiline(regexp)` returns whether the multiline (`m`) flag is set on this `RegExp`.\n\nSee [`RegExp.multiline`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/multiline) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.multiline) // Logs `false`, since `m` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mi\")\nConsole.log(regexp2->RegExp.multiline) // Logs `true`, since `m` is set\n```" - ], - "signature": "let multiline: t => bool" - }, - { - "id": "Stdlib.RegExp.source", - "kind": "value", - "name": "source", - "docstrings": [ - "`source(regexp)` returns the source text for this `RegExp`, without the two forward slashes (if present), and without any set flags.\n\nSee [`RegExp.source`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/source) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp->RegExp.source) // Logs `\\w+`, the source text of the `RegExp`\n```" - ], - "signature": "let source: t => string" - }, - { - "id": "Stdlib.RegExp.sticky", - "kind": "value", - "name": "sticky", - "docstrings": [ - "`sticky(regexp)` returns whether the sticky (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.sticky`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `y` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"my\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `y` is set\n```" - ], - "signature": "let sticky: t => bool" - }, - { - "id": "Stdlib.RegExp.unicode", - "kind": "value", - "name": "unicode", - "docstrings": [ - "`unicode(regexp)` returns whether the unicode (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.unicode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `u` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mu\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `u` is set\n```" - ], - "signature": "let unicode: t => bool" - }, - { - "id": "Stdlib.RegExp.flags", - "kind": "value", - "name": "flags", - "docstrings": [ - "`flags(regexp)` returns a string consisting of all the flags set on this `RegExp`.\n\nSee [`RegExp.flags`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromString(\"\\\\w+\", ~flags=\"gi\")\nConsole.log(regexp->RegExp.flags) // Logs \"gi\", all the flags set on the RegExp\n```" - ], - "signature": "let flags: t => string" - }, - { - "id": "Stdlib.RegExp.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(regExp)` ignores the provided regExp and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/promise": { - "id": "Stdlib.Promise", - "name": "Promise", - "docstrings": [ - "Functions for interacting with JavaScript Promise.\nSee: [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)." - ], - "items": [ - { - "id": "Stdlib.Promise.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>" - }, - { - "id": "Stdlib.Promise.resolve", - "kind": "value", - "name": "resolve", - "docstrings": [ - "`resolve(value)` creates a resolved Promise with a given `value`.\nSee [`Promise.resolve`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve) on MDN.\n\n## Examples\n\n```rescript\nlet p = Promise.resolve(5) // promise\n```" - ], - "signature": "let resolve: 'a => t<'a>" - }, - { - "id": "Stdlib.Promise.reject", - "kind": "value", - "name": "reject", - "docstrings": [ - "`reject(exn)` reject a Promise.\nSee [`Promise.reject`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject) on MDN.\n\n## Examples\n\n```rescript\nexception TestError(string)\n\nTestError(\"some rejected value\")\n->Promise.reject\n->Promise.catch(v => {\n switch v {\n | TestError(msg) => msg == \"some rejected value\"\n | _ => assert(false)\n }\n Promise.resolve()\n})\n->ignore\n```" - ], - "signature": "let reject: exn => t<'a>" - }, - { - "id": "Stdlib.Promise.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(callback)` creates a new Promise based on a `callback` that receives two\nuncurried functions `resolve` and `reject` for defining the Promise's result.\n\n## Examples\n\n```rescript\nopen Promise\n\nlet n = 4\nPromise.make((resolve, reject) => {\n if n < 5 {\n resolve(\"success\")\n } else {\n reject(\"failed\")\n }\n})\n->then(str => {\n Console.log(str)->resolve\n})\n->catch(_ => {\n Console.log(\"Error occurred\")\n resolve()\n})\n->ignore\n```" - ], - "signature": "let make: (('a => unit, 'e => unit) => unit) => t<'a>" - }, - { - "id": "Stdlib.Promise.promiseAndResolvers", - "kind": "type", - "name": "promiseAndResolvers", - "docstrings": [], - "signature": "type promiseAndResolvers<'a> = {\n promise: t<'a>,\n resolve: 'a => unit,\n reject: exn => unit,\n}" - }, - { - "id": "Stdlib.Promise.withResolvers", - "kind": "value", - "name": "withResolvers", - "docstrings": [ - "`withResolvers()` returns a object containing a new promise with functions to resolve or reject it. See [`Promise.withResolvers`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\n\nlet {promise, resolve, _} = Promise.withResolvers()\n\nsetTimeout(() => {\n resolve(\"success\")\n}, 1000)->TimeoutId.ignore\n\npromise\n->thenResolve(str => {\n Console.log(str)\n})\n->ignore\n```" - ], - "signature": "let withResolvers: unit => promiseAndResolvers<'a>" - }, - { - "id": "Stdlib.Promise.catch", - "kind": "value", - "name": "catch", - "docstrings": [ - "`catch(promise, errorCallback)` registers an exception handler in a promise chain.\nThe `errorCallback` receives an `exn` value that can later be refined into a JS\nerror or ReScript error. The `errorCallback` needs to return a promise with the\nsame type as the consumed promise. See [`Promise.catch`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\n\nexception SomeError(string)\n\nreject(SomeError(\"this is an error\"))\n->then(_ => {\n Ok(\"This result will never be returned\")->resolve\n})\n->catch(e => {\n let msg = switch e {\n | SomeError(msg) => \"ReScript error occurred: \" ++ msg\n | JsExn(obj) =>\n switch JsExn.message(obj) {\n | Some(msg) => \"JS exception occurred: \" ++ msg\n | None => \"Some other JS value has been thrown\"\n }\n | _ => \"Unexpected error occurred\"\n }\n\n Error(msg)->resolve\n})\n->then(result => {\n switch result {\n | Ok(r) => Console.log2(\"Operation successful: \", r)\n | Error(msg) => Console.log2(\"Operation failed: \", msg)\n }->resolve\n})\n->ignore // Ignore needed for side-effects\n```\n\nIn case you want to return another promise in your `callback`, consider using\n`then` instead." - ], - "signature": "let catch: (t<'a>, exn => t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Promise.then", - "kind": "value", - "name": "then", - "docstrings": [ - "`then(promise, callback)` returns a new promise based on the result of `promise`'s\nvalue. The `callback` needs to explicitly return a new promise via `resolve`.\nIt is **not allowed** to resolve a nested promise (like `resolve(resolve(1))`).\nSee [`Promise.then`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) on MDN.\n## Examples\n\n```rescript\nopen Promise\nresolve(5)\n->then(num => {\n resolve(num + 5)\n})\n->then(num => {\n Console.log2(\"Your lucky number is: \", num)\n resolve()\n})\n->ignore\n```" - ], - "signature": "let then: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Promise.thenResolve", - "kind": "value", - "name": "thenResolve", - "docstrings": [ - "`thenResolve(promise, callback)` converts an encapsulated value of a promise\ninto another promise wrapped value. It is **not allowed** to return a promise\nwithin the provided callback (e.g. `thenResolve(value => resolve(value))`).\n\n## Examples\n\n```rescript\nopen Promise\nresolve(\"Anna\")\n->thenResolve(str => {\n \"Hello \" ++ str\n})\n->thenResolve(str => {\n Console.log(str)\n})\n->ignore // Ignore needed for side-effects\n```\n\nIn case you want to return another promise in your `callback`, consider using\n`then` instead." - ], - "signature": "let thenResolve: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Promise.finally", - "kind": "value", - "name": "finally", - "docstrings": [ - "`finally(promise, callback)` is used to execute a function that is called no\nmatter if a promise was resolved or rejected. It will return the same `promise`\nit originally received. See [`Promise.finally`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/finally) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nexception SomeError(string)\nlet isDone = ref(false)\n\nresolve(5)\n->then(_ => {\n reject(SomeError(\"test\"))\n})\n->then(v => {\n Console.log2(\"final result\", v)\n resolve()\n})\n->catch(_ => {\n Console.log(\"Error handled\")\n resolve()\n})\n->finally(() => {\n Console.log(\"finally\")\n isDone := true\n})\n->then(() => {\n Console.log2(\"isDone:\", isDone.contents)\n resolve()\n})\n->ignore\n```" - ], - "signature": "let finally: (t<'a>, unit => unit) => t<'a>" - }, - { - "id": "Stdlib.Promise.race", - "kind": "value", - "name": "race", - "docstrings": [ - "`race(arr)` runs all promises concurrently and returns promise settles with the eventual state of the first promise that settles. See [`Promise.race`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nlet racer = (ms, name) => {\n Promise.make((resolve, _) => {\n setTimeout(() => {\n resolve(name)\n }, ms)->TimeoutId.ignore\n })\n}\n\nlet promises = [racer(1000, \"Turtle\"), racer(500, \"Hare\"), racer(100, \"Eagle\")]\n\nrace(promises)->then(winner => {\n Console.log(\"The winner is \" ++ winner)\n resolve()\n})\n```" - ], - "signature": "let race: array> => t<'a>" - }, - { - "id": "Stdlib.Promise.any", - "kind": "value", - "name": "any", - "docstrings": [ - "`any(arr)` runs all promises concurrently and returns promise fulfills when any of the input's promises fulfills, with this first fulfillment value. See [`Promise.any`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/any) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nlet racer = (ms, name) => {\n Promise.make((resolve, _) => {\n setTimeout(() => {\n resolve(name)\n }, ms)->TimeoutId.ignore\n })\n}\n\nlet promises = [racer(1000, \"Turtle\"), racer(500, \"Hare\"), racer(100, \"Eagle\")]\n\nany(promises)->then(winner => {\n Console.log(\"The winner is \" ++ winner)\n resolve()\n})\n```" - ], - "signature": "let any: array> => t<'a>" - }, - { - "id": "Stdlib.Promise.all", - "kind": "value", - "name": "all", - "docstrings": [ - "`all(promises)` runs all promises concurrently and returns a promise fulfills when all of the input's promises fulfill, with an array of the fulfillment values. See [`Promise.all`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all) on MDN.\n\n```rescript\nopen Promise\nlet promises = [resolve(1), resolve(2), resolve(3)]\n\nall(promises)\n->then(results => {\n results->Array.forEach(num => {\n Console.log2(\"Number: \", num)\n })\n\n resolve()\n})\n->ignore\n```" - ], - "signature": "let all: array> => t>" - }, - { - "id": "Stdlib.Promise.all2", - "kind": "value", - "name": "all2", - "docstrings": [ - "`all2((p1, p2))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all2: ((t<'a>, t<'b>)) => t<('a, 'b)>" - }, - { - "id": "Stdlib.Promise.all3", - "kind": "value", - "name": "all3", - "docstrings": [ - "`all3((p1, p2, p3))`. Like `all()`, but with a fixed size tuple of 3" - ], - "signature": "let all3: ((t<'a>, t<'b>, t<'c>)) => t<('a, 'b, 'c)>" - }, - { - "id": "Stdlib.Promise.all4", - "kind": "value", - "name": "all4", - "docstrings": [ - "`all4((p1, p2, p3, p4))`. Like `all()`, but with a fixed size tuple of 4" - ], - "signature": "let all4: ((t<'a>, t<'b>, t<'c>, t<'d>)) => t<('a, 'b, 'c, 'd)>" - }, - { - "id": "Stdlib.Promise.all5", - "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((p1, p2, p3, p4, p5))`. Like `all()`, but with a fixed size tuple of 5" - ], - "signature": "let all5: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>),\n) => t<('a, 'b, 'c, 'd, 'e)>" - }, - { - "id": "Stdlib.Promise.all6", - "kind": "value", - "name": "all6", - "docstrings": [ - "`all6((p1, p2, p4, p5, p6))`. Like `all()`, but with a fixed size tuple of 6\n\")" - ], - "signature": "let all6: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>, t<'f>),\n) => t<('a, 'b, 'c, 'd, 'e, 'f)>" - }, - { - "id": "Stdlib.Promise.settledResult", - "kind": "type", - "name": "settledResult", - "docstrings": [], - "signature": "type settledResult<'a> =\n | Fulfilled({value: 'a})\n | Rejected({reason: exn})" - }, - { - "id": "Stdlib.Promise.allSettled", - "kind": "value", - "name": "allSettled", - "docstrings": [ - "`allSettled(promises)` runs all promises concurrently and returns promise fulfills when all of the input's promises settle with an array of objects that describe the outcome of each promise. See [`Promise.allSettled`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled) on MDN.\n\n```rescript\nopen Promise\n\nexception TestError(string)\n\nlet promises = [resolve(1), resolve(2), reject(TestError(\"some rejected promise\"))]\n\nallSettled(promises)\n->then(results => {\n results->Array.forEach(result => {\n switch result {\n | Fulfilled({value: num}) => Console.log2(\"Number: \", num)\n | Rejected({reason}) => Console.log(reason)\n }\n })\n\n resolve()\n})\n->ignore\n```" - ], - "signature": "let allSettled: array> => t>>" - }, - { - "id": "Stdlib.Promise.allSettled2", - "kind": "value", - "name": "allSettled2", - "docstrings": [ - "`allSettled2((p1, p2))`. Like `allSettled()`, but with a fixed size tuple of 2" - ], - "signature": "let allSettled2: (\n (t<'a>, t<'b>),\n) => t<(settledResult<'a>, settledResult<'b>)>" - }, - { - "id": "Stdlib.Promise.allSettled3", - "kind": "value", - "name": "allSettled3", - "docstrings": [ - "`allSettled3((p1, p2, p3))`. Like `allSettled()`, but with a fixed size tuple of 3" - ], - "signature": "let allSettled3: (\n (t<'a>, t<'b>, t<'c>),\n) => t<\n (settledResult<'a>, settledResult<'b>, settledResult<'c>),\n>" - }, - { - "id": "Stdlib.Promise.allSettled4", - "kind": "value", - "name": "allSettled4", - "docstrings": [ - "`allSettled4((p1, p2, p3, p4))`. Like `allSettled()`, but with a fixed size tuple of 4" - ], - "signature": "let allSettled4: (\n (t<'a>, t<'b>, t<'c>, t<'d>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n ),\n>" - }, - { - "id": "Stdlib.Promise.allSettled5", - "kind": "value", - "name": "allSettled5", - "docstrings": [ - "`allSettled5((p1, p2, p3, p4, p5))`. Like `allSettled()`, but with a fixed size tuple of 5" - ], - "signature": "let allSettled5: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n settledResult<'e>,\n ),\n>" - }, - { - "id": "Stdlib.Promise.allSettled6", - "kind": "value", - "name": "allSettled6", - "docstrings": [ - "`allSettled6((p1, p2, p4, p5, p6))`. Like `allSettled()`, but with a fixed size tuple of 6\n\")" - ], - "signature": "let allSettled6: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>, t<'f>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n settledResult<'e>,\n settledResult<'f>,\n ),\n>" - }, - { - "id": "Stdlib.Promise.done", - "kind": "value", - "name": "done", - "docstrings": [ - "`done(p)` is a safe way to ignore a promise. If a value is anything else than a\npromise, it will throw a type error." - ], - "signature": "let done: promise<'a> => unit", - "deprecated": "" - }, - { - "id": "Stdlib.Promise.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(promise)` ignores the provided promise and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: promise<'a> => unit" - } - ] - }, - "stdlib/pair": { - "id": "Stdlib.Pair", - "name": "Pair", - "docstrings": [ - "This module provides functions to work with pairs, which are 2-element tuples." - ], - "items": [ - { - "id": "Stdlib.Pair.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a, 'b> = ('a, 'b)" - }, - { - "id": "Stdlib.Pair.first", - "kind": "value", - "name": "first", - "docstrings": [ - "`first(pair)` returns the first element of a pair.\n\n## Examples\n\n```rescript\nPair.first((1, 2)) == 1\n```" - ], - "signature": "let first: (('a, 'b)) => 'a" - }, - { - "id": "Stdlib.Pair.second", - "kind": "value", - "name": "second", - "docstrings": [ - "`second(pair)` returns the second element of a pair.\n\n## Examples\n\n```rescript\nPair.second((1, 2)) == 2\n```" - ], - "signature": "let second: (('a, 'b)) => 'b" - }, - { - "id": "Stdlib.Pair.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(pair)` ignores the provided pair and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Pair.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(pair1, pair2, f1, f2)` check equality of `pair2` and `pair2` using `f1` for\nequality on the first element and `f2` for equality on the second element.\n\n## Examples\n\n```rescript\nPair.equal((1, \"test\"), (1, \"test\"), Int.equal, String.equal) == true\n\nPair.equal((1, \"test\"), (2, \"test\"), Int.equal, String.equal) == false\n```" - ], - "signature": "let equal: (\n ('a, 'b),\n ('c, 'd),\n ('a, 'c) => bool,\n ('b, 'd) => bool,\n) => bool" - }, - { - "id": "Stdlib.Pair.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(pair1, pair2, f1, f2)` compares two pairs, using `f1` to compare the first element\nand `f2` to compare the second element. Ordering is based on the first element,\nif they are equal, the second element is compared.\n\n## Examples\n\n```rescript\nPair.compare((1, \"a\"), (1, \"a\"), Int.compare, String.compare) == Ordering.equal\nPair.compare((1, \"a\"), (1, \"b\"), Int.compare, String.compare) == Ordering.less\nPair.compare((2, \"a\"), (1, \"b\"), Int.compare, String.compare) == Ordering.greater\n```" - ], - "signature": "let compare: (\n ('a, 'b),\n ('c, 'd),\n ('a, 'c) => float,\n ('b, 'd) => float,\n) => float" - } - ] - }, - "stdlib/ordering": { - "id": "Stdlib.Ordering", - "name": "Ordering", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Ordering.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Ordering values represent the result of a comparison: `less`, `equal`, or `greater`." - ], - "signature": "type t = float" - }, - { - "id": "Stdlib.Ordering.less", - "kind": "value", - "name": "less", - "docstrings": [], - "signature": "let less: float" - }, - { - "id": "Stdlib.Ordering.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: float" - }, - { - "id": "Stdlib.Ordering.greater", - "kind": "value", - "name": "greater", - "docstrings": [], - "signature": "let greater: float" - }, - { - "id": "Stdlib.Ordering.isLess", - "kind": "value", - "name": "isLess", - "docstrings": [ - "`isLess(ordering)` returns `true` when `ordering` equals `Ordering.less`.\n\n## Examples\n\n```rescript\nOrdering.isLess(Ordering.less) == true\nOrdering.isLess(Ordering.equal) == false\n```" - ], - "signature": "let isLess: float => bool" - }, - { - "id": "Stdlib.Ordering.isEqual", - "kind": "value", - "name": "isEqual", - "docstrings": [ - "`isEqual(ordering)` returns `true` when `ordering` equals `Ordering.equal`.\n\n## Examples\n\n```rescript\nOrdering.isEqual(Ordering.equal) == true\nOrdering.isEqual(Ordering.greater) == false\n```" - ], - "signature": "let isEqual: float => bool" - }, - { - "id": "Stdlib.Ordering.isGreater", - "kind": "value", - "name": "isGreater", - "docstrings": [ - "`isGreater(ordering)` returns `true` when `ordering` equals `Ordering.greater`.\n\n## Examples\n\n```rescript\nOrdering.isGreater(Ordering.greater) == true\nOrdering.isGreater(Ordering.less) == false\n```" - ], - "signature": "let isGreater: float => bool" - }, - { - "id": "Stdlib.Ordering.invert", - "kind": "value", - "name": "invert", - "docstrings": [ - "`invert(ordering)` flips the ordering result (less becomes greater and vice versa).\n\n## Examples\n\n```rescript\nOrdering.invert(Ordering.less) == Ordering.greater\nOrdering.invert(Ordering.equal) == Ordering.equal\n```" - ], - "signature": "let invert: float => float" - }, - { - "id": "Stdlib.Ordering.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "`fromInt(n)` converts an integer comparison result into an ordering.\n\n## Examples\n\n```rescript\nOrdering.fromInt(-5) == Ordering.less\nOrdering.fromInt(0) == Ordering.equal\nOrdering.fromInt(3) == Ordering.greater\n```" - ], - "signature": "let fromInt: int => float" - }, - { - "id": "Stdlib.Ordering.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(ordering)` ignores the provided ordering and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/option": { - "id": "Stdlib.Option", - "name": "Option", - "docstrings": [ - "We represent the existence and nonexistence of a value by wrapping it with\nthe `option` type. In order to make it a bit more convenient to work with\noption-types, we provide utility-functions for it.\n\nThe `option` type is a part of the ReScript standard library which is defined\nlike this:\n\n```rescript\ntype option<'a> = None | Some('a)\n```\n\n```rescript\nlet someString: option = Some(\"hello\")\n```" - ], - "items": [ - { - "id": "Stdlib.Option.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an option of type 'a." - ], - "signature": "type t<'a> = option<'a> = None | Some('a)" - }, - { - "id": "Stdlib.Option.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(opt, f)` applies `f` to `opt`, if `f` returns `true`, then it returns `Some(value)`, otherwise returns `None`.\n\n## Examples\n\n```rescript\nOption.filter(Some(10), x => x > 5) // Some(10)\nOption.filter(Some(4), x => x > 5) // None\nOption.filter(None, x => x > 5) // None\n```" - ], - "signature": "let filter: (option<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Option.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(opt, f)` call `f` on `opt`. if `opt` is `Some(value)`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nOption.forEach(Some(\"thing\"), x => Console.log(x)) // logs \"thing\"\nOption.forEach(None, x => Console.log(x)) // returns ()\n```" - ], - "signature": "let forEach: (option<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Option.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(opt, ~message=?)` returns `value` if `opt` is `Some(value)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n```rescript\nOption.getExn(Some(3)) == 3\n\nswitch Option.getExn(None) {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n\nswitch Option.getExn(None, ~message=\"was None!\") {\n| exception _ => assert(true) // Throws a JsError with the message \"was None!\"\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an error if `opt` is `None`" - ], - "signature": "let getExn: (option<'a>, ~message: string=?) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Option.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(opt, ~message=?)` returns `value` if `opt` is `Some(value)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n```rescript\nOption.getOrThrow(Some(3)) == 3\n\nswitch Option.getOrThrow(None) {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n\nswitch Option.getOrThrow(None, ~message=\"was None!\") {\n| exception _ => assert(true) // Throws a JsError with the message \"was None!\"\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an error if `opt` is `None`" - ], - "signature": "let getOrThrow: (option<'a>, ~message: string=?) => 'a" - }, - { - "id": "Stdlib.Option.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(opt)` returns `value` if `opt` is `Some(value)`, otherwise `undefined`.\n\n## Examples\n\n```rescript\nOption.getUnsafe(Some(3)) == 3\nOption.getUnsafe((None: option)) // Returns `undefined`, which is not a valid `int`\n```\n\n## Notes\n\n- This is an unsafe operation. It assumes `value` is not `None`, and may cause undefined behaviour if it is." - ], - "signature": "let getUnsafe: option<'a> => 'a" - }, - { - "id": "Stdlib.Option.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(opt, default, f)` returns `f(value)` if `opt` is `Some(value)`, otherwise `default`.\n\n## Examples\n\n```rescript\nlet someValue = Some(3)\nsomeValue->Option.mapOr(0, x => x + 5) // 8\n\nlet noneValue = None\nnoneValue->Option.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (option<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Option.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (option<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Option.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(opt, f)` returns `Some(f(value))` if `opt` is `Some(value)`, otherwise `None`.\n\n## Examples\n\n```rescript\nOption.map(Some(3), x => x * x) // Some(9)\nOption.map(None, x => x * x) // None\n```" - ], - "signature": "let map: (option<'a>, 'a => 'b) => option<'b>" - }, - { - "id": "Stdlib.Option.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(opt, f)` returns `f(value)` if `opt` is `Some(value)`, otherwise `None`.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Some(value + 1)\n } else {\n None\n }\n\nOption.flatMap(Some(2), addIfAboveOne) // Some(3)\nOption.flatMap(Some(-4), addIfAboveOne) // None\nOption.flatMap(None, addIfAboveOne) // None\n```" - ], - "signature": "let flatMap: (option<'a>, 'a => option<'b>) => option<'b>" - }, - { - "id": "Stdlib.Option.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(opt, default)` returns `value` if `opt` is `Some(value)`, otherwise `default`.\n\n## Examples\n\n```rescript\nOption.getOr(None, \"Banana\") // Banana\nOption.getOr(Some(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nSome(\"Jane\")->greet // \"Greetings Jane\"\nNone->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (option<'a>, 'a) => 'a" - }, - { - "id": "Stdlib.Option.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (option<'a>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Option.orElse", - "kind": "value", - "name": "orElse", - "docstrings": [ - "`orElse(opt1, opt2)` returns `opt2` if `opt1` is `None`, otherwise `opt1`.\n\n## Examples\n\n```rescript\nOption.orElse(Some(1812), Some(1066)) == Some(1812)\nOption.orElse(None, Some(1066)) == Some(1066)\nOption.orElse(None, None) == None\n```" - ], - "signature": "let orElse: (option<'a>, option<'a>) => option<'a>" - }, - { - "id": "Stdlib.Option.isSome", - "kind": "value", - "name": "isSome", - "docstrings": [ - "`isSome(opt)` returns `true` if `opt` is `Some(value)`, otherwise returns `false`.\n\n## Examples\n\n```rescript\nOption.isSome(None) // false\nOption.isSome(Some(1)) // true\n```" - ], - "signature": "let isSome: option<'a> => bool" - }, - { - "id": "Stdlib.Option.isNone", - "kind": "value", - "name": "isNone", - "docstrings": [ - "`isNone(opt)` returns `true` if `opt` is `None`, false otherwise.\n\n## Examples\n\n```rescript\nOption.isNone(None) // true\nOption.isNone(Some(1)) // false\n```" - ], - "signature": "let isNone: option<'a> => bool" - }, - { - "id": "Stdlib.Option.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(opt1, opt2, f)` evaluates two optional values for equality with respect to a predicate function `f`. If both `opt1` and `opt2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, the predicate function `f` must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Option\n\nequal(Some(3), Some(15), clockEqual) // true\nequal(Some(3), None, clockEqual) // false\nequal(None, Some(3), clockEqual) // false\nequal(None, None, clockEqual) // true\n```" - ], - "signature": "let equal: (option<'a>, option<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.Option.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(opt1, opt2, f)` compares two optional values with respect to given `f`.\n\nIf both `opt1` and `opt2` are `None`, it returns `0.`. If the first argument is `Some(value1)` and the second is `None`, returns `1.` (something is greater than nothing).\n\nIf the first argument is `None` and the second is `Some(value2)`, returns `-1.`\n(nothing is less than something).\n\nIf the arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, `f` takes two arguments and returns `-1.` if the first\nargument is less than the second, `0.` if the arguments are equal, and `1.` if\nthe first argument is greater than the second.\n\n## Examples\n\n```rescript\nlet clockCompare = (a, b) => Int.compare(mod(a, 12), mod(b, 12))\n\nOption.compare(Some(3), Some(15), clockCompare) // 0.\nOption.compare(Some(3), Some(14), clockCompare) // 1.\nOption.compare(Some(2), Some(15), clockCompare) // (-1.)\nOption.compare(None, Some(15), clockCompare) // (-1.)\nOption.compare(Some(14), None, clockCompare) // 1.\nOption.compare(None, None, clockCompare) // 0.\n```" - ], - "signature": "let compare: (\n option<'a>,\n option<'b>,\n ('a, 'b) => Ordering.t,\n) => Ordering.t" - }, - { - "id": "Stdlib.Option.all", - "kind": "value", - "name": "all", - "docstrings": [ - "`all(options)` returns an option of array if all options are Some, otherwise returns None.\n\n## Examples\n\n```rescript\nOption.all([Some(1), Some(2), Some(3)]) // Some([1, 2, 3])\nOption.all([Some(1), None]) // None\n```" - ], - "signature": "let all: array> => option>" - }, - { - "id": "Stdlib.Option.all2", - "kind": "value", - "name": "all2", - "docstrings": [ - "`all2((o1, o2))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all2: ((option<'a>, option<'b>)) => option<('a, 'b)>" - }, - { - "id": "Stdlib.Option.all3", - "kind": "value", - "name": "all3", - "docstrings": [ - "`all3((o1, o2, o3))`. Like `all()`, but with a fixed size tuple of 3" - ], - "signature": "let all3: (\n (option<'a>, option<'b>, option<'c>),\n) => option<('a, 'b, 'c)>" - }, - { - "id": "Stdlib.Option.all4", - "kind": "value", - "name": "all4", - "docstrings": [ - "`all4((o1, o2, o3, o4))`. Like `all()`, but with a fixed size tuple of 4" - ], - "signature": "let all4: (\n (option<'a>, option<'b>, option<'c>, option<'d>),\n) => option<('a, 'b, 'c, 'd)>" - }, - { - "id": "Stdlib.Option.all5", - "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((o1, o2, o3, o4, o5))`. Like `all()`, but with a fixed size tuple of 5" - ], - "signature": "let all5: (\n (\n option<'a>,\n option<'b>,\n option<'c>,\n option<'d>,\n option<'e>,\n ),\n) => option<('a, 'b, 'c, 'd, 'e)>" - }, - { - "id": "Stdlib.Option.all6", - "kind": "value", - "name": "all6", - "docstrings": [ - "`all6((o1, o2, o3, o4, o5, o6))`. Like `all()`, but with a fixed size tuple of 6" - ], - "signature": "let all6: (\n (\n option<'a>,\n option<'b>,\n option<'c>,\n option<'d>,\n option<'e>,\n option<'f>,\n ),\n) => option<('a, 'b, 'c, 'd, 'e, 'f)>" - }, - { - "id": "Stdlib.Option.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(option)` ignores the provided option and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: option<'a> => unit" - } - ] - }, - "stdlib/object": { - "id": "Stdlib.Object", - "name": "Object", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Object.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make` create a new object that inherits the properties and methods from the standard built-in Object, such as `toString`. See [Object on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)\n\n## Examples\n\n```rescript\nlet x = Object.make()\nx->Object.keysToArray->Array.length // 0\nx->Object.get(\"toString\")->Option.isSome // true\n```" - ], - "signature": "let make: unit => {..}" - }, - { - "id": "Stdlib.Object.is", - "kind": "value", - "name": "is", - "docstrings": [ - "`is` determines if two objects are identical in all contexts. Objects, arrays, records, and other non-primitives are only identical if they reference the **exact** same object in memory. Primitives like ints, floats, and strings are identical if they have the same value. `+0` and `-0` are distinct. NaN is equal to itself. See [Object.is on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)\n\nIn most scenarios use `==` or `===` or the custom `equals` function (if provided) for the type.\n\n## Examples\n\n```rescript\nObject.is(25, 13) // false\nObject.is(\"abc\", \"abc\") // true\nObject.is(undefined, undefined) // true\nObject.is(undefined, null) // false\nObject.is(-0.0, 0.0) // false\nObject.is(list{1, 2}, list{1, 2}) // false\n\nObject.is([1, 2, 3], [1, 2, 3]) // false\n[1, 2, 3] == [1, 2, 3] // true\n[1, 2, 3] === [1, 2, 3] // false\n\nlet fruit = {\"name\": \"Apple\"}\nObject.is(fruit, fruit) // true\nObject.is(fruit, {\"name\": \"Apple\"}) // false\nfruit == {\"name\": \"Apple\"} // true\nfruit === {\"name\": \"Apple\"} // false\n```" - ], - "signature": "let is: ('a, 'a) => bool" - }, - { - "id": "Stdlib.Object.create", - "kind": "value", - "name": "create", - "docstrings": [ - "`create` creates a new object, using an existing object as the prototype of the new object. See [Object.create on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\n\n**Note:** ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object) and [records](https://rescript-lang.org/docs/manual/latest/record). This is often safer and more convenient than using `create` and other functions in this module.\n\n## Examples\n\n```rescript\nlet x = {\"fruit\": \"banana\"}\nlet y = Object.create(x)\ny->Object.get(\"fruit\") // Some(\"banana\")\n```" - ], - "signature": "let create: {..} => {..}" - }, - { - "id": "Stdlib.Object.createWithProperties", - "kind": "value", - "name": "createWithProperties", - "docstrings": [ - "`createWithProperties(proto, descriptors)` creates a new object that delegates to `proto` and defines additional properties using descriptor objects.\n\nSee [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) on MDN.\n\n## Examples\n\n```rescript\nlet proto = {\"kind\": \"fruit\"}\nlet obj = Object.createWithProperties(proto, {\"name\": {\"value\": \"banana\"}})\nobj->Object.get(\"name\") == Some(\"banana\")\nobj->Object.get(\"kind\") == Some(\"fruit\")\n```" - ], - "signature": "let createWithProperties: ({..}, {..}) => {..}" - }, - { - "id": "Stdlib.Object.createWithNull", - "kind": "value", - "name": "createWithNull", - "docstrings": [ - "`createWithNull()` creates an object with a `null` prototype (no inherited properties).\n\nSee [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) on MDN.\n\n## Examples\n\n```rescript\nlet obj = Object.createWithNull()\nobj->Object.get(\"toString\") == None\n```" - ], - "signature": "let createWithNull: unit => {..}" - }, - { - "id": "Stdlib.Object.createWithNullAndProperties", - "kind": "value", - "name": "createWithNullAndProperties", - "docstrings": [ - "`createWithNullAndProperties(descriptors)` creates an object with a `null` prototype and defines properties using descriptor objects.\n\nSee [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) on MDN.\n\n## Examples\n\n```rescript\nlet obj = Object.createWithNullAndProperties({\"name\": {\"value\": \"banana\"}})\nobj->Object.get(\"name\") == Some(\"banana\")\nobj->Object.get(\"toString\") == None\n```" - ], - "signature": "let createWithNullAndProperties: {..} => {..}" - }, - { - "id": "Stdlib.Object.assign", - "kind": "value", - "name": "assign", - "docstrings": [ - "`assign(target, source)` copies enumerable own properties from the source to the target, overwriting properties with the same name. It returns the modified target object. A deep clone is not created; properties are copied by reference.\n\n**Warning:** ReScript provides compile-time support for type-safe access to JavaScript objects. This eliminates common errors such as accessing properties that do not exist, or using a property of type x as if it were a y. Using `assign` can bypass these safety checks and lead to run-time errors (if you are not careful). ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object) and [records](https://rescript-lang.org/docs/manual/latest/record). This is often safer and more convenient than using `assign` and other functions in this module.\n\nSee [Object.assign on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) or [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign).\n\n## Examples\n\n```rescript\nObject.assign({\"a\": 1}, {\"a\": 2}) // {\"a\": 2}\nObject.assign({\"a\": 1, \"b\": 2}, {\"a\": 0}) // {\"a\": 0, \"b\": 2}\nObject.assign({\"a\": 1}, {\"a\": null}) // {\"a\": null}\n```" - ], - "signature": "let assign: ({..}, {..}) => {..}" - }, - { - "id": "Stdlib.Object.assignMany", - "kind": "value", - "name": "assignMany", - "docstrings": [ - "`assignMany(target, sources)` copies enumerable own properties from each source to the target, overwriting properties with the same name. Later sources' properties overwrite earlier ones. It returns the modified target object. A deep clone is not created; properties are copied by reference.\n\n**Note:** ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object), including spreading one object into another. This is often more convenient than using `assign` or `assignMany`. \n\nSee [Object.assign on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) or [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign)." - ], - "signature": "let assignMany: ({..}, array<{..}>) => {..}" - }, - { - "id": "Stdlib.Object.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(object)` creates a shallow copy of `object`.\n\nSee [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) on MDN.\n\n## Examples\n\n```rescript\nlet original = {\"name\": \"banana\"}\nlet cloned = Object.copy(original)\ncloned->Object.get(\"name\") == Some(\"banana\")\nObject.is(original, cloned) == false\n```" - ], - "signature": "let copy: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get` gets the value of a property by name. Returns `None` if the property does not exist or has the value `undefined`. Otherwise returns `Some`, including if the value is `null`.\n\n## Examples\n\n```rescript\n{\"a\": 1}->Object.get(\"a\") // Some(1)\n{\"a\": 1}->Object.get(\"b\") // None\n{\"a\": undefined}->Object.get(\"a\") // None\n{\"a\": null}->Object.get(\"a\") // Some(null)\n{\"a\": 1}->Object.get(\"toString\")->Option.isSome // true\n```" - ], - "signature": "let get: ({..}, string) => option<'a>" - }, - { - "id": "Stdlib.Object.getSymbol", - "kind": "value", - "name": "getSymbol", - "docstrings": [ - "`getSymbol` gets the value of a property by symbol. Returns `None` if the property does not exist or has the value `undefined`. Otherwise returns `Some`, including if the value is `null`.\n\n## Examples\n\n```rescript\nlet fruit = Symbol.make(\"fruit\")\nlet x = Object.make()\nx->Object.setSymbol(fruit, \"banana\")\nx->Object.getSymbol(fruit) == Some(\"banana\")\n```" - ], - "signature": "let getSymbol: ({..}, Symbol.t) => option<'a>" - }, - { - "id": "Stdlib.Object.getSymbolUnsafe", - "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [ - "`getSymbolUnsafe(object, key)` reads the value stored under the symbol `key` without any optional check.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet obj = Object.make()\nobj->Object.setSymbol(key, \"hello\")\nObject.getSymbolUnsafe(obj, key) == \"hello\"\n```" - ], - "signature": "let getSymbolUnsafe: ({..}, Symbol.t) => 'a" - }, - { - "id": "Stdlib.Object.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(name, value)` assigns a value to the named object property, overwriting the previous value if any. See [Working with Objects on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#objects_and_properties)\n\n## Examples\n\n```rescript\n{\"a\": 1}->Object.set(\"a\", 2) // {\"a\": 2}\n{\"a\": 1}->Object.set(\"a\", None) // {\"a\": None}\n{\"a\": 1}->Object.set(\"b\", 2) // {\"a\": 1, \"b\": 2}\n```" - ], - "signature": "let set: ({..}, string, 'a) => unit" - }, - { - "id": "Stdlib.Object.setSymbol", - "kind": "value", - "name": "setSymbol", - "docstrings": [ - "`setSymbol(object, key, value)` stores `value` under the symbol `key` on `object`.\n\nBeware this will *mutate* the object.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"count\")\nlet obj = Object.make()\nobj->Object.setSymbol(key, 5)\nObject.getSymbol(obj, key) == Some(5)\n```" - ], - "signature": "let setSymbol: ({..}, Symbol.t, 'a) => unit" - }, - { - "id": "Stdlib.Object.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "`keysToArray` returns an array of an object's own enumerable string-keyed property names. See [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.keys)\nor [Object.keys on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys).\n\n## Examples\n\n```rescript\n{\"a\": 1, \"b\": 2}->Object.keysToArray // [\"a\", \"b\"]\n{\"a\": None}->Object.keysToArray // [\"a\"]\nObject.make()->Object.keysToArray // []\n```" - ], - "signature": "let keysToArray: {..} => array" - }, - { - "id": "Stdlib.Object.hasOwnProperty", - "kind": "value", - "name": "hasOwnProperty", - "docstrings": [ - "`hasOwnProperty` determines whether the object has the specified property as its **own** property, as opposed to inheriting it. See [hasOwnProperty on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 2}\n{\"a\": 1}->Object.hasOwnProperty(\"a\") // true\n{\"a\": 1}->Object.hasOwnProperty(\"b\") // false\n{\"a\": 1}->Object.hasOwnProperty(\"toString\") // false\n```" - ], - "signature": "let hasOwnProperty: ({..}, string) => bool" - }, - { - "id": "Stdlib.Object.seal", - "kind": "value", - "name": "seal", - "docstrings": [ - "`seal` seals an object. Sealing an object prevents extensions and makes existing properties non-configurable. A sealed object has a fixed set of properties. Unlike `freeze`, values of existing properties can still be changed as long as they are writable.\n\n**Note:** `seal` returns the same object that was passed in; it does not create a copy. Any attempt to delete or add properties to a sealed object will fail, either silently or by throwing an error.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.seal) and [Object.seal on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 2}\npoint->Object.set(\"x\", -7) // succeeds\npoint->Object.seal->ignore\n\ntry {\n point->Object.set(\"z\", 9) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n\npoint->Object.set(\"x\", 13) // succeeds\n```" - ], - "signature": "let seal: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.preventExtensions", - "kind": "value", - "name": "preventExtensions", - "docstrings": [ - "`preventExtensions` prevents new properties from being added to the object. It modifies the object (rather than creating a copy) and returns it.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.preventextensions) and [Object.preventExtensions on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/preventExtensions)\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.set(\"b\", 2) // succeeds\nobj->Object.preventExtensions->ignore\ntry {\n obj->Object.set(\"c\", 3) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let preventExtensions: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.freeze", - "kind": "value", - "name": "freeze", - "docstrings": [ - "`freeze` freezes an object. Freezing an object makes existing properties non-writable and prevents extensions. Once an object is frozen, new properties cannot be be added, existing properties cannot be removed, and their values cannot be changed.\n\n**Note:** `freeze` returns the same object that was passed in; it does not create a frozen copy. Any attempt to change a frozen object will fail, either silently or by throwing an exception.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isfrozen) and [Object.isFrozen on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen).\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.set(\"a\", 2) // succeeds\nobj->Object.freeze->ignore\n\ntry {\n obj->Object.set(\"a\", 3) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let freeze: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.isSealed", - "kind": "value", - "name": "isSealed", - "docstrings": [ - "`isSealed` determines if an object is sealed. A sealed object has a fixed set of properties.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.issealed) and [Object.isSealed on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 3}->Object.seal\nlet pointIsSealed = point->Object.isSealed // true\nlet fruit = {\"name\": \"Apple\"}\nlet fruitIsSealed = fruit->Object.isSealed // false\n```" - ], - "signature": "let isSealed: 'a => bool" - }, - { - "id": "Stdlib.Object.isFrozen", - "kind": "value", - "name": "isFrozen", - "docstrings": [ - "`isFrozen` determines if an object is frozen. An object is frozen if an only if it is not extensible, all its properties are non-configurable, and all its data properties are non-writable.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isfrozen) and [Object.isFrozen on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen).\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 3}->Object.freeze\nlet pointIsFrozen = point->Object.isFrozen // true\nlet fruit = {\"name\": \"Apple\"}\nlet fruitIsFrozen = fruit->Object.isFrozen // false\n```" - ], - "signature": "let isFrozen: 'a => bool" - }, - { - "id": "Stdlib.Object.isExtensible", - "kind": "value", - "name": "isExtensible", - "docstrings": [ - "`isExtensible` determines if an object is extensible (whether it can have new properties added to it).\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isextensible) and [Object.isExtensible on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible)\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.isExtensible // true\nobj->Object.preventExtensions->ignore\nobj->Object.isExtensible // false\n```" - ], - "signature": "let isExtensible: 'a => bool" - }, - { - "id": "Stdlib.Object.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(object)` ignores the provided object and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: {..} => unit" - } - ] - }, - "stdlib/nullable": { - "id": "Stdlib.Nullable", - "name": "Nullable", - "docstrings": [ - "Functions for handling nullable values.\n\nPrimarily useful when interoping with JavaScript when you don't know whether you'll get a value, `null` or `undefined`." - ], - "items": [ - { - "id": "Stdlib.Nullable.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a nullable value.\nA nullable value can be the value `'a`, `null` or `undefined`." - ], - "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined" - }, - { - "id": "Stdlib.Nullable.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The value `null`.\n\nSee [`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null) on MDN.\n\n## Examples\n```rescript\nConsole.log(Nullable.null) // Logs `null` to the console.\n```" - ], - "signature": "let null: t<'a>" - }, - { - "id": "Stdlib.Nullable.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The value `undefined`.\n\nSee [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/undefined) on MDN.\n\n## Examples\n```rescript\nConsole.log(undefined) // Logs `undefined` to the console.\n```" - ], - "signature": "let undefined: t<'a>" - }, - { - "id": "Stdlib.Nullable.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [ - "`isNullable(a)` returns `true` if `a` is null or undefined, `false` otherwise.\n\n## Examples\n\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Check if asNullable is not null or undefined\nswitch asNullable->Nullable.isNullable {\n| true => assert(false)\n| false => assert(true)\n}\n```" - ], - "signature": "let isNullable: t<'a> => bool" - }, - { - "id": "Stdlib.Nullable.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new nullable value from the provided value.\nThis means the compiler will enforce null checks for the new value.\n\n## Examples\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Need to do this\nswitch asNullable->Nullable.toOption {\n| Some(value) if value == myStr => Console.log(\"Yay, values matched!\")\n| _ => Console.log(\"Values did not match.\")\n}\n```" - ], - "signature": "let make: 'a => t<'a>" - }, - { - "id": "Stdlib.Nullable.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.Nullable.compare", - "kind": "value", - "name": "compare", - "docstrings": [], - "signature": "let compare: (t<'a>, t<'b>, ('a, 'b) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.Nullable.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Converts a nullable value into an option, so it can be pattern matched on.\nWill convert both `null` and `undefined` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullableString = Nullable.make(\"Hello\")\n\nswitch nullableString->Nullable.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```" - ], - "signature": "let toOption: t<'a> => option<'a>" - }, - { - "id": "Stdlib.Nullable.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Turns an `option` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet optString = Some(\"Hello\")\nlet asNullable = optString->Nullable.fromOption // Nullable.t\n```" - ], - "signature": "let fromOption: option<'a> => t<'a>" - }, - { - "id": "Stdlib.Nullable.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(value, default)` returns `value` if not `null` or `undefined`,\notherwise return `default`.\n\n## Examples\n\n```rescript\nNullable.getOr(Nullable.null, \"Banana\") // Banana\nNullable.getOr(Nullable.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNullable.make(\"Jane\")->Nullable.toOption->greet // \"Greetings Jane\"\nNullable.null->Nullable.toOption->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (t<'a>, 'a) => 'a" - }, - { - "id": "Stdlib.Nullable.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Nullable.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getExn(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getExn(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`" - ], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Nullable.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getOrThrow(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getOrThrow(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`" - ], - "signature": "let getOrThrow: t<'a> => 'a" - }, - { - "id": "Stdlib.Nullable.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNullable.getUnsafe(Nullable.make(3)) == 3\nNullable.getUnsafe(Nullable.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null` or `undefined`." - ], - "signature": "let getUnsafe: t<'a> => 'a" - }, - { - "id": "Stdlib.Nullable.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(value, f)` call `f` on `value`. if `value` is not `null` or `undefined`,\nthen if calls `f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNullable.forEach(Nullable.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNullable.forEach(Nullable.null, x => Console.log(x)) // returns ()\nNullable.forEach(undefined, x => Console.log(x)) // returns ()\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Nullable.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nNullable.map(Nullable.make(3), x => x * x) // Nullable.make(9)\nNullable.map(undefined, x => x * x) // undefined\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Nullable.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`\nor `undefined`, otherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Nullable.make(3)\nsomeValue->Nullable.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Nullable.null\nnoneValue->Nullable.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (t<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Nullable.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (t<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Nullable.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Nullable.make(value + 1)\n } else {\n Nullable.null\n }\n\nNullable.flatMap(Nullable.make(2), addIfAboveOne) // Nullable.make(3)\nNullable.flatMap(Nullable.make(-4), addIfAboveOne) // undefined\nNullable.flatMap(Nullable.null, addIfAboveOne) // undefined\n```" - ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Nullable.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(nullable)` ignores the provided nullable and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/null": { - "id": "Stdlib.Null", - "name": "Null", - "docstrings": [ - "Functions for handling values that could be `null`.\n\nIf you also need to cover `undefined`, check out `Nullable` instead." - ], - "items": [ - { - "id": "Stdlib.Null.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a value that can be either `'a` or `null`." - ], - "signature": "@unboxed\ntype t<'a> = null<'a> =\n | Value('a)\n | @as(null) Null" - }, - { - "id": "Stdlib.Null.asNullable", - "kind": "value", - "name": "asNullable", - "docstrings": [ - "Converts a `Null.t` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet nullValue = Null.make(\"Hello\")\nlet asNullable = nullValue->Null.asNullable // Nullable.t\n```" - ], - "signature": "let asNullable: t<'a> => Nullable.t<'a>" - }, - { - "id": "Stdlib.Null.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The value `null`.\n\nSee [`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null) on MDN.\n\n## Examples\n```rescript\nConsole.log(null) // Logs `null` to the console.\n```" - ], - "signature": "let null: t<'a>" - }, - { - "id": "Stdlib.Null.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Null.t` from the provided value.\nThis means the compiler will enforce null checks for the new value.\n\n## Examples\n```rescript\nlet myStr = \"Hello\"\nlet asNullValue = myStr->Null.make // The compiler now thinks this can be `string` or `null`.\n```" - ], - "signature": "let make: 'a => t<'a>" - }, - { - "id": "Stdlib.Null.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(a, b, eq)` checks if `a` and `b` are equal.\nIf both are `Null.Value`, it will use function `eq` to check if the values are equal.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\nNull.equal(a, b, Int.equal) == false\nNull.equal(a, c, Int.equal) == false\nNull.equal(Null.null, Null.null, Int.equal) == true\n```" - ], - "signature": "let equal: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.Null.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(a, b, cmp)` compares `a` and `b`.\nIf both are `Null.Value`, it will use function `cmp` to compare the values.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\n// A value is greater than null\nNull.compare(a, b, Int.compare) == Ordering.greater\n// A value is less than null\nNull.compare(b, a, Int.compare) == Ordering.less\n// A null is equal to null\nNull.compare(Null.null, Null.null, Int.compare) == Ordering.equal\n// The compare function is used if both are `Null.Value`\nNull.compare(a, c, Int.compare) == Ordering.less\n```" - ], - "signature": "let compare: (t<'a>, t<'b>, ('a, 'b) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.Null.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Converts a nullable value into an option, so it can be pattern matched on.\nWill convert `null` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullStr = Null.make(\"Hello\")\n\nswitch nullStr->Null.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```" - ], - "signature": "let toOption: t<'a> => option<'a>" - }, - { - "id": "Stdlib.Null.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Turns an `option` into a `Null.t`. `None` will be converted to `null`.\n\n## Examples\n```rescript\nlet optString: option = None\nlet asNull = optString->Null.fromOption // Null.t\nConsole.log(asNull == Null.null) // Logs `true` to the console.\n```" - ], - "signature": "let fromOption: option<'a> => t<'a>" - }, - { - "id": "Stdlib.Null.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(value, default)` returns `value` if not `null`, otherwise return\n`default`.\n\n## Examples\n\n```rescript\nNull.getOr(Null.null, \"Banana\") // Banana\nNull.getOr(Null.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNull.make(\"Jane\")->Null.toOption->greet // \"Greetings Jane\"\nNull.null->Null.toOption->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (t<'a>, 'a) => 'a" - }, - { - "id": "Stdlib.Null.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Null.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getExn(Null.make(3)) == 3\n\nswitch Null.getExn(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`" - ], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Null.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getOrThrow(Null.make(3)) == 3\n\nswitch Null.getOrThrow(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`" - ], - "signature": "let getOrThrow: t<'a> => 'a" - }, - { - "id": "Stdlib.Null.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNull.getUnsafe(Null.make(3)) == 3\nNull.getUnsafe(Null.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null`." - ], - "signature": "let getUnsafe: t<'a> => 'a" - }, - { - "id": "Stdlib.Null.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(value, f)` call `f` on `value`. if `value` is not `null`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNull.forEach(Null.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNull.forEach(Null.null, x => Console.log(x)) // logs nothing\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Null.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(value, f)` returns `f(value)` if `value` is not `null`, otherwise returns\n`value` unchanged.\n\n## Examples\n\n```rescript\nNull.map(Null.make(3), x => x * x) // Null.make(9)\nNull.map(Null.null, x => x * x) // null\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Null.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`,\notherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Null.make(3)\nsomeValue->Null.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Null.null\nnoneValue->Null.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (t<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Null.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (t<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Null.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(value, f)` returns `f(value)` if `value` is not `null`, otherwise\nreturns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Null.make(value + 1)\n } else {\n Null.null\n }\n\nNull.flatMap(Null.make(2), addIfAboveOne) // Null.make(3)\nNull.flatMap(Null.make(-4), addIfAboveOne) // null\nNull.flatMap(Null.null, addIfAboveOne) // null\n```" - ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Null.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(null)` ignores the provided null and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/math": { - "id": "Stdlib.Math", - "name": "Math", - "docstrings": [ - "Functions for interacting with JavaScript Math.\nSee: [`Math`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math)." - ], - "items": [ - { - "id": "Stdlib.Math.abs", - "kind": "value", - "name": "abs", - "docstrings": [ - "`abs(v)` returns absolute value of `v`.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n## Examples\n\n```rescript\nMath.abs(-2.0) == 2.0\nMath.abs(3.0) == 3.0\n```" - ], - "signature": "let abs: float => float" - }, - { - "id": "Stdlib.Math.acos", - "kind": "value", - "name": "acos", - "docstrings": [ - "`acos(v)` returns arccosine (in radians) of argument `v`, returns `NaN` if the\nargument is outside the range \\[-1.0, 1.0\\].\nSee [`Math.acos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acos) on MDN.\n\n## Examples\n\n```rescript\nMath.acos(-1.0) == 3.141592653589793\nMath.acos(-3.0)->Float.isNaN == true\n```" - ], - "signature": "let acos: float => float" - }, - { - "id": "Stdlib.Math.acosh", - "kind": "value", - "name": "acosh", - "docstrings": [ - "`acosh(v)` returns the inverse hyperbolic arccosine (in radians) of argument `v`,\nreturns `NaN` if the argument is less than `1.0`.\nSee [`Math.acosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acosh) on MDN.\n\n## Examples\n\n```rescript\nMath.acosh(1.0) == 0.0\nMath.acosh(0.5)->Float.isNaN == true\n```" - ], - "signature": "let acosh: float => float" - }, - { - "id": "Stdlib.Math.asin", - "kind": "value", - "name": "asin", - "docstrings": [ - "`asin(v)` returns the inverse sine (in radians) of argument `v`, returns `NaN`\nif the argument `v` is outside the range \\[-1.0, 1.0\\].\nSee [`Math.asin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asin) on MDN.\n\n## Examples\n\n```rescript\nMath.asin(-1.0) == -1.5707963267948966\nMath.asin(-2.0)->Float.isNaN == true\n```" - ], - "signature": "let asin: float => float" - }, - { - "id": "Stdlib.Math.asinh", - "kind": "value", - "name": "asinh", - "docstrings": [ - "`asinh(v)` returns the inverse hyperbolic sine of argument `v`.\nSee [`Math.asinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh) on MDN.\n\n## Examples\n\n```rescript\nMath.asinh(-1.0) == -0.881373587019543\nMath.asinh(-0.0) == -0.0\n```" - ], - "signature": "let asinh: float => float" - }, - { - "id": "Stdlib.Math.atan", - "kind": "value", - "name": "atan", - "docstrings": [ - "`atan(v)` returns the inverse tangent (in radians) of argument `v`.\nSee [`Math.atan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan) on MDN.\n\n## Examples\n\n```rescript\nMath.atan(-0.0) == -0.0\nMath.atan(0.0) == 0.0\nMath.atan(1.0) == 0.7853981633974483\n```" - ], - "signature": "let atan: float => float" - }, - { - "id": "Stdlib.Math.atanh", - "kind": "value", - "name": "atanh", - "docstrings": [ - "`atanh(v)` returns the invert hyperbolic tangent of argument `v`. Returns `NaN`\nif the argument `v` is is outside the range \\[-1.0, 1.0\\] and `Infinity` if `v`\nis `-1.0` or `1.0`.\nSee [`Math.atanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh) on MDN.\n\n## Examples\n\n```rescript\nMath.atanh(-2.0)->Float.isNaN == true\nMath.atanh(-1.0)->Float.isFinite == false\nMath.atanh(-0.0) == -0.0\nMath.atanh(0.0) == 0.0\nMath.atanh(0.5) == 0.5493061443340548\n```" - ], - "signature": "let atanh: float => float" - }, - { - "id": "Stdlib.Math.atan2", - "kind": "value", - "name": "atan2", - "docstrings": [ - "`atan2(~y, ~x)` returns the angle (in radians) of the quotient `y /. x`. It is\nalso the angle between the *x*\\-axis and point (*x*, *y*).\nSee [`Math.atan2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2) on MDN.\n\n## Examples\n\n```rescript\nMath.atan2(~y=0.0, ~x=10.0) == 0.0\nMath.atan2(~x=5.0, ~y=5.0) == Math.Constants.pi /. 4.0\nMath.atan2(~x=90.0, ~y=15.0) == 0.16514867741462683\nMath.atan2(~x=15.0, ~y=90.0) == 1.4056476493802699\n```" - ], - "signature": "let atan2: (~y: float, ~x: float) => float" - }, - { - "id": "Stdlib.Math.cbrt", - "kind": "value", - "name": "cbrt", - "docstrings": [ - "`cbrt(v)` returns the cube root of argument `v`.\nSee [`Math.cbrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt) on MDN.\n\n## Examples\n\n```rescript\nMath.cbrt(-1.0) == -1.0\nMath.cbrt(-0.0) == -0.0\nMath.cbrt(0.0) == 0.0\n```" - ], - "signature": "let cbrt: float => float" - }, - { - "id": "Stdlib.Math.ceil", - "kind": "value", - "name": "ceil", - "docstrings": [ - "`ceil(v)` returns the smallest integral value greater than or equal to the\nargument `v`. The result is a `float` and is not restricted to the `int` data\ntype range.\nSee [`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil) on MDN.\n\n## Examples\n\n```rescript\nMath.ceil(3.1) == 4.0\nMath.ceil(3.0) == 3.0\nMath.ceil(-3.1) == -3.0\nMath.ceil(2_150_000_000.3) == 2_150_000_001.0\n```" - ], - "signature": "let ceil: float => float" - }, - { - "id": "Stdlib.Math.cos", - "kind": "value", - "name": "cos", - "docstrings": [ - "`cos(v)` returns the cosine of argument `v`, which must be specified in radians.\nSee [`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos) on MDN.\n\n## Examples\n\n```rescript\nMath.cos(-0.0) == 1.0\nMath.cos(0.0) == 1.0\nMath.cos(1.0) == 0.5403023058681398\n```" - ], - "signature": "let cos: float => float" - }, - { - "id": "Stdlib.Math.cosh", - "kind": "value", - "name": "cosh", - "docstrings": [ - "`cosh(v)` returns the hyperbolic cosine of argument `v`, which must be specified\nin radians.\nSee [`Math.cosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh) on MDN.\n\n## Examples\n\n```rescript\nMath.cosh(-1.0) == 1.5430806348152437\nMath.cosh(-0.0) == 1.0\nMath.cosh(0.0) == 1.0\n```" - ], - "signature": "let cosh: float => float" - }, - { - "id": "Stdlib.Math.exp", - "kind": "value", - "name": "exp", - "docstrings": [ - "`exp(v)` returns natural exponentional, returns *e* (the base of natural logarithms)\nto the power of the given argument `v`.\nSee [`Math.exp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/exp) on MDN.\n\n## Examples\n\n```rescript\nMath.exp(-1.0) == 0.36787944117144233\nMath.exp(0.0) == 1.0\n```" - ], - "signature": "let exp: float => float" - }, - { - "id": "Stdlib.Math.expm1", - "kind": "value", - "name": "expm1", - "docstrings": [ - "`expm1(v)` returns *e* (the base of natural logarithms) to the power of the given\nargument `v` minus 1.\nSee [`Math.expm1`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1) on MDN.\n\n## Examples\n\n```rescript\nMath.expm1(-1.0) == -0.6321205588285577\nMath.expm1(-0.0) == -0.0\n```" - ], - "signature": "let expm1: float => float" - }, - { - "id": "Stdlib.Math.floor", - "kind": "value", - "name": "floor", - "docstrings": [ - "`floor(v)` returns the largest integral value less than or equal to the argument\n`v`. The result is a `float` and is not restricted to the `int` data type range.\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor) on MDN.\n\n## Examples\n\n```rescript\nMath.floor(-45.95) == -46.0\nMath.floor(-45.05) == -46.0\nMath.floor(-0.0) == -0.0\n```" - ], - "signature": "let floor: float => float" - }, - { - "id": "Stdlib.Math.fround", - "kind": "value", - "name": "fround", - "docstrings": [ - "`fround(v)` returns the nearest single precision float.\nSee [`Math.fround`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround) on MDN.\n\n## Examples\n\n```rescript\nMath.fround(5.5) == 5.5\nMath.fround(5.05) == 5.050000190734863\n```" - ], - "signature": "let fround: float => float" - }, - { - "id": "Stdlib.Math.hypot", - "kind": "value", - "name": "hypot", - "docstrings": [ - "`hypot(a, b)` returns the square root of the sum of squares of its two arguments\n(the Pythagorean formula).\nSee [`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot) on MDN.\n\n## Examples\n\n```rescript\nMath.hypot(3.0, 4.0) == 5.0\nMath.hypot(3.0, 5.0) == 5.8309518948453\n```" - ], - "signature": "let hypot: (float, float) => float" - }, - { - "id": "Stdlib.Math.hypotMany", - "kind": "value", - "name": "hypotMany", - "docstrings": [ - "`hypotMany(arr)` returns the square root of the sum of squares of the numbers in\nthe array argument (generalized Pythagorean equation). Using an array allows you\nto have more than two items. If `arr` is an empty array then returns `0.0`.\nSee [`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot) on MDN.\n\n## Examples\n\n```rescript\nMath.hypotMany([3.0, 4.0, 5.0]) == 7.0710678118654755\nMath.hypotMany([]) == 0.0\n```" - ], - "signature": "let hypotMany: array => float" - }, - { - "id": "Stdlib.Math.log", - "kind": "value", - "name": "log", - "docstrings": [ - "`log(v)` returns the natural logarithm of argument `v`, this is the number *x*\nsuch that `e^x` equals the argument. Returns `NaN` for negative arguments and\n`Infinity` for `0.0` or `-0.0`.\nSee [`Math.log`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log) on MDN.\n\n## Examples\n\n```rescript\nMath.log(-1.0)->Float.isNaN == true\nMath.log(-0.0)->Float.isFinite == false\nMath.log(0.0)->Float.isFinite == false\nMath.log(1.0) == 0.0\n```" - ], - "signature": "let log: float => float" - }, - { - "id": "Stdlib.Math.log1p", - "kind": "value", - "name": "log1p", - "docstrings": [ - "`log1p(v)` returns the natural logarithm of one plus the argument `v`.\nReturns `NaN` for arguments less than `-1` and `Infinity` if `v` is `-1.0`.\nSee [`Math.log1p`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log1p) on MDN.\n\n## Examples\n\n```rescript\nMath.log1p(-2.0)->Float.isNaN == true\nMath.log1p(-1.0)->Float.isFinite == false\nMath.log1p(-0.0) == -0.0\n```" - ], - "signature": "let log1p: float => float" - }, - { - "id": "Stdlib.Math.log10", - "kind": "value", - "name": "log10", - "docstrings": [ - "`log10(v)` returns the base 10 logarithm of argument `v`. Returns `NaN` for\nnegative `v`. If `v` is `-0.0` or `0.0` returns `Infinity`.\nSee [`Math.log10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log10) on MDN.\n\n## Examples\n\n```rescript\nMath.log10(-2.0)->Float.isNaN == true\nMath.log10(-0.0)->Float.isFinite == false\nMath.log10(0.0)->Float.isFinite == false\nMath.log10(1.0) == 0.0\n```" - ], - "signature": "let log10: float => float" - }, - { - "id": "Stdlib.Math.log2", - "kind": "value", - "name": "log2", - "docstrings": [ - "`log2(v)` returns the base 2 logarithm of argument `v`. Returns `NaN` for\nnegative `v` and `Infinity` if `v` is `-0.0` or `0.0`.\nSee [`Math.log2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2) on MDN.\n\n## Examples\n\n```rescript\nMath.log2(-2.0)->Float.isNaN == true\nMath.log2(-0.0)->Float.isFinite == false\nMath.log2(0.0)->Float.isFinite == false\nMath.log2(1.0) == 0.0\n```" - ], - "signature": "let log2: float => float" - }, - { - "id": "Stdlib.Math.min", - "kind": "value", - "name": "min", - "docstrings": [ - "`min(a, b)` returns the minimum of its two float arguments.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n## Examples\n\n```rescript\nMath.min(1.0, 2.0) == 1.0\nMath.min(-1.0, -2.0) == -2.0\n```" - ], - "signature": "let min: (float, float) => float" - }, - { - "id": "Stdlib.Math.minMany", - "kind": "value", - "name": "minMany", - "docstrings": [ - "`minMany(arr)` returns the minimum of the float in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n## Examples\n\n```rescript\nMath.minMany([1.0, 2.0]) == 1.0\nMath.minMany([-1.0, -2.0]) == -2.0\nMath.minMany([])->Float.isFinite == false\n```" - ], - "signature": "let minMany: array => float" - }, - { - "id": "Stdlib.Math.max", - "kind": "value", - "name": "max", - "docstrings": [ - "`max(a, b)` returns the maximum of its two float arguments.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n## Examples\n\n```rescript\nMath.max(1.0, 2.0) == 2.0\nMath.max(-1.0, -2.0) == -1.0\n```" - ], - "signature": "let max: (float, float) => float" - }, - { - "id": "Stdlib.Math.maxMany", - "kind": "value", - "name": "maxMany", - "docstrings": [ - "`maxMany(arr)` returns the maximum of the float in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n## Examples\n\n```rescript\nMath.maxMany([1.0, 2.0]) == 2.0\nMath.maxMany([-1.0, -2.0]) == -1.0\nMath.maxMany([])->Float.isFinite == false\n```" - ], - "signature": "let maxMany: array => float" - }, - { - "id": "Stdlib.Math.pow", - "kind": "value", - "name": "pow", - "docstrings": [ - "`pow(a, ~exp)` throws the given base `a` to the given exponent `exp`.\nSee [`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow) on MDN.\n\n## Examples\n\n```rescript\nMath.pow(2.0, ~exp=4.0) == 16.0\nMath.pow(3.0, ~exp=4.0) == 81.0\n```" - ], - "signature": "let pow: (float, ~exp: float) => float" - }, - { - "id": "Stdlib.Math.random", - "kind": "value", - "name": "random", - "docstrings": [ - "`random()` returns a random number in the half-closed interval \\[0,1\\].\nSee [`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random) on MDN.\n\n## Examples\n\n```rescript\nMath.random()\n```" - ], - "signature": "let random: unit => float" - }, - { - "id": "Stdlib.Math.round", - "kind": "value", - "name": "round", - "docstrings": [ - "`round(v)` returns then value of `v` rounded to nearest integral value\n(expressed as a float). If the fractional portion of the argument `v` is greater\nthan `0.5`, the argument `v` is rounded to the float with the next higher\nabsolute value.\nSee [`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round) on MDN.\n\n## Examples\n\n```rescript\nMath.round(-20.5) == -20.0\nMath.round(-0.1) == -0.0\nMath.round(0.0) == 0.0\nMath.round(-0.0) == -0.0\n```" - ], - "signature": "let round: float => float" - }, - { - "id": "Stdlib.Math.sign", - "kind": "value", - "name": "sign", - "docstrings": [ - "`sign(v)` returns the sign of its foat argument: `-1` if negative, `0` if\nzero, `1` if positive.\nSee [`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign) on MDN.\n\n## Examples\n\n```rescript\nMath.sign(3.0) == 1.0\nMath.sign(-3.0) == -1.0\nMath.sign(0.0) == 0.0\n```" - ], - "signature": "let sign: float => float" - }, - { - "id": "Stdlib.Math.sin", - "kind": "value", - "name": "sin", - "docstrings": [ - "`sin(v)` returns the sine of argument `v`, which must be specified in radians.\nSee [`Math.sin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin) on MDN.\n\n## Examples\n\n```rescript\nMath.sin(-0.0) == -0.0\nMath.sin(0.0) == 0.0\nMath.sin(1.0) == 0.8414709848078965\n```" - ], - "signature": "let sin: float => float" - }, - { - "id": "Stdlib.Math.sinh", - "kind": "value", - "name": "sinh", - "docstrings": [ - "`sinh(v)` returns then hyperbolic sine of argument `v`, which must be specified\nin radians.\nSee [`Math.sinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sinh) on MDN.\n\n## Examples\n\n```rescript\nMath.sinh(-0.0) == -0.0\nMath.sinh(0.0) == 0.0\nMath.sinh(1.0) == 1.1752011936438014\n```" - ], - "signature": "let sinh: float => float" - }, - { - "id": "Stdlib.Math.sqrt", - "kind": "value", - "name": "sqrt", - "docstrings": [ - "`sqrt(v)` returns the square root of `v`. If `v` is negative returns `NaN`.\nSee [`Math.sqrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt) on MDN.\n\n## Examples\n\n```rescript\nMath.sqrt(-1.0)->Float.isNaN == true\nMath.sqrt(-0.0) == -0.0\nMath.sqrt(0.0) == 0.0\nMath.sqrt(1.0) == 1.0\nMath.sqrt(9.0) == 3.0\n```" - ], - "signature": "let sqrt: float => float" - }, - { - "id": "Stdlib.Math.tan", - "kind": "value", - "name": "tan", - "docstrings": [ - "`tan(v)` returns the tangent of argument `v`, which must be specified in\nradians. Returns `NaN` if `v` is positive `Infinity` or negative `Infinity`.\nSee [`Math.tan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tan) on MDN.\n\n## Examples\n\n```rescript\nMath.tan(-0.0) == -0.0\nMath.tan(0.0) == 0.0\nMath.tan(1.0) == 1.5574077246549023\n```" - ], - "signature": "let tan: float => float" - }, - { - "id": "Stdlib.Math.tanh", - "kind": "value", - "name": "tanh", - "docstrings": [ - "`tanh(v)` returns the hyperbolic tangent of argument `v`, which must be\nspecified in radians.\nSee [`Math.tanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tanh) on MDN.\n\n## Examples\n\n```rescript\nMath.tanh(-0.0) == -0.0\nMath.tanh(0.0) == 0.0\nMath.tanh(1.0) == 0.7615941559557649\n```" - ], - "signature": "let tanh: float => float" - }, - { - "id": "Stdlib.Math.trunc", - "kind": "value", - "name": "trunc", - "docstrings": [ - "`trunc(v)` truncates the argument `v`, i.e., removes fractional digits.\nSee [`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc) on MDN.\n\n## Examples\n\n```rescript\nMath.trunc(0.123) == 0.0\nMath.trunc(1.999) == 1.0\nMath.trunc(13.37) == 13.0\nMath.trunc(42.84) == 42.0\n```" - ], - "signature": "let trunc: float => float" - } - ] - }, - "stdlib/list": { - "id": "Stdlib.List", - "name": "List", - "docstrings": [], - "items": [ - { - "id": "Stdlib.List.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Collection functions for manipulating the `list` data structures, a singly-linked list.\n\n**Prefer Array** if you need any of the following:\n\n- Random access of element\n- Better interop with JavaScript\n- Better memory usage & performance." - ], - "signature": "type t<'a> = list<'a>" - }, - { - "id": "Stdlib.List.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(list)` returns the length of `list`.\n\n## Examples\n\n```rescript\nList.length(list{1, 2, 3}) == 3\n```" - ], - "signature": "let length: list<'a> => int" - }, - { - "id": "Stdlib.List.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(list)`. See [`length`](#length)\n\n## Examples\n\n```rescript\nList.size(list{1, 2, 3}) == 3\n```" - ], - "signature": "let size: list<'a> => int" - }, - { - "id": "Stdlib.List.head", - "kind": "value", - "name": "head", - "docstrings": [ - "`head(list)` returns `Some(value)` where `value` is the first element in the\nlist, or `None` if `list` is an empty list.\n\n## Examples\n\n```rescript\nList.head(list{}) == None\nList.head(list{1, 2, 3}) == Some(1)\n```" - ], - "signature": "let head: list<'a> => option<'a>" - }, - { - "id": "Stdlib.List.headExn", - "kind": "value", - "name": "headExn", - "docstrings": [ - "`headExn(list)` same as [`head`](#head).\n\n## Examples\n\n```rescript\nList.headExn(list{1, 2, 3}) == 1\n\nswitch List.headExn(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let headExn: list<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.List.headOrThrow", - "kind": "value", - "name": "headOrThrow", - "docstrings": [ - "`headOrThrow(list)` same as [`head`](#head).\n\n## Examples\n\n```rescript\nList.headOrThrow(list{1, 2, 3}) == 1\n\nswitch List.headOrThrow(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let headOrThrow: list<'a> => 'a" - }, - { - "id": "Stdlib.List.tail", - "kind": "value", - "name": "tail", - "docstrings": [ - "`tail(list)` returns `None` if `list` is empty, otherwise it returns `Some(tail)`\nwhere `tail` is everything except the first element of `list`.\n\n## Examples\n\n```rescript\nList.tail(list{1, 2, 3}) == Some(list{2, 3})\n\nList.tail(list{}) == None\n```" - ], - "signature": "let tail: list<'a> => option>" - }, - { - "id": "Stdlib.List.tailExn", - "kind": "value", - "name": "tailExn", - "docstrings": [ - "`tailExn(list)` same as [`tail`](#tail).\n\n## Examples\n\n```rescript\nList.tailExn(list{1, 2, 3}) == list{2, 3}\n\nswitch List.tailExn(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let tailExn: list<'a> => list<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.List.tailOrThrow", - "kind": "value", - "name": "tailOrThrow", - "docstrings": [ - "`tailOrThrow(list)` same as [`tail`](#tail).\n\n## Examples\n\n```rescript\nList.tailOrThrow(list{1, 2, 3}) == list{2, 3}\n\nswitch List.tailOrThrow(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let tailOrThrow: list<'a> => list<'a>" - }, - { - "id": "Stdlib.List.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(list, value)` adds a `value` to the beginning of list `list`.\n\n## Examples\n\n```rescript\nList.add(list{2, 3}, 1) == list{1, 2, 3}\n\nList.add(list{\"World\", \"!\"}, \"Hello\") == list{\"Hello\", \"World\", \"!\"}\n```" - ], - "signature": "let add: (list<'a>, 'a) => list<'a>" - }, - { - "id": "Stdlib.List.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(list, index)` return the `index` element in `list`, or `None` if `index`\nis larger than the length of list `list`.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.get(1) == Some(\"B\")\n\nabc->List.get(4) == None\n```" - ], - "signature": "let get: (list<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.List.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(list, index)` same as [`get`](#get).\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.getExn(1) == \"B\"\n\nswitch abc->List.getExn(4) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if `index` is larger than the length of list." - ], - "signature": "let getExn: (list<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.List.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(list, index)` same as [`get`](#get).\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.getOrThrow(1) == \"B\"\n\nswitch abc->List.getOrThrow(4) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if `index` is larger than the length of list." - ], - "signature": "let getOrThrow: (list<'a>, int) => 'a" - }, - { - "id": "Stdlib.List.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(length, value)` returns a list of length `length` with each element filled\nwith `value`. Returns an empty list if `value` is negative.\n\n## Examples\n\n```rescript\nList.make(~length=3, 1) == list{1, 1, 1}\n```" - ], - "signature": "let make: (~length: int, 'a) => list<'a>" - }, - { - "id": "Stdlib.List.fromInitializer", - "kind": "value", - "name": "fromInitializer", - "docstrings": [ - "`fromInitializer(length, f)` return a list of length `length` with element initialized\nwith `f`. Returns an empty list if `length` is negative.\n\n## Examples\n\n```rescript\nList.fromInitializer(~length=5, i => i) == list{0, 1, 2, 3, 4}\n\nList.fromInitializer(~length=5, i => i * i) == list{0, 1, 4, 9, 16}\n```" - ], - "signature": "let fromInitializer: (~length: int, int => 'a) => list<'a>" - }, - { - "id": "Stdlib.List.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "`shuffle(list)` returns a new list in random order.\n\n## Examples\n\n```rescript\nList.shuffle(list{1, 2, 3}) // list{2, 1, 3}\n```" - ], - "signature": "let shuffle: list<'a> => list<'a>" - }, - { - "id": "Stdlib.List.toShuffled", - "kind": "value", - "name": "toShuffled", - "docstrings": [ - "`toShuffled(list)` returns a new list in random order.\n\n## Examples\n\n```rescript\nList.toShuffled(list{1, 2, 3}) // list{2, 1, 3}\n```" - ], - "signature": "let toShuffled: list<'a> => list<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.List.drop", - "kind": "value", - "name": "drop", - "docstrings": [ - "`drop(list, value)` return a new list, dropping the first `value` element.\nReturns `None` if `list` has fewer than `value` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.drop(2) == Some(list{3})\n\nlist{1, 2, 3}->List.drop(3) == Some(list{})\n\nlist{1, 2, 3}->List.drop(4) == None\n```" - ], - "signature": "let drop: (list<'a>, int) => option>" - }, - { - "id": "Stdlib.List.take", - "kind": "value", - "name": "take", - "docstrings": [ - "`take(list, value)` returns a list with the first `value` elements from `list`,\nor `None` if `list` has fewer than `value` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.take(1) == Some(list{1})\n\nlist{1, 2, 3}->List.take(2) == Some(list{1, 2})\n\nlist{1, 2, 3}->List.take(4) == None\n```" - ], - "signature": "let take: (list<'a>, int) => option>" - }, - { - "id": "Stdlib.List.splitAt", - "kind": "value", - "name": "splitAt", - "docstrings": [ - "`splitAt(list, n)` split the list `list` at `n`. Returns `None` when the length\nof `list` is less than `n`.\n\n## Examples\n\n```rescript\nlist{\"Hello\", \"World\"}->List.splitAt(1) == Some((list{\"Hello\"}, list{\"World\"}))\n\nlist{0, 1, 2, 3, 4}->List.splitAt(2) == Some((list{0, 1}, list{2, 3, 4}))\n```" - ], - "signature": "let splitAt: (list<'a>, int) => option<(list<'a>, list<'a>)>" - }, - { - "id": "Stdlib.List.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(list1, list2)` returns the list obtained by adding `list2` after `list1`.\n\n## Examples\n\n```rescript\nList.concat(list{1, 2, 3}, list{4, 5}) == list{1, 2, 3, 4, 5}\n```" - ], - "signature": "let concat: (list<'a>, list<'a>) => list<'a>" - }, - { - "id": "Stdlib.List.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(arr)` returns the list obtained by concatenating all the lists in\narray `arr`, in order.\n\n## Examples\n\n```rescript\nList.concatMany([list{1, 2, 3}, list{}, list{3}]) == list{1, 2, 3, 3}\n```" - ], - "signature": "let concatMany: array> => list<'a>" - }, - { - "id": "Stdlib.List.reverseConcat", - "kind": "value", - "name": "reverseConcat", - "docstrings": [ - "`reverseConcat(list1, list2)` is equivalent to writing: `concat(reverse(list1, list2)`\n\n## Examples\n\n```rescript\nList.reverseConcat(list{1, 2}, list{3, 4}) == list{2, 1, 3, 4}\n```" - ], - "signature": "let reverseConcat: (list<'a>, list<'a>) => list<'a>" - }, - { - "id": "Stdlib.List.flat", - "kind": "value", - "name": "flat", - "docstrings": [ - "`flat(list)` return the list obtained by concatenating all the lists in\n`list`, in order.\n\n## Examples\n\n```rescript\nList.flat(list{list{1, 2, 3}, list{}, list{3}}) == list{1, 2, 3, 3}\n```" - ], - "signature": "let flat: list> => list<'a>" - }, - { - "id": "Stdlib.List.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nlist{1, 2}->List.map(x => x + 1) == list{2, 3}\n```" - ], - "signature": "let map: (list<'a>, 'a => 'b) => list<'b>" - }, - { - "id": "Stdlib.List.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "`zip(list1, list2)` returns a list of pairs from the two lists with the length\nof the shorter list.\n\n## Examples\n\n```rescript\nList.zip(list{1, 2}, list{3, 4, 5}) == list{(1, 3), (2, 4)}\n```" - ], - "signature": "let zip: (list<'a>, list<'b>) => list<('a, 'b)>" - }, - { - "id": "Stdlib.List.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "`zipBy(list1, list2, f)`. See [`zip`](#zip)\n\n## Examples\n\n```rescript\nList.zipBy(list{1, 2, 3}, list{4, 5}, (a, b) => 2 * a + b) == list{6, 9}\n```" - ], - "signature": "let zipBy: (list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>" - }, - { - "id": "Stdlib.List.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(list, f)` applies `f` to each element of `list`. Function `f`\ntakes two arguments: the index starting from 0 and the element from `list`, in\nthat order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.mapWithIndex((x, index) => index + x) == list{1, 3, 5}\n```" - ], - "signature": "let mapWithIndex: (list<'a>, ('a, int) => 'b) => list<'b>" - }, - { - "id": "Stdlib.List.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(arr)` converts the given array `arr` to a list.\n\n## Examples\n\n```rescript\nList.fromArray([1, 2, 3]) == list{1, 2, 3}\n```" - ], - "signature": "let fromArray: array<'a> => list<'a>" - }, - { - "id": "Stdlib.List.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(list)` converts the given list `list` to an array.\n\n## Examples\n\n```rescript\nList.toArray(list{1, 2, 3}) == [1, 2, 3]\n```" - ], - "signature": "let toArray: list<'a> => array<'a>" - }, - { - "id": "Stdlib.List.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(list)` returns a new list whose elements are those of `list` in\nreversed order.\n\n## Examples\n\n```rescript\nList.reverse(list{1, 2, 3}) == list{3, 2, 1}\n```" - ], - "signature": "let reverse: list<'a> => list<'a>" - }, - { - "id": "Stdlib.List.mapReverse", - "kind": "value", - "name": "mapReverse", - "docstrings": [ - "`mapReverse(list, f)` is equivalent to `map` function.\n\n## Examples\n\n```rescript\nlet f = x => x * x\nlet l = list{3, 4, 5}\n\nlet withMap = List.map(l, f)->List.reverse\nlet withMapReverse = l->List.mapReverse(f)\n\nConsole.log(withMap == withMapReverse) // true\n```" - ], - "signature": "let mapReverse: (list<'a>, 'a => 'b) => list<'b>" - }, - { - "id": "Stdlib.List.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(list, f)` call `f` on each element of `list` from the beginning to end.\n`f` returns `unit`, so no new array is created. Use `forEach` when you are primarily\nconcerned with repetitively creating side effects.\n\n## Examples\n\n```rescript\nList.forEach(list{\"a\", \"b\", \"c\"}, x => Console.log(\"Item: \" ++ x))\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\n```" - ], - "signature": "let forEach: (list<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.List.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(list, f, index)` call `f` on each element of `list` from beginning\nto end. Function `f` takes two arguments: the `index` starting from 0 and the\nelement from `list`. `f` returns `unit`.\n\n## Examples\n\n```rescript\nList.forEachWithIndex(list{\"a\", \"b\", \"c\"}, (x, index) => {\n Console.log(\"Item \" ++ Int.toString(index) ++ \" is \" ++ x)\n})\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\n```" - ], - "signature": "let forEachWithIndex: (list<'a>, ('a, int) => unit) => unit" - }, - { - "id": "Stdlib.List.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(list, initialValue, f)` applies `f` to each element of `list` from\nbeginning to end. Function `f` has two parameters: the item from the list and\nan \"accumulator\", which starts with a value of `initialValue`. `reduce` returns\nthe final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduce(0, (a, b) => a + b) == 10\n\n// same as\n\nlist{1, 2, 3, 4}->List.reduce(0, (acc, item) => acc + item) == 10\n```" - ], - "signature": "let reduce: (list<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.List.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(list, initialValue, f)` applies `f` to each element of `list`\nfrom beginning to end. Function `f` has three parameters: the item from the list\nand an \"accumulator\", which starts with a value of `initialValue` and the index\nof each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduceWithIndex(0, (acc, item, index) => acc + item + index) == 16\n```" - ], - "signature": "let reduceWithIndex: (list<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Stdlib.List.reduceReverse", - "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "`reduceReverse(list, initialValue, f)` works like `reduce`, except that\nfunction `f` is applied to each item of `list` from the last back to the first.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduceReverse(0, (a, b) => a + b) == 10\n\nlist{1, 2, 3, 4}->List.reduceReverse(10, (a, b) => a - b) == 0\n\nlist{1, 2, 3, 4}->List.reduceReverse(list{}, List.add) == list{1, 2, 3, 4}\n```" - ], - "signature": "let reduceReverse: (list<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.List.mapReverse2", - "kind": "value", - "name": "mapReverse2", - "docstrings": [ - "`mapReverse2(list1, list2, f)` is equivalent to `List.zipBy(list1, list2, f)->List.reverse`.\n\n## Examples\n\n```rescript\nList.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) == list{4, 2}\n```" - ], - "signature": "let mapReverse2: (list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>" - }, - { - "id": "Stdlib.List.forEach2", - "kind": "value", - "name": "forEach2", - "docstrings": [ - "`forEach2(list1, list2, f)` is similar to `forEach`, but accepts two lists and\nstops at the length of the shorter list.\n\n## Examples\n\n```rescript\nList.forEach2(list{\"Z\", \"Y\"}, list{\"A\", \"B\", \"C\"}, (x, y) => Console.log2(x, y))\n\n/*\n prints:\n \"Z\" \"A\"\n \"Y\" \"B\"\n*/\n```" - ], - "signature": "let forEach2: (list<'a>, list<'b>, ('a, 'b) => 'c) => unit" - }, - { - "id": "Stdlib.List.reduce2", - "kind": "value", - "name": "reduce2", - "docstrings": [ - "`reduce2(list1, list2, initialValue, f)` applies `f` to each element of `list1`\nand `list2` from beginning to end. Stops with the shorter list. Function `f` has\nthree parameters: an accumulator which starts with a value of `initialValue`, an\nitem from `l1`, and an item from `l2`. `reduce2` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nList.reduce2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduce2: (list<'b>, list<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a" - }, - { - "id": "Stdlib.List.reduceReverse2", - "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "`reduceReverse2(list1, list2, initialValue, f)` applies `f` to each element of\n`list1` and `list2`from end to beginning. Stops with the shorter list. Function\n`f` has three parameters: an accumulator which starts with a value of\n`initialValue`, an item from `l1`, and an item from `l2`. `reduce2` returns the\nfinal value of the accumulator.\n\n## Examples\n\n```rescript\nList.reduceReverse2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduceReverse2: (list<'a>, list<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" - }, - { - "id": "Stdlib.List.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(list, f)` returns `true` if all elements in `list` satisfy `f`, where `f`\nis a predicate: a function taking an element and returning a bool.\n\n## Examples\n\n```rescript\nlet isBelow10 = value => value < 10\n\nlist{1, 9, 8, 2}->List.every(isBelow10) == true\n\nlist{1, 99, 8, 2}->List.every(isBelow10) == false\n```" - ], - "signature": "let every: (list<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.List.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(list, f)` returns `true` if at least _one_ of the elements in `list`\nsatisfies `f`, where `f` is a predicate: a function taking an element and\nreturning a bool.\n\n## Examples\n\n```rescript\nlet isAbove100 = value => value > 100\n\nlist{101, 1, 2, 3}->List.some(isAbove100) == true\n\nlist{1, 2, 3, 4}->List.some(isAbove100) == false\n```" - ], - "signature": "let some: (list<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.List.every2", - "kind": "value", - "name": "every2", - "docstrings": [ - "`every2(list1, list2, f)` returns `true` if predicate `f` is `true` for all\npairs of elements up to the shorter length (i.e. `min(length(list1), length(list2))`)\n\n## Examples\n\n```rescript\nList.every2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nList.every2(list{}, list{1}, (a, b) => a > b) == true\n\nList.every2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nList.every2(list{0, 1}, list{5, 0}, (a, b) => a > b) == false\n```" - ], - "signature": "let every2: (list<'a>, list<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.List.some2", - "kind": "value", - "name": "some2", - "docstrings": [ - "`some2(list1, list2, f)` returns `true` if predicate `f` is `true` for any pair\nof elements up to the shorter length (i.e. `min(length(list1), length(list2))`)\n\n## Examples\n\n```rescript\nList.some2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nList.some2(list{}, list{1}, (a, b) => a > b) == false\n\nList.some2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nList.some2(list{0, 1}, list{5, 0}, (a, b) => a > b) == true\n```" - ], - "signature": "let some2: (list<'a>, list<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.List.compareLength", - "kind": "value", - "name": "compareLength", - "docstrings": [ - "`compareLength(list1, list2)` compare two lists solely by length. Returns `-1.` if\n`length(list1)` is less than `length(list2)`, `0.` if `length(list1)` equals\n`length(list2)`, and `1.` if `length(list1)` is greater than `length(list2)`.\n\n## Examples\n\n```rescript\nList.compareLength(list{1, 2}, list{3, 4, 5, 6}) == -1.\n\nList.compareLength(list{1, 2, 3}, list{4, 5, 6}) == 0.\n\nList.compareLength(list{1, 2, 3, 4}, list{5, 6}) == 1.\n```" - ], - "signature": "let compareLength: (list<'a>, list<'a>) => Ordering.t" - }, - { - "id": "Stdlib.List.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(list1, list2, f)` compare elements one by one `f`. `f` returns a negative\nnumber if `list1` is \"less than\" `list2`, zero if `list1` is \"equal to\" `list2`,\na positive number if `list1` is \"greater than\" `list2`.\n\nThe comparison returns the first non-zero result of `f`, or zero if `f` returns\nzero for all `list1` and `list2`.\n\n- If all items have compared equal, but `list1` is exhausted first, return `-1.`. (`list1` is shorter).\n- If all items have compared equal, but `list2` is exhausted first, return `1.` (`list1` is longer).\n\n## Examples\n\n```rescript\nList.compare(list{3}, list{3, 7}, (a, b) => Int.compare(a, b)) == -1.\nList.compare(list{5, 3}, list{5}, (a, b) => Int.compare(a, b)) == 1.\nList.compare(list{1, 3, 5}, list{1, 4, 2}, (a, b) => Int.compare(a, b)) == -1.\nList.compare(list{1, 3, 5}, list{1, 2, 3}, (a, b) => Int.compare(a, b)) == 1.\nList.compare(list{1, 3, 5}, list{1, 3, 5}, (a, b) => Int.compare(a, b)) == 0.\n```\n\n**Please note:** The total ordering of List is different from Array,\nfor Array, we compare the length first and, only if the lengths are equal, elements one by one.\nFor lists, we just compare elements one by one." - ], - "signature": "let compare: (list<'a>, list<'a>, ('a, 'a) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.List.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(list1, list2, f)` check equality of `list2` and `list2` using `f` for\nequality on elements, where `f` is a function that returns `true` if items `x` and\n`y` meet some criterion for equality, `false` otherwise. equal `false` if length\nof `list1` and `list2` are not the same.\n\n## Examples\n\n```rescript\nList.equal(list{1, 2, 3}, list{1, 2}, (a, b) => a == b) == false\n\nList.equal(list{1, 2}, list{1, 2}, (a, b) => a == b) == true\n\nList.equal(list{1, 2, 3}, list{-1, -2, -3}, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let equal: (list<'a>, list<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Stdlib.List.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(list, element, f)` returns `true` if the list contains at least one\n`element` for which `f` returns \\`true'.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.has(2, (a, b) => a == b) == true\n\nlist{1, 2, 3}->List.has(4, (a, b) => a == b) == false\n\nlist{-1, -2, -3}->List.has(2, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let has: (list<'a>, 'b, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.List.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(list, f)` returns `Some(value)` for the first value in `list` that\nsatisfies the predicate function `f`. Returns `None` if no element satisfies\nthe function.\n\n## Examples\n\n```rescript\nList.find(list{1, 4, 3, 2}, x => x > 3) == Some(4)\n\nList.find(list{1, 4, 3, 2}, x => x > 4) == None\n```" - ], - "signature": "let find: (list<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.List.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(list, f)` returns a list of all elements in `list` which satisfy the\npredicate function `f`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nList.filter(list{1, 2, 3, 4}, isEven) == list{2, 4}\n\nList.filter(list{None, Some(2), Some(3), None}, Option.isSome) == list{Some(2), Some(3)}\n```" - ], - "signature": "let filter: (list<'a>, 'a => bool) => list<'a>" - }, - { - "id": "Stdlib.List.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(list, f)` returns a list of all elements in `list` which\nsatisfy the predicate function `f`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nList.filterWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) == list{1, 3}\n```" - ], - "signature": "let filterWithIndex: (list<'a>, ('a, int) => bool) => list<'a>" - }, - { - "id": "Stdlib.List.filterMap", - "kind": "value", - "name": "filterMap", - "docstrings": [ - "`filterMap(list, f)` applies `f` to each element of `list`. If `f` returns\n`Some(value)`, then `value` is _kept_ in the resulting list. If `f` returns\n`None`, the element is _not_ retained in the result.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nlist{1, 2, 3, 4}->List.filterMap(x =>\n if isEven(x) {\n Some(x)\n } else {\n None\n }\n) // list{2, 4}\n\nlist{Some(1), Some(2), None}->List.filterMap(x => x) == list{1, 2}\n```" - ], - "signature": "let filterMap: (list<'a>, 'a => option<'b>) => list<'b>" - }, - { - "id": "Stdlib.List.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(list, f)` creates a pair of lists; the first list consists of all\nelements of `list` that satisfy the predicate function `f`, the second list\nconsists of all elements of `list` that _do not_ satisfy `f`.\n\n## Examples\n\n```rescript\n// (elementsThatSatisfies, elementsThatDoesNotSatisfy)\n\nList.partition(list{1, 2, 3, 4}, x => x > 2) == (list{3, 4}, list{1, 2})\n```" - ], - "signature": "let partition: (list<'a>, 'a => bool) => (list<'a>, list<'a>)" - }, - { - "id": "Stdlib.List.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "`unzip(list)` takes a list of pairs and creates a pair of lists. The first list\ncontains all the first items of the pairs, the second list contains all the\nsecond items.\n\n## Examples\n\n```rescript\nList.unzip(list{(1, 2), (3, 4)}) // (list{1, 3}, list{2, 4})\n\nList.unzip(list{(\"H\", \"W\"), (\"e\", \"o\"), (\"l\", \"r\"), (\"l\", \"l\"), (\"o\", \"d\"), (\" \", \"!\")}) ==\n (list{\"H\", \"e\", \"l\", \"l\", \"o\", \" \"}, list{\"W\", \"o\", \"r\", \"l\", \"d\", \"!\"})\n```" - ], - "signature": "let unzip: list<('a, 'b)> => (list<'a>, list<'b>)" - }, - { - "id": "Stdlib.List.getAssoc", - "kind": "value", - "name": "getAssoc", - "docstrings": [ - "`getAssoc(list, k, f)` return the second element of a pair in `list` where\nthe first element equals `k` as per the predicate function `f`, or `None` if\nnot found.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.getAssoc(3, (a, b) => a == b) // Some(\"c\")\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->List.getAssoc(15, (k, item) =>\n k /* 15 */ == item\n) == Some(\"afternoon\")\n/* 9, 5, 22 */\n```" - ], - "signature": "let getAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.hasAssoc", - "kind": "value", - "name": "hasAssoc", - "docstrings": [ - "`hasAssoc(list, k, f)` returns `true` if there is a pair in `list` where the\nfirst element equals `k` as per the predicate function `f`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.hasAssoc(1, (a, b) => a == b) // true\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->List.hasAssoc(25, (k, item) =>\n k /* 25 */ == item\n) == false\n/* 9, 5, 22 */\n```" - ], - "signature": "let hasAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => bool", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.removeAssoc", - "kind": "value", - "name": "removeAssoc", - "docstrings": [ - "`removeAssoc(list, k, f)` return a list after removing the first pair whose\nfirst value is `k` per the equality predicate `f`, if not found, return a new\nlist identical to `list`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.removeAssoc(1, (a, b) => a == b) // list{(2, \"b\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->List.removeAssoc(9, (k, item) =>\n k /* 9 */ == item\n) == list{(15, \"afternoon\"), (22, \"night\")}\n/* 9, 5, 22 */\n```" - ], - "signature": "let removeAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => list<('a, 'c)>", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.setAssoc", - "kind": "value", - "name": "setAssoc", - "docstrings": [ - "`setAssoc(list, k, v, f)`. If `k` exists in `list` by satisfying the `f`\npredicate, return a new list with the key and value replaced by the new `k` and\n`v`, otherwise, return a new list with the pair `k`, `v` added to the head of\n`list`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.setAssoc(2, \"x\", (a, b) => a == b) ==\n list{(1, \"a\"), (2, \"x\"), (3, \"c\")}\n\nlist{(1, \"a\"), (3, \"c\")}->List.setAssoc(2, \"b\", (a, b) => a == b) ==\n list{(2, \"b\"), (1, \"a\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (3, \"morning?!\"), (22, \"night\")}->List.setAssoc(15, \"afternoon\", (a, b) =>\n mod(a, 12) == mod(b, 12)\n) == list{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n```\n\n**Please note**: In the last example, since: `15 mod 12` equals `3 mod 12`. Both\nthe key _and_ the value are replaced in the list." - ], - "signature": "let setAssoc: (list<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => list<('a, 'c)>", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(list, f)` returns a sorted list.\n\n## Examples\n\n```rescript\nList.sort(list{5, 4, 9, 3, 7}, Int.compare) == list{3, 4, 5, 7, 9}\n```" - ], - "signature": "let sort: (list<'a>, ('a, 'a) => Ordering.t) => list<'a>" - }, - { - "id": "Stdlib.List.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(list)` ignores the provided list and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: list<'a> => unit" - } - ] - }, - "stdlib/lazy": { - "id": "Stdlib.Lazy", - "name": "Lazy", - "docstrings": [ - "This module provides a type `Lazy.t` and functions to create and\n manipulate lazy values. A lazy value is a value that is not\n computed until it is needed. This is useful for deferring\n computations that may be expensive or unnecessary." - ], - "items": [ - { - "id": "Stdlib.Lazy.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of a lazy value. `Lazy.t<'a>` represents a lazy value\n that will eventually yield a value of type `'a` when accessed.\n The value is computed only once, and the result is cached for\n subsequent accesses. If the computation throws an exception,\n the same exception is thrown again on subsequent accesses." - ], - "signature": "type t<+'a>" - }, - { - "id": "Stdlib.Lazy.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`Lazy.make(f)` creates a lazy value from `f` which is the\n computation to be deferred of type `unit => 'a`. \n The function returns a lazy value of type `Lazy.t<'a>`. \n The computation is not executed until the lazy value is accessed.\n\n ## Examples \n ```rescript \n let lazyValue = Lazy.make(() => {\n // Some expensive computation\n Console.log(\"Computing...\")\n 42\n });\n lazyValue->Lazy.get->assertEqual(42)\n ```" - ], - "signature": "let make: (unit => 'a) => t<'a>" - }, - { - "id": "Stdlib.Lazy.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`Lazy.get(x)` forces the suspension `x` and returns its result.\n If `x` has already been forced, `Lazy.get(x)` returns the\n same value again without recomputing it. If it threw an\n exception, the same exception is thrown again.\n Throw `Undefined` if the forcing of `x` tries to force `x` itself\n recursively. This is a runtime error." - ], - "signature": "let get: t<'a> => 'a" - }, - { - "id": "Stdlib.Lazy.isEvaluated", - "kind": "value", - "name": "isEvaluated", - "docstrings": [ - "`Lazy.isEvaluated(x)` returns `true` if the suspension `x` has\n already been forced and did not throw an exception. Otherwise, \n it returns `false`. This is useful for checking if a lazy value\n has been computed before accessing it.\n\n ## Examples\n ```rescript \n let lazyValue = Lazy.make(() => {\n // Some expensive computation\n Console.log(\"Computing...\")\n 42\n })\n Lazy.isEvaluated(lazyValue)->assertEqual(false)\n lazyValue->Lazy.get->assertEqual(42)\n lazyValue->Lazy.isEvaluated->assertEqual(true)\n ```" - ], - "signature": "let isEvaluated: t<'a> => bool" - }, - { - "id": "Stdlib.Lazy.force", - "kind": "value", - "name": "force", - "docstrings": [ - "`force(x)` forces the suspension `x` and returns its result.\n If `x` has already been forced, `Lazy.force(x)` returns the\n same value again without recomputing it. If it threw an exception,\n the same exception is thrown again.\n Throw `Undefined` if the forcing of `x` tries to force `x` itself\n recursively." - ], - "signature": "let force: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.force_val", - "kind": "value", - "name": "force_val", - "docstrings": [ - "`force_val(x)` forces the suspension `x` and returns its\n result. If `x` has already been forced, `force_val(x)`\n returns the same value again without recomputing it.\n Throw `Undefined` if the forcing of `x` tries to force `x` itself\n recursively.\n If the computation of `x` throws an exception, it is unspecified\n whether `force_val(x)` throws the same exception or `Undefined`." - ], - "signature": "let force_val: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.from_fun", - "kind": "value", - "name": "from_fun", - "docstrings": [ - "`Lazy.from_fun(f)` creates a lazy value from `f` which is the\n computation to be deferred of type `unit => 'a`. \n The function returns a lazy value of type `Lazy.t<'a>`. \n The computation is not executed until the lazy value is accessed." - ], - "signature": "let from_fun: (unit => 'a) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.from_val", - "kind": "value", - "name": "from_val", - "docstrings": [ - "`from_val(v)` returns an already-forced suspension of `v`.\n This is for special purposes only." - ], - "signature": "let from_val: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.is_val", - "kind": "value", - "name": "is_val", - "docstrings": [ - "`is_val(x)` returns `true` if `x has already been forced and\n did not throw an exception." - ], - "signature": "let is_val: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(lazyValue)` ignores the provided lazy value and returns unit.\n\n This helper is useful when you want to discard a lazy value (for example, when only its side effects matter)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/json": { - "id": "Stdlib.JSON", - "name": "JSON", - "docstrings": [ - "Functions for interacting with JSON." - ], - "items": [ - { - "id": "Stdlib.JSON.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a JSON object." - ], - "signature": "@unboxed\ntype t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)" - }, - { - "id": "Stdlib.JSON.replacer", - "kind": "type", - "name": "replacer", - "docstrings": [], - "signature": "@unboxed\ntype replacer =\n | Keys(array)\n | Replacer((string, t) => t)" - }, - { - "id": "Stdlib.JSON.parseOrThrow", - "kind": "value", - "name": "parseOrThrow", - "docstrings": [ - "`parseOrThrow(string, ~reviver=?)`\n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\ntry {\n let _ = JSON.parseOrThrow(`{\"foo\":\"bar\",\"hello\":\"world\"}`)\n // { foo: 'bar', hello: 'world' }\n\n let _ = JSON.parseOrThrow(\"\")\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\ntry {\n JSON.parseOrThrow(jsonString, ~reviver)->Console.log\n // { hello: 'WORLD', someNumber: 42 }\n\n JSON.parseOrThrow(\"\", ~reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions\n\n- Throws a SyntaxError (Exn.t) if the string isn't valid JSON." - ], - "signature": "let parseOrThrow: (string, ~reviver: (string, t) => t=?) => t" - }, - { - "id": "Stdlib.JSON.parseExn", - "kind": "value", - "name": "parseExn", - "docstrings": [ - "`parseExn(string, ~reviver=?)`\n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\ntry {\n let _ = JSON.parseExn(`{\"foo\":\"bar\",\"hello\":\"world\"}`)\n // { foo: 'bar', hello: 'world' }\n\n let _ = JSON.parseExn(\"\")\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\ntry {\n JSON.parseExn(jsonString, ~reviver)->Console.log\n // { hello: 'WORLD', someNumber: 42 }\n\n JSON.parseExn(\"\", ~reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions\n\n- Throws a SyntaxError (Exn.t) if the string isn't valid JSON." - ], - "signature": "let parseExn: (string, ~reviver: (string, t) => t=?) => t", - "deprecated": "Use `parseOrThrow` instead" - }, - { - "id": "Stdlib.JSON.parseExnWithReviver", - "kind": "value", - "name": "parseExnWithReviver", - "docstrings": [ - "`parseExnWithReviver(string, reviver)`\n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\nJSON.parseExnWithReviver(jsonString, reviver)->Console.log\n// { hello: 'WORLD', someNumber: 42 }\n\ntry {\n JSON.parseExnWithReviver(\"\", reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions\n\n- Throws a SyntaxError if the string is not a valid JSON." - ], - "signature": "let parseExnWithReviver: (string, (string, t) => t) => t", - "deprecated": "Use `parseOrThrow` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringify", - "kind": "value", - "name": "stringify", - "docstrings": [ - "`stringify(json, ~replacer=?, ~space=?)`\n\nConverts a JSON object to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value,\nor an array of keys which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAny` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringify(json)\n// {\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}\n\nJSON.stringify(json, ~space=2)\n// {\n// \"foo\": \"bar\",\n// \"hello\": \"world\",\n// \"someNumber\": 42\n// }\n\nJSON.stringify(json, ~replacer=Keys([\"foo\", \"someNumber\"]))\n// {\"foo\":\"bar\",\"someNumber\":42}\n\nlet replacer = JSON.Replacer(\n (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n },\n)\n\nJSON.stringify(json, ~replacer)\n// {\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}\n```" - ], - "signature": "let stringify: (t, ~replacer: replacer=?, ~space: int=?) => string" - }, - { - "id": "Stdlib.JSON.stringifyWithIndent", - "kind": "value", - "name": "stringifyWithIndent", - "docstrings": [ - "`stringifyWithIndent(json, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nIf you want to stringify any type, use `JSON.stringifyAnyWithIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithIndent(json, 2)\n// {\n// \"foo\": \"bar\",\n// \"hello\": \"world\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithIndent: (t, int) => string", - "deprecated": "Use `stringify` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyWithReplacer", - "kind": "value", - "name": "stringifyWithReplacer", - "docstrings": [ - "`stringifyWithReplacer(json, replacer)`\n\nConverts a JSON object to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nIf you want to stringify any type, use `JSON.stringifyAnyWithReplacer` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\nJSON.stringifyWithReplacer(json, replacer)\n// {\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}\n```" - ], - "signature": "let stringifyWithReplacer: (t, (string, t) => t) => string", - "deprecated": "Use `stringify` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyWithReplacerAndIndent", - "kind": "value", - "name": "stringifyWithReplacerAndIndent", - "docstrings": [ - "`stringifyWithReplacerAndIndent(json, replacer, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nIf you want to stringify any type, use `JSON.stringifyAnyWithReplacerAndIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\nJSON.stringifyWithReplacerAndIndent(json, replacer, 2)\n// {\n// \"foo\": \"BAR\",\n// \"hello\": \"WORLD\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithReplacerAndIndent: (t, (string, t) => t, int) => string", - "deprecated": "Use `stringify` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.stringifyWithFilter", - "kind": "value", - "name": "stringifyWithFilter", - "docstrings": [ - "`stringifyWithFilter(json, filter)`\n\nConverts a JSON object to a JSON string.\nThe filter is an array of keys, which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAnyWithFilter` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithFilter(json, [\"foo\", \"someNumber\"])\n// {\"foo\":\"bar\",\"someNumber\":42}\n```" - ], - "signature": "let stringifyWithFilter: (t, array) => string", - "deprecated": "Use `stringify` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyWithFilterAndIndent", - "kind": "value", - "name": "stringifyWithFilterAndIndent", - "docstrings": [ - "`stringifyWithFilterAndIndent(json, filter, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nThe filter is an array of keys, which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAnyWithFilterAndIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithFilterAndIndent(json, [\"foo\", \"someNumber\"], 2)\n// {\n// \"foo\": \"bar\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithFilterAndIndent: (t, array, int) => string", - "deprecated": "Use `stringify` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.stringifyAny", - "kind": "value", - "name": "stringifyAny", - "docstrings": [ - "`stringifyAny(any, ~replacer=?, ~space=?)`\n\nConverts any type to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringify` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAny\n->Option.getUnsafe == `{\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}`\n\ndict\n->JSON.stringifyAny(~space=2)\n->Option.getUnsafe == `{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`\n\ndict\n->JSON.stringifyAny(~replacer=Keys([\"foo\", \"someNumber\"]))\n->Option.getUnsafe == `{\"foo\":\"bar\",\"someNumber\":42}`\n\nlet replacer = JSON.Replacer(\n (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n },\n)\n\ndict\n->JSON.stringifyAny(~replacer)\n->Option.getUnsafe == `{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\n// Throw a exception\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAny: ('a, ~replacer: replacer=?, ~space: int=?) => option" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithIndent", - "kind": "value", - "name": "stringifyAnyWithIndent", - "docstrings": [ - "`stringifyAnyWithIndent(any, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAnyWithIndent(2)\n->Option.getUnsafe == `{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithIndent: ('a, int) => option", - "deprecated": "Use `stringifyAny` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithReplacer", - "kind": "value", - "name": "stringifyAnyWithReplacer", - "docstrings": [ - "`stringifyAnyWithReplacer(json, replacer)`\n\nConverts any type to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithReplacer` instead.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\ndict\n->JSON.stringifyAnyWithReplacer(replacer)\n->Option.getUnsafe == `{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithReplacer: ('a, (string, t) => t) => option", - "deprecated": "Use `stringifyAny` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithReplacerAndIndent", - "kind": "value", - "name": "stringifyAnyWithReplacerAndIndent", - "docstrings": [ - "`stringifyAnyWithReplacerAndIndent(json, replacer, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithReplacerAndIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\ndict\n->JSON.stringifyAnyWithReplacer(replacer)\n->Option.getUnsafe == `{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithReplacerAndIndent: ('a, (string, t) => t, int) => option", - "deprecated": "Use `stringifyAny` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithFilter", - "kind": "value", - "name": "stringifyAnyWithFilter", - "docstrings": [ - "`stringifyAnyWithFilter(json, filter)`\n\nConverts any type to a JSON string.\nThe filter is an array of keys, which should be included in the output.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithFilter` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict->JSON.stringifyAnyWithFilter([\"foo\", \"someNumber\"]) == `{\"foo\":\"bar\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithFilter: ('a, array) => string", - "deprecated": "Use `stringifyAny` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithFilterAndIndent", - "kind": "value", - "name": "stringifyAnyWithFilterAndIndent", - "docstrings": [ - "`stringifyAnyWithFilterAndIndent(json, filter, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nThe filter is an array of keys, which should be included in the output.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithFilterAndIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAny\n->Option.getUnsafe == `{\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}`\n\ndict\n->JSON.stringifyAny(~space=2)\n->Option.getUnsafe == `{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`\n\ndict\n->JSON.stringifyAny(~replacer=Keys([\"foo\", \"someNumber\"]))\n->Option.getUnsafe == `{\"foo\":\"bar\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithFilterAndIndent: ('a, array, int) => string", - "deprecated": "Use `stringifyAny` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(json)` ignores the provided json and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/jsexn": { - "id": "Stdlib.JsExn", - "name": "JsExn", - "docstrings": [ - "Provide utilities for dealing with JS exceptions.\n\nJS exceptions can be of any type, even though they *should* be of type `Error` of one of its subclasses.\n\nSee [`throw`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/throw) on MDN." - ], - "items": [ - { - "id": "Stdlib.JsExn.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JS exception" - ], - "signature": "type t = unknown" - }, - { - "id": "Stdlib.JsExn.fromException", - "kind": "value", - "name": "fromException", - "docstrings": [], - "signature": "let fromException: exn => option" - }, - { - "id": "Stdlib.JsExn.anyToExnInternal", - "kind": "value", - "name": "anyToExnInternal", - "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a JsExn if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." - ], - "signature": "let anyToExnInternal: 'a => exn" - }, - { - "id": "Stdlib.JsExn.stack", - "kind": "value", - "name": "stack", - "docstrings": [ - "`stack(jsExn)` retrieves the `stack` property of the exception, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\ntry {JsError.make(\"error\")->JsError.throw} catch {\n| JsExn(e) => Console.log(JsExn.stack(e)) // Logs `stack`\n| _ => assert(false)\n}\n```" - ], - "signature": "let stack: t => option" - }, - { - "id": "Stdlib.JsExn.message", - "kind": "value", - "name": "message", - "docstrings": [ - "`message(error)` retrieves the `message` property of the error, if it exists.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\ntry {JsError.SyntaxError.throwWithMessage(\"Some message here\")} catch {\n| JsExn(e) => e->JsExn.message->Option.getExn == \"Some message here\"\n| _ => assert(false)\n}\n```" - ], - "signature": "let message: t => option" - }, - { - "id": "Stdlib.JsExn.name", - "kind": "value", - "name": "name", - "docstrings": [ - "`name(error)` retrieves the `name` property of the error, if it exists.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\ntry {JsError.SyntaxError.throwWithMessage(\"Some message here\")} catch {\n| JsExn(e) => e->JsExn.name->Option.getExn == \"SyntaxError\"\n| _ => assert(false)\n}\n```" - ], - "signature": "let name: t => option" - }, - { - "id": "Stdlib.JsExn.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [ - "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." - ], - "signature": "let fileName: t => option" - }, - { - "id": "Stdlib.JsExn.throw", - "kind": "value", - "name": "throw", - "docstrings": [ - "Throws the given value, terminating execution unless caught by a surrounding try/catch block.\n\nThis is meant to be used when a JS API is based on throwing values that are not of type `Error` or its subclasses." - ], - "signature": "let throw: 'a => 'b" - }, - { - "id": "Stdlib.JsExn.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(jsExn)` ignores the provided JS exception and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/jserror": { - "id": "Stdlib.JsError", - "name": "JsError", - "docstrings": [ - "Functions for working with JavaScript errors.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) on MDN." - ], - "items": [ - { - "id": "Stdlib.JsError.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JavaScript error." - ], - "signature": "type t" - }, - { - "id": "Stdlib.JsError.stack", - "kind": "value", - "name": "stack", - "docstrings": [ - "`stack(error)` retrieves the `stack` property of the error, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\nlet error = JsError.make(\"error\")\nConsole.log(error->JsError.stack) // Logs `stack` if it exists on `someError`\n```" - ], - "signature": "let stack: t => option" - }, - { - "id": "Stdlib.JsError.message", - "kind": "value", - "name": "message", - "docstrings": [ - "`message(error)` retrieves the `message` property of the error.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\nlet error = JsError.SyntaxError.make(\"Some message here\")\nerror->JsError.message == \"Some message here\"\n```" - ], - "signature": "let message: t => string" - }, - { - "id": "Stdlib.JsError.name", - "kind": "value", - "name": "name", - "docstrings": [ - "`name(error)` retrieves the `name` property of the error.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\nlet error = JsError.SyntaxError.make(\"Some message here\")\nerror->JsError.name == \"SyntaxError\"\n```" - ], - "signature": "let name: t => string" - }, - { - "id": "Stdlib.JsError.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [ - "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." - ], - "signature": "let fileName: t => option" - }, - { - "id": "Stdlib.JsError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(message)` creates a new error, setting its `message` to the provided value.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error) on MDN.\n\n## Example\n```rescript\nlet error = JsError.make(\"Some message here\")\nerror->JsError.message == \"Some message here\"\nerror->JsError.name == \"Error\"\n```" - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.throw", - "kind": "value", - "name": "throw", - "docstrings": [ - "Throws the given error, terminating execution unless caught by a surrounding try/catch block.\n\n## Examples\n\n```rescript\nlet error = JsError.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n JsError.throw(error)\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" - ], - "signature": "let throw: t => 'a" - }, - { - "id": "Stdlib.JsError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `Error` with the provided `message` and throws it.\n\n`JsError.throwWithMessage(\"message\")` is equivalent to `JsError.make(\"message\")->JsError.throw`." - ], - "signature": "let throwWithMessage: string => 'a" - }, - { - "id": "Stdlib.JsError.panic", - "kind": "value", - "name": "panic", - "docstrings": [ - "Throws a panic exception with the given message.\n\nA panic exception is a native JavaScript exception that is not intended to be caught and\nhandled. Compared to a ReScript exception this will give a better stack trace and\ndebugging experience.\n\n## Examples\n\n```rescript\ntry {\n JsError.panic(\"Uh oh. This was unexpected!\")\n} catch {\n| JsExn(obj) =>\n switch JsExn.message(obj) {\n | Some(m) => assert(m == \"Panic! Uh oh. This was unexpected!\")\n | None => assert(false)\n }\n| _ => assert(false)\n}\n```" - ], - "signature": "let panic: string => 'a" - }, - { - "id": "Stdlib.JsError.toJsExn", - "kind": "value", - "name": "toJsExn", - "docstrings": [ - "Casts a `JsError.t` to a `JsExn.t`. \n\nThis is useful when you want to compare a JS exception and a JS error." - ], - "signature": "let toJsExn: t => JsExn.t" - }, - { - "id": "Stdlib.JsError.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(error)` ignores the provided error and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl": { - "id": "Stdlib.Intl", - "name": "Intl", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.getCanonicalLocalesExn", - "kind": "value", - "name": "getCanonicalLocalesExn", - "docstrings": [ - "`getCanonicalLocalesExn(locale)` returns the canonical form of `locale`.\n\nThrows `RangeError` when the locale string is malformed.\n\nSee [`Intl.getCanonicalLocales`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales) on MDN.\n\n## Examples\n\n```rescript\nIntl.getCanonicalLocalesExn(\"EN-US\") == [\"en-US\"]\n```" - ], - "signature": "let getCanonicalLocalesExn: string => array" - }, - { - "id": "Stdlib.Intl.getCanonicalLocalesManyExn", - "kind": "value", - "name": "getCanonicalLocalesManyExn", - "docstrings": [ - "`getCanonicalLocalesManyExn(locales)` canonicalises every locale in `locales`.\n\nThrows `RangeError` when any locale string is malformed.\n\nSee [`Intl.getCanonicalLocales`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales) on MDN.\n\n## Examples\n\n```rescript\nIntl.getCanonicalLocalesManyExn([\"EN-US\", \"fr\"]) == [\"en-US\", \"fr\"]\n```" - ], - "signature": "let getCanonicalLocalesManyExn: array => array" - }, - { - "id": "Stdlib.Intl.supportedValuesOfExn", - "kind": "value", - "name": "supportedValuesOfExn", - "docstrings": [ - "`supportedValuesOfExn(key)` returns the list of values supported by the runtime for the feature identified by `key`.\n\nThrows `RangeError` when `key` is unsupported.\n\nSee [`Intl.supportedValuesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.supportedValuesOfExn(\"calendar\")->Array.includes(\"gregory\") == true\n```" - ], - "signature": "let supportedValuesOfExn: string => array" - } - ] - }, - "stdlib/int": { - "id": "Stdlib.Int", - "name": "Int", - "docstrings": [ - "Functions for interacting with JavaScript Number.\nSee: [`Number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)." - ], - "items": [ - { - "id": "Stdlib.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an int." - ], - "signature": "type t = int" - }, - { - "id": "Stdlib.Int.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (int, int) => bool" - }, - { - "id": "Stdlib.Int.compare", - "kind": "value", - "name": "compare", - "docstrings": [], - "signature": "let compare: (int, int) => Ordering.t" - }, - { - "id": "Stdlib.Int.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponential: (int, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Int.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponentialWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toFixed", - "kind": "value", - "name": "toFixed", - "docstrings": [ - "`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixed: (int, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Int.toFixedWithPrecision", - "kind": "value", - "name": "toFixedWithPrecision", - "docstrings": [ - "`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixedWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecision: (int, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Int.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecisionWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." - ], - "signature": "let toString: (int, ~radix: int=?) => string" - }, - { - "id": "Stdlib.Int.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." - ], - "signature": "let toStringWithRadix: (int, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```" - ], - "signature": "let toLocaleString: int => string" - }, - { - "id": "Stdlib.Int.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [ - "`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```" - ], - "signature": "let toFloat: int => float" - }, - { - "id": "Stdlib.Int.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "`fromFloat(n)` return an `int` representing the given value. The conversion is\ndone by truncating the decimal part.\n\n## Examples\n\n```rescript\nInt.fromFloat(2.0) == 2\nInt.fromFloat(1.999) == 1\nInt.fromFloat(1.5) == 1\nInt.fromFloat(0.9999) == 0\n```" - ], - "signature": "let fromFloat: float => int" - }, - { - "id": "Stdlib.Int.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(str, ~radix=?)` return an `option` representing the given value\n`str`. `~radix` specifies the radix base to use for the formatted number.\n\n## Examples\n\n```rescript\nInt.fromString(\"0\") == Some(0)\nInt.fromString(\"NaN\") == None\nInt.fromString(\"6\", ~radix=2) == None\n```" - ], - "signature": "let fromString: (string, ~radix: int=?) => option" - }, - { - "id": "Stdlib.Int.mod", - "kind": "value", - "name": "mod", - "docstrings": [ - "`mod(n1, n2)` calculates the modulo (remainder after division) of two integers.\n\n## Examples\n\n```rescript\nInt.mod(7, 4) == 3\n```" - ], - "signature": "let mod: (int, int) => int" - }, - { - "id": "Stdlib.Int.rangeOptions", - "kind": "type", - "name": "rangeOptions", - "docstrings": [ - "The options for `range`." - ], - "signature": "type rangeOptions = {step?: int, inclusive?: bool}" - }, - { - "id": "Stdlib.Int.range", - "kind": "value", - "name": "range", - "docstrings": [ - "`range(start, end, ~options=?)` returns an int array of the sequence of integers in the\nrange `[start, end)`. That is, including `start` but excluding `end`.\n\nIf `step` is not set and `start < end`, the sequence will be increasing in steps of 1.\n\nIf `step` is not set and `start > end`, the sequence will be decreasing in steps of -1.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nthrown as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.range(3, 6) == [3, 4, 5]\nInt.range(-3, -1) == [-3, -2]\nInt.range(3, 1) == [3, 2]\nInt.range(3, 7, ~options={step: 2}) == [3, 5]\nInt.range(3, 7, ~options={step: 2, inclusive: true}) == [3, 5, 7]\nInt.range(3, 6, ~options={step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`." - ], - "signature": "let range: (int, int, ~options: rangeOptions=?) => array" - }, - { - "id": "Stdlib.Int.rangeWithOptions", - "kind": "value", - "name": "rangeWithOptions", - "docstrings": [ - "`rangeWithOptions(start, end, options)` is like `range`, but with `step` and\n`inclusive` options configurable.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nraised as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.rangeWithOptions(3, 7, {step: 2}) == [3, 5]\nInt.rangeWithOptions(3, 7, {step: 2, inclusive: true}) == [3, 5, 7]\nInt.rangeWithOptions(3, 6, {step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`." - ], - "signature": "let rangeWithOptions: (int, int, rangeOptions) => array", - "deprecated": "" - }, - { - "id": "Stdlib.Int.clamp", - "kind": "value", - "name": "clamp", - "docstrings": [ - "`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nInt.clamp(42) == 42\nInt.clamp(42, ~min=50) == 50\nInt.clamp(42, ~max=40) == 40\nInt.clamp(42, ~min=50, ~max=40) == 50\n```" - ], - "signature": "let clamp: (~min: int=?, ~max: int=?, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseAnd", - "kind": "value", - "name": "bitwiseAnd", - "docstrings": [ - "`bitwiseAnd(n1, n2)` calculates the bitwise AND of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseAnd(7, 4) == 4\n```" - ], - "signature": "let bitwiseAnd: (int, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseOr", - "kind": "value", - "name": "bitwiseOr", - "docstrings": [ - "`bitwiseOr(n1, n2)` calculates the bitwise OR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseOr(7, 4) == 7\n```" - ], - "signature": "let bitwiseOr: (int, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseXor", - "kind": "value", - "name": "bitwiseXor", - "docstrings": [ - "`bigwiseXor(n1, n2)` calculates the bitwise XOR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseXor(7, 4) == 3\n```" - ], - "signature": "let bitwiseXor: (int, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseNot", - "kind": "value", - "name": "bitwiseNot", - "docstrings": [ - "`bitwiseNot(n)` calculates the bitwise NOT of an integer.\n\n## Examples\n\n```rescript\nInt.bitwiseNot(2) == -3\n```" - ], - "signature": "let bitwiseNot: int => int" - }, - { - "id": "Stdlib.Int.shiftLeft", - "kind": "value", - "name": "shiftLeft", - "docstrings": [ - "`shiftLeft(n, length)` calculates the shifted value of an integer `n` by `length` bits to the left.\n\n## Examples\n\n```rescript\nInt.shiftLeft(4, 1) == 8\n```" - ], - "signature": "let shiftLeft: (int, int) => int" - }, - { - "id": "Stdlib.Int.shiftRight", - "kind": "value", - "name": "shiftRight", - "docstrings": [ - "`shiftRight(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\n\nAlso known as \"arithmetic right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRight(8, 1) == 4\n```" - ], - "signature": "let shiftRight: (int, int) => int" - }, - { - "id": "Stdlib.Int.shiftRightUnsigned", - "kind": "value", - "name": "shiftRightUnsigned", - "docstrings": [ - "`shiftRightUnsigned(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\nExcess bits shifted off to the right are discarded, and zero bits are shifted in from the left.\n\nAlso known as \"zero-filling right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRightUnsigned(4, 1) == 2\n```" - ], - "signature": "let shiftRightUnsigned: (int, int) => int" - }, - { - "id": "Stdlib.Int.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(int)` ignores the provided int and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: int => unit" - } - ] - }, - "stdlib/float": { - "id": "Stdlib.Float", - "name": "Float", - "docstrings": [ - "Functions for interacting with float." - ], - "items": [ - { - "id": "Stdlib.Float.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a float." - ], - "signature": "type t = float" - }, - { - "id": "Stdlib.Float.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "Checks if two floating point numbers are equal.\n\n## Examples\n```rescript\nFloat.equal(1.0, 1.0) == true\nFloat.equal(1.0, 2.0) == false\n```" - ], - "signature": "let equal: (float, float) => bool" - }, - { - "id": "Stdlib.Float.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "Compares two floating point numbers, returns an `Ordering.t` value.\n\n## Examples\n```rescript\nFloat.compare(1.0, 1.0) == Ordering.equal\nFloat.compare(1.0, 2.0) == Ordering.less\nFloat.compare(2.0, 1.0) == Ordering.greater\n```" - ], - "signature": "let compare: (float, float) => Ordering.t" - }, - { - "id": "Stdlib.Float.isNaN", - "kind": "value", - "name": "isNaN", - "docstrings": [ - "`isNaN(v)` tests if the given `v` is `NaN`.\nSee [`isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) on MDN.\n\n## Examples\n\n```rescript\nFloat.isNaN(3.0) // false\nFloat.isNaN(Float.Constants.nan) // true\n```" - ], - "signature": "let isNaN: float => bool" - }, - { - "id": "Stdlib.Float.isFinite", - "kind": "value", - "name": "isFinite", - "docstrings": [ - "`isFinite(v)` tests if the given `v` is finite.\nSee [`isFinite`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite) on MDN.\n\n## Examples\n\n```rescript\nFloat.isFinite(1.0) == true\nFloat.isFinite(Float.Constants.nan) == false\nFloat.isFinite(Float.Constants.positiveInfinity) == false\n```" - ], - "signature": "let isFinite: float => bool" - }, - { - "id": "Stdlib.Float.parseFloat", - "kind": "value", - "name": "parseFloat", - "docstrings": [ - "`parseFloat(v)` parse the given `v` and returns a float. Leading whitespace in\n`v` is ignored. Returns `NaN` if `v` can't be parsed. Use \\[`fromString`\\] to\nensure it returns a valid float and not `NaN`.\nSee [`parseFloat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseFloat(\"1.0\") == 1.0\nFloat.parseFloat(\" 3.14 \") == 3.14\nFloat.parseFloat(\"3.0\") == 3.0\nFloat.parseFloat(\"3.14some non-digit characters\") == 3.14\nFloat.parseFloat(\"error\")->Float.isNaN == true\n```" - ], - "signature": "let parseFloat: string => float" - }, - { - "id": "Stdlib.Float.parseInt", - "kind": "value", - "name": "parseInt", - "docstrings": [ - "`parseInt(v, ~radix=?)` parse the given `v` and returns a float. Leading\nwhitespace in this argument `v`is ignored. `radix` specifies the radix base to\nuse for the formatted number. The value must be in the range \\[2, 36\\] (inclusive).\nReturns `NaN` if `v` can't be parsed and `radix` is smaller than 2 or bigger\nthan 36.\nSee [`parseInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseInt(\"1.0\") == 1.0\nFloat.parseInt(\" 3.14 \") == 3.0\nFloat.parseInt(3) == 3.0\nFloat.parseInt(\"3.14some non-digit characters\") == 3.0\nFloat.parseInt(\"error\")->Float.isNaN == true\nFloat.parseInt(\"10.0\", ~radix=2) == 2.0\nFloat.parseInt(\"15 * 3\", ~radix=10) == 15.0\nFloat.parseInt(\"12\", ~radix=13) == 15.0\nFloat.parseInt(\"17\", ~radix=40)->Float.isNaN == true\n```" - ], - "signature": "let parseInt: ('a, ~radix: int=?) => float" - }, - { - "id": "Stdlib.Float.parseIntWithRadix", - "kind": "value", - "name": "parseIntWithRadix", - "docstrings": [ - "`parseIntWithRadix(v, ~radix)` parse the given `v` and returns a float. Leading\nwhitespace in this argument `v`is ignored. `radix` specifies the radix base to\nuse for the formatted number. The value must be in the range \\[2, 36\\] (inclusive).\nReturns `NaN` if `v` can't be parsed and `radix` is smaller than 2 or bigger\nthan 36.\nSee [`parseInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseIntWithRadix(\"10.0\", ~radix=2) == 2.0\nFloat.parseIntWithRadix(\"15 * 3\", ~radix=10) == 15.0\nFloat.parseIntWithRadix(\"12\", ~radix=13) == 15.0\nFloat.parseIntWithRadix(\"17\", ~radix=40)->Float.isNaN == true\n```" - ], - "signature": "let parseIntWithRadix: ('a, ~radix: int) => float", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "`toExponential(v, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponential(1000.0) == \"1e+3\"\nFloat.toExponential(-1000.0) == \"-1e+3\"\nFloat.toExponential(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponential(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponential: (float, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Float.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "`toExponential(v, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponentialWithPrecision(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponentialWithPrecision(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponentialWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toFixed", - "kind": "value", - "name": "toFixed", - "docstrings": [ - "`toFixed(v, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixed(123456.0) == \"123456\"\nFloat.toFixed(10.0) == \"10\"\nFloat.toFixed(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixed(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixed: (float, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Float.toFixedWithPrecision", - "kind": "value", - "name": "toFixedWithPrecision", - "docstrings": [ - "`toFixedWithPrecision(v, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixedWithPrecision(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixedWithPrecision(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixedWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "`toPrecision(v, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecision(100.0) == \"100\"\nFloat.toPrecision(1.0) == \"1\"\nFloat.toPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecision: (float, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Float.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "`toPrecisionWithPrecision(v, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecisionWithPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecisionWithPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecisionWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(v)` return a `string` representing the given value.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toString(1000.0) == \"1000\"\nFloat.toString(-1000.0) == \"-1000\"\n```" - ], - "signature": "let toString: (float, ~radix: int=?) => string" - }, - { - "id": "Stdlib.Float.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "`toStringWithRadix(v, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toStringWithRadix(6.0, ~radix=2) == \"110\"\nFloat.toStringWithRadix(3735928559.0, ~radix=16) == \"deadbeef\"\nFloat.toStringWithRadix(123456.0, ~radix=36) == \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." - ], - "signature": "let toStringWithRadix: (float, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(v)` return a `string` with language-sensitive representing the\ngiven value.\nSee [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nFloat.toLocaleString(1000.0) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nFloat.toLocaleString(1000.0) // \"1.000\"\n```" - ], - "signature": "let toLocaleString: float => string" - }, - { - "id": "Stdlib.Float.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(str)` return an `option` representing the given value `str`.\n\n## Examples\n\n```rescript\nFloat.fromString(\"0\") == Some(0.0)\nFloat.fromString(\"NaN\") == None\nFloat.fromString(\"6\") == Some(6.0)\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.Float.toInt", - "kind": "value", - "name": "toInt", - "docstrings": [ - "`toInt(v)` returns an int to given float `v`.\n\n## Examples\n\n```rescript\nFloat.toInt(2.0) == 2\nFloat.toInt(1.0) == 1\nFloat.toInt(1.1) == 1\nFloat.toInt(1.6) == 1\n```" - ], - "signature": "let toInt: float => int" - }, - { - "id": "Stdlib.Float.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "`fromInt(v)` returns a float to given int `v`.\n\n## Examples\n\n```rescript\nFloat.fromInt(2) == 2.0\nFloat.fromInt(1) == 1.0\n```" - ], - "signature": "let fromInt: int => float" - }, - { - "id": "Stdlib.Float.mod", - "kind": "value", - "name": "mod", - "docstrings": [ - "`mod(n1, n2)` calculates the modulo (remainder after division) of two floats.\n\n## Examples\n\n```rescript\nFloat.mod(7.0, 4.0) == 3.0\n```" - ], - "signature": "let mod: (float, float) => float" - }, - { - "id": "Stdlib.Float.clamp", - "kind": "value", - "name": "clamp", - "docstrings": [ - "`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nFloat.clamp(4.2) == 4.2\nFloat.clamp(4.2, ~min=4.3) == 4.3\nFloat.clamp(4.2, ~max=4.1) == 4.1\nFloat.clamp(4.2, ~min=4.3, ~max=4.1) == 4.3\n```" - ], - "signature": "let clamp: (~min: float=?, ~max: float=?, float) => float" - }, - { - "id": "Stdlib.Float.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(float)` ignores the provided float and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: float => unit" - } - ] - }, - "stdlib/error": { - "id": "Stdlib.Error", - "name": "Error", - "docstrings": [ - "Functions for working with JavaScript exceptions.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) on MDN." - ], - "items": [ - { - "id": "Stdlib.Error.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JavaScript exception." - ], - "signature": "type t = Exn.t", - "deprecated": "" - }, - { - "id": "Stdlib.Error.fromException", - "kind": "value", - "name": "fromException", - "docstrings": [], - "signature": "let fromException: exn => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.toException", - "kind": "value", - "name": "toException", - "docstrings": [ - "Turns an `Error.t` into an `exn`.\n\n## Examples\n```rescript\nlet error = Error.make(\"Something went wrong.\")\n\nlet asExn = error->Error.toException // `asExn` is now type `exn`\n```" - ], - "signature": "let toException: t => exn", - "deprecated": "Use functions from `JsExn` instead" - }, - { - "id": "Stdlib.Error.stack", - "kind": "value", - "name": "stack", - "docstrings": [ - "`stack(error)` retrieves the `stack` property of the error, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\nlet error = Error.make(\"error\")\nConsole.log(error->Error.stack) // Logs `stack` if it exists on `someError`\n```" - ], - "signature": "let stack: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.message", - "kind": "value", - "name": "message", - "docstrings": [ - "`message(error)` retrieves the `message` property of the error, if it exists.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\nlet error = Error.SyntaxError.make(\"Some message here\")\nConsole.log(error->Error.message) // Logs \"Some message here\" to the console\n```" - ], - "signature": "let message: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.name", - "kind": "value", - "name": "name", - "docstrings": [ - "`name(error)` retrieves the `name` property of the error, if it exists.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\nlet error = Error.SyntaxError.make(\"Some message here\")\nConsole.log(error->Error.name) // Logs \"SyntaxError\" to the console\n```" - ], - "signature": "let name: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [ - "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." - ], - "signature": "let fileName: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(message)` creates a new error, setting its `message` to the provided value.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error) on MDN.\n\n## Example\n```rescript\nlet error = Error.make(\"Some message here\")\nConsole.log(error->Error.message) // Logs \"Some message here\" to the console\nConsole.log(error->Error.name) // Logs \"Error\" to the console, because this is a regular error\n```" - ], - "signature": "let make: string => t", - "deprecated": "" - }, - { - "id": "Stdlib.Error.raise", - "kind": "value", - "name": "raise", - "docstrings": [ - "Raises (throws in JavaScript language) the provided `Error.t`, which will stop execution.\n\n## Examples\n```rescript\nlet error = Error.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n error->Error.raise\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" - ], - "signature": "let raise: t => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Error.throw", - "kind": "value", - "name": "throw", - "docstrings": [ - "Throws the given exception, terminating execution unless caught by a surrounding try/catch block.\n\n## Examples\n\n```rescript\nlet error = Error.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n Error.throw(error)\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" - ], - "signature": "let throw: t => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Error.panic", - "kind": "value", - "name": "panic", - "docstrings": [ - "Throws a panic exception with the given message.\n\nA panic exception is a native JavaScript exception that is not intended to be caught and\nhandled. Compared to a ReScript exception this will give a better stack trace and\ndebugging experience.\n\n## Examples\n\n```rescript\ntry {\n Error.panic(\"Uh oh. This was unexpected!\")\n} catch {\n| Exn.Error(obj) =>\n switch Exn.message(obj) {\n | Some(m) => assert(m == \"Panic! Uh oh. This was unexpected!\")\n | None => assert(false)\n }\n| _ => assert(false)\n}\n```" - ], - "signature": "let panic: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Error.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(error)` ignores the provided error and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit", - "deprecated": "" - } - ] - }, - "stdlib/exn": { - "id": "Stdlib.Exn", - "name": "Exn", - "docstrings": [ - "Provide utilities for dealing with JS exceptions." - ], - "items": [ - { - "id": "Stdlib.Exn.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JS exception" - ], - "signature": "type t", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.asJsExn", - "kind": "value", - "name": "asJsExn", - "docstrings": [], - "signature": "let asJsExn: exn => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.stack", - "kind": "value", - "name": "stack", - "docstrings": [], - "signature": "let stack: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.message", - "kind": "value", - "name": "message", - "docstrings": [], - "signature": "let message: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.name", - "kind": "value", - "name": "name", - "docstrings": [], - "signature": "let name: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [], - "signature": "let fileName: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.anyToExnInternal", - "kind": "value", - "name": "anyToExnInternal", - "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a Exn.Error if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." - ], - "signature": "let anyToExnInternal: 'a => exn", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseError", - "kind": "value", - "name": "raiseError", - "docstrings": [ - "Raise Js exception Error object with stacktrace" - ], - "signature": "let raiseError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseEvalError", - "kind": "value", - "name": "raiseEvalError", - "docstrings": [], - "signature": "let raiseEvalError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseRangeError", - "kind": "value", - "name": "raiseRangeError", - "docstrings": [], - "signature": "let raiseRangeError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseReferenceError", - "kind": "value", - "name": "raiseReferenceError", - "docstrings": [], - "signature": "let raiseReferenceError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseSyntaxError", - "kind": "value", - "name": "raiseSyntaxError", - "docstrings": [], - "signature": "let raiseSyntaxError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseTypeError", - "kind": "value", - "name": "raiseTypeError", - "docstrings": [], - "signature": "let raiseTypeError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseUriError", - "kind": "value", - "name": "raiseUriError", - "docstrings": [], - "signature": "let raiseUriError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(exn)` ignores the provided exn and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit", - "deprecated": "" - } - ] - }, - "stdlib/dict": { - "id": "Stdlib.Dict", - "name": "Dict", - "docstrings": [ - "A mutable dictionary with string keys.\n\nCompiles to a regular JavaScript object." - ], - "items": [ - { - "id": "Stdlib.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a dictionary of value `'a`." - ], - "signature": "type t<'a> = dict<'a>" - }, - { - "id": "Stdlib.Dict.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(dict, key)` Returns the `value` at the provided `key`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `key` does not exist in `dict`.\n\nUse `Dict.getUnsafe` only when you are sure the key exists (i.e. when iterating `Dict.keys` result).\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\nlet value = dict->Dict.getUnsafe(\"key1\")\nConsole.log(value) // value1\n```" - ], - "signature": "let getUnsafe: (dict<'a>, string) => 'a" - }, - { - "id": "Stdlib.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the value at the provided key, if it exists. Returns an option.\n\n## Examples\n```rescript\nlet dict = dict{\"someKey\": \"someValue\"}\n\nswitch dict->Dict.get(\"someKey\") {\n| None => Console.log(\"Nope, didn't have the key.\")\n| Some(value) => Console.log(value)\n}\n```\n\n## Alternative: Pattern Matching with `dict{}`\n\nFor nested dictionary access, consider using the more concise `dict{}` pattern matching syntax:\n\n```rescript\n// More concise approach using pattern matching\nlet decodeImageUrl = (json: JSON.t) => {\n switch json {\n | JSON.Object(dict{\"data\": JSON.Object(dict{\"image_url\": JSON.String(url)})}) => Some(url)\n | _ => None\n }\n}\n\n// Alternative using Dict.get\nlet decodeImageUrl = (json: JSON.t) => {\n switch json {\n | JSON.Object(obj) =>\n switch Dict.get(obj, \"data\") {\n | Some(JSON.Object(data)) =>\n switch Dict.get(data, \"image_url\") {\n | Some(JSON.String(url)) => Some(url)\n | _ => None\n }\n | _ => None\n }\n | _ => None\n }\n}\n```" - ], - "signature": "let get: (dict<'a>, string) => option<'a>" - }, - { - "id": "Stdlib.Dict.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(dictionary, key, value)` sets the value at the provided key to the provided value.\n\n## Examples\n```rescript\nlet dict = Dict.make()\n\ndict->Dict.set(\"someKey\", \"someValue\")\n```" - ], - "signature": "let set: (dict<'a>, string, 'a) => unit" - }, - { - "id": "Stdlib.Dict.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "`delete(dictionary, key)` deletes the value at `key`, if it exists.\n\n## Examples\n```rescript\nlet dict = dict{\"someKey\": \"someValue\"}\n\ndict->Dict.delete(\"someKey\")\n```" - ], - "signature": "let delete: (dict<'a>, string) => unit" - }, - { - "id": "Stdlib.Dict.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make()` creates a new, empty dictionary.\n\n## Examples\n```rescript\nlet dict1: dict = Dict.make() // You can annotate the type of the values of your dict yourself if you want\n\nlet dict2 = Dict.make() // Or you can let ReScript infer it via usage.\ndict2->Dict.set(\"someKey\", 12)\n```" - ], - "signature": "let make: unit => dict<'a>" - }, - { - "id": "Stdlib.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(entries)` creates a new dictionary from the provided array of key/value pairs.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([(\"key1\", \"value1\"), (\"key2\", \"value2\")])\n```" - ], - "signature": "let fromArray: array<(string, 'a)> => dict<'a>" - }, - { - "id": "Stdlib.Dict.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "`fromIterator(entries)` creates a new dictionary from the provided iterator of key/value pairs.\n\n## Examples\n\n```rescript\nlet iterator: Iterator.t<(string, int)> = %raw(`\n (() => {\n var map1 = new Map();\n map1.set('first', 1);\n map1.set('second', 2);\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\niterator\n->Dict.fromIterator\n->Dict.valuesToArray == [1, 2]\n```" - ], - "signature": "let fromIterator: Iterator.t<(string, 'a)> => dict<'a>" - }, - { - "id": "Stdlib.Dict.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(dictionary)` returns an array of all the key/value pairs of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet asArray = dict->Dict.toArray\nConsole.log(asArray) // Logs `[[\"someKey\", 1], [\"someKey2\", 2]]` to the console\n```" - ], - "signature": "let toArray: dict<'a> => array<(string, 'a)>" - }, - { - "id": "Stdlib.Dict.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "`keysToArray(dictionary)` returns an array of all the keys of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet keys = dict->Dict.keysToArray\nConsole.log(keys) // Logs `[\"someKey\", \"someKey2\"]` to the console\n```" - ], - "signature": "let keysToArray: dict<'a> => array" - }, - { - "id": "Stdlib.Dict.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(dictionary)` returns the number of key/value pairs in the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.size->assertEqual(0)\n\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\ndict->Dict.size->assertEqual(2)\n\n// After deleting a key\ndict->Dict.delete(\"someKey\")\ndict->Dict.size->assertEqual(1)\n```" - ], - "signature": "let size: dict<'a> => int" - }, - { - "id": "Stdlib.Dict.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(dictionary)` returns `true` if the dictionary is empty (has no key/value pairs), `false` otherwise.\n\n## Examples\n```rescript\nlet emptyDict = Dict.make()\nemptyDict->Dict.isEmpty->assertEqual(true)\n\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.isEmpty->assertEqual(false)\n\n// After clearing all keys\ndict->Dict.delete(\"someKey\")\ndict->Dict.isEmpty->assertEqual(true)\n```" - ], - "signature": "let isEmpty: dict<'a> => bool" - }, - { - "id": "Stdlib.Dict.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [ - "`valuesToArray(dictionary)` returns an array of all the values of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet values = dict->Dict.valuesToArray\nConsole.log(values) // Logs `[1, 2]` to the console\n```" - ], - "signature": "let valuesToArray: dict<'a> => array<'a>" - }, - { - "id": "Stdlib.Dict.assign", - "kind": "value", - "name": "assign", - "docstrings": [ - "`assign(dictionary1, dictionary2)` [shallowly](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) merges dictionary2 into dictionary1, and returns dictionary1.\n\nBeware this will *mutate* dictionary1. If you're looking for a way to copy a dictionary, check out `Dict.copy`.\n\n## Examples\n```rescript\nlet dict1 = Dict.make()\ndict1->Dict.set(\"firstKey\", 1)\nConsole.log(dict1->Dict.keysToArray) // Logs `[\"firstKey\"]`\n\nlet dict2 = Dict.make()\ndict2->Dict.set(\"someKey\", 2)\ndict2->Dict.set(\"someKey2\", 3)\n\nlet dict1 = dict1->Dict.assign(dict2)\n\nConsole.log(dict1->Dict.keysToArray) // Logs `[\"firstKey\", \"someKey\", \"someKey2\"]`\n```" - ], - "signature": "let assign: (dict<'a>, dict<'a>) => dict<'a>" - }, - { - "id": "Stdlib.Dict.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(dictionary)` [shallowly copies](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) the provided dictionary to a new dictionary.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\nlet dict2 = dict->Dict.copy\n\n// Both log `[\"key1\", \"key2\"]` here.\nConsole.log2(dict->Dict.keysToArray, dict2->Dict.keysToArray)\n```" - ], - "signature": "let copy: dict<'a> => dict<'a>" - }, - { - "id": "Stdlib.Dict.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(dictionary, f)` iterates through all values of the dict.\n\n> Please note that this is *without the keys*, just the values. If you need the key as well, use `Dict.forEachWithKey`.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\n\ndict->Dict.forEach(value => {\n Console.log(value)\n})\n```" - ], - "signature": "let forEach: (dict<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Dict.forEachWithKey", - "kind": "value", - "name": "forEachWithKey", - "docstrings": [ - "`forEachWithKey(dictionary, f)` iterates through all values of the dict, including the key for each value.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\n\ndict->Dict.forEachWithKey((value, key) => {\n Console.log2(value, key)\n})\n```" - ], - "signature": "let forEachWithKey: (dict<'a>, ('a, string) => unit) => unit" - }, - { - "id": "Stdlib.Dict.mapValues", - "kind": "value", - "name": "mapValues", - "docstrings": [ - "`mapValues(dictionary, f)` returns a new dictionary with the same keys, and `f` applied to each value in the original dictionary.\n\n## Examples\n\n```rescript\nlet dict = dict{\"key1\": 1, \"key2\": 2}\n\ndict->Dict.mapValues(v => v + 10)->Dict.toArray // [(\"key1\", 11), (\"key2\", 12)]\ndict->Dict.mapValues(v => Int.toString(v))->Dict.toArray // [(\"key1\", \"1\"), (\"key2\", \"2\")]\n```" - ], - "signature": "let mapValues: (dict<'a>, 'a => 'b) => dict<'b>" - }, - { - "id": "Stdlib.Dict.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(dictionary, \"key\")` returns true if the \"key\" is present in the dictionary.\n\nBe aware that it uses the JavaScript `in` operator under the hood.\n\n## Examples\n\n```rescript\nlet dict = dict{\"key1\": Some(1), \"key2\": None}\n\ndict->Dict.has(\"key1\") == true\ndict->Dict.has(\"key2\") == true\ndict->Dict.has(\"key3\") == false\ndict->Dict.has(\"toString\") == true\n```" - ], - "signature": "let has: (dict<'a>, string) => bool" - }, - { - "id": "Stdlib.Dict.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(dict)` ignores the provided dict and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: dict<'a> => unit" - } - ] - }, - "stdlib/date": { - "id": "Stdlib.Date", - "name": "Date", - "docstrings": [ - "Functions for interacting with JavaScript Dates." - ], - "items": [ - { - "id": "Stdlib.Date.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a JavaScript date." - ], - "signature": "type t" - }, - { - "id": "Stdlib.Date.msSinceEpoch", - "kind": "type", - "name": "msSinceEpoch", - "docstrings": [ - "Time, in milliseconds, since / until the UNIX epoch (January 1, 1970 00:00:00 UTC).\nPositive numbers represent dates after, negative numbers dates before epoch." - ], - "signature": "type msSinceEpoch = float" - }, - { - "id": "Stdlib.Date.localeOptions", - "kind": "type", - "name": "localeOptions", - "docstrings": [ - "A type representing date time format options.\n\nNote: There are some properties missing:\n- fractionalSecondDigits\n- dayPeriod\n- calendar\n- numberingSystem\n- localeMatcher\n- timeZone\n- hour12\n- hourCycle\n- formatMatcher\n\nSee full spec at https://tc39.es/ecma402/#datetimeformat-objects" - ], - "signature": "type localeOptions = {\n dateStyle?: [#full | #long | #medium | #short],\n timeStyle?: [#full | #long | #medium | #short],\n weekday?: [#long | #narrow | #short],\n era?: [#long | #narrow | #short],\n year?: [#\"2-digit\" | #numeric],\n month?: [\n | #\"2-digit\"\n | #long\n | #narrow\n | #numeric\n | #short\n ],\n day?: [#\"2-digit\" | #numeric],\n hour?: [#\"2-digit\" | #numeric],\n minute?: [#\"2-digit\" | #numeric],\n second?: [#\"2-digit\" | #numeric],\n timeZoneName?: [#long | #short],\n}" - }, - { - "id": "Stdlib.Date.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make()`\n\nCreates a date object with the current date time as value.\n\n## Examples\n```rescript\nDate.make()\n```" - ], - "signature": "let make: unit => t" - }, - { - "id": "Stdlib.Date.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(dateTimeString)`\n\nCreates a date object from given date time string.\nThe string has to be in the ISO 8601 format YYYY-MM-DDTHH:mm:ss.sssZ (https://tc39.es/ecma262/\\#sec-date-time-string-format).\n\nInvalid date time strings will create invalid dates.\nYou can use the result like any valid date, but many functions like `toString` will return \"Invalid Date\" or functions like `Date.getTime` will return NaN.\n\n## Examples\n```rescript\nDate.fromString(\"2023\") // 2023-01-01T00:00:00.000Z\n\nDate.fromString(\"2023-02-20\") // 2023-02-20T00:00:00.000Z\n\nDate.fromString(\"2023-02-20T16:40:00.00Z\") // 2023-02-20T16:40:00.000Z\n\nDate.fromString(\"\") // Invalid Date\n\nDate.fromString(\"\")->Date.getTime // NaN\n```" - ], - "signature": "let fromString: string => t" - }, - { - "id": "Stdlib.Date.fromTime", - "kind": "value", - "name": "fromTime", - "docstrings": [ - "`fromTime(msSinceEpoch)`\n\nCreates a date object from the given time in milliseconds since / until UNIX epoch (January 1, 1970 00:00:00 UTC).\nPositive numbers create dates after epoch, negative numbers create dates before epoch.\n\n## Examples\n```rescript\nDate.fromTime(0.0)\n// 1970-01-01T00:00:00.000Z\n\nDate.fromTime(-86_400_000.0)\n// 1969-12-31T00:00:00.000Z\n\nDate.fromTime(86_400_000.0)\n// 1970-01-02T00:00:00.000Z\n```" - ], - "signature": "let fromTime: msSinceEpoch => t" - }, - { - "id": "Stdlib.Date.makeWithYM", - "kind": "value", - "name": "makeWithYM", - "docstrings": [ - "Creates a date object with the given year and month.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYM(~year=2023, ~month=0)\n// 2023-01-01T00:00:00.000Z\n\nDate.makeWithYM(~year=2023, ~month=11)\n// 2023-12-01T00:00:00.000Z\n\nDate.makeWithYM(~year=2023, ~month=12)\n// 2024-01-01T00:00:00.000Z\n\nDate.makeWithYM(~year=2023, ~month=-1)\n// 2022-12-01T00:00:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYM: (~year: int, ~month: int) => t" - }, - { - "id": "Stdlib.Date.makeWithYMD", - "kind": "value", - "name": "makeWithYMD", - "docstrings": [ - "Creates a date object with the given year, month and date (day of month).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMD(~year=2023, ~month=1, ~day=20)\n// 2023-02-20T00:00:00.000Z\n\nDate.makeWithYMD(~year=2023, ~month=1, ~day=-1)\n// 2022-11-29T00:00:00.000Z\n\nDate.makeWithYMD(~year=2023, ~month=1, ~day=29)\n// 2023-03-01T00:00:00.000Z\n```" - ], - "signature": "let makeWithYMD: (~year: int, ~month: int, ~day: int) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDH", - "kind": "value", - "name": "makeWithYMDH", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month) and hours.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=16)\n// 2023-02-20T16:00:00.000Z\n\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=24)\n// 2023-02-21T00:00:00.000Z\n\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=-1)\n// 2023-02-19T23:00:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDH: (~year: int, ~month: int, ~day: int, ~hours: int) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDHM", - "kind": "value", - "name": "makeWithYMDHM", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours and minutes.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=60)\n// 2023-02-20T17:00:00.000Z\n\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=-1)\n// 2023-02-20T15:59:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDHM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDHMS", - "kind": "value", - "name": "makeWithYMDHMS", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours, minutes and seconds.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=60)\n// 2023-02-20T16:41:00.000Z\n\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=-1)\n// 2023-02-20T16:39:59.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDHMS: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDHMSM", - "kind": "value", - "name": "makeWithYMDHMSM", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours, minutes, seconds and milliseconds.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=0,\n)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=1000,\n)\n// 2023-02-20T16:40:01.000Z\n\nDate.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=-1,\n)\n// 2023-02-20T16:39:59.999Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDHMSM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => t" - }, - { - "id": "Stdlib.Date.now", - "kind": "value", - "name": "now", - "docstrings": [ - "`now()`\n\nReturns the time, in milliseconds, between UNIX epoch (January 1, 1970 00:00:00 UTC) and the current date time." - ], - "signature": "let now: unit => msSinceEpoch" - }, - { - "id": "Stdlib.Date.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(date1, date2)` checks if two dates represent the same point in time.\n\n## Examples\n```rescript\nDate.equal(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-01\")) == true\nDate.equal(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-02\")) == false\n```" - ], - "signature": "let equal: (t, t) => bool" - }, - { - "id": "Stdlib.Date.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(date1, date2)` compares two dates chronologically, returns an `Ordering.t` value.\n\n## Examples\n```rescript\nDate.compare(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-01\")) == Ordering.equal\nDate.compare(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-02\")) == Ordering.less\nDate.compare(Date.fromString(\"2023-01-02\"), Date.fromString(\"2023-01-01\")) == Ordering.greater\n```" - ], - "signature": "let compare: (t, t) => Ordering.t" - }, - { - "id": "Stdlib.Date.getTime", - "kind": "value", - "name": "getTime", - "docstrings": [ - "`getTime(date)`\n\nReturns the time, in milliseconds, between UNIX epoch (January 1, 1970 00:00:00 UTC) and the current date time.\nInvalid dates will return NaN.\nDates before epoch will return negative numbers.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20\")->Date.getTime\n// 1676851200000\n```" - ], - "signature": "let getTime: t => msSinceEpoch" - }, - { - "id": "Stdlib.Date.getTimezoneOffset", - "kind": "value", - "name": "getTimezoneOffset", - "docstrings": [ - "`getTimezoneOffset(date)`\n\nReturns the time in minutes between the UTC time and the locale time.\nThe timezone of the given date doesn't matter.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01\")->Date.getTimezoneOffset\n// -60 with local time zone = Europe/Berlin\n\nDate.fromString(\"2023-06-01\")->Date.getTimezoneOffset\n// -120 with local time zone = Europe/Berlin\n```" - ], - "signature": "let getTimezoneOffset: t => int" - }, - { - "id": "Stdlib.Date.getFullYear", - "kind": "value", - "name": "getFullYear", - "docstrings": [ - "`getFullYear(date)`\n\nReturns the year of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20\")->Date.getFullYear\n// 2023\n```" - ], - "signature": "let getFullYear: t => int" - }, - { - "id": "Stdlib.Date.getMonth", - "kind": "value", - "name": "getMonth", - "docstrings": [ - "`getMonth(date)`\n\nReturns the month (0-indexed) of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01\")->Date.getMonth\n// 0\n```" - ], - "signature": "let getMonth: t => int" - }, - { - "id": "Stdlib.Date.getDate", - "kind": "value", - "name": "getDate", - "docstrings": [ - "`getDate(date)`\n\nReturns the date (day of month) of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getDate\n// 20\n```" - ], - "signature": "let getDate: t => int" - }, - { - "id": "Stdlib.Date.getHours", - "kind": "value", - "name": "getHours", - "docstrings": [ - "`getHours(date)`\n\nReturns the hours of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getHours\n// 16\n```" - ], - "signature": "let getHours: t => int" - }, - { - "id": "Stdlib.Date.getMinutes", - "kind": "value", - "name": "getMinutes", - "docstrings": [ - "`getMinutes(date)`\n\nReturns the minutes of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getMinutes\n// 40\n```" - ], - "signature": "let getMinutes: t => int" - }, - { - "id": "Stdlib.Date.getSeconds", - "kind": "value", - "name": "getSeconds", - "docstrings": [ - "`getSeconds(date)`\n\nReturns the seconds of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getSeconds\n// 0\n```" - ], - "signature": "let getSeconds: t => int" - }, - { - "id": "Stdlib.Date.getMilliseconds", - "kind": "value", - "name": "getMilliseconds", - "docstrings": [ - "`getMilliseconds(date)`\n\nReturns the milliseconds of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getMilliseconds\n// 0\n```" - ], - "signature": "let getMilliseconds: t => int" - }, - { - "id": "Stdlib.Date.getDay", - "kind": "value", - "name": "getDay", - "docstrings": [ - "`getDay(date)`\n\nReturns the day of week of a given date (according to local time).\n0 = Sunday, 1 = Monday, ... 6 = Saturday\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getDay\n// 1\n```" - ], - "signature": "let getDay: t => int" - }, - { - "id": "Stdlib.Date.setFullYear", - "kind": "value", - "name": "setFullYear", - "docstrings": [ - "`setFullYear(date, year)`\n\nSets the year of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYear(2024)\n```" - ], - "signature": "let setFullYear: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setFullYearM", - "kind": "value", - "name": "setFullYearM", - "docstrings": [ - "`setFullYearM(date, ~year, ~month)`\n\nSets the year and month of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYearM(~year=2024, ~month=0)\n```" - ], - "signature": "let setFullYearM: (t, ~year: int, ~month: int) => unit" - }, - { - "id": "Stdlib.Date.setFullYearMD", - "kind": "value", - "name": "setFullYearMD", - "docstrings": [ - "`setFullYearMD(date, ~year, ~month, ~day)`\n\nSets the year, month and date (day of month) of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYearMD(~year=2024, ~month=0, ~day=1)\n```" - ], - "signature": "let setFullYearMD: (t, ~year: int, ~month: int, ~day: int) => unit" - }, - { - "id": "Stdlib.Date.setMonth", - "kind": "value", - "name": "setMonth", - "docstrings": [ - "`setMonth(date, month)`\n\nSets the month of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMonth(0)\n```" - ], - "signature": "let setMonth: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setDate", - "kind": "value", - "name": "setDate", - "docstrings": [ - "`setDate(date, day)`\n\nSets the date (day of month) of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setDate(1)\n```" - ], - "signature": "let setDate: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setHours", - "kind": "value", - "name": "setHours", - "docstrings": [ - "`setHours(date, hours)`\n\nSets the hours of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHours(0)\n```" - ], - "signature": "let setHours: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setHoursM", - "kind": "value", - "name": "setHoursM", - "docstrings": [ - "`setHoursM(date, ~hours, ~minutes)`\n\nSets the hours and minutes of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHoursM(~hours=0, ~minutes=0)\n```" - ], - "signature": "let setHoursM: (t, ~hours: int, ~minutes: int) => unit" - }, - { - "id": "Stdlib.Date.setHoursMS", - "kind": "value", - "name": "setHoursMS", - "docstrings": [ - "`setHoursMS(date, ~hours, ~minutes, ~seconds)`\n\nSets the hours, minutes and seconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHoursMS(~hours=0, ~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setHoursMS: (t, ~hours: int, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setHoursMSMs", - "kind": "value", - "name": "setHoursMSMs", - "docstrings": [ - "`setHoursMSMs(date, ~hours, ~minutes, ~seconds, ~milliseconds)`\n\nSets the hours, minutes, seconds and milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHoursMSMs(\n ~hours=0,\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setHoursMSMs: (\n t,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setMinutes", - "kind": "value", - "name": "setMinutes", - "docstrings": [ - "`setMinutes(date, minutes)`\n\nSets the minutes of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMinutes(0)\n```" - ], - "signature": "let setMinutes: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setMinutesS", - "kind": "value", - "name": "setMinutesS", - "docstrings": [ - "`setMinutesS(date, ~minutes, ~seconds)`\n\nSets the minutes and seconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMinutesS(~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setMinutesS: (t, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setMinutesSMs", - "kind": "value", - "name": "setMinutesSMs", - "docstrings": [ - "`setMinutesSMs(date, ~minutes, ~seconds, ~milliseconds)`\n\nSets the minutes, seconds and milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMinutesSMs(\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setMinutesSMs: (\n t,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setSeconds", - "kind": "value", - "name": "setSeconds", - "docstrings": [ - "`setSeconds(date, seconds)`\n\nSets the seconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setSeconds(0)\n```" - ], - "signature": "let setSeconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setSecondsMs", - "kind": "value", - "name": "setSecondsMs", - "docstrings": [ - "`setSecondsMs(date, ~seconds, ~milliseconds)`\n\nSets the seconds and milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setSecondsMs(~seconds=0, ~milliseconds=0)\n```" - ], - "signature": "let setSecondsMs: (t, ~seconds: int, ~milliseconds: int) => unit" - }, - { - "id": "Stdlib.Date.setMilliseconds", - "kind": "value", - "name": "setMilliseconds", - "docstrings": [ - "`setMilliseconds(date, milliseconds)`\n\nSets the milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMilliseconds(0)\n```" - ], - "signature": "let setMilliseconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.getUTCFullYear", - "kind": "value", - "name": "getUTCFullYear", - "docstrings": [ - "`getUTCFullYear(date)`\n\nReturns the year of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCFullYear // 2022\n```" - ], - "signature": "let getUTCFullYear: t => int" - }, - { - "id": "Stdlib.Date.getUTCMonth", - "kind": "value", - "name": "getUTCMonth", - "docstrings": [ - "`getUTCMonth(date)`\n\nReturns the month of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCMonth // 11\n```" - ], - "signature": "let getUTCMonth: t => int" - }, - { - "id": "Stdlib.Date.getUTCDate", - "kind": "value", - "name": "getUTCDate", - "docstrings": [ - "`getUTCDate(date)`\n\nReturns the date (day of month) of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCDate // 31\n```" - ], - "signature": "let getUTCDate: t => int" - }, - { - "id": "Stdlib.Date.getUTCHours", - "kind": "value", - "name": "getUTCHours", - "docstrings": [ - "`getUTCHours(date)`\n\nReturns the hours of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCHours // 23\n```" - ], - "signature": "let getUTCHours: t => int" - }, - { - "id": "Stdlib.Date.getUTCMinutes", - "kind": "value", - "name": "getUTCMinutes", - "docstrings": [ - "`getUTCMinutes(date)`\n\nReturns the minutes of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCMinutes // 0\n```" - ], - "signature": "let getUTCMinutes: t => int" - }, - { - "id": "Stdlib.Date.getUTCSeconds", - "kind": "value", - "name": "getUTCSeconds", - "docstrings": [ - "`getUTCSeconds(date)`\n\nReturns the seconds of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCSeconds // 0\n```" - ], - "signature": "let getUTCSeconds: t => int" - }, - { - "id": "Stdlib.Date.getUTCMilliseconds", - "kind": "value", - "name": "getUTCMilliseconds", - "docstrings": [ - "`getUTCMilliseconds(date)`\n\nReturns the milliseconds of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCMilliseconds // 0\n```" - ], - "signature": "let getUTCMilliseconds: t => int" - }, - { - "id": "Stdlib.Date.getUTCDay", - "kind": "value", - "name": "getUTCDay", - "docstrings": [ - "`getUTCDay(date)`\n\nReturns the day (day of week) of a given date (according to UTC time).\n0 = Sunday, 1 = Monday, ... 6 = Saturday\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCDay // 6\n```" - ], - "signature": "let getUTCDay: t => int" - }, - { - "id": "Stdlib.Date.setUTCFullYear", - "kind": "value", - "name": "setUTCFullYear", - "docstrings": [ - "`setUTCFullYear(date, year)`\n\nSets the year of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYear(2024)\n```" - ], - "signature": "let setUTCFullYear: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCFullYearM", - "kind": "value", - "name": "setUTCFullYearM", - "docstrings": [ - "`setUTCFullYearM(date, ~year, ~month)`\n\nSets the year and month of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYearM(~year=2024, ~month=0)\n```" - ], - "signature": "let setUTCFullYearM: (t, ~year: int, ~month: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCFullYearMD", - "kind": "value", - "name": "setUTCFullYearMD", - "docstrings": [ - "`setUTCFullYearMD(date, ~year, ~month, ~day)`\n\nSets the year, month and date (day of month) of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYearMD(~year=2024, ~month=0, ~day=1)\n```" - ], - "signature": "let setUTCFullYearMD: (t, ~year: int, ~month: int, ~day: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMonth", - "kind": "value", - "name": "setUTCMonth", - "docstrings": [ - "`setUTCMonth(date, month)`\n\nSets the month of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMonth(0)\n```" - ], - "signature": "let setUTCMonth: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCDate", - "kind": "value", - "name": "setUTCDate", - "docstrings": [ - "`setDate(date, day)`\n\nSets the date (day of month) of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCDate(1)\n```" - ], - "signature": "let setUTCDate: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHours", - "kind": "value", - "name": "setUTCHours", - "docstrings": [ - "`setUTCHours(date, hours)`\n\nSets the hours of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHours(0)\n```" - ], - "signature": "let setUTCHours: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHoursM", - "kind": "value", - "name": "setUTCHoursM", - "docstrings": [ - "`setHoursM(date, ~hours, ~minutes)`\n\nSets the hours and minutes of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHoursM(~hours=0, ~minutes=0)\n```" - ], - "signature": "let setUTCHoursM: (t, ~hours: int, ~minutes: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHoursMS", - "kind": "value", - "name": "setUTCHoursMS", - "docstrings": [ - "`setUTCHoursMS(date, ~hours, ~minutes, ~seconds)`\n\nSets the hours, minutes and seconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHoursMS(~hours=0, ~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setUTCHoursMS: (t, ~hours: int, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHoursMSMs", - "kind": "value", - "name": "setUTCHoursMSMs", - "docstrings": [ - "`setUTCHoursMSMs(date, ~hours, ~minutes, ~seconds, ~milliseconds)`\n\nSets the hours, minutes, seconds and milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHoursMSMs(\n ~hours=0,\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setUTCHoursMSMs: (\n t,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setUTCMinutes", - "kind": "value", - "name": "setUTCMinutes", - "docstrings": [ - "`setUTCMinutes(date, minutes)`\n\nSets the minutes of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMinutes(0)\n```" - ], - "signature": "let setUTCMinutes: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMinutesS", - "kind": "value", - "name": "setUTCMinutesS", - "docstrings": [ - "`setUTCMinutesS(date, ~minutes, ~seconds)`\n\nSets the minutes and seconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMinutesS(~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setUTCMinutesS: (t, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMinutesSMs", - "kind": "value", - "name": "setUTCMinutesSMs", - "docstrings": [ - "`setUTCMinutesSMs(date, ~minutes, ~seconds, ~milliseconds)`\n\nSets the minutes, seconds and milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMinutesSMs(\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setUTCMinutesSMs: (\n t,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setUTCSeconds", - "kind": "value", - "name": "setUTCSeconds", - "docstrings": [ - "`setUTCSeconds(date, seconds)`\n\nSets the seconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCSeconds(0)\n```" - ], - "signature": "let setUTCSeconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCSecondsMs", - "kind": "value", - "name": "setUTCSecondsMs", - "docstrings": [ - "`setUTCSecondsMs(date, ~seconds, ~milliseconds)`\n\nSets the seconds and milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCSecondsMs(~seconds=0, ~milliseconds=0)\n```" - ], - "signature": "let setUTCSecondsMs: (t, ~seconds: int, ~milliseconds: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMilliseconds", - "kind": "value", - "name": "setUTCMilliseconds", - "docstrings": [ - "`setUTCMilliseconds(date, milliseconds)`\n\nSets the milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMilliseconds(0)\n```" - ], - "signature": "let setUTCMilliseconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.toDateString", - "kind": "value", - "name": "toDateString", - "docstrings": [ - "`toDateString(date)`\n\nConverts a JavaScript date to a standard date string. The date will be mapped to the current time zone.\nIf you want to convert it to a localized string, use `Date.toLocaleDateString` instead.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.toDateString->Console.log\n// Sun Jan 01 2023\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toDateString->Console.log\n// Sat Dec 31 2022\n```" - ], - "signature": "let toDateString: t => string" - }, - { - "id": "Stdlib.Date.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(date)`\n\nConverts a JavaScript date to a standard date time string. The date will be mapped to the current time zone.\nIf you want to convert it to a localized string, use `Date.toLocaleString` instead.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.toString->Console.log\n// Sun Jan 01 2023 00:00:00 GMT+0100 (Central European Standard Time)\n\nDate.fromString(\"2023-06-01T00:00:00.00+01:00\")->Date.toString->Console.log\n// Thu Jun 01 2023 01:00:00 GMT+0200 (Central European Summer Time)\n```" - ], - "signature": "let toString: t => string" - }, - { - "id": "Stdlib.Date.toTimeString", - "kind": "value", - "name": "toTimeString", - "docstrings": [ - "`toTimeString(date)`\n\nConverts a JavaScript date to a standard time string. The date will be mapped to the current time zone.\nIf you want to convert it to a localized string, use `Date.toLocaleStimeString` instead.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.toTimeString->Console.log\n// 00:00:00 GMT+0100 (Central European Standard Time)\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toTimeString->Console.log\n// 17:00:00 GMT+0100 (Central European Standard Time)\n```" - ], - "signature": "let toTimeString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleDateString", - "kind": "value", - "name": "toLocaleDateString", - "docstrings": [ - "`toLocaleDateString(date)`\n\nConverts a JavaScript date to a localized date string. It will use the current locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleDateString->Console.log\n// 2/19/2023\n```" - ], - "signature": "let toLocaleDateString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleDateStringWithLocale", - "kind": "value", - "name": "toLocaleDateStringWithLocale", - "docstrings": [ - "`toLocaleDateStringWithLocale(date, locale)`\n\nConverts a JavaScript date to a localized date string. It will use the specified locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleDateStringWithLocale(\"en-US\")->Console.log\n// 2/19/2023\n```" - ], - "signature": "let toLocaleDateStringWithLocale: (t, string) => string" - }, - { - "id": "Stdlib.Date.toLocaleDateStringWithLocaleAndOptions", - "kind": "value", - "name": "toLocaleDateStringWithLocaleAndOptions", - "docstrings": [ - "`toLocaleDateStringWithLocaleAndOptions(date, locale, options)`\n\nConverts a JavaScript date to a localized date string. It will use the specified locale and formatting options.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleDateStringWithLocaleAndOptions(\"en-US\", {dateStyle: #long})->Console.log\n// February 19, 2023\n\nDate.make()\n->Date.toLocaleDateStringWithLocaleAndOptions(\"de\", {hour: #\"2-digit\", minute: #\"2-digit\"})\n->Console.log\n// 19.2.2023, 15:40\n\nDate.make()->Date.toLocaleDateStringWithLocaleAndOptions(\"de\", {year: #numeric})->Console.log\n// 2023\n```" - ], - "signature": "let toLocaleDateStringWithLocaleAndOptions: (t, string, localeOptions) => string" - }, - { - "id": "Stdlib.Date.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(date)`\n\nConverts a JavaScript date to a localized date-time string. It will use the current locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleString->Console.log\n// 2/19/2023, 3:40:00 PM\n```" - ], - "signature": "let toLocaleString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleStringWithLocale", - "kind": "value", - "name": "toLocaleStringWithLocale", - "docstrings": [ - "`toLocaleStringWithLocale(date, locale)`\n\nConverts a JavaScript date to a localized date-time string. It will use the specified locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleStringWithLocale(\"en-US\")->Console.log\n// 2/19/2023, 3:40:00 PM\n```" - ], - "signature": "let toLocaleStringWithLocale: (t, string) => string" - }, - { - "id": "Stdlib.Date.toLocaleStringWithLocaleAndOptions", - "kind": "value", - "name": "toLocaleStringWithLocaleAndOptions", - "docstrings": [ - "`toLocaleStringWithLocaleAndOptions(date, locale, options)`\n\nConverts a JavaScript date to a localized date-time string. It will use the specified locale and formatting options.\n\n## Examples\n```rescript\nDate.make()\n->Date.toLocaleStringWithLocaleAndOptions(\"en\", {dateStyle: #short, timeStyle: #short})\n->Console.log\n// 2/19/23, 3:40 PM\n\nDate.make()\n->Date.toLocaleStringWithLocaleAndOptions(\n \"en\",\n {\n era: #long,\n year: #numeric,\n month: #\"2-digit\",\n day: #\"2-digit\",\n hour: #numeric,\n timeZoneName: #short,\n },\n)\n->Console.log\n// 02/19/2023 Anno Domini, 3 PM GMT+1\n```" - ], - "signature": "let toLocaleStringWithLocaleAndOptions: (t, string, localeOptions) => string" - }, - { - "id": "Stdlib.Date.toLocaleTimeString", - "kind": "value", - "name": "toLocaleTimeString", - "docstrings": [ - "`toLocaleTimeString(date)`\n\nConverts a JavaScript date to a localized time string. It will use the current locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleTimeString->Console.log\n// 3:40:00 PM\n```" - ], - "signature": "let toLocaleTimeString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleTimeStringWithLocale", - "kind": "value", - "name": "toLocaleTimeStringWithLocale", - "docstrings": [ - "`toLocaleTimeStringWithLocale(date, locale)`\n\nConverts a JavaScript date to a localized time string. It will use the specified locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleTimeStringWithLocale(\"en-US\")->Console.log\n// 3:40:00 PM\n```" - ], - "signature": "let toLocaleTimeStringWithLocale: (t, string) => string" - }, - { - "id": "Stdlib.Date.toLocaleTimeStringWithLocaleAndOptions", - "kind": "value", - "name": "toLocaleTimeStringWithLocaleAndOptions", - "docstrings": [ - "`toLocaleTimeStringWithLocaleAndOptions(date, locale, options)`\n\nConverts a JavaScript date to a localized time string. It will use the specified locale and formatting options.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleTimeStringWithLocaleAndOptions(\"en-US\", {timeStyle: #long})->Console.log\n// 3:40:00 PM GMT+1\n\nDate.make()\n->Date.toLocaleTimeStringWithLocaleAndOptions(\"de\", {hour: #\"2-digit\", minute: #\"2-digit\"})\n->Console.log\n// 15:40\n```" - ], - "signature": "let toLocaleTimeStringWithLocaleAndOptions: (t, string, localeOptions) => string" - }, - { - "id": "Stdlib.Date.toISOString", - "kind": "value", - "name": "toISOString", - "docstrings": [ - "`toISOString(date)`\n\nConverts a JavaScript date to a ISO 8601 string (YYYY-MM-DDTHH:mm:ss.sssZ). The date will be mapped to the UTC time.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toISOString->Console.log\n// 2023-01-01T00:00:00.000Z\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toISOString->Console.log\n// 2022-12-31T16:00:00.000Z\n```" - ], - "signature": "let toISOString: t => string" - }, - { - "id": "Stdlib.Date.toUTCString", - "kind": "value", - "name": "toUTCString", - "docstrings": [ - "`toUTCString(date)`\n\nConverts a JavaScript date to date time string. The date will be mapped to the UTC time.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toUTCString->Console.log\n// Sun, 01 Jan 2023 00:00:00 GMT\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toUTCString->Console.log\n// Sat, 31 Dec 2022 16:00:00 GMT\n```" - ], - "signature": "let toUTCString: t => string" - }, - { - "id": "Stdlib.Date.toJSON", - "kind": "value", - "name": "toJSON", - "docstrings": [ - "`toJSON(date)`\n\nConverts a JavaScript date to a string.\nIf the date is valid, the function will return the same result as `Date.toISOString`.\nInvalid dates will return `None`.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toJSON\n// Some(\"2023-01-01T00:00:00.000Z\")\n\nDate.fromString(\"\")->Date.toJSON\n// None\n```" - ], - "signature": "let toJSON: t => option" - }, - { - "id": "Stdlib.Date.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(date)` ignores the provided date and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/dataview": { - "id": "Stdlib.DataView", - "name": "DataView", - "docstrings": [ - "Functions for interacting with DataView.\n\nSee [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN." - ], - "items": [ - { - "id": "Stdlib.DataView.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a DataView." - ], - "signature": "type t" - }, - { - "id": "Stdlib.DataView.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer(buffer)` creates a DataView for the entire ArrayBuffer.\n\nSee [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN.\n\n## Examples\n\n```rescript\nDataView.fromBuffer(ArrayBuffer.make(16))\nDataView.fromBuffer(ArrayBuffer.make(16), ~byteOffset=4)\nDataView.fromBuffer(ArrayBuffer.make(16), ~byteOffset=4, ~length=8)\n```" - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.DataView.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd(buffer, ~byteOffset)` creates a DataView starting at a given byte offset. See [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN.\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.\n\n## Examples\n\n```rescript\nDataView.fromBufferToEnd(buffer, ~byteOffset=4)\n```" - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.DataView.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange(buffer, ~byteOffset, ~length)` creates a DataView for a specific byte range.\n\nSee [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN.\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.\n\n## Examples\n\n```rescript\nDataView.fromBufferWithRange(ArrayBuffer.make(16), ~byteOffset=2, ~length=8)\n```" - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.DataView.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [ - "`buffer(dataView)` returns the underlying ArrayBuffer referenced by this DataView.\n\nSee [`DataView.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/buffer) on MDN.\n\n## Examples\n\n```rescript\nlet array_buffer = ArrayBuffer.make(16)\nlet dv = DataView.fromBuffer(array_buffer)\nDataView.buffer(dv) == array_buffer\n```" - ], - "signature": "let buffer: t => ArrayBuffer.t" - }, - { - "id": "Stdlib.DataView.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [ - "`byteLength(dataView)` returns the length (in bytes) of this DataView.\n\nSee [`DataView.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet array_buffer = ArrayBuffer.make(16)\nlet dv = DataView.fromBuffer(array_buffer)\nDataView.byteLength(dv) == 16\n```" - ], - "signature": "let byteLength: t => int" - }, - { - "id": "Stdlib.DataView.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [ - "`byteOffset(dataView)` returns the byte offset of this DataView from the start of its ArrayBuffer.\n\nSee [`DataView.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/byteOffset) on MDN.\n\n## Examples\n\n```rescript\nlet array_buffer = ArrayBuffer.make(16)\nlet dv = DataView.fromBuffer(array_buffer, ~byteOffset=4)\nDataView.byteOffset(dv) == 4\n```" - ], - "signature": "let byteOffset: t => int" - }, - { - "id": "Stdlib.DataView.getInt8", - "kind": "value", - "name": "getInt8", - "docstrings": [ - "`getInt8(dataView, offset)` reads an 8-bit signed integer at the specified byte offset.\n\nSee [`DataView.getInt8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setInt8(0, -12)\nDataView.getInt8(dv, 0) == -12\n```" - ], - "signature": "let getInt8: (t, int) => int" - }, - { - "id": "Stdlib.DataView.getUint8", - "kind": "value", - "name": "getUint8", - "docstrings": [ - "`getUint8(dataView, offset)` reads an 8-bit unsigned integer at the specified byte offset.\n\nSee [`DataView.getUint8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setUint8(1, 255)\nDataView.getUint8(dv, 1) == 255\n```" - ], - "signature": "let getUint8: (t, int) => int" - }, - { - "id": "Stdlib.DataView.getInt16", - "kind": "value", - "name": "getInt16", - "docstrings": [ - "`getInt16(dataView, offset, ~littleEndian=?)` reads a 16-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getInt16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setInt16(0, -1234)\ndv->DataView.setInt16(2, -1234, ~littleEndian=true)\nDataView.getInt16(dv, 0) == -1234\nDataView.getInt16(dv, 2, ~littleEndian=true) == -1234\n```" - ], - "signature": "let getInt16: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getUint16", - "kind": "value", - "name": "getUint16", - "docstrings": [ - "`getUint16(dataView, offset, ~littleEndian=?)` reads a 16-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getUint16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setUint16(0, 1234)\ndv->DataView.setUint16(2, 1234, ~littleEndian=true)\nDataView.getUint16(dv, 0) == 1234\nDataView.getUint16(dv, 2, ~littleEndian=true) == 1234\n```" - ], - "signature": "let getUint16: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getInt32", - "kind": "value", - "name": "getInt32", - "docstrings": [ - "`getInt32(dataView, offset, ~littleEndian=?)` reads a 32-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getInt32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setInt32(0, -123456)\ndv->DataView.setInt32(4, -123456, ~littleEndian=true)\nDataView.getInt32(dv, 0) == -123456\nDataView.getInt32(dv, 4, ~littleEndian=true) == -123456\n```" - ], - "signature": "let getInt32: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getUint32", - "kind": "value", - "name": "getUint32", - "docstrings": [ - "`getUint32(dataView, offset, ~littleEndian=?)` reads a 32-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getUint32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setUint32(0, 123456)\ndv->DataView.setUint32(4, 123456, ~littleEndian=true)\nDataView.getUint32(dv, 0) == 123456\nDataView.getUint32(dv, 4, ~littleEndian=true) == 123456\n```" - ], - "signature": "let getUint32: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getFloat16", - "kind": "value", - "name": "getFloat16", - "docstrings": [ - "`getFloat16(dataView, offset, ~littleEndian=?)` reads a 16-bit floating point number (if supported) at the specified byte offset, with optional endianness.\n\nSee [`DataView.getFloat16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat16) on MDN.\n\n## Examples\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setFloat16(0, 1.5)\ndv->DataView.setFloat16(2, 1.5, ~littleEndian=true)\nDataView.getFloat16(dv, 0) == 1.5\nDataView.getFloat16(dv, 2, ~littleEndian=true) == 1.5\n```" - ], - "signature": "let getFloat16: (t, int, ~littleEndian: bool=?) => float" - }, - { - "id": "Stdlib.DataView.getFloat32", - "kind": "value", - "name": "getFloat32", - "docstrings": [ - "`getFloat32(dataView, offset, ~littleEndian=?)` reads a 32-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.getFloat32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setFloat32(0, 3.14)\ndv->DataView.setFloat32(4, 3.14, ~littleEndian=true)\n// DataView.getFloat32(dv, 0) == 3.14\n// DataView.getFloat32(dv, 4, ~littleEndian=true) == 3.14\n```" - ], - "signature": "let getFloat32: (t, int, ~littleEndian: bool=?) => float" - }, - { - "id": "Stdlib.DataView.getFloat64", - "kind": "value", - "name": "getFloat64", - "docstrings": [ - "`getFloat64(dataView, offset, ~littleEndian=?)` reads a 64-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.getFloat64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setFloat64(0, 6.28)\ndv->DataView.setFloat64(8, 6.28, ~littleEndian=true)\nDataView.getFloat64(dv, 0) == 6.28\nDataView.getFloat64(dv, 8, ~littleEndian=true) == 6.28\n```" - ], - "signature": "let getFloat64: (t, int, ~littleEndian: bool=?) => float" - }, - { - "id": "Stdlib.DataView.getBigInt64", - "kind": "value", - "name": "getBigInt64", - "docstrings": [ - "`getBigInt64(dataView, offset, ~littleEndian=?)` reads a 64-bit signed integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.getBigInt64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getBigInt64) on MDN.\n\n## Examples\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setBigInt64(0, -123456789n)\ndv->DataView.setBigInt64(8, -123456789n, ~littleEndian=true)\nDataView.getBigInt64(dv, 0) == -123456789n\nDataView.getBigInt64(dv, 8, ~littleEndian=true) == -123456789n\n```" - ], - "signature": "let getBigInt64: (t, int, ~littleEndian: bool=?) => bigint" - }, - { - "id": "Stdlib.DataView.getBigUint64", - "kind": "value", - "name": "getBigUint64", - "docstrings": [ - "`getBigUint64(dataView, offset, ~littleEndian=?)` reads a 64-bit unsigned integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.getBigUint64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getBigUint64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setBigUint64(0, 123456789n)\ndv->DataView.setBigUint64(8, 123456789n, ~littleEndian=true)\nDataView.getBigUint64(dv, 0) == 123456789n\nDataView.getBigUint64(dv, 8, ~littleEndian=true) == 123456789n\n```" - ], - "signature": "let getBigUint64: (t, int, ~littleEndian: bool=?) => bigint" - }, - { - "id": "Stdlib.DataView.setInt8", - "kind": "value", - "name": "setInt8", - "docstrings": [ - "`setInt8(dataView, offset, value)` writes an 8-bit signed integer at the specified byte offset.\n\nSee [`DataView.setInt8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setInt8(dv, 0, -12)\ndv->DataView.getInt8(0) == -12\n```" - ], - "signature": "let setInt8: (t, int, int) => unit" - }, - { - "id": "Stdlib.DataView.setUint8", - "kind": "value", - "name": "setUint8", - "docstrings": [ - "`setUint8(dataView, offset, value)` writes an 8-bit unsigned integer at the specified byte offset.\n\nSee [`DataView.setUint8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setUint8(dv, 0, 255)\ndv->DataView.getUint8(0) == 255\n```" - ], - "signature": "let setUint8: (t, int, int) => unit" - }, - { - "id": "Stdlib.DataView.setInt16", - "kind": "value", - "name": "setInt16", - "docstrings": [ - "`setInt16(dataView, offset, value, ~littleEndian=?)` writes a 16-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setInt16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setInt16(dv, 0, -1234)\nDataView.setInt16(dv, 2, -1234, ~littleEndian=true)\ndv->DataView.getInt16(0) == -1234\ndv->DataView.getInt16(2, ~littleEndian=true) == -1234\n```" - ], - "signature": "let setInt16: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setUint16", - "kind": "value", - "name": "setUint16", - "docstrings": [ - "`setUint16(dataView, offset, value, ~littleEndian=?)` writes a 16-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setUint16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setUint16(dv, 0, 1234)\nDataView.setUint16(dv, 2, 1234, ~littleEndian=true)\ndv->DataView.getUint16(0) == 1234\ndv->DataView.getUint16(2, ~littleEndian=true) == 1234\n```" - ], - "signature": "let setUint16: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setInt32", - "kind": "value", - "name": "setInt32", - "docstrings": [ - "`setInt32(dataView, offset, value, ~littleEndian=?)` writes a 32-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setInt32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setInt32(dv, 0, -123456)\nDataView.setInt32(dv, 4, -123456, ~littleEndian=true)\ndv->DataView.getInt32(0) == -123456\ndv->DataView.getInt32(4, ~littleEndian=true) == -123456\n```" - ], - "signature": "let setInt32: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setUint32", - "kind": "value", - "name": "setUint32", - "docstrings": [ - "`setUint32(dataView, offset, value, ~littleEndian=?)` writes a 32-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setUint32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setUint32(dv, 0, 123456)\nDataView.setUint32(dv, 4, 123456, ~littleEndian=true)\ndv->DataView.getUint32(0) == 123456\ndv->DataView.getUint32(4, ~littleEndian=true) == 123456\n```" - ], - "signature": "let setUint32: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setFloat16", - "kind": "value", - "name": "setFloat16", - "docstrings": [ - "`setFloat16(dataView, offset, value, ~littleEndian=?)` writes a 16-bit floating point number (if supported) at the specified byte offset, with optional endianness.\n\nSee [`DataView.setFloat16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setFloat16(dv, 0, 1.5)\nDataView.setFloat16(dv, 2, 1.5, ~littleEndian=true)\ndv->DataView.getFloat16(0) == 1.5\ndv->DataView.getFloat16(2, ~littleEndian=true) == 1.5\n```" - ], - "signature": "let setFloat16: (t, int, float, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setFloat32", - "kind": "value", - "name": "setFloat32", - "docstrings": [ - "`setFloat32(dataView, offset, value, ~littleEndian=?)` writes a 32-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.setFloat32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setFloat32(dv, 0, 3.14)\nDataView.setFloat32(dv, 4, 3.14, ~littleEndian=true)\n// dv->DataView.getFloat32(0) == 3.14\n// dv->DataView.getFloat32(4, ~littleEndian=true) == 3.14\n```" - ], - "signature": "let setFloat32: (t, int, float, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setFloat64", - "kind": "value", - "name": "setFloat64", - "docstrings": [ - "`setFloat64(dataView, offset, value, ~littleEndian=?)` writes a 64-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.setFloat64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setFloat64(dv, 0, 6.28)\nDataView.setFloat64(dv, 8, 6.28, ~littleEndian=true)\ndv->DataView.getFloat64(0) == 6.28\ndv->DataView.getFloat64(8, ~littleEndian=true) == 6.28\n```" - ], - "signature": "let setFloat64: (t, int, float, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setBigInt64", - "kind": "value", - "name": "setBigInt64", - "docstrings": [ - "`setBigInt64(dataView, offset, value, ~littleEndian=?)` writes a 64-bit signed integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.setBigInt64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setBigInt64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setBigInt64(dv, 0, -123456789n)\nDataView.setBigInt64(dv, 8, -123456789n, ~littleEndian=true)\ndv->DataView.getBigInt64(0) == -123456789n\ndv->DataView.getBigInt64(8, ~littleEndian=true) == -123456789n\n```" - ], - "signature": "let setBigInt64: (t, int, bigint, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setBigUint64", - "kind": "value", - "name": "setBigUint64", - "docstrings": [ - "`setBigUint64(dataView, offset, value, ~littleEndian=?)` writes a 64-bit unsigned integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.setBigUint64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setBigUint64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setBigUint64(dv, 0, 123456789n)\nDataView.setBigUint64(dv, 8, 123456789n, ~littleEndian=true)\ndv->DataView.getBigUint64(0) == 123456789n\ndv->DataView.getBigUint64(8, ~littleEndian=true) == 123456789n\n```" - ], - "signature": "let setBigUint64: (t, int, bigint, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(dataView)` ignores the provided DataView and returns unit.\n\nThis helper is useful when you want to discard a value (for example, the result of an operation with side effects) without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/console": { - "id": "Stdlib.Console", - "name": "Console", - "docstrings": [ - "Functions for interacting with JavaScript console.\n\nSee: [`console`](https://developer.mozilla.org/en-US/docs/Web/API/Console)." - ], - "items": [ - { - "id": "Stdlib.Console.assert_", - "kind": "value", - "name": "assert_", - "docstrings": [ - "`assert_(assertion, value)` print a message to console if `assertion` evaluates `false`. Does nothing if it's `true`.\n\nSee [`console.assert`](https://developer.mozilla.org/en-US/docs/Web/API/console/assert)\non MDN.\n\n## Examples\n\n```rescript\nConsole.assert_(false, \"Hello World!\")\nConsole.assert_(42 === 42, \"The answer\")\n```" - ], - "signature": "let assert_: (bool, 'a) => unit" - }, - { - "id": "Stdlib.Console.assert2", - "kind": "value", - "name": "assert2", - "docstrings": [ - "`assert2(v1, v2)`. Like `assert_`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.assert2(false, \"Hello\", \"World\")\nConsole.assert2(42 === 42, [1, 2, 3], '4')\n```" - ], - "signature": "let assert2: (bool, 'a, 'b) => unit" - }, - { - "id": "Stdlib.Console.assert3", - "kind": "value", - "name": "assert3", - "docstrings": [ - "`assert3(v1, v2, v3)`. Like `assert_`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.assert3(false, \"Hello\", \"World\", \"ReScript\")\nConsole.assert3(42 === 42, \"One\", 2, #3)\n```" - ], - "signature": "let assert3: (bool, 'a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.assert4", - "kind": "value", - "name": "assert4", - "docstrings": [ - "`assert4(v1, v2, v3, v4)`. Like `assert_`, but with four arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert4(false, \"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.assert4(value === 42, [1, 2], (3, 4), [#5, #6], #polyvar)\n```" - ], - "signature": "let assert4: (bool, 'a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.assert5", - "kind": "value", - "name": "assert5", - "docstrings": [ - "`assert5(v1, v2, v3, v4, v5)`. Like `assert_`, but with five arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert5(false, \"Hello\", \"World\", \"JS\", '!', '!')\nConsole.assert5(value === 42, [1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let assert5: (bool, 'a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.assert6", - "kind": "value", - "name": "assert6", - "docstrings": [ - "`assert6(v1, v2)`. Like `assert_`, but with six arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert6(false, \"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.assert6(value === 42, [1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let assert6: (bool, 'a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.assertMany", - "kind": "value", - "name": "assertMany", - "docstrings": [ - "`assertMany(assertion, arr)`. Like `assert_`, but variadic.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assertMany(false, [\"Hello\", \"World\"])\nConsole.assertMany(value === 42, [1, 2, 3])\n```" - ], - "signature": "let assertMany: (bool, array<'a>) => unit" - }, - { - "id": "Stdlib.Console.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "`clear()` clears the console, if allowed.\n\nSee [`console.clear`](https://developer.mozilla.org/en-US/docs/Web/API/console/clear)\non MDN.\n\n## Examples\n\n```rescript\nConsole.clear()\n```" - ], - "signature": "let clear: unit => unit" - }, - { - "id": "Stdlib.Console.count", - "kind": "value", - "name": "count", - "docstrings": [ - "`count(label)` prints to the console the number of times it's been called with the given label.\n\nSee [`console.count`](https://developer.mozilla.org/en-US/docs/Web/API/console/count)\non MDN.\n\n## Examples\n\n```rescript\nConsole.count(\"rescript\")\n```" - ], - "signature": "let count: string => unit" - }, - { - "id": "Stdlib.Console.countReset", - "kind": "value", - "name": "countReset", - "docstrings": [ - "`countReset(label)` resets the count for the given label to 0.\n\nSee [`console.countReset`](https://developer.mozilla.org/en-US/docs/Web/API/console/countReset)\non MDN.\n\n## Examples\n\n```rescript\nConsole.countReset(\"rescript\")\n```" - ], - "signature": "let countReset: string => unit" - }, - { - "id": "Stdlib.Console.debug", - "kind": "value", - "name": "debug", - "docstrings": [ - "`debug(value)` print a debug message to console.\n\nSee [`console.debug`](https://developer.mozilla.org/en-US/docs/Web/API/console/debug)\non MDN.\n\n## Examples\n\n```rescript\nConsole.debug(\"Hello\")\nlet obj = {\"name\": \"ReScript\", \"version\": 10}\nConsole.debug(obj)\n```" - ], - "signature": "let debug: 'a => unit" - }, - { - "id": "Stdlib.Console.debug2", - "kind": "value", - "name": "debug2", - "docstrings": [ - "`debug2(v1, v2)`. Like `debug`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.debug2(\"Hello\", \"World\")\nConsole.debug2([1, 2, 3], '4')\n```" - ], - "signature": "let debug2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.debug3", - "kind": "value", - "name": "debug3", - "docstrings": [ - "`debug3(v1, v2, v3)`. Like `debug`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.debug3(\"Hello\", \"World\", \"ReScript\")\nConsole.debug3(\"One\", 2, #3)\n```" - ], - "signature": "let debug3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.debug4", - "kind": "value", - "name": "debug4", - "docstrings": [ - "`debug4(v1, v2, v3, v4)`. Like `debug`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.debug4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.debug4([1, 2], (3, 4), [#5, #6], #polyvar)\n```" - ], - "signature": "let debug4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.debug5", - "kind": "value", - "name": "debug5", - "docstrings": [ - "`debug5(v1, v2, v3, v4, v5)`. Like `debug`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.debug5(\"Hello\", \"World\", \"JS\", '!', '!')\nConsole.debug5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let debug5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.debug6", - "kind": "value", - "name": "debug6", - "docstrings": [ - "`debug6(v1, v2, v3, v4, v5, v6)`. Like `debug`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.debug6(\"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.debug6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let debug6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.debugMany", - "kind": "value", - "name": "debugMany", - "docstrings": [ - "`debugMany(arr)`. Like `debug`, but variadic.\n\n## Examples\n\n```rescript\nConsole.debugMany([\"Hello\", \"World\"])\nConsole.debugMany([1, 2, 3])\n```" - ], - "signature": "let debugMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.dirOptions", - "kind": "type", - "name": "dirOptions", - "docstrings": [], - "signature": "type dirOptions = {\n colors?: bool,\n depth?: Nullable.t,\n showHidden?: bool,\n}" - }, - { - "id": "Stdlib.Console.dir", - "kind": "value", - "name": "dir", - "docstrings": [ - "`dir(object, options)` displays an interactive view of the object in the console.\n\nSee [`console.dir`](https://developer.mozilla.org/en-US/docs/Web/API/console/dir)\non MDN.\n\n## Examples\n\n```rescript\nConsole.dir({\"language\": \"rescript\", \"version\": \"10.1.2\"})\nConsole.dir(\n {\"language\": \"rescript\", \"version\": {\"major\": \"10\", \"minor\": \"1\", \"patch\": \"2\"}},\n ~options={depth: null},\n)\n```" - ], - "signature": "let dir: ('a, ~options: dirOptions=?) => unit" - }, - { - "id": "Stdlib.Console.dirxml", - "kind": "value", - "name": "dirxml", - "docstrings": [ - "`dirxml(object)` displays an interactive tree view of an XML/HTML element in the console.\n\nSee [`console.dirxml`](https://developer.mozilla.org/en-US/docs/Web/API/console/dirxml)\non MDN." - ], - "signature": "let dirxml: 'a => unit" - }, - { - "id": "Stdlib.Console.error", - "kind": "value", - "name": "error", - "docstrings": [ - "`error(value)` prints an error message to console.\n\nSee [`console.error`](https://developer.mozilla.org/en-US/docs/Web/API/console/error)\non MDN.\n\n## Examples\n\n```rescript\nConsole.error(\"error message\")\nConsole.error((\"error\", \"invalid value\"))\n```" - ], - "signature": "let error: 'a => unit" - }, - { - "id": "Stdlib.Console.error2", - "kind": "value", - "name": "error2", - "docstrings": [ - "`error(v1, v2)`. Like `error`, but two arguments.\n\n## Examples\n\n```rescript\nConsole.error2(\"Error\", \"here\")\nConsole.error2((\"log\", \"error\"), \"message\")\n```" - ], - "signature": "let error2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.error3", - "kind": "value", - "name": "error3", - "docstrings": [ - "`error3(v1, v2, v3)`. Like `error`, but three arguments.\n\n## Examples\n\n```rescript\nConsole.error3(\"Hello\", \"World\", \"!!!\")\nConsole.error3(#first, #second, #third)\n```" - ], - "signature": "let error3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.error4", - "kind": "value", - "name": "error4", - "docstrings": [ - "`error4(v1, v2, v3, v4)`. Like `error`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.error4(\"Hello\", \"World\", \"ReScript\", '!')\nConsole.error4(#first, #second, #third, \"fourth\")\n```" - ], - "signature": "let error4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.error5", - "kind": "value", - "name": "error5", - "docstrings": [ - "`error5(v1, v2, v3, v4, v5)`. Like `error`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.error5('e', 'r', 'r', 'o', 'r')\nConsole.error5(1, #second, #third, \"fourth\", 'c')\n```" - ], - "signature": "let error5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.error6", - "kind": "value", - "name": "error6", - "docstrings": [ - "`error6(v1, v2, v3, v4, v5, v6)`. Like `error`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.error6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.error6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let error6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.group", - "kind": "value", - "name": "group", - "docstrings": [ - "`group(label)` creates a new \"group\" level with the given label.\n\nSee [`console.group`](https://developer.mozilla.org/en-US/docs/Web/API/console/group)\non MDN.\n\n## Example\n\n```rescript\nConsole.group(\"first group\")\nConsole.group(\"second group\")\nConsole.log(\"a message on the second level\")\nConsole.groupEnd()\nConsole.log(\"a message message on the first level\")\nConsole.groupEnd()\n```" - ], - "signature": "let group: string => unit" - }, - { - "id": "Stdlib.Console.groupCollapsed", - "kind": "value", - "name": "groupCollapsed", - "docstrings": [ - "`groupCollapsed(label)`. Like `group` but collapses the group initially.\n\nSee [`console.groupCollapsed`](https://developer.mozilla.org/en-US/docs/Web/API/console/groupCollapsed)\non MDN." - ], - "signature": "let groupCollapsed: string => unit" - }, - { - "id": "Stdlib.Console.groupEnd", - "kind": "value", - "name": "groupEnd", - "docstrings": [ - "`groupEnd()` ends the current group.\n\nSee [`console.groupEnd`](https://developer.mozilla.org/en-US/docs/Web/API/console/groupEnd)\non MDN." - ], - "signature": "let groupEnd: unit => unit" - }, - { - "id": "Stdlib.Console.errorMany", - "kind": "value", - "name": "errorMany", - "docstrings": [ - "`errorMany(arr)`. Like `error`, but variadic.\n\n## Examples\n\n```rescript\nConsole.errorMany([\"Hello\", \"World\"])\nConsole.errorMany([1, 2, 3])\n```" - ], - "signature": "let errorMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.info", - "kind": "value", - "name": "info", - "docstrings": [ - "`info(value)` print an informational message to console.\n\nSee [`console.info`](https://developer.mozilla.org/en-US/docs/Web/API/console/info)\non MDN.\n\n## Examples\n\n```rescript\nConsole.info(\"Information\")\nConsole.info((\"Hello\", \"JS\"))\n```" - ], - "signature": "let info: 'a => unit" - }, - { - "id": "Stdlib.Console.info2", - "kind": "value", - "name": "info2", - "docstrings": [ - "`info2(v1, v2)`. Like `info`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.info2(\"Info\", \"failed to download\")\nConsole.info2(#info, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let info2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.info3", - "kind": "value", - "name": "info3", - "docstrings": [ - "`info3(v1, v2, v3)`. Like `info`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.info3(\"Hello\", \"World\", \"ReScript\")\nConsole.info3([1, 2, 3], #4, #5)\n```" - ], - "signature": "let info3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.info4", - "kind": "value", - "name": "info4", - "docstrings": [ - "`info4(v1, v2, v3, v4)`. Like `info`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.info4(\"Hello\", \"World\", \"ReScript\", '!')\nConsole.info4([1, 2, 3], #4, #5, #lastinfo)\n```" - ], - "signature": "let info4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.info5", - "kind": "value", - "name": "info5", - "docstrings": [ - "`info5(v1, v2, v3, v4, v5)`. Like `info`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.info5(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\")\nConsole.info5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let info5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.info6", - "kind": "value", - "name": "info6", - "docstrings": [ - "`info6(v1, v2, v3, v4, v5, v6)`. Like `info`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.info6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.info6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let info6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.infoMany", - "kind": "value", - "name": "infoMany", - "docstrings": [ - "`infoMany(arr)`. Like `info`, but variadic.\n\n## Examples\n\n```rescript\nConsole.infoMany([\"Hello\", \"World\"])\nConsole.infoMany([1, 2, 3])\n```" - ], - "signature": "let infoMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.log", - "kind": "value", - "name": "log", - "docstrings": [ - "`log(value)` print a message to console.\n\nSee [`console.log`](https://developer.mozilla.org/en-US/docs/Web/API/console/log)\non MDN.\n\n## Examples\n\n```rescript\nConsole.log(\"Hello\")\nlet obj = {\"name\": \"ReScript\", \"version\": 10}\nConsole.log(obj)\n```" - ], - "signature": "let log: 'a => unit" - }, - { - "id": "Stdlib.Console.log2", - "kind": "value", - "name": "log2", - "docstrings": [ - "`log2(v1, v2)`. Like `log`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.log2(\"Hello\", \"World\")\nConsole.log2([1, 2, 3], '4')\n```" - ], - "signature": "let log2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.log3", - "kind": "value", - "name": "log3", - "docstrings": [ - "`log3(v1, v2, v3)`. Like `log`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.log3(\"Hello\", \"World\", \"ReScript\")\nConsole.log3(\"One\", 2, #3)\n```" - ], - "signature": "let log3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.log4", - "kind": "value", - "name": "log4", - "docstrings": [ - "`log4(v1, v2, v3, v4)`. Like `log`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.log4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.log4([1, 2], (3, 4), [#5, #6], #polyvar)\n```" - ], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.log5", - "kind": "value", - "name": "log5", - "docstrings": [ - "`log5(v1, v2, v3, v4, v5)`. Like `log`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.log5(\"Hello\", \"World\", \"JS\", '!', '!')\nConsole.log5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let log5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.log6", - "kind": "value", - "name": "log6", - "docstrings": [ - "`log6(v1, v2, v3, v4, v5, v6)`. Like `log`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.log6(\"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.log6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let log6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.logMany", - "kind": "value", - "name": "logMany", - "docstrings": [ - "`logMany(arr)`. Like `log`, but variadic.\n\n## Examples\n\n```rescript\nConsole.logMany([\"Hello\", \"World\"])\nConsole.logMany([1, 2, 3])\n```" - ], - "signature": "let logMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.table", - "kind": "value", - "name": "table", - "docstrings": [ - "`table(object)` displays an tabular view of the object in the console.\n\nSee [`console.table`](https://developer.mozilla.org/en-US/docs/Web/API/console/table)\non MDN.\n\n## Examples\n\n```rescript\nConsole.table({\"language\": \"rescript\", \"version\": \"10.1.2\"})\n```" - ], - "signature": "let table: 'a => unit" - }, - { - "id": "Stdlib.Console.time", - "kind": "value", - "name": "time", - "docstrings": [ - "`time(label)` creates a timer to measure how long an operation takes. `label`\nmust be a unique name. Call `console.timeEnd` with the same `label` to print\noutput time.\n\nSee [`console.time`](https://developer.mozilla.org/en-US/docs/Web/API/console/time)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let time: string => unit" - }, - { - "id": "Stdlib.Console.timeEnd", - "kind": "value", - "name": "timeEnd", - "docstrings": [ - "`timeEnd(label)` stops a timer created by `time`.\n\nSee [`console.timeEnd`](https://developer.mozilla.org/en-US/docs/Web/API/console/timeEnd)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let timeEnd: string => unit" - }, - { - "id": "Stdlib.Console.timeLog", - "kind": "value", - "name": "timeLog", - "docstrings": [ - "`timeLog(label)` prints the current elapsed time of the given timer to the console.\n\nSee [`console.timeLog`](https://developer.mozilla.org/en-US/docs/Web/API/console/timeLog)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let timeLog: string => unit" - }, - { - "id": "Stdlib.Console.trace", - "kind": "value", - "name": "trace", - "docstrings": [ - "`trace()` print a stack trace to console.\n\nSee [`console.trace`](https://developer.mozilla.org/en-US/docs/Web/API/console/trace)\non MDN.\n\n## Examples\n\n```rescript\nlet main = () => {\n Console.trace()\n}\nmain()\n// In the console, the following trace will be displayed:\n// main\n// \n```" - ], - "signature": "let trace: unit => unit" - }, - { - "id": "Stdlib.Console.warn", - "kind": "value", - "name": "warn", - "docstrings": [ - "`warn(value)` print a warning message to console.\n\nSee [`console.warn`](https://developer.mozilla.org/en-US/docs/Web/API/console/warn)\non MDN.\n\n## Examples\n\n```rescript\nConsole.warn(\"Warning\")\nConsole.warn((\"Warning\", \"invalid number\"))\n```" - ], - "signature": "let warn: 'a => unit" - }, - { - "id": "Stdlib.Console.warn2", - "kind": "value", - "name": "warn2", - "docstrings": [ - "`warn2(v1, v2)`. Like `warn`, but two arguments.\n\n## Examples\n\n```rescript\nConsole.warn2(\"Hello\", \"World\")\nConsole.warn2([1, 2, 3], 4)\n```" - ], - "signature": "let warn2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.warn3", - "kind": "value", - "name": "warn3", - "docstrings": [ - "`warn3(v1, v2, v3)`. Like `warn`, but three arguments.\n\n## Examples\n\n```rescript\nConsole.warn3(\"Hello\", \"World\", \"ReScript\")\nConsole.warn3([1, 2, 3], #4, #5)\n```" - ], - "signature": "let warn3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.warn4", - "kind": "value", - "name": "warn4", - "docstrings": [ - "`warn4(v1, v2, v3, v4)`. Like `warn`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.warn4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.warn4(#first, #second, #third, \"fourth\")\n```" - ], - "signature": "let warn4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.warn5", - "kind": "value", - "name": "warn5", - "docstrings": [ - "`warn5(v1, v2, v3, v4, v5)`. Like `warn`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.warn5(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\")\nConsole.warn5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let warn5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.warn6", - "kind": "value", - "name": "warn6", - "docstrings": [ - "`warn6(v1, v2, v3, v4, v5, v6)`. Like `warn`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.warn6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.warn6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let warn6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.warnMany", - "kind": "value", - "name": "warnMany", - "docstrings": [ - "`warnMany(arr)`. Like `warn`, but variadic.\n\n## Examples\n\n```rescript\nConsole.warnMany([\"Hello\", \"World\"])\nConsole.warnMany([1, 2, 3])\n```" - ], - "signature": "let warnMany: array<'a> => unit" - } - ] - }, - "stdlib/bool": { - "id": "Stdlib.Bool", - "name": "Bool", - "docstrings": [ - "Functions for interacting with JavaScript booleans.\nSee: [`Boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)" - ], - "items": [ - { - "id": "Stdlib.Bool.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a boolean." - ], - "signature": "type t = bool" - }, - { - "id": "Stdlib.Bool.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts a boolean to a string.\n\n## Examples\n```rescript\nBool.toString(true) == \"true\"\nBool.toString(false) == \"false\"\n```" - ], - "signature": "let toString: bool => string" - }, - { - "id": "Stdlib.Bool.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Converts a string to a boolean.\n\n## Examples\n```rescript\nBool.fromString(\"true\") == Some(true)\nBool.fromString(\"false\") == Some(false)\nBool.fromString(\"notAValidBoolean\") == None\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.Bool.fromStringOrThrow", - "kind": "value", - "name": "fromStringOrThrow", - "docstrings": [ - "Converts a string to a boolean.\nThrows an `Invalid_argument` exception if the string is not a valid boolean.\n\n## Examples\n```rescript\nBool.fromStringOrThrow(\"true\") == true\nBool.fromStringOrThrow(\"false\") == false\nswitch Bool.fromStringOrThrow(\"notAValidBoolean\") {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let fromStringOrThrow: string => bool" - }, - { - "id": "Stdlib.Bool.fromStringExn", - "kind": "value", - "name": "fromStringExn", - "docstrings": [ - "Converts a string to a boolean.\nBeware, this function will throw an `Invalid_argument` exception\nif the string is not a valid boolean.\n\n## Examples\n```rescript\nBool.fromStringExn(\"true\") == true\nBool.fromStringExn(\"false\") == false\nswitch Bool.fromStringExn(\"notAValidBoolean\") {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let fromStringExn: string => bool", - "deprecated": "" - }, - { - "id": "Stdlib.Bool.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "Compares two booleans, returns an `Ordering.t` value.\n\n## Examples\n```rescript\nBool.compare(true, true) == Ordering.equal\nBool.compare(false, false) == Ordering.equal\nBool.compare(true, false) == Ordering.greater\nBool.compare(false, true) == Ordering.less\n```" - ], - "signature": "let compare: (bool, bool) => Ordering.t" - }, - { - "id": "Stdlib.Bool.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "Checks if two booleans are equal and have the same value.\n\n## Examples\n```rescript\nBool.equal(true, true) == true\nBool.equal(false, false) == true\nBool.equal(true, false) == false\nBool.equal(false, true) == false\n```" - ], - "signature": "let equal: (bool, bool) => bool" - }, - { - "id": "Stdlib.Bool.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bool)` ignores the provided boolean and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: bool => unit" - } - ] - }, - "stdlib/bigint": { - "id": "Stdlib.BigInt", - "name": "BigInt", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigInt.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a bigint." - ], - "signature": "type t = bigint" - }, - { - "id": "Stdlib.BigInt.asIntN", - "kind": "value", - "name": "asIntN", - "docstrings": [ - "`asIntN(~width, bigint)` returns a bigint value truncated to the given number of bits as a signed integer.\n\nSee [`BigInt.asIntN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/asIntN) on MDN.\n\n## Examples\n\n```rescript\nBigInt.asIntN(~width=4, 25n) == -7n\nBigInt.asIntN(~width=4, 3n) == 3n\n```" - ], - "signature": "let asIntN: (~width: int, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.asUintN", - "kind": "value", - "name": "asUintN", - "docstrings": [ - "`asUintN(~width, bigint)` returns a bigint value truncated to the given number of bits as an unsigned integer.\n\nSee [`BigInt.asUintN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/asUintN) on MDN.\n\n## Examples\n\n```rescript\nBigInt.asUintN(~width=4, 25n) == 9n\nBigInt.asUintN(~width=4, 3n) == 3n\n```" - ], - "signature": "let asUintN: (~width: int, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.fromStringOrThrow", - "kind": "value", - "name": "fromStringOrThrow", - "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Return the\nnumber as a `bigint` if successfully parsed. Throws a syntax exception otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromStringOrThrow(\"123\") == 123n\n\nBigInt.fromStringOrThrow(\"\") == 0n\n\nBigInt.fromStringOrThrow(\"0x11\") == 17n\n\nBigInt.fromStringOrThrow(\"0b11\") == 3n\n\nBigInt.fromStringOrThrow(\"0o11\") == 9n\n\n/* catch exception */\nswitch BigInt.fromStringOrThrow(\"a\") {\n| exception JsExn(_error) => assert(true)\n| _bigInt => assert(false)\n}\n```" - ], - "signature": "let fromStringOrThrow: string => bigint" - }, - { - "id": "Stdlib.BigInt.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Returns\n`Some(bigint)` if the string can be parsed, `None` otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromString(\"123\") == Some(123n)\n\nBigInt.fromString(\"\") == Some(0n)\n\nBigInt.fromString(\"0x11\") == Some(17n)\n\nBigInt.fromString(\"0b11\") == Some(3n)\n\nBigInt.fromString(\"0o11\") == Some(9n)\n\nBigInt.fromString(\"invalid\") == None\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.BigInt.fromStringExn", - "kind": "value", - "name": "fromStringExn", - "docstrings": [], - "signature": "let fromStringExn: string => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "`fromInt(int)` converts an `int` to a `bigint`.\n\n## Examples\n\n```rescript\nBigInt.fromInt(123) == 123n\nBigInt.fromInt(0) == 0n\nBigInt.fromInt(-456) == -456n\n```" - ], - "signature": "let fromInt: int => bigint" - }, - { - "id": "Stdlib.BigInt.fromFloatOrThrow", - "kind": "value", - "name": "fromFloatOrThrow", - "docstrings": [ - "Converts a `float` to a `bigint` using JavaScript semantics.\nThrows an exception if the float is not an integer or is infinite/NaN.\n\n## Examples\n\n```rescript\nBigInt.fromFloatOrThrow(123.0) == 123n\n\nBigInt.fromFloatOrThrow(0.0) == 0n\n\nBigInt.fromFloatOrThrow(-456.0) == -456n\n\n/* This will throw an exception */\nswitch BigInt.fromFloatOrThrow(123.5) {\n| exception JsExn(_error) => assert(true)\n| _bigInt => assert(false)\n}\n```" - ], - "signature": "let fromFloatOrThrow: float => bigint" - }, - { - "id": "Stdlib.BigInt.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "`fromFloat(float)` converts a `float` to a `bigint` using JavaScript semantics.\nReturns `Some(bigint)` if the float is a valid `bigint`, `None` otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromFloat(123.0) == Some(123n)\nBigInt.fromFloat(0.0) == Some(0n)\nBigInt.fromFloat(-456.0) == Some(-456n)\nBigInt.fromFloat(123.5) == None\n```" - ], - "signature": "let fromFloat: float => option" - }, - { - "id": "Stdlib.BigInt.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats a `bigint` as a string. Return a `string` representing the given value.\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nBigInt.toString(123n) == \"123\"\n```" - ], - "signature": "let toString: (bigint, ~radix: int=?) => string" - }, - { - "id": "Stdlib.BigInt.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [], - "signature": "let toStringWithRadix: (bigint, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Returns a string with a language-sensitive representation of this BigInt value.\n\n## Examples\n\n```rescript\nBigInt.toString(123n) == \"123\"\n```" - ], - "signature": "let toLocaleString: bigint => string" - }, - { - "id": "Stdlib.BigInt.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [ - "`toFloat(bigint)` converts a `bigint` to a `float`.\n\n## Examples\n\n```rescript\nBigInt.toFloat(123n) == 123.0\nBigInt.toFloat(0n) == 0.0\nBigInt.toFloat(-456n) == -456.0\n```" - ], - "signature": "let toFloat: bigint => float" - }, - { - "id": "Stdlib.BigInt.toInt", - "kind": "value", - "name": "toInt", - "docstrings": [ - "`toInt(bigint)` converts a `bigint` to an `int`.\n\n## Examples\n\n```rescript\nBigInt.toInt(123n) == 123\nBigInt.toInt(0n) == 0\nBigInt.toInt(-456n) == -456\n```" - ], - "signature": "let toInt: bigint => int" - }, - { - "id": "Stdlib.BigInt.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(a, b)` calculates the sum of two bigints.\n\n## Examples\n\n```rescript\nBigInt.add(5n, 3n) == 8n\nBigInt.add(-2n, 7n) == 5n\n```" - ], - "signature": "let add: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.sub", - "kind": "value", - "name": "sub", - "docstrings": [ - "`sub(a, b)` calculates the difference of two bigints.\n\n## Examples\n\n```rescript\nBigInt.sub(8n, 3n) == 5n\nBigInt.sub(2n, 7n) == -5n\n```" - ], - "signature": "let sub: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.mul", - "kind": "value", - "name": "mul", - "docstrings": [ - "`mul(a, b)` calculates the product of two bigints.\n\n## Examples\n\n```rescript\nBigInt.mul(5n, 3n) == 15n\nBigInt.mul(-2n, 7n) == -14n\n```" - ], - "signature": "let mul: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.div", - "kind": "value", - "name": "div", - "docstrings": [ - "`div(a, b)` calculates the quotient of two bigints.\n\n## Examples\n\n```rescript\nBigInt.div(15n, 3n) == 5n\nBigInt.div(14n, 3n) == 4n\n```" - ], - "signature": "let div: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.mod", - "kind": "value", - "name": "mod", - "docstrings": [ - "`mod(a, b)` calculates the remainder of dividing two bigints.\n\n## Examples\n\n```rescript\nBigInt.mod(15n, 4n) == 3n\nBigInt.mod(14n, 3n) == 2n\n```" - ], - "signature": "let mod: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseAnd", - "kind": "value", - "name": "bitwiseAnd", - "docstrings": [ - "`bitwiseAnd(a, b)` calculates the bitwise AND of two bigints.\n\n## Examples\n\n```rescript\nBigInt.bitwiseAnd(7n, 4n) == 4n\nBigInt.bitwiseAnd(15n, 8n) == 8n\n```" - ], - "signature": "let bitwiseAnd: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseOr", - "kind": "value", - "name": "bitwiseOr", - "docstrings": [ - "`bitwiseOr(a, b)` calculates the bitwise OR of two bigints.\n\n## Examples\n\n```rescript\nBigInt.bitwiseOr(7n, 4n) == 7n\nBigInt.bitwiseOr(8n, 4n) == 12n\n```" - ], - "signature": "let bitwiseOr: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseXor", - "kind": "value", - "name": "bitwiseXor", - "docstrings": [ - "`bitwiseXor(a, b)` calculates the bitwise XOR of two bigints.\n\n## Examples\n\n```rescript\nBigInt.bitwiseXor(7n, 4n) == 3n\nBigInt.bitwiseXor(15n, 8n) == 7n\n```" - ], - "signature": "let bitwiseXor: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseNot", - "kind": "value", - "name": "bitwiseNot", - "docstrings": [ - "`bitwiseNot(bigint)` calculates the bitwise NOT of a bigint.\n\n## Examples\n\n```rescript\nBigInt.bitwiseNot(2n) == -3n\nBigInt.bitwiseNot(-1n) == 0n\n```" - ], - "signature": "let bitwiseNot: bigint => bigint" - }, - { - "id": "Stdlib.BigInt.shiftLeft", - "kind": "value", - "name": "shiftLeft", - "docstrings": [ - "`shiftLeft(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the left.\n\n## Examples\n\n```rescript\nBigInt.shiftLeft(4n, 1n) == 8n\nBigInt.shiftLeft(1n, 3n) == 8n\n```" - ], - "signature": "let shiftLeft: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.shiftRight", - "kind": "value", - "name": "shiftRight", - "docstrings": [ - "`shiftRight(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the right.\n\n## Examples\n\n```rescript\nBigInt.shiftRight(8n, 1n) == 4n\nBigInt.shiftRight(16n, 2n) == 4n\n```" - ], - "signature": "let shiftRight: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bigint)` ignores the provided bigint and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: bigint => unit" - }, - { - "id": "Stdlib.BigInt.land", - "kind": "value", - "name": "land", - "docstrings": [ - "`land(a, b)` calculates the bitwise AND of two bigints.\n\n**Deprecated:** Use `&&&` operator or `bitwiseAnd` instead.\n\n## Examples\n\n```rescript\nBigInt.land(7n, 4n) == 4n\n```" - ], - "signature": "let land: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lor", - "kind": "value", - "name": "lor", - "docstrings": [ - "`lor(a, b)` calculates the bitwise OR of two bigints.\n\n**Deprecated:** Use `|||` operator or `bitwiseOr` instead.\n\n## Examples\n\n```rescript\nBigInt.lor(7n, 4n) == 7n\n```" - ], - "signature": "let lor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lxor", - "kind": "value", - "name": "lxor", - "docstrings": [ - "`lxor(a, b)` calculates the bitwise XOR of two bigints.\n\n**Deprecated:** Use `^^^` operator or `bitwiseXor` instead.\n\n## Examples\n\n```rescript\nBigInt.lxor(7n, 4n) == 3n\n```" - ], - "signature": "let lxor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lnot", - "kind": "value", - "name": "lnot", - "docstrings": [ - "`lnot(bigint)` calculates the bitwise NOT of a bigint.\n\n**Deprecated:** Use `~~~` operator or `bitwiseNot` instead.\n\n## Examples\n\n```rescript\nBigInt.lnot(2n) == -3n\n```" - ], - "signature": "let lnot: bigint => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lsl", - "kind": "value", - "name": "lsl", - "docstrings": [ - "`lsl(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the left.\n\n**Deprecated:** Use `<<` operator or `shiftLeft` instead.\n\n## Examples\n\n```rescript\nBigInt.lsl(4n, 1n) == 8n\n```" - ], - "signature": "let lsl: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.asr", - "kind": "value", - "name": "asr", - "docstrings": [ - "`asr(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the right.\n\n**Deprecated:** Use `>>` operator or `shiftRight` instead.\n\n## Examples\n\n```rescript\nBigInt.asr(8n, 1n) == 4n\n```" - ], - "signature": "let asr: (bigint, bigint) => bigint", - "deprecated": "" - } - ] - }, - "stdlib/array": { - "id": "Stdlib.Array", - "name": "Array", - "docstrings": [ - "A mutable array.\n\nCompiles to a regular JavaScript array." - ], - "items": [ - { - "id": "Stdlib.Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an array of value `'a`." - ], - "signature": "type t<'a> = array<'a>" - }, - { - "id": "Stdlib.Array.arrayLike", - "kind": "type", - "name": "arrayLike", - "docstrings": [], - "signature": "type arrayLike<'a>" - }, - { - "id": "Stdlib.Array.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "`fromIterator(iterator)` creates an array from the provided `iterator`\n\n## Examples\n\n```rescript\nMap.fromArray([(\"foo\", 1), (\"bar\", 2)])\n->Map.values\n->Array.fromIterator == [1, 2]\n```" - ], - "signature": "let fromIterator: Iterator.t<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.fromArrayLike", - "kind": "value", - "name": "fromArrayLike", - "docstrings": [ - "`fromArrayLike(source)` converts an array-like value (anything with indexed items and a `length`) into a regular array.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 10, 1: 20, length: 2}`)\nArray.fromArrayLike(source) == [10, 20]\n```" - ], - "signature": "let fromArrayLike: arrayLike<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.fromArrayLikeWithMap", - "kind": "value", - "name": "fromArrayLikeWithMap", - "docstrings": [ - "`fromArrayLikeWithMap(source, map)` converts an array-like value into an array and applies `map` to every element.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 1, 1: 2, length: 2}`)\nArray.fromArrayLikeWithMap(source, x => x * 10) == [10, 20]\n```" - ], - "signature": "let fromArrayLikeWithMap: (arrayLike<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Stdlib.Array.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(str)` creates an array of each character as a separate string from the provided `str`.\n\n## Examples\n\n```rescript\nArray.fromString(\"abcde\") == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let fromString: string => array" - }, - { - "id": "Stdlib.Array.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(~length, init)` creates an array of length `length` initialized with the value of `init`.\n\n## Examples\n\n```rescript\nArray.make(~length=3, #apple) == [#apple, #apple, #apple]\nArray.make(~length=6, 7) == [7, 7, 7, 7, 7, 7]\n```" - ], - "signature": "let make: (~length: int, 'a) => array<'a>" - }, - { - "id": "Stdlib.Array.fromInitializer", - "kind": "value", - "name": "fromInitializer", - "docstrings": [ - "`fromInitializer(~length, f)`\n\nCreates an array of length `length` initialized with the value returned from `f ` for each index.\n\n## Examples\n\n```rescript\nArray.fromInitializer(~length=3, i => i + 3) == [3, 4, 5]\n\nArray.fromInitializer(~length=7, i => i + 3) == [3, 4, 5, 6, 7, 8, 9]\n```" - ], - "signature": "let fromInitializer: (~length: int, int => 'a) => array<'a>" - }, - { - "id": "Stdlib.Array.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(left, right, predicate)` checks if the two arrays contain the same elements according to the equality `predicate`.\n\n## Examples\n\n```rescript\nArray.equal([1, 2, 3], [1, 2, 3], Int.equal) == true\nArray.equal([1, 2, 3], [1, 3, 2], Int.equal) == false\n```" - ], - "signature": "let equal: (array<'a>, array<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Stdlib.Array.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(left, right, comparator)` compares two arrays element by element using `comparator` and returns an `Ordering`.\n\n## Examples\n\n```rescript\nArray.compare([1, 3], [1, 2], Int.compare) == Ordering.greater\nArray.compare([1, 2], [1, 2], Int.compare) == Ordering.equal\n```" - ], - "signature": "let compare: (array<'a>, array<'a>, ('a, 'a) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.Array.isArray", - "kind": "value", - "name": "isArray", - "docstrings": [ - "`isArray(value)` returns `true` when `value` is a JavaScript array and `false` otherwise.\n\nSee [`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) on MDN.\n\n## Examples\n\n```rescript\nArray.isArray([1, 2, 3]) == true\nArray.isArray(\"not an array\") == false\n```" - ], - "signature": "let isArray: 'a => bool" - }, - { - "id": "Stdlib.Array.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(array)` returns the length of (i.e. number of items in) the array.\n\nSee [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.length == 2\n```" - ], - "signature": "let length: array<'a> => int" - }, - { - "id": "Stdlib.Array.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\n[]->Array.isEmpty->assertEqual(true)\n[1, 2, 3]->Array.isEmpty->assertEqual(false)\n\nlet emptyArray = []\nemptyArray->Array.isEmpty->assertEqual(true)\n\nlet nonEmptyArray = [\"hello\"]\nnonEmptyArray->Array.isEmpty->assertEqual(false)\n```" - ], - "signature": "let isEmpty: array<'a> => bool" - }, - { - "id": "Stdlib.Array.copyAllWithin", - "kind": "value", - "name": "copyAllWithin", - "docstrings": [ - "`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyAllWithin(~target=2) == [100, 101, 100, 101, 102]\narr == [100, 101, 100, 101, 102]\n```" - ], - "signature": "let copyAllWithin: (array<'a>, ~target: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Array.copyWithinToEnd", - "kind": "value", - "name": "copyWithinToEnd", - "docstrings": [ - "`copyWithinToEnd(array, ~target, ~start)` copies starting at element `start` in the given array to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyWithinToEnd(~target=0, ~start=2) == [102, 103, 104, 103, 104]\narr == [102, 103, 104, 103, 104]\n```" - ], - "signature": "let copyWithinToEnd: (array<'a>, ~target: int, ~start: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [ - "`copyWithin(array, ~target, ~start, ~end)` copies starting at element `start` in the given array up to but not including `end` to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105]\narr->Array.copyWithin(~target=1, ~start=2, ~end=5) == [100, 102, 103, 104, 104, 105]\narr == [100, 102, 103, 104, 104, 105]\n```" - ], - "signature": "let copyWithin: (\n array<'a>,\n ~target: int,\n ~start: int,\n ~end: int=?,\n) => array<'a>" - }, - { - "id": "Stdlib.Array.fillAll", - "kind": "value", - "name": "fillAll", - "docstrings": [ - "`fillAll(array, value)` fills the entire `array` with `value`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillAll(9)\nmyArray == [9, 9, 9, 9]\n```" - ], - "signature": "let fillAll: (array<'a>, 'a) => unit", - "deprecated": "" - }, - { - "id": "Stdlib.Array.fillToEnd", - "kind": "value", - "name": "fillToEnd", - "docstrings": [ - "`fillToEnd(array, value, ~start)` fills `array` with `value` from the `start` index.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillToEnd(9, ~start=1)\nmyArray == [1, 9, 9, 9]\n```" - ], - "signature": "let fillToEnd: (array<'a>, 'a, ~start: int) => unit", - "deprecated": "" - }, - { - "id": "Stdlib.Array.fill", - "kind": "value", - "name": "fill", - "docstrings": [ - "`fill(array, value, ~start, ~end)` fills `array` with `value` from `start` to `end`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\n\nmyArray->Array.fill(9)\nmyArray == [9, 9, 9, 9]\n\nmyArray->Array.fill(0, ~start=1)\nmyArray == [9, 0, 0, 0]\n\nmyArray->Array.fill(5, ~start=1, ~end=3)\nmyArray == [9, 5, 5, 0]\n```" - ], - "signature": "let fill: (array<'a>, 'a, ~start: int=?, ~end: int=?) => unit" - }, - { - "id": "Stdlib.Array.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "`pop(array)` removes the last item from `array` and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pop == Some(\"hello\")\n\nsomeArray == [\"hi\"] // Notice last item is gone.\n```" - ], - "signature": "let pop: array<'a> => option<'a>" - }, - { - "id": "Stdlib.Array.push", - "kind": "value", - "name": "push", - "docstrings": [ - "`push(array, item)` appends `item` to the end of `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.push(\"yay\")\n\nsomeArray == [\"hi\", \"hello\", \"yay\"]\n```" - ], - "signature": "let push: (array<'a>, 'a) => unit" - }, - { - "id": "Stdlib.Array.pushMany", - "kind": "value", - "name": "pushMany", - "docstrings": [ - "`pushMany(array, itemsArray)` appends many new items to the end of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pushMany([\"yay\", \"wehoo\"])\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let pushMany: (array<'a>, array<'a>) => unit" - }, - { - "id": "Stdlib.Array.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(array)` reverses the order of the items in `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.reverse\n\nsomeArray == [\"hello\", \"hi\"]\n```" - ], - "signature": "let reverse: array<'a> => unit" - }, - { - "id": "Stdlib.Array.shift", - "kind": "value", - "name": "shift", - "docstrings": [ - "`shift(array)` removes the first item in the array, and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.shift == Some(\"hi\")\n\nsomeArray == [\"hello\"] // Notice first item is gone.\n```" - ], - "signature": "let shift: array<'a> => option<'a>" - }, - { - "id": "Stdlib.Array.toSorted", - "kind": "value", - "name": "toSorted", - "docstrings": [ - "`toSorted(array, comparator)` returns a new, sorted array from `array`, using the `comparator` function.\n\nSee [`Array.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [3, 2, 1]\n\nsomeArray->Array.toSorted(Int.compare) == [1, 2, 3]\n\nsomeArray == [3, 2, 1] // Original unchanged\n```" - ], - "signature": "let toSorted: (array<'a>, ('a, 'a) => Ordering.t) => array<'a>" - }, - { - "id": "Stdlib.Array.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(array, comparator)` sorts `array` in-place using the `comparator` function.\n\nBeware this will *mutate* the array.\n\nSee [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet array = [3, 2, 1]\narray->Array.sort((a, b) => float(a - b))\narray == [1, 2, 3]\n```" - ], - "signature": "let sort: (array<'a>, ('a, 'a) => Ordering.t) => unit" - }, - { - "id": "Stdlib.Array.splice", - "kind": "value", - "name": "splice", - "docstrings": [ - "`splice(array, ~start, ~remove, ~insert)` removes `remove` items starting at `start` and inserts the values from `insert`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) on MDN.\n\n## Examples\n\n```rescript\nlet items = [\"a\", \"b\", \"c\"]\nitems->Array.splice(~start=1, ~remove=1, ~insert=[\"x\"])\nitems == [\"a\", \"x\", \"c\"]\n```" - ], - "signature": "let splice: (\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => unit" - }, - { - "id": "Stdlib.Array.toSpliced", - "kind": "value", - "name": "toSpliced", - "docstrings": [ - "`toSpliced(array, ~start, ~remove, ~insert)` returns a new array with the same edits that `splice` would perform, leaving the original unchanged.\n\nSee [`Array.toSpliced`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced) on MDN.\n\n## Examples\n\n```rescript\nlet original = [1, 2, 3]\nlet updated = original->Array.toSpliced(~start=1, ~remove=1, ~insert=[10])\nupdated == [1, 10, 3]\noriginal == [1, 2, 3]\n```" - ], - "signature": "let toSpliced: (\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => array<'a>" - }, - { - "id": "Stdlib.Array.removeInPlace", - "kind": "value", - "name": "removeInPlace", - "docstrings": [ - "`removeInPlace(array, index)` removes the item at the specified `index` from `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = []\narray->Array.removeInPlace(0)\narray == [] // Removing from an empty array does nothing\n\nlet array2 = [\"Hello\", \"Hi\", \"Good bye\"]\narray2->Array.removeInPlace(1)\narray2 == [\"Hello\", \"Good bye\"] // Removes the item at index 1\n```" - ], - "signature": "let removeInPlace: (array<'a>, int) => unit" - }, - { - "id": "Stdlib.Array.with", - "kind": "value", - "name": "with", - "docstrings": [ - "`with(array, index, value)` returns a copy of `array` where the element at `index` is replaced with `value`.\n\nSee [`Array.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/with) on MDN.\n\n## Examples\n\n```rescript\nlet original = [\"a\", \"b\", \"c\"]\nlet replaced = original->Array.with(1, \"x\")\nreplaced == [\"a\", \"x\", \"c\"]\noriginal == [\"a\", \"b\", \"c\"]\n```" - ], - "signature": "let with: (array<'a>, int, 'a) => array<'a>" - }, - { - "id": "Stdlib.Array.unshift", - "kind": "value", - "name": "unshift", - "docstrings": [ - "`unshift(array, item)` inserts a new item at the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshift(\"yay\")\nsomeArray == [\"yay\", \"hi\", \"hello\"]\n```" - ], - "signature": "let unshift: (array<'a>, 'a) => unit" - }, - { - "id": "Stdlib.Array.unshiftMany", - "kind": "value", - "name": "unshiftMany", - "docstrings": [ - "`unshiftMany(array, itemsArray)` inserts many new items to the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshiftMany([\"yay\", \"wehoo\"])\nsomeArray == [\"yay\", \"wehoo\", \"hi\", \"hello\"]\n```" - ], - "signature": "let unshiftMany: (array<'a>, array<'a>) => unit" - }, - { - "id": "Stdlib.Array.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(array1, array2)` concatenates the two arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\", \"wehoo\"]\n\nlet someArray = array1->Array.concat(array2)\n\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let concat: (array<'a>, array<'a>) => array<'a>" - }, - { - "id": "Stdlib.Array.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(array1, arrays)` concatenates array1 with several other arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\"]\nlet array3 = [\"wehoo\"]\n\nlet someArray = array1->Array.concatMany([array2, array3])\n\nConsole.log(someArray) // [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let concatMany: (array<'a>, array>) => array<'a>" - }, - { - "id": "Stdlib.Array.flat", - "kind": "value", - "name": "flat", - "docstrings": [ - "`flat(arrays)` concatenates an array of arrays into a single array.\n\nSee [`Array.flat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) on MDN.\n\n## Examples\n\n```rescript\n[[1], [2], [3, 4]]->Array.flat == [1, 2, 3, 4]\n```" - ], - "signature": "let flat: array> => array<'a>" - }, - { - "id": "Stdlib.Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "`includes(array, item)` checks whether `array` includes `item`, by doing a [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality).\n\nSee [`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.includes(1) == true\n[1, 2]->Array.includes(3) == false\n\n[{\"language\": \"ReScript\"}]->Array.includes({\"language\": \"ReScript\"}) == false // false, because of strict equality\n```" - ], - "signature": "let includes: (array<'a>, 'a) => bool" - }, - { - "id": "Stdlib.Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "`indexOf(array, item, ~from)` returns the index of the provided `item` in `array`, starting the search at `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.indexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOf(2) == 1\n[1, 2]->Array.indexOf(3) == -1\n[1, 2, 1, 2]->Array.indexOf(2, ~from=2) == 3\n\n[{\"language\": \"ReScript\"}]->Array.indexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```" - ], - "signature": "let indexOf: (array<'a>, 'a, ~from: int=?) => int" - }, - { - "id": "Stdlib.Array.indexOfOpt", - "kind": "value", - "name": "indexOfOpt", - "docstrings": [ - "`indexOfOpt(array, item)` returns an option of the index of the provided `item` in `array`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOfOpt(2) == Some(1)\n[1, 2]->Array.indexOfOpt(3) == None\n[{\"language\": \"ReScript\"}]->Array.indexOfOpt({\"language\": \"ReScript\"}) == None // None, because of strict equality\n```" - ], - "signature": "let indexOfOpt: (array<'a>, 'a) => option" - }, - { - "id": "Stdlib.Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (array<'a>, 'a, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Array.join", - "kind": "value", - "name": "join", - "docstrings": [ - "`join(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.join(\" -- \") == \"One -- Two -- Three\"\n```" - ], - "signature": "let join: (array, string) => string" - }, - { - "id": "Stdlib.Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "`joinWith(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinWithUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.joinWith(\" -- \") == \"One -- Two -- Three\"\n```" - ], - "signature": "let joinWith: (array, string) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Array.joinUnsafe", - "kind": "value", - "name": "joinUnsafe", - "docstrings": [ - "`joinUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```" - ], - "signature": "let joinUnsafe: (array<'a>, string) => string" - }, - { - "id": "Stdlib.Array.joinWithUnsafe", - "kind": "value", - "name": "joinWithUnsafe", - "docstrings": [ - "`joinWithUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinWithUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```" - ], - "signature": "let joinWithUnsafe: (array<'a>, string) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(array, item, ~from)` returns the last index of the provided `item` in `array`, searching backwards from `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.lastIndexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 1, 2]->Array.lastIndexOf(2) == 3\n[1, 2]->Array.lastIndexOf(3) == -1\n[1, 2, 1, 2]->Array.lastIndexOf(2, ~from=2) == 1\n\n[{\"language\": \"ReScript\"}]->Array.lastIndexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```" - ], - "signature": "let lastIndexOf: (array<'a>, 'a, ~from: int=?) => int" - }, - { - "id": "Stdlib.Array.lastIndexOfOpt", - "kind": "value", - "name": "lastIndexOfOpt", - "docstrings": [], - "signature": "let lastIndexOfOpt: (array<'a>, 'a) => option" - }, - { - "id": "Stdlib.Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (array<'a>, 'a, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(array, ~start, ~end)` creates a new array of items copied from `array` from `start` until (but not including) `end`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.slice(~start=1, ~end=3) == [2, 3]\n[1, 2, 3, 4]->Array.slice(~start=1) == [2, 3, 4]\n[1, 2, 3, 4]->Array.slice == [1, 2, 3, 4]\n```" - ], - "signature": "let slice: (array<'a>, ~start: int=?, ~end: int=?) => array<'a>" - }, - { - "id": "Stdlib.Array.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(array, start)` creates a new array from `array`, with all items from `array` starting from `start`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.sliceToEnd(~start=1) == [2, 3, 4]\n```" - ], - "signature": "let sliceToEnd: (array<'a>, ~start: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(array)` makes a copy of the array with the items in it, but does not make copies of the items themselves.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3]\nlet copyOfMyArray = myArray->Array.copy\n\ncopyOfMyArray == [1, 2, 3]\n(myArray === copyOfMyArray) == false\n```" - ], - "signature": "let copy: array<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(array)` stringifies `array` by running `toString` on all of the array elements and joining them with \",\".\n\nSee [`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.toString == \"1,2,3,4\"\n```" - ], - "signature": "let toString: array<'a> => string" - }, - { - "id": "Stdlib.Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(array)` converts each element to a locale-aware string and joins them with commas.\n\nSee [`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n[\"apple\", \"banana\"]->Array.toLocaleString == \"apple,banana\"\n```" - ], - "signature": "let toLocaleString: array<'a> => string" - }, - { - "id": "Stdlib.Array.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(array, predicate)` returns true if `predicate` returns true for all items in `array`.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.every(num => num <= 4) == true\n\narray->Array.every(num => num === 1) == false\n```" - ], - "signature": "let every: (array<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Array.everyWithIndex", - "kind": "value", - "name": "everyWithIndex", - "docstrings": [ - "`everyWithIndex(array, checker)` returns true if all items in `array` returns true when running the provided `checker` function.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.everyWithIndex((num, index) => index < 5 && num <= 4) == true\n\narray->Array.everyWithIndex((num, index) => index < 2 && num >= 2) == false\n```" - ], - "signature": "let everyWithIndex: (array<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filter(num => num > 2) == [3, 4]\n```" - ], - "signature": "let filter: (array<'a>, 'a => bool) => array<'a>" - }, - { - "id": "Stdlib.Array.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filterWithIndex((num, index) => index === 0 || num === 2) == [1, 2]\n```" - ], - "signature": "let filterWithIndex: (array<'a>, ('a, int) => bool) => array<'a>" - }, - { - "id": "Stdlib.Array.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.find(item => item == ReScript) == Some(ReScript)\n```" - ], - "signature": "let find: (array<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findWithIndex", - "kind": "value", - "name": "findWithIndex", - "docstrings": [ - "`findWithIndex(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [TypeScript, JavaScript, ReScript]\n\narray->Array.findWithIndex((item, index) => index > 1 && item == ReScript) == Some(ReScript)\n```" - ], - "signature": "let findWithIndex: (array<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findLast", - "kind": "value", - "name": "findLast", - "docstrings": [ - "`findLast(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLast(item => item > 0) == Some(3)\n```" - ], - "signature": "let findLast: (array<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findLastWithIndex", - "kind": "value", - "name": "findLastWithIndex", - "docstrings": [ - "`findLastWithIndex(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLastWithIndex((item, index) => index < 2 && item > 0) == Some(2)\n```" - ], - "signature": "let findLastWithIndex: (array<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [ - "`findIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\narray->Array.findIndex(item => item == ReScript) == 0\n\narray->Array.findIndex(item => item == TypeScript) == -1\n```" - ], - "signature": "let findIndex: (array<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.Array.findIndexWithIndex", - "kind": "value", - "name": "findIndexWithIndex", - "docstrings": [ - "`findIndexWithIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\nlet isReScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == ReScript)\nlet isTypeScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == TypeScript)\n\nisReScriptFirst == 0\nisTypeScriptFirst == -1\n```" - ], - "signature": "let findIndexWithIndex: (array<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.Array.findLastIndex", - "kind": "value", - "name": "findLastIndex", - "docstrings": [ - "`findLastIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, ReScript]\n\narray->Array.findLastIndex(item => item == ReScript) == 2\n\narray->Array.findLastIndex(item => item == TypeScript) == -1\n```" - ], - "signature": "let findLastIndex: (array<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.Array.findLastIndexWithIndex", - "kind": "value", - "name": "findLastIndexWithIndex", - "docstrings": [ - "`findLastIndexWithIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, JavaScript, ReScript]\n\nlet isReScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == ReScript)\nlet isTypeScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == TypeScript)\n\nisReScriptLast == 3\nisTypeScriptLast == -1\n```" - ], - "signature": "let findLastIndexWithIndex: (array<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEach(item => {\n Console.log(item)\n})\n```" - ], - "signature": "let forEach: (array<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Array.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEachWithIndex((item, index) => {\n Console.log(\"At item \" ++ Int.toString(index) ++ \": \" ++ item)\n})\n```" - ], - "signature": "let forEachWithIndex: (array<'a>, ('a, int) => unit) => unit" - }, - { - "id": "Stdlib.Array.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```" - ], - "signature": "let map: (array<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Stdlib.Array.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```" - ], - "signature": "let mapWithIndex: (array<'a>, ('a, int) => 'b) => array<'b>" - }, - { - "id": "Stdlib.Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(xs, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has two parameters: the item from the list and an \"accumulator\"; which starts with a value of `init`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\nArray.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n\n[1, 2, 3]->Array.reduce(list{}, List.add) == list{3, 2, 1}\n\nArray.reduce([], list{}, List.add) == list{}\n```" - ], - "signature": "let reduce: (array<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(x, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has three parameters: the item from the array and an \"accumulator\", which starts with a value of `init` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceWithIndex([1, 2, 3], list{}, (acc, v, i) => list{v + i, ...acc}) == list{5, 3, 1}\n\nArray.reduceWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```" - ], - "signature": "let reduceWithIndex: (array<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [ - "`reduceRight(xs, init, fn)`\n\nWorks like `Array.reduce`; except that function `fn` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nArray.reduceRight([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n\nArray.reduceRight([1, 2, 3], list{}, List.add) == list{1, 2, 3}\n\nArray.reduceRight([], list{}, List.add) == list{}\n```" - ], - "signature": "let reduceRight: (array<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.reduceRightWithIndex", - "kind": "value", - "name": "reduceRightWithIndex", - "docstrings": [ - "`reduceRightWithIndex(xs, init, fn)`\n\nLike `reduceRight`, but with an additional index argument on the callback function.\n\n## Examples\n\n```rescript\nArray.reduceRightWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceRightWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```" - ], - "signature": "let reduceRightWithIndex: (array<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(array, predicate)` returns true if `predicate` returns true for any element in `array`.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.some(greeting => greeting === \"Hello\") == true\n```" - ], - "signature": "let some: (array<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Array.someWithIndex", - "kind": "value", - "name": "someWithIndex", - "docstrings": [ - "`someWithIndex(array, checker)` returns true if running the provided `checker` function on any element in `array` returns true.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.someWithIndex((greeting, index) => greeting === \"Hello\" && index === 0) == true\n```" - ], - "signature": "let someWithIndex: (array<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.Array.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(array, index)` returns the element at `index` of `array`.\n\nReturns `None` if the index does not exist in the array. Equivalent to doing `array[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.get(0) == Some(\"Hello\")\n\narray->Array.get(3) == None\n```" - ], - "signature": "let get: (array<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.Array.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.set(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```" - ], - "signature": "let set: (array<'a>, int, 'a) => unit" - }, - { - "id": "Stdlib.Array.getSymbol", - "kind": "value", - "name": "getSymbol", - "docstrings": [ - "`getSymbol(array, key)` retrieves the value stored under the symbol `key`, if present.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN for more details about symbol keys.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbol(items, key) == Some(\"hello\")\n```" - ], - "signature": "let getSymbol: (array<'a>, Symbol.t) => option<'b>" - }, - { - "id": "Stdlib.Array.getSymbolUnsafe", - "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [ - "`getSymbolUnsafe(array, key)` retrieves the value stored under the symbol `key` without any safety checks.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbolUnsafe(items, key) == \"hello\"\n```" - ], - "signature": "let getSymbolUnsafe: (array<'a>, Symbol.t) => 'b" - }, - { - "id": "Stdlib.Array.setSymbol", - "kind": "value", - "name": "setSymbol", - "docstrings": [ - "`setSymbol(array, key, value)` stores `value` under the symbol `key` on `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"count\")\nlet items = []\nitems->Array.setSymbol(key, 5)\nArray.getSymbol(items, key) == Some(5)\n```" - ], - "signature": "let setSymbol: (array<'a>, Symbol.t, 'b) => unit" - }, - { - "id": "Stdlib.Array.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.getUnsafe` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.getUnsafe(index)\n Console.log(value)\n}\n```" - ], - "signature": "let getUnsafe: (array<'a>, int) => 'a" - }, - { - "id": "Stdlib.Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [ - "`unsafe_get(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.unsafe_get` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.unsafe_get(index)\n Console.log(value)\n}\n```" - ], - "signature": "let unsafe_get: (array<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Array.setUnsafe", - "kind": "value", - "name": "setUnsafe", - "docstrings": [ - "`setUnsafe(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array, and is *unsafe*.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.setUnsafe(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```" - ], - "signature": "let setUnsafe: (array<'a>, int, 'a) => unit" - }, - { - "id": "Stdlib.Array.findIndexOpt", - "kind": "value", - "name": "findIndexOpt", - "docstrings": [ - "`findIndexOpt(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.findIndexOpt(item => item == ReScript) == Some(0)\n```" - ], - "signature": "let findIndexOpt: (array<'a>, 'a => bool) => option" - }, - { - "id": "Stdlib.Array.findLastIndexOpt", - "kind": "value", - "name": "findLastIndexOpt", - "docstrings": [ - "`findIndexOpt(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"hello\", \"world\", \"!\"]\n\narray->Array.findLastIndexOpt(item => item->String.includes(\"o\")) == Some(1)\n```" - ], - "signature": "let findLastIndexOpt: (array<'a>, 'a => bool) => option" - }, - { - "id": "Stdlib.Array.toReversed", - "kind": "value", - "name": "toReversed", - "docstrings": [ - "`toReversed(array)` creates a new array with all items from `array` in reversed order.\n\nSee [`Array.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nlet reversed = someArray->Array.toReversed\n\nreversed == [\"hello\", \"hi\"]\nsomeArray == [\"hi\", \"hello\"] // Original unchanged\n```" - ], - "signature": "let toReversed: array<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.filterMap", - "kind": "value", - "name": "filterMap", - "docstrings": [ - "`filterMap(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMap(item =>\n switch item {\n | \"Hello\" => Some(item->String.length)\n | _ => None\n }\n) == [5]\n\n[1, 2, 3, 4, 5, 6]->Array.filterMap(n => mod(n, 2) == 0 ? Some(n * n) : None) == [4, 16, 36]\n\nArray.filterMap([1, 2, 3, 4, 5, 6], _ => None) == []\n\nArray.filterMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == []\n```" - ], - "signature": "let filterMap: (array<'a>, 'a => option<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.filterMapWithIndex", - "kind": "value", - "name": "filterMapWithIndex", - "docstrings": [ - "`filterMapWithIndex(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMapWithIndex((item, index) =>\n switch item {\n | \"Hello\" => Some(index)\n | _ => None\n }\n) == [0]\n```" - ], - "signature": "let filterMapWithIndex: (array<'a>, ('a, int) => option<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.keepSome", - "kind": "value", - "name": "keepSome", - "docstrings": [ - "`keepSome(arr)`\n\nReturns a new array containing `value` for all elements that are `Some(value)`\nand ignoring every value that is `None`\n\n## Examples\n\n```rescript\nArray.keepSome([Some(1), None, Some(3)]) == [1, 3]\n\nArray.keepSome([Some(1), Some(2), Some(3)]) == [1, 2, 3]\n\nArray.keepSome([None, None, None]) == []\n\nArray.keepSome([]) == []\n```" - ], - "signature": "let keepSome: array> => array<'a>" - }, - { - "id": "Stdlib.Array.toShuffled", - "kind": "value", - "name": "toShuffled", - "docstrings": [ - "`toShuffled(array)` returns a new array with all items in `array` in a random order.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet shuffledArray = array->Array.toShuffled\nConsole.log(shuffledArray)\n\nArray.toShuffled([1, 2, 3])->Array.length == 3\n```" - ], - "signature": "let toShuffled: array<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "`shuffle(array)` randomizes the position of all items in `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.shuffle\nConsole.log(array)\n\nlet array2 = [1, 2, 3]\narray2->Array.shuffle\n\narray2->Array.length == 3\n```" - ], - "signature": "let shuffle: array<'a> => unit" - }, - { - "id": "Stdlib.Array.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMap(item =>\n switch item {\n | ReScript => [1, 2, 3]\n | TypeScript => [4, 5, 6]\n | JavaScript => [7, 8, 9]\n }\n) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\n```" - ], - "signature": "let flatMap: (array<'a>, 'a => array<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.flatMapWithIndex", - "kind": "value", - "name": "flatMapWithIndex", - "docstrings": [ - "`flatMapWithIndex(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMapWithIndex((item, index) =>\n switch item {\n | ReScript => [index]\n | TypeScript => [index, index + 1]\n | JavaScript => [index, index + 1, index + 2]\n }\n) == [0, 1, 2, 2, 3, 4]\n```" - ], - "signature": "let flatMapWithIndex: (array<'a>, ('a, int) => array<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.findMap", - "kind": "value", - "name": "findMap", - "docstrings": [ - "`findMap(arr, fn)`\n\nCalls `fn` for each element and returns the first value from `fn` that is `Some(_)`.\nOtherwise returns `None`\n\n## Examples\n\n```rescript\nArray.findMap([1, 2, 3], n => mod(n, 2) == 0 ? Some(n - 2) : None) == Some(0)\n\nArray.findMap([1, 2, 3, 4, 5, 6], n => mod(n, 2) == 0 ? Some(n - 8) : None) == Some(-6)\n\nArray.findMap([1, 2, 3, 4, 5, 6], _ => None) == None\n\nArray.findMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == None\n```" - ], - "signature": "let findMap: (array<'a>, 'a => option<'b>) => option<'b>" - }, - { - "id": "Stdlib.Array.at", - "kind": "value", - "name": "at", - "docstrings": [ - "`at(array, index)`\n\nGet an element by its index. Negative indices count backwards from the last item.\n\n## Examples\n\n```rescript\n[\"a\", \"b\", \"c\"]->Array.at(0) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(2) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(3) == None\n[\"a\", \"b\", \"c\"]->Array.at(-1) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(-3) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(-4) == None\n```" - ], - "signature": "let at: (array<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.Array.last", - "kind": "value", - "name": "last", - "docstrings": [ - "`last(array)` returns the last element of `array`.\n\nReturns `None` if the array is empty.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.last == Some(\"Good bye\")\n\n[]->Array.last == None\n```" - ], - "signature": "let last: array<'a> => option<'a>" - }, - { - "id": "Stdlib.Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(array)` ignores the provided array and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: array<'a> => unit" - }, - { - "id": "Stdlib.Array.entries", - "kind": "value", - "name": "entries", - "docstrings": [ - "`entries(array)` returns a new array iterator object that contains the key/value pairs for each index in the array.\n\nSee [Array.prototype.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: Iterator.t<(int, int)> = array->Array.entries\niterator->Iterator.next == {done: false, value: Some((0, 5))}\niterator->Iterator.next == {done: false, value: Some((1, 6))}\n```" - ], - "signature": "let entries: array<'a> => Iterator.t<(int, 'a)>" - }, - { - "id": "Stdlib.Array.values", - "kind": "value", - "name": "values", - "docstrings": [ - "`values(array)` returns a new array iterator object that contains the values for each index in the array.\n\nSee [Array.prototype.values](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: Iterator.t = array->Array.values\niterator->Iterator.next == {done: false, value: Some(5)}\niterator->Iterator.next == {done: false, value: Some(6)}\n```" - ], - "signature": "let values: array<'a> => Iterator.t<'a>" - } - ] - }, - "stdlib/intervalid": { - "id": "Stdlib.IntervalId", - "name": "IntervalId", - "docstrings": [], - "items": [] - }, - "stdlib/timeoutid": { - "id": "Stdlib.TimeoutId", - "name": "TimeoutId", - "docstrings": [], - "items": [] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v12.0.1/toc_tree.json b/apps/docs/data/api/v12.0.1/toc_tree.json deleted file mode 100644 index 7304b0e63..000000000 --- a/apps/docs/data/api/v12.0.1/toc_tree.json +++ /dev/null @@ -1 +0,0 @@ -{"belt":{"name":"Belt","path":["belt"],"children":[{"name":"Float","path":["belt","float"],"children":[]},{"name":"Int","path":["belt","int"],"children":[]},{"name":"Result","path":["belt","result"],"children":[]},{"name":"Option","path":["belt","option"],"children":[]},{"name":"HashMap","path":["belt","hashmap"],"children":[{"name":"String","path":["belt","hashmap","string"],"children":[]},{"name":"Int","path":["belt","hashmap","int"],"children":[]}]},{"name":"HashSet","path":["belt","hashset"],"children":[{"name":"String","path":["belt","hashset","string"],"children":[]},{"name":"Int","path":["belt","hashset","int"],"children":[]}]},{"name":"MutableMap","path":["belt","mutablemap"],"children":[{"name":"String","path":["belt","mutablemap","string"],"children":[]},{"name":"Int","path":["belt","mutablemap","int"],"children":[]}]},{"name":"MutableSet","path":["belt","mutableset"],"children":[{"name":"String","path":["belt","mutableset","string"],"children":[]},{"name":"Int","path":["belt","mutableset","int"],"children":[]}]},{"name":"Map","path":["belt","map"],"children":[{"name":"Dict","path":["belt","map","dict"],"children":[]},{"name":"String","path":["belt","map","string"],"children":[]},{"name":"Int","path":["belt","map","int"],"children":[]}]},{"name":"Set","path":["belt","set"],"children":[{"name":"Dict","path":["belt","set","dict"],"children":[]},{"name":"String","path":["belt","set","string"],"children":[]},{"name":"Int","path":["belt","set","int"],"children":[]}]},{"name":"Range","path":["belt","range"],"children":[]},{"name":"List","path":["belt","list"],"children":[]},{"name":"MutableStack","path":["belt","mutablestack"],"children":[]},{"name":"MutableQueue","path":["belt","mutablequeue"],"children":[]},{"name":"SortArray","path":["belt","sortarray"],"children":[{"name":"String","path":["belt","sortarray","string"],"children":[]},{"name":"Int","path":["belt","sortarray","int"],"children":[]}]},{"name":"Array","path":["belt","array"],"children":[]},{"name":"Id","path":["belt","id"],"children":[{"name":"MakeHashable","path":["belt","id","makehashable"],"children":[]},{"name":"MakeHashableU","path":["belt","id","makehashableu"],"children":[]},{"name":"MakeComparable","path":["belt","id","makecomparable"],"children":[]},{"name":"MakeComparableU","path":["belt","id","makecomparableu"],"children":[]}]}]},"dom":{"name":"Dom","path":["dom"],"children":[{"name":"Storage2","path":["dom","storage2"],"children":[]},{"name":"Storage","path":["dom","storage"],"children":[]}]},"js":{"name":"Js","path":["js"],"children":[{"name":"WeakMap","path":["js","weakmap"],"children":[]},{"name":"Map","path":["js","map"],"children":[]},{"name":"WeakSet","path":["js","weakset"],"children":[]},{"name":"Set","path":["js","set"],"children":[]},{"name":"Console","path":["js","console"],"children":[]},{"name":"Result","path":["js","result"],"children":[]},{"name":"Option","path":["js","option"],"children":[]},{"name":"Blob","path":["js","blob"],"children":[]},{"name":"File","path":["js","file"],"children":[]},{"name":"BigInt","path":["js","bigint"],"children":[]},{"name":"Int","path":["js","int"],"children":[]},{"name":"Float","path":["js","float"],"children":[]},{"name":"Types","path":["js","types"],"children":[]},{"name":"TypedArray2","path":["js","typedarray2"],"children":[{"name":"DataView","path":["js","typedarray2","dataview"],"children":[]},{"name":"Float64Array","path":["js","typedarray2","float64array"],"children":[]},{"name":"Float32Array","path":["js","typedarray2","float32array"],"children":[]},{"name":"Uint32Array","path":["js","typedarray2","uint32array"],"children":[]},{"name":"Int32Array","path":["js","typedarray2","int32array"],"children":[]},{"name":"Uint16Array","path":["js","typedarray2","uint16array"],"children":[]},{"name":"Int16Array","path":["js","typedarray2","int16array"],"children":[]},{"name":"Uint8ClampedArray","path":["js","typedarray2","uint8clampedarray"],"children":[]},{"name":"Uint8Array","path":["js","typedarray2","uint8array"],"children":[]},{"name":"Int8Array","path":["js","typedarray2","int8array"],"children":[]},{"name":"ArrayBuffer","path":["js","typedarray2","arraybuffer"],"children":[]}]},{"name":"Typed_array","path":["js","typed_array"],"children":[{"name":"DataView","path":["js","typed_array","dataview"],"children":[]},{"name":"Float64_array","path":["js","typed_array","float64_array"],"children":[]},{"name":"Float64Array","path":["js","typed_array","float64array"],"children":[]},{"name":"Float32_array","path":["js","typed_array","float32_array"],"children":[]},{"name":"Float32Array","path":["js","typed_array","float32array"],"children":[]},{"name":"Uint32Array","path":["js","typed_array","uint32array"],"children":[]},{"name":"Int32_array","path":["js","typed_array","int32_array"],"children":[]},{"name":"Int32Array","path":["js","typed_array","int32array"],"children":[]},{"name":"Uint16Array","path":["js","typed_array","uint16array"],"children":[]},{"name":"Int16Array","path":["js","typed_array","int16array"],"children":[]},{"name":"Uint8ClampedArray","path":["js","typed_array","uint8clampedarray"],"children":[]},{"name":"Uint8Array","path":["js","typed_array","uint8array"],"children":[]},{"name":"Int8Array","path":["js","typed_array","int8array"],"children":[]},{"name":"S","path":["js","typed_array","s"],"children":[]},{"name":"ArrayBuffer","path":["js","typed_array","arraybuffer"],"children":[]},{"name":"Type","path":["js","typed_array","type"],"children":[]}]},{"name":"Obj","path":["js","obj"],"children":[]},{"name":"Math","path":["js","math"],"children":[]},{"name":"Json","path":["js","json"],"children":[{"name":"Kind","path":["js","json","kind"],"children":[]}]},{"name":"Global","path":["js","global"],"children":[]},{"name":"Dict","path":["js","dict"],"children":[]},{"name":"Date","path":["js","date"],"children":[]},{"name":"Promise2","path":["js","promise2"],"children":[]},{"name":"Promise","path":["js","promise"],"children":[]},{"name":"Re","path":["js","re"],"children":[]},{"name":"String2","path":["js","string2"],"children":[]},{"name":"String","path":["js","string"],"children":[]},{"name":"Array2","path":["js","array2"],"children":[]},{"name":"Array","path":["js","array"],"children":[]},{"name":"Exn","path":["js","exn"],"children":[]},{"name":"Null_undefined","path":["js","null_undefined"],"children":[]},{"name":"Nullable","path":["js","nullable"],"children":[]},{"name":"Undefined","path":["js","undefined"],"children":[]},{"name":"Null","path":["js","null"],"children":[]}]},"stdlib":{"name":"Stdlib","path":["stdlib"],"children":[{"name":"BigUint64Array","path":["stdlib","biguint64array"],"children":[{"name":"Constants","path":["stdlib","biguint64array","constants"],"children":[]}]},{"name":"BigInt64Array","path":["stdlib","bigint64array"],"children":[{"name":"Constants","path":["stdlib","bigint64array","constants"],"children":[]}]},{"name":"Uint8ClampedArray","path":["stdlib","uint8clampedarray"],"children":[{"name":"Constants","path":["stdlib","uint8clampedarray","constants"],"children":[]}]},{"name":"Uint32Array","path":["stdlib","uint32array"],"children":[{"name":"Constants","path":["stdlib","uint32array","constants"],"children":[]}]},{"name":"Uint16Array","path":["stdlib","uint16array"],"children":[{"name":"Constants","path":["stdlib","uint16array","constants"],"children":[]}]},{"name":"Uint8Array","path":["stdlib","uint8array"],"children":[{"name":"Constants","path":["stdlib","uint8array","constants"],"children":[]}]},{"name":"Int32Array","path":["stdlib","int32array"],"children":[{"name":"Constants","path":["stdlib","int32array","constants"],"children":[]}]},{"name":"Int16Array","path":["stdlib","int16array"],"children":[{"name":"Constants","path":["stdlib","int16array","constants"],"children":[]}]},{"name":"Int8Array","path":["stdlib","int8array"],"children":[{"name":"Constants","path":["stdlib","int8array","constants"],"children":[]}]},{"name":"Float64Array","path":["stdlib","float64array"],"children":[{"name":"Constants","path":["stdlib","float64array","constants"],"children":[]}]},{"name":"Float32Array","path":["stdlib","float32array"],"children":[{"name":"Constants","path":["stdlib","float32array","constants"],"children":[]}]},{"name":"TypedArray","path":["stdlib","typedarray"],"children":[]},{"name":"ArrayBuffer","path":["stdlib","arraybuffer"],"children":[]},{"name":"WeakSet","path":["stdlib","weakset"],"children":[]},{"name":"Set","path":["stdlib","set"],"children":[]},{"name":"WeakMap","path":["stdlib","weakmap"],"children":[]},{"name":"Map","path":["stdlib","map"],"children":[]},{"name":"AsyncIterator","path":["stdlib","asynciterator"],"children":[]},{"name":"Iterator","path":["stdlib","iterator"],"children":[]},{"name":"Type","path":["stdlib","type"],"children":[{"name":"Classify","path":["stdlib","type","classify"],"children":[]}]},{"name":"Symbol","path":["stdlib","symbol"],"children":[]},{"name":"String","path":["stdlib","string"],"children":[]},{"name":"Result","path":["stdlib","result"],"children":[]},{"name":"RegExp","path":["stdlib","regexp"],"children":[{"name":"Result","path":["stdlib","regexp","result"],"children":[]}]},{"name":"Promise","path":["stdlib","promise"],"children":[]},{"name":"Pair","path":["stdlib","pair"],"children":[]},{"name":"Ordering","path":["stdlib","ordering"],"children":[]},{"name":"Option","path":["stdlib","option"],"children":[]},{"name":"Object","path":["stdlib","object"],"children":[]},{"name":"Nullable","path":["stdlib","nullable"],"children":[]},{"name":"Null","path":["stdlib","null"],"children":[]},{"name":"Math","path":["stdlib","math"],"children":[{"name":"Int","path":["stdlib","math","int"],"children":[]},{"name":"Constants","path":["stdlib","math","constants"],"children":[]}]},{"name":"List","path":["stdlib","list"],"children":[]},{"name":"Lazy","path":["stdlib","lazy"],"children":[]},{"name":"JSON","path":["stdlib","json"],"children":[{"name":"Decode","path":["stdlib","json","decode"],"children":[]},{"name":"Encode","path":["stdlib","json","encode"],"children":[]},{"name":"Classify","path":["stdlib","json","classify"],"children":[]}]},{"name":"JsExn","path":["stdlib","jsexn"],"children":[]},{"name":"JsError","path":["stdlib","jserror"],"children":[{"name":"URIError","path":["stdlib","jserror","urierror"],"children":[]},{"name":"TypeError","path":["stdlib","jserror","typeerror"],"children":[]},{"name":"SyntaxError","path":["stdlib","jserror","syntaxerror"],"children":[]},{"name":"ReferenceError","path":["stdlib","jserror","referenceerror"],"children":[]},{"name":"RangeError","path":["stdlib","jserror","rangeerror"],"children":[]},{"name":"EvalError","path":["stdlib","jserror","evalerror"],"children":[]}]},{"name":"Intl","path":["stdlib","intl"],"children":[{"name":"Segments","path":["stdlib","intl","segments"],"children":[]},{"name":"Segmenter","path":["stdlib","intl","segmenter"],"children":[]},{"name":"RelativeTimeFormat","path":["stdlib","intl","relativetimeformat"],"children":[]},{"name":"PluralRules","path":["stdlib","intl","pluralrules"],"children":[]},{"name":"NumberFormat","path":["stdlib","intl","numberformat"],"children":[{"name":"Grouping","path":["stdlib","intl","numberformat","grouping"],"children":[]}]},{"name":"Locale","path":["stdlib","intl","locale"],"children":[]},{"name":"ListFormat","path":["stdlib","intl","listformat"],"children":[]},{"name":"DateTimeFormat","path":["stdlib","intl","datetimeformat"],"children":[]},{"name":"Collator","path":["stdlib","intl","collator"],"children":[]},{"name":"Common","path":["stdlib","intl","common"],"children":[]}]},{"name":"Int","path":["stdlib","int"],"children":[{"name":"Ref","path":["stdlib","int","ref"],"children":[]},{"name":"Bitwise","path":["stdlib","int","bitwise"],"children":[]},{"name":"Constants","path":["stdlib","int","constants"],"children":[]}]},{"name":"Float","path":["stdlib","float"],"children":[{"name":"Constants","path":["stdlib","float","constants"],"children":[]}]},{"name":"Error","path":["stdlib","error"],"children":[{"name":"URIError","path":["stdlib","error","urierror"],"children":[]},{"name":"TypeError","path":["stdlib","error","typeerror"],"children":[]},{"name":"SyntaxError","path":["stdlib","error","syntaxerror"],"children":[]},{"name":"ReferenceError","path":["stdlib","error","referenceerror"],"children":[]},{"name":"RangeError","path":["stdlib","error","rangeerror"],"children":[]},{"name":"EvalError","path":["stdlib","error","evalerror"],"children":[]}]},{"name":"Exn","path":["stdlib","exn"],"children":[]},{"name":"Dict","path":["stdlib","dict"],"children":[]},{"name":"Date","path":["stdlib","date"],"children":[{"name":"UTC","path":["stdlib","date","utc"],"children":[]}]},{"name":"DataView","path":["stdlib","dataview"],"children":[]},{"name":"Console","path":["stdlib","console"],"children":[]},{"name":"Bool","path":["stdlib","bool"],"children":[]},{"name":"BigInt","path":["stdlib","bigint"],"children":[]},{"name":"Array","path":["stdlib","array"],"children":[]},{"name":"IntervalId","path":["stdlib","intervalid"],"children":[]},{"name":"TimeoutId","path":["stdlib","timeoutid"],"children":[]}]}} \ No newline at end of file diff --git a/apps/docs/data/api/v12.0.2/belt.json b/apps/docs/data/api/v12.0.2/belt.json deleted file mode 100644 index 74e7ee076..000000000 --- a/apps/docs/data/api/v12.0.2/belt.json +++ /dev/null @@ -1,9728 +0,0 @@ -{ - "belt": { - "id": "Belt", - "name": "Belt", - "docstrings": [ - "The ReScript standard library.\n\nBelt is currently mostly covering collection types. It has no string or date functions yet, although Belt.String is in the works. In the meantime, use [Js.String](js/string) for string functions and [Js.Date](js/date) for date functions.\n\n## Motivation\n\nBelt provides:\n\n- The **highest quality** immutable data structures in JavaScript.\n- Safety by default: A Belt function will never throw exceptions, unless it is\n indicated explicitly in the function name (suffix \"Exn\").\n- Better performance and smaller code size running on the JS platform.\n- Ready for [Tree Shaking](https://webpack.js.org/guides/tree-shaking/).\n\n## Usage\n\nTo use modules from Belt, either refer to them by their fully qualified name (`Belt.List`, `Belt.Array` etc.) or open the `Belt` module by putting\n\n## Examples\n\n```rescript\nopen Belt\n```\n\nat the top of your source files. After opening Belt this way, `Array` will refer to `Belt.Array`, `List` will refer to `Belt.List` etc. in the subsequent code.\n\nIf you want to open Belt globally for all files in your project instead, you can put\n\n```json\n{\n \"compiler-flags\": [\"-open Belt\"]\n}\n```\n\ninto your `rescript.json`.\n\n**Note**: this is the **only** `open` we encourage.\n\nExample usage:\n\n## Examples\n\n```rescript\nlet someNumbers = [1, 1, 4, 2, 3, 6, 3, 4, 2]\n\nlet greaterThan2UniqueAndSorted =\n someNumbers\n ->Belt.Array.keep(x => x > 2)\n // convert to and from set to make values unique\n ->Belt.Set.Int.fromArray\n ->Belt.Set.Int.toArray // output is already sorted\n\nJs.log2(\"result\", greaterThan2UniqueAndSorted)\n```\n\n## Specialized Collections\n\nFor collections types like set or map, Belt provides both a generic module as well as specialized, more efficient implementations for string and int keys.\n\nFor example, Belt has the following set modules:\n\n- [Belt.Set](belt/set)\n- [Belt.Set.Int](belt/set/int)\n- [Belt.Set.String](belt/set/string)\n\n## Implementation Details\n\n### Array access runtime safety\n\nOne common confusion comes from the way Belt handles array access. It differs from than the default standard library's.\n\n## Examples\n\n```rescript\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0] // a == \"a\"\nlet capitalA = Js.String.toUpperCase(a)\nlet k = letters[10] // Throws an exception! The 10th index doesn't exist.\n```\n\nBecause Belt avoids exceptions and returns `options` instead, this code behaves differently:\n\n## Examples\n\n```rescript\nopen Belt\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0] // a == Some(\"a\")\nlet captialA = Js.String.toUpperCase(a) // Type error! This code will not compile.\nlet k = letters[10] // k == None\n```\n\nAlthough we've fixed the problem where `k` throws an exception, we now have a type error when trying to capitalize `a`. There are a few things going on here:\n\n- Reason transforms array index access to the function `Array.get`. So `letters[0]` is the same as `Array.get(letters, 0)`.\n- The compiler uses whichever `Array` module is in scope. If you `open Belt`, then it uses `Belt.Array`.\n- `Belt.Array.get` returns values wrapped in options, so `letters[0] == Some(\"a\")`.\n\nFortunately, this is easy to fix:\n\n## Examples\n\n```rescript\nopen Belt\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0]\n\n// Use a switch statement:\nlet capitalA = switch a {\n| Some(a) => Some(Js.String.toUpperCase(a))\n| None => None\n}\n\nlet k = letters[10] // k == None\n```\n\nWith that little bit of tweaking, our code now compiles successfully and is 100% free of runtime errors\\!\n\n### A Special Encoding for Collection Safety\n\nWhen we create a collection library for a custom data type we need a way to provide a comparator function. Take Set for example, suppose its element type is a pair of ints, it needs a custom compare function that takes two tuples and returns their order. The Set could not just be typed as Set.t (int \\* int) , its customized compare function needs to manifest itself in the signature, otherwise, if the user creates another customized compare function, the two collection could mix which would result in runtime error.\n\nWe use a phantom type to solve the problem:\n\n## Examples\n\n```rescript\nmodule Comparable1 = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet1 = Belt.Set.make(~id=module(Comparable1))\n\nmodule Comparable2 = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet2 = Belt.Set.make(~id=module(Comparable2))\n```\n\nHere, the compiler would infer `mySet1` and `mySet2` having different type, so e.g. a `merge` operation that tries to merge these two sets will correctly fail.\n\n## Examples\n\n```rescript\nlet mySet1: t<(int, int), Comparable1.identity> = %todo\nlet mySet2: t<(int, int), Comparable2.identity> = %todo\n```\n\n`Comparable1.identity` and `Comparable2.identity` are not the same using our encoding scheme." - ], - "items": [] - }, - "belt/hashmap/string": { - "id": "Belt.HashMap.String", - "name": "String", - "docstrings": [ - "Specalized when key type is `string`, more efficient than the generic type" - ], - "items": [ - { - "id": "Belt.HashMap.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.HashMap.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'b>" - }, - { - "id": "Belt.HashMap.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t<'b>" - }, - { - "id": "Belt.HashMap.String.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'b> => unit" - }, - { - "id": "Belt.HashMap.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.HashMap.String.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`setDone(tbl, k, v)` if `k` does not exist, add the binding `k,v`, otherwise,\nupdate the old value with the new `v`" - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.HashMap.String.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.HashMap.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.HashMap.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'b>, key) => bool" - }, - { - "id": "Belt.HashMap.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.HashMap.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'b>, (key, 'b) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashMap.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'b>, (key, 'b) => unit) => unit" - }, - { - "id": "Belt.HashMap.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashMap.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c" - }, - { - "id": "Belt.HashMap.String.keepMapInPlaceU", - "kind": "value", - "name": "keepMapInPlaceU", - "docstrings": [], - "signature": "let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit", - "deprecated": "Use `keepMapInPlace` instead" - }, - { - "id": "Belt.HashMap.String.keepMapInPlace", - "kind": "value", - "name": "keepMapInPlace", - "docstrings": [], - "signature": "let keepMapInPlace: (t<'a>, (key, 'a) => option<'a>) => unit" - }, - { - "id": "Belt.HashMap.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.HashMap.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.HashMap.String.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.HashMap.String.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.HashMap.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.HashMap.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'a>, array<(key, 'a)>) => unit" - }, - { - "id": "Belt.HashMap.String.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t<'a> => array" - }, - { - "id": "Belt.HashMap.String.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t<'a> => unit" - } - ] - }, - "belt/hashmap/int": { - "id": "Belt.HashMap.Int", - "name": "Int", - "docstrings": [ - "Specalized when key type is `int`, more efficient than the generic type" - ], - "items": [ - { - "id": "Belt.HashMap.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.HashMap.Int.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'b>" - }, - { - "id": "Belt.HashMap.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t<'b>" - }, - { - "id": "Belt.HashMap.Int.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'b> => unit" - }, - { - "id": "Belt.HashMap.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.HashMap.Int.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`setDone(tbl, k, v)` if `k` does not exist, add the binding `k,v`, otherwise,\nupdate the old value with the new `v`" - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.HashMap.Int.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.HashMap.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.HashMap.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'b>, key) => bool" - }, - { - "id": "Belt.HashMap.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.HashMap.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'b>, (key, 'b) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashMap.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'b>, (key, 'b) => unit) => unit" - }, - { - "id": "Belt.HashMap.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashMap.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c" - }, - { - "id": "Belt.HashMap.Int.keepMapInPlaceU", - "kind": "value", - "name": "keepMapInPlaceU", - "docstrings": [], - "signature": "let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit", - "deprecated": "Use `keepMapInPlace` instead" - }, - { - "id": "Belt.HashMap.Int.keepMapInPlace", - "kind": "value", - "name": "keepMapInPlace", - "docstrings": [], - "signature": "let keepMapInPlace: (t<'a>, (key, 'a) => option<'a>) => unit" - }, - { - "id": "Belt.HashMap.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.HashMap.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.HashMap.Int.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.HashMap.Int.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.HashMap.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.HashMap.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'a>, array<(key, 'a)>) => unit" - }, - { - "id": "Belt.HashMap.Int.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t<'a> => array" - }, - { - "id": "Belt.HashMap.Int.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t<'a> => unit" - } - ] - }, - "belt/hashset/string": { - "id": "Belt.HashSet.String", - "name": "String", - "docstrings": [ - "Specalized when key type is `string`, more efficient than the generic type", - "This module is [`Belt.HashSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.HashSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.HashSet`]()" - ], - "items": [ - { - "id": "Belt.HashSet.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.HashSet.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Belt.HashSet.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t" - }, - { - "id": "Belt.HashSet.String.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Belt.HashSet.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.HashSet.String.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, key) => unit" - }, - { - "id": "Belt.HashSet.String.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.HashSet.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, key) => bool" - }, - { - "id": "Belt.HashSet.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, key) => unit" - }, - { - "id": "Belt.HashSet.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, key => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashSet.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, key => unit) => unit" - }, - { - "id": "Belt.HashSet.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'c, ('c, key) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashSet.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, 'c, ('c, key) => 'c) => 'c" - }, - { - "id": "Belt.HashSet.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.HashSet.String.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t => unit" - }, - { - "id": "Belt.HashSet.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.HashSet.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.HashSet.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.HashSet.String.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t => array" - } - ] - }, - "belt/hashset/int": { - "id": "Belt.HashSet.Int", - "name": "Int", - "docstrings": [ - "Specalized when key type is `int`, more efficient than the generic type", - "This module is [`Belt.HashSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.HashSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.HashSet`]()" - ], - "items": [ - { - "id": "Belt.HashSet.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.HashSet.Int.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Belt.HashSet.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t" - }, - { - "id": "Belt.HashSet.Int.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Belt.HashSet.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.HashSet.Int.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, key) => unit" - }, - { - "id": "Belt.HashSet.Int.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.HashSet.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, key) => bool" - }, - { - "id": "Belt.HashSet.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, key) => unit" - }, - { - "id": "Belt.HashSet.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, key => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashSet.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, key => unit) => unit" - }, - { - "id": "Belt.HashSet.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'c, ('c, key) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashSet.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, 'c, ('c, key) => 'c) => 'c" - }, - { - "id": "Belt.HashSet.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.HashSet.Int.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t => unit" - }, - { - "id": "Belt.HashSet.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.HashSet.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.HashSet.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.HashSet.Int.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t => array" - } - ] - }, - "belt/mutablemap/string": { - "id": "Belt.MutableMap.String", - "name": "String", - "docstrings": [], - "items": [ - { - "id": "Belt.MutableMap.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.MutableMap.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableMap.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableMap.String.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableMap.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a>, key) => bool" - }, - { - "id": "Belt.MutableMap.String.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.MutableMap.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m1, m2, cmp)`. First compare by size, if size is the same, compare by key,\nvalue pair" - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.MutableMap.String.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.MutableMap.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, cmp)`" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, (key, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableMap.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the key as\nfirst argument, and the associated value as second argument. The application \norder of `f` is in increasing order." - ], - "signature": "let forEach: (t<'a>, (key, 'a) => unit) => unit" - }, - { - "id": "Belt.MutableMap.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableMap.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`, where `k1 ... kN` are\nthe keys of all bindings in `m` (in increasing order), and `d1 ... dN` are the\nassociated data." - ], - "signature": "let reduce: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableMap.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableMap.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let every: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableMap.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let some: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableMap.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t<'a> => list<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order" - ], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.MutableMap.String.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.MutableMap.String.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.MutableMap.String.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.String.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.String.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.String.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.MutableMap.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'a>, key) => Js.undefined<'a>" - }, - { - "id": "Belt.MutableMap.String.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, key, 'a) => 'a" - }, - { - "id": "Belt.MutableMap.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` do the in-place modification" - ], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.MutableMap.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'a>, array) => unit" - }, - { - "id": "Belt.MutableMap.String.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` do the in-place modification, return `m` for chaining. If `x` was\nalready bound in `m`, its previous binding disappears." - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.MutableMap.String.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'a>, key, option<'a> => option<'a>) => unit", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.MutableMap.String.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'a>, key, option<'a> => option<'a>) => unit" - }, - { - "id": "Belt.MutableMap.String.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableMap.String.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.MutableMap.String.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'a>, (key, 'a) => 'b) => t<'b>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.MutableMap.String.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'a>, (key, 'a) => 'b) => t<'b>" - } - ] - }, - "belt/mutablemap/int": { - "id": "Belt.MutableMap.Int", - "name": "Int", - "docstrings": [], - "items": [ - { - "id": "Belt.MutableMap.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.MutableMap.Int.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableMap.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableMap.Int.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableMap.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a>, key) => bool" - }, - { - "id": "Belt.MutableMap.Int.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.MutableMap.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m1, m2, cmp)`. First compare by size, if size is the same, compare by key,\nvalue pair" - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.MutableMap.Int.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.MutableMap.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, cmp)`" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, (key, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableMap.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the key as\nfirst argument, and the associated value as second argument. The application \norder of `f` is in increasing order." - ], - "signature": "let forEach: (t<'a>, (key, 'a) => unit) => unit" - }, - { - "id": "Belt.MutableMap.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableMap.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`, where `k1 ... kN` are\nthe keys of all bindings in `m` (in increasing order), and `d1 ... dN` are the\nassociated data." - ], - "signature": "let reduce: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableMap.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableMap.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let every: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableMap.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let some: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableMap.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t<'a> => list<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order" - ], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.MutableMap.Int.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.MutableMap.Int.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.MutableMap.Int.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.Int.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.Int.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.Int.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.MutableMap.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'a>, key) => Js.undefined<'a>" - }, - { - "id": "Belt.MutableMap.Int.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, key, 'a) => 'a" - }, - { - "id": "Belt.MutableMap.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**Throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` do the in-place modification" - ], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.MutableMap.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'a>, array) => unit" - }, - { - "id": "Belt.MutableMap.Int.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` do the in-place modification, return `m` for chaining. If `x` was\nalready bound in `m`, its previous binding disappears." - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.MutableMap.Int.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'a>, key, option<'a> => option<'a>) => unit", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.MutableMap.Int.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'a>, key, option<'a> => option<'a>) => unit" - }, - { - "id": "Belt.MutableMap.Int.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableMap.Int.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.MutableMap.Int.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'a>, (key, 'a) => 'b) => t<'b>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.MutableMap.Int.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'a>, (key, 'a) => 'b) => t<'b>" - } - ] - }, - "belt/mutableset/string": { - "id": "Belt.MutableSet.String", - "name": "String", - "docstrings": [ - "Specialized when key type is `string`, more efficient than the generic type", - "This module is [`Belt.MutableSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.MutableSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.MutableSet`]()" - ], - "items": [ - { - "id": "Belt.MutableSet.String.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = string" - }, - { - "id": "Belt.MutableSet.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.MutableSet.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t" - }, - { - "id": "Belt.MutableSet.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.MutableSet.String.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.MutableSet.String.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.MutableSet.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.MutableSet.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.String.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.String.addCheck", - "kind": "value", - "name": "addCheck", - "docstrings": [], - "signature": "let addCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.String.removeCheck", - "kind": "value", - "name": "removeCheck", - "docstrings": [], - "signature": "let removeCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.String.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.MutableSet.String.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.MutableSet.String.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.MutableSet.String.subset", - "kind": "value", - "name": "subset", - "docstrings": [], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.MutableSet.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableSet.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.MutableSet.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableSet.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.MutableSet.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableSet.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`.\nOrder unspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableSet.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.String.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.MutableSet.String.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(s, p)` returns a fresh copy of the set of all elements in `s` that satisfy\npredicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.MutableSet.String.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.MutableSet.String.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(s, p)` returns a fresh copy pair of sets `(s1, s2)`, where `s1` is\nthe set of all the elements of `s` that satisfy the predicate `p`, and `s2` is\nthe set of all the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.MutableSet.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.MutableSet.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.MutableSet.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.MutableSet.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.MutableSet.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.MutableSet.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.MutableSet.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.MutableSet.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.MutableSet.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.MutableSet.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(s, key)` return a fresh copy of each" - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.MutableSet.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/mutableset/int": { - "id": "Belt.MutableSet.Int", - "name": "Int", - "docstrings": [ - "Specialized when key type is `int`, more efficient than the generic type", - "This module is [`Belt.MutableSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.MutableSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.MutableSet`]()" - ], - "items": [ - { - "id": "Belt.MutableSet.Int.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = int" - }, - { - "id": "Belt.MutableSet.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.MutableSet.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t" - }, - { - "id": "Belt.MutableSet.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.MutableSet.Int.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.MutableSet.Int.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.MutableSet.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.MutableSet.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.Int.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.Int.addCheck", - "kind": "value", - "name": "addCheck", - "docstrings": [], - "signature": "let addCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.Int.removeCheck", - "kind": "value", - "name": "removeCheck", - "docstrings": [], - "signature": "let removeCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.Int.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.MutableSet.Int.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.MutableSet.Int.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.MutableSet.Int.subset", - "kind": "value", - "name": "subset", - "docstrings": [], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.MutableSet.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableSet.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.MutableSet.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableSet.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.MutableSet.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableSet.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`.\nOrder unspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableSet.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.Int.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.MutableSet.Int.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(s, p)` returns a fresh copy of the set of all elements in `s` that satisfy\npredicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.MutableSet.Int.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.MutableSet.Int.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(s, p)` returns a fresh copy pair of sets `(s1, s2)`, where `s1` is\nthe set of all the elements of `s` that satisfy the predicate `p`, and `s2` is\nthe set of all the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.MutableSet.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.MutableSet.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.MutableSet.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.MutableSet.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.MutableSet.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.MutableSet.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.MutableSet.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.MutableSet.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.MutableSet.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.MutableSet.Int.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(s, key)` return a fresh copy of each" - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.MutableSet.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/map/dict": { - "id": "Belt.Map.Dict", - "name": "Dict", - "docstrings": [ - "This module separates identity from data, it is a bit more verbose but\nslightly more efficient due to the fact that there is no need to pack\nidentity and data back after each operation.\n\n**_Advanced usage only_**" - ], - "items": [ - { - "id": "Belt.Map.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'key, 'value, 'id>" - }, - { - "id": "Belt.Map.Dict.cmp", - "kind": "type", - "name": "cmp", - "docstrings": [], - "signature": "type cmp<'key, 'id> = Belt_Id.cmp<'key, 'id>" - }, - { - "id": "Belt.Map.Dict.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.Dict.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'k, 'v, 'id> => bool" - }, - { - "id": "Belt.Map.Dict.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => bool" - }, - { - "id": "Belt.Map.Dict.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (\n t<'k, 'v, 'id>,\n t<'k, 'v, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~vcmp: ('v, 'v) => int,\n) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.Dict.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (\n t<'k, 'v, 'id>,\n t<'k, 'v, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~vcmp: ('v, 'v) => int,\n) => int" - }, - { - "id": "Belt.Map.Dict.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (\n t<'k, 'a, 'id>,\n t<'k, 'a, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~veq: ('a, 'a) => bool,\n) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.Dict.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, cmp)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `cmp` is the\nequality predicate used to compare the data associated with the keys." - ], - "signature": "let eq: (\n t<'k, 'a, 'id>,\n t<'k, 'a, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~veq: ('a, 'a) => bool,\n) => bool" - }, - { - "id": "Belt.Map.Dict.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.Dict.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`findFirstBy(m, p)` uses function `f` to find the first key value pair to\nmatch predicate `p`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Map.Dict.fromArray([(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")], ~cmp=IntCmp.cmp)\n\nBelt.Map.Dict.findFirstBy(s0, (k, _) => k == 4) == Some((4, \"4\"))\n```" - ], - "signature": "let findFirstBy: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>" - }, - { - "id": "Belt.Map.Dict.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.Dict.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the\nkey as first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys." - ], - "signature": "let forEach: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit" - }, - { - "id": "Belt.Map.Dict.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.Dict.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `f(kN, dN ... f(k1, d1, a)...)`, where `k1 ... kN` \nare the keys of all bindings in `m` (in increasing order), and `d1 ... dN` \nare the associated data." - ], - "signature": "let reduce: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b" - }, - { - "id": "Belt.Map.Dict.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.Dict.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let every: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.Map.Dict.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.Dict.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the\npredicate `p`. Order unspecified" - ], - "signature": "let some: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.Map.Dict.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'k, 'a, 'id> => int" - }, - { - "id": "Belt.Map.Dict.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'k, 'a, 'id> => list<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'k, 'a, 'id> => array<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: (array<('k, 'a)>, ~cmp: cmp<'k, 'id>) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.Map.Dict.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'k, 'a, 'id> => array<'k>" - }, - { - "id": "Belt.Map.Dict.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'k, 'a, 'id> => array<'a>" - }, - { - "id": "Belt.Map.Dict.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.Dict.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.Dict.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.Dict.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.Dict.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => option<'a>" - }, - { - "id": "Belt.Map.Dict.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => Js.undefined<'a>" - }, - { - "id": "Belt.Map.Dict.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'k, 'a, 'id>, 'k, 'a, ~cmp: cmp<'k, 'id>) => 'a" - }, - { - "id": "Belt.Map.Dict.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => 'a" - }, - { - "id": "Belt.Map.Dict.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => 'a" - }, - { - "id": "Belt.Map.Dict.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [], - "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit" - }, - { - "id": "Belt.Map.Dict.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` returns a map containing the same bindings as `m`, except\nfor `x` which is unbound in the returned map." - ], - "signature": "let remove: (t<'a, 'b, 'id>, 'a, ~cmp: cmp<'a, 'id>) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (\n t<'a, 'b, 'id>,\n array<'a>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as `m`, plus a\nbinding of `x` to `y`. If `x` was already bound in `m`, its previous\nbinding disappears." - ], - "signature": "let set: (\n t<'a, 'b, 'id>,\n 'a,\n 'b,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (\n t<'a, 'b, 'id>,\n 'a,\n option<'b> => option<'b>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.Dict.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (\n t<'a, 'b, 'id>,\n 'a,\n option<'b> => option<'b>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'a, 'b, 'id>,\n t<'a, 'c, 'id>,\n ('a, option<'b>, option<'c>) => option<'d>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'd, 'id>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.Dict.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'a, 'b, 'id>,\n t<'a, 'c, 'id>,\n ('a, option<'b>, option<'c>) => option<'d>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'd, 'id>" - }, - { - "id": "Belt.Map.Dict.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (\n t<'a, 'b, 'id>,\n array<('a, 'b)>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => t<'k, 'a, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.Dict.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in `m` that satisfy\npredicate `p`." - ], - "signature": "let keep: (t<'k, 'a, 'id>, ('k, 'a) => bool) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.Map.Dict.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'k, 'a, 'id>,\n ('k, 'a) => bool,\n) => (t<'k, 'a, 'id>, t<'k, 'a, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.Dict.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains\nall the bindings of `s` that satisfy the predicate `p`, and `m2` is the map\nwith all the bindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (\n t<'k, 'a, 'id>,\n ('k, 'a) => bool,\n) => (t<'k, 'a, 'id>, t<'k, 'a, 'id>)" - }, - { - "id": "Belt.Map.Dict.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with\nall the bindings of `m` whose key is strictly less than `x`; `r` is the map\nwith all the bindings of `m` whose key is strictly greater than `x`; `data`\nis `None` if `m` contains no binding for `x`, or `Some(v)` if `m` binds `v`\nto `x`." - ], - "signature": "let split: (\n t<'a, 'b, 'id>,\n 'a,\n ~cmp: cmp<'a, 'id>,\n) => ((t<'a, 'b, 'id>, t<'a, 'b, 'id>), option<'b>)" - }, - { - "id": "Belt.Map.Dict.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.Dict.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated\nvalue `a` of all bindings of `m` has been replaced by the result of the\napplication of `f` to `a`. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let map: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.Dict.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>" - } - ] - }, - "belt/map/string": { - "id": "Belt.Map.String", - "name": "String", - "docstrings": [], - "items": [ - { - "id": "Belt.Map.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.Map.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of maps from type `key` to type `'value`." - ], - "signature": "type t<'value>" - }, - { - "id": "Belt.Map.String.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t<'v>" - }, - { - "id": "Belt.Map.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'v> => bool" - }, - { - "id": "Belt.Map.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'v>, key) => bool" - }, - { - "id": "Belt.Map.String.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'v>, t<'v>, ('v, 'v) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t<'v>, t<'v>, ('v, 'v) => int) => int" - }, - { - "id": "Belt.Map.String.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'v>, t<'v>, ('v, 'v) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2)` tests whether the maps `m1` and `m2` are\nequal, that is, contain equal keys and associate them with\nequal data." - ], - "signature": "let eq: (t<'v>, t<'v>, ('v, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.String.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.String.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`findFirstBy(m, p)` uses funcion `f` to find the first key value pair\nto match predicate `p`.\n\n## Examples\n\n```rescript\nlet mapString = Belt.Map.String.fromArray([(\"1\", \"one\"), (\"2\", \"two\"), (\"3\", \"three\")])\n\nmapString->Belt.Map.String.findFirstBy((k, v) => k == \"1\" && v == \"one\") == Some(\"1\", \"one\")\n```" - ], - "signature": "let findFirstBy: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>" - }, - { - "id": "Belt.Map.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'v>, (key, 'v) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`.\n`f` receives the key as first argument, and the associated value\nas second argument. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let forEach: (t<'v>, (key, 'v) => unit) => unit" - }, - { - "id": "Belt.Map.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`,\nwhere `k1 ... kN` are the keys of all bindings in `m`\n(in increasing order), and `d1 ... dN` are the associated data." - ], - "signature": "let reduce: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2" - }, - { - "id": "Belt.Map.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nOrder unspecified" - ], - "signature": "let every: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let some: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'v> => int" - }, - { - "id": "Belt.Map.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'v> => list<(key, 'v)>" - }, - { - "id": "Belt.Map.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'v> => array<(key, 'v)>" - }, - { - "id": "Belt.Map.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'v)> => t<'v>" - }, - { - "id": "Belt.Map.String.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'v> => array" - }, - { - "id": "Belt.Map.String.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'v> => array<'v>" - }, - { - "id": "Belt.Map.String.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.Map.String.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.String.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.Map.String.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'v>, key) => option<'v>" - }, - { - "id": "Belt.Map.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'v>, key) => Js.undefined<'v>" - }, - { - "id": "Belt.Map.String.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'v>, key, 'v) => 'v" - }, - { - "id": "Belt.Map.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.Map.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove m x` returns a map containing the same bindings as\n `m`, except for `x` which is unbound in the returned map." - ], - "signature": "let remove: (t<'v>, key) => t<'v>" - }, - { - "id": "Belt.Map.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'v>, array) => t<'v>" - }, - { - "id": "Belt.Map.String.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as\n`m`, plus a binding of `x` to `y`. If `x` was already bound\nin `m`, its previous binding disappears." - ], - "signature": "let set: (t<'v>, key, 'v) => t<'v>" - }, - { - "id": "Belt.Map.String.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'v>, key, option<'v> => option<'v>) => t<'v>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.String.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'v>, key, option<'v> => option<'v>) => t<'v>" - }, - { - "id": "Belt.Map.String.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.String.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>" - }, - { - "id": "Belt.Map.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'v>, array<(key, 'v)>) => t<'v>" - }, - { - "id": "Belt.Map.String.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'v>, (key, 'v) => bool) => t<'v>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.String.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in `m` that satisfy predicate\n`p`." - ], - "signature": "let keep: (t<'v>, (key, 'v) => bool) => t<'v>" - }, - { - "id": "Belt.Map.String.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.String.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains all the\nbindings of `s` that satisfy the predicate `p`, and `m2` is the map with all the\nbindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)" - }, - { - "id": "Belt.Map.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with all the\nbindings of `m` whose key is strictly less than `x`; `r` is the map with all the\nbindings of `m` whose key is strictly greater than `x`; `data` is `None` if `m`\ncontains no binding for `x`, or `Some(v)` if `m` binds `v` to `x`." - ], - "signature": "let split: (key, t<'v>) => (t<'v>, option<'v>, t<'v>)" - }, - { - "id": "Belt.Map.String.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'v>, 'v => 'v2) => t<'v2>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.String.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'v>, 'v => 'v2) => t<'v2>" - }, - { - "id": "Belt.Map.String.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'v>, (key, 'v) => 'v2) => t<'v2>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.String.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'v>, (key, 'v) => 'v2) => t<'v2>" - } - ] - }, - "belt/map/int": { - "id": "Belt.Map.Int", - "name": "Int", - "docstrings": [ - "## Examples\n\n```rescript\ntype t<'key, 'value, 'identity>\ntype id<'key, 'id> = Belt_Id.comparable<'key, 'id>\n```" - ], - "items": [ - { - "id": "Belt.Map.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.Map.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of maps from type `key` to type `'value`." - ], - "signature": "type t<'value>" - }, - { - "id": "Belt.Map.Int.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t<'v>" - }, - { - "id": "Belt.Map.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'v> => bool" - }, - { - "id": "Belt.Map.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'v>, key) => bool" - }, - { - "id": "Belt.Map.Int.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'v>, t<'v>, ('v, 'v) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t<'v>, t<'v>, ('v, 'v) => int) => int" - }, - { - "id": "Belt.Map.Int.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'v>, t<'v>, ('v, 'v) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2)` tests whether the maps `m1` and `m2` are\nequal, that is, contain equal keys and associate them with\nequal data." - ], - "signature": "let eq: (t<'v>, t<'v>, ('v, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.Int.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.Int.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`findFirstBy(m, p)` uses funcion `f` to find the first key value pair\nto match predicate `p`.\n\n## Examples\n\n```rescript\nlet mapInt = Belt.Map.Int.fromArray([(1, \"one\"), (2, \"two\"), (3, \"three\")])\n\nmapInt->Belt.Map.Int.findFirstBy((k, v) => k == 1 && v == \"one\") == Some(1, \"one\")\n```" - ], - "signature": "let findFirstBy: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'v>, (key, 'v) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`.\n`f` receives the key as first argument, and the associated value\nas second argument. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let forEach: (t<'v>, (key, 'v) => unit) => unit" - }, - { - "id": "Belt.Map.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`,\nwhere `k1 ... kN` are the keys of all bindings in `m`\n(in increasing order), and `d1 ... dN` are the associated data." - ], - "signature": "let reduce: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2" - }, - { - "id": "Belt.Map.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nOrder unspecified" - ], - "signature": "let every: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let some: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'v> => int" - }, - { - "id": "Belt.Map.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'v> => list<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'v> => array<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'v)> => t<'v>" - }, - { - "id": "Belt.Map.Int.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'v> => array" - }, - { - "id": "Belt.Map.Int.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'v> => array<'v>" - }, - { - "id": "Belt.Map.Int.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.Map.Int.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.Int.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.Map.Int.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'v>, key) => option<'v>" - }, - { - "id": "Belt.Map.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'v>, key) => Js.undefined<'v>" - }, - { - "id": "Belt.Map.Int.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'v>, key, 'v) => 'v" - }, - { - "id": "Belt.Map.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.Map.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove m x` returns a map containing the same bindings as\n `m`, except for `x` which is unbound in the returned map." - ], - "signature": "let remove: (t<'v>, key) => t<'v>" - }, - { - "id": "Belt.Map.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'v>, array) => t<'v>" - }, - { - "id": "Belt.Map.Int.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as\n`m`, plus a binding of `x` to `y`. If `x` was already bound\nin `m`, its previous binding disappears." - ], - "signature": "let set: (t<'v>, key, 'v) => t<'v>" - }, - { - "id": "Belt.Map.Int.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'v>, key, option<'v> => option<'v>) => t<'v>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.Int.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'v>, key, option<'v> => option<'v>) => t<'v>" - }, - { - "id": "Belt.Map.Int.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.Int.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>" - }, - { - "id": "Belt.Map.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'v>, array<(key, 'v)>) => t<'v>" - }, - { - "id": "Belt.Map.Int.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'v>, (key, 'v) => bool) => t<'v>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.Int.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in `m` that satisfy predicate\n`p`." - ], - "signature": "let keep: (t<'v>, (key, 'v) => bool) => t<'v>" - }, - { - "id": "Belt.Map.Int.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.Int.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains all the\nbindings of `s` that satisfy the predicate `p`, and `m2` is the map with all the\nbindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)" - }, - { - "id": "Belt.Map.Int.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with all the\nbindings of `m` whose key is strictly less than `x`; `r` is the map with all the\nbindings of `m` whose key is strictly greater than `x`; `data` is `None` if `m`\ncontains no binding for `x`, or `Some(v)` if `m` binds `v` to `x`." - ], - "signature": "let split: (key, t<'v>) => (t<'v>, option<'v>, t<'v>)" - }, - { - "id": "Belt.Map.Int.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'v>, 'v => 'v2) => t<'v2>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.Int.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'v>, 'v => 'v2) => t<'v2>" - }, - { - "id": "Belt.Map.Int.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'v>, (key, 'v) => 'v2) => t<'v2>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.Int.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'v>, (key, 'v) => 'v2) => t<'v2>" - } - ] - }, - "belt/set/dict": { - "id": "Belt.Set.Dict", - "name": "Dict", - "docstrings": [ - "This module separates identity from data, it is a bit more verbose but slightly\nmore efficient due to the fact that there is no need to pack identity and data back\nafter each operation", - "This module separates identity from data. It is a bit more verbose but slightly\nmore efficient due to the fact that there is no need to pack identity and data\nback after each operation." - ], - "items": [ - { - "id": "Belt.Set.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'value, 'identity>" - }, - { - "id": "Belt.Set.Dict.cmp", - "kind": "type", - "name": "cmp", - "docstrings": [ - "Type of compare function." - ], - "signature": "type cmp<'value, 'id> = Belt_Id.cmp<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "## Examples\n\n```rescript\nlet s0 = Belt.Set.Dict.empty\n```" - ], - "signature": "let empty: t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 3, 2, 4], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let fromArray: (array<'value>, ~cmp: cmp<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [ - "The same as [fromArray][#fromarray] except it is after assuming the input array\nis already sorted." - ], - "signature": "let fromSortedArrayUnsafe: array<'value> => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.Set.Dict.fromArray([], ~cmp=IntCmp.cmp)\nlet notEmpty = Belt.Set.Dict.fromArray([1], ~cmp=IntCmp.cmp)\n\nBelt.Set.Dict.isEmpty(empty) == true\nBelt.Set.Dict.isEmpty(notEmpty) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.Set.Dict.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if an element exists in the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.fromArray([1, 4, 2, 5], ~cmp=IntCmp.cmp)\n\nset->Belt.Set.Dict.has(3, ~cmp=IntCmp.cmp) == false\nset->Belt.Set.Dict.has(1, ~cmp=IntCmp.cmp) == true\n```" - ], - "signature": "let has: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => bool" - }, - { - "id": "Belt.Set.Dict.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = s0->Belt.Set.Dict.add(1, ~cmp=IntCmp.cmp)\nlet s2 = s1->Belt.Set.Dict.add(2, ~cmp=IntCmp.cmp)\nlet s3 = s2->Belt.Set.Dict.add(2, ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.toArray == []\ns1->Belt.Set.Dict.toArray == [1]\ns2->Belt.Set.Dict.toArray == [1, 2]\ns3->Belt.Set.Dict.toArray == [1, 2]\ns2 == s3\n```" - ], - "signature": "let add: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "Adds each element of array to set. Unlike [add](#add), the reference of return value might be changed even if all values in array already exist in set\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.empty\n\nlet newSet = set->Belt.Set.Dict.mergeMany([5, 4, 3, 2, 1], ~cmp=IntCmp.cmp)\nnewSet->Belt.Set.Dict.toArray == [1, 2, 3, 4, 5]\n```" - ], - "signature": "let mergeMany: (\n t<'value, 'id>,\n array<'value>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([2, 3, 1, 4, 5], ~cmp=IntCmp.cmp)\nlet s1 = s0->Belt.Set.Dict.remove(1, ~cmp=IntCmp.cmp)\nlet s2 = s1->Belt.Set.Dict.remove(3, ~cmp=IntCmp.cmp)\nlet s3 = s2->Belt.Set.Dict.remove(3, ~cmp=IntCmp.cmp)\n\ns1->Belt.Set.Dict.toArray == [2, 3, 4, 5]\ns2->Belt.Set.Dict.toArray == [2, 4, 5]\ns2 == s3\n```" - ], - "signature": "let remove: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "Removes each element of array from set. Unlike [remove](#remove), the reference of return value might be changed even if any values in array not existed in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.fromArray([1, 2, 3, 4], ~cmp=IntCmp.cmp)\n\nlet newSet = set->Belt.Set.Dict.removeMany([5, 4, 3, 2, 1], ~cmp=IntCmp.cmp)\nnewSet->Belt.Set.Dict.toArray == []\n```" - ], - "signature": "let removeMany: (\n t<'value, 'id>,\n array<'value>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet union = Belt.Set.Dict.union(s0, s1, ~cmp=IntCmp.cmp)\nunion->Belt.Set.Dict.toArray == [1, 2, 3, 4, 5, 6]\n```" - ], - "signature": "let union: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet intersect = Belt.Set.Dict.intersect(s0, s1, ~cmp=IntCmp.cmp)\nintersect->Belt.Set.Dict.toArray == [2, 3, 5]\n```" - ], - "signature": "let intersect: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.diff", - "kind": "value", - "name": "diff", - "docstrings": [ - "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\n\nlet diff1 = Belt.Set.Dict.diff(s0, s1, ~cmp=IntCmp.cmp)\nlet diff2 = Belt.Set.Dict.diff(s1, s0, ~cmp=IntCmp.cmp)\n\ndiff1->Belt.Set.Dict.toArray == [6]\ndiff2->Belt.Set.Dict.toArray == [1, 4]\n```" - ], - "signature": "let diff: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet s2 = Belt.Set.Dict.intersect(s0, s1, ~cmp=IntCmp.cmp)\nBelt.Set.Dict.subset(s2, s0, ~cmp=IntCmp.cmp) == true\nBelt.Set.Dict.subset(s2, s1, ~cmp=IntCmp.cmp) == true\nBelt.Set.Dict.subset(s1, s0, ~cmp=IntCmp.cmp) == false\n```" - ], - "signature": "let subset: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => bool" - }, - { - "id": "Belt.Set.Dict.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets. It compares size first and then iterates over each element following the\norder of elements." - ], - "signature": "let cmp: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => int" - }, - { - "id": "Belt.Set.Dict.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 5], ~cmp=IntCmp.cmp)\n\nBelt.Set.Dict.eq(s0, s1, ~cmp=IntCmp.cmp) == true\n```" - ], - "signature": "let eq: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => bool" - }, - { - "id": "Belt.Set.Dict.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as [forEach](##forEach) but takes uncurried functon." - ], - "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.Dict.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet acc = ref(list{})\ns0->Belt.Set.Dict.forEach(x => acc := Belt.List.add(acc.contents, x))\nacc.contents == list{6, 5, 3, 2}\n```" - ], - "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit" - }, - { - "id": "Belt.Set.Dict.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.Dict.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) == list{6, 5, 3, 2}\n```" - ], - "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a" - }, - { - "id": "Belt.Set.Dict.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.Dict.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.Dict.fromArray([2, 4, 6, 8], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.every(isEven) == true\n```" - ], - "signature": "let every: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.Dict.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.Dict.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 4, 6, 8], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.some(isOdd) == true\n```" - ], - "signature": "let some: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.Dict.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.Dict.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\nlet s1 = s0->Belt.Set.Dict.keep(isEven)\n\ns1->Belt.Set.Dict.toArray == [2, 4]\n```" - ], - "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.Dict.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "Returns a pair of sets, where first is the set of all the elements of set that satisfy the predicate, and second is the set of all the elements of set that do not satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\nlet (s1, s2) = s0->Belt.Set.Dict.partition(isOdd)\n\ns1->Belt.Set.Dict.toArray == [1, 3, 5]\ns2->Belt.Set.Dict.toArray == [2, 4]\n```" - ], - "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)" - }, - { - "id": "Belt.Set.Dict.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.size == 4\n```" - ], - "signature": "let size: t<'value, 'id> => int" - }, - { - "id": "Belt.Set.Dict.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toList == list{1, 2, 3, 5}\n```" - ], - "signature": "let toList: t<'value, 'id> => list<'value>" - }, - { - "id": "Belt.Set.Dict.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toArray == [1, 2, 3, 5]\n```" - ], - "signature": "let toArray: t<'value, 'id> => array<'value>" - }, - { - "id": "Belt.Set.Dict.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.minimum == None\ns1->Belt.Set.Dict.minimum == Some(1)\n```" - ], - "signature": "let minimum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.Dict.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "Returns minimum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.minUndefined == Js.undefined\ns1->Belt.Set.Dict.minUndefined == Js.Undefined.return(1)\n```" - ], - "signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.Dict.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.maximum == None\ns1->Belt.Set.Dict.maximum == Some(5)\n```" - ], - "signature": "let maximum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.Dict.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "Returns maximum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.maxUndefined == Js.undefined\ns1->Belt.Set.Dict.maxUndefined == Js.Undefined.return(5)\n```" - ], - "signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the reference of the value which is equivalent to value using the comparator\nspecifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.get(3, ~cmp=IntCmp.cmp) == Some(3)\ns0->Belt.Set.Dict.get(20, ~cmp=IntCmp.cmp) == None\n```" - ], - "signature": "let get: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => option<'value>" - }, - { - "id": "Belt.Set.Dict.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "Same as [get](#get) but returns `undefined` when element does not exist." - ], - "signature": "let getUndefined: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => Js.undefined<'value>" - }, - { - "id": "Belt.Set.Dict.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getExn: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => 'value" - }, - { - "id": "Belt.Set.Dict.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getOrThrow: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => 'value" - }, - { - "id": "Belt.Set.Dict.split", - "kind": "value", - "name": "split", - "docstrings": [ - "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\n\nlet ((smaller, larger), present) = s0->Belt.Set.Dict.split(3, ~cmp=IntCmp.cmp)\n\npresent == true\nsmaller->Belt.Set.Dict.toArray == [1, 2]\nlarger->Belt.Set.Dict.toArray == [4, 5]\n```" - ], - "signature": "let split: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)" - }, - { - "id": "Belt.Set.Dict.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b> => unit" - } - ] - }, - "belt/set/string": { - "id": "Belt.Set.String", - "name": "String", - "docstrings": [ - "Specialized when value type is `string`, more efficient than the generic type,\nits compare behavior is fixed using the built-in comparison", - "This module is [`Belt.Set`]() specialized with value type to be a primitive type.\nIt is more efficient in general, the API is the same with [`Belt_Set`]() except its value type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.Set`]()" - ], - "items": [ - { - "id": "Belt.Set.String.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = string" - }, - { - "id": "Belt.Set.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.Set.String.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t" - }, - { - "id": "Belt.Set.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.Set.String.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.Set.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.Set.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.Set.String.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(s, x)` If `x` was already in `s`, `s` is returned unchanged." - ], - "signature": "let add: (t, value) => t" - }, - { - "id": "Belt.Set.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => t" - }, - { - "id": "Belt.Set.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` If `x` was not in `m`, `m` is returned reference unchanged." - ], - "signature": "let remove: (t, value) => t" - }, - { - "id": "Belt.Set.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => t" - }, - { - "id": "Belt.Set.String.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.Set.String.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.Set.String.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.Set.String.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "`subset(s1, s2)` tests whether the set `s1` is a subset of the set `s2`." - ], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.Set.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets." - ], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.Set.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(s1, s2)` tests whether the sets `s1` and `s2` are equal, that is, contain\nequal elements." - ], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.Set.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(s, f)` applies `f` in turn to all elements of `s`. In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.Set.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.Set.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`. Order\nunspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.String.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.String.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(p, s)` returns the set of all elements in `s` that satisfy predicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.Set.String.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.String.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(p, s)` returns a pair of sets `(s1, s2)`, where `s1` is the set of\nall the elements of `s` that satisfy the predicate `p`, and `s2` is the set of\nall the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.Set.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.Set.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.Set.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.Set.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.Set.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.Set.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.Set.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.Set.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.Set.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.Set.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, s)` returns a triple `(l, present, r)`, where `l` is the set of\nelements of `s` that are strictly less than `x`;`r` is the set of elements of\n`s` that are strictly greater than `x`; `present` is `false` if `s` contains no\nelement equal to `x`, or `true` if `s` contains an element equal to `x`." - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.Set.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/set/int": { - "id": "Belt.Set.Int", - "name": "Int", - "docstrings": [ - "Specialized when value type is `int`, more efficient than the generic type, its\ncompare behavior is fixed using the built-in comparison", - "This module is [`Belt.Set`]() specialized with value type to be a primitive type.\nIt is more efficient in general, the API is the same with [`Belt_Set`]() except its value type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.Set`]()" - ], - "items": [ - { - "id": "Belt.Set.Int.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = int" - }, - { - "id": "Belt.Set.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.Set.Int.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t" - }, - { - "id": "Belt.Set.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.Set.Int.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.Set.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.Set.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.Set.Int.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(s, x)` If `x` was already in `s`, `s` is returned unchanged." - ], - "signature": "let add: (t, value) => t" - }, - { - "id": "Belt.Set.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => t" - }, - { - "id": "Belt.Set.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` If `x` was not in `m`, `m` is returned reference unchanged." - ], - "signature": "let remove: (t, value) => t" - }, - { - "id": "Belt.Set.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => t" - }, - { - "id": "Belt.Set.Int.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.Set.Int.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.Set.Int.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.Set.Int.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "`subset(s1, s2)` tests whether the set `s1` is a subset of the set `s2`." - ], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.Set.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets." - ], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.Set.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(s1, s2)` tests whether the sets `s1` and `s2` are equal, that is, contain\nequal elements." - ], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.Set.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(s, f)` applies `f` in turn to all elements of `s`. In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.Set.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.Set.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`. Order\nunspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.Int.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.Int.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(p, s)` returns the set of all elements in `s` that satisfy predicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.Set.Int.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.Int.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(p, s)` returns a pair of sets `(s1, s2)`, where `s1` is the set of\nall the elements of `s` that satisfy the predicate `p`, and `s2` is the set of\nall the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.Set.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.Set.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.Set.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.Set.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.Set.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.Set.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.Set.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.Set.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.Set.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.Set.Int.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, s)` returns a triple `(l, present, r)`, where `l` is the set of\nelements of `s` that are strictly less than `x`;`r` is the set of elements of\n`s` that are strictly greater than `x`; `present` is `false` if `s` contains no\nelement equal to `x`, or `true` if `s` contains an element equal to `x`." - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.Set.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/sortarray/string": { - "id": "Belt.SortArray.String", - "name": "String", - "docstrings": [ - "Specalized when key type is `string`, more efficient than the generic type", - "This is a specialized module for [`Belt_SortArray`](), the docs in that module also\napplies here, except the comparator is fixed and inlined" - ], - "items": [ - { - "id": "Belt.SortArray.String.element", - "kind": "type", - "name": "element", - "docstrings": [], - "signature": "type element = string" - }, - { - "id": "Belt.SortArray.String.strictlySortedLength", - "kind": "value", - "name": "strictlySortedLength", - "docstrings": [ - "The same as [`Belt_SortArray.strictlySortedLength`]() except the comparator is fixed\n\n**return** `+n` means increasing order `-n` means negative order" - ], - "signature": "let strictlySortedLength: array => int" - }, - { - "id": "Belt.SortArray.String.isSorted", - "kind": "value", - "name": "isSorted", - "docstrings": [ - "`sorted(xs)` return true if `xs` is in non strict increasing order" - ], - "signature": "let isSorted: array => bool" - }, - { - "id": "Belt.SortArray.String.stableSortInPlace", - "kind": "value", - "name": "stableSortInPlace", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortInPlaceBy`]() except the comparator is fixed" - ], - "signature": "let stableSortInPlace: array => unit" - }, - { - "id": "Belt.SortArray.String.stableSort", - "kind": "value", - "name": "stableSort", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortBy`]() except the comparator is fixed" - ], - "signature": "let stableSort: array => array" - }, - { - "id": "Belt.SortArray.String.binarySearch", - "kind": "value", - "name": "binarySearch", - "docstrings": [ - "If value is not found and value is less than one or more elements in array,\nthe negative number returned is the bitwise complement of the index of the first element\nthat is larger than value.\n\nIf value is not found and value is greater than all elements in array,\nthe negative number returned is the bitwise complement of\n(the index of the last element plus 1)\n\nfor example, if `key` is smaller than all elements return `-1` since `lnot (-1) = 0`\nif `key` is larger than all elements return `- (len + 1)` since `lnot (-(len+1)) = len`" - ], - "signature": "let binarySearch: (array, element) => int" - }, - { - "id": "Belt.SortArray.String.union", - "kind": "value", - "name": "union", - "docstrings": [ - "`union(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp)` assume\n`src` and `src2` is strictly sorted. for equivalent elements, it is picked from\n`src` also assume that `dst` is large enough to store all elements" - ], - "signature": "let union: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.String.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.String.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - } - ] - }, - "belt/sortarray/int": { - "id": "Belt.SortArray.Int", - "name": "Int", - "docstrings": [ - "Specalized when key type is `int`, more efficient than the generic type", - "This is a specialized module for [`Belt_SortArray`](), the docs in that module also\napplies here, except the comparator is fixed and inlined" - ], - "items": [ - { - "id": "Belt.SortArray.Int.element", - "kind": "type", - "name": "element", - "docstrings": [], - "signature": "type element = int" - }, - { - "id": "Belt.SortArray.Int.strictlySortedLength", - "kind": "value", - "name": "strictlySortedLength", - "docstrings": [ - "The same as [`Belt_SortArray.strictlySortedLength`]() except the comparator is fixed\n\n**return** `+n` means increasing order `-n` means negative order" - ], - "signature": "let strictlySortedLength: array => int" - }, - { - "id": "Belt.SortArray.Int.isSorted", - "kind": "value", - "name": "isSorted", - "docstrings": [ - "`sorted(xs)` return true if `xs` is in non strict increasing order" - ], - "signature": "let isSorted: array => bool" - }, - { - "id": "Belt.SortArray.Int.stableSortInPlace", - "kind": "value", - "name": "stableSortInPlace", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortInPlaceBy`]() except the comparator is fixed" - ], - "signature": "let stableSortInPlace: array => unit" - }, - { - "id": "Belt.SortArray.Int.stableSort", - "kind": "value", - "name": "stableSort", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortBy`]() except the comparator is fixed" - ], - "signature": "let stableSort: array => array" - }, - { - "id": "Belt.SortArray.Int.binarySearch", - "kind": "value", - "name": "binarySearch", - "docstrings": [ - "If value is not found and value is less than one or more elements in array,\nthe negative number returned is the bitwise complement of the index of the first element\nthat is larger than value.\n\nIf value is not found and value is greater than all elements in array,\nthe negative number returned is the bitwise complement of\n(the index of the last element plus 1)\n\nfor example, if `key` is smaller than all elements return `-1` since `lnot (-1) = 0`\nif `key` is larger than all elements return `- (len + 1)` since `lnot (-(len+1)) = len`" - ], - "signature": "let binarySearch: (array, element) => int" - }, - { - "id": "Belt.SortArray.Int.union", - "kind": "value", - "name": "union", - "docstrings": [ - "`union(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp)` assume\n`src` and `src2` is strictly sorted. for equivalent elements, it is picked from\n`src` also assume that `dst` is large enough to store all elements" - ], - "signature": "let union: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.Int.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.Int.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - } - ] - }, - "belt/id/makehashable": { - "id": "Belt.Id.MakeHashable", - "name": "MakeHashable", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeHashable.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeHashable.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeHashable.hash", - "kind": "value", - "name": "hash", - "docstrings": [], - "signature": "let hash: hash" - }, - { - "id": "Belt.Id.MakeHashable.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: eq" - } - ] - }, - "belt/id/makehashableu": { - "id": "Belt.Id.MakeHashableU", - "name": "MakeHashableU", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeHashableU.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeHashableU.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeHashableU.hash", - "kind": "value", - "name": "hash", - "docstrings": [], - "signature": "let hash: hash" - }, - { - "id": "Belt.Id.MakeHashableU.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: eq" - } - ] - }, - "belt/id/makecomparable": { - "id": "Belt.Id.MakeComparable", - "name": "MakeComparable", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeComparable.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeComparable.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeComparable.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: cmp" - } - ] - }, - "belt/id/makecomparableu": { - "id": "Belt.Id.MakeComparableU", - "name": "MakeComparableU", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeComparableU.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeComparableU.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeComparableU.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: cmp" - } - ] - }, - "belt/float": { - "id": "Belt.Float", - "name": "Float", - "docstrings": [ - "[`Belt.Float`]()\n\n Utilities for Float.", - "This module includes convenience methods for handling `float` types." - ], - "items": [ - { - "id": "Belt.Float.toInt", - "kind": "value", - "name": "toInt", - "docstrings": [ - "Converts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nBelt.Float.toInt(1.0) == 1\n```" - ], - "signature": "let toInt: float => int" - }, - { - "id": "Belt.Float.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "Converts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nBelt.Float.fromInt(1) == 1.0\n```" - ], - "signature": "let fromInt: int => float" - }, - { - "id": "Belt.Float.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Converts a given `string` to a `float`. Returns `Some(float)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nBelt.Float.fromString(\"1.0\") == Some(1.0)\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Belt.Float.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts a given `float` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nBelt.Float.toString(1.0) == \"1\"\n```" - ], - "signature": "let toString: float => string" - }, - { - "id": "Belt.Float.+", - "kind": "value", - "name": "+", - "docstrings": [ - "Addition of two `float` values.\nCan be opened in a module to avoid dot-notation (`+.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n2.0 + 2.0 == 4.0\n```" - ], - "signature": "let +: (float, float) => float" - }, - { - "id": "Belt.Float.-", - "kind": "value", - "name": "-", - "docstrings": [ - "Subtraction of two `float` values.\nCan be opened in a module to avoid dot-notation (`-.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n2.0 - 1.0 == 1.0\n```" - ], - "signature": "let -: (float, float) => float" - }, - { - "id": "Belt.Float.*", - "kind": "value", - "name": "*", - "docstrings": [ - "Multiplication of two `float` values.\nCan be opened in a module to avoid dot-notation (`*.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n2.0 * 2.0 == 4.0\n```" - ], - "signature": "let *: (float, float) => float" - }, - { - "id": "Belt.Float./", - "kind": "value", - "name": "/", - "docstrings": [ - "Division of two `float` values.\nCan be opened in a module to avoid dot-notation (`/.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n4.0 / 2.0 == 2.0\n```" - ], - "signature": "let /: (float, float) => float" - } - ] - }, - "belt/int": { - "id": "Belt.Int", - "name": "Int", - "docstrings": [ - "[`Belt.Int`]()\n\n Utilities for Int.", - "This module includes convenience methods for handling `int` types." - ], - "items": [ - { - "id": "Belt.Int.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [ - "Converts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nBelt.Int.toFloat(1) == 1.0\n```" - ], - "signature": "let toFloat: int => float" - }, - { - "id": "Belt.Int.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "Converts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nBelt.Int.fromFloat(1.0) == 1\n```" - ], - "signature": "let fromFloat: float => int" - }, - { - "id": "Belt.Int.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Converts a given `string` to an `int`. Returns `Some(int)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nBelt.Int.fromString(\"1\") == Some(1)\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Belt.Int.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nBelt.Int.toString(1) == \"1\"\n```" - ], - "signature": "let toString: int => string" - }, - { - "id": "Belt.Int.+", - "kind": "value", - "name": "+", - "docstrings": [ - "Addition of two `int` values. Same as the addition from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n2 + 2 == 4\n```" - ], - "signature": "let +: (int, int) => int" - }, - { - "id": "Belt.Int.-", - "kind": "value", - "name": "-", - "docstrings": [ - "Subtraction of two `int` values. Same as the subtraction from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n2 - 1 == 1\n```" - ], - "signature": "let -: (int, int) => int" - }, - { - "id": "Belt.Int.*", - "kind": "value", - "name": "*", - "docstrings": [ - "Multiplication of two `int` values. Same as the multiplication from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n2 * 2 == 4\n```" - ], - "signature": "let *: (int, int) => int" - }, - { - "id": "Belt.Int./", - "kind": "value", - "name": "/", - "docstrings": [ - "Division of two `int` values. Same as the division from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n4 / 2 == 2\n```" - ], - "signature": "let /: (int, int) => int" - } - ] - }, - "belt/result": { - "id": "Belt.Result", - "name": "Result", - "docstrings": [ - "[`Belt.Result`]()\n\n Utilities for result data type.", - "Result types are really useful to describe the result of a certain operation\nwithout relying on exceptions or `option` types.\n\nThis module gives you useful utilities to create and combine `Result` data." - ], - "items": [ - { - "id": "Belt.Result.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a, 'b> = result<'a, 'b> = Ok('a) | Error('b)" - }, - { - "id": "Belt.Result.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(res)`: when `res` is `Ok(n)`, returns `n` when `res` is `Error(m)`, throw an exception\n\n## Examples\n\n```rescript\nBelt.Result.Ok(42)->Belt.Result.getExn == 42\n\nswitch Belt.Result.getExn(Belt.Result.Error(\"Invalid data\")) {\n// throw a exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getExn: t<'a, 'b> => 'a" - }, - { - "id": "Belt.Result.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(res)`: when `res` is `Ok(n)`, returns `n` when `res` is `Error(m)`, throw an exception\n\n## Examples\n\n```rescript\nBelt.Result.Ok(42)->Belt.Result.getOrThrow == 42\n\nswitch Belt.Result.getOrThrow(Belt.Result.Error(\"Invalid data\")) {\n// throw a exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getOrThrow: t<'a, 'b> => 'a" - }, - { - "id": "Belt.Result.mapWithDefaultU", - "kind": "value", - "name": "mapWithDefaultU", - "docstrings": [], - "signature": "let mapWithDefaultU: (t<'a, 'c>, 'b, 'a => 'b) => 'b", - "deprecated": "Use `mapWithDefault` instead" - }, - { - "id": "Belt.Result.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [ - "`mapWithDefault(res, default, f)`: When res is `Ok(n)`, returns `f(n)`,\notherwise `default`.\n\n## Examples\n\n```rescript\nlet ok = Belt.Result.Ok(42)\nBelt.Result.mapWithDefault(ok, 0, x => x / 2) == 21\n\nlet error = Belt.Result.Error(\"Invalid data\")\nBelt.Result.mapWithDefault(error, 0, x => x / 2) == 0\n```" - ], - "signature": "let mapWithDefault: (t<'a, 'c>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Belt.Result.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a, 'c>, 'a => 'b) => t<'b, 'c>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Result.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(res, f)`: When res is `Ok(n)`, returns `Ok(f(n))`. Otherwise returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns an\nordinary value.\n\n## Examples\n\n```rescript\nlet f = x => sqrt(Belt.Int.toFloat(x))\n\nBelt.Result.map(Ok(64), f) == Ok(8.0)\n\nBelt.Result.map(Error(\"Invalid data\"), f) == Error(\"Invalid data\")\n```" - ], - "signature": "let map: (t<'a, 'c>, 'a => 'b) => t<'b, 'c>" - }, - { - "id": "Belt.Result.flatMapU", - "kind": "value", - "name": "flatMapU", - "docstrings": [], - "signature": "let flatMapU: (t<'a, 'c>, 'a => t<'b, 'c>) => t<'b, 'c>", - "deprecated": "Use `flatMap` instead" - }, - { - "id": "Belt.Result.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(res, f)`: When res is `Ok(n)`, returns `f(n)`. Otherwise, returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns a\n`Belt.Result`.\n\n## Examples\n\n```rescript\nlet recip = x =>\n if x !== 0.0 {\n Belt.Result.Ok(1.0 /. x)\n } else {\n Belt.Result.Error(\"Divide by zero\")\n }\n\nBelt.Result.flatMap(Ok(2.0), recip) == Ok(0.5)\n\nBelt.Result.flatMap(Ok(0.0), recip) == Error(\"Divide by zero\")\n\nBelt.Result.flatMap(Error(\"Already bad\"), recip) == Error(\"Already bad\")\n```" - ], - "signature": "let flatMap: (t<'a, 'c>, 'a => t<'b, 'c>) => t<'b, 'c>" - }, - { - "id": "Belt.Result.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [ - "`getWithDefault(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`,\notherwise `default`\n\n## Examples\n\n```rescript\nBelt.Result.getWithDefault(Ok(42), 0) == 42\n\nBelt.Result.getWithDefault(Error(\"Invalid Data\"), 0) == 0\n```" - ], - "signature": "let getWithDefault: (t<'a, 'b>, 'a) => 'a" - }, - { - "id": "Belt.Result.isOk", - "kind": "value", - "name": "isOk", - "docstrings": [ - "`isOk(res)`: Returns `true` if `res` is of the form `Ok(n)`, `false` if it is\nthe `Error(e)` variant." - ], - "signature": "let isOk: t<'a, 'b> => bool" - }, - { - "id": "Belt.Result.isError", - "kind": "value", - "name": "isError", - "docstrings": [ - "`isError(res)`: Returns `true` if `res` is of the form `Error(e)`, `false` if\nit is the `Ok(n)` variant." - ], - "signature": "let isError: t<'a, 'b> => bool" - }, - { - "id": "Belt.Result.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Result.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(res1, res2, f)`: Determine if two `Belt.Result` variables are equal with\nrespect to an equality function. If `res1` and `res2` are of the form `Ok(n)`\nand `Ok(m)`, return the result of `f(n, m)`. If one of `res1` and `res2` are of\nthe form `Error(e)`, return false If both `res1` and `res2` are of the form\n`Error(e)`, return true\n\n## Examples\n\n```rescript\nlet good1 = Belt.Result.Ok(42)\n\nlet good2 = Belt.Result.Ok(32)\n\nlet bad1 = Belt.Result.Error(\"invalid\")\n\nlet bad2 = Belt.Result.Error(\"really invalid\")\n\nlet mod10equal = (a, b) => mod(a, 10) === mod(b, 10)\n\nBelt.Result.eq(good1, good2, mod10equal) == true\n\nBelt.Result.eq(good1, bad1, mod10equal) == false\n\nBelt.Result.eq(bad2, good2, mod10equal) == false\n\nBelt.Result.eq(bad1, bad2, mod10equal) == true\n```" - ], - "signature": "let eq: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Result.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Result.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(res1, res2, f)`: Compare two `Belt.Result` variables with respect to a\ncomparison function. The comparison function returns -1 if the first variable\nis \"less than\" the second, 0 if the two variables are equal, and 1 if the first\nis \"greater than\" the second.\n\nIf `res1` and `res2` are of the form `Ok(n)` and `Ok(m)`, return the result of\n`f(n, m)`. If `res1` is of the form `Error(e)` and `res2` of the form `Ok(n)`,\nreturn -1 (nothing is less than something) If `res1` is of the form `Ok(n)` and\n`res2` of the form `Error(e)`, return 1 (something is greater than nothing) If\nboth `res1` and `res2` are of the form `Error(e)`, return 0 (equal)\n\n## Examples\n\n```rescript\nlet good1 = Belt.Result.Ok(59)\n\nlet good2 = Belt.Result.Ok(37)\n\nlet bad1 = Belt.Result.Error(\"invalid\")\n\nlet bad2 = Belt.Result.Error(\"really invalid\")\n\nlet mod10cmp = (a, b) => Pervasives.compare(mod(a, 10), mod(b, 10))\n\nBelt.Result.cmp(Ok(39), Ok(57), mod10cmp) == 1\n\nBelt.Result.cmp(Ok(57), Ok(39), mod10cmp) == -1\n\nBelt.Result.cmp(Ok(39), Error(\"y\"), mod10cmp) == 1\n\nBelt.Result.cmp(Error(\"x\"), Ok(57), mod10cmp) == -1\n\nBelt.Result.cmp(Error(\"x\"), Error(\"y\"), mod10cmp) == 0\n```" - ], - "signature": "let cmp: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => int) => int" - } - ] - }, - "belt/option": { - "id": "Belt.Option", - "name": "Option", - "docstrings": [ - "[`Belt.Option`]()\n\n Utilities for option data type.", - "In Belt we represent the existence and nonexistence of a value by wrapping it\nwith the `option` type. In order to make it a bit more convenient to work with\noption-types, Belt provides utility-functions for it.\n\nThe `option` type is a part of the ReScript standard library which is defined like this:\n\n## Examples\n\n```rescript\ntype option<'a> = None | Some('a)\n```\n\n```rescript\nlet someString: option = Some(\"hello\")\n```" - ], - "items": [ - { - "id": "Belt.Option.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [ - "Uncurried version of `keep`" - ], - "signature": "let keepU: (option<'a>, 'a => bool) => option<'a>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Option.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "If `optionValue` is `Some(value)` and `p(value) = true`, it returns `Some(value)`; otherwise returns `None`\n\n## Examples\n\n```rescript\nBelt.Option.keep(Some(10), x => x > 5) == Some(10)\nBelt.Option.keep(Some(4), x => x > 5) == None\nBelt.Option.keep(None, x => x > 5) == None\n```" - ], - "signature": "let keep: (option<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Belt.Option.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Uncurried version of `forEach`" - ], - "signature": "let forEachU: (option<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Option.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "If `optionValue` is `Some(value`), it calls `f(value)`; otherwise returns `()`\n\n## Examples\n\n```rescript\nBelt.Option.forEach(Some(\"thing\"), x => Js.log(x)) /* logs \"thing\" */\nBelt.Option.forEach(None, x => Js.log(x)) /* returns () */\n```" - ], - "signature": "let forEach: (option<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.Option.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Throws an Error in case `None` is provided. Use with care.\n\n## Examples\n\n```rescript\nSome(3)->Belt.Option.getExn == 3\n\nswitch Belt.Option.getExn(None) {\n// Throws an exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getExn: option<'a> => 'a" - }, - { - "id": "Belt.Option.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Throws an Error in case `None` is provided. Use with care.\n\n## Examples\n\n```rescript\nSome(3)->Belt.Option.getOrThrow == 3\n\nswitch Belt.Option.getOrThrow(None) {\n// Throws an exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getOrThrow: option<'a> => 'a" - }, - { - "id": "Belt.Option.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(x)` returns `x`\n\nThis is an unsafe operation, it assumes `x` is neither `None`\nnor `Some(None(...)))`" - ], - "signature": "let getUnsafe: option<'a> => 'a" - }, - { - "id": "Belt.Option.mapWithDefaultU", - "kind": "value", - "name": "mapWithDefaultU", - "docstrings": [ - "Uncurried version of `mapWithDefault`" - ], - "signature": "let mapWithDefaultU: (option<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "Use `mapWithDefault` instead" - }, - { - "id": "Belt.Option.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [ - "If `optionValue` is of `Some(value)`,\nthis function returns that value applied with `f`, in other words `f(value)`.\n\nIf `optionValue` is `None`, the default is returned.\n\n## Examples\n\n```rescript\nlet someValue = Some(3)\nsomeValue->Belt.Option.mapWithDefault(0, x => x + 5) == 8\n\nlet noneValue = None\nnoneValue->Belt.Option.mapWithDefault(0, x => x + 5) == 0\n```" - ], - "signature": "let mapWithDefault: (option<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Belt.Option.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [ - "Uncurried version of `map`" - ], - "signature": "let mapU: (option<'a>, 'a => 'b) => option<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Option.map", - "kind": "value", - "name": "map", - "docstrings": [ - "If `optionValue` is `Some(value)` this returns `f(value)`, otherwise it returns `None`.\n\n## Examples\n\n```rescript\nBelt.Option.map(Some(3), x => x * x) == Some(9)\n\nBelt.Option.map(None, x => x * x) == None\n```" - ], - "signature": "let map: (option<'a>, 'a => 'b) => option<'b>" - }, - { - "id": "Belt.Option.flatMapU", - "kind": "value", - "name": "flatMapU", - "docstrings": [ - "Uncurried version of `flatMap`" - ], - "signature": "let flatMapU: (option<'a>, 'a => option<'b>) => option<'b>", - "deprecated": "Use `flatMap` instead" - }, - { - "id": "Belt.Option.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "If `optionValue` is `Some(value)`, returns `f(value)`, otherwise returns\n`None`.
\nThe function `f` must have a return type of `option<'b>`.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Some(value + 1)\n } else {\n None\n }\n\nBelt.Option.flatMap(Some(2), addIfAboveOne) == Some(3)\n\nBelt.Option.flatMap(Some(-4), addIfAboveOne) == None\n\nBelt.Option.flatMap(None, addIfAboveOne) == None\n```" - ], - "signature": "let flatMap: (option<'a>, 'a => option<'b>) => option<'b>" - }, - { - "id": "Belt.Option.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [ - "If `optionalValue` is `Some(value)`, returns `value`, otherwise default.\n\n## Examples\n\n```rescript\nBelt.Option.getWithDefault(None, \"Banana\") == \"Banana\"\n\nBelt.Option.getWithDefault(Some(\"Apple\"), \"Banana\") == \"Apple\"\n```\n\n```rescript\nlet greet = (firstName: option) =>\n \"Greetings \" ++ firstName->Belt.Option.getWithDefault(\"Anonymous\")\n\nSome(\"Jane\")->greet == \"Greetings Jane\"\n\nNone->greet == \"Greetings Anonymous\"\n```" - ], - "signature": "let getWithDefault: (option<'a>, 'a) => 'a" - }, - { - "id": "Belt.Option.orElse", - "kind": "value", - "name": "orElse", - "docstrings": [ - "`orElse(optionalValue, otherOptional)` if `optionalValue` is `Some(value)`,\nreturns `Some(value)`, otherwise `otherOptional`\n\n## Examples\n\n```rescript\nBelt.Option.orElse(Some(1812), Some(1066)) == Some(1812)\nBelt.Option.orElse(None, Some(1066)) == Some(1066)\nBelt.Option.orElse(None, None) == None\n```" - ], - "signature": "let orElse: (option<'a>, option<'a>) => option<'a>" - }, - { - "id": "Belt.Option.isSome", - "kind": "value", - "name": "isSome", - "docstrings": [ - "Returns `true` if the argument is `Some(value)`, `false` otherwise.\n\n## Examples\n\n```rescript\nBelt.Option.isSome(None) == false\n\nBelt.Option.isSome(Some(1)) == true\n```" - ], - "signature": "let isSome: option<'a> => bool" - }, - { - "id": "Belt.Option.isNone", - "kind": "value", - "name": "isNone", - "docstrings": [ - "Returns `true` if the argument is `None`, `false` otherwise.\n\n## Examples\n\n```rescript\nBelt.Option.isNone(None) == true\n\nBelt.Option.isNone(Some(1)) == false\n```" - ], - "signature": "let isNone: option<'a> => bool" - }, - { - "id": "Belt.Option.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [ - "Uncurried version of `eq`" - ], - "signature": "let eqU: (option<'a>, option<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Option.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Evaluates two optional values for equality with respect to a predicate\nfunction. If both `optValue1` and `optValue2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\n\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`predicate(value1, value2)`; the predicate function must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Belt.Option\n\neq(Some(3), Some(15), clockEqual) == true\n\neq(Some(3), None, clockEqual) == false\n\neq(None, Some(3), clockEqual) == false\n\neq(None, None, clockEqual) == true\n```" - ], - "signature": "let eq: (option<'a>, option<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Option.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [ - "Uncurried version of `cmp`" - ], - "signature": "let cmpU: (option<'a>, option<'b>, ('a, 'b) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Option.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(optValue1, optValue2, comparisonFunction)` compares two optional values\nwith respect to given `comparisonFunction`.\n\nIf both `optValue1` and `optValue2` are `None`, it returns `0`.\n\nIf the first argument is `Some(value1)` and the second is `None`, returns `1`\n(something is greater than nothing).\n\nIf the first argument is `None` and the second is `Some(value2)`, returns `-1`\n(nothing is less than something).\n\nIf the arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`comparisonFunction(value1, value2)`; comparisonFunction takes two arguments\nand returns `-1` if the first argument is less than the second, `0` if the\narguments are equal, and `1` if the first argument is greater than the second.\n\n## Examples\n\n```rescript\nlet clockCompare = (a, b) => compare(mod(a, 12), mod(b, 12))\n\nopen Belt.Option\n\ncmp(Some(3), Some(15), clockCompare) == 0\n\ncmp(Some(3), Some(14), clockCompare) == 1\n\ncmp(Some(2), Some(15), clockCompare) == -1\n\ncmp(None, Some(15), clockCompare) == -1\n\ncmp(Some(14), None, clockCompare) == 1\n\ncmp(None, None, clockCompare) == 0\n```" - ], - "signature": "let cmp: (option<'a>, option<'b>, ('a, 'b) => int) => int" - } - ] - }, - "belt/hashmap": { - "id": "Belt.HashMap", - "name": "HashMap", - "docstrings": [ - "[`Belt.HashMap`]()\n\n The top level provides generic **mutable** hash map operations.\n\n It also has two specialized inner modules\n [`Belt.HashMap.Int`]() and [`Belt.HashMap.String`]()", - "A **mutable** Hash map which allows customized [`hash`]() behavior.\n\nAll data are parameterized by not its only type but also a unique identity in\nthe time of initialization, so that two _HashMaps of ints_ initialized with different\n_hash_ functions will have different type.\n\n## Examples\n\n```rescript\ntype t = int\nmodule I0 = unpack(Belt.Id.hashable(~hash=(_: t) => 0xff_ff, ~eq=(a, b) => a == b))\nlet s0: Belt.HashMap.t = Belt.HashMap.make(~hintSize=40, ~id=module(I0))\n\nmodule I1 = unpack(Belt.Id.hashable(~hash=(_: t) => 0xff, ~eq=(a, b) => a == b))\nlet s1: Belt.HashMap.t = Belt.HashMap.make(~hintSize=40, ~id=module(I1))\n```\n\nThe invariant must be held: for two elements who are _equal_,\ntheir hashed value should be the same\n\nHere the compiler would infer `s0` and `s1` having different type so that\nit would not mix.\n\n## Examples\n\n```\nlet s0: t\nlet s1: t\n```\n\nWe can add elements to the collection:\n\n## Examples\n\n```rescript\nlet () = {\n Belt.HashMap.set(s0, 0, 3)\n Belt.HashMap.set(s1, 1, \"3\")\n}\n```\n\nSince this is an mutable data strucure, `s1` will contain two pairs." - ], - "items": [ - { - "id": "Belt.HashMap.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of hash tables from type `'key` to type `'value`." - ], - "signature": "type t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making an empty hash map." - ], - "signature": "type id<'a, 'id> = Belt_Id.hashable<'a, 'id>" - }, - { - "id": "Belt.HashMap.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(~hintSize=10, ~id)` creates a new map by taking in the comparator and `hintSize`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\n\nBelt.HashMap.set(hMap, 0, \"a\")\n```" - ], - "signature": "let make: (~hintSize: int, ~id: id<'key, 'id>) => t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Clears a hash table.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.fromArray([(1, \"1\")], ~id=module(IntHash))\nBelt.HashMap.clear(hMap)\nBelt.HashMap.isEmpty(hMap) == true\n```" - ], - "signature": "let clear: t<'key, 'value, 'id> => unit" - }, - { - "id": "Belt.HashMap.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(m)` checks whether a hash map is empty.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nBelt.HashMap.isEmpty(Belt.HashMap.fromArray([(1, \"1\")], ~id=module(IntHash))) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b, 'c> => bool" - }, - { - "id": "Belt.HashMap.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(hMap, k, v)` if `k` does not exist, add the binding `k,v`, otherwise, update the old value with the new `v`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntHash))\n\nBelt.HashMap.set(s0, 2, \"3\")\n\nBelt.HashMap.valuesToArray(s0) == [\"1\", \"3\", \"3\"]\n```" - ], - "signature": "let set: (t<'key, 'value, 'id>, 'key, 'value) => unit" - }, - { - "id": "Belt.HashMap.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Creates copy of a hash map.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntHash))\nlet s1 = Belt.HashMap.copy(s0)\n\nBelt.HashMap.set(s0, 2, \"3\")\n\n(Belt.HashMap.get(s0, 2) != Belt.HashMap.get(s1, 2)) == true\n```" - ], - "signature": "let copy: t<'key, 'value, 'id> => t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns value bound under specific key. If values not exist returns `None`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\n\nBelt.HashMap.get(s0, 1) == Some(\"value1\")\nBelt.HashMap.get(s0, 2) == None\n```" - ], - "signature": "let get: (t<'key, 'value, 'id>, 'key) => option<'value>" - }, - { - "id": "Belt.HashMap.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if `x` is bound in `tbl`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\n\nBelt.HashMap.has(s0, 1) == true\nBelt.HashMap.has(s0, 2) == false\n```" - ], - "signature": "let has: (t<'key, 'value, 'id>, 'key) => bool" - }, - { - "id": "Belt.HashMap.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "If bound exists, removes it from the hash map.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.remove(s0, 1)\nBelt.HashMap.has(s0, 1) == false\n```" - ], - "signature": "let remove: (t<'key, 'value, 'id>, 'key) => unit" - }, - { - "id": "Belt.HashMap.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as [forEach](#forEach) but takes uncurried function." - ], - "signature": "let forEachU: (t<'key, 'value, 'id>, ('key, 'value) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashMap.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(tbl, f)` applies `f` to all bindings in table `tbl`. `f` receives the key as first argument, and the associated value as second argument. Each binding is presented exactly once to `f`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.forEach(s0, (key, value) => Js.log2(key, value))\n// prints (1, \"value1\")\n```" - ], - "signature": "let forEach: (t<'key, 'value, 'id>, ('key, 'value) => unit) => unit" - }, - { - "id": "Belt.HashMap.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashMap.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(tbl, init, f)` computes `(f(kN, dN) ... (f(k1, d1, init))...)`, where `k1 ... kN` are the keys of all bindings in `tbl`, and `d1 ... dN` are the associated values. Each binding is presented exactly once to `f`.\n\nThe order in which the bindings are passed to `f` is unspecified. However, if the table contains several bindings for the same key, they are passed to `f` in reverse order of introduction, that is, the most recent binding is passed first.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\n\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\ns0->Belt.HashMap.reduce(\"\", (acc, _, value) => acc ++ (\", \" ++ value)) == \", value1, value2\"\n```\n\n## More Examples\n\n```rescript\nConsole.log(\"lol\")\n```" - ], - "signature": "let reduce: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c" - }, - { - "id": "Belt.HashMap.keepMapInPlaceU", - "kind": "value", - "name": "keepMapInPlaceU", - "docstrings": [ - "Same as [keepMapInPlace](#keepMapInPlace) but takes uncurried function." - ], - "signature": "let keepMapInPlaceU: (\n t<'key, 'value, 'id>,\n ('key, 'value) => option<'value>,\n) => unit", - "deprecated": "Use `keepMapInPlace` instead" - }, - { - "id": "Belt.HashMap.keepMapInPlace", - "kind": "value", - "name": "keepMapInPlace", - "docstrings": [ - "Filters out values for which function `f` returned `None`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.keepMapInPlace(s0, (key, value) => key == 1 ? None : Some(value))\n```" - ], - "signature": "let keepMapInPlace: (\n t<'key, 'value, 'id>,\n ('key, 'value) => option<'value>,\n) => unit" - }, - { - "id": "Belt.HashMap.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(tbl)` returns the number of bindings in `tbl`. It takes constant time.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.size(s0) == 2\n```" - ], - "signature": "let size: t<'a, 'b, 'c> => int" - }, - { - "id": "Belt.HashMap.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of key value pairs.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.toArray(s0) == [(1, \"value1\"), (2, \"value2\")]\n```" - ], - "signature": "let toArray: t<'key, 'value, 'id> => array<('key, 'value)>" - }, - { - "id": "Belt.HashMap.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "Returns array of keys.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.keysToArray(s0) == [1, 2]\n```" - ], - "signature": "let keysToArray: t<'key, 'a, 'b> => array<'key>" - }, - { - "id": "Belt.HashMap.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [ - "Returns array of values.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.valuesToArray(s0) == [\"value1\", \"value2\"]\n```" - ], - "signature": "let valuesToArray: t<'a, 'value, 'b> => array<'value>" - }, - { - "id": "Belt.HashMap.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new hash map from array of pairs.\n\nReturns array of values.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(1, \"value1\"), (2, \"value2\")], ~id=module(IntHash))\nBelt.HashMap.toArray(s0) == [(1, \"value1\"), (2, \"value2\")]\n```" - ], - "signature": "let fromArray: (\n array<('key, 'value)>,\n ~id: id<'key, 'id>,\n) => t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.mergeMany(hMap, [(1, \"1\"), (2, \"2\")])\n```" - ], - "signature": "let mergeMany: (t<'key, 'value, 'id>, array<('key, 'value)>) => unit" - }, - { - "id": "Belt.HashMap.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(hMap, 1, \"1\")\n\nBelt.HashMap.getBucketHistogram(hMap)\n```" - ], - "signature": "let getBucketHistogram: t<'a, 'b, 'c> => array" - }, - { - "id": "Belt.HashMap.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(hMap, 1, \"1\")\n\nBelt.HashMap.logStats(hMap)\n```" - ], - "signature": "let logStats: t<'a, 'b, 'c> => unit" - } - ] - }, - "belt/hashset": { - "id": "Belt.HashSet", - "name": "HashSet", - "docstrings": [ - "[`Belt.HashSet`]()\n\n The top level provides generic **mutable** hash set operations.\n\n It also has two specialized inner modules\n [`Belt.HashSet.Int`]() and [`Belt.HashSet.String`]()", - "A **mutable** Hash set which allows customized `hash` behavior.\n\nAll data are parameterized by not its only type but also a unique identity in\nthe time of initialization, so that two _HashSets of ints_ initialized with\ndifferent _hash_ functions will have different type.\n\n## Examples\n\n```rescript\nmodule I0 = unpack(Belt.Id.hashable(~hash=(a: int) => land(a, 65535), ~eq=(a, b) => a == b))\n\nlet s0 = Belt.HashSet.make(~id=module(I0), ~hintSize=40)\n\nmodule I1 = unpack(Belt.Id.hashable(~hash=(a: int) => land(a, 255), ~eq=(a, b) => a == b))\n\nlet s1 = Belt.HashSet.make(~id=module(I1), ~hintSize=40)\n\nBelt.HashSet.add(s1, 0)\nBelt.HashSet.add(s1, 1)\n```\n\nThe invariant must be held: for two elements who are equal, their hashed\nvalue should be the same.\n\nHere the compiler would infer `s0` and `s1` having different type so that it\nwould not mix.\n\nSignatures:\n\n```\nlet s0: Belt.HashSet.t\nlet s1: Belt.HashSet.t\n```\n\nWe can add elements to the collection (see last two lines in the example\nabove). Since this is an mutable data structure, `s1` will contain two pairs." - ], - "items": [ - { - "id": "Belt.HashSet.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a, 'id>" - }, - { - "id": "Belt.HashSet.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The type of hash tables from type `'a` to type `'b`." - ], - "signature": "type id<'a, 'id> = Belt_Id.hashable<'a, 'id>" - }, - { - "id": "Belt.HashSet.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int, ~id: id<'a, 'id>) => t<'a, 'id>" - }, - { - "id": "Belt.HashSet.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a, 'id> => unit" - }, - { - "id": "Belt.HashSet.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.HashSet.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t<'a, 'id>, 'a) => unit" - }, - { - "id": "Belt.HashSet.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a, 'id> => t<'a, 'id>" - }, - { - "id": "Belt.HashSet.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a, 'id>, 'a) => bool" - }, - { - "id": "Belt.HashSet.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t<'a, 'id>, 'a) => unit" - }, - { - "id": "Belt.HashSet.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a, 'id>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashSet.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Order unspecified." - ], - "signature": "let forEach: (t<'a, 'id>, 'a => unit) => unit" - }, - { - "id": "Belt.HashSet.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a, 'id>, 'c, ('c, 'a) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashSet.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Order unspecified." - ], - "signature": "let reduce: (t<'a, 'id>, 'c, ('c, 'a) => 'c) => 'c" - }, - { - "id": "Belt.HashSet.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a, 'id> => int" - }, - { - "id": "Belt.HashSet.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t<'a, 'b> => unit" - }, - { - "id": "Belt.HashSet.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'a, 'id> => array<'a>" - }, - { - "id": "Belt.HashSet.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: (array<'a>, ~id: id<'a, 'id>) => t<'a, 'id>" - }, - { - "id": "Belt.HashSet.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'a, 'id>, array<'a>) => unit" - }, - { - "id": "Belt.HashSet.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t<'a, 'b> => array" - } - ] - }, - "belt/mutablemap": { - "id": "Belt.MutableMap", - "name": "MutableMap", - "docstrings": [ - "[`Belt.MutableMap`]()\n\n The top level provides generic **mutable** map operations.\n\n It also has two specialized inner modules\n [`Belt.MutableMap.Int`]() and [`Belt.MutableMap.String`]()" - ], - "items": [ - { - "id": "Belt.MutableMap.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v, 'id>" - }, - { - "id": "Belt.MutableMap.id", - "kind": "type", - "name": "id", - "docstrings": [], - "signature": "type id<'key, 'id> = Belt_Id.comparable<'key, 'id>" - }, - { - "id": "Belt.MutableMap.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~id: id<'k, 'id>) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.MutableMap.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a, 'b, 'c> => unit" - }, - { - "id": "Belt.MutableMap.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a, 'b, 'c> => bool" - }, - { - "id": "Belt.MutableMap.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'k, 'a, 'b>, 'k) => bool" - }, - { - "id": "Belt.MutableMap.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.MutableMap.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m1, m2, cmp)` First compare by size, if size is the same, compare by\nkey, value pair." - ], - "signature": "let cmp: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.MutableMap.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.MutableMap.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, eqf)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `eqf` is the\nequality predicate used to compare the data associated with the keys." - ], - "signature": "let eq: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableMap.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies f to all bindings in map `m`. `f` receives the `'k`\nas first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys." - ], - "signature": "let forEach: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit" - }, - { - "id": "Belt.MutableMap.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableMap.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f), computes`(f(kN, dN) ... (f(k1, d1, a))...)`, where`k1 ...\nkN`are the keys of all bindings in`m`(in increasing order), and`d1 ... dN`\nare the associated data." - ], - "signature": "let reduce: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableMap.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableMap.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`." - ], - "signature": "let every: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableMap.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`." - ], - "signature": "let some: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'k, 'a, 'id> => int" - }, - { - "id": "Belt.MutableMap.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'k, 'a, 'id> => list<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'k, 'a, 'id> => array<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: (array<('k, 'a)>, ~id: id<'k, 'id>) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.MutableMap.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'k, 'a, 'b> => array<'k>" - }, - { - "id": "Belt.MutableMap.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'b, 'a, 'c> => array<'a>" - }, - { - "id": "Belt.MutableMap.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.MutableMap.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.MutableMap.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.MutableMap.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.MutableMap.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'k, 'a, 'id>, 'k) => option<'a>" - }, - { - "id": "Belt.MutableMap.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'k, 'a, 'id>, 'k) => Js.undefined<'a>" - }, - { - "id": "Belt.MutableMap.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'k, 'a, 'id>, 'k, 'a) => 'a" - }, - { - "id": "Belt.MutableMap.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'k, 'a, 'id>, 'k) => 'a" - }, - { - "id": "Belt.MutableMap.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'k, 'a, 'id>, 'k) => 'a" - }, - { - "id": "Belt.MutableMap.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "Throw when invariant is not held." - ], - "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit" - }, - { - "id": "Belt.MutableMap.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` do the in-place modification." - ], - "signature": "let remove: (t<'k, 'a, 'id>, 'k) => unit" - }, - { - "id": "Belt.MutableMap.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'k, 'a, 'id>, array<'k>) => unit" - }, - { - "id": "Belt.MutableMap.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` do the in-place modification" - ], - "signature": "let set: (t<'k, 'a, 'id>, 'k, 'a) => unit" - }, - { - "id": "Belt.MutableMap.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'k, 'a, 'id>, 'k, option<'a> => option<'a>) => unit", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.MutableMap.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'k, 'a, 'id>, 'k, option<'a> => option<'a>) => unit" - }, - { - "id": "Belt.MutableMap.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'k, 'a, 'id>, array<('k, 'a)>) => unit" - }, - { - "id": "Belt.MutableMap.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableMap.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated\nvalue a of all bindings of `m` has been replaced by the result of the\napplication of `f` to `a`. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let map: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>" - }, - { - "id": "Belt.MutableMap.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.MutableMap.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>" - } - ] - }, - "belt/mutableset": { - "id": "Belt.MutableSet", - "name": "MutableSet", - "docstrings": [ - "[`Belt.MutableSet`]()\n\n The top level provides generic **mutable** set operations.\n\n It also has two specialized inner modules\n [`Belt.MutableSet.Int`]() and [`Belt.MutableSet.String`]()", - "A **mutable** sorted set module which allows customized compare behavior.\nThe implementation uses balanced binary trees, and therefore searching and insertion take time logarithmic in the size of the map.\n\nIt also has two specialized inner modules [Belt.MutableSet.Int](mutable-set-int) and [Belt.MutableSet.String](mutable-set-string) - This module separates data from function which is more verbose but slightly more efficient\n\n## Examples\n\n```rescript\nmodule PairComparator = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet = Belt.MutableSet.make(~id=module(PairComparator))\nmySet->Belt.MutableSet.add((1, 2))\n```" - ], - "items": [ - { - "id": "Belt.MutableSet.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'value, 'identity>" - }, - { - "id": "Belt.MutableSet.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making a set from scratch" - ], - "signature": "type id<'value, 'id> = Belt_Id.comparable<'value, 'id>" - }, - { - "id": "Belt.MutableSet.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new set by taking in the comparator" - ], - "signature": "let make: (~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let fromArray: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [ - "The same as [fromArray][#fromarray] except it is after assuming the input array is already sorted." - ], - "signature": "let fromSortedArrayUnsafe: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Returns copy of a set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\nlet copied = s0->Belt.MutableSet.copy\ncopied->Belt.MutableSet.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let copy: t<'value, 'id> => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.MutableSet.fromArray([], ~id=module(IntCmp))\nlet notEmpty = Belt.MutableSet.fromArray([1], ~id=module(IntCmp))\n\nBelt.MutableSet.isEmpty(empty) == true\nBelt.MutableSet.isEmpty(notEmpty) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.MutableSet.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if element exists in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.fromArray([1, 4, 2, 5], ~id=module(IntCmp))\n\nset->Belt.MutableSet.has(3) == false\nset->Belt.MutableSet.has(1) == true\n```" - ], - "signature": "let has: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.MutableSet.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\ns0->Belt.MutableSet.add(1)\ns0->Belt.MutableSet.add(2)\ns0->Belt.MutableSet.add(2)\n\ns0->Belt.MutableSet.toArray == [1, 2]\n```" - ], - "signature": "let add: (t<'value, 'id>, 'value) => unit" - }, - { - "id": "Belt.MutableSet.addCheck", - "kind": "value", - "name": "addCheck", - "docstrings": [], - "signature": "let addCheck: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.MutableSet.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "Adds each element of array to set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.make(~id=module(IntCmp))\n\nset->Belt.MutableSet.mergeMany([5, 4, 3, 2, 1])\nset->Belt.MutableSet.toArray == [1, 2, 3, 4, 5]\n```" - ], - "signature": "let mergeMany: (t<'value, 'id>, array<'value>) => unit" - }, - { - "id": "Belt.MutableSet.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([2, 3, 1, 4, 5], ~id=module(IntCmp))\ns0->Belt.MutableSet.remove(1)\ns0->Belt.MutableSet.remove(3)\ns0->Belt.MutableSet.remove(3)\n\ns0->Belt.MutableSet.toArray == [2, 4, 5]\n```" - ], - "signature": "let remove: (t<'value, 'id>, 'value) => unit" - }, - { - "id": "Belt.MutableSet.removeCheck", - "kind": "value", - "name": "removeCheck", - "docstrings": [], - "signature": "let removeCheck: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.MutableSet.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "Removes each element of array from set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\nset->Belt.MutableSet.removeMany([5, 4, 3, 2, 1])\nset->Belt.MutableSet.toArray == []\n```" - ], - "signature": "let removeMany: (t<'value, 'id>, array<'value>) => unit" - }, - { - "id": "Belt.MutableSet.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet union = Belt.MutableSet.union(s0, s1)\nunion->Belt.MutableSet.toArray == [1, 2, 3, 4, 5, 6]\n```" - ], - "signature": "let union: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet intersect = Belt.MutableSet.intersect(s0, s1)\nintersect->Belt.MutableSet.toArray == [2, 3, 5]\n```" - ], - "signature": "let intersect: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.diff", - "kind": "value", - "name": "diff", - "docstrings": [ - "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nBelt.MutableSet.toArray(Belt.MutableSet.diff(s0, s1)) == [6]\nBelt.MutableSet.toArray(Belt.MutableSet.diff(s1, s0)) == [1, 4]\n```" - ], - "signature": "let diff: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet s2 = Belt.MutableSet.intersect(s0, s1)\nBelt.MutableSet.subset(s2, s0) == true\nBelt.MutableSet.subset(s2, s1) == true\nBelt.MutableSet.subset(s1, s0) == false\n```" - ], - "signature": "let subset: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.MutableSet.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets of sets.\nIt compares size first and then iterates over each element following the order of elements." - ], - "signature": "let cmp: (t<'value, 'id>, t<'value, 'id>) => int" - }, - { - "id": "Belt.MutableSet.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 5], ~id=module(IntCmp))\n\nBelt.MutableSet.eq(s0, s1) == true\n```" - ], - "signature": "let eq: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.MutableSet.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as `Belt.MutableSet.forEach` but takes uncurried functon." - ], - "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableSet.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet acc = ref(list{})\ns0->Belt.MutableSet.forEach(x => acc := Belt.List.add(acc.contents, x))\nacc.contents == list{6, 5, 3, 2}\n```" - ], - "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit" - }, - { - "id": "Belt.MutableSet.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableSet.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\ns0->Belt.MutableSet.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) ==\n list{6, 5, 3, 2}\n```" - ], - "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a" - }, - { - "id": "Belt.MutableSet.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableSet.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.MutableSet.fromArray([2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.MutableSet.every(isEven) == true\n```" - ], - "signature": "let every: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.MutableSet.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableSet.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.MutableSet.some(isOdd) == true\n```" - ], - "signature": "let some: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.MutableSet.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.MutableSet.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.MutableSet.keep(isEven)\n\ns1->Belt.MutableSet.toArray == [2, 4]\n```" - ], - "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.MutableSet.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet (s1, s2) = s0->Belt.MutableSet.partition(isOdd)\n\ns1->Belt.MutableSet.toArray == [1, 3, 5]\ns2->Belt.MutableSet.toArray == [2, 4]\n```" - ], - "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)" - }, - { - "id": "Belt.MutableSet.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.size == 4\n```" - ], - "signature": "let size: t<'value, 'id> => int" - }, - { - "id": "Belt.MutableSet.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toList == list{1, 2, 3, 5}\n```" - ], - "signature": "let toList: t<'value, 'id> => list<'value>" - }, - { - "id": "Belt.MutableSet.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toArray == [1, 2, 3, 5]\n```" - ], - "signature": "let toArray: t<'value, 'id> => array<'value>" - }, - { - "id": "Belt.MutableSet.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.minimum == None\ns1->Belt.MutableSet.minimum == Some(1)\n```" - ], - "signature": "let minimum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.MutableSet.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "Returns minimum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.minUndefined == Js.undefined\ns1->Belt.MutableSet.minUndefined == Js.Undefined.return(1)\n```" - ], - "signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.MutableSet.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.maximum == None\ns1->Belt.MutableSet.maximum == Some(5)\n```" - ], - "signature": "let maximum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.MutableSet.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "Returns maximum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.maxUndefined == Js.undefined\ns1->Belt.MutableSet.maxUndefined == Js.Undefined.return(5)\n```" - ], - "signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.MutableSet.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the reference of the value which is equivalent to value using the comparator specifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.get(3) == Some(3)\ns0->Belt.MutableSet.get(20) == None\n```" - ], - "signature": "let get: (t<'value, 'id>, 'value) => option<'value>" - }, - { - "id": "Belt.MutableSet.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "Same as `Belt.MutableSet.get` but returns `undefined` when element does not exist." - ], - "signature": "let getUndefined: (t<'value, 'id>, 'value) => Js.undefined<'value>" - }, - { - "id": "Belt.MutableSet.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as `Belt.MutableSet.get` but throw when element does not exist." - ], - "signature": "let getExn: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.MutableSet.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as `Belt.MutableSet.get` but throw when element does not exist." - ], - "signature": "let getOrThrow: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.MutableSet.split", - "kind": "value", - "name": "split", - "docstrings": [ - "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\nlet ((smaller, larger), present) = s0->Belt.MutableSet.split(3)\n\npresent == true\nsmaller->Belt.MutableSet.toArray == [1, 2]\nlarger->Belt.MutableSet.toArray == [4, 5]\n```" - ], - "signature": "let split: (\n t<'value, 'id>,\n 'value,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)" - }, - { - "id": "Belt.MutableSet.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b> => unit" - } - ] - }, - "belt/map": { - "id": "Belt.Map", - "name": "Map", - "docstrings": [ - "[`Belt.Map`](),\n\n The top level provides generic **immutable** map operations.\n\n It also has three specialized inner modules\n [`Belt.Map.Int`](), [`Belt.Map.String`]() and\n\n [`Belt.Map.Dict`](): This module separates data from function\n which is more verbose but slightly more efficient", - "The top level provides generic immutable map operations.\n\nIt also has three specialized inner modules `Belt.Map.Int`, `Belt.Map.String`\nand `Belt.Map.Dict`." - ], - "items": [ - { - "id": "Belt.Map.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'key` is the field type\n\n`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'key, 'value, 'identity>" - }, - { - "id": "Belt.Map.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making an empty map." - ], - "signature": "type id<'key, 'id> = Belt_Id.comparable<'key, 'id>" - }, - { - "id": "Belt.Map.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(~id)` creates a new map by taking in the comparator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet m = Belt.Map.make(~id=module(IntCmp))\n\nBelt.Map.set(m, 0, \"a\")\n```" - ], - "signature": "let make: (~id: id<'k, 'id>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(m)` checks whether a map m is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.isEmpty(Belt.Map.fromArray([(1, \"1\")], ~id=module(IntCmp))) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b, 'c> => bool" - }, - { - "id": "Belt.Map.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(m, k)` checks whether `m` has the key `k`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.has(Belt.Map.fromArray([(1, \"1\")], ~id=module(IntCmp)), 1) == true\n```" - ], - "signature": "let has: (t<'k, 'v, 'id>, 'k) => bool" - }, - { - "id": "Belt.Map.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m0, m1, vcmp);`\n\nTotal ordering of map given total ordering of value function.\n\nIt will compare size first and each element following the order one by one." - ], - "signature": "let cmp: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => int) => int" - }, - { - "id": "Belt.Map.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "eq(m1, m2, veq)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `veq` is the\nequality predicate used to compare the data associated with the keys." - ], - "signature": "let eq: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`\nfindFirstBy(m, p)` uses function `f` to find the first key value pair to match predicate `p`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"\")])\n\ns0->Belt.Map.findFirstBy((k, _) => k == 4) == Some(4, \"4\")\n```" - ], - "signature": "let findFirstBy: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>" - }, - { - "id": "Belt.Map.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'k, 'v, 'id>, ('k, 'v) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the\n`'k` as first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")])\n\nlet acc = ref(list{})\n\nBelt.Map.forEach(s0, (k, v) => acc := list{(k, v), ...acc.contents})\n\nacc.contents == list{(4, \"4\"), (3, \"3\"), (2, \"2\"), (1, \"1\")}\n```" - ], - "signature": "let forEach: (t<'k, 'v, 'id>, ('k, 'v) => unit) => unit" - }, - { - "id": "Belt.Map.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'k, 'v, 'id>, 'acc, ('acc, 'k, 'v) => 'acc) => 'acc", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f(kN, dN) ... (f(k1, d1, a))...)`, where `k1\n... kN` are the keys of all bindings in m (in increasing order), and `d1\n... dN` are the associated data.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")])\n\nBelt.Map.reduce(s0, list{}, (acc, k, v) => list{(k, v), ...acc}) ==\n list{(4, \"4\"), (3, \"3\"), (2, \"2\"), (1, \"1\")}\n```" - ], - "signature": "let reduce: (t<'k, 'v, 'id>, 'acc, ('acc, 'k, 'v) => 'acc) => 'acc" - }, - { - "id": "Belt.Map.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let every: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate \n`p`. Order unspecified" - ], - "signature": "let some: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(s)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.size(Belt.Map.fromArray([(2, \"2\"), (2, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == 2\n```" - ], - "signature": "let size: t<'k, 'v, 'id> => int" - }, - { - "id": "Belt.Map.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(s)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.toArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n (1, \"1\"),\n (2, \"2\"),\n (3, \"3\"),\n ]\n```" - ], - "signature": "let toArray: t<'k, 'v, 'id> => array<('k, 'v)>" - }, - { - "id": "Belt.Map.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order. See `Belt.Map.toArray`" - ], - "signature": "let toList: t<'k, 'v, 'id> => list<('k, 'v)>" - }, - { - "id": "Belt.Map.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(kvs, ~id);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.toArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n (1, \"1\"),\n (2, \"2\"),\n (3, \"3\"),\n ]\n```" - ], - "signature": "let fromArray: (array<('k, 'v)>, ~id: id<'k, 'id>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "`keysToArray(s);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.keysToArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n 1,\n 2,\n 3,\n ]\n```" - ], - "signature": "let keysToArray: t<'k, 'v, 'id> => array<'k>" - }, - { - "id": "Belt.Map.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [ - "`valuesToArray(s);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.valuesToArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n \"1\",\n \"2\",\n \"3\",\n ]\n```" - ], - "signature": "let valuesToArray: t<'k, 'v, 'id> => array<'v>" - }, - { - "id": "Belt.Map.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [ - "`minKey(s)` returns the minimum key, None if not exist." - ], - "signature": "let minKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [ - "See `Belt.Map.minKey`" - ], - "signature": "let minKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [ - "`maxKey(s)` returns the maximum key, None if not exist." - ], - "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [ - "See `Belt.Map.maxKey`" - ], - "signature": "let maxKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "`minimum(s)` returns the minimum key value pair, None if not exist." - ], - "signature": "let minimum: t<'k, 'v, 'a> => option<('k, 'v)>" - }, - { - "id": "Belt.Map.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "See `Belt.Map.minimum`" - ], - "signature": "let minUndefined: t<'k, 'v, 'a> => Js.undefined<('k, 'v)>" - }, - { - "id": "Belt.Map.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "`maximum(s)` returns the maximum key value pair, None if not exist." - ], - "signature": "let maximum: t<'k, 'v, 'a> => option<('k, 'v)>" - }, - { - "id": "Belt.Map.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "See `Belt.Map.maximum`" - ], - "signature": "let maxUndefined: t<'k, 'v, 'a> => Js.undefined<('k, 'v)>" - }, - { - "id": "Belt.Map.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(s, k)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.get(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp)), 2) == Some(\"2\")\n\nBelt.Map.get(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp)), 4) == None\n```" - ], - "signature": "let get: (t<'k, 'v, 'id>, 'k) => option<'v>" - }, - { - "id": "Belt.Map.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "See `Belt.Map.get`. Returns `undefined` when not found" - ], - "signature": "let getUndefined: (t<'k, 'v, 'id>, 'k) => Js.undefined<'v>" - }, - { - "id": "Belt.Map.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [ - "`getWithDefault(s, k, default)`\n\nSee `Belt.Map.get`\n\nReturns default when `k` is not found." - ], - "signature": "let getWithDefault: (t<'k, 'v, 'id>, 'k, 'v) => 'v" - }, - { - "id": "Belt.Map.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(s, k)`\n\nSee `Belt.Map.get`\n\nthrow when `k` not exist" - ], - "signature": "let getExn: (t<'k, 'v, 'id>, 'k) => 'v" - }, - { - "id": "Belt.Map.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(s, k)`\n\nSee `Belt.Map.get`\n\nthrow when `k` not exist" - ], - "signature": "let getOrThrow: (t<'k, 'v, 'id>, 'k) => 'v" - }, - { - "id": "Belt.Map.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` when `x` is not in `m`, `m` is returned reference unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))\n\nlet s1 = Belt.Map.remove(s0, 1)\n\nlet s2 = Belt.Map.remove(s1, 1)\n\ns1 == s2\n\nBelt.Map.keysToArray(s1) == [2, 3]\n```" - ], - "signature": "let remove: (t<'k, 'v, 'id>, 'k) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "`removeMany(s, xs)`\n\nRemoving each of `xs` to `s`, note unlike `Belt.Map.remove`, the reference\nof return value might be changed even if none in `xs` exists `s`." - ], - "signature": "let removeMany: (t<'k, 'v, 'id>, array<'k>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as `m`, with a\nnew binding of `x` to `y`. If `x` was already bound in `m`, its previous\nbinding disappears.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))\n\nlet s1 = Belt.Map.set(s0, 2, \"3\")\n\nBelt.Map.valuesToArray(s1) == [\"1\", \"3\", \"3\"]\n```" - ], - "signature": "let set: (t<'k, 'v, 'id>, 'k, 'v) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (\n t<'k, 'v, 'id>,\n 'k,\n option<'v> => option<'v>,\n) => t<'k, 'v, 'id>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.update", - "kind": "value", - "name": "update", - "docstrings": [ - "`update(m, x, f)` returns a map containing the same bindings as `m`, except\nfor the binding of `x`. Depending on the value of `y` where `y` is\n`f(get(m, x))`, the binding of `x` is added, removed or updated. If `y` is\n`None`, the binding is removed if it exists; otherwise, if `y` is `Some(z)`\nthen `x` is associated to `z` in the resulting map." - ], - "signature": "let update: (\n t<'k, 'v, 'id>,\n 'k,\n option<'v> => option<'v>,\n) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "`mergeMany(s, xs)`\n\nAdding each of `xs` to `s`, note unlike `add`, the reference of return\nvalue might be changed even if all values in `xs` exist `s`." - ], - "signature": "let mergeMany: (t<'k, 'v, 'id>, array<('k, 'v)>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'k, 'v, 'id>,\n t<'k, 'v2, 'id>,\n ('k, option<'v>, option<'v2>) => option<'v3>,\n) => t<'k, 'v3, 'id>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'k, 'v, 'id>,\n t<'k, 'v2, 'id>,\n ('k, option<'v>, option<'v2>) => option<'v3>,\n) => t<'k, 'v3, 'id>" - }, - { - "id": "Belt.Map.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => t<'k, 'v, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in m that satisfy\npredicate `p`." - ], - "signature": "let keep: (t<'k, 'v, 'id>, ('k, 'v) => bool) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'k, 'v, 'id>,\n ('k, 'v) => bool,\n) => (t<'k, 'v, 'id>, t<'k, 'v, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains\nall the bindings of `s` that satisfy the predicate `p`, and `m2` is the map\nwith all the bindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (\n t<'k, 'v, 'id>,\n ('k, 'v) => bool,\n) => (t<'k, 'v, 'id>, t<'k, 'v, 'id>)" - }, - { - "id": "Belt.Map.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a tuple `(l, r)`, data, where `l` is the map with all\nthe bindings of `m` whose 'k is strictly less than `x`; `r` is the map with\nall the bindings of m whose 'k is strictly greater than `x`; `data` is\n`None` if `m` contains no binding for `x`, or `Some(v)` if `m` binds `v` to\n`x`." - ], - "signature": "let split: (\n t<'k, 'v, 'id>,\n 'k,\n) => ((t<'k, 'v, 'id>, t<'k, 'v, 'id>), option<'v>)" - }, - { - "id": "Belt.Map.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'k, 'v, 'id>, 'v => 'v2) => t<'k, 'v2, 'id>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'k, 'v, 'id>, 'v => 'v2) => t<'k, 'v2, 'id>" - }, - { - "id": "Belt.Map.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'k, 'v, 'id>, ('k, 'v) => 'v2) => t<'k, 'v2, 'id>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [ - "`mapWithKey(m, f)`\n\nThe same as `Belt.Map.map` except that `f` is supplied with one more\nargument: the key." - ], - "signature": "let mapWithKey: (t<'k, 'v, 'id>, ('k, 'v) => 'v2) => t<'k, 'v2, 'id>" - }, - { - "id": "Belt.Map.getData", - "kind": "value", - "name": "getData", - "docstrings": [ - "`getData(s0)`\n\nAdvanced usage only\n\nReturns the raw data (detached from comparator), but its type is still\nmanifested, so that user can pass identity directly without boxing." - ], - "signature": "let getData: t<'k, 'v, 'id> => Belt_MapDict.t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.getId", - "kind": "value", - "name": "getId", - "docstrings": [ - "Advanced usage only. Returns the identity of s0." - ], - "signature": "let getId: t<'k, 'v, 'id> => id<'k, 'id>" - }, - { - "id": "Belt.Map.packIdData", - "kind": "value", - "name": "packIdData", - "docstrings": [ - "`packIdData(~id, ~data)`\n\nAdvanced usage only\n\nReturns the packed collection." - ], - "signature": "let packIdData: (\n ~id: id<'k, 'id>,\n ~data: Belt_MapDict.t<'k, 'v, 'id>,\n) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit" - } - ] - }, - "belt/set": { - "id": "Belt.Set", - "name": "Set", - "docstrings": [ - "[`Belt.Set`]()\n\n The top level provides generic **immutable** set operations.\n\n It also has three specialized inner modules\n [`Belt.Set.Int`](), [`Belt.Set.String`]() and\n\n [`Belt.Set.Dict`](): This module separates data from function\n which is more verbose but slightly more efficient", - "An _immutable_ sorted set module which allows customized _compare_ behavior.\n\nThe implementation uses balanced binary trees, and therefore searching\nand insertion take time logarithmic in the size of the map.\n\nFor more info on this module's usage of identity, `make` and others, please see\nthe top level documentation of Belt, **A special encoding for collection safety**.\n\n## Examples\n\n```rescript\nmodule PairComparator = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet = Belt.Set.make(~id=module(PairComparator))\nlet mySet2 = Belt.Set.add(mySet, (1, 2))\n```\n\n**Note:** This module's examples will assume a predeclared module for integers\ncalled `IntCmp`. It is declared like this:\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n```" - ], - "items": [ - { - "id": "Belt.Set.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'value, 'identity>" - }, - { - "id": "Belt.Set.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making a set from scratch" - ], - "signature": "type id<'value, 'id> = Belt_Id.comparable<'value, 'id>" - }, - { - "id": "Belt.Set.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new set by taking in the comparator\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.make(~id=module(IntCmp))\n\nBelt.Set.isEmpty(set) == true\n```" - ], - "signature": "let make: (~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\ns0->Belt.Set.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let fromArray: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [ - "The same as [fromArray][#fromarray] except it is after assuming the input array\nis already sorted." - ], - "signature": "let fromSortedArrayUnsafe: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.Set.fromArray([], ~id=module(IntCmp))\nlet notEmpty = Belt.Set.fromArray([1], ~id=module(IntCmp))\n\nBelt.Set.isEmpty(empty) == true\nBelt.Set.isEmpty(notEmpty) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.Set.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if element exists in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.fromArray([1, 4, 2, 5], ~id=module(IntCmp))\n\nset->Belt.Set.has(3) == false\nset->Belt.Set.has(1) == true\n```" - ], - "signature": "let has: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.Set.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\n\nlet s1 = s0->Belt.Set.add(1)\nlet s2 = s1->Belt.Set.add(2)\nlet s3 = s2->Belt.Set.add(2)\n\ns0->Belt.Set.toArray == []\ns1->Belt.Set.toArray == [1]\ns2->Belt.Set.toArray == [1, 2]\ns3->Belt.Set.toArray == [1, 2]\ns2 == s3\n```" - ], - "signature": "let add: (t<'value, 'id>, 'value) => t<'value, 'id>" - }, - { - "id": "Belt.Set.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "Adds each element of array to set. Unlike `Belt.Set.add`\\](\\#add), the reference of return value might be changed even if all values in array already exist in set\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.make(~id=module(IntCmp))\n\nlet newSet = set->Belt.Set.mergeMany([5, 4, 3, 2, 1])\n\nnewSet->Belt.Set.toArray == [1, 2, 3, 4, 5]\n```" - ], - "signature": "let mergeMany: (t<'value, 'id>, array<'value>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([2, 3, 1, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.Set.remove(1)\nlet s2 = s1->Belt.Set.remove(3)\nlet s3 = s2->Belt.Set.remove(3)\n\ns1->Belt.Set.toArray == [2, 3, 4, 5]\ns2->Belt.Set.toArray == [2, 4, 5]\ns2 == s3\n```" - ], - "signature": "let remove: (t<'value, 'id>, 'value) => t<'value, 'id>" - }, - { - "id": "Belt.Set.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "Removes each element of array from set. Unlike [remove](#remove), the reference of return value might be changed even if none of values in array existed in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\nlet newSet = set->Belt.Set.removeMany([5, 4, 3, 2, 1])\n\nnewSet->Belt.Set.toArray == []\n```" - ], - "signature": "let removeMany: (t<'value, 'id>, array<'value>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet union = Belt.Set.union(s0, s1)\n\nunion->Belt.Set.toArray == [1, 2, 3, 4, 5, 6]\n```" - ], - "signature": "let union: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\n\nlet intersect = Belt.Set.intersect(s0, s1)\n\nintersect->Belt.Set.toArray == [2, 3, 5]\n```" - ], - "signature": "let intersect: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.diff", - "kind": "value", - "name": "diff", - "docstrings": [ - "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\n\nBelt.Set.diff(s0, s1)->Belt.Set.toArray == [6]\n\nBelt.Set.diff(s1, s0)->Belt.Set.toArray == [1, 4]\n```" - ], - "signature": "let diff: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet s2 = Belt.Set.intersect(s0, s1)\n\nBelt.Set.subset(s2, s0) == true\nBelt.Set.subset(s2, s1) == true\nBelt.Set.subset(s1, s0) == false\n```" - ], - "signature": "let subset: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.Set.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets. It compares size first and then iterates over each element following\nthe order of elements." - ], - "signature": "let cmp: (t<'value, 'id>, t<'value, 'id>) => int" - }, - { - "id": "Belt.Set.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 5], ~id=module(IntCmp))\n\nBelt.Set.eq(s0, s1) == true\n```" - ], - "signature": "let eq: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.Set.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as [forEach](#forEach) but takes uncurried functon." - ], - "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\n\nlet acc = ref(list{})\n\ns0->Belt.Set.forEach(x => {\n acc := Belt.List.add(acc.contents, x)\n})\n\nacc.contents == list{6, 5, 3, 2}\n```" - ], - "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit" - }, - { - "id": "Belt.Set.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\ns0->Belt.Set.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) == list{6, 5, 3, 2}\n```" - ], - "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a" - }, - { - "id": "Belt.Set.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.fromArray([2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.Set.every(isEven) == true\n```" - ], - "signature": "let every: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.fromArray([1, 2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.Set.some(isOdd) == true\n```" - ], - "signature": "let some: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.Set.keep(isEven)\n\ns1->Belt.Set.toArray == [2, 4]\n```" - ], - "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>" - }, - { - "id": "Belt.Set.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "Returns a pair of sets, where first is the set of all the elements of set that satisfy the predicate, and second is the set of all the elements of set that do not satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet (s1, s2) = s0->Belt.Set.partition(isOdd)\n\ns1->Belt.Set.toArray == [1, 3, 5]\ns2->Belt.Set.toArray == [2, 4]\n```" - ], - "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)" - }, - { - "id": "Belt.Set.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\ns0->Belt.Set.size == 4\n```" - ], - "signature": "let size: t<'value, 'id> => int" - }, - { - "id": "Belt.Set.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.toArray == [1, 2, 3, 5]\n```" - ], - "signature": "let toArray: t<'value, 'id> => array<'value>" - }, - { - "id": "Belt.Set.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.toList == list{1, 2, 3, 5}\n```" - ], - "signature": "let toList: t<'value, 'id> => list<'value>" - }, - { - "id": "Belt.Set.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.minimum == None\ns1->Belt.Set.minimum == Some(1)\n```" - ], - "signature": "let minimum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "Returns minimum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.minUndefined->Js.Undefined.toOption == None\ns1->Belt.Set.minUndefined->Js.Undefined.toOption == Some(1)\n```" - ], - "signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.maximum == None\ns1->Belt.Set.maximum == Some(5)\n```" - ], - "signature": "let maximum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "Returns maximum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0\n->Belt.Set.maxUndefined\n->Js.Undefined.toOption == None\n\ns1\n->Belt.Set.maxUndefined\n->Js.Undefined.toOption == Some(5)\n```" - ], - "signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the reference of the value which is equivalent to value using the comparator specifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.get(3) == Some(3)\ns0->Belt.Set.get(20) == None\n```" - ], - "signature": "let get: (t<'value, 'id>, 'value) => option<'value>" - }, - { - "id": "Belt.Set.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "Same as [get](#get) but returns `undefined` when element does not exist." - ], - "signature": "let getUndefined: (t<'value, 'id>, 'value) => Js.undefined<'value>" - }, - { - "id": "Belt.Set.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getExn: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.Set.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getOrThrow: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.Set.split", - "kind": "value", - "name": "split", - "docstrings": [ - "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\nlet ((smaller, larger), present) = s0->Belt.Set.split(3)\n\npresent == true\nsmaller->Belt.Set.toArray == [1, 2]\nlarger->Belt.Set.toArray == [4, 5]\n```" - ], - "signature": "let split: (\n t<'value, 'id>,\n 'value,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)" - }, - { - "id": "Belt.Set.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b> => unit" - }, - { - "id": "Belt.Set.getData", - "kind": "value", - "name": "getData", - "docstrings": [ - "**Advanced usage only**\n\nReturns the raw data (detached from comparator), but its type is still manifested,\nso that user can pass identity directly without boxing." - ], - "signature": "let getData: t<'value, 'id> => Belt_SetDict.t<'value, 'id>" - }, - { - "id": "Belt.Set.getId", - "kind": "value", - "name": "getId", - "docstrings": [ - "**Advanced usage only**\n\nReturns the identity of set." - ], - "signature": "let getId: t<'value, 'id> => id<'value, 'id>" - }, - { - "id": "Belt.Set.packIdData", - "kind": "value", - "name": "packIdData", - "docstrings": [ - "**Advanced usage only**\n\nReturns the packed collection." - ], - "signature": "let packIdData: (\n ~id: id<'value, 'id>,\n ~data: Belt_SetDict.t<'value, 'id>,\n) => t<'value, 'id>" - } - ] - }, - "belt/range": { - "id": "Belt.Range", - "name": "Range", - "docstrings": [ - "[`Belt.Range`]()\n\n Utilities for a closed range `(from, start)`", - "A small utility module to provide inclusive range operations for `[start, finish]`.\nInternally it is relying on loops instead of creating new arrays, which makes it\npretty performant and memory friendly." - ], - "items": [ - { - "id": "Belt.Range.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (int, int, int => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Range.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(start, finish, action)` equivalent to `Belt.Array.forEach(Belt.Array.range(start, finish), action))`\n\n## Examples\n\n```rescript\nBelt.Range.forEach(0, 4, i => Js.log(i))\n\n// Prints:\n// 0\n// 1\n// 2\n// 3\n// 4\n```" - ], - "signature": "let forEach: (int, int, int => unit) => unit" - }, - { - "id": "Belt.Range.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (int, int, int => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Range.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(start, finish, p)` equivalent to `Belt.Array.every(Belt.Array.range(start, finish), p)`\n## Examples\n\n```rescript\nBelt.Range.every(0, 4, i => i < 5) == true\n\nBelt.Range.every(0, 4, i => i < 4) == false\n```" - ], - "signature": "let every: (int, int, int => bool) => bool" - }, - { - "id": "Belt.Range.everyByU", - "kind": "value", - "name": "everyByU", - "docstrings": [], - "signature": "let everyByU: (int, int, ~step: int, int => bool) => bool", - "deprecated": "Use `everyBy` instead" - }, - { - "id": "Belt.Range.everyBy", - "kind": "value", - "name": "everyBy", - "docstrings": [ - "`everyBy(start, finish, ~step, p)`. See `Belt.Array.rangeBy`, equivalent to\n`Belt.Array.every(Belt.Array.rangeBy(start, finish, ~step), p)`\n\n## Examples\n\n```rescript\nBelt.Range.everyBy(0, 4, ~step=1, i => mod(i, 2) === 0) == false\n\nBelt.Range.everyBy(0, 4, ~step=2, i => mod(i, 2) === 0) == true\n```" - ], - "signature": "let everyBy: (int, int, ~step: int, int => bool) => bool" - }, - { - "id": "Belt.Range.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (int, int, int => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Range.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(start, finish, p)` equivalent to `Belt.Array.some(Belt.Array.range(start, finish), p)`\n\n## Examples\n\n```rescript\nBelt.Range.some(0, 4, i => i > 5) == false\n\nBelt.Range.some(0, 4, i => i > 2) == true\n```" - ], - "signature": "let some: (int, int, int => bool) => bool" - }, - { - "id": "Belt.Range.someByU", - "kind": "value", - "name": "someByU", - "docstrings": [], - "signature": "let someByU: (int, int, ~step: int, int => bool) => bool", - "deprecated": "Use `someBy` instead" - }, - { - "id": "Belt.Range.someBy", - "kind": "value", - "name": "someBy", - "docstrings": [ - "`someBy(start, finish, ~step, p)` See `Belt.Array.rangeBy`, equivalent to\n`Belt.Array.some(Belt.Array.rangeBy(start, finish, ~step), p)`\n\n## Examples\n\n```rescript\nBelt.Range.someBy(1, 5, ~step=2, i => mod(i, 2) === 0) == false\nBelt.Range.someBy(0, 4, ~step=2, i => mod(i, 2) === 0) == true\n```" - ], - "signature": "let someBy: (int, int, ~step: int, int => bool) => bool" - } - ] - }, - "belt/list": { - "id": "Belt.List", - "name": "List", - "docstrings": [ - "[`Belt.List`]()\n\n Utilities for List data type", - "Collection functions for manipulating the `list` data structures, a singly-linked list.\n\n**Prefer Array** if you need any of the following:\n\n- Random access of element\n- Better interop with JavaScript\n- Better memory usage & performance." - ], - "items": [ - { - "id": "Belt.List.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'a t` is compatible with built-in `list` type" - ], - "signature": "type t<'a> = list<'a>" - }, - { - "id": "Belt.List.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Returns the length of a list.\n\n## Examples\n\n```rescript\nBelt.List.length(list{1, 2, 3}) == 3\n```" - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Belt.List.size", - "kind": "value", - "name": "size", - "docstrings": [ - "See `Belt.List.length`" - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.List.head", - "kind": "value", - "name": "head", - "docstrings": [ - "Returns `Some(value)` where `value` is the first element in the list, or\n`None` if `someList` is an empty list.\n\n## Examples\n\n```rescript\nBelt.List.head(list{}) == None\nBelt.List.head(list{1, 2, 3}) == Some(1)\n```" - ], - "signature": "let head: t<'a> => option<'a>" - }, - { - "id": "Belt.List.headExn", - "kind": "value", - "name": "headExn", - "docstrings": [ - "Same as `Belt.List.head` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.headExn(list{1, 2, 3}) == 1\n\nswitch Belt.List.headExn(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let headExn: t<'a> => 'a" - }, - { - "id": "Belt.List.headOrThrow", - "kind": "value", - "name": "headOrThrow", - "docstrings": [ - "Same as `Belt.List.head` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.headOrThrow(list{1, 2, 3}) == 1\n\nswitch Belt.List.headOrThrow(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let headOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.List.tail", - "kind": "value", - "name": "tail", - "docstrings": [ - "Returns `None` if `someList` is empty, otherwise it returns `Some(tail)`\nwhere `tail` is everything except the first element of `someList`.\n\n## Examples\n\n```rescript\nBelt.List.tail(list{1, 2, 3}) == Some(list{2, 3})\n\nBelt.List.tail(list{}) == None\n```" - ], - "signature": "let tail: t<'a> => option>" - }, - { - "id": "Belt.List.tailExn", - "kind": "value", - "name": "tailExn", - "docstrings": [ - "Same as `Belt.List.tail` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.tailExn(list{1, 2, 3}) == list{2, 3}\n\nswitch Belt.List.tailExn(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let tailExn: t<'a> => t<'a>" - }, - { - "id": "Belt.List.tailOrThrow", - "kind": "value", - "name": "tailOrThrow", - "docstrings": [ - "Same as `Belt.List.tail` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.tailOrThrow(list{1, 2, 3}) == list{2, 3}\n\nswitch Belt.List.tailOrThrow(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let tailOrThrow: t<'a> => t<'a>" - }, - { - "id": "Belt.List.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds `value` to the beginning of `someList`.\n\n## Examples\n\n```rescript\nBelt.List.add(list{2, 3}, 1) // list{1, 2, 3}\n\nBelt.List.add(list{\"World\", \"!\"}, \"Hello\") == list{\"Hello\", \"World\", \"!\"}\n```" - ], - "signature": "let add: (t<'a>, 'a) => t<'a>" - }, - { - "id": "Belt.List.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Return the nth element in `someList`, or `None` if `index` is larger than the\nlength.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.get(1) == Some(\"B\")\n\nabc->Belt.List.get(4) == None\n```" - ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, - { - "id": "Belt.List.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as `Belt.List.get` but throws an exception if `index` is larger than the\nlength. Use with care.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.getExn(1) == \"B\"\n\nswitch abc->Belt.List.getExn(4) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getExn: (t<'a>, int) => 'a" - }, - { - "id": "Belt.List.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as `Belt.List.get` but throws an exception if `index` is larger than the\nlength. Use with care.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.getOrThrow(1) == \"B\"\n\nswitch abc->Belt.List.getOrThrow(4) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getOrThrow: (t<'a>, int) => 'a" - }, - { - "id": "Belt.List.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a list of length `numItems` with each element filled with value `v`. Returns an empty list if `numItems` is negative.\n\n## Examples\n\n```rescript\nBelt.List.make(3, 1) == list{1, 1, 1}\n```" - ], - "signature": "let make: (int, 'a) => t<'a>" - }, - { - "id": "Belt.List.makeByU", - "kind": "value", - "name": "makeByU", - "docstrings": [ - "Uncurried version of [makeBy](#makeBy)" - ], - "signature": "let makeByU: (int, int => 'a) => t<'a>", - "deprecated": "Use `makeBy` instead" - }, - { - "id": "Belt.List.makeBy", - "kind": "value", - "name": "makeBy", - "docstrings": [ - "Return a list of length `numItems` with element `i` initialized with `f(i)`.\nReturns an empty list if `numItems` is negative.\n\n## Examples\n\n```rescript\nBelt.List.makeBy(5, i => i) == list{0, 1, 2, 3, 4}\n\nBelt.List.makeBy(5, i => i * i) == list{0, 1, 4, 9, 16}\n```" - ], - "signature": "let makeBy: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.List.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "Returns a new list in random order.\n\n## Examples\n\n```rescript\nBelt.List.shuffle(list{1, 2, 3}) // list{2, 1, 3}\n```" - ], - "signature": "let shuffle: t<'a> => t<'a>" - }, - { - "id": "Belt.List.drop", - "kind": "value", - "name": "drop", - "docstrings": [ - "Return a new list, dropping the first `n` elements. Returns `None` if `someList` has fewer than `n` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.drop(2) == Some(list{3})\n\nlist{1, 2, 3}->Belt.List.drop(3) == Some(list{})\n\nlist{1, 2, 3}->Belt.List.drop(4) == None\n```" - ], - "signature": "let drop: (t<'a>, int) => option>" - }, - { - "id": "Belt.List.take", - "kind": "value", - "name": "take", - "docstrings": [ - "Returns a list with the first `n` elements from `someList`, or `None` if `someList` has fewer than `n` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.take(1) == Some(list{1})\n\nlist{1, 2, 3}->Belt.List.take(2) == Some(list{1, 2})\n\nlist{1, 2, 3}->Belt.List.take(4) == None\n```" - ], - "signature": "let take: (t<'a>, int) => option>" - }, - { - "id": "Belt.List.splitAt", - "kind": "value", - "name": "splitAt", - "docstrings": [ - "Split the list `someList` at `index`. Returns `None` when the length of `someList` is less than `index`.\n\n## Examples\n\n```rescript\nlist{\"Hello\", \"World\"}->Belt.List.splitAt(1) == Some((list{\"Hello\"}, list{\"World\"}))\n\nlist{0, 1, 2, 3, 4}->Belt.List.splitAt(2) == Some((list{0, 1}, list{2, 3, 4}))\n```" - ], - "signature": "let splitAt: (t<'a>, int) => option<(list<'a>, list<'a>)>" - }, - { - "id": "Belt.List.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "Returns the list obtained by adding `secondList` after `firstList`.\n\n## Examples\n\n```rescript\nBelt.List.concat(list{1, 2, 3}, list{4, 5}) == list{1, 2, 3, 4, 5}\n```" - ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Belt.List.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "Returns the list obtained by concatenating all the lists in array `a`, in\norder.\n\n## Examples\n\n```rescript\nBelt.List.concatMany([list{1, 2, 3}, list{}, list{3}]) == list{1, 2, 3, 3}\n```" - ], - "signature": "let concatMany: array> => t<'a>" - }, - { - "id": "Belt.List.reverseConcat", - "kind": "value", - "name": "reverseConcat", - "docstrings": [ - "Equivalent to writing: `concat(reverse(firstList, secondList)`\n\n## Examples\n\n```rescript\nBelt.List.reverseConcat(list{1, 2}, list{3, 4}) == list{2, 1, 3, 4}\n```" - ], - "signature": "let reverseConcat: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Belt.List.flatten", - "kind": "value", - "name": "flatten", - "docstrings": [ - "Return the list obtained by concatenating all the lists in list `ls`, in order.\n\n## Examples\n\n```rescript\nBelt.List.flatten(list{list{1, 2, 3}, list{}, list{3}}) == list{1, 2, 3, 3}\n```" - ], - "signature": "let flatten: t> => t<'a>" - }, - { - "id": "Belt.List.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [ - "Uncurried version of [map](#map)." - ], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.List.map", - "kind": "value", - "name": "map", - "docstrings": [ - "Returns a new list with `f` applied to each element of `someList`.\n\n## Examples\n\n```rescript\nlist{1, 2}->Belt.List.map(x => x + 1) == list{2, 3}\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.List.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "Returns a list of pairs from the two lists with the length of the shorter list.\n\n## Examples\n\n```rescript\nBelt.List.zip(list{1, 2}, list{3, 4, 5}) == list{(1, 3), (2, 4)}\n```" - ], - "signature": "let zip: (t<'a>, t<'b>) => t<('a, 'b)>" - }, - { - "id": "Belt.List.zipByU", - "kind": "value", - "name": "zipByU", - "docstrings": [ - "Uncurried version of [zipBy](#zipBy)." - ], - "signature": "let zipByU: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>", - "deprecated": "Use `zipBy` instead" - }, - { - "id": "Belt.List.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "See [Belt.List.zip](#zip)\n\n## Examples\n\n```rescript\nBelt.List.zipBy(list{1, 2, 3}, list{4, 5}, (a, b) => 2 * a + b) == list{6, 9}\n```" - ], - "signature": "let zipBy: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>" - }, - { - "id": "Belt.List.mapWithIndexU", - "kind": "value", - "name": "mapWithIndexU", - "docstrings": [ - "Uncurried version of [mapWithIndex](#mapWithIndex)." - ], - "signature": "let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => t<'b>", - "deprecated": "Use `mapWithIndex` instead" - }, - { - "id": "Belt.List.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "Applies `f` to each element of `someList`.\nFunction `f` takes two arguments: the index starting from 0 and the element from `someList`, in that order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.mapWithIndex((index, x) => index + x) == list{1, 3, 5}\n```" - ], - "signature": "let mapWithIndex: (t<'a>, (int, 'a) => 'b) => t<'b>" - }, - { - "id": "Belt.List.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Converts the given array to a list.\n\n## Examples\n\n```rescript\nBelt.List.fromArray([1, 2, 3]) == list{1, 2, 3}\n```" - ], - "signature": "let fromArray: array<'a> => t<'a>" - }, - { - "id": "Belt.List.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Converts the given list to an array.\n\n## Examples\n\n```rescript\nBelt.List.toArray(list{1, 2, 3}) == [1, 2, 3]\n```" - ], - "signature": "let toArray: t<'a> => array<'a>" - }, - { - "id": "Belt.List.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "Returns a new list whose elements are those of `someList` in reversed order.\n\n## Examples\n\n```rescript\nBelt.List.reverse(list{1, 2, 3}) == list{3, 2, 1}\n```" - ], - "signature": "let reverse: t<'a> => t<'a>" - }, - { - "id": "Belt.List.mapReverseU", - "kind": "value", - "name": "mapReverseU", - "docstrings": [ - "Uncurried version of [mapReverse](#mapReverse)." - ], - "signature": "let mapReverseU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `mapReverse` instead" - }, - { - "id": "Belt.List.mapReverse", - "kind": "value", - "name": "mapReverse", - "docstrings": [ - "Equivalent to `Belt.List.map(someList, f)->Belt.List.reverse`\n\n## Examples\n\n```rescript\nlist{3, 4, 5}->Belt.List.mapReverse(x => x * x) == list{25, 16, 9}\n```" - ], - "signature": "let mapReverse: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.List.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Uncurried version of [forEach](#forEach)." - ], - "signature": "let forEachU: (t<'a>, 'a => 'b) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.List.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Call `f` on each element of `someList` from the beginning to end.\n`f` returns `unit`, so no new array is created. Use `forEach` when you are primarily concerned with repetitively creating side effects.\n\n## Examples\n\n```rescript\nBelt.List.forEach(list{\"a\", \"b\", \"c\"}, x => Js.log(\"Item: \" ++ x))\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\n```" - ], - "signature": "let forEach: (t<'a>, 'a => 'b) => unit" - }, - { - "id": "Belt.List.forEachWithIndexU", - "kind": "value", - "name": "forEachWithIndexU", - "docstrings": [ - "Uncurried version of [forEachWithIndex](#forEachWithIndex)." - ], - "signature": "let forEachWithIndexU: (t<'a>, (int, 'a) => 'b) => unit", - "deprecated": "Use `forEachWithIndex` instead" - }, - { - "id": "Belt.List.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "Call `f` on each element of `someList` from beginning to end.\nFunction `f` takes two arguments: the index starting from 0 and the element from `someList`. `f` returns `unit`.\n\n## Examples\n\n```rescript\nBelt.List.forEachWithIndex(list{\"a\", \"b\", \"c\"}, (index, x) => {\n Js.log(\"Item \" ++ Belt.Int.toString(index) ++ \" is \" ++ x)\n})\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\n```" - ], - "signature": "let forEachWithIndex: (t<'a>, (int, 'a) => 'b) => unit" - }, - { - "id": "Belt.List.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [ - "Uncurried version of [reduce](#reduce)." - ], - "signature": "let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.List.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies `f` to each element of `someList` from beginning to end. Function `f` has two parameters: the item from the list and an “accumulator”, which starts with a value of `initialValue`. reduce returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduce(0, (a, b) => a + b) == 10\n\n/* same as */\n\nlist{1, 2, 3, 4}->Belt.List.reduce(0, (acc, item) => acc + item) == 10\n```" - ], - "signature": "let reduce: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Belt.List.reduceWithIndexU", - "kind": "value", - "name": "reduceWithIndexU", - "docstrings": [ - "Uncurried version of [reduceWithIndex](#reduceWithIndex)." - ], - "signature": "let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b", - "deprecated": "Use `reduceWithIndex` instead" - }, - { - "id": "Belt.List.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "Applies `f` to each element of `someList` from beginning to end. Function `f` has three parameters: the item from the list and an “accumulator”, which starts with a value of `initialValue` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduceWithIndex(0, (acc, item, index) => acc + item + index) == 16\n```" - ], - "signature": "let reduceWithIndex: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Belt.List.reduceReverseU", - "kind": "value", - "name": "reduceReverseU", - "docstrings": [ - "Uncurried version of [reduceReverse](#reduceReverse)." - ], - "signature": "let reduceReverseU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b", - "deprecated": "Use `reduceReverse` instead" - }, - { - "id": "Belt.List.reduceReverse", - "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "Works like [reduce](#reduce), except that function `f` is applied to each\nitem of `someList` from the last back to the first.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(0, (a, b) => a + b) == 10\n\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(10, (a, b) => a - b) == 0\n\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(list{}, Belt.List.add) == list{1, 2, 3, 4}\n```" - ], - "signature": "let reduceReverse: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Belt.List.mapReverse2U", - "kind": "value", - "name": "mapReverse2U", - "docstrings": [ - "Uncurried version of [mapReverse2](#mapReverse2)." - ], - "signature": "let mapReverse2U: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>", - "deprecated": "Use `mapReverse2` instead" - }, - { - "id": "Belt.List.mapReverse2", - "kind": "value", - "name": "mapReverse2", - "docstrings": [ - "Equivalent to: `zipBy(xs, ys, f)->reverse`\n\n## Examples\n\n```rescript\nBelt.List.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) == list{4, 2}\n```" - ], - "signature": "let mapReverse2: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>" - }, - { - "id": "Belt.List.forEach2U", - "kind": "value", - "name": "forEach2U", - "docstrings": [ - "Uncurried version of [forEach2](#forEach2)." - ], - "signature": "let forEach2U: (t<'a>, t<'b>, ('a, 'b) => 'c) => unit", - "deprecated": "Use `forEach2` instead" - }, - { - "id": "Belt.List.forEach2", - "kind": "value", - "name": "forEach2", - "docstrings": [ - "Stops at the length of the shorter list.\n\n## Examples\n\n```rescript\nBelt.List.forEach2(list{\"Z\", \"Y\"}, list{\"A\", \"B\", \"C\"}, (x, y) => Js.log2(x, y))\n\n/*\n prints:\n \"Z\" \"A\"\n \"Y\" \"B\"\n*/\n```" - ], - "signature": "let forEach2: (t<'a>, t<'b>, ('a, 'b) => 'c) => unit" - }, - { - "id": "Belt.List.reduce2U", - "kind": "value", - "name": "reduce2U", - "docstrings": [ - "Uncurried version of [reduce2](#reduce2)." - ], - "signature": "let reduce2U: (t<'b>, t<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a", - "deprecated": "Use `reduce2` instead" - }, - { - "id": "Belt.List.reduce2", - "kind": "value", - "name": "reduce2", - "docstrings": [ - "Applies `f` to each element of `firstList` and `secondList` from beginning to end. Stops with the shorter list. Function `f` has three parameters: an “accumulator” which starts with a value of `initialValue`, an item from `firstList`, and an item from `secondList`. `reduce2` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nBelt.List.reduce2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduce2: (t<'b>, t<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a" - }, - { - "id": "Belt.List.reduceReverse2U", - "kind": "value", - "name": "reduceReverse2U", - "docstrings": [ - "Uncurried version of [reduceReverse2](#reduceReverse2)." - ], - "signature": "let reduceReverse2U: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c", - "deprecated": "Use `reduceReverse2` instead" - }, - { - "id": "Belt.List.reduceReverse2", - "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "Applies `f` to each element of `firstList` and `secondList` from end to\nbeginning. Stops with the shorter list. Function `f` has three parameters: an\n“accumulator” which starts with a value of init, an item from `firstList`,\nand an item from `secondList`. `reduce2` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nBelt.List.reduceReverse2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduceReverse2: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" - }, - { - "id": "Belt.List.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [ - "Uncurried version of [every](#every)." - ], - "signature": "let everyU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.List.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Returns `true` if all elements satisfy `pred`, where `pred` is a predicate: a function taking an element and returning a bool.\n\n## Examples\n\n```rescript\nlet isBelow10 = value => value < 10\n\nlist{1, 9, 8, 2}->Belt.List.every(isBelow10) == true\n\nlist{1, 99, 8, 2}->Belt.List.every(isBelow10) == false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.List.someU", - "kind": "value", - "name": "someU", - "docstrings": [ - "Uncurried version of [some](#some)." - ], - "signature": "let someU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.List.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Returns `true` if at least _one_ of the elements in `someList` satisfies\n`pred`, where `pred` is a predicate: a function taking an element and\nreturning a bool.\n\n## Examples\n\n```rescript\nlet isAbove100 = value => value > 100\n\nlist{101, 1, 2, 3}->Belt.List.some(isAbove100) == true\n\nlist{1, 2, 3, 4}->Belt.List.some(isAbove100) == false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.List.every2U", - "kind": "value", - "name": "every2U", - "docstrings": [ - "Uncurried version of [every2](#every2)." - ], - "signature": "let every2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `every2` instead" - }, - { - "id": "Belt.List.every2", - "kind": "value", - "name": "every2", - "docstrings": [ - "Returns `true` if predicate `pred(a, b)` is `true` for all pairs of elements\nup to the shorter length (i.e. `min(length(firstList), length(secondList))`)\n\n## Examples\n\n```rescript\nBelt.List.every2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nBelt.List.every2(list{}, list{1}, (a, b) => a > b) == true\n\nBelt.List.every2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nBelt.List.every2(list{0, 1}, list{5, 0}, (a, b) => a > b) == false\n```" - ], - "signature": "let every2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.some2U", - "kind": "value", - "name": "some2U", - "docstrings": [ - "Uncurried version of [some2](#some2)." - ], - "signature": "let some2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `some2` instead" - }, - { - "id": "Belt.List.some2", - "kind": "value", - "name": "some2", - "docstrings": [ - "Returns `true` if predicate `pred(a, b)` is true for any pair of elements up\nto the shorter length (i.e. `min(length(firstList), length(secondList))`)\n\n## Examples\n\n```rescript\nBelt.List.some2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nBelt.List.some2(list{}, list{1}, (a, b) => a > b) == false\n\nBelt.List.some2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nBelt.List.some2(list{0, 1}, list{5, 0}, (a, b) => a > b) == true\n```" - ], - "signature": "let some2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.cmpByLength", - "kind": "value", - "name": "cmpByLength", - "docstrings": [ - "Compare two lists solely by length. Returns `-1` if `length(firstList)` is\nless than `length(secondList)`, `0` if `length(firstList)` equals\n`length(secondList)`, and `1` if `length(firstList)` is greater than\n`length(secondList)`.\n\n## Examples\n\n```rescript\nBelt.List.cmpByLength(list{1, 2}, list{3, 4, 5, 6}) == -1\n\nBelt.List.cmpByLength(list{1, 2, 3}, list{4, 5, 6}) == 0\n\nBelt.List.cmpByLength(list{1, 2, 3, 4}, list{5, 6}) == 1\n```" - ], - "signature": "let cmpByLength: (t<'a>, t<'a>) => int" - }, - { - "id": "Belt.List.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [ - "Uncurried version of [cmp](#cmp)." - ], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.List.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Compare elements one by one `compareFn(a, b)`. `compareFn` returns a negative number if `a` is \"less than\" `b`, zero if `a` is \"equal to\" `b`, a positive number if `a` is \"greater than\" `b`.\n\nThe comparison returns the first non-zero result of `compareFn`, or zero if `compareFn` returns zero for all `a` and `b`.\n\nIf all items have compared equal, but `firstList` is exhausted first, return `-1`. (`firstList` is shorter).\nIf all items have compared equal, but `secondList` is exhausted first, return `1` (`firstList` is longer).\n\n## Examples\n\n```rescript\nBelt.List.cmp(list{3}, list{3, 7}, (a, b) => compare(a, b)) == -1\n\nBelt.List.cmp(list{5, 3}, list{5}, (a, b) => compare(a, b)) == 1\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 4, 2}, (a, b) => compare(a, b)) == -1\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 2, 3}, (a, b) => compare(a, b)) == 1\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 3, 5}, (a, b) => compare(a, b)) == 0\n```\n\n**Please note:** The total ordering of List is different from Array,\nfor Array, we compare the length first and, only if the lengths are equal, elements one by one.\nFor lists, we just compare elements one by one." - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.List.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [ - "Uncurried version of [eq](#eq)." - ], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.List.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Check equality of `firstList` and `secondList` using `eqElem` for equality on\nelements, where `eqElem` is a function that returns `true` if items `x` and\n`y` meet some criterion for equality, `false` otherwise. eq `false` if length\nof `firstList` and `secondList` are not the same.\n\n## Examples\n\n```rescript\nBelt.List.eq(list{1, 2, 3}, list{1, 2}, (a, b) => a == b) == false\n\nBelt.List.eq(list{1, 2}, list{1, 2}, (a, b) => a == b) == true\n\nBelt.List.eq(list{1, 2, 3}, list{-1, -2, -3}, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.List.hasU", - "kind": "value", - "name": "hasU", - "docstrings": [ - "Uncurried version of [has](#has)." - ], - "signature": "let hasU: (t<'a>, 'b, ('a, 'b) => bool) => bool", - "deprecated": "Use `has` instead" - }, - { - "id": "Belt.List.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Returns `true` if the list contains at least one element for which\n`eqFunction(x)` returns true.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.has(2, (a, b) => a == b) == true\n\nlist{1, 2, 3}->Belt.List.has(4, (a, b) => a == b) == false\n\nlist{-1, -2, -3}->Belt.List.has(2, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let has: (t<'a>, 'b, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.getByU", - "kind": "value", - "name": "getByU", - "docstrings": [ - "Uncurried version of [getBy](#getBy)." - ], - "signature": "let getByU: (t<'a>, 'a => bool) => option<'a>", - "deprecated": "Use `getBy` instead" - }, - { - "id": "Belt.List.getBy", - "kind": "value", - "name": "getBy", - "docstrings": [ - "Returns `Some(value)` for the first value in `someList` that satisfies the\npredicate function `pred`. Returns `None` if no element satisfies the function.\n\n## Examples\n\n```rescript\nBelt.List.getBy(list{1, 4, 3, 2}, x => x > 3) == Some(4)\n\nBelt.List.getBy(list{1, 4, 3, 2}, x => x > 4) == None\n```" - ], - "signature": "let getBy: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Belt.List.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [ - "Uncurried version of [keep](#keep)." - ], - "signature": "let keepU: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.List.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.keep(list{1, 2, 3, 4}, isEven) == list{2, 4}\n\nBelt.List.keep(list{None, Some(2), Some(3), None}, Belt.Option.isSome) == list{Some(2), Some(3)}\n```" - ], - "signature": "let keep: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Belt.List.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.filter(list{1, 2, 3, 4}, isEven) == list{2, 4}\n\nBelt.List.filter(list{None, Some(2), Some(3), None}, Belt.Option.isSome) == list{Some(2), Some(3)}\n```" - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "This function will soon be deprecated. Please, use `List.keep` instead." - }, - { - "id": "Belt.List.keepWithIndexU", - "kind": "value", - "name": "keepWithIndexU", - "docstrings": [ - "Uncurried version of [keepWithIndex](#keepWithIndex)." - ], - "signature": "let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "Use `keepWithIndex` instead" - }, - { - "id": "Belt.List.keepWithIndex", - "kind": "value", - "name": "keepWithIndex", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.keepWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) == list{1, 3}\n```" - ], - "signature": "let keepWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" - }, - { - "id": "Belt.List.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.filterWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) == list{1, 3}\n```" - ], - "signature": "let filterWithIndex: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "This function will soon be deprecated. Please, use `List.keepWithIndex` \\\n instead." - }, - { - "id": "Belt.List.keepMapU", - "kind": "value", - "name": "keepMapU", - "docstrings": [ - "Uncurried version of [keepMap](#keepMap)." - ], - "signature": "let keepMapU: (t<'a>, 'a => option<'b>) => t<'b>", - "deprecated": "Use `keepMap` instead" - }, - { - "id": "Belt.List.keepMap", - "kind": "value", - "name": "keepMap", - "docstrings": [ - "Applies `f` to each element of `someList`. If `f(x)` returns `Some(value)`, then `value` is _kept_ in the resulting list.\nIf `f(x)` returns `None`, the element is _not_ retained in the result.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nlist{1, 2, 3, 4}->Belt.List.keepMap(x =>\n if isEven(x) {\n Some(x)\n } else {\n None\n }\n) /* list{2, 4} */\n\nlist{Some(1), Some(2), None}->Belt.List.keepMap(x => x) == list{1, 2}\n```" - ], - "signature": "let keepMap: (t<'a>, 'a => option<'b>) => t<'b>" - }, - { - "id": "Belt.List.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [ - "Uncurried version of [partition](#partition)." - ], - "signature": "let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.List.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "Creates a pair of lists; the first list consists of all elements of `someList` that satisfy the predicate function `pred`; the second list consists of all elements of `someList` that _do not_ satisfy \\`pred.\n\nIn other words:\n\n```\n(elementsThatSatisfies, elementsThatDoesNotSatisfy)\n```\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.partition(x => x > 2) == (list{3, 4}, list{1, 2})\n```" - ], - "signature": "let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)" - }, - { - "id": "Belt.List.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "Takes a list of pairs and creates a pair of lists. The first list contains all the first items of the pairs; the second list contains all the second items.\n\n## Examples\n\n```rescript\nBelt.List.unzip(list{(1, 2), (3, 4)}) == (list{1, 3}, list{2, 4})\n\nBelt.List.unzip(list{(\"H\", \"W\"), (\"e\", \"o\"), (\"l\", \"r\"), (\"l\", \"l\"), (\"o\", \"d\"), (\" \", \"!\")}) ==\n (list{\"H\", \"e\", \"l\", \"l\", \"o\", \" \"}, list{\"W\", \"o\", \"r\", \"l\", \"d\", \"!\"})\n```" - ], - "signature": "let unzip: t<('a, 'b)> => (t<'a>, t<'b>)" - }, - { - "id": "Belt.List.getAssocU", - "kind": "value", - "name": "getAssocU", - "docstrings": [ - "Uncurried version of [getAssoc](#getAssoc)." - ], - "signature": "let getAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>", - "deprecated": "Use `getAssoc` instead" - }, - { - "id": "Belt.List.getAssoc", - "kind": "value", - "name": "getAssoc", - "docstrings": [ - "Return the second element of a pair in `someList` where the first element equals `k` as per the predicate function `eqFunction`, or `None` if not found.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.getAssoc(3, (a, b) => a == b) /* Some(\"c\") */\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.getAssoc(15, (k, item) =>\n k /* 15 */ == item\n) == Some(\"afternoon\")\n/* 9, 5, 22 */\n```" - ], - "signature": "let getAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>" - }, - { - "id": "Belt.List.hasAssocU", - "kind": "value", - "name": "hasAssocU", - "docstrings": [ - "Uncurried version of [hasAssoc](#hasAssoc)." - ], - "signature": "let hasAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => bool", - "deprecated": "Use `hasAssoc` instead" - }, - { - "id": "Belt.List.hasAssoc", - "kind": "value", - "name": "hasAssoc", - "docstrings": [ - "Returns `true` if there is a pair in `someList` where the first element equals `k` as per the predicate function `eqFunction`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.hasAssoc(1, (a, b) => a == b) == true\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.hasAssoc(25, (k, item) =>\n k /* 25 */ == item\n) == false\n/* 9, 5, 22 */\n```" - ], - "signature": "let hasAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.removeAssocU", - "kind": "value", - "name": "removeAssocU", - "docstrings": [ - "Uncurried version of [removeAssoc](#removeAssoc)." - ], - "signature": "let removeAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => t<('a, 'c)>", - "deprecated": "Use `removeAssoc` instead" - }, - { - "id": "Belt.List.removeAssoc", - "kind": "value", - "name": "removeAssoc", - "docstrings": [ - "Return a list after removing the first pair whose first value is `k` per the equality predicate `eqFunction`; if not found, return a new list identical to `someList`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.removeAssoc(1, (a, b) => a == b) ==\n list{(2, \"b\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.removeAssoc(9, (k, item) =>\n k /* 9 */ == item\n) == list{(15, \"afternoon\"), (22, \"night\")}\n/* 9, 5, 22 */\n```" - ], - "signature": "let removeAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => t<('a, 'c)>" - }, - { - "id": "Belt.List.setAssocU", - "kind": "value", - "name": "setAssocU", - "docstrings": [ - "Uncurried version of [setAssoc](#setAssoc)." - ], - "signature": "let setAssocU: (t<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => t<('a, 'c)>", - "deprecated": "Use `setAssoc` instead" - }, - { - "id": "Belt.List.setAssoc", - "kind": "value", - "name": "setAssoc", - "docstrings": [ - "If `k` exists in `someList` by satisfying the `eqFunction` predicate, return a new list with the key and value replaced by the new `k` and `v`; otherwise, return a new list with the pair `k`, `v` added to the head of `someList`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.setAssoc(2, \"x\", (a, b) => a == b) ==\n list{(1, \"a\"), (2, \"x\"), (3, \"c\")}\n\nlist{(1, \"a\"), (3, \"c\")}->Belt.List.setAssoc(2, \"b\", (a, b) => a == b) ==\n list{(2, \"b\"), (1, \"a\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (3, \"morning?!\"), (22, \"night\")}->Belt.List.setAssoc(15, \"afternoon\", (a, b) =>\n mod(a, 12) == mod(b, 12)\n) == list{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n```\n\n**Please note**\n\nIn the last example, since: `15 mod 12` equals `3 mod 12`\n\nBoth the key _and_ the value are replaced in the list." - ], - "signature": "let setAssoc: (t<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => t<('a, 'c)>" - }, - { - "id": "Belt.List.sortU", - "kind": "value", - "name": "sortU", - "docstrings": [ - "Uncurried version of [sort](#sort)." - ], - "signature": "let sortU: (t<'a>, ('a, 'a) => int) => t<'a>", - "deprecated": "Use `sort` instead" - }, - { - "id": "Belt.List.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "Returns a sorted list.\n\n## Examples\n\n```rescript\nBelt.List.sort(list{5, 4, 9, 3, 7}, (a, b) => a - b) == list{3, 4, 5, 7, 9}\n```" - ], - "signature": "let sort: (t<'a>, ('a, 'a) => int) => t<'a>" - } - ] - }, - "belt/mutablestack": { - "id": "Belt.MutableStack", - "name": "MutableStack", - "docstrings": [ - "[`Belt.MutableStack`]()\n\n An FILO(first in last out) stack data structure", - "First in last out stack. This module implements stacks, with in-place\nmodification." - ], - "items": [ - { - "id": "Belt.MutableStack.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableStack.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a new stack, initially empty." - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableStack.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Discard all elements from the stack." - ], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableStack.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(x)` O(1) operation, return a new stack." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.MutableStack.push", - "kind": "value", - "name": "push", - "docstrings": [], - "signature": "let push: (t<'a>, 'a) => unit" - }, - { - "id": "Belt.MutableStack.popUndefined", - "kind": "value", - "name": "popUndefined", - "docstrings": [], - "signature": "let popUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableStack.pop", - "kind": "value", - "name": "pop", - "docstrings": [], - "signature": "let pop: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableStack.topUndefined", - "kind": "value", - "name": "topUndefined", - "docstrings": [], - "signature": "let topUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableStack.top", - "kind": "value", - "name": "top", - "docstrings": [], - "signature": "let top: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableStack.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableStack.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableStack.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableStack.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.MutableStack.dynamicPopIterU", - "kind": "value", - "name": "dynamicPopIterU", - "docstrings": [], - "signature": "let dynamicPopIterU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `dynamicPopIter` instead" - }, - { - "id": "Belt.MutableStack.dynamicPopIter", - "kind": "value", - "name": "dynamicPopIter", - "docstrings": [ - "`dynamicPopIter(s, f)` apply `f` to each element of `s`. The item is poped\nbefore applying `f`, `s` will be empty after this opeartion. This function is\nuseful for worklist algorithm." - ], - "signature": "let dynamicPopIter: (t<'a>, 'a => unit) => unit" - } - ] - }, - "belt/mutablequeue": { - "id": "Belt.MutableQueue", - "name": "MutableQueue", - "docstrings": [ - "[`Belt.MutableQueue`]()\n\n An FIFO(first in first out) queue data structure", - "A FIFO (first in first out) queue data structure." - ], - "items": [ - { - "id": "Belt.MutableQueue.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of queues containing elements of `type('a)`." - ], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableQueue.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a new queue, initially empty." - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableQueue.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Discard all elements from the queue." - ], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableQueue.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Returns `true` if the given queue is empty, `false` otherwise." - ], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableQueue.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` a is equivalent to `Array.forEach(a, add(q, a));`" - ], - "signature": "let fromArray: array<'a> => t<'a>" - }, - { - "id": "Belt.MutableQueue.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(q, x)` adds the element `x` at the end of the queue `q`." - ], - "signature": "let add: (t<'a>, 'a) => unit" - }, - { - "id": "Belt.MutableQueue.peek", - "kind": "value", - "name": "peek", - "docstrings": [ - "`peekOpt(q)` returns the first element in queue `q`, without removing it from the queue." - ], - "signature": "let peek: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableQueue.peekUndefined", - "kind": "value", - "name": "peekUndefined", - "docstrings": [ - "`peekUndefined(q)` returns `undefined` if not found." - ], - "signature": "let peekUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableQueue.peekExn", - "kind": "value", - "name": "peekExn", - "docstrings": [ - "`peekExn(q)` throws an exception if `q` is empty." - ], - "signature": "let peekExn: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.peekOrThrow", - "kind": "value", - "name": "peekOrThrow", - "docstrings": [ - "`peekOrThrow(q)` throws an exception if `q` is empty." - ], - "signature": "let peekOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "`pop(q)` removes and returns the first element in queue `q`." - ], - "signature": "let pop: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableQueue.popUndefined", - "kind": "value", - "name": "popUndefined", - "docstrings": [ - "`popUndefined(q)` removes and returns the first element in queue `q`. it will\nreturn `undefined` if it is already empty." - ], - "signature": "let popUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableQueue.popExn", - "kind": "value", - "name": "popExn", - "docstrings": [ - "`popExn(q)` throw an exception if q is empty." - ], - "signature": "let popExn: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.popOrThrow", - "kind": "value", - "name": "popOrThrow", - "docstrings": [ - "`popOrThrow(q)` throw an exception if q is empty." - ], - "signature": "let popOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(q)` returns a fresh queue." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.MutableQueue.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns the number of elements in a queue." - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableQueue.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableQueue.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.MutableQueue.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableQueue.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(q, f) applies`f`in turn to all elements of`q`, from the least\nrecently entered to the most recently entered. The queue itself is unchanged." - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.MutableQueue.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableQueue.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(q, accu, f)` is equivalent to `List.reduce(l, accu, f)`, where `l` is the\nlist of `q`'s elements. The queue remains unchanged." - ], - "signature": "let reduce: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableQueue.transfer", - "kind": "value", - "name": "transfer", - "docstrings": [ - "`transfer(q1, q2)` adds all of `q1`'s elements at the end of the queue `q2`,\nthen clears `q1`. It is equivalent to the sequence `forEach((x) => add(x, q2), q1)`;\nclear `q1`, but runs in constant time." - ], - "signature": "let transfer: (t<'a>, t<'a>) => unit" - }, - { - "id": "Belt.MutableQueue.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "First added will be in the beginning of the array." - ], - "signature": "let toArray: t<'a> => array<'a>" - } - ] - }, - "belt/sortarray": { - "id": "Belt.SortArray", - "name": "SortArray", - "docstrings": [ - "[`Belt.SortArray`]()\n\n The top level provides some generic sort related utilities.\n\n It also has two specialized inner modules\n [`Belt.SortArray.Int`]() and [`Belt.SortArray.String`]()", - "A module for Array sort relevant utiliites" - ], - "items": [ - { - "id": "Belt.SortArray.strictlySortedLengthU", - "kind": "value", - "name": "strictlySortedLengthU", - "docstrings": [], - "signature": "let strictlySortedLengthU: (array<'a>, ('a, 'a) => bool) => int", - "deprecated": "Use `strictlySortedLength` instead" - }, - { - "id": "Belt.SortArray.strictlySortedLength", - "kind": "value", - "name": "strictlySortedLength", - "docstrings": [ - "`strictlySortedLenght(xs, cmp);` return `+n` means increasing order `-n` means negative order\n\n## Examples\n\n```rescript\nBelt.SortArray.strictlySortedLength([1, 2, 3, 4, 3], (x, y) => x < y) == 4\n\nBelt.SortArray.strictlySortedLength([], (x, y) => x < y) == 0\n\nBelt.SortArray.strictlySortedLength([1], (x, y) => x < y) == 1\n\nBelt.SortArray.strictlySortedLength([4, 3, 2, 1], (x, y) => x < y) == -4\n```" - ], - "signature": "let strictlySortedLength: (array<'a>, ('a, 'a) => bool) => int" - }, - { - "id": "Belt.SortArray.isSortedU", - "kind": "value", - "name": "isSortedU", - "docstrings": [], - "signature": "let isSortedU: (array<'a>, ('a, 'a) => int) => bool", - "deprecated": "Use `isSorted` instead" - }, - { - "id": "Belt.SortArray.isSorted", - "kind": "value", - "name": "isSorted", - "docstrings": [ - "`isSorted(arr, cmp)`: Returns true if array is increasingly sorted (equal is okay)" - ], - "signature": "let isSorted: (array<'a>, ('a, 'a) => int) => bool" - }, - { - "id": "Belt.SortArray.stableSortInPlaceByU", - "kind": "value", - "name": "stableSortInPlaceByU", - "docstrings": [], - "signature": "let stableSortInPlaceByU: (array<'a>, ('a, 'a) => int) => unit", - "deprecated": "Use `stableSortInPlaceBy` instead" - }, - { - "id": "Belt.SortArray.stableSortInPlaceBy", - "kind": "value", - "name": "stableSortInPlaceBy", - "docstrings": [], - "signature": "let stableSortInPlaceBy: (array<'a>, ('a, 'a) => int) => unit" - }, - { - "id": "Belt.SortArray.stableSortByU", - "kind": "value", - "name": "stableSortByU", - "docstrings": [], - "signature": "let stableSortByU: (array<'a>, ('a, 'a) => int) => array<'a>", - "deprecated": "Use `stableSortBy` instead" - }, - { - "id": "Belt.SortArray.stableSortBy", - "kind": "value", - "name": "stableSortBy", - "docstrings": [ - "`stableSortBy(xs, cmp)`: Returns a fresh array Sort `xs` in place using\ncomparator `cmp`, the stable means if the elements are equal, their order will\nbe preserved" - ], - "signature": "let stableSortBy: (array<'a>, ('a, 'a) => int) => array<'a>" - }, - { - "id": "Belt.SortArray.binarySearchByU", - "kind": "value", - "name": "binarySearchByU", - "docstrings": [], - "signature": "let binarySearchByU: (array<'a>, 'a, ('a, 'a) => int) => int", - "deprecated": "Use `binarySearchBy` instead" - }, - { - "id": "Belt.SortArray.binarySearchBy", - "kind": "value", - "name": "binarySearchBy", - "docstrings": [ - "If value is not found and value is less than one or more elements in array, the\nnegative number returned is the bitwise complement of the index of the first\nelement that is larger than value.\n\nIf value is not found and value is greater\nthan all elements in array, the negative number returned is the bitwise\ncomplement of (the index of the last element plus 1)for example, if `key` is\nsmaller than all elements return `-1` since `lnot(-1) == 0` if `key` is larger\nthan all elements return `lnot(-1) == 0` since `lnot(- (len + 1)) == len`\n\n## Examples\n\n```rescript\nBelt.SortArray.binarySearchBy([1, 2, 3, 4, 33, 35, 36], 33, Pervasives.compare) == 4\n\nlnot(Belt.SortArray.binarySearchBy([1, 3, 5, 7], 4, Pervasives.compare)) == 2\n```" - ], - "signature": "let binarySearchBy: (array<'a>, 'a, ('a, 'a) => int) => int" - }, - { - "id": "Belt.SortArray.unionU", - "kind": "value", - "name": "unionU", - "docstrings": [], - "signature": "let unionU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int", - "deprecated": "Use `union` instead" - }, - { - "id": "Belt.SortArray.union", - "kind": "value", - "name": "union", - "docstrings": [ - "`union src src1ofs src1len src2 src2ofs src2len dst dstofs cmp` assume `src` and\n`src2` is strictly sorted. for equivalent elements, it is picked from `src`\nalso assume that `dst` is large enough to store all elements" - ], - "signature": "let union: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int" - }, - { - "id": "Belt.SortArray.intersectU", - "kind": "value", - "name": "intersectU", - "docstrings": [], - "signature": "let intersectU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int", - "deprecated": "Use `intersect` instead" - }, - { - "id": "Belt.SortArray.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "`union src src1ofs src1len src2 src2ofs src2len dst dstofs cmp`\n\n**return** the `offset` in the output array" - ], - "signature": "let intersect: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int" - }, - { - "id": "Belt.SortArray.diffU", - "kind": "value", - "name": "diffU", - "docstrings": [], - "signature": "let diffU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int", - "deprecated": "Use `diff` instead" - }, - { - "id": "Belt.SortArray.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int" - } - ] - }, - "belt/array": { - "id": "Belt.Array", - "name": "Array", - "docstrings": [ - "[`Belt.Array`]()\n\n **mutable array**: Utilities functions", - "Utilities for `Array` functions." - ], - "items": [ - { - "id": "Belt.Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = array<'a>" - }, - { - "id": "Belt.Array.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Return the size of the array\n\n## Examples\n\n```rescript\nBelt.Array.length([\"test\"]) == 1\n```" - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Belt.Array.size", - "kind": "value", - "name": "size", - "docstrings": [ - "See [`Belt.Array.length`]()" - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.Array.get", - "kind": "value", - "name": "get", - "docstrings": [ - "If `i <= 0 <= length(arr)` returns `Some(value)` where `value` is the item at index `i`.\nIf `i` is out of range returns `None`.\n\n## Examples\n\n```rescript\nBelt.Array.get([\"a\", \"b\", \"c\"], 0) == Some(\"a\")\nBelt.Array.get([\"a\", \"b\", \"c\"], 3) == None\nBelt.Array.get([\"a\", \"b\", \"c\"], -1) == None\n```" - ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, - { - "id": "Belt.Array.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Throw an exception if `i` is out of range.\nOtherwise return the value at index `i` in `arr`." - ], - "signature": "let getExn: (t<'a>, int) => 'a" - }, - { - "id": "Belt.Array.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Throw an exception if `i` is out of range.\nOtherwise return the value at index `i` in `arr`." - ], - "signature": "let getOrThrow: (t<'a>, int) => 'a" - }, - { - "id": "Belt.Array.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(arr, i)`\n\n**Unsafe**\n\nno bounds checking; this would cause type error if `i` does not stay within range" - ], - "signature": "let getUnsafe: (t<'a>, int) => 'a" - }, - { - "id": "Belt.Array.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "`getUndefined(arr, i)`\n\nIt does the samething in the runtime as [`getUnsafe`]();\nit is _type safe_ since the return type still track whether it is\nin range or not" - ], - "signature": "let getUndefined: (t<'a>, int) => Js.undefined<'a>" - }, - { - "id": "Belt.Array.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(arr, n, x)` modifies `arr` in place; it replaces the nth element of `arr`\nwith `x`. Returning `false` means not updated due to out of range." - ], - "signature": "let set: (t<'a>, int, 'a) => bool" - }, - { - "id": "Belt.Array.setExn", - "kind": "value", - "name": "setExn", - "docstrings": [ - "`setExn(arr, i, x)` throw an exception if `i` is out of range." - ], - "signature": "let setExn: (t<'a>, int, 'a) => unit" - }, - { - "id": "Belt.Array.setOrThrow", - "kind": "value", - "name": "setOrThrow", - "docstrings": [ - "`setOrThrow(arr, i, x)` throw an exception if `i` is out of range." - ], - "signature": "let setOrThrow: (t<'a>, int, 'a) => unit" - }, - { - "id": "Belt.Array.setUnsafe", - "kind": "value", - "name": "setUnsafe", - "docstrings": [], - "signature": "let setUnsafe: (t<'a>, int, 'a) => unit" - }, - { - "id": "Belt.Array.shuffleInPlace", - "kind": "value", - "name": "shuffleInPlace", - "docstrings": [ - "`shuffleInPlace(arr)` randomly re-orders the items in `arr`" - ], - "signature": "let shuffleInPlace: t<'a> => unit" - }, - { - "id": "Belt.Array.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "Returns a fresh array with items in original array randomly shuffled." - ], - "signature": "let shuffle: t<'a> => t<'a>" - }, - { - "id": "Belt.Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [ - "`reverseInPlace(arr)` reverses items in `arr` in place.\n\n## Examples\n\n```rescript\nlet arr = [10, 11, 12, 13, 14]\n\nlet () = Belt.Array.reverseInPlace(arr)\n\narr == [14, 13, 12, 11, 10]\n```" - ], - "signature": "let reverseInPlace: t<'a> => unit" - }, - { - "id": "Belt.Array.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(arr)` returns a fresh array with items in arr in reverse order.\n\n## Examples\n\n```rescript\nBelt.Array.reverse([10, 11, 12, 13, 14]) == [14, 13, 12, 11, 10]\n```" - ], - "signature": "let reverse: t<'a> => t<'a>" - }, - { - "id": "Belt.Array.makeUninitialized", - "kind": "value", - "name": "makeUninitialized", - "docstrings": [ - "`makeUninitialized(n)` creates an array of length `n` filled with the undefined\nvalue. You must specify the type of data that will eventually fill the array.\n\n## Examples\n\n```rescript\nlet arr: array> = Belt.Array.makeUninitialized(5)\n\nBelt.Array.getExn(arr, 0) == Js.undefined\n```" - ], - "signature": "let makeUninitialized: int => array>" - }, - { - "id": "Belt.Array.makeUninitializedUnsafe", - "kind": "value", - "name": "makeUninitializedUnsafe", - "docstrings": [ - "**Unsafe**\n\n## Examples\n\n```rescript\nlet arr = Belt.Array.makeUninitializedUnsafe(5)\n\nJs.log(Belt.Array.getExn(arr, 0)) // undefined\n\nBelt.Array.setExn(arr, 0, \"example\")\n\nBelt.Array.getExn(arr, 0) == \"example\"\n```" - ], - "signature": "let makeUninitializedUnsafe: int => t<'a>" - }, - { - "id": "Belt.Array.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(n, e)` return an array of size `n` filled with value `e`.\nReturns an empty array when `n` is negative." - ], - "signature": "let make: (int, 'a) => t<'a>" - }, - { - "id": "Belt.Array.range", - "kind": "value", - "name": "range", - "docstrings": [ - "`range(start, finish)` create an inclusive array.\n\n## Examples\n\n```rescript\nBelt.Array.range(0, 3) == [0, 1, 2, 3]\n\nBelt.Array.range(3, 0) == []\n\nBelt.Array.range(3, 3) == [3]\n```" - ], - "signature": "let range: (int, int) => array" - }, - { - "id": "Belt.Array.rangeBy", - "kind": "value", - "name": "rangeBy", - "docstrings": [ - "`rangeBy(start, finish, ~step)` returns empty array when step is 0 or negative.\nIt also return an empty array when `start > finish`.\n\n## Examples\n\n```rescript\nBelt.Array.rangeBy(0, 10, ~step=3) == [0, 3, 6, 9]\n\nBelt.Array.rangeBy(0, 12, ~step=3) == [0, 3, 6, 9, 12]\n\nBelt.Array.rangeBy(33, 0, ~step=1) == []\n\nBelt.Array.rangeBy(33, 0, ~step=-1) == []\n\nBelt.Array.rangeBy(3, 12, ~step=-1) == []\n\nBelt.Array.rangeBy(3, 3, ~step=0) == []\n\nBelt.Array.rangeBy(3, 3, ~step=1) == [3]\n```" - ], - "signature": "let rangeBy: (int, int, ~step: int) => array" - }, - { - "id": "Belt.Array.makeByU", - "kind": "value", - "name": "makeByU", - "docstrings": [], - "signature": "let makeByU: (int, int => 'a) => t<'a>", - "deprecated": "Use `makeBy` instead" - }, - { - "id": "Belt.Array.makeBy", - "kind": "value", - "name": "makeBy", - "docstrings": [ - "`makeBy(n, f)` return an empty array when n is negative return an array of size\nn populated by `f(i)` start from `0` to `n - 1`.\n\n## Examples\n\n```rescript\nBelt.Array.makeBy(5, i => i) == [0, 1, 2, 3, 4]\n\nBelt.Array.makeBy(5, i => i * i) == [0, 1, 4, 9, 16]\n```" - ], - "signature": "let makeBy: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.Array.makeByAndShuffleU", - "kind": "value", - "name": "makeByAndShuffleU", - "docstrings": [], - "signature": "let makeByAndShuffleU: (int, int => 'a) => t<'a>", - "deprecated": "Use `makeByAndShuffle` instead" - }, - { - "id": "Belt.Array.makeByAndShuffle", - "kind": "value", - "name": "makeByAndShuffle", - "docstrings": [ - "Equivalent to `shuffle(makeBy(n, f))`" - ], - "signature": "let makeByAndShuffle: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.Array.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "`zip(a, b)` create an array of pairs from corresponding elements of a and b.\nStop with the shorter array.\n\n## Examples\n\n```rescript\nBelt.Array.zip([1, 2], [3, 4, 5]) == [(1, 3), (2, 4)]\n```" - ], - "signature": "let zip: (t<'a>, array<'b>) => array<('a, 'b)>" - }, - { - "id": "Belt.Array.zipByU", - "kind": "value", - "name": "zipByU", - "docstrings": [], - "signature": "let zipByU: (t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>", - "deprecated": "Use `zipBy` instead" - }, - { - "id": "Belt.Array.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "`zipBy(xs, ys, f)` create an array by applying `f` to corresponding elements of\n`xs` and `ys`. Stops with shorter array.\n\nEquivalent to `map(zip(xs, ys), ((a, b)) => f(a, b))`\n\n## Examples\n\n```rescript\nBelt.Array.zipBy([1, 2, 3], [4, 5], (a, b) => 2 * a + b) == [6, 9]\n```" - ], - "signature": "let zipBy: (t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>" - }, - { - "id": "Belt.Array.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "`unzip(a)` takes an array of pairs and creates a pair of arrays. The first array\ncontains all the first items of the pairs; the second array contains all the\nsecond items.\n\n## Examples\n\n```rescript\nBelt.Array.unzip([(1, 2), (3, 4)]) == ([1, 3], [2, 4])\n\nBelt.Array.unzip([(1, 2), (3, 4), (5, 6), (7, 8)]) == ([1, 3, 5, 7], [2, 4, 6, 8])\n```" - ], - "signature": "let unzip: array<('a, 'b)> => (t<'a>, array<'b>)" - }, - { - "id": "Belt.Array.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(xs, ys)` returns a fresh array containing the concatenation of the arrays\n`v1` and `v2`, so even if `v1` or `v2` is empty; it can not be shared.\n\n## Examples\n\n```rescript\nBelt.Array.concat([1, 2, 3], [4, 5]) == [1, 2, 3, 4, 5]\n\nBelt.Array.concat([], [\"a\", \"b\", \"c\"]) == [\"a\", \"b\", \"c\"]\n```" - ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Belt.Array.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(xss)` returns a fresh array as the concatenation of `xss` (an array of arrays)\n\n## Examples\n\n```rescript\nBelt.Array.concatMany([[1, 2, 3], [4, 5, 6], [7, 8]]) == [1, 2, 3, 4, 5, 6, 7, 8]\n```" - ], - "signature": "let concatMany: array> => t<'a>" - }, - { - "id": "Belt.Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(xs, offset, len)` creates a new array with the len elements of `xs`\nstarting at `offset` for `offset` can be negative;and is evaluated as\n`length(xs) - offset(slice, xs) - 1(1)` means get the last element as a\nsingleton array `slice(xs, ~-len, len)` will return a copy of the array if the\narray does not have enough data; `slice` extracts through the end of sequence.\n\nif `len` is negative; returns the empty array.\n\n## Examples\n\n```rescript\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=2, ~len=3) == [12, 13, 14]\n\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=-4, ~len=3) == [13, 14, 15]\n\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=4, ~len=9) == [14, 15, 16]\n```" - ], - "signature": "let slice: (t<'a>, ~offset: int, ~len: int) => t<'a>" - }, - { - "id": "Belt.Array.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(xs, offset)` creates a new array with the elements of `xs` starting\nat `offset`\n\n`offset` can be negative; and is evaluated as `length(xs) - offset(sliceToEnd, xs) - 1`\nmeans get the last element as a singleton array\n\n`sliceToEnd(xs, 0)` will return a copy of the array\n\n## Examples\n\n```rescript\nBelt.Array.sliceToEnd([10, 11, 12, 13, 14, 15, 16], 2) == [12, 13, 14, 15, 16]\n\nBelt.Array.sliceToEnd([10, 11, 12, 13, 14, 15, 16], -4) == [13, 14, 15, 16]\n```" - ], - "signature": "let sliceToEnd: (t<'a>, int) => t<'a>" - }, - { - "id": "Belt.Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(a)` returns a copy of `a`; that is; a fresh array containing the same\nelements as `a`." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.Array.fill", - "kind": "value", - "name": "fill", - "docstrings": [ - "`fill(arr, ~offset, ~len, x)` modifies `arr` in place, storing `x` in elements\nnumber `offset` to `offset + len - 1`. `offset` can be negative; and is evaluated\nas `length(arr - offset)`.\n\n`fill(arr, ~offset=-1, ~len=1)` means fill the last element, if the array does not have enough data; `fill` will ignore it\n\n## Examples\n\n```rescript\nlet arr = Belt.Array.makeBy(5, i => i)\n\nBelt.Array.fill(arr, ~offset=2, ~len=2, 9)\n\narr == [0, 1, 9, 9, 4]\n\nBelt.Array.fill(arr, ~offset=7, ~len=2, 8)\n\narr == [0, 1, 9, 9, 4]\n```" - ], - "signature": "let fill: (t<'a>, ~offset: int, ~len: int, 'a) => unit" - }, - { - "id": "Belt.Array.blit", - "kind": "value", - "name": "blit", - "docstrings": [ - "`blit(~src=v1, ~srcOffset=o1, ~dst=v2, ~dstOffset=o2, ~len)` copies `len` elements\nfrom array `v1`;starting at element number `o1`;to array `v2`, starting at element\nnumber `o2`. It works correctly even if `v1` and `v2` are the same array and the\nsource and destination chunks overlap.\n\n`offset` can be negative; `-1` means `len - 1`; if `len + offset` is still negative;it will be set as 0\n\nFor each of the examples;presume that `v1 == [10, 11, 12, 13, 14, 15, 16, 17]` and `v2 == [20, 21, 22, 23, 24, 25, 26, 27]`. The result shown is the content of the destination array.\n\n## Examples\n\n```rescript\nlet v1 = [10, 11, 12, 13, 14, 15, 16, 17]\nlet v2 = [20, 21, 22, 23, 24, 25, 26, 27]\n\nBelt.Array.blit(~src=v1, ~srcOffset=4, ~dst=v2, ~dstOffset=2, ~len=3)\nv2 == [20, 21, 14, 15, 16, 25, 26, 27]\n\nBelt.Array.blit(~src=v1, ~srcOffset=4, ~dst=v1, ~dstOffset=2, ~len=3)\nv1 == [10, 11, 14, 15, 16, 15, 16, 17]\n```" - ], - "signature": "let blit: (\n ~src: t<'a>,\n ~srcOffset: int,\n ~dst: t<'a>,\n ~dstOffset: int,\n ~len: int,\n) => unit" - }, - { - "id": "Belt.Array.blitUnsafe", - "kind": "value", - "name": "blitUnsafe", - "docstrings": [ - "Unsafe blit without bounds checking." - ], - "signature": "let blitUnsafe: (\n ~src: t<'a>,\n ~srcOffset: int,\n ~dst: t<'a>,\n ~dstOffset: int,\n ~len: int,\n) => unit" - }, - { - "id": "Belt.Array.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(xs, f)`\n\nCall `f` on each element of `xs` from the beginning to end. `f` returns `unit`\nso no new array is created. Use `forEach` when you are primarily concerned with\nrepetitively creating side effects.\n\n## Examples\n\n```rescript\nBelt.Array.forEach([\"a\", \"b\", \"c\"], x => Js.log(\"Item: \" ++ x))\n\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\nlet total = ref(0)\n\nBelt.Array.forEach([1, 2, 3, 4], x => total := total.contents + x)\n\ntotal.contents == 1 + 2 + 3 + 4\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.Array.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => array<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Array.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(xs, f)` returns a new array by calling `f` for each element of `xs` from\nthe beginning to end.\n\n## Examples\n\n```rescript\nBelt.Array.map([1, 2], x => x + 1) == [2, 3]\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Belt.Array.flatMapU", - "kind": "value", - "name": "flatMapU", - "docstrings": [], - "signature": "let flatMapU: (t<'a>, 'a => array<'b>) => array<'b>", - "deprecated": "Use `flatMap` instead" - }, - { - "id": "Belt.Array.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(xs, f)` returns a new array by calling `f` for each element of `xs` from\nthe beginning to end, concatenating the results.\n\n## Examples\n\n```rescript\nBelt.Array.flatMap([1, 2], x => [x + 10, x + 20]) == [11, 21, 12, 22]\n```" - ], - "signature": "let flatMap: (t<'a>, 'a => array<'b>) => array<'b>" - }, - { - "id": "Belt.Array.getByU", - "kind": "value", - "name": "getByU", - "docstrings": [], - "signature": "let getByU: (t<'a>, 'a => bool) => option<'a>", - "deprecated": "Use `getBy` instead" - }, - { - "id": "Belt.Array.getBy", - "kind": "value", - "name": "getBy", - "docstrings": [ - "`getBy(xs, p)` returns `Some(value)` for the first value in `xs` that satisifies\nthe predicate function `p`; returns `None` if no element satisifies the function.\n\n## Examples\n\n```rescript\nBelt.Array.getBy([1, 4, 3, 2], x => mod(x, 2) == 0) == Some(4)\nBelt.Array.getBy([15, 13, 11], x => mod(x, 2) == 0) == None\n```" - ], - "signature": "let getBy: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Belt.Array.getIndexByU", - "kind": "value", - "name": "getIndexByU", - "docstrings": [], - "signature": "let getIndexByU: (t<'a>, 'a => bool) => option", - "deprecated": "Use `getIndexBy` instead" - }, - { - "id": "Belt.Array.getIndexBy", - "kind": "value", - "name": "getIndexBy", - "docstrings": [ - "`getIndexBy(xs, p)` returns `Some(index)` for the first value in `xs` that\nsatisifies the predicate function `p`; returns `None` if no element satisifies\nthe function.\n\n## Examples\n\n```rescript\nBelt.Array.getIndexBy([1, 4, 3, 2], x => mod(x, 2) == 0) == Some(1)\nBelt.Array.getIndexBy([15, 13, 11], x => mod(x, 2) == 0) == None\n```" - ], - "signature": "let getIndexBy: (t<'a>, 'a => bool) => option" - }, - { - "id": "Belt.Array.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Array.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(xs, p)` returns a new array that keep all elements satisfy `p`." - ], - "signature": "let keep: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Belt.Array.keepWithIndexU", - "kind": "value", - "name": "keepWithIndexU", - "docstrings": [], - "signature": "let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "Use `keepWithIndex` instead" - }, - { - "id": "Belt.Array.keepWithIndex", - "kind": "value", - "name": "keepWithIndex", - "docstrings": [ - "`keepWithIndex(xs, p)` returns a new array that keep all elements satisfy `p`.\n\n## Examples\n\n```rescript\nBelt.Array.keepWithIndex([1, 2, 3], (_x, i) => i == 1) == [2]\n```" - ], - "signature": "let keepWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" - }, - { - "id": "Belt.Array.keepMapU", - "kind": "value", - "name": "keepMapU", - "docstrings": [], - "signature": "let keepMapU: (t<'a>, 'a => option<'b>) => array<'b>", - "deprecated": "Use `keepMap` instead" - }, - { - "id": "Belt.Array.keepMap", - "kind": "value", - "name": "keepMap", - "docstrings": [ - "`keepMap(xs, p)` returns a new array that keep all elements that return a non\nNone applied `p`.\n\n## Examples\n\n```rescript\nBelt.Array.keepMap([1, 2, 3], x =>\n if mod(x, 2) == 0 {\n Some(x)\n } else {\n None\n }\n) == [2]\n```" - ], - "signature": "let keepMap: (t<'a>, 'a => option<'b>) => array<'b>" - }, - { - "id": "Belt.Array.forEachWithIndexU", - "kind": "value", - "name": "forEachWithIndexU", - "docstrings": [], - "signature": "let forEachWithIndexU: (t<'a>, (int, 'a) => unit) => unit", - "deprecated": "Use `forEachWithIndex` instead" - }, - { - "id": "Belt.Array.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(xs, f)` same as `Belt.Array.forEach`, except that `f` is\nsupplied two arguments: the index starting from 0 and the element from `xs`.\n\n## Examples\n\n```rescript\nBelt.Array.forEachWithIndex([\"a\", \"b\", \"c\"], (i, x) =>\n Js.log(\"Item \" ++ Belt.Int.toString(i) ++ \" is \" ++ x)\n)\n\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\nlet total = ref(0)\n\nBelt.Array.forEachWithIndex([10, 11, 12, 13], (i, x) => total := total.contents + x + i)\n\ntotal.contents == 0 + 10 + 1 + 11 + 2 + 12 + 3 + 13\n```" - ], - "signature": "let forEachWithIndex: (t<'a>, (int, 'a) => unit) => unit" - }, - { - "id": "Belt.Array.mapWithIndexU", - "kind": "value", - "name": "mapWithIndexU", - "docstrings": [], - "signature": "let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => array<'b>", - "deprecated": "Use `mapWithIndex` instead" - }, - { - "id": "Belt.Array.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(xs, f)` applies `f` to each element of `xs`. Function `f` takes\ntwo arguments: the index starting from 0 and the element from `xs`.\n\n## Examples\n\n```rescript\nBelt.Array.mapWithIndex([1, 2, 3], (i, x) => i + x) == [0 + 1, 1 + 2, 2 + 3]\n```" - ], - "signature": "let mapWithIndex: (t<'a>, (int, 'a) => 'b) => array<'b>" - }, - { - "id": "Belt.Array.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Array.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(f, a)` split array into tuple of two arrays based on predicate `f`;\nfirst of tuple where predicate cause true, second where predicate cause false\n\n## Examples\n\n```rescript\nBelt.Array.partition([1, 2, 3, 4, 5], x => mod(x, 2) == 0) == ([2, 4], [1, 3, 5])\n\nBelt.Array.partition([1, 2, 3, 4, 5], x => mod(x, 2) != 0) == ([1, 3, 5], [2, 4])\n```" - ], - "signature": "let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)" - }, - { - "id": "Belt.Array.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(xs, init, f)` applies `f` to each element of `xs` from beginning to end.\nFunction `f` has two parameters: the item from the list and an “accumulator”;\nwhich starts with a value of `init`. `reduce` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nBelt.Array.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\nBelt.Array.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n```" - ], - "signature": "let reduce: (array<'b>, 'a, ('a, 'b) => 'a) => 'a" - }, - { - "id": "Belt.Array.reduceReverseU", - "kind": "value", - "name": "reduceReverseU", - "docstrings": [], - "signature": "let reduceReverseU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a", - "deprecated": "Use `reduceReverse` instead" - }, - { - "id": "Belt.Array.reduceReverse", - "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "`reduceReverse(xs, init, f)` works like `Belt.Array.reduce` except that\nfunction `f` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nBelt.Array.reduceReverse([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n```" - ], - "signature": "let reduceReverse: (array<'b>, 'a, ('a, 'b) => 'a) => 'a" - }, - { - "id": "Belt.Array.reduceReverse2U", - "kind": "value", - "name": "reduceReverse2U", - "docstrings": [], - "signature": "let reduceReverse2U: (t<'a>, array<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c", - "deprecated": "Use `reduceReverse2` instead" - }, - { - "id": "Belt.Array.reduceReverse2", - "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "`reduceReverse2(xs, ys, init, f)` reduces two arrays xs and ys;taking items\nstarting at `min(length(xs), length(ys))` down to and including zero.\n\n## Examples\n\n```rescript\nBelt.Array.reduceReverse2([1, 2, 3], [1, 2], 0, (acc, x, y) => acc + x + y) == 6\n```" - ], - "signature": "let reduceReverse2: (t<'a>, array<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" - }, - { - "id": "Belt.Array.reduceWithIndexU", - "kind": "value", - "name": "reduceWithIndexU", - "docstrings": [], - "signature": "let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b", - "deprecated": "Use `reduceWithIndex` instead" - }, - { - "id": "Belt.Array.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "Applies `f` to each element of `xs` from beginning to end. Function `f` has\nthree parameters: the item from the array and an “accumulator”, which starts\nwith a value of `init` and the index of each element. `reduceWithIndex` returns\nthe final value of the accumulator.\n\n## Examples\n\n```rescript\nBelt.Array.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n```" - ], - "signature": "let reduceWithIndex: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Belt.Array.joinWithU", - "kind": "value", - "name": "joinWithU", - "docstrings": [], - "signature": "let joinWithU: (t<'a>, string, 'a => string) => string", - "deprecated": "Use `joinWith` instead" - }, - { - "id": "Belt.Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "`joinWith(xs, sep, toString)`\n\nConcatenates all the elements of `xs` converted to string with `toString`, each\nseparated by `sep`, the string given as the second argument, into a single string.\nIf the array has only one element, then that element will be returned without\nusing the separator. If the array is empty, the empty string will be returned.\n\n## Examples\n\n```rescript\nBelt.Array.joinWith([0, 1], \", \", Js.Int.toString) == \"0, 1\"\nBelt.Array.joinWith([], \" \", Js.Int.toString) == \"\"\nBelt.Array.joinWith([1], \" \", Js.Int.toString) == \"1\"\n```" - ], - "signature": "let joinWith: (t<'a>, string, 'a => string) => string" - }, - { - "id": "Belt.Array.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Array.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(xs, p)` returns true if at least one of the elements in `xs` satifies `p`;\nwhere `p` is a predicate: a function taking an element and returning a `bool`.\n\n## Examples\n\n```rescript\nBelt.Array.some([2, 3, 4], x => mod(x, 2) == 1) == true\n\nBelt.Array.some([-1, -3, -5], x => x > 0) == false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.Array.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Array.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(xs, p)` returns `true` if all elements satisfy `p`; where `p` is a\npredicate: a function taking an element and returning a `bool`.\n\n## Examples\n\n```rescript\nBelt.Array.every([1, 3, 5], x => mod(x, 2) == 1) == true\n\nBelt.Array.every([1, -3, 5], x => x > 0) == false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.Array.every2U", - "kind": "value", - "name": "every2U", - "docstrings": [], - "signature": "let every2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `every2` instead" - }, - { - "id": "Belt.Array.every2", - "kind": "value", - "name": "every2", - "docstrings": [ - "`every2(xs, ys, p)` returns true if `p(xi, yi)` is true for all pairs of\nelements up to the shorter length (i.e. `min(length(xs), length(ys))`)\n\n## Examples\n\n```rescript\nBelt.Array.every2([1, 2, 3], [0, 1], (a, b) => a > b) == true\n\nBelt.Array.every2([], [1], (x, y) => x > y) == true\n\nBelt.Array.every2([2, 3], [1], (x, y) => x > y) == true\n\nBelt.Array.every2([0, 1], [5, 0], (x, y) => x > y) == false\n```" - ], - "signature": "let every2: (t<'a>, array<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Array.some2U", - "kind": "value", - "name": "some2U", - "docstrings": [], - "signature": "let some2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `some2` instead" - }, - { - "id": "Belt.Array.some2", - "kind": "value", - "name": "some2", - "docstrings": [ - "`some2(xs, ys, p)` returns true if `p(xi, yi)` is true for any pair of elements\nup to the shorter length (i.e. `min(length(xs), length(ys))`)\n\n## Examples\n\n```rescript\nBelt.Array.some2([0, 2], [1, 0, 3], (a, b) => a > b) == true\n\nBelt.Array.some2([], [1], (x, y) => x > y) == false\n\nBelt.Array.some2([2, 3], [1, 4], (x, y) => x > y) == true\n```" - ], - "signature": "let some2: (t<'a>, array<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Array.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Array.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(xs, ys, f)` compared by length if `length(xs) != length(ys)`; returning `-1`\nif `length(xs) < length(ys)` or 1 if `length(xs) > length(ys)`. Otherwise\ncompare one by one `f(x, y)`. `f` returns a negative number if `x` is “less than” `y`\nzero if `x` is “equal to” `y` a positive number if `x` is “greater than”\n`y`. The comparison returns the first non-zero result of `f`; or zero if `f`\nreturns zero for all `x` and `y`.\n\n## Examples\n\n```rescript\nBelt.Array.cmp([1, 3, 5], [1, 4, 2], (a, b) => compare(a, b)) == -1\n\nBelt.Array.cmp([1, 3, 5], [1, 2, 3], (a, b) => compare(a, b)) == 1\n\nBelt.Array.cmp([1, 3, 5], [1, 3, 5], (a, b) => compare(a, b)) == 0\n```" - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.Array.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Array.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(xs, ys)` return `false` if length is not the same otherwise compare items\none by one using `f(xi, yi)`; and return true if all results are true false otherwise\n\n## Examples\n\n```rescript\nBelt.Array.eq([1, 2, 3], [-1, -2, -3], (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.Array.truncateToLengthUnsafe", - "kind": "value", - "name": "truncateToLengthUnsafe", - "docstrings": [ - "Unsafe `truncateToLengthUnsafe(xs, n)` sets length of array `xs` to `n`. If `n`\nis greater than the length of `xs`; the extra elements are set to `Js.Null_undefined.null`.\nIf `n` is less than zero; throws a `RangeError`.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n\nBelt.Array.truncateToLengthUnsafe(arr, 3)\n\narr == [\"ant\", \"bee\", \"cat\"]\n```" - ], - "signature": "let truncateToLengthUnsafe: (t<'a>, int) => unit" - }, - { - "id": "Belt.Array.initU", - "kind": "value", - "name": "initU", - "docstrings": [], - "signature": "let initU: (int, int => 'a) => t<'a>", - "deprecated": "Use `init` instead" - }, - { - "id": "Belt.Array.init", - "kind": "value", - "name": "init", - "docstrings": [], - "signature": "let init: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.Array.push", - "kind": "value", - "name": "push", - "docstrings": [ - "`arr->push(item)` pushes an element `item` into an array `arr`." - ], - "signature": "let push: (t<'a>, 'a) => unit" - } - ] - }, - "belt/id": { - "id": "Belt.Id", - "name": "Id", - "docstrings": [ - "[`Belt.Id`]()\n\n Provide utilities to create identified comparators or hashes for\n data structures used below.\n\n It create a unique identifier per module of\n functions so that different data structures with slightly different\n comparison functions won't mix", - "[`Belt.Id`]()\n\nProvide utiliites to create identified comparators or hashes for\ndata structures used below.\n\nIt create a unique identifer per module of functions so that different data structures with slightly different\ncomparison functions won't mix." - ], - "items": [ - { - "id": "Belt.Id.hash", - "kind": "type", - "name": "hash", - "docstrings": [ - "`('a, 'id) hash`\n\nIts runtime represenation is a `hash` function, but signed with a\ntype parameter, so that different hash functions type mismatch" - ], - "signature": "type hash<'a, 'id>" - }, - { - "id": "Belt.Id.eq", - "kind": "type", - "name": "eq", - "docstrings": [ - "`('a, 'id) eq`\n\nIts runtime represenation is an `eq` function, but signed with a\ntype parameter, so that different hash functions type mismatch" - ], - "signature": "type eq<'a, 'id>" - }, - { - "id": "Belt.Id.cmp", - "kind": "type", - "name": "cmp", - "docstrings": [ - "`('a,'id) cmp`\n\nIts runtime representation is a `cmp` function, but signed with a\ntype parameter, so that different hash functions type mismatch" - ], - "signature": "type cmp<'a, 'id>" - }, - { - "id": "Belt.Id.comparable", - "kind": "type", - "name": "comparable", - "docstrings": [ - "`('key, 'id) cmparable` is a module of functions, here it only includes `cmp`.\n\nUnlike normal functions, when created, it comes with a unique identity (guaranteed\nby the type system).\n\nIt can be created using function [`comparableU`]() or [`comparable`]().\n\nThe idea of a unique identity when created is that it makes sure two sets would type\nmismatch if they use different comparison function" - ], - "signature": "type comparable<'key, 'id> = module(Comparable\n with type identity = 'id\n and type t = 'key)" - }, - { - "id": "Belt.Id.comparableU", - "kind": "value", - "name": "comparableU", - "docstrings": [], - "signature": "let comparableU: (\n ~cmp: ('a, 'a) => int,\n) => module(Comparable with type t = 'a)", - "deprecated": "Use `comparable` instead" - }, - { - "id": "Belt.Id.comparable", - "kind": "value", - "name": "comparable", - "docstrings": [], - "signature": "let comparable: (\n ~cmp: ('a, 'a) => int,\n) => module(Comparable with type t = 'a)" - }, - { - "id": "Belt.Id.hashable", - "kind": "type", - "name": "hashable", - "docstrings": [ - "`('key, 'id) hashable` is a module of functions, here it only includes `hash`, `eq`.\n\nUnlike normal functions, when created, it comes with a unique identity (guaranteed\nby the type system).\n\nIt can be created using function [`hashableU`]() or [`hashable`]().\n\nThe idea of a unique identity when created is that it makes sure two hash sets would type\nmismatch if they use different comparison function" - ], - "signature": "type hashable<'key, 'id> = module(Hashable\n with type identity = 'id\n and type t = 'key)" - }, - { - "id": "Belt.Id.hashableU", - "kind": "value", - "name": "hashableU", - "docstrings": [], - "signature": "let hashableU: (\n ~hash: 'a => int,\n ~eq: ('a, 'a) => bool,\n) => module(Hashable with type t = 'a)", - "deprecated": "Use `hashable` instead" - }, - { - "id": "Belt.Id.hashable", - "kind": "value", - "name": "hashable", - "docstrings": [], - "signature": "let hashable: (\n ~hash: 'a => int,\n ~eq: ('a, 'a) => bool,\n) => module(Hashable with type t = 'a)" - }, - { - "id": "Belt.Id.getHashInternal", - "kind": "value", - "name": "getHashInternal", - "docstrings": [], - "signature": "let getHashInternal: hash<'a, 'id> => 'a => int" - }, - { - "id": "Belt.Id.getEqInternal", - "kind": "value", - "name": "getEqInternal", - "docstrings": [], - "signature": "let getEqInternal: eq<'a, 'id> => ('a, 'a) => bool" - }, - { - "id": "Belt.Id.getCmpInternal", - "kind": "value", - "name": "getCmpInternal", - "docstrings": [], - "signature": "let getCmpInternal: cmp<'a, 'id> => ('a, 'a) => int" - } - ] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v12.0.2/dom.json b/apps/docs/data/api/v12.0.2/dom.json deleted file mode 100644 index 2bf0f3038..000000000 --- a/apps/docs/data/api/v12.0.2/dom.json +++ /dev/null @@ -1,1962 +0,0 @@ -{ - "dom": { - "id": "Dom", - "name": "Dom", - "docstrings": [], - "items": [ - { - "id": "Dom._baseClass", - "kind": "type", - "name": "_baseClass", - "docstrings": [], - "signature": "type _baseClass" - }, - { - "id": "Dom.animation", - "kind": "type", - "name": "animation", - "docstrings": [], - "signature": "type animation" - }, - { - "id": "Dom.cssStyleDeclaration", - "kind": "type", - "name": "cssStyleDeclaration", - "docstrings": [], - "signature": "type cssStyleDeclaration" - }, - { - "id": "Dom.cssStyleSheet", - "kind": "type", - "name": "cssStyleSheet", - "docstrings": [], - "signature": "type cssStyleSheet" - }, - { - "id": "Dom.eventTarget_like", - "kind": "type", - "name": "eventTarget_like", - "docstrings": [], - "signature": "type eventTarget_like<'a>" - }, - { - "id": "Dom.eventTarget", - "kind": "type", - "name": "eventTarget", - "docstrings": [], - "signature": "type eventTarget = eventTarget_like<_baseClass>" - }, - { - "id": "Dom._node", - "kind": "type", - "name": "_node", - "docstrings": [], - "signature": "type _node<'a>" - }, - { - "id": "Dom.node_like", - "kind": "type", - "name": "node_like", - "docstrings": [], - "signature": "type node_like<'a> = eventTarget_like<_node<'a>>" - }, - { - "id": "Dom.node", - "kind": "type", - "name": "node", - "docstrings": [], - "signature": "type node = node_like<_baseClass>" - }, - { - "id": "Dom._attr", - "kind": "type", - "name": "_attr", - "docstrings": [], - "signature": "type _attr" - }, - { - "id": "Dom.attr", - "kind": "type", - "name": "attr", - "docstrings": [], - "signature": "type attr = node_like<_attr>" - }, - { - "id": "Dom._characterData", - "kind": "type", - "name": "_characterData", - "docstrings": [], - "signature": "type _characterData<'a>" - }, - { - "id": "Dom.characterData_like", - "kind": "type", - "name": "characterData_like", - "docstrings": [], - "signature": "type characterData_like<'a> = node_like<_characterData<'a>>" - }, - { - "id": "Dom.characterData", - "kind": "type", - "name": "characterData", - "docstrings": [], - "signature": "type characterData = characterData_like<_baseClass>" - }, - { - "id": "Dom._cdataSection", - "kind": "type", - "name": "_cdataSection", - "docstrings": [], - "signature": "type _cdataSection" - }, - { - "id": "Dom.cdataSection", - "kind": "type", - "name": "cdataSection", - "docstrings": [], - "signature": "type cdataSection = characterData_like<_cdataSection>" - }, - { - "id": "Dom._comment", - "kind": "type", - "name": "_comment", - "docstrings": [], - "signature": "type _comment" - }, - { - "id": "Dom.comment", - "kind": "type", - "name": "comment", - "docstrings": [], - "signature": "type comment = characterData_like<_comment>" - }, - { - "id": "Dom._document", - "kind": "type", - "name": "_document", - "docstrings": [], - "signature": "type _document<'a>" - }, - { - "id": "Dom.document_like", - "kind": "type", - "name": "document_like", - "docstrings": [], - "signature": "type document_like<'a> = node_like<_document<'a>>" - }, - { - "id": "Dom.document", - "kind": "type", - "name": "document", - "docstrings": [], - "signature": "type document = document_like<_baseClass>" - }, - { - "id": "Dom._documentFragment", - "kind": "type", - "name": "_documentFragment", - "docstrings": [], - "signature": "type _documentFragment" - }, - { - "id": "Dom.documentFragment", - "kind": "type", - "name": "documentFragment", - "docstrings": [], - "signature": "type documentFragment = node_like<_documentFragment>" - }, - { - "id": "Dom._documentType", - "kind": "type", - "name": "_documentType", - "docstrings": [], - "signature": "type _documentType" - }, - { - "id": "Dom.documentType", - "kind": "type", - "name": "documentType", - "docstrings": [], - "signature": "type documentType = node_like<_documentType>" - }, - { - "id": "Dom.domImplementation", - "kind": "type", - "name": "domImplementation", - "docstrings": [], - "signature": "type domImplementation" - }, - { - "id": "Dom._element", - "kind": "type", - "name": "_element", - "docstrings": [], - "signature": "type _element<'a>" - }, - { - "id": "Dom.element_like", - "kind": "type", - "name": "element_like", - "docstrings": [], - "signature": "type element_like<'a> = node_like<_element<'a>>" - }, - { - "id": "Dom.element", - "kind": "type", - "name": "element", - "docstrings": [], - "signature": "type element = element_like<_baseClass>" - }, - { - "id": "Dom.htmlCollection", - "kind": "type", - "name": "htmlCollection", - "docstrings": [], - "signature": "type htmlCollection" - }, - { - "id": "Dom.htmlFormControlsCollection", - "kind": "type", - "name": "htmlFormControlsCollection", - "docstrings": [], - "signature": "type htmlFormControlsCollection" - }, - { - "id": "Dom.htmlOptionsCollection", - "kind": "type", - "name": "htmlOptionsCollection", - "docstrings": [], - "signature": "type htmlOptionsCollection" - }, - { - "id": "Dom.intersectionObserver", - "kind": "type", - "name": "intersectionObserver", - "docstrings": [], - "signature": "type intersectionObserver" - }, - { - "id": "Dom.intersectionObserverEntry", - "kind": "type", - "name": "intersectionObserverEntry", - "docstrings": [], - "signature": "type intersectionObserverEntry" - }, - { - "id": "Dom.mutationObserver", - "kind": "type", - "name": "mutationObserver", - "docstrings": [], - "signature": "type mutationObserver" - }, - { - "id": "Dom.mutationRecord", - "kind": "type", - "name": "mutationRecord", - "docstrings": [], - "signature": "type mutationRecord" - }, - { - "id": "Dom.performanceObserver", - "kind": "type", - "name": "performanceObserver", - "docstrings": [], - "signature": "type performanceObserver" - }, - { - "id": "Dom.performanceObserverEntryList", - "kind": "type", - "name": "performanceObserverEntryList", - "docstrings": [], - "signature": "type performanceObserverEntryList" - }, - { - "id": "Dom.reportingObserver", - "kind": "type", - "name": "reportingObserver", - "docstrings": [], - "signature": "type reportingObserver" - }, - { - "id": "Dom.reportingObserverOptions", - "kind": "type", - "name": "reportingObserverOptions", - "docstrings": [], - "signature": "type reportingObserverOptions" - }, - { - "id": "Dom.resizeObserver", - "kind": "type", - "name": "resizeObserver", - "docstrings": [], - "signature": "type resizeObserver" - }, - { - "id": "Dom.resizeObserverEntry", - "kind": "type", - "name": "resizeObserverEntry", - "docstrings": [], - "signature": "type resizeObserverEntry" - }, - { - "id": "Dom.namedNodeMap", - "kind": "type", - "name": "namedNodeMap", - "docstrings": [], - "signature": "type namedNodeMap" - }, - { - "id": "Dom.nodeList", - "kind": "type", - "name": "nodeList", - "docstrings": [], - "signature": "type nodeList" - }, - { - "id": "Dom.radioNodeList", - "kind": "type", - "name": "radioNodeList", - "docstrings": [], - "signature": "type radioNodeList" - }, - { - "id": "Dom.processingInstruction", - "kind": "type", - "name": "processingInstruction", - "docstrings": [], - "signature": "type processingInstruction" - }, - { - "id": "Dom._shadowRoot", - "kind": "type", - "name": "_shadowRoot", - "docstrings": [], - "signature": "type _shadowRoot" - }, - { - "id": "Dom.shadowRoot", - "kind": "type", - "name": "shadowRoot", - "docstrings": [], - "signature": "type shadowRoot = node_like<_shadowRoot>" - }, - { - "id": "Dom._text", - "kind": "type", - "name": "_text", - "docstrings": [], - "signature": "type _text" - }, - { - "id": "Dom.text", - "kind": "type", - "name": "text", - "docstrings": [], - "signature": "type text = characterData_like<_text>" - }, - { - "id": "Dom.domRect", - "kind": "type", - "name": "domRect", - "docstrings": [], - "signature": "type domRect" - }, - { - "id": "Dom.dataTransfer", - "kind": "type", - "name": "dataTransfer", - "docstrings": [], - "signature": "type dataTransfer" - }, - { - "id": "Dom.domStringMap", - "kind": "type", - "name": "domStringMap", - "docstrings": [], - "signature": "type domStringMap" - }, - { - "id": "Dom.history", - "kind": "type", - "name": "history", - "docstrings": [], - "signature": "type history" - }, - { - "id": "Dom._htmlDocument", - "kind": "type", - "name": "_htmlDocument", - "docstrings": [], - "signature": "type _htmlDocument" - }, - { - "id": "Dom.htmlDocument", - "kind": "type", - "name": "htmlDocument", - "docstrings": [], - "signature": "type htmlDocument = document_like<_htmlDocument>" - }, - { - "id": "Dom._htmlElement", - "kind": "type", - "name": "_htmlElement", - "docstrings": [], - "signature": "type _htmlElement<'a>" - }, - { - "id": "Dom.htmlElement_like", - "kind": "type", - "name": "htmlElement_like", - "docstrings": [], - "signature": "type htmlElement_like<'a> = element_like<_htmlElement<'a>>" - }, - { - "id": "Dom.htmlElement", - "kind": "type", - "name": "htmlElement", - "docstrings": [], - "signature": "type htmlElement = htmlElement_like<_baseClass>" - }, - { - "id": "Dom._htmlAnchorElement", - "kind": "type", - "name": "_htmlAnchorElement", - "docstrings": [], - "signature": "type _htmlAnchorElement" - }, - { - "id": "Dom.htmlAnchorElement", - "kind": "type", - "name": "htmlAnchorElement", - "docstrings": [], - "signature": "type htmlAnchorElement = htmlElement_like<\n _htmlAnchorElement,\n>" - }, - { - "id": "Dom._htmlAreaElement", - "kind": "type", - "name": "_htmlAreaElement", - "docstrings": [], - "signature": "type _htmlAreaElement" - }, - { - "id": "Dom.htmlAreaElement", - "kind": "type", - "name": "htmlAreaElement", - "docstrings": [], - "signature": "type htmlAreaElement = htmlElement_like<_htmlAreaElement>" - }, - { - "id": "Dom._htmlAudioElement", - "kind": "type", - "name": "_htmlAudioElement", - "docstrings": [], - "signature": "type _htmlAudioElement" - }, - { - "id": "Dom.htmlAudioElement", - "kind": "type", - "name": "htmlAudioElement", - "docstrings": [], - "signature": "type htmlAudioElement = htmlElement_like<_htmlAudioElement>" - }, - { - "id": "Dom._htmlBaseElement", - "kind": "type", - "name": "_htmlBaseElement", - "docstrings": [], - "signature": "type _htmlBaseElement" - }, - { - "id": "Dom.htmlBaseElement", - "kind": "type", - "name": "htmlBaseElement", - "docstrings": [], - "signature": "type htmlBaseElement = htmlElement_like<_htmlBaseElement>" - }, - { - "id": "Dom._htmlBodyElement", - "kind": "type", - "name": "_htmlBodyElement", - "docstrings": [], - "signature": "type _htmlBodyElement" - }, - { - "id": "Dom.htmlBodyElement", - "kind": "type", - "name": "htmlBodyElement", - "docstrings": [], - "signature": "type htmlBodyElement = htmlElement_like<_htmlBodyElement>" - }, - { - "id": "Dom._htmlBrElement", - "kind": "type", - "name": "_htmlBrElement", - "docstrings": [], - "signature": "type _htmlBrElement" - }, - { - "id": "Dom.htmlBrElement", - "kind": "type", - "name": "htmlBrElement", - "docstrings": [], - "signature": "type htmlBrElement = htmlElement_like<_htmlBrElement>" - }, - { - "id": "Dom._htmlButtonElement", - "kind": "type", - "name": "_htmlButtonElement", - "docstrings": [], - "signature": "type _htmlButtonElement" - }, - { - "id": "Dom.htmlButtonElement", - "kind": "type", - "name": "htmlButtonElement", - "docstrings": [], - "signature": "type htmlButtonElement = htmlElement_like<\n _htmlButtonElement,\n>" - }, - { - "id": "Dom._htmlCanvasElement", - "kind": "type", - "name": "_htmlCanvasElement", - "docstrings": [], - "signature": "type _htmlCanvasElement" - }, - { - "id": "Dom.htmlCanvasElement", - "kind": "type", - "name": "htmlCanvasElement", - "docstrings": [], - "signature": "type htmlCanvasElement = htmlElement_like<\n _htmlCanvasElement,\n>" - }, - { - "id": "Dom._htmlDataElement", - "kind": "type", - "name": "_htmlDataElement", - "docstrings": [], - "signature": "type _htmlDataElement" - }, - { - "id": "Dom.htmlDataElement", - "kind": "type", - "name": "htmlDataElement", - "docstrings": [], - "signature": "type htmlDataElement = htmlElement_like<_htmlDataElement>" - }, - { - "id": "Dom._htmlDataListElement", - "kind": "type", - "name": "_htmlDataListElement", - "docstrings": [], - "signature": "type _htmlDataListElement" - }, - { - "id": "Dom.htmlDataListElement", - "kind": "type", - "name": "htmlDataListElement", - "docstrings": [], - "signature": "type htmlDataListElement = htmlElement_like<\n _htmlDataListElement,\n>" - }, - { - "id": "Dom._htmlDialogElement", - "kind": "type", - "name": "_htmlDialogElement", - "docstrings": [], - "signature": "type _htmlDialogElement" - }, - { - "id": "Dom.htmlDialogElement", - "kind": "type", - "name": "htmlDialogElement", - "docstrings": [], - "signature": "type htmlDialogElement = htmlElement_like<\n _htmlDialogElement,\n>" - }, - { - "id": "Dom._htmlDivElement", - "kind": "type", - "name": "_htmlDivElement", - "docstrings": [], - "signature": "type _htmlDivElement" - }, - { - "id": "Dom.htmlDivElement", - "kind": "type", - "name": "htmlDivElement", - "docstrings": [], - "signature": "type htmlDivElement = htmlElement_like<_htmlDivElement>" - }, - { - "id": "Dom._htmlDlistElement", - "kind": "type", - "name": "_htmlDlistElement", - "docstrings": [], - "signature": "type _htmlDlistElement" - }, - { - "id": "Dom.htmlDlistElement", - "kind": "type", - "name": "htmlDlistElement", - "docstrings": [], - "signature": "type htmlDlistElement = htmlElement_like<_htmlDlistElement>" - }, - { - "id": "Dom._htmlEmbedElement", - "kind": "type", - "name": "_htmlEmbedElement", - "docstrings": [], - "signature": "type _htmlEmbedElement" - }, - { - "id": "Dom.htmlEmbedElement", - "kind": "type", - "name": "htmlEmbedElement", - "docstrings": [], - "signature": "type htmlEmbedElement = htmlElement_like<_htmlEmbedElement>" - }, - { - "id": "Dom._htmlFieldSetElement", - "kind": "type", - "name": "_htmlFieldSetElement", - "docstrings": [], - "signature": "type _htmlFieldSetElement" - }, - { - "id": "Dom.htmlFieldSetElement", - "kind": "type", - "name": "htmlFieldSetElement", - "docstrings": [], - "signature": "type htmlFieldSetElement = htmlElement_like<\n _htmlFieldSetElement,\n>" - }, - { - "id": "Dom._htmlFormElement", - "kind": "type", - "name": "_htmlFormElement", - "docstrings": [], - "signature": "type _htmlFormElement" - }, - { - "id": "Dom.htmlFormElement", - "kind": "type", - "name": "htmlFormElement", - "docstrings": [], - "signature": "type htmlFormElement = htmlElement_like<_htmlFormElement>" - }, - { - "id": "Dom._htmlHeadElement", - "kind": "type", - "name": "_htmlHeadElement", - "docstrings": [], - "signature": "type _htmlHeadElement" - }, - { - "id": "Dom.htmlHeadElement", - "kind": "type", - "name": "htmlHeadElement", - "docstrings": [], - "signature": "type htmlHeadElement = htmlElement_like<_htmlHeadElement>" - }, - { - "id": "Dom._htmlHeadingElement", - "kind": "type", - "name": "_htmlHeadingElement", - "docstrings": [], - "signature": "type _htmlHeadingElement" - }, - { - "id": "Dom.htmlHeadingElement", - "kind": "type", - "name": "htmlHeadingElement", - "docstrings": [], - "signature": "type htmlHeadingElement = htmlElement_like<\n _htmlHeadingElement,\n>" - }, - { - "id": "Dom._htmlHrElement", - "kind": "type", - "name": "_htmlHrElement", - "docstrings": [], - "signature": "type _htmlHrElement" - }, - { - "id": "Dom.htmlHrElement", - "kind": "type", - "name": "htmlHrElement", - "docstrings": [], - "signature": "type htmlHrElement = htmlElement_like<_htmlHrElement>" - }, - { - "id": "Dom._htmlHtmlElement", - "kind": "type", - "name": "_htmlHtmlElement", - "docstrings": [], - "signature": "type _htmlHtmlElement" - }, - { - "id": "Dom.htmlHtmlElement", - "kind": "type", - "name": "htmlHtmlElement", - "docstrings": [], - "signature": "type htmlHtmlElement = htmlElement_like<_htmlHtmlElement>" - }, - { - "id": "Dom._htmlIframeElement", - "kind": "type", - "name": "_htmlIframeElement", - "docstrings": [], - "signature": "type _htmlIframeElement" - }, - { - "id": "Dom.htmlIframeElement", - "kind": "type", - "name": "htmlIframeElement", - "docstrings": [], - "signature": "type htmlIframeElement = htmlElement_like<\n _htmlIframeElement,\n>" - }, - { - "id": "Dom._htmlImageElement", - "kind": "type", - "name": "_htmlImageElement", - "docstrings": [], - "signature": "type _htmlImageElement" - }, - { - "id": "Dom.htmlImageElement", - "kind": "type", - "name": "htmlImageElement", - "docstrings": [], - "signature": "type htmlImageElement = htmlElement_like<_htmlImageElement>" - }, - { - "id": "Dom._htmlInputElement", - "kind": "type", - "name": "_htmlInputElement", - "docstrings": [], - "signature": "type _htmlInputElement" - }, - { - "id": "Dom.htmlInputElement", - "kind": "type", - "name": "htmlInputElement", - "docstrings": [], - "signature": "type htmlInputElement = htmlElement_like<_htmlInputElement>" - }, - { - "id": "Dom._htmlLabelElement", - "kind": "type", - "name": "_htmlLabelElement", - "docstrings": [], - "signature": "type _htmlLabelElement" - }, - { - "id": "Dom.htmlLabelElement", - "kind": "type", - "name": "htmlLabelElement", - "docstrings": [], - "signature": "type htmlLabelElement = htmlElement_like<_htmlLabelElement>" - }, - { - "id": "Dom._htmlLegendElement", - "kind": "type", - "name": "_htmlLegendElement", - "docstrings": [], - "signature": "type _htmlLegendElement" - }, - { - "id": "Dom.htmlLegendElement", - "kind": "type", - "name": "htmlLegendElement", - "docstrings": [], - "signature": "type htmlLegendElement = htmlElement_like<\n _htmlLegendElement,\n>" - }, - { - "id": "Dom._htmlLiElement", - "kind": "type", - "name": "_htmlLiElement", - "docstrings": [], - "signature": "type _htmlLiElement" - }, - { - "id": "Dom.htmlLiElement", - "kind": "type", - "name": "htmlLiElement", - "docstrings": [], - "signature": "type htmlLiElement = htmlElement_like<_htmlLiElement>" - }, - { - "id": "Dom._htmlLinkElement", - "kind": "type", - "name": "_htmlLinkElement", - "docstrings": [], - "signature": "type _htmlLinkElement" - }, - { - "id": "Dom.htmlLinkElement", - "kind": "type", - "name": "htmlLinkElement", - "docstrings": [], - "signature": "type htmlLinkElement = htmlElement_like<_htmlLinkElement>" - }, - { - "id": "Dom._htmlMapElement", - "kind": "type", - "name": "_htmlMapElement", - "docstrings": [], - "signature": "type _htmlMapElement" - }, - { - "id": "Dom.htmlMapElement", - "kind": "type", - "name": "htmlMapElement", - "docstrings": [], - "signature": "type htmlMapElement = htmlElement_like<_htmlMapElement>" - }, - { - "id": "Dom._htmlMediaElement", - "kind": "type", - "name": "_htmlMediaElement", - "docstrings": [], - "signature": "type _htmlMediaElement" - }, - { - "id": "Dom.htmlMediaElement", - "kind": "type", - "name": "htmlMediaElement", - "docstrings": [], - "signature": "type htmlMediaElement = htmlElement_like<_htmlMediaElement>" - }, - { - "id": "Dom._htmlMenuElement", - "kind": "type", - "name": "_htmlMenuElement", - "docstrings": [], - "signature": "type _htmlMenuElement" - }, - { - "id": "Dom.htmlMenuElement", - "kind": "type", - "name": "htmlMenuElement", - "docstrings": [], - "signature": "type htmlMenuElement = htmlElement_like<_htmlMenuElement>" - }, - { - "id": "Dom._htmlMetaElement", - "kind": "type", - "name": "_htmlMetaElement", - "docstrings": [], - "signature": "type _htmlMetaElement" - }, - { - "id": "Dom.htmlMetaElement", - "kind": "type", - "name": "htmlMetaElement", - "docstrings": [], - "signature": "type htmlMetaElement = htmlElement_like<_htmlMetaElement>" - }, - { - "id": "Dom._htmlMeterElement", - "kind": "type", - "name": "_htmlMeterElement", - "docstrings": [], - "signature": "type _htmlMeterElement" - }, - { - "id": "Dom.htmlMeterElement", - "kind": "type", - "name": "htmlMeterElement", - "docstrings": [], - "signature": "type htmlMeterElement = htmlElement_like<_htmlMeterElement>" - }, - { - "id": "Dom._htmlModElement", - "kind": "type", - "name": "_htmlModElement", - "docstrings": [], - "signature": "type _htmlModElement" - }, - { - "id": "Dom.htmlModElement", - "kind": "type", - "name": "htmlModElement", - "docstrings": [], - "signature": "type htmlModElement = htmlElement_like<_htmlModElement>" - }, - { - "id": "Dom._htmlOListElement", - "kind": "type", - "name": "_htmlOListElement", - "docstrings": [], - "signature": "type _htmlOListElement" - }, - { - "id": "Dom.htmlOListElement", - "kind": "type", - "name": "htmlOListElement", - "docstrings": [], - "signature": "type htmlOListElement = htmlElement_like<_htmlOListElement>" - }, - { - "id": "Dom._htmlObjectElement", - "kind": "type", - "name": "_htmlObjectElement", - "docstrings": [], - "signature": "type _htmlObjectElement" - }, - { - "id": "Dom.htmlObjectElement", - "kind": "type", - "name": "htmlObjectElement", - "docstrings": [], - "signature": "type htmlObjectElement = htmlElement_like<\n _htmlObjectElement,\n>" - }, - { - "id": "Dom._htmlOptGroupElement", - "kind": "type", - "name": "_htmlOptGroupElement", - "docstrings": [], - "signature": "type _htmlOptGroupElement" - }, - { - "id": "Dom.htmlOptGroupElement", - "kind": "type", - "name": "htmlOptGroupElement", - "docstrings": [], - "signature": "type htmlOptGroupElement = htmlElement_like<\n _htmlOptGroupElement,\n>" - }, - { - "id": "Dom._htmlOptionElement", - "kind": "type", - "name": "_htmlOptionElement", - "docstrings": [], - "signature": "type _htmlOptionElement" - }, - { - "id": "Dom.htmlOptionElement", - "kind": "type", - "name": "htmlOptionElement", - "docstrings": [], - "signature": "type htmlOptionElement = htmlElement_like<\n _htmlOptionElement,\n>" - }, - { - "id": "Dom._htmlOutputElement", - "kind": "type", - "name": "_htmlOutputElement", - "docstrings": [], - "signature": "type _htmlOutputElement" - }, - { - "id": "Dom.htmlOutputElement", - "kind": "type", - "name": "htmlOutputElement", - "docstrings": [], - "signature": "type htmlOutputElement = htmlElement_like<\n _htmlOutputElement,\n>" - }, - { - "id": "Dom._htmlParagraphElement", - "kind": "type", - "name": "_htmlParagraphElement", - "docstrings": [], - "signature": "type _htmlParagraphElement" - }, - { - "id": "Dom.htmlParagraphElement", - "kind": "type", - "name": "htmlParagraphElement", - "docstrings": [], - "signature": "type htmlParagraphElement = htmlElement_like<\n _htmlParagraphElement,\n>" - }, - { - "id": "Dom._htmlParamElement", - "kind": "type", - "name": "_htmlParamElement", - "docstrings": [], - "signature": "type _htmlParamElement" - }, - { - "id": "Dom.htmlParamElement", - "kind": "type", - "name": "htmlParamElement", - "docstrings": [], - "signature": "type htmlParamElement = htmlElement_like<_htmlParamElement>" - }, - { - "id": "Dom._htmlPreElement", - "kind": "type", - "name": "_htmlPreElement", - "docstrings": [], - "signature": "type _htmlPreElement" - }, - { - "id": "Dom.htmlPreElement", - "kind": "type", - "name": "htmlPreElement", - "docstrings": [], - "signature": "type htmlPreElement = htmlElement_like<_htmlPreElement>" - }, - { - "id": "Dom._htmlProgressElement", - "kind": "type", - "name": "_htmlProgressElement", - "docstrings": [], - "signature": "type _htmlProgressElement" - }, - { - "id": "Dom.htmlProgressElement", - "kind": "type", - "name": "htmlProgressElement", - "docstrings": [], - "signature": "type htmlProgressElement = htmlElement_like<\n _htmlProgressElement,\n>" - }, - { - "id": "Dom._htmlQuoteElement", - "kind": "type", - "name": "_htmlQuoteElement", - "docstrings": [], - "signature": "type _htmlQuoteElement" - }, - { - "id": "Dom.htmlQuoteElement", - "kind": "type", - "name": "htmlQuoteElement", - "docstrings": [], - "signature": "type htmlQuoteElement = htmlElement_like<_htmlQuoteElement>" - }, - { - "id": "Dom._htmlScriptElement", - "kind": "type", - "name": "_htmlScriptElement", - "docstrings": [], - "signature": "type _htmlScriptElement" - }, - { - "id": "Dom.htmlScriptElement", - "kind": "type", - "name": "htmlScriptElement", - "docstrings": [], - "signature": "type htmlScriptElement = htmlElement_like<\n _htmlScriptElement,\n>" - }, - { - "id": "Dom._htmlSelectElement", - "kind": "type", - "name": "_htmlSelectElement", - "docstrings": [], - "signature": "type _htmlSelectElement" - }, - { - "id": "Dom.htmlSelectElement", - "kind": "type", - "name": "htmlSelectElement", - "docstrings": [], - "signature": "type htmlSelectElement = htmlElement_like<\n _htmlSelectElement,\n>" - }, - { - "id": "Dom._htmlSlotElement", - "kind": "type", - "name": "_htmlSlotElement", - "docstrings": [], - "signature": "type _htmlSlotElement" - }, - { - "id": "Dom.htmlSlotElement", - "kind": "type", - "name": "htmlSlotElement", - "docstrings": [], - "signature": "type htmlSlotElement = htmlElement_like<_htmlSlotElement>" - }, - { - "id": "Dom._htmlSourceElement", - "kind": "type", - "name": "_htmlSourceElement", - "docstrings": [], - "signature": "type _htmlSourceElement" - }, - { - "id": "Dom.htmlSourceElement", - "kind": "type", - "name": "htmlSourceElement", - "docstrings": [], - "signature": "type htmlSourceElement = htmlElement_like<\n _htmlSourceElement,\n>" - }, - { - "id": "Dom._htmlSpanElement", - "kind": "type", - "name": "_htmlSpanElement", - "docstrings": [], - "signature": "type _htmlSpanElement" - }, - { - "id": "Dom.htmlSpanElement", - "kind": "type", - "name": "htmlSpanElement", - "docstrings": [], - "signature": "type htmlSpanElement = htmlElement_like<_htmlSpanElement>" - }, - { - "id": "Dom._htmlStyleElement", - "kind": "type", - "name": "_htmlStyleElement", - "docstrings": [], - "signature": "type _htmlStyleElement" - }, - { - "id": "Dom.htmlStyleElement", - "kind": "type", - "name": "htmlStyleElement", - "docstrings": [], - "signature": "type htmlStyleElement = htmlElement_like<_htmlStyleElement>" - }, - { - "id": "Dom._htmlTableCaptionElement", - "kind": "type", - "name": "_htmlTableCaptionElement", - "docstrings": [], - "signature": "type _htmlTableCaptionElement" - }, - { - "id": "Dom.htmlTableCaptionElement", - "kind": "type", - "name": "htmlTableCaptionElement", - "docstrings": [], - "signature": "type htmlTableCaptionElement = htmlElement_like<\n _htmlTableCaptionElement,\n>" - }, - { - "id": "Dom._htmlTableCellElement", - "kind": "type", - "name": "_htmlTableCellElement", - "docstrings": [], - "signature": "type _htmlTableCellElement" - }, - { - "id": "Dom.htmlTableCellElement", - "kind": "type", - "name": "htmlTableCellElement", - "docstrings": [], - "signature": "type htmlTableCellElement = htmlElement_like<\n _htmlTableCellElement,\n>" - }, - { - "id": "Dom._htmlTableColElement", - "kind": "type", - "name": "_htmlTableColElement", - "docstrings": [], - "signature": "type _htmlTableColElement" - }, - { - "id": "Dom.htmlTableColElement", - "kind": "type", - "name": "htmlTableColElement", - "docstrings": [], - "signature": "type htmlTableColElement = htmlElement_like<\n _htmlTableColElement,\n>" - }, - { - "id": "Dom._htmlTableDataCellElement", - "kind": "type", - "name": "_htmlTableDataCellElement", - "docstrings": [], - "signature": "type _htmlTableDataCellElement" - }, - { - "id": "Dom.htmlTableDataCellElement", - "kind": "type", - "name": "htmlTableDataCellElement", - "docstrings": [], - "signature": "type htmlTableDataCellElement = htmlElement_like<\n _htmlTableDataCellElement,\n>" - }, - { - "id": "Dom._htmlTableElement", - "kind": "type", - "name": "_htmlTableElement", - "docstrings": [], - "signature": "type _htmlTableElement" - }, - { - "id": "Dom.htmlTableElement", - "kind": "type", - "name": "htmlTableElement", - "docstrings": [], - "signature": "type htmlTableElement = htmlElement_like<_htmlTableElement>" - }, - { - "id": "Dom._htmlTableHeaderCellElement", - "kind": "type", - "name": "_htmlTableHeaderCellElement", - "docstrings": [], - "signature": "type _htmlTableHeaderCellElement" - }, - { - "id": "Dom.htmlTableHeaderCellElement", - "kind": "type", - "name": "htmlTableHeaderCellElement", - "docstrings": [], - "signature": "type htmlTableHeaderCellElement = htmlElement_like<\n _htmlTableHeaderCellElement,\n>" - }, - { - "id": "Dom._htmlTableRowElement", - "kind": "type", - "name": "_htmlTableRowElement", - "docstrings": [], - "signature": "type _htmlTableRowElement" - }, - { - "id": "Dom.htmlTableRowElement", - "kind": "type", - "name": "htmlTableRowElement", - "docstrings": [], - "signature": "type htmlTableRowElement = htmlElement_like<\n _htmlTableRowElement,\n>" - }, - { - "id": "Dom._htmlTableSectionElement", - "kind": "type", - "name": "_htmlTableSectionElement", - "docstrings": [], - "signature": "type _htmlTableSectionElement" - }, - { - "id": "Dom.htmlTableSectionElement", - "kind": "type", - "name": "htmlTableSectionElement", - "docstrings": [], - "signature": "type htmlTableSectionElement = htmlElement_like<\n _htmlTableSectionElement,\n>" - }, - { - "id": "Dom._htmlTextAreaElement", - "kind": "type", - "name": "_htmlTextAreaElement", - "docstrings": [], - "signature": "type _htmlTextAreaElement" - }, - { - "id": "Dom.htmlTextAreaElement", - "kind": "type", - "name": "htmlTextAreaElement", - "docstrings": [], - "signature": "type htmlTextAreaElement = htmlElement_like<\n _htmlTextAreaElement,\n>" - }, - { - "id": "Dom._htmlTimeElement", - "kind": "type", - "name": "_htmlTimeElement", - "docstrings": [], - "signature": "type _htmlTimeElement" - }, - { - "id": "Dom.htmlTimeElement", - "kind": "type", - "name": "htmlTimeElement", - "docstrings": [], - "signature": "type htmlTimeElement = htmlElement_like<_htmlTimeElement>" - }, - { - "id": "Dom._htmlTitleElement", - "kind": "type", - "name": "_htmlTitleElement", - "docstrings": [], - "signature": "type _htmlTitleElement" - }, - { - "id": "Dom.htmlTitleElement", - "kind": "type", - "name": "htmlTitleElement", - "docstrings": [], - "signature": "type htmlTitleElement = htmlElement_like<_htmlTitleElement>" - }, - { - "id": "Dom._htmlTrackElement", - "kind": "type", - "name": "_htmlTrackElement", - "docstrings": [], - "signature": "type _htmlTrackElement" - }, - { - "id": "Dom.htmlTrackElement", - "kind": "type", - "name": "htmlTrackElement", - "docstrings": [], - "signature": "type htmlTrackElement = htmlElement_like<_htmlTrackElement>" - }, - { - "id": "Dom._htmlUlistElement", - "kind": "type", - "name": "_htmlUlistElement", - "docstrings": [], - "signature": "type _htmlUlistElement" - }, - { - "id": "Dom.htmlUlistElement", - "kind": "type", - "name": "htmlUlistElement", - "docstrings": [], - "signature": "type htmlUlistElement = htmlElement_like<_htmlUlistElement>" - }, - { - "id": "Dom._htmlUnknownElement", - "kind": "type", - "name": "_htmlUnknownElement", - "docstrings": [], - "signature": "type _htmlUnknownElement" - }, - { - "id": "Dom.htmlUnknownElement", - "kind": "type", - "name": "htmlUnknownElement", - "docstrings": [], - "signature": "type htmlUnknownElement = htmlElement_like<\n _htmlUnknownElement,\n>" - }, - { - "id": "Dom._htmlVideoElement", - "kind": "type", - "name": "_htmlVideoElement", - "docstrings": [], - "signature": "type _htmlVideoElement" - }, - { - "id": "Dom.htmlVideoElement", - "kind": "type", - "name": "htmlVideoElement", - "docstrings": [], - "signature": "type htmlVideoElement = htmlElement_like<_htmlVideoElement>" - }, - { - "id": "Dom.location", - "kind": "type", - "name": "location", - "docstrings": [], - "signature": "type location" - }, - { - "id": "Dom.window", - "kind": "type", - "name": "window", - "docstrings": [], - "signature": "type window" - }, - { - "id": "Dom._xmlDocument", - "kind": "type", - "name": "_xmlDocument", - "docstrings": [], - "signature": "type _xmlDocument" - }, - { - "id": "Dom.xmlDocument", - "kind": "type", - "name": "xmlDocument", - "docstrings": [], - "signature": "type xmlDocument = document_like<_xmlDocument>" - }, - { - "id": "Dom.event_like", - "kind": "type", - "name": "event_like", - "docstrings": [], - "signature": "type event_like<'a>" - }, - { - "id": "Dom.event", - "kind": "type", - "name": "event", - "docstrings": [], - "signature": "type event = event_like<_baseClass>" - }, - { - "id": "Dom._uiEvent", - "kind": "type", - "name": "_uiEvent", - "docstrings": [], - "signature": "type _uiEvent<'a>" - }, - { - "id": "Dom.uiEvent_like", - "kind": "type", - "name": "uiEvent_like", - "docstrings": [], - "signature": "type uiEvent_like<'a> = event_like<_uiEvent<'a>>" - }, - { - "id": "Dom.uiEvent", - "kind": "type", - "name": "uiEvent", - "docstrings": [], - "signature": "type uiEvent = uiEvent_like<_baseClass>" - }, - { - "id": "Dom._animationEvent", - "kind": "type", - "name": "_animationEvent", - "docstrings": [], - "signature": "type _animationEvent" - }, - { - "id": "Dom.animationEvent", - "kind": "type", - "name": "animationEvent", - "docstrings": [], - "signature": "type animationEvent = event_like<_animationEvent>" - }, - { - "id": "Dom._beforeUnloadEvent", - "kind": "type", - "name": "_beforeUnloadEvent", - "docstrings": [], - "signature": "type _beforeUnloadEvent" - }, - { - "id": "Dom.beforeUnloadEvent", - "kind": "type", - "name": "beforeUnloadEvent", - "docstrings": [], - "signature": "type beforeUnloadEvent = event_like<_beforeUnloadEvent>" - }, - { - "id": "Dom._clipboardEvent", - "kind": "type", - "name": "_clipboardEvent", - "docstrings": [], - "signature": "type _clipboardEvent" - }, - { - "id": "Dom.clipboardEvent", - "kind": "type", - "name": "clipboardEvent", - "docstrings": [], - "signature": "type clipboardEvent = event_like<_clipboardEvent>" - }, - { - "id": "Dom._closeEvent", - "kind": "type", - "name": "_closeEvent", - "docstrings": [], - "signature": "type _closeEvent" - }, - { - "id": "Dom.closeEvent", - "kind": "type", - "name": "closeEvent", - "docstrings": [], - "signature": "type closeEvent = event_like<_closeEvent>" - }, - { - "id": "Dom._compositionEvent", - "kind": "type", - "name": "_compositionEvent", - "docstrings": [], - "signature": "type _compositionEvent" - }, - { - "id": "Dom.compositionEvent", - "kind": "type", - "name": "compositionEvent", - "docstrings": [], - "signature": "type compositionEvent = uiEvent_like<_compositionEvent>" - }, - { - "id": "Dom._customEvent", - "kind": "type", - "name": "_customEvent", - "docstrings": [], - "signature": "type _customEvent" - }, - { - "id": "Dom.customEvent", - "kind": "type", - "name": "customEvent", - "docstrings": [], - "signature": "type customEvent = event_like<_customEvent>" - }, - { - "id": "Dom._dragEvent", - "kind": "type", - "name": "_dragEvent", - "docstrings": [], - "signature": "type _dragEvent" - }, - { - "id": "Dom.dragEvent", - "kind": "type", - "name": "dragEvent", - "docstrings": [], - "signature": "type dragEvent = event_like<_dragEvent>" - }, - { - "id": "Dom._errorEvent", - "kind": "type", - "name": "_errorEvent", - "docstrings": [], - "signature": "type _errorEvent" - }, - { - "id": "Dom.errorEvent", - "kind": "type", - "name": "errorEvent", - "docstrings": [], - "signature": "type errorEvent = event_like<_errorEvent>" - }, - { - "id": "Dom._focusEvent", - "kind": "type", - "name": "_focusEvent", - "docstrings": [], - "signature": "type _focusEvent" - }, - { - "id": "Dom.focusEvent", - "kind": "type", - "name": "focusEvent", - "docstrings": [], - "signature": "type focusEvent = uiEvent_like<_focusEvent>" - }, - { - "id": "Dom._idbVersionChangeEvent", - "kind": "type", - "name": "_idbVersionChangeEvent", - "docstrings": [], - "signature": "type _idbVersionChangeEvent" - }, - { - "id": "Dom.idbVersionChangeEvent", - "kind": "type", - "name": "idbVersionChangeEvent", - "docstrings": [], - "signature": "type idbVersionChangeEvent = event_like<\n _idbVersionChangeEvent,\n>" - }, - { - "id": "Dom._inputEvent", - "kind": "type", - "name": "_inputEvent", - "docstrings": [], - "signature": "type _inputEvent" - }, - { - "id": "Dom.inputEvent", - "kind": "type", - "name": "inputEvent", - "docstrings": [], - "signature": "type inputEvent = uiEvent_like<_inputEvent>" - }, - { - "id": "Dom._keyboardEvent", - "kind": "type", - "name": "_keyboardEvent", - "docstrings": [], - "signature": "type _keyboardEvent" - }, - { - "id": "Dom.keyboardEvent", - "kind": "type", - "name": "keyboardEvent", - "docstrings": [], - "signature": "type keyboardEvent = uiEvent_like<_keyboardEvent>" - }, - { - "id": "Dom._mouseEvent", - "kind": "type", - "name": "_mouseEvent", - "docstrings": [], - "signature": "type _mouseEvent<'a>" - }, - { - "id": "Dom.mouseEvent_like", - "kind": "type", - "name": "mouseEvent_like", - "docstrings": [], - "signature": "type mouseEvent_like<'a> = uiEvent_like<_mouseEvent<'a>>" - }, - { - "id": "Dom.mouseEvent", - "kind": "type", - "name": "mouseEvent", - "docstrings": [], - "signature": "type mouseEvent = mouseEvent_like<_baseClass>" - }, - { - "id": "Dom._pageTransitionEvent", - "kind": "type", - "name": "_pageTransitionEvent", - "docstrings": [], - "signature": "type _pageTransitionEvent" - }, - { - "id": "Dom.pageTransitionEvent", - "kind": "type", - "name": "pageTransitionEvent", - "docstrings": [], - "signature": "type pageTransitionEvent = event_like<_pageTransitionEvent>" - }, - { - "id": "Dom._pointerEvent", - "kind": "type", - "name": "_pointerEvent", - "docstrings": [], - "signature": "type _pointerEvent" - }, - { - "id": "Dom.pointerEvent", - "kind": "type", - "name": "pointerEvent", - "docstrings": [], - "signature": "type pointerEvent = mouseEvent_like<_pointerEvent>" - }, - { - "id": "Dom._popStateEvent", - "kind": "type", - "name": "_popStateEvent", - "docstrings": [], - "signature": "type _popStateEvent" - }, - { - "id": "Dom.popStateEvent", - "kind": "type", - "name": "popStateEvent", - "docstrings": [], - "signature": "type popStateEvent = event_like<_popStateEvent>" - }, - { - "id": "Dom._progressEvent", - "kind": "type", - "name": "_progressEvent", - "docstrings": [], - "signature": "type _progressEvent" - }, - { - "id": "Dom.progressEvent", - "kind": "type", - "name": "progressEvent", - "docstrings": [], - "signature": "type progressEvent = event_like<_progressEvent>" - }, - { - "id": "Dom._relatedEvent", - "kind": "type", - "name": "_relatedEvent", - "docstrings": [], - "signature": "type _relatedEvent" - }, - { - "id": "Dom.relatedEvent", - "kind": "type", - "name": "relatedEvent", - "docstrings": [], - "signature": "type relatedEvent = event_like<_relatedEvent>" - }, - { - "id": "Dom._storageEvent", - "kind": "type", - "name": "_storageEvent", - "docstrings": [], - "signature": "type _storageEvent" - }, - { - "id": "Dom.storageEvent", - "kind": "type", - "name": "storageEvent", - "docstrings": [], - "signature": "type storageEvent = event_like<_storageEvent>" - }, - { - "id": "Dom._svgZoomEvent", - "kind": "type", - "name": "_svgZoomEvent", - "docstrings": [], - "signature": "type _svgZoomEvent" - }, - { - "id": "Dom.svgZoomEvent", - "kind": "type", - "name": "svgZoomEvent", - "docstrings": [], - "signature": "type svgZoomEvent = event_like<_svgZoomEvent>" - }, - { - "id": "Dom._timeEvent", - "kind": "type", - "name": "_timeEvent", - "docstrings": [], - "signature": "type _timeEvent" - }, - { - "id": "Dom.timeEvent", - "kind": "type", - "name": "timeEvent", - "docstrings": [], - "signature": "type timeEvent = event_like<_timeEvent>" - }, - { - "id": "Dom._touchEvent", - "kind": "type", - "name": "_touchEvent", - "docstrings": [], - "signature": "type _touchEvent" - }, - { - "id": "Dom.touchEvent", - "kind": "type", - "name": "touchEvent", - "docstrings": [], - "signature": "type touchEvent = uiEvent_like<_touchEvent>" - }, - { - "id": "Dom._trackEvent", - "kind": "type", - "name": "_trackEvent", - "docstrings": [], - "signature": "type _trackEvent" - }, - { - "id": "Dom.trackEvent", - "kind": "type", - "name": "trackEvent", - "docstrings": [], - "signature": "type trackEvent = event_like<_trackEvent>" - }, - { - "id": "Dom._transitionEvent", - "kind": "type", - "name": "_transitionEvent", - "docstrings": [], - "signature": "type _transitionEvent" - }, - { - "id": "Dom.transitionEvent", - "kind": "type", - "name": "transitionEvent", - "docstrings": [], - "signature": "type transitionEvent = event_like<_transitionEvent>" - }, - { - "id": "Dom._webGlContextEvent", - "kind": "type", - "name": "_webGlContextEvent", - "docstrings": [], - "signature": "type _webGlContextEvent" - }, - { - "id": "Dom.webGlContextEvent", - "kind": "type", - "name": "webGlContextEvent", - "docstrings": [], - "signature": "type webGlContextEvent = event_like<_webGlContextEvent>" - }, - { - "id": "Dom._wheelEvent", - "kind": "type", - "name": "_wheelEvent", - "docstrings": [], - "signature": "type _wheelEvent" - }, - { - "id": "Dom.wheelEvent", - "kind": "type", - "name": "wheelEvent", - "docstrings": [], - "signature": "type wheelEvent = uiEvent_like<_wheelEvent>" - }, - { - "id": "Dom.range", - "kind": "type", - "name": "range", - "docstrings": [], - "signature": "type range" - }, - { - "id": "Dom.selection", - "kind": "type", - "name": "selection", - "docstrings": [], - "signature": "type selection" - }, - { - "id": "Dom.domTokenList", - "kind": "type", - "name": "domTokenList", - "docstrings": [], - "signature": "type domTokenList" - }, - { - "id": "Dom.domSettableTokenList", - "kind": "type", - "name": "domSettableTokenList", - "docstrings": [], - "signature": "type domSettableTokenList" - }, - { - "id": "Dom.nodeFilter", - "kind": "type", - "name": "nodeFilter", - "docstrings": [], - "signature": "type nodeFilter = {acceptNode: element => int}" - }, - { - "id": "Dom.nodeIterator", - "kind": "type", - "name": "nodeIterator", - "docstrings": [], - "signature": "type nodeIterator" - }, - { - "id": "Dom.treeWalker", - "kind": "type", - "name": "treeWalker", - "docstrings": [], - "signature": "type treeWalker" - }, - { - "id": "Dom.svgRect", - "kind": "type", - "name": "svgRect", - "docstrings": [], - "signature": "type svgRect" - }, - { - "id": "Dom.svgPoint", - "kind": "type", - "name": "svgPoint", - "docstrings": [], - "signature": "type svgPoint" - }, - { - "id": "Dom.eventPointerId", - "kind": "type", - "name": "eventPointerId", - "docstrings": [], - "signature": "type eventPointerId" - } - ] - }, - "dom/storage2": { - "id": "Dom.Storage2", - "name": "Storage2", - "docstrings": [], - "items": [ - { - "id": "Dom.Storage2.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Dom.Storage2.getItem", - "kind": "value", - "name": "getItem", - "docstrings": [], - "signature": "let getItem: (t, string) => option" - }, - { - "id": "Dom.Storage2.setItem", - "kind": "value", - "name": "setItem", - "docstrings": [], - "signature": "let setItem: (t, string, string) => unit" - }, - { - "id": "Dom.Storage2.removeItem", - "kind": "value", - "name": "removeItem", - "docstrings": [], - "signature": "let removeItem: (t, string) => unit" - }, - { - "id": "Dom.Storage2.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Dom.Storage2.key", - "kind": "value", - "name": "key", - "docstrings": [], - "signature": "let key: (t, int) => option" - }, - { - "id": "Dom.Storage2.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int" - }, - { - "id": "Dom.Storage2.localStorage", - "kind": "value", - "name": "localStorage", - "docstrings": [], - "signature": "let localStorage: t" - }, - { - "id": "Dom.Storage2.sessionStorage", - "kind": "value", - "name": "sessionStorage", - "docstrings": [], - "signature": "let sessionStorage: t" - } - ] - }, - "dom/storage": { - "id": "Dom.Storage", - "name": "Storage", - "docstrings": [], - "items": [ - { - "id": "Dom.Storage.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Dom_storage2.t" - }, - { - "id": "Dom.Storage.getItem", - "kind": "value", - "name": "getItem", - "docstrings": [], - "signature": "let getItem: (string, t) => option" - }, - { - "id": "Dom.Storage.setItem", - "kind": "value", - "name": "setItem", - "docstrings": [], - "signature": "let setItem: (string, string, t) => unit" - }, - { - "id": "Dom.Storage.removeItem", - "kind": "value", - "name": "removeItem", - "docstrings": [], - "signature": "let removeItem: (string, t) => unit" - }, - { - "id": "Dom.Storage.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Dom.Storage.key", - "kind": "value", - "name": "key", - "docstrings": [], - "signature": "let key: (int, t) => option" - }, - { - "id": "Dom.Storage.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int" - }, - { - "id": "Dom.Storage.localStorage", - "kind": "value", - "name": "localStorage", - "docstrings": [], - "signature": "let localStorage: t" - }, - { - "id": "Dom.Storage.sessionStorage", - "kind": "value", - "name": "sessionStorage", - "docstrings": [], - "signature": "let sessionStorage: t" - } - ] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v12.0.2/js.json b/apps/docs/data/api/v12.0.2/js.json deleted file mode 100644 index b6d50b8ef..000000000 --- a/apps/docs/data/api/v12.0.2/js.json +++ /dev/null @@ -1,12866 +0,0 @@ -{ - "js": { - "id": "Js", - "name": "Js", - "docstrings": [ - "The Js module mostly contains ReScript bindings to _standard JavaScript APIs_\nlike [console.log](https://developer.mozilla.org/en-US/docs/Web/API/Console/log),\nor the JavaScript\n[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String),\n[Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date), and\n[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\nclasses.\n\nIt is meant as a zero-abstraction interop layer and directly exposes JavaScript functions as they are. If you can find your API in this module, prefer this over an equivalent Belt helper. For example, prefer [Js.Array2](js/array2) over [Belt.Array](belt/array)\n\n## Argument Order\n\nFor historical reasons, some APIs in the Js namespace (e.g. [Js.String](js/string)) are\nusing the data-last argument order whereas others (e.g. [Js.Date](js/date)) are using data-first.\n\nFor more information about these argument orders and the trade-offs between them, see\n[this blog post](https://www.javierchavarri.com/data-first-and-data-last-a-comparison/).\n\n_Eventually, all modules in the Js namespace are going to be migrated to data-first though._\n\n## Js.Xxx2 Modules\n\nPrefer `Js.Array2` over `Js.Array`, `Js.String2` over `Js.String`, etc. The latters are old modules." - ], - "items": [ - { - "id": "Js.t", - "kind": "type", - "name": "t", - "docstrings": [ - "JS object type" - ], - "signature": "type t<'a> = 'a\n constraint 'a = {..}", - "deprecated": "This has been deprecated and will be removed in v13. Use the `{..}` type directly instead." - }, - { - "id": "Js.globalThis", - "kind": "value", - "name": "globalThis", - "docstrings": [ - "JS global object reference" - ], - "signature": "let globalThis: t<{..}>", - "deprecated": "" - }, - { - "id": "Js.null", - "kind": "type", - "name": "null", - "docstrings": [], - "signature": "@unboxed\ntype null<'a> = Js_null.t<'a> = Value('a) | @as(null) Null", - "deprecated": "" - }, - { - "id": "Js.undefined", - "kind": "type", - "name": "undefined", - "docstrings": [], - "signature": "type undefined<'a> = Js_undefined.t<'a>", - "deprecated": "This has been deprecated and will be removed in v13." - }, - { - "id": "Js.nullable", - "kind": "type", - "name": "nullable", - "docstrings": [], - "signature": "@unboxed\ntype nullable<'a> = Js_null_undefined.t<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined", - "deprecated": "" - }, - { - "id": "Js.null_undefined", - "kind": "type", - "name": "null_undefined", - "docstrings": [], - "signature": "type null_undefined<'a> = nullable<'a>", - "deprecated": "" - }, - { - "id": "Js.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [], - "signature": "let toOption: nullable<'a> => option<'a>" - }, - { - "id": "Js.undefinedToOption", - "kind": "value", - "name": "undefinedToOption", - "docstrings": [], - "signature": "let undefinedToOption: undefined<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.nullToOption", - "kind": "value", - "name": "nullToOption", - "docstrings": [], - "signature": "let nullToOption: null<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [], - "signature": "let isNullable: nullable<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.import", - "kind": "value", - "name": "import", - "docstrings": [], - "signature": "let import: 'a => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.testAny", - "kind": "value", - "name": "testAny", - "docstrings": [ - "The same as {!test} except that it is more permissive on the types of input" - ], - "signature": "let testAny: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.promise", - "kind": "type", - "name": "promise", - "docstrings": [ - "The promise type, defined here for interoperation across packages." - ], - "signature": "type promise<+'a, +'e>", - "deprecated": "This is deprecated and will be removed in v13. Use the `promise` type directly instead." - }, - { - "id": "Js.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The same as empty in `Js.Null`. Compiles to `null`." - ], - "signature": "let null: null<'a>", - "deprecated": "" - }, - { - "id": "Js.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The same as empty `Js.Undefined`. Compiles to `undefined`." - ], - "signature": "let undefined: undefined<'a>", - "deprecated": "" - }, - { - "id": "Js.typeof", - "kind": "value", - "name": "typeof", - "docstrings": [ - "`typeof x` will be compiled as `typeof x` in JS. Please consider functions in\n`Js.Types` for a type safe way of reflection." - ], - "signature": "let typeof: 'a => string", - "deprecated": "" - }, - { - "id": "Js.log", - "kind": "value", - "name": "log", - "docstrings": [ - "Equivalent to console.log any value." - ], - "signature": "let log: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.log2", - "kind": "value", - "name": "log2", - "docstrings": [], - "signature": "let log2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.log3", - "kind": "value", - "name": "log3", - "docstrings": [], - "signature": "let log3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.log4", - "kind": "value", - "name": "log4", - "docstrings": [], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.logMany", - "kind": "value", - "name": "logMany", - "docstrings": [ - "A convenience function to console.log more than 4 arguments" - ], - "signature": "let logMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.eqNull", - "kind": "value", - "name": "eqNull", - "docstrings": [], - "signature": "let eqNull: ('a, null<'a>) => bool", - "deprecated": "" - }, - { - "id": "Js.eqUndefined", - "kind": "value", - "name": "eqUndefined", - "docstrings": [], - "signature": "let eqUndefined: ('a, undefined<'a>) => bool", - "deprecated": "" - }, - { - "id": "Js.eqNullable", - "kind": "value", - "name": "eqNullable", - "docstrings": [], - "signature": "let eqNullable: ('a, nullable<'a>) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_lt", - "kind": "value", - "name": "unsafe_lt", - "docstrings": [ - "`unsafe_lt(a, b)` will be compiled as `a < b`.\n It is marked as unsafe, since it is impossible\n to give a proper semantics for comparision which applies to any type" - ], - "signature": "let unsafe_lt: ('a, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_le", - "kind": "value", - "name": "unsafe_le", - "docstrings": [ - "`unsafe_le(a, b)` will be compiled as `a <= b`.\n See also `Js.unsafe_lt`." - ], - "signature": "let unsafe_le: ('a, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_gt", - "kind": "value", - "name": "unsafe_gt", - "docstrings": [ - "`unsafe_gt(a, b)` will be compiled as `a > b`.\n See also `Js.unsafe_lt`." - ], - "signature": "let unsafe_gt: ('a, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_ge", - "kind": "value", - "name": "unsafe_ge", - "docstrings": [ - "`unsafe_ge(a, b)` will be compiled as `a >= b`.\n See also `Js.unsafe_lt`." - ], - "signature": "let unsafe_ge: ('a, 'a) => bool", - "deprecated": "" - } - ] - }, - "js/typedarray2/dataview": { - "id": "Js.TypedArray2.DataView", - "name": "DataView", - "docstrings": [ - "The DataView view provides a low-level interface for reading and writing\nmultiple number types in an ArrayBuffer irrespective of the platform's endianness.\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)" - ], - "items": [ - { - "id": "Js.TypedArray2.DataView.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Js.TypedArray2.DataView.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array_buffer => t" - }, - { - "id": "Js.TypedArray2.DataView.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.DataView.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [], - "signature": "let fromBufferOffset: (array_buffer, int) => t" - }, - { - "id": "Js.TypedArray2.DataView.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t" - }, - { - "id": "Js.TypedArray2.DataView.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.DataView.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.DataView.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt8", - "kind": "value", - "name": "getInt8", - "docstrings": [], - "signature": "let getInt8: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint8", - "kind": "value", - "name": "getUint8", - "docstrings": [], - "signature": "let getUint8: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt16", - "kind": "value", - "name": "getInt16", - "docstrings": [], - "signature": "let getInt16: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt16LittleEndian", - "kind": "value", - "name": "getInt16LittleEndian", - "docstrings": [], - "signature": "let getInt16LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint16", - "kind": "value", - "name": "getUint16", - "docstrings": [], - "signature": "let getUint16: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint16LittleEndian", - "kind": "value", - "name": "getUint16LittleEndian", - "docstrings": [], - "signature": "let getUint16LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt32", - "kind": "value", - "name": "getInt32", - "docstrings": [], - "signature": "let getInt32: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt32LittleEndian", - "kind": "value", - "name": "getInt32LittleEndian", - "docstrings": [], - "signature": "let getInt32LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint32", - "kind": "value", - "name": "getUint32", - "docstrings": [], - "signature": "let getUint32: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint32LittleEndian", - "kind": "value", - "name": "getUint32LittleEndian", - "docstrings": [], - "signature": "let getUint32LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getFloat32", - "kind": "value", - "name": "getFloat32", - "docstrings": [], - "signature": "let getFloat32: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.getFloat32LittleEndian", - "kind": "value", - "name": "getFloat32LittleEndian", - "docstrings": [], - "signature": "let getFloat32LittleEndian: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.getFloat64", - "kind": "value", - "name": "getFloat64", - "docstrings": [], - "signature": "let getFloat64: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.getFloat64LittleEndian", - "kind": "value", - "name": "getFloat64LittleEndian", - "docstrings": [], - "signature": "let getFloat64LittleEndian: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.setInt8", - "kind": "value", - "name": "setInt8", - "docstrings": [], - "signature": "let setInt8: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint8", - "kind": "value", - "name": "setUint8", - "docstrings": [], - "signature": "let setUint8: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt16", - "kind": "value", - "name": "setInt16", - "docstrings": [], - "signature": "let setInt16: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt16LittleEndian", - "kind": "value", - "name": "setInt16LittleEndian", - "docstrings": [], - "signature": "let setInt16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint16", - "kind": "value", - "name": "setUint16", - "docstrings": [], - "signature": "let setUint16: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint16LittleEndian", - "kind": "value", - "name": "setUint16LittleEndian", - "docstrings": [], - "signature": "let setUint16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt32", - "kind": "value", - "name": "setInt32", - "docstrings": [], - "signature": "let setInt32: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt32LittleEndian", - "kind": "value", - "name": "setInt32LittleEndian", - "docstrings": [], - "signature": "let setInt32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint32", - "kind": "value", - "name": "setUint32", - "docstrings": [], - "signature": "let setUint32: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint32LittleEndian", - "kind": "value", - "name": "setUint32LittleEndian", - "docstrings": [], - "signature": "let setUint32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat32", - "kind": "value", - "name": "setFloat32", - "docstrings": [], - "signature": "let setFloat32: (t, int, float) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat32LittleEndian", - "kind": "value", - "name": "setFloat32LittleEndian", - "docstrings": [], - "signature": "let setFloat32LittleEndian: (t, int, float) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat64", - "kind": "value", - "name": "setFloat64", - "docstrings": [], - "signature": "let setFloat64: (t, int, float) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat64LittleEndian", - "kind": "value", - "name": "setFloat64LittleEndian", - "docstrings": [], - "signature": "let setFloat64LittleEndian: (t, int, float) => unit" - } - ] - }, - "js/typedarray2/float64array": { - "id": "Js.TypedArray2.Float64Array", - "name": "Float64Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Float64Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.TypedArray2.Float64Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Float64Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Float64Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Float64Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Float64Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Float64Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Float64Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Float64Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/float32array": { - "id": "Js.TypedArray2.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Float32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.TypedArray2.Float32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Float32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Float32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Float32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Float32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Float32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Float32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Float32Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/uint32array": { - "id": "Js.TypedArray2.Uint32Array", - "name": "Uint32Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint32Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/int32array": { - "id": "Js.TypedArray2.Int32Array", - "name": "Int32Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Int32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Int32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Int32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Int32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Int32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Int32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Int32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Int32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Int32Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/uint16array": { - "id": "Js.TypedArray2.Uint16Array", - "name": "Uint16Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t" - }, - { - "id": "Js.TypedArray2.Uint16Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t" - }, - { - "id": "Js.TypedArray2.Uint16Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>" - }, - { - "id": "Js.TypedArray2.Uint16Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b" - }, - { - "id": "Js.TypedArray2.Uint16Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b" - }, - { - "id": "Js.TypedArray2.Uint16Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b" - }, - { - "id": "Js.TypedArray2.Uint16Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/int16array": { - "id": "Js.TypedArray2.Int16Array", - "name": "Int16Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Int16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Int16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Int16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Int16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Int16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Int16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Int16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Int16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Int16Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int" - }, - { - "id": "Js.TypedArray2.Int16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t" - }, - { - "id": "Js.TypedArray2.Int16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t" - } - ] - }, - "js/typedarray2/uint8clampedarray": { - "id": "Js.TypedArray2.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint8ClampedArray.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/uint8array": { - "id": "Js.TypedArray2.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint8Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t" - }, - { - "id": "Js.TypedArray2.Uint8Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/int8array": { - "id": "Js.TypedArray2.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Int8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Int8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Int8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Int8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Int8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Int8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Int8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Int8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Int8Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Int8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/arraybuffer": { - "id": "Js.TypedArray2.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [ - "The underlying buffer that the typed arrays provide views of\n\n **see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)" - ], - "items": [ - { - "id": "Js.TypedArray2.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = array_buffer" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.make", - "kind": "value", - "name": "make", - "docstrings": [ - "takes length. initializes elements to 0" - ], - "signature": "let make: int => t" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (t, ~start: int, ~end_: int) => array_buffer", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => array_buffer", - "deprecated": "" - } - ] - }, - "js/typed_array/dataview": { - "id": "Js.Typed_array.DataView", - "name": "DataView", - "docstrings": [ - "The DataView view provides a low-level interface for reading and writing\nmultiple number types in an ArrayBuffer irrespective of the platform's endianness.\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)" - ], - "items": [ - { - "id": "Js.Typed_array.DataView.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Js_typed_array2.DataView.t" - }, - { - "id": "Js.Typed_array.DataView.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array_buffer => t" - }, - { - "id": "Js.Typed_array.DataView.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.DataView.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [], - "signature": "let fromBufferOffset: (array_buffer, int) => t" - }, - { - "id": "Js.Typed_array.DataView.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t" - }, - { - "id": "Js.Typed_array.DataView.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.DataView.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.DataView.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.DataView.getInt8", - "kind": "value", - "name": "getInt8", - "docstrings": [], - "signature": "let getInt8: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint8", - "kind": "value", - "name": "getUint8", - "docstrings": [], - "signature": "let getUint8: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt16", - "kind": "value", - "name": "getInt16", - "docstrings": [], - "signature": "let getInt16: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt16LittleEndian", - "kind": "value", - "name": "getInt16LittleEndian", - "docstrings": [], - "signature": "let getInt16LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint16", - "kind": "value", - "name": "getUint16", - "docstrings": [], - "signature": "let getUint16: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint16LittleEndian", - "kind": "value", - "name": "getUint16LittleEndian", - "docstrings": [], - "signature": "let getUint16LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt32", - "kind": "value", - "name": "getInt32", - "docstrings": [], - "signature": "let getInt32: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt32LittleEndian", - "kind": "value", - "name": "getInt32LittleEndian", - "docstrings": [], - "signature": "let getInt32LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint32", - "kind": "value", - "name": "getUint32", - "docstrings": [], - "signature": "let getUint32: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint32LittleEndian", - "kind": "value", - "name": "getUint32LittleEndian", - "docstrings": [], - "signature": "let getUint32LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getFloat32", - "kind": "value", - "name": "getFloat32", - "docstrings": [], - "signature": "let getFloat32: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.getFloat32LittleEndian", - "kind": "value", - "name": "getFloat32LittleEndian", - "docstrings": [], - "signature": "let getFloat32LittleEndian: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.getFloat64", - "kind": "value", - "name": "getFloat64", - "docstrings": [], - "signature": "let getFloat64: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.getFloat64LittleEndian", - "kind": "value", - "name": "getFloat64LittleEndian", - "docstrings": [], - "signature": "let getFloat64LittleEndian: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.setInt8", - "kind": "value", - "name": "setInt8", - "docstrings": [], - "signature": "let setInt8: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint8", - "kind": "value", - "name": "setUint8", - "docstrings": [], - "signature": "let setUint8: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt16", - "kind": "value", - "name": "setInt16", - "docstrings": [], - "signature": "let setInt16: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt16LittleEndian", - "kind": "value", - "name": "setInt16LittleEndian", - "docstrings": [], - "signature": "let setInt16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint16", - "kind": "value", - "name": "setUint16", - "docstrings": [], - "signature": "let setUint16: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint16LittleEndian", - "kind": "value", - "name": "setUint16LittleEndian", - "docstrings": [], - "signature": "let setUint16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt32", - "kind": "value", - "name": "setInt32", - "docstrings": [], - "signature": "let setInt32: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt32LittleEndian", - "kind": "value", - "name": "setInt32LittleEndian", - "docstrings": [], - "signature": "let setInt32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint32", - "kind": "value", - "name": "setUint32", - "docstrings": [], - "signature": "let setUint32: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint32LittleEndian", - "kind": "value", - "name": "setUint32LittleEndian", - "docstrings": [], - "signature": "let setUint32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat32", - "kind": "value", - "name": "setFloat32", - "docstrings": [], - "signature": "let setFloat32: (t, int, float) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat32LittleEndian", - "kind": "value", - "name": "setFloat32LittleEndian", - "docstrings": [], - "signature": "let setFloat32LittleEndian: (t, int, float) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat64", - "kind": "value", - "name": "setFloat64", - "docstrings": [], - "signature": "let setFloat64: (t, int, float) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat64LittleEndian", - "kind": "value", - "name": "setFloat64LittleEndian", - "docstrings": [], - "signature": "let setFloat64LittleEndian: (t, int, float) => unit" - } - ] - }, - "js/typed_array/float64_array": { - "id": "Js.Typed_array.Float64_array", - "name": "Float64_array", - "docstrings": [], - "items": [] - }, - "js/typed_array/float64array": { - "id": "Js.Typed_array.Float64Array", - "name": "Float64Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Float64Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.Typed_array.Float64Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Float64Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Float64Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Float64Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Float64Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Float64Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Float64Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Float64Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Float64Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.create", - "kind": "value", - "name": "create", - "docstrings": [], - "signature": "let create: array => t", - "deprecated": "use `make` instead" - }, - { - "id": "Js.Typed_array.Float64Array.of_buffer", - "kind": "value", - "name": "of_buffer", - "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" - } - ] - }, - "js/typed_array/float32_array": { - "id": "Js.Typed_array.Float32_array", - "name": "Float32_array", - "docstrings": [], - "items": [] - }, - "js/typed_array/float32array": { - "id": "Js.Typed_array.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Float32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.Typed_array.Float32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Float32Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Float32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Float32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Float32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Float32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Float32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Float32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Float32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.create", - "kind": "value", - "name": "create", - "docstrings": [], - "signature": "let create: array => t", - "deprecated": "use `make` instead" - }, - { - "id": "Js.Typed_array.Float32Array.of_buffer", - "kind": "value", - "name": "of_buffer", - "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" - } - ] - }, - "js/typed_array/uint32array": { - "id": "Js.Typed_array.Uint32Array", - "name": "Uint32Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint32Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/int32_array": { - "id": "Js.Typed_array.Int32_array", - "name": "Int32_array", - "docstrings": [], - "items": [] - }, - "js/typed_array/int32array": { - "id": "Js.Typed_array.Int32Array", - "name": "Int32Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Int32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Int32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int32Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Int32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Int32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Int32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Int32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Int32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Int32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Int32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.create", - "kind": "value", - "name": "create", - "docstrings": [], - "signature": "let create: array => t", - "deprecated": "use `make` instead" - }, - { - "id": "Js.Typed_array.Int32Array.of_buffer", - "kind": "value", - "name": "of_buffer", - "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" - } - ] - }, - "js/typed_array/uint16array": { - "id": "Js.Typed_array.Uint16Array", - "name": "Uint16Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint16Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/int16array": { - "id": "Js.Typed_array.Int16Array", - "name": "Int16Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Int16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Int16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int16Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Int16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Int16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Int16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Int16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Int16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Int16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Int16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/uint8clampedarray": { - "id": "Js.Typed_array.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint8ClampedArray.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint8ClampedArray.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/uint8array": { - "id": "Js.Typed_array.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint8Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.Uint8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/int8array": { - "id": "Js.Typed_array.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Int8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Int8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int8Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Int8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Int8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Int8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Int8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Int8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Int8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Int8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "Use `TypedArray.slice` instead." - }, - { - "id": "Js.Typed_array.Int8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "Use `TypedArray.sliceToEnd` instead." - }, - { - "id": "Js.Typed_array.Int8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.Int8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "throw Js.Exn.Error throw Js exception\n\n param offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "throw Js.Exn.Error throws Js exception\n\n param offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/s": { - "id": "Js.Typed_array.S", - "name": "S", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.S.elt", - "kind": "type", - "name": "elt", - "docstrings": [], - "signature": "type elt" - }, - { - "id": "Js.Typed_array.S.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.Typed_array.S.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.S.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.S.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.S.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.S.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.S.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.S.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int" - }, - { - "id": "Js.Typed_array.S.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t" - }, - { - "id": "Js.Typed_array.S.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: elt => bool", - "deprecated": "" - }, - { - "id": "Js.Typed_array.S.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "should we use `bool` or `boolean` seems they are intechangeable here" - ], - "signature": "let filter: (elt => bool) => t" - } - ] - }, - "js/typed_array/arraybuffer": { - "id": "Js.Typed_array.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [ - "The underlying buffer that the typed arrays provide views of\n\n **see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)" - ], - "items": [ - { - "id": "Js.Typed_array.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = array_buffer" - }, - { - "id": "Js.Typed_array.ArrayBuffer.make", - "kind": "value", - "name": "make", - "docstrings": [ - "takes length. initializes elements to 0" - ], - "signature": "let make: int => t" - }, - { - "id": "Js.Typed_array.ArrayBuffer.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - } - ] - }, - "js/typed_array/type": { - "id": "Js.Typed_array.Type", - "name": "Type", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Type.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - } - ] - }, - "js/json/kind": { - "id": "Js.Json.Kind", - "name": "Kind", - "docstrings": [], - "items": [ - { - "id": "Js.Json.Kind.json", - "kind": "type", - "name": "json", - "docstrings": [], - "signature": "type json = t" - }, - { - "id": "Js.Json.Kind.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Underlying type of a JSON value" - ], - "signature": "type t<_> =\n | String: t\n | Number: t\n | Object: t>\n | Array: t>\n | Boolean: t\n | Null: t" - } - ] - }, - "js/weakmap": { - "id": "Js.WeakMap", - "name": "WeakMap", - "docstrings": [ - "Provides bindings for ES6 WeakMap", - "ES6 WeakMap API" - ], - "items": [ - { - "id": "Js.WeakMap.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v> = WeakMap.t<'k, 'v>", - "deprecated": "" - } - ] - }, - "js/map": { - "id": "Js.Map", - "name": "Map", - "docstrings": [ - "Provides bindings for ES6 Map", - "ES6 Map API" - ], - "items": [ - { - "id": "Js.Map.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v> = Map.t<'k, 'v>", - "deprecated": "" - } - ] - }, - "js/weakset": { - "id": "Js.WeakSet", - "name": "WeakSet", - "docstrings": [ - "Provides bindings for ES6 WeakSet", - "ES6 WeakSet API" - ], - "items": [ - { - "id": "Js.WeakSet.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = WeakSet.t<'a>", - "deprecated": "" - } - ] - }, - "js/set": { - "id": "Js.Set", - "name": "Set", - "docstrings": [ - "Provides bindings for ES6 Set", - "ES6 Set API" - ], - "items": [ - { - "id": "Js.Set.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = Set.t<'a>", - "deprecated": "" - } - ] - }, - "js/console": { - "id": "Js.Console", - "name": "Console", - "docstrings": [ - "Provides bindings for console" - ], - "items": [ - { - "id": "Js.Console.log", - "kind": "value", - "name": "log", - "docstrings": [], - "signature": "let log: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.log2", - "kind": "value", - "name": "log2", - "docstrings": [], - "signature": "let log2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.log3", - "kind": "value", - "name": "log3", - "docstrings": [], - "signature": "let log3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.log4", - "kind": "value", - "name": "log4", - "docstrings": [], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.logMany", - "kind": "value", - "name": "logMany", - "docstrings": [], - "signature": "let logMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info", - "kind": "value", - "name": "info", - "docstrings": [], - "signature": "let info: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info2", - "kind": "value", - "name": "info2", - "docstrings": [], - "signature": "let info2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info3", - "kind": "value", - "name": "info3", - "docstrings": [], - "signature": "let info3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info4", - "kind": "value", - "name": "info4", - "docstrings": [], - "signature": "let info4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.infoMany", - "kind": "value", - "name": "infoMany", - "docstrings": [], - "signature": "let infoMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn", - "kind": "value", - "name": "warn", - "docstrings": [], - "signature": "let warn: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn2", - "kind": "value", - "name": "warn2", - "docstrings": [], - "signature": "let warn2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn3", - "kind": "value", - "name": "warn3", - "docstrings": [], - "signature": "let warn3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn4", - "kind": "value", - "name": "warn4", - "docstrings": [], - "signature": "let warn4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warnMany", - "kind": "value", - "name": "warnMany", - "docstrings": [], - "signature": "let warnMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error", - "kind": "value", - "name": "error", - "docstrings": [], - "signature": "let error: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error2", - "kind": "value", - "name": "error2", - "docstrings": [], - "signature": "let error2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error3", - "kind": "value", - "name": "error3", - "docstrings": [], - "signature": "let error3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error4", - "kind": "value", - "name": "error4", - "docstrings": [], - "signature": "let error4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.errorMany", - "kind": "value", - "name": "errorMany", - "docstrings": [], - "signature": "let errorMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.trace", - "kind": "value", - "name": "trace", - "docstrings": [], - "signature": "let trace: unit => unit", - "deprecated": "" - }, - { - "id": "Js.Console.timeStart", - "kind": "value", - "name": "timeStart", - "docstrings": [], - "signature": "let timeStart: string => unit", - "deprecated": "" - }, - { - "id": "Js.Console.timeEnd", - "kind": "value", - "name": "timeEnd", - "docstrings": [], - "signature": "let timeEnd: string => unit", - "deprecated": "" - }, - { - "id": "Js.Console.table", - "kind": "value", - "name": "table", - "docstrings": [], - "signature": "let table: 'a => unit", - "deprecated": "" - } - ] - }, - "js/result": { - "id": "Js.Result", - "name": "Result", - "docstrings": [ - "Define the interface for result" - ], - "items": [ - { - "id": "Js.Result.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'good, 'bad> = Ok('good) | Error('bad)", - "deprecated": "" - } - ] - }, - "js/option": { - "id": "Js.Option", - "name": "Option", - "docstrings": [ - "Provide utilities for option" - ], - "items": [ - { - "id": "Js.Option.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = option<'a>", - "deprecated": "" - }, - { - "id": "Js.Option.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: 'a => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Option.isSome", - "kind": "value", - "name": "isSome", - "docstrings": [], - "signature": "let isSome: option<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Option.isSomeValue", - "kind": "value", - "name": "isSomeValue", - "docstrings": [], - "signature": "let isSomeValue: (('a, 'a) => bool, 'a, option<'a>) => bool", - "deprecated": "Use `Option.equal` instead." - }, - { - "id": "Js.Option.isNone", - "kind": "value", - "name": "isNone", - "docstrings": [], - "signature": "let isNone: option<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Option.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: option<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Option.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (('a, 'b) => bool, option<'a>, option<'b>) => bool", - "deprecated": "" - }, - { - "id": "Js.Option.andThen", - "kind": "value", - "name": "andThen", - "docstrings": [], - "signature": "let andThen: ('a => option<'b>, option<'a>) => option<'b>", - "deprecated": "" - }, - { - "id": "Js.Option.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: ('a => 'b, option<'a>) => option<'b>", - "deprecated": "" - }, - { - "id": "Js.Option.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: ('a, option<'a>) => 'a", - "deprecated": "" - }, - { - "id": "Js.Option.default", - "kind": "value", - "name": "default", - "docstrings": [], - "signature": "let default: ('a, option<'a>) => 'a", - "deprecated": "" - }, - { - "id": "Js.Option.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: ('a => bool, option<'a>) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Option.firstSome", - "kind": "value", - "name": "firstSome", - "docstrings": [], - "signature": "let firstSome: (option<'a>, option<'a>) => option<'a>", - "deprecated": "" - } - ] - }, - "js/blob": { - "id": "Js.Blob", - "name": "Blob", - "docstrings": [ - "Provide utilities for Blob", - "JavaScript Blob API" - ], - "items": [ - { - "id": "Js.Blob.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - } - ] - }, - "js/file": { - "id": "Js.File", - "name": "File", - "docstrings": [ - "Provide utilities for File", - "JavaScript File API" - ], - "items": [ - { - "id": "Js.File.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - } - ] - }, - "js/bigint": { - "id": "Js.BigInt", - "name": "BigInt", - "docstrings": [ - "Provide utilities for bigint", - "JavaScript BigInt API" - ], - "items": [ - { - "id": "Js.BigInt.fromStringExn", - "kind": "value", - "name": "fromStringExn", - "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Return the\nnumber as a `bigint` if successfully parsed. Uncaught syntax exception otherwise.\n\n## Examples\n\n```rescript\n/* returns 123n */\nJs.BigInt.fromStringExn(\"123\")\n\n/* returns 0n */\nJs.BigInt.fromStringExn(\"\")\n\n/* returns 17n */\nJs.BigInt.fromStringExn(\"0x11\")\n\n/* returns 3n */\nJs.BigInt.fromStringExn(\"0b11\")\n\n/* returns 9n */\nJs.BigInt.fromStringExn(\"0o11\")\n\n/* catch exception */\ntry {\n Js.BigInt.fromStringExn(\"a\")\n} catch {\n| _ => Console.error(\"Error parsing bigint\")\n}\n```" - ], - "signature": "let fromStringExn: string => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.~-", - "kind": "value", - "name": "~-", - "docstrings": [], - "signature": "let ~-: bigint => bigint" - }, - { - "id": "Js.BigInt.~+", - "kind": "value", - "name": "~+", - "docstrings": [], - "signature": "let ~+: bigint => bigint" - }, - { - "id": "Js.BigInt.+", - "kind": "value", - "name": "+", - "docstrings": [], - "signature": "let +: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.-", - "kind": "value", - "name": "-", - "docstrings": [], - "signature": "let -: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.*", - "kind": "value", - "name": "*", - "docstrings": [], - "signature": "let *: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt./", - "kind": "value", - "name": "/", - "docstrings": [], - "signature": "let /: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.mod", - "kind": "value", - "name": "mod", - "docstrings": [], - "signature": "let mod: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.**", - "kind": "value", - "name": "**", - "docstrings": [], - "signature": "let **: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.land", - "kind": "value", - "name": "land", - "docstrings": [], - "signature": "let land: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lor", - "kind": "value", - "name": "lor", - "docstrings": [], - "signature": "let lor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lxor", - "kind": "value", - "name": "lxor", - "docstrings": [], - "signature": "let lxor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lnot", - "kind": "value", - "name": "lnot", - "docstrings": [], - "signature": "let lnot: bigint => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lsl", - "kind": "value", - "name": "lsl", - "docstrings": [], - "signature": "let lsl: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.asr", - "kind": "value", - "name": "asr", - "docstrings": [], - "signature": "let asr: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats a `bigint` as a string. Return a `string` representing the given value.\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123\" */\nJs.BigInt.toString(123n)->Js.log\n```" - ], - "signature": "let toString: bigint => string", - "deprecated": "" - }, - { - "id": "Js.BigInt.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Returns a string with a language-sensitive representation of this BigInt value.\n\n## Examples\n\n```rescript\n/* prints \"123\" */\nJs.BigInt.toString(123n)->Js.log\n```" - ], - "signature": "let toLocaleString: bigint => string", - "deprecated": "" - } - ] - }, - "js/int": { - "id": "Js.Int", - "name": "Int", - "docstrings": [ - "Provide utilities for int", - "Provide utilities for handling `int`." - ], - "items": [ - { - "id": "Js.Int.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "Formats an `int` using exponential (scientific) notation.\nReturns a `string` representing the given value in exponential notation.\nThrows `RangeError` if digits is not in the range \\[0, 20\\] (inclusive).\n\nSee [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.7e+1\" */\nJs.log(Js.Int.toExponential(77))\n```" - ], - "signature": "let toExponential: int => string", - "deprecated": "" - }, - { - "id": "Js.Int.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "Formats an `int` using exponential (scientific) notation.\n`digits` specifies how many digits should appear after the decimal point. The value must be in the range \\[0, 20\\] (inclusive).\n\nReturns a `string` representing the given value in exponential notation.\n\nThe output will be rounded or padded with zeroes if necessary.\nThrows `RangeError` if `digits` is not in the range \\[0, 20\\] (inclusive).\n\nSee [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.70e+1\" */\nJs.log(Js.Int.toExponentialWithPrecision(77, ~digits=2))\n\n/* prints \"5.68e+3\" */\nJs.log(Js.Int.toExponentialWithPrecision(5678, ~digits=2))\n```" - ], - "signature": "let toExponentialWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Int.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "Formats an `int` using some fairly arbitrary rules.\nReturns a `string` representing the given value in fixed-point (usually).\n\n`toPrecision` differs from `toFixed` in that the former will format the number with full precision, while the latter will not output any digits after the decimal point.\nThrows `RangeError` if `digits` is not in the range accepted by this function.\n\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123456789\" */\nJs.log(Js.Int.toPrecision(123456789))\n```" - ], - "signature": "let toPrecision: int => string", - "deprecated": "" - }, - { - "id": "Js.Int.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "Formats an `int` using some fairly arbitrary rules.\n`digits` specifies how many digits should appear in total. The value must between 0 and some arbitrary number that's hopefully at least larger than 20 (for Node it's 21. Why? Who knows).\n\nReturns a `string` representing the given value in fixed-point or scientific notation.\n\nThe output will be rounded or padded with zeroes if necessary.\n\n`toPrecisionWithPrecision` differs from `toFixedWithPrecision` in that the former will count all digits against the precision, while the latter will count only the digits after the decimal point.\n`toPrecisionWithPrecision` will also use scientific notation if the specified precision is less than the number of digits before the decimal point.\nThrows `RangeError` if `digits` is not in the range accepted by this function.\n\n\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"1.2e+8\" */\nJs.log(Js.Int.toPrecisionWithPrecision(123456789, ~digits=2))\n\n/* prints \"0.0\" */\nJs.log(Js.Int.toPrecisionWithPrecision(0, ~digits=2))\n```" - ], - "signature": "let toPrecisionWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Int.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats an `int` as a `string`. Returns a `string` representing the given value\nin fixed-point (usually).\n\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123456789\" */\nJs.log(Js.Int.toString(123456789))\n```" - ], - "signature": "let toString: int => string", - "deprecated": "" - }, - { - "id": "Js.Int.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "Formats an `int` as a `string`. `radix` specifies the radix base to use for the\nformatted number. The value must be in the range \\[2, 36\\] (inclusive). Returns\na `string` representing the given value in fixed-point (usually). Throws\n`RangeError` if `radix` is not in the range \\[2, 36\\] (inclusive).\n\n\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"110\" */\nJs.log(Js.Int.toStringWithRadix(6, ~radix=2))\n\n/* prints \"deadbeef\" */\nJs.log(Js.Int.toStringWithRadix(3735928559, ~radix=16))\n\n/* prints \"2n9c\" */\nJs.log(Js.Int.toStringWithRadix(123456, ~radix=36))\n```" - ], - "signature": "let toStringWithRadix: (int, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Js.Int.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [], - "signature": "let toFloat: int => float", - "deprecated": "" - }, - { - "id": "Js.Int.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (int, int) => bool", - "deprecated": "" - }, - { - "id": "Js.Int.max", - "kind": "value", - "name": "max", - "docstrings": [], - "signature": "let max: int" - }, - { - "id": "Js.Int.min", - "kind": "value", - "name": "min", - "docstrings": [], - "signature": "let min: int" - } - ] - }, - "js/float": { - "id": "Js.Float", - "name": "Float", - "docstrings": [ - "Provide utilities for JS float", - "Provide utilities for JS float." - ], - "items": [ - { - "id": "Js.Float._NaN", - "kind": "value", - "name": "_NaN", - "docstrings": [ - "The special value \"Not a Number\". See [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN) on MDN." - ], - "signature": "let _NaN: float", - "deprecated": "" - }, - { - "id": "Js.Float.isNaN", - "kind": "value", - "name": "isNaN", - "docstrings": [ - "Tests if the given value is `_NaN`\n\nNote that both `_NaN = _NaN` and `_NaN == _NaN` will return `false`. `isNaN` is\ntherefore necessary to test for `_NaN`. Return `true` if the given value is\n`_NaN`, `false` otherwise. See [`isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) on MDN." - ], - "signature": "let isNaN: float => bool", - "deprecated": "" - }, - { - "id": "Js.Float.isFinite", - "kind": "value", - "name": "isFinite", - "docstrings": [ - "Tests if the given value is finite. Return `true` if the given value is a finite\nnumber, `false` otherwise. See [`isFinite`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite) on MDN.\n\n## Examples\n\n```rescript\n/* returns [false] */\nJs.Float.isFinite(infinity)\n\n/* returns [false] */\nJs.Float.isFinite(neg_infinity)\n\n/* returns [false] */\nJs.Float.isFinite(Js.Float._NaN)\n\n/* returns [true] */\nJs.Float.isFinite(1234.)\n```" - ], - "signature": "let isFinite: float => bool", - "deprecated": "" - }, - { - "id": "Js.Float.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "Formats a `float` using exponential (scientific) notation. Return a\n`string` representing the given value in exponential notation. Throw\nRangeError if digits is not in the range \\[0, 20\\] (inclusive). See [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.71234e+1\" */\nJs.Float.toExponential(77.1234)->Js.log\n\n/* prints \"7.7e+1\" */\nJs.Float.toExponential(77.)->Js.log\n```" - ], - "signature": "let toExponential: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "Formats a `float` using exponential (scientific) notation. `digits` specifies\nhow many digits should appear after the decimal point. The value must be in\nthe range \\[0, 20\\] (inclusive). Return a `string` representing the given value\nin exponential notation. The output will be rounded or padded with zeroes if\nnecessary. Throw RangeError if `digits` is not in the range \\[0, 20\\] (inclusive).\nSee [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.71e+1\" */\nJs.Float.toExponentialWithPrecision(77.1234, ~digits=2)->Js.log\n```" - ], - "signature": "let toExponentialWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.toFixed", - "kind": "value", - "name": "toFixed", - "docstrings": [ - "Formats a `float` using fixed point notation. Return a `string` representing the\ngiven value in fixed-point notation (usually). Throw RangeError if digits is not\nin the range \\[0, 20\\] (inclusive). See [`toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"12346\" (note the rounding) */\nJs.Float.toFixed(12345.6789)->Js.log\n\n/* print \"1.2e+21\" */\nJs.Float.toFixed(1.2e21)->Js.log\n```" - ], - "signature": "let toFixed: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toFixedWithPrecision", - "kind": "value", - "name": "toFixedWithPrecision", - "docstrings": [ - "Formats a `float` using fixed point notation. `digits` specifies how many digits\nshould appear after the decimal point. The value must be in the range \\[0, 20\\]\n(inclusive). Defaults to `0`. Return a `string` representing the given value in\nfixed-point notation (usually). See [`toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\nThe output will be rounded or padded with zeroes if necessary.\n\nThrow RangeError if digits is not in the range \\[0, 20\\] (inclusive)\n\n## Examples\n\n```rescript\n/* prints \"12345.7\" (note the rounding) */\nJs.Float.toFixedWithPrecision(12345.6789, ~digits=1)->Js.log\n\n/* prints \"0.00\" (note the added zeroes) */\nJs.Float.toFixedWithPrecision(0., ~digits=2)->Js.log\n```" - ], - "signature": "let toFixedWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "Formats a `float` using some fairly arbitrary rules. Return a `string`\nrepresenting the given value in fixed-point (usually). `toPrecision` differs\nfrom `Js.Float.toFixed` in that the former will format the number with full\nprecision, while the latter will not output any digits after the decimal point.\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\nThrow RangeError if digits is not in the range accepted by this function (what do you mean \"vague\"?)\n\n## Examples\n\n```rescript\n/* prints \"12345.6789\" */\nJs.Float.toPrecision(12345.6789)->Js.log\n\n/* print \"1.2e+21\" */\nJs.Float.toPrecision(1.2e21)->Js.log\n```" - ], - "signature": "let toPrecision: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "Formats a `float` using some fairly arbitrary rules. `digits` specifies how many\ndigits should appear in total. The value must between 0 and some arbitrary number\nthat's hopefully at least larger than 20 (for Node it's 21. Why? Who knows).\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\nReturn a `string` representing the given value in fixed-point or scientific\nnotation. The output will be rounded or padded with zeroes if necessary.\n\n`toPrecisionWithPrecision` differs from `toFixedWithPrecision` in that the former\nwill count all digits against the precision, while the latter will count only\nthe digits after the decimal point. `toPrecisionWithPrecision` will also use\nscientific notation if the specified precision is less than the number for digits\nbefore the decimal point.\n\nThrow RangeError if digits is not in the range accepted by this function (what do you mean \"vague\"?)\n\n## Examples\n\n```rescript\n/* prints \"1e+4\" */\nJs.Float.toPrecisionWithPrecision(12345.6789, ~digits=1)->Js.log\n\n/* prints \"0.0\" */\nJs.Float.toPrecisionWithPrecision(0., ~digits=2)->Js.log\n```" - ], - "signature": "let toPrecisionWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats a `float` as a string. Return a `string` representing the given value in\nfixed-point (usually). See [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"12345.6789\" */\nJs.Float.toString(12345.6789)->Js.log\n```" - ], - "signature": "let toString: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "Formats a `float` as a string. `radix` specifies the radix base to use for the\nformatted number. The value must be in the range \\[2, 36\\] (inclusive). Return a\n`string` representing the given value in fixed-point (usually). See [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\nThrow RangeError if radix is not in the range \\[2, 36\\] (inclusive)\n\n## Examples\n\n```rescript\n/* prints \"110\" */\nJs.Float.toStringWithRadix(6., ~radix=2)->Js.log\n\n/* prints \"11.001000111101011100001010001111010111000010100011111\" */\nJs.Float.toStringWithRadix(3.14, ~radix=2)->Js.log\n\n/* prints \"deadbeef\" */\nJs.Float.toStringWithRadix(3735928559., ~radix=16)->Js.log\n\n/* prints \"3f.gez4w97ry0a18ymf6qadcxr\" */\nJs.Float.toStringWithRadix(123.456, ~radix=36)->Js.log\n```" - ], - "signature": "let toStringWithRadix: (float, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Parses the given `string` into a `float` using JavaScript semantics. Return the\nnumber as a `float` if successfully parsed, `_NaN` otherwise.\n\n## Examples\n\n```rescript\n/* returns 123 */\nJs.Float.fromString(\"123\")\n\n/* returns 12.3 */\nJs.Float.fromString(\"12.3\")\n\n/* returns 0 */\nJs.Float.fromString(\"\")\n\n/* returns 17 */\nJs.Float.fromString(\"0x11\")\n\n/* returns 3 */\nJs.Float.fromString(\"0b11\")\n\n/* returns 9 */\nJs.Float.fromString(\"0o11\")\n\n/* returns [_NaN] */\nJs.Float.fromString(\"hello\")\n\n/* returns [_NaN] */\nJs.Float.fromString(\"100a\")\n```" - ], - "signature": "let fromString: string => float", - "deprecated": "" - } - ] - }, - "js/types": { - "id": "Js.Types", - "name": "Types", - "docstrings": [ - "Provide utilities for manipulating JS types", - "Provide utilities for manipulating JS types." - ], - "items": [ - { - "id": "Js.Types.symbol", - "kind": "type", - "name": "symbol", - "docstrings": [ - "Js symbol type (only available in ES6)" - ], - "signature": "type symbol = Symbol.t", - "deprecated": "" - }, - { - "id": "Js.Types.obj_val", - "kind": "type", - "name": "obj_val", - "docstrings": [], - "signature": "type obj_val = \\\"Type.Classify\".object", - "deprecated": "" - }, - { - "id": "Js.Types.undefined_val", - "kind": "type", - "name": "undefined_val", - "docstrings": [ - "This type has only one value `undefined`" - ], - "signature": "type undefined_val", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.null_val", - "kind": "type", - "name": "null_val", - "docstrings": [ - "This type has only one value `null`" - ], - "signature": "type null_val", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.function_val", - "kind": "type", - "name": "function_val", - "docstrings": [], - "signature": "type function_val = \\\"Type.Classify\".function", - "deprecated": "" - }, - { - "id": "Js.Types.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<_> =\n | Undefined: t\n | Null: t\n | Boolean: t\n | Number: t\n | String: t\n | Function: t\n | Object: t\n | Symbol: t\n | BigInt: t", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.test", - "kind": "value", - "name": "test", - "docstrings": [ - "`test(value, t)` returns `true` if `value` is `typeof t`, otherwise `false`.\nThis is useful for doing runtime reflection on any given value.\n\n## Examples\n\n```rescript\ntest(\"test\", String) == true\ntest(() => true, Function) == true\ntest(\"test\", Boolean) == false\n```" - ], - "signature": "let test: ('a, t<'b>) => bool", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.tagged_t", - "kind": "type", - "name": "tagged_t", - "docstrings": [], - "signature": "type tagged_t =\n | JSFalse\n | JSTrue\n | JSNull\n | JSUndefined\n | JSNumber(float)\n | JSString(string)\n | JSFunction(function_val)\n | JSObject(obj_val)\n | JSSymbol(symbol)\n | JSBigInt(bigint)", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.classify", - "kind": "value", - "name": "classify", - "docstrings": [], - "signature": "let classify: 'a => tagged_t", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - } - ] - }, - "js/typedarray2": { - "id": "Js.TypedArray2", - "name": "TypedArray2", - "docstrings": [ - "Provide bindings for JS typed array", - "JavaScript Typed Array API\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)" - ], - "items": [ - { - "id": "Js.TypedArray2.array_buffer", - "kind": "type", - "name": "array_buffer", - "docstrings": [], - "signature": "type array_buffer = ArrayBuffer.t" - }, - { - "id": "Js.TypedArray2.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [], - "signature": "type array_like<'a>" - } - ] - }, - "js/typed_array": { - "id": "Js.Typed_array", - "name": "Typed_array", - "docstrings": [ - "Provide bindings for JS typed array", - "JavaScript Typed Array API\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)" - ], - "items": [ - { - "id": "Js.Typed_array.array_buffer", - "kind": "type", - "name": "array_buffer", - "docstrings": [], - "signature": "type array_buffer = Js_typed_array2.array_buffer", - "deprecated": "" - }, - { - "id": "Js.Typed_array.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [], - "signature": "type array_like<'a> = Js_typed_array2.array_like<'a>", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `TypedArray` module instead." - } - ] - }, - "js/obj": { - "id": "Js.Obj", - "name": "Obj", - "docstrings": [ - "Provide utilities for `Js.t`", - "Provides functions for inspecting and manipulating native JavaScript objects" - ], - "items": [ - { - "id": "Js.Obj.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "`empty()` returns the empty object `{}`" - ], - "signature": "let empty: unit => {..}", - "deprecated": "" - }, - { - "id": "Js.Obj.assign", - "kind": "value", - "name": "assign", - "docstrings": [ - "`assign(target, source)` copies properties from source to target.\nProperties in `target` will be overwritten by properties in `source` if they have the same key.\nReturns `target`.\n\n**See** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\n\n## Examples\n\n```rescript\n/* Copy an object */\n\nlet obj = {\"a\": 1}\n\nlet copy = Js.Obj.assign(Js.Obj.empty(), obj)\n\n/* prints \"{ a: 1 }\" */\nJs.log(copy)\n\n/* Merge objects with same properties */\n\nlet target = {\"a\": 1, \"b\": 1}\nlet source = {\"b\": 2}\n\nlet obj = Js.Obj.assign(target, source)\n\n/* prints \"{ a: 1, b: 2 }\" */\nJs.log(obj)\n\n/* prints \"{ a: 1, b: 2 }\", target is modified */\nJs.log(target)\n```" - ], - "signature": "let assign: ({..}, {..}) => {..}", - "deprecated": "" - }, - { - "id": "Js.Obj.keys", - "kind": "value", - "name": "keys", - "docstrings": [ - "`keys(obj)` returns an `array` of the keys of `obj`'s own enumerable properties." - ], - "signature": "let keys: {..} => array", - "deprecated": "" - } - ] - }, - "js/math": { - "id": "Js.Math", - "name": "Math", - "docstrings": [ - "Provide bindings for JS `Math` object", - "Provide utilities for JS Math. Note: The constants `_E`, `_LN10`, `_LN2`,\n`_LOG10E`, `_LOG2E`, `_PI`, `_SQRT1_2`, and `_SQRT2` begin with an underscore\nbecause ReScript variable names cannot begin with a capital letter. (Module\nnames begin with upper case.)" - ], - "items": [ - { - "id": "Js.Math._E", - "kind": "value", - "name": "_E", - "docstrings": [ - "Euler's number; ≈ 2.718281828459045. See\n[`Math.E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/E)\non MDN." - ], - "signature": "let _E: float", - "deprecated": "" - }, - { - "id": "Js.Math._LN2", - "kind": "value", - "name": "_LN2", - "docstrings": [ - "Natural logarithm of 2; ≈ 0.6931471805599453. See\n[`Math.LN2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN2)\non MDN." - ], - "signature": "let _LN2: float", - "deprecated": "" - }, - { - "id": "Js.Math._LN10", - "kind": "value", - "name": "_LN10", - "docstrings": [ - "Natural logarithm of 10; ≈ 2.302585092994046. See\n[`Math.LN10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN10)\non MDN." - ], - "signature": "let _LN10: float", - "deprecated": "" - }, - { - "id": "Js.Math._LOG2E", - "kind": "value", - "name": "_LOG2E", - "docstrings": [ - "Base 2 logarithm of E; ≈ 1.4426950408889634. See\n[`Math.LOG2E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG2E)\non MDN." - ], - "signature": "let _LOG2E: float", - "deprecated": "" - }, - { - "id": "Js.Math._LOG10E", - "kind": "value", - "name": "_LOG10E", - "docstrings": [ - "Base 10 logarithm of E; ≈ 0.4342944819032518. See\n[`Math.LOG10E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG10E)\non MDN." - ], - "signature": "let _LOG10E: float", - "deprecated": "" - }, - { - "id": "Js.Math._PI", - "kind": "value", - "name": "_PI", - "docstrings": [ - "Pi - ratio of the circumference to the diameter of a circle; ≈ 3.141592653589793. See\n[`Math.PI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/PI)\non MDN." - ], - "signature": "let _PI: float", - "deprecated": "" - }, - { - "id": "Js.Math._SQRT1_2", - "kind": "value", - "name": "_SQRT1_2", - "docstrings": [ - "Square root of 1/2; ≈ 0.7071067811865476. See\n[`Math.SQRT1_2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2)\non MDN." - ], - "signature": "let _SQRT1_2: float", - "deprecated": "" - }, - { - "id": "Js.Math._SQRT2", - "kind": "value", - "name": "_SQRT2", - "docstrings": [ - "Square root of 2; ≈ 1.4142135623730951. See\n[`Math.SQRT2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT2)\non MDN." - ], - "signature": "let _SQRT2: float", - "deprecated": "" - }, - { - "id": "Js.Math.abs_int", - "kind": "value", - "name": "abs_int", - "docstrings": [ - "Absolute value for integer argument. See\n[`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs)\non MDN." - ], - "signature": "let abs_int: int => int", - "deprecated": "" - }, - { - "id": "Js.Math.abs_float", - "kind": "value", - "name": "abs_float", - "docstrings": [ - "Absolute value for float argument. See\n[`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs)\non MDN." - ], - "signature": "let abs_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.acos", - "kind": "value", - "name": "acos", - "docstrings": [ - "Arccosine (in radians) of argument; returns `NaN` if the argument is outside\nthe range [-1.0, 1.0]. See\n[`Math.acos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acos)\non MDN." - ], - "signature": "let acos: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.acosh", - "kind": "value", - "name": "acosh", - "docstrings": [ - "Hyperbolic arccosine (in radians) of argument; returns `NaN` if the argument\nis less than 1.0. See\n[`Math.acosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acosh)\non MDN." - ], - "signature": "let acosh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.asin", - "kind": "value", - "name": "asin", - "docstrings": [ - "Arcsine (in radians) of argument; returns `NaN` if the argument is outside\nthe range [-1.0, 1.0]. See\n[`Math.asin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asin)\non MDN." - ], - "signature": "let asin: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.asinh", - "kind": "value", - "name": "asinh", - "docstrings": [ - "Hyperbolic arcsine (in radians) of argument. See\n[`Math.asinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh)\non MDN." - ], - "signature": "let asinh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.atan", - "kind": "value", - "name": "atan", - "docstrings": [ - "Arctangent (in radians) of argument. See\n[`Math.atan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan)\non MDN." - ], - "signature": "let atan: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.atanh", - "kind": "value", - "name": "atanh", - "docstrings": [ - "Hyperbolic arctangent (in radians) of argument; returns `NaN` if the argument\nis is outside the range [-1.0, 1.0]. Returns `-Infinity` and `Infinity` for\narguments -1.0 and 1.0. See\n[`Math.atanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh)\non MDN." - ], - "signature": "let atanh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.atan2", - "kind": "value", - "name": "atan2", - "docstrings": [ - "Returns the angle (in radians) of the quotient `y /. x`. It is also the angle\nbetween the *x*\\-axis and point (*x*, *y*). See\n[`Math.atan2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.atan2(~y=0.0, ~x=10.0, ()) == 0.0\nJs.Math.atan2(~x=5.0, ~y=5.0, ()) == Js.Math._PI /. 4.0\nJs.Math.atan2(~x=-5.0, ~y=5.0, ())\nJs.Math.atan2(~x=-5.0, ~y=5.0, ()) == 3.0 *. Js.Math._PI /. 4.0\nJs.Math.atan2(~x=-0.0, ~y=-5.0, ()) == -.Js.Math._PI /. 2.0\n```" - ], - "signature": "let atan2: (~y: float, ~x: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Math.cbrt", - "kind": "value", - "name": "cbrt", - "docstrings": [ - "Cube root. See\n[`Math.cbrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt)\non MDN" - ], - "signature": "let cbrt: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_ceil_int", - "kind": "value", - "name": "unsafe_ceil_int", - "docstrings": [ - "Returns the smallest integer greater than or equal to the argument. This\nfunction may return values not representable by `int`, whose range is\n\\-2147483648 to 2147483647. This is because, in JavaScript, there are only\n64-bit floating point numbers, which can represent integers in the range\n±(253\\-1) exactly. See\n[`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.unsafe_ceil_int(3.1) == 4\nJs.Math.unsafe_ceil_int(3.0) == 3\nJs.Math.unsafe_ceil_int(-3.1) == -3\nJs.Math.unsafe_ceil_int(1.0e15) // result is outside range of int datatype\n```" - ], - "signature": "let unsafe_ceil_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_ceil", - "kind": "value", - "name": "unsafe_ceil", - "docstrings": [], - "signature": "let unsafe_ceil: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.ceil_int", - "kind": "value", - "name": "ceil_int", - "docstrings": [ - "Returns the smallest `int` greater than or equal to the argument; the result\nis pinned to the range of the `int` data type: -2147483648 to 2147483647. See\n[`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.ceil_int(3.1) == 4\nJs.Math.ceil_int(3.0) == 3\nJs.Math.ceil_int(-3.1) == -3\nJs.Math.ceil_int(-1.0e15) == -2147483648\nJs.Math.ceil_int(1.0e15) == 2147483647\n```" - ], - "signature": "let ceil_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.ceil", - "kind": "value", - "name": "ceil", - "docstrings": [], - "signature": "let ceil: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.ceil_float", - "kind": "value", - "name": "ceil_float", - "docstrings": [ - "Returns the smallest integral value greater than or equal to the argument.\nThe result is a `float` and is not restricted to the `int` data type range.\nSee\n[`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.ceil_float(3.1) == 4.0\nJs.Math.ceil_float(3.0) == 3.0\nJs.Math.ceil_float(-3.1) == -3.0\nJs.Math.ceil_float(2_150_000_000.3) == 2_150_000_001.0\n```" - ], - "signature": "let ceil_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.clz32", - "kind": "value", - "name": "clz32", - "docstrings": [ - "Number of leading zero bits of the argument's 32 bit int representation. See\n[`Math.clz32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.clz32(0) == 32\nJs.Math.clz32(-1) == 0\nJs.Math.clz32(255) == 24\n```" - ], - "signature": "let clz32: int => int", - "deprecated": "" - }, - { - "id": "Js.Math.cos", - "kind": "value", - "name": "cos", - "docstrings": [ - "Cosine of argument, which must be specified in radians. See\n[`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos)\non MDN." - ], - "signature": "let cos: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.cosh", - "kind": "value", - "name": "cosh", - "docstrings": [ - "Hyperbolic cosine of argument, which must be specified in radians. See\n[`Math.cosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh)\non MDN." - ], - "signature": "let cosh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.exp", - "kind": "value", - "name": "exp", - "docstrings": [ - "Natural exponentional; returns *e* (the base of natural logarithms) to the\npower of the given argument. See\n[`Math.exp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/exp)\non MDN." - ], - "signature": "let exp: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.expm1", - "kind": "value", - "name": "expm1", - "docstrings": [ - "Returns *e* (the base of natural logarithms) to the power of the given\nargument minus 1. See\n[`Math.expm1`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1)\non MDN." - ], - "signature": "let expm1: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_floor_int", - "kind": "value", - "name": "unsafe_floor_int", - "docstrings": [ - "Returns the largest integer less than or equal to the argument. This function\nmay return values not representable by `int`, whose range is -2147483648 to\n2147483647. This is because, in JavaScript, there are only 64-bit floating\npoint numbers, which can represent integers in the range\n±(253\\-1) exactly. See\n[`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.unsafe_floor_int(3.7) == 3\nJs.Math.unsafe_floor_int(3.0) == 3\nJs.Math.unsafe_floor_int(-3.7) == -4\nJs.Math.unsafe_floor_int(1.0e15) // result is outside range of int datatype\n```" - ], - "signature": "let unsafe_floor_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_floor", - "kind": "value", - "name": "unsafe_floor", - "docstrings": [], - "signature": "let unsafe_floor: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.floor_int", - "kind": "value", - "name": "floor_int", - "docstrings": [ - "Returns the largest `int` less than or equal to the argument; the result is\npinned to the range of the `int` data type: -2147483648 to 2147483647. See\n[`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.floor_int(3.7) == 3\nJs.Math.floor_int(3.0) == 3\nJs.Math.floor_int(-3.1) == -4\nJs.Math.floor_int(-1.0e15) == -2147483648\nJs.Math.floor_int(1.0e15) == 2147483647\n```" - ], - "signature": "let floor_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.floor", - "kind": "value", - "name": "floor", - "docstrings": [], - "signature": "let floor: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.floor_float", - "kind": "value", - "name": "floor_float", - "docstrings": [ - "Returns the largest integral value less than or equal to the argument. The\nresult is a `float` and is not restricted to the `int` data type range. See\n[`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.floor_float(3.7) == 3.0\nJs.Math.floor_float(3.0) == 3.0\nJs.Math.floor_float(-3.1) == -4.0\nJs.Math.floor_float(2_150_000_000.3) == 2_150_000_000.0\n```" - ], - "signature": "let floor_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.fround", - "kind": "value", - "name": "fround", - "docstrings": [ - "Round to nearest single precision float. See\n[`Math.fround`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.fround(5.5) == 5.5\nJs.Math.fround(5.05) == 5.050000190734863\n```" - ], - "signature": "let fround: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.hypot", - "kind": "value", - "name": "hypot", - "docstrings": [ - "Returns the square root of the sum of squares of its two arguments (the\nPythagorean formula). See\n[`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot)\non MDN." - ], - "signature": "let hypot: (float, float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.hypotMany", - "kind": "value", - "name": "hypotMany", - "docstrings": [ - "Returns the square root of the sum of squares of the numbers in the array\nargument (generalized Pythagorean equation). Using an array allows you to\nhave more than two items. See\n[`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.hypotMany([3.0, 4.0, 12.0]) == 13.0\n```" - ], - "signature": "let hypotMany: array => float", - "deprecated": "" - }, - { - "id": "Js.Math.imul", - "kind": "value", - "name": "imul", - "docstrings": [ - "32-bit integer multiplication. Use this only when you need to optimize\nperformance of multiplication of numbers stored as 32-bit integers. See\n[`Math.imul`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul)\non MDN." - ], - "signature": "let imul: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.log", - "kind": "value", - "name": "log", - "docstrings": [ - "Returns the natural logarithm of its argument; this is the number *x* such\nthat *e**x* equals the argument. Returns `NaN` for negative\narguments. See\n[`Math.log`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log(Js.Math._E) == 1.0\nJs.Math.log(100.0) == 4.605170185988092\n```" - ], - "signature": "let log: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.log1p", - "kind": "value", - "name": "log1p", - "docstrings": [ - "Returns the natural logarithm of one plus the argument. Returns `NaN` for\narguments less than -1. See\n[`Math.log1p`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log1p)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log1p(Js.Math._E -. 1.0) == 1.0\nJs.Math.log1p(99.0) == 4.605170185988092\n```" - ], - "signature": "let log1p: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.log10", - "kind": "value", - "name": "log10", - "docstrings": [ - "Returns the base 10 logarithm of its argument. Returns `NaN` for negative\narguments. See\n[`Math.log10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log10)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log10(1000.0) == 3.0\nJs.Math.log10(0.01) == -2.0\nJs.Math.log10(Js.Math.sqrt(10.0)) == 0.5\n```" - ], - "signature": "let log10: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.log2", - "kind": "value", - "name": "log2", - "docstrings": [ - "Returns the base 2 logarithm of its argument. Returns `NaN` for negative\narguments. See\n[`Math.log2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log2(512.0) == 9.0\nJs.Math.log2(0.125) == -3.0\nJs.Math.log2(Js.Math._SQRT2) == 0.5000000000000001 // due to precision\n```" - ], - "signature": "let log2: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.max_int", - "kind": "value", - "name": "max_int", - "docstrings": [ - "Returns the maximum of its two integer arguments. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let max_int: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.maxMany_int", - "kind": "value", - "name": "maxMany_int", - "docstrings": [ - "Returns the maximum of the integers in the given array. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let maxMany_int: array => int", - "deprecated": "" - }, - { - "id": "Js.Math.max_float", - "kind": "value", - "name": "max_float", - "docstrings": [ - "Returns the maximum of its two floating point arguments. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let max_float: (float, float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.maxMany_float", - "kind": "value", - "name": "maxMany_float", - "docstrings": [ - "Returns the maximum of the floating point values in the given array. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let maxMany_float: array => float", - "deprecated": "" - }, - { - "id": "Js.Math.min_int", - "kind": "value", - "name": "min_int", - "docstrings": [ - "Returns the minimum of its two integer arguments. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let min_int: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.minMany_int", - "kind": "value", - "name": "minMany_int", - "docstrings": [ - "Returns the minimum of the integers in the given array. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let minMany_int: array => int", - "deprecated": "" - }, - { - "id": "Js.Math.min_float", - "kind": "value", - "name": "min_float", - "docstrings": [ - "Returns the minimum of its two floating point arguments. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let min_float: (float, float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.minMany_float", - "kind": "value", - "name": "minMany_float", - "docstrings": [ - "Returns the minimum of the floating point values in the given array. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let minMany_float: array => float", - "deprecated": "" - }, - { - "id": "Js.Math.pow_int", - "kind": "value", - "name": "pow_int", - "docstrings": [ - "Throws the given base to the given exponent. (Arguments and result are\nintegers.) See\n[`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.pow_int(~base=3, ~exp=4) == 81\n```" - ], - "signature": "let pow_int: (~base: int, ~exp: int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.pow_float", - "kind": "value", - "name": "pow_float", - "docstrings": [ - "Throws the given base to the given exponent. (Arguments and result are\nfloats.) Returns `NaN` if the result would be imaginary. See\n[`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.pow_float(~base=3.0, ~exp=4.0) == 81.0\nJs.Math.pow_float(~base=4.0, ~exp=-2.0) == 0.0625\nJs.Math.pow_float(~base=625.0, ~exp=0.5) == 25.0\nJs.Math.pow_float(~base=625.0, ~exp=-0.5) == 0.04\nJs.Float.isNaN(Js.Math.pow_float(~base=-2.0, ~exp=0.5)) == true\n```" - ], - "signature": "let pow_float: (~base: float, ~exp: float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.random", - "kind": "value", - "name": "random", - "docstrings": [ - "Returns a random number in the half-closed interval [0,1). See\n[`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\non MDN." - ], - "signature": "let random: unit => float", - "deprecated": "" - }, - { - "id": "Js.Math.random_int", - "kind": "value", - "name": "random_int", - "docstrings": [ - "A call to `random_int(minVal, maxVal)` returns a random number in the\nhalf-closed interval [minVal, maxVal). See\n[`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\non MDN." - ], - "signature": "let random_int: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_round", - "kind": "value", - "name": "unsafe_round", - "docstrings": [ - "Rounds its argument to nearest integer. For numbers with a fractional portion\nof exactly 0.5, the argument is rounded to the next integer in the direction\nof positive infinity. This function may return values not representable by\n`int`, whose range is -2147483648 to 2147483647. This is because, in\nJavaScript, there are only 64-bit floating point numbers, which can represent\nintegers in the range ±(253\\-1) exactly. See\n[`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.unsafe_round(3.7) == 4\nJs.Math.unsafe_round(-3.5) == -3\nJs.Math.unsafe_round(2_150_000_000_000.3) // out of range for int\n```" - ], - "signature": "let unsafe_round: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.round", - "kind": "value", - "name": "round", - "docstrings": [ - "Rounds to nearest integral value (expressed as a float). See\n[`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round)\non MDN." - ], - "signature": "let round: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sign_int", - "kind": "value", - "name": "sign_int", - "docstrings": [ - "Returns the sign of its integer argument: -1 if negative, 0 if zero, 1 if\npositive. See\n[`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign)\non MDN." - ], - "signature": "let sign_int: int => int", - "deprecated": "" - }, - { - "id": "Js.Math.sign_float", - "kind": "value", - "name": "sign_float", - "docstrings": [ - "Returns the sign of its float argument: -1.0 if negative, 0.0 if zero, 1.0 if\npositive. See\n[`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign)\non MDN." - ], - "signature": "let sign_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sin", - "kind": "value", - "name": "sin", - "docstrings": [ - "Sine of argument, which must be specified in radians. See\n[`Math.sin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin)\non MDN." - ], - "signature": "let sin: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sinh", - "kind": "value", - "name": "sinh", - "docstrings": [ - "Hyperbolic sine of argument, which must be specified in radians. See\n[`Math.sinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sinh)\non MDN." - ], - "signature": "let sinh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sqrt", - "kind": "value", - "name": "sqrt", - "docstrings": [ - "Square root. If the argument is negative, this function returns `NaN`. See\n[`Math.sqrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt)\non MDN." - ], - "signature": "let sqrt: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.tan", - "kind": "value", - "name": "tan", - "docstrings": [ - "Tangent of argument, which must be specified in radians. Returns `NaN` if the\nargument is positive infinity or negative infinity. See\n[`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos)\non MDN." - ], - "signature": "let tan: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.tanh", - "kind": "value", - "name": "tanh", - "docstrings": [ - "Hyperbolic tangent of argument, which must be specified in radians. See\n[`Math.tanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tanh)\non MDN." - ], - "signature": "let tanh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_trunc", - "kind": "value", - "name": "unsafe_trunc", - "docstrings": [ - "Truncates its argument; i.e., removes fractional digits. This function may\nreturn values not representable by `int`, whose range is -2147483648 to\n2147483647. This is because, in JavaScript, there are only 64-bit floating\npoint numbers, which can represent integers in the range ±(253-1)\nexactly. See\n[`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc)\non MDN." - ], - "signature": "let unsafe_trunc: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.trunc", - "kind": "value", - "name": "trunc", - "docstrings": [ - "Truncates its argument; i.e., removes fractional digits. See\n[`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc)\non MDN." - ], - "signature": "let trunc: float => float", - "deprecated": "" - } - ] - }, - "js/json": { - "id": "Js.Json", - "name": "Json", - "docstrings": [ - "Provide utilities for json", - "Efficient JSON encoding using JavaScript API\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON)" - ], - "items": [ - { - "id": "Js.Json.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The JSON data structure" - ], - "signature": "@unboxed\ntype t = JSON.t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)", - "deprecated": "" - }, - { - "id": "Js.Json.tagged_t", - "kind": "type", - "name": "tagged_t", - "docstrings": [], - "signature": "type tagged_t =\n | JSONFalse\n | JSONTrue\n | JSONNull\n | JSONString(string)\n | JSONNumber(float)\n | JSONObject(dict)\n | JSONArray(array)", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.classify", - "kind": "value", - "name": "classify", - "docstrings": [], - "signature": "let classify: t => tagged_t", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.test", - "kind": "value", - "name": "test", - "docstrings": [ - "`test(v, kind)` returns `true` if `v` is of `kind`." - ], - "signature": "let test: ('a, Kind.t<'b>) => bool", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.decodeString", - "kind": "value", - "name": "decodeString", - "docstrings": [ - "`decodeString(json)` returns `Some(s)` if `json` is a `string`, `None` otherwise." - ], - "signature": "let decodeString: t => option", - "deprecated": "" - }, - { - "id": "Js.Json.decodeNumber", - "kind": "value", - "name": "decodeNumber", - "docstrings": [ - "`decodeNumber(json)` returns `Some(n)` if `json` is a `number`, `None` otherwise." - ], - "signature": "let decodeNumber: t => option", - "deprecated": "" - }, - { - "id": "Js.Json.decodeObject", - "kind": "value", - "name": "decodeObject", - "docstrings": [ - "`decodeObject(json)` returns `Some(o)` if `json` is an `object`, `None` otherwise." - ], - "signature": "let decodeObject: t => option>", - "deprecated": "" - }, - { - "id": "Js.Json.decodeArray", - "kind": "value", - "name": "decodeArray", - "docstrings": [ - "`decodeArray(json)` returns `Some(a)` if `json` is an `array`, `None` otherwise." - ], - "signature": "let decodeArray: t => option>", - "deprecated": "" - }, - { - "id": "Js.Json.decodeBoolean", - "kind": "value", - "name": "decodeBoolean", - "docstrings": [ - "`decodeBoolean(json)` returns `Some(b)` if `json` is a `boolean`, `None` otherwise." - ], - "signature": "let decodeBoolean: t => option", - "deprecated": "" - }, - { - "id": "Js.Json.decodeNull", - "kind": "value", - "name": "decodeNull", - "docstrings": [ - "`decodeNull(json)` returns `Some(null)` if `json` is a `null`, `None` otherwise." - ], - "signature": "let decodeNull: t => option>", - "deprecated": "" - }, - { - "id": "Js.Json.null", - "kind": "value", - "name": "null", - "docstrings": [ - "`null` is the singleton null JSON value." - ], - "signature": "let null: t", - "deprecated": "" - }, - { - "id": "Js.Json.string", - "kind": "value", - "name": "string", - "docstrings": [ - "`string(s)` makes a JSON string of the `string` `s`." - ], - "signature": "let string: string => t", - "deprecated": "" - }, - { - "id": "Js.Json.number", - "kind": "value", - "name": "number", - "docstrings": [ - "`number(n)` makes a JSON number of the `float` `n`." - ], - "signature": "let number: float => t", - "deprecated": "" - }, - { - "id": "Js.Json.boolean", - "kind": "value", - "name": "boolean", - "docstrings": [ - "`boolean(b)` makes a JSON boolean of the `bool` `b`." - ], - "signature": "let boolean: bool => t", - "deprecated": "" - }, - { - "id": "Js.Json.object_", - "kind": "value", - "name": "object_", - "docstrings": [ - "`object_(dict)` makes a JSON object of the `dict`." - ], - "signature": "let object_: dict => t", - "deprecated": "" - }, - { - "id": "Js.Json.array", - "kind": "value", - "name": "array", - "docstrings": [ - "`array_(a)` makes a JSON array of the `Js.Json.t` array `a`." - ], - "signature": "let array: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.stringArray", - "kind": "value", - "name": "stringArray", - "docstrings": [ - "`stringArray(a)` makes a JSON array of the `string` array `a`." - ], - "signature": "let stringArray: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.numberArray", - "kind": "value", - "name": "numberArray", - "docstrings": [ - "`numberArray(a)` makes a JSON array of the `float` array `a`." - ], - "signature": "let numberArray: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.booleanArray", - "kind": "value", - "name": "booleanArray", - "docstrings": [ - "`booleanArray(a)` makes a JSON array of the `bool` array `a`." - ], - "signature": "let booleanArray: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.objectArray", - "kind": "value", - "name": "objectArray", - "docstrings": [ - "`objectArray(a) makes a JSON array of the `JsDict.t` array `a`." - ], - "signature": "let objectArray: array> => t", - "deprecated": "" - }, - { - "id": "Js.Json.parseExn", - "kind": "value", - "name": "parseExn", - "docstrings": [ - "`parseExn(s)` parses the `string` `s` into a JSON data structure.\nReturns a JSON data structure.\nThrows `SyntaxError` if the given string is not a valid JSON. Note: `SyntaxError` is a JavaScript exception.\n\nSee [`parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) on MDN.\n\n## Examples\n\n```rescript\n/* parse a simple JSON string */\n\nlet json = try Js.Json.parseExn(` \"hello\" `) catch {\n| _ => failwith(\"Error parsing JSON string\")\n}\n\nswitch Js.Json.classify(json) {\n| Js.Json.JSONString(value) => Js.log(value)\n| _ => failwith(\"Expected a string\")\n}\n```\n\n```rescript\n/* parse a complex JSON string */\n\nlet getIds = s => {\n let json = try Js.Json.parseExn(s) catch {\n | _ => failwith(\"Error parsing JSON string\")\n }\n\n switch Js.Json.classify(json) {\n | Js.Json.JSONObject(value) =>\n /* In this branch, compiler infer value : Js.Json.t dict */\n switch Js.Dict.get(value, \"ids\") {\n | Some(ids) =>\n switch Js.Json.classify(ids) {\n | Js.Json.JSONArray(ids) => /* In this branch compiler infer ids : Js.Json.t array */\n ids\n | _ => failwith(\"Expected an array\")\n }\n | None => failwith(\"Expected an `ids` property\")\n }\n | _ => failwith(\"Expected an object\")\n }\n}\n\n/* prints `1, 2, 3` */\nJs.log(getIds(` { \"ids\" : [1, 2, 3 ] } `))\n```" - ], - "signature": "let parseExn: string => t", - "deprecated": "" - }, - { - "id": "Js.Json.stringify", - "kind": "value", - "name": "stringify", - "docstrings": [ - "`stringify(json)` formats the JSON data structure as a `string`.\nReturns the string representation of a given JSON data structure.\n\nSee [`stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) on MDN.\n\n## Examples\n\n```rescript\n/* Creates and stringifies a simple JS object */\n\nlet dict = Js.Dict.empty()\nJs.Dict.set(dict, \"name\", Js.Json.string(\"John Doe\"))\nJs.Dict.set(dict, \"age\", Js.Json.number(30.0))\nJs.Dict.set(dict, \"likes\", Js.Json.stringArray([\"ReScript\", \"ocaml\", \"js\"]))\n\nJs.log(Js.Json.stringify(Js.Json.object_(dict)))\n```" - ], - "signature": "let stringify: t => string", - "deprecated": "" - }, - { - "id": "Js.Json.stringifyWithSpace", - "kind": "value", - "name": "stringifyWithSpace", - "docstrings": [ - "`stringifyWithSpace(json)` formats the JSON data structure as a `string`.\nReturns the string representation of a given JSON data structure with spacing.\n\nSee [`stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) on MDN.\n\n## Examples\n\n```rescript\n/* Creates and stringifies a simple JS object with spacing */\n\nlet dict = Js.Dict.empty()\nJs.Dict.set(dict, \"name\", Js.Json.string(\"John Doe\"))\nJs.Dict.set(dict, \"age\", Js.Json.number(30.0))\nJs.Dict.set(dict, \"likes\", Js.Json.stringArray([\"ReScript\", \"ocaml\", \"js\"]))\n\nJs.log(Js.Json.stringifyWithSpace(Js.Json.object_(dict), 2))\n```" - ], - "signature": "let stringifyWithSpace: (t, int) => string", - "deprecated": "" - }, - { - "id": "Js.Json.stringifyAny", - "kind": "value", - "name": "stringifyAny", - "docstrings": [ - "`stringifyAny(value)` formats any value into a JSON string.\n\n## Examples\n\n```rescript\n/* prints `[\"hello\", \"world\"]` */\nJs.log(Js.Json.stringifyAny([\"hello\", \"world\"]))\n```" - ], - "signature": "let stringifyAny: 'a => option", - "deprecated": "" - }, - { - "id": "Js.Json.deserializeUnsafe", - "kind": "value", - "name": "deserializeUnsafe", - "docstrings": [ - "Best-effort serialization, it tries to seralize as\nmany objects as possible and deserialize it back\n\nIt is unsafe in two aspects\n- It may throw during parsing\n- when you cast it to a specific type, it may have a type mismatch" - ], - "signature": "let deserializeUnsafe: string => 'a", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.serializeExn", - "kind": "value", - "name": "serializeExn", - "docstrings": [ - "It will throw in such situations:\n- The object can not be serlialized to a JSON\n- There are cycles\n- Some JS engines can not stringify deeply nested json objects" - ], - "signature": "let serializeExn: 'a => string", - "deprecated": "This functionality has been deprecated and will be removed in v13." - } - ] - }, - "js/global": { - "id": "Js.Global", - "name": "Global", - "docstrings": [ - "Provide bindings to JS global functions in global namespace", - "Contains functions available in the global scope (`window` in a browser context)" - ], - "items": [ - { - "id": "Js.Global.intervalId", - "kind": "type", - "name": "intervalId", - "docstrings": [ - "Identify an interval started by `Js.Global.setInterval`." - ], - "signature": "type intervalId = Global.intervalId", - "deprecated": "" - }, - { - "id": "Js.Global.timeoutId", - "kind": "type", - "name": "timeoutId", - "docstrings": [ - "Identify timeout started by `Js.Global.setTimeout`." - ], - "signature": "type timeoutId = Global.timeoutId", - "deprecated": "" - }, - { - "id": "Js.Global.clearInterval", - "kind": "value", - "name": "clearInterval", - "docstrings": [ - "Clear an interval started by `Js.Global.setInterval`\n\n## Examples\n\n```rescript\n/* API for a somewhat aggressive snoozing alarm clock */\n\nlet punchSleepyGuy = () => Js.log(\"Punch\")\n\nlet interval = ref(Js.Nullable.null)\n\nlet remind = () => {\n Js.log(\"Wake Up!\")\n punchSleepyGuy()\n}\n\nlet snooze = mins => interval := Js.Nullable.return(Js.Global.setInterval(remind, mins * 60 * 1000))\n\nlet cancel = () =>\n Js.Nullable.iter(interval.contents, intervalId => Js.Global.clearInterval(intervalId))\n```" - ], - "signature": "let clearInterval: intervalId => unit", - "deprecated": "" - }, - { - "id": "Js.Global.clearTimeout", - "kind": "value", - "name": "clearTimeout", - "docstrings": [ - "Clear a timeout started by `Js.Global.setTimeout`.\n\n## Examples\n\n```rescript\n/* A simple model of a code monkey's brain */\n\nlet closeHackerNewsTab = () => Js.log(\"close\")\n\nlet timer = ref(Js.Nullable.null)\n\nlet work = () => closeHackerNewsTab()\n\nlet procrastinate = mins => {\n Js.Nullable.iter(timer.contents, timer => Js.Global.clearTimeout(timer))\n timer := Js.Nullable.return(Js.Global.setTimeout(work, mins * 60 * 1000))\n}\n```" - ], - "signature": "let clearTimeout: timeoutId => unit", - "deprecated": "" - }, - { - "id": "Js.Global.setInterval", - "kind": "value", - "name": "setInterval", - "docstrings": [ - "Repeatedly executes a callback with a specified interval (in milliseconds)\nbetween calls. Returns a `Js.Global.intervalId` that can be passed to\n`Js.Global.clearInterval` to cancel the timeout.\n\n## Examples\n\n```rescript\n/* Will count up and print the count to the console every second */\n\nlet count = ref(0)\n\nlet tick = () => {\n count := count.contents + 1\n Js.log(Belt.Int.toString(count.contents))\n}\n\nJs.Global.setInterval(tick, 1000)\n```" - ], - "signature": "let setInterval: (unit => unit, int) => intervalId", - "deprecated": "" - }, - { - "id": "Js.Global.setIntervalFloat", - "kind": "value", - "name": "setIntervalFloat", - "docstrings": [ - "Repeatedly executes a callback with a specified interval (in milliseconds)\nbetween calls. Returns a `Js.Global.intervalId` that can be passed to\n`Js.Global.clearInterval` to cancel the timeout.\n\n## Examples\n\n```rescript\n/* Will count up and print the count to the console every second */\n\nlet count = ref(0)\n\nlet tick = () => {\n count := count.contents + 1\n Js.log(Belt.Int.toString(count.contents))\n}\n\nJs.Global.setIntervalFloat(tick, 1000.0)\n```" - ], - "signature": "let setIntervalFloat: (unit => unit, float) => intervalId", - "deprecated": "" - }, - { - "id": "Js.Global.setTimeout", - "kind": "value", - "name": "setTimeout", - "docstrings": [ - "Execute a callback after a specified delay (in milliseconds). Returns a\n`Js.Global.timeoutId` that can be passed to `Js.Global.clearTimeout` to cancel\nthe timeout.\n\n## Examples\n\n```rescript\n/* Prints \"Timed out!\" in the console after one second */\n\nlet message = \"Timed out!\"\n\nJs.Global.setTimeout(() => Js.log(message), 1000)\n```" - ], - "signature": "let setTimeout: (unit => unit, int) => timeoutId", - "deprecated": "" - }, - { - "id": "Js.Global.setTimeoutFloat", - "kind": "value", - "name": "setTimeoutFloat", - "docstrings": [ - "Execute a callback after a specified delay (in milliseconds). Returns a\n`Js.Global.timeoutId` that can be passed to `Js.Global.clearTimeout` to cancel\nthe timeout.\n\n## Examples\n\n```rescript\n/* Prints \"Timed out!\" in the console after one second */\n\nlet message = \"Timed out!\"\n\nJs.Global.setTimeoutFloat(() => Js.log(message), 1000.0)\n```" - ], - "signature": "let setTimeoutFloat: (unit => unit, float) => timeoutId", - "deprecated": "" - }, - { - "id": "Js.Global.encodeURI", - "kind": "value", - "name": "encodeURI", - "docstrings": [ - "URL-encodes a string.\n\nSee [`encodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI) on MDN." - ], - "signature": "let encodeURI: string => string", - "deprecated": "" - }, - { - "id": "Js.Global.decodeURI", - "kind": "value", - "name": "decodeURI", - "docstrings": [ - "Decodes a URL-enmcoded string produced by `encodeURI`\n\nSee [`decodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI) on MDN." - ], - "signature": "let decodeURI: string => string", - "deprecated": "" - }, - { - "id": "Js.Global.encodeURIComponent", - "kind": "value", - "name": "encodeURIComponent", - "docstrings": [ - "URL-encodes a string, including characters with special meaning in a URI.\n\nSee [`encodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) on MDN." - ], - "signature": "let encodeURIComponent: string => string", - "deprecated": "" - }, - { - "id": "Js.Global.decodeURIComponent", - "kind": "value", - "name": "decodeURIComponent", - "docstrings": [ - "Decodes a URL-enmcoded string produced by `encodeURIComponent`\n\nSee [`decodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) on MDN." - ], - "signature": "let decodeURIComponent: string => string", - "deprecated": "" - } - ] - }, - "js/dict": { - "id": "Js.Dict", - "name": "Dict", - "docstrings": [ - "Provide utilities for JS dictionary object", - "Provide utilities for JS dictionary object.\n\n**Note:** This module's examples will assume this predeclared dictionary:\n\n## Examples\n\n```rescript\nlet ages = Js.Dict.fromList(list{(\"Maria\", 30), (\"Vinh\", 22), (\"Fred\", 49)})\n```" - ], - "items": [ - { - "id": "Js.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = dict<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.key", - "kind": "type", - "name": "key", - "docstrings": [ - "The type for dictionary keys. This means that dictionaries *must* use `string`s as their keys." - ], - "signature": "type key = string", - "deprecated": "" - }, - { - "id": "Js.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`Js.Dict.get(key)` returns `None` if the key is not found in the dictionary,\n`Some(value)` otherwise.\n\n## Examples\n\n```rescript\nJs.Dict.get(ages, \"Vinh\") == Some(22)\nJs.Dict.get(ages, \"Paul\") == None\n```" - ], - "signature": "let get: (t<'a>, key) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.unsafeGet", - "kind": "value", - "name": "unsafeGet", - "docstrings": [ - "`Js.Dict.unsafeGet(key)` returns the value if the key exists, otherwise an `undefined` value is returned. Use this only when you are sure the key exists (i.e. when having used the `keys()` function to check that the key is valid).\n\n## Examples\n\n```rescript\nJs.Dict.unsafeGet(ages, \"Fred\") == 49\nJs.Dict.unsafeGet(ages, \"Paul\") // returns undefined\n```" - ], - "signature": "let unsafeGet: (t<'a>, key) => 'a", - "deprecated": "" - }, - { - "id": "Js.Dict.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`Js.Dict.set(dict, key, value)` sets the key/value in the dictionary `dict`. If\nthe key does not exist, and entry will be created for it.\n\n*This function modifies the original dictionary.*\n\n## Examples\n\n```rescript\nJs.Dict.set(ages, \"Maria\", 31)\nJs.log(ages == Js.Dict.fromList(list{(\"Maria\", 31), (\"Vinh\", 22), (\"Fred\", 49)}))\n\nJs.Dict.set(ages, \"David\", 66)\nJs.log(ages == Js.Dict.fromList(list{(\"Maria\", 31), (\"Vinh\", 22), (\"Fred\", 49), (\"David\", 66)}))\n```" - ], - "signature": "let set: (t<'a>, key, 'a) => unit", - "deprecated": "" - }, - { - "id": "Js.Dict.keys", - "kind": "value", - "name": "keys", - "docstrings": [ - "Returns all the keys in the dictionary `dict`.\n\n## Examples\n\n```rescript\nJs.Dict.keys(ages) == [\"Maria\", \"Vinh\", \"Fred\"]\n```" - ], - "signature": "let keys: t<'a> => array", - "deprecated": "" - }, - { - "id": "Js.Dict.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "Returns an empty dictionary." - ], - "signature": "let empty: unit => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.unsafeDeleteKey", - "kind": "value", - "name": "unsafeDeleteKey", - "docstrings": [ - "Experimental internal function" - ], - "signature": "let unsafeDeleteKey: (t, string) => unit", - "deprecated": "" - }, - { - "id": "Js.Dict.entries", - "kind": "value", - "name": "entries", - "docstrings": [ - "Returns an array of key/value pairs in the given dictionary (ES2017).\n\n## Examples\n\n```rescript\nJs.Dict.entries(ages) == [(\"Maria\", 30), (\"Vinh\", 22), (\"Fred\", 49)]\n```" - ], - "signature": "let entries: t<'a> => array<(key, 'a)>", - "deprecated": "" - }, - { - "id": "Js.Dict.values", - "kind": "value", - "name": "values", - "docstrings": [ - "Returns the values in the given dictionary (ES2017).\n\n## Examples\n\n```rescript\nJs.Dict.values(ages) == [30, 22, 49]\n```" - ], - "signature": "let values: t<'a> => array<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.fromList", - "kind": "value", - "name": "fromList", - "docstrings": [ - "Creates a new dictionary containing each (key, value) pair in its list\nargument.\n\n## Examples\n\n```rescript\nlet capitals = Js.Dict.fromList(list{(\"Japan\", \"Tokyo\"), (\"France\", \"Paris\"), (\"Egypt\", \"Cairo\")})\n```" - ], - "signature": "let fromList: list<(key, 'a)> => t<'a>", - "deprecated": "Use `Dict.fromArray(List.toArray(...))` instead." - }, - { - "id": "Js.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates a new dictionary containing each (key, value) pair in its array\nargument.\n\n## Examples\n\n```rescript\nlet capitals2 = Js.Dict.fromArray([(\"Germany\", \"Berlin\"), (\"Burkina Faso\", \"Ouagadougou\")])\n```" - ], - "signature": "let fromArray: array<(key, 'a)> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(f, dict)` maps `dict` to a new dictionary with the same keys, using the\nfunction `f` to map each value.\n\n## Examples\n\n```rescript\nlet prices = Js.Dict.fromList(list{(\"pen\", 1.00), (\"book\", 5.00), (\"stapler\", 7.00)})\n\nlet discount = price => price *. 0.90\nlet salePrices = Js.Dict.map(discount, prices)\n\nsalePrices == Js.Dict.fromList(list{(\"pen\", 0.90), (\"book\", 4.50), (\"stapler\", 6.30)})\n```" - ], - "signature": "let map: ('a => 'b, t<'a>) => t<'b>", - "deprecated": "" - } - ] - }, - "js/date": { - "id": "Js.Date", - "name": "Date", - "docstrings": [ - "Provide bindings for JS Date", - "Provide bindings to JS date. (See\n[`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)\non MDN.) JavaScript stores dates as the number of milliseconds since the UNIX\n*epoch*, midnight 1 January 1970, UTC." - ], - "items": [ - { - "id": "Js.Date.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Date.t", - "deprecated": "" - }, - { - "id": "Js.Date.valueOf", - "kind": "value", - "name": "valueOf", - "docstrings": [ - "Returns the primitive value of this date, equivalent to `getTime()`. (See\n[`Date.valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/valueOf)\non MDN.)\n\n## Examples\n\n```rescript\nJs.Date.valueOf(exampleDate) == 123456654321.0\n```" - ], - "signature": "let valueOf: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a date representing the current time. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nlet now = Js.Date.make()\n```" - ], - "signature": "let make: unit => t", - "deprecated": "" - }, - { - "id": "Js.Date.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "Returns a date representing the given argument, which is a number of\nmilliseconds since the epoch. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.fromFloat(123456654321.0) == exampleDate\n```" - ], - "signature": "let fromFloat: float => t", - "deprecated": "" - }, - { - "id": "Js.Date.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Returns a `Js.Date.t` represented by the given string. The string can be in\n“IETF-compliant RFC 2822 timestamps, and also strings in a version of ISO8601.”\nReturns `NaN` if given an invalid date string. According to the [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\ndocumentation on MDN, its use is discouraged.\n\n## Examples\n\n```rescript\nJs.Date.fromString(\"Thu, 29 Nov 1973 21:30:54.321 GMT\") == exampleDate\nJs.Date.fromString(\"1973-11-29T21:30:54.321Z00:00\") == exampleDate\nJs.Date.fromString(\"Thor, 32 Lok -19 60:70:80 XYZ\") // returns NaN\n```" - ], - "signature": "let fromString: string => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYM", - "kind": "value", - "name": "makeWithYM", - "docstrings": [ - "Returns a date representing midnight of the first day of the given month and\nyear in the current time zone. Fractional parts of arguments are ignored. See\n[`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nlet november1 = Js.Date.makeWithYM(~year=2020.0, ~month=10.0, ())\n```" - ], - "signature": "let makeWithYM: (~year: float, ~month: float, unit) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMD", - "kind": "value", - "name": "makeWithYMD", - "docstrings": [ - "Returns a date representing midnight of the given date of the given month and\nyear in the current time zone. Fractional parts of arguments are ignored. See\n[`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN." - ], - "signature": "let makeWithYMD: (~year: float, ~month: float, ~date: float, unit) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMDH", - "kind": "value", - "name": "makeWithYMDH", - "docstrings": [ - "Returns a date representing the given date of the given month and year, at zero\nminutes and zero seconds past the given `hours`, in the current time zone.\nFractional parts of arguments are ignored. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN. Fractional parts of the arguments are ignored." - ], - "signature": "let makeWithYMDH: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n unit,\n) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMDHM", - "kind": "value", - "name": "makeWithYMDHM", - "docstrings": [ - "Returns a date representing the given date of the given month and year, at zero\nseconds past the given time in hours and minutes in the current time zone.\nFractional parts of arguments are ignored. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN." - ], - "signature": "let makeWithYMDHM: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n unit,\n) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMDHMS", - "kind": "value", - "name": "makeWithYMDHMS", - "docstrings": [ - "Returns a date representing the given date of the given month and year, at the\ngiven time in hours, minutes, and seconds in the current time zone. Fractional\nparts of arguments are ignored. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.makeWithYMDHMS(\n ~year=1973.0,\n ~month=11.0,\n ~date=29.0,\n ~hours=21.0,\n ~minutes=30.0,\n ~seconds=54.321,\n (),\n) == exampleDate\n```" - ], - "signature": "let makeWithYMDHMS: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => t", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYM", - "kind": "value", - "name": "utcWithYM", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the first day of the given month and year in UTC. Fractional parts\nof arguments are ignored. See\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN.\n\n## Examples\n\n```rescript\nlet november1 = Js.Date.utcWithYM(~year=2020.0, ~month=10.0, ())\n```" - ], - "signature": "let utcWithYM: (~year: float, ~month: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMD", - "kind": "value", - "name": "utcWithYMD", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year in UTC. Fractional parts\nof arguments are ignored. See\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMD: (~year: float, ~month: float, ~date: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMDH", - "kind": "value", - "name": "utcWithYMDH", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year, at zero minutes and\nseconds past the given hours in UTC. Fractional parts of arguments are ignored.\nSee\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMDH: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMDHM", - "kind": "value", - "name": "utcWithYMDHM", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year, at zero seconds past\nthe given number of minutes past the given hours in UTC. Fractional parts of\narguments are ignored. See\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMDHM: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMDHMS", - "kind": "value", - "name": "utcWithYMDHMS", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year, at the given time in\nhours, minutes and seconds in UTC. Fractional parts of arguments are ignored.\n\nSee\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMDHMS: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.now", - "kind": "value", - "name": "now", - "docstrings": [ - "Returns the current time as number of milliseconds since Unix epoch." - ], - "signature": "let now: unit => float", - "deprecated": "" - }, - { - "id": "Js.Date.parse", - "kind": "value", - "name": "parse", - "docstrings": [], - "signature": "let parse: string => t", - "deprecated": "" - }, - { - "id": "Js.Date.parseAsFloat", - "kind": "value", - "name": "parseAsFloat", - "docstrings": [ - "Returns a float with the number of milliseconds past the epoch represented by\nthe given string. The string can be in “IETF-compliant RFC 2822 timestamps, and\nalso strings in a version of ISO8601.” Returns `NaN` if given an invalid date\nstring. According to the\n[`Date.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse)\ndocumentation on MDN, its use is discouraged. Returns `NaN` if passed invalid\ndate string." - ], - "signature": "let parseAsFloat: string => float", - "deprecated": "" - }, - { - "id": "Js.Date.getDate", - "kind": "value", - "name": "getDate", - "docstrings": [ - "Returns the day of the month for its argument. The argument is evaluated in the\ncurrent time zone. See\n[`Date.getDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDate)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getDate(exampleDate) == 29.0\n```" - ], - "signature": "let getDate: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getDay", - "kind": "value", - "name": "getDay", - "docstrings": [ - "Returns the day of the week (0.0-6.0) for its argument, where 0.0 represents\nSunday. The argument is evaluated in the current time zone. See\n[`Date.getDay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDay)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getDay(exampleDate) == 4.0\n```" - ], - "signature": "let getDay: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getFullYear", - "kind": "value", - "name": "getFullYear", - "docstrings": [ - "Returns the full year (as opposed to the range 0-99) for its argument. The\nargument is evaluated in the current time zone. See\n[`Date.getFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getFullYear)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getFullYear(exampleDate) == 1973.0\n```" - ], - "signature": "let getFullYear: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getHours", - "kind": "value", - "name": "getHours", - "docstrings": [ - "Returns the hours for its argument, evaluated in the current time zone. See\n[`Date.getHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getHours)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getHours(exampleDate) == 22.0 // Vienna is in GMT+01:00\n```" - ], - "signature": "let getHours: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getMilliseconds", - "kind": "value", - "name": "getMilliseconds", - "docstrings": [ - "Returns the number of milliseconds for its argument, evaluated in the current\ntime zone. See\n[`Date.getMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getMilliseconds(exampleDate) == 321.0\n```" - ], - "signature": "let getMilliseconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getMinutes", - "kind": "value", - "name": "getMinutes", - "docstrings": [ - "Returns the number of minutes for its argument, evaluated in the current time\nzone. See\n[`Date.getMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMinutes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getMinutes(exampleDate) == 30.0\n```" - ], - "signature": "let getMinutes: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getMonth", - "kind": "value", - "name": "getMonth", - "docstrings": [ - "Returns the month (0.0-11.0) for its argument, evaluated in the current time\nzone. January is month zero. See\n[`Date.getMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMonth)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getMonth(exampleDate) == 10.0\n```" - ], - "signature": "let getMonth: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getSeconds", - "kind": "value", - "name": "getSeconds", - "docstrings": [ - "Returns the seconds for its argument, evaluated in the current time zone. See\n[`Date.getSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getSeconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getSeconds(exampleDate) == 54.0\n```" - ], - "signature": "let getSeconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getTime", - "kind": "value", - "name": "getTime", - "docstrings": [ - "Returns the number of milliseconds since Unix epoch, evaluated in UTC. See\n[`Date.getTime`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getTime(exampleDate) == 123456654321.0\n```" - ], - "signature": "let getTime: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getTimezoneOffset", - "kind": "value", - "name": "getTimezoneOffset", - "docstrings": [ - "Returns the time zone offset in minutes from the current time zone to UTC. See\n[`Date.getTimezoneOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getTimezoneOffset(exampleDate) == -60.0\n```" - ], - "signature": "let getTimezoneOffset: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCDate", - "kind": "value", - "name": "getUTCDate", - "docstrings": [ - "Returns the day of the month of the argument, evaluated in UTC. See\n[`Date.getUTCDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCDate)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCDate(exampleDate) == 29.0\n```" - ], - "signature": "let getUTCDate: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCDay", - "kind": "value", - "name": "getUTCDay", - "docstrings": [ - "Returns the day of the week of the argument, evaluated in UTC. The range of the\nreturn value is 0.0-6.0, where Sunday is zero. See\n[`Date.getUTCDay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCDay)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCDay(exampleDate) == 4.0\n```" - ], - "signature": "let getUTCDay: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCFullYear", - "kind": "value", - "name": "getUTCFullYear", - "docstrings": [ - "Returns the full year (as opposed to the range 0-99) for its argument. The\nargument is evaluated in UTC. See\n[`Date.getUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCFullYear(exampleDate) == 1973.0\n```" - ], - "signature": "let getUTCFullYear: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCHours", - "kind": "value", - "name": "getUTCHours", - "docstrings": [ - "Returns the hours for its argument, evaluated in the current time zone. See\n[`Date.getUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCHours(exampleDate) == 21.0\n```" - ], - "signature": "let getUTCHours: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCMilliseconds", - "kind": "value", - "name": "getUTCMilliseconds", - "docstrings": [ - "Returns the number of milliseconds for its argument, evaluated in UTC. See\n[`Date.getUTCMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCMilliseconds(exampleDate) == 321.0\n```" - ], - "signature": "let getUTCMilliseconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCMinutes", - "kind": "value", - "name": "getUTCMinutes", - "docstrings": [ - "Returns the number of minutes for its argument, evaluated in UTC. See\n[`Date.getUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCMinutes(exampleDate) == 30.0\n```" - ], - "signature": "let getUTCMinutes: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCMonth", - "kind": "value", - "name": "getUTCMonth", - "docstrings": [ - "Returns the month (0.0-11.0) for its argument, evaluated in UTC. January is\nmonth zero. See\n[`Date.getUTCMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMonth)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCMonth(exampleDate) == 10.0\n```" - ], - "signature": "let getUTCMonth: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCSeconds", - "kind": "value", - "name": "getUTCSeconds", - "docstrings": [ - "Returns the seconds for its argument, evaluated in UTC. See\n[`Date.getUTCSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCSeconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCSeconds(exampleDate) == 54.0\n```" - ], - "signature": "let getUTCSeconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getYear", - "kind": "value", - "name": "getYear", - "docstrings": [], - "signature": "let getYear: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.setDate", - "kind": "value", - "name": "setDate", - "docstrings": [ - "Sets the given `Date`’s day of month to the value in the second argument\naccording to the current time zone. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setDate)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet twoWeeksBefore = Js.Date.setDate(date1, 15.0)\ndate1 == Js.Date.fromString(\"1973-11-15T21:30:54.321Z00:00\")\ntwoWeeksBefore == Js.Date.getTime(date1)\n```" - ], - "signature": "let setDate: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setFullYear", - "kind": "value", - "name": "setFullYear", - "docstrings": [ - "Sets the given `Date`’s year to the value in the second argument according to\nthe current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextYear = Js.Date.setFullYear(date1, 1974.0)\ndate1 == Js.Date.fromString(\"1974-11-15T21:30:54.321Z00:00\")\nnextYear == Js.Date.getTime(date1)\n```" - ], - "signature": "let setFullYear: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setFullYearM", - "kind": "value", - "name": "setFullYearM", - "docstrings": [ - "Sets the given `Date`’s year and month to the values in the labeled arguments\naccording to the current time zone. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setFullYearM(date1, ~year=1974.0, ~month=0.0, ())\ndate1 == Js.Date.fromString(\"1974-01-22T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setFullYearM: (t, ~year: float, ~month: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setFullYearMD", - "kind": "value", - "name": "setFullYearMD", - "docstrings": [ - "Sets the given `Date`’s year, month, and day of month to the values in the\nlabeled arguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setFullYearMD(date1, ~year=1974.0, ~month=0.0, ~date=7.0, ())\ndate1 == Js.Date.fromString(\"1974-01-07T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setFullYearMD: (\n t,\n ~year: float,\n ~month: float,\n ~date: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHours", - "kind": "value", - "name": "setHours", - "docstrings": [ - "Sets the given `Date`’s hours to the value in the second argument according to\nthe current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextHour = Js.Date.setHours(date1, 22.0)\ndate1 == Js.Date.fromString(\"1973-11-29T22:30:54.321Z00:00\")\nnextHour == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHours: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHoursM", - "kind": "value", - "name": "setHoursM", - "docstrings": [ - "Sets the given `Date`’s hours and minutes to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setHoursM(date1, ~hours=22.0, ~minutes=46.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:54.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHoursM: (t, ~hours: float, ~minutes: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHoursMS", - "kind": "value", - "name": "setHoursMS", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, and seconds to the values in the\nlabeled arguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setHoursMS(date1, ~hours=22.0, ~minutes=46.0, ~seconds=37.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHoursMS: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHoursMSMs", - "kind": "value", - "name": "setHoursMSMs", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, seconds, and milliseconds to the values\nin the labeled arguments according to the current time zone. Returns the number\nof milliseconds since the epoch of the updated `Date`. *This function modifies\nthe original `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setHoursMSMs(\n date1,\n ~hours=22.0,\n ~minutes=46.0,\n ~seconds=37.0,\n ~milliseconds=494.0,\n (),\n)\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHoursMSMs: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMilliseconds", - "kind": "value", - "name": "setMilliseconds", - "docstrings": [ - "Sets the given `Date`’s milliseconds to the value in the second argument\naccording to the current time zone. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMilliseconds(date1, 494.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:30:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMilliseconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMinutes", - "kind": "value", - "name": "setMinutes", - "docstrings": [ - "Sets the given `Date`’s minutes to the value in the second argument according\nto the current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMinutes(date1, 34.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMinutes: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMinutesS", - "kind": "value", - "name": "setMinutesS", - "docstrings": [ - "Sets the given `Date`’s minutes and seconds to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMinutesS(date1, ~minutes=34.0, ~seconds=56.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMinutesS: (t, ~minutes: float, ~seconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMinutesSMs", - "kind": "value", - "name": "setMinutesSMs", - "docstrings": [ - "Sets the given `Date`’s minutes, seconds, and milliseconds to the values in the\nlabeled arguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMinutesSMs(date1, ~minutes=34.0, ~seconds=56.0, ~milliseconds=789.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMinutesSMs: (\n t,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMonth", - "kind": "value", - "name": "setMonth", - "docstrings": [ - "Sets the given `Date`’s month to the value in the second argument according to\nthe current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMonth(date1, 11.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMonth: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMonthD", - "kind": "value", - "name": "setMonthD", - "docstrings": [ - "Sets the given `Date`’s month and day of month to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMonthD(date1, ~month=11.0, ~date=8.0, ())\ndate1 == Js.Date.fromString(\"1973-12-08T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMonthD: (t, ~month: float, ~date: float, unit) => float", - "deprecated": "Use `Date.setMonth` then `Date.setDate`. No direct 1:1 migration available." - }, - { - "id": "Js.Date.setSeconds", - "kind": "value", - "name": "setSeconds", - "docstrings": [ - "Sets the given `Date`’s seconds to the value in the second argument according\nto the current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setSeconds(date1, 56.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setSeconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setSecondsMs", - "kind": "value", - "name": "setSecondsMs", - "docstrings": [ - "Sets the given `Date`’s seconds and milliseconds to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setSecondsMs(date1, ~seconds=56.0, ~milliseconds=789.0, ())\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setSecondsMs: (t, ~seconds: float, ~milliseconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setTime", - "kind": "value", - "name": "setTime", - "docstrings": [ - "Sets the given `Date`’s value in terms of milliseconds since the epoch. Returns\nthe number of milliseconds since the epoch of the updated `Date`. *This\nfunction modifies the original `Date`.* See\n[`Date.setTime`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setTime)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setTime(date1, 198765432101.0)\n\ndate1 == Js.Date.fromString(\"1976-04-19T12:37:12.101Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setTime: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCDate", - "kind": "value", - "name": "setUTCDate", - "docstrings": [ - "Sets the given `Date`’s day of month to the value in the second argument\naccording to UTC. Returns the number of milliseconds since the epoch of the\nupdated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCDate)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet twoWeeksBefore = Js.Date.setUTCDate(date1, 15.0)\ndate1 == Js.Date.fromString(\"1973-11-15T21:30:54.321Z00:00\")\ntwoWeeksBefore == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCDate: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCFullYear", - "kind": "value", - "name": "setUTCFullYear", - "docstrings": [ - "Sets the given `Date`’s year to the value in the second argument according to\nUTC. Returns the number of milliseconds since the epoch of the updated `Date`.\n*This function modifies the original `Date`.* See\n[`Date.setUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextYear = Js.Date.setUTCFullYear(date1, 1974.0)\ndate1 == Js.Date.fromString(\"1974-11-15T21:30:54.321Z00:00\")\nnextYear == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCFullYear: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCFullYearM", - "kind": "value", - "name": "setUTCFullYearM", - "docstrings": [ - "Sets the given `Date`’s year and month to the values in the labeled arguments\naccording to UTC. Returns the number of milliseconds since the epoch of the\nupdated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setUTCFullYearM(date1, ~year=1974.0, ~month=0.0, ())\ndate1 == Js.Date.fromString(\"1974-01-22T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCFullYearM: (t, ~year: float, ~month: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCFullYearMD", - "kind": "value", - "name": "setUTCFullYearMD", - "docstrings": [ - "Sets the given `Date`’s year, month, and day of month to the values in the\nlabeled arguments according to UTC. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setUTCFullYearMD(date1, ~year=1974.0, ~month=0.0, ~date=7.0, ())\ndate1 == Js.Date.fromString(\"1974-01-07T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCFullYearMD: (\n t,\n ~year: float,\n ~month: float,\n ~date: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHours", - "kind": "value", - "name": "setUTCHours", - "docstrings": [ - "Sets the given `Date`’s hours to the value in the second argument according to\nUTC. Returns the number of milliseconds since the epoch of the updated `Date`.\n*This function modifies the original `Date`.* See\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextHour = Js.Date.setUTCHours(date1, 22.0)\ndate1 == Js.Date.fromString(\"1973-11-29T22:30:54.321Z00:00\")\nnextHour == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHours: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHoursM", - "kind": "value", - "name": "setUTCHoursM", - "docstrings": [ - "Sets the given `Date`’s hours and minutes to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCHoursM(date1, ~hours=22.0, ~minutes=46.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:54.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHoursM: (t, ~hours: float, ~minutes: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHoursMS", - "kind": "value", - "name": "setUTCHoursMS", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, and seconds to the values in the\nlabeled arguments according to UTC. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\n\nSee\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCHoursMS(date1, ~hours=22.0, ~minutes=46.0, ~seconds=37.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHoursMS: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHoursMSMs", - "kind": "value", - "name": "setUTCHoursMSMs", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, seconds, and milliseconds to the values\nin the labeled arguments according to UTC. Returns the number of milliseconds\nsince the epoch of the updated `Date`. *This function modifies the original\n`Date`.* See\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCHoursMSMs(\n date1,\n ~hours=22.0,\n ~minutes=46.0,\n ~seconds=37.0,\n ~milliseconds=494.0,\n (),\n)\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHoursMSMs: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMilliseconds", - "kind": "value", - "name": "setUTCMilliseconds", - "docstrings": [ - "Sets the given `Date`’s milliseconds to the value in the second argument\naccording to UTC. Returns the number of milliseconds since the epoch of the\nupdated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMilliseconds(date1, 494.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:30:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMilliseconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMinutes", - "kind": "value", - "name": "setUTCMinutes", - "docstrings": [ - "Sets the given `Date`’s minutes to the value in the second argument according\nto the current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMinutes(date1, 34.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMinutes: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMinutesS", - "kind": "value", - "name": "setUTCMinutesS", - "docstrings": [ - "Sets the given `Date`’s minutes and seconds to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMinutesS(date1, ~minutes=34.0, ~seconds=56.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMinutesS: (t, ~minutes: float, ~seconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMinutesSMs", - "kind": "value", - "name": "setUTCMinutesSMs", - "docstrings": [ - "Sets the given `Date`’s minutes, seconds, and milliseconds to the values in the\nlabeled arguments according to UTC. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMinutesSMs(\n date1,\n ~minutes=34.0,\n ~seconds=56.0,\n ~milliseconds=789.0,\n (),\n)\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMinutesSMs: (\n t,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMonth", - "kind": "value", - "name": "setUTCMonth", - "docstrings": [ - "Sets the given `Date`’s month to the value in the second argument according to\nUTC. Returns the number of milliseconds since the epoch of the updated `Date`.\n*This function modifies the original `Date`.* See\n[`Date.setUTCMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMonth(date1, 11.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMonth: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMonthD", - "kind": "value", - "name": "setUTCMonthD", - "docstrings": [ - "Sets the given `Date`’s month and day of month to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMonthD(date1, ~month=11.0, ~date=8.0, ())\ndate1 == Js.Date.fromString(\"1973-12-08T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMonthD: (t, ~month: float, ~date: float, unit) => float", - "deprecated": "Use `Date.setUTCMonth` then `Date.setUTCDate`. No direct 1:1 migration available." - }, - { - "id": "Js.Date.setUTCSeconds", - "kind": "value", - "name": "setUTCSeconds", - "docstrings": [ - "Sets the given `Date`’s seconds to the value in the second argument according\nto UTC. Returns the number of milliseconds since the epoch of the updated\n`Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCSeconds(date1, 56.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCSeconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCSecondsMs", - "kind": "value", - "name": "setUTCSecondsMs", - "docstrings": [ - "Sets the given `Date`’s seconds and milliseconds to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCSecondsMs(date1, ~seconds=56.0, ~milliseconds=789.0, ())\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCSecondsMs: (t, ~seconds: float, ~milliseconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCTime", - "kind": "value", - "name": "setUTCTime", - "docstrings": [ - "Same as [`setTime()`](#settime)." - ], - "signature": "let setUTCTime: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setYear", - "kind": "value", - "name": "setYear", - "docstrings": [], - "signature": "let setYear: (t, float) => float", - "deprecated": "Use `setFullYear` instead" - }, - { - "id": "Js.Date.toDateString", - "kind": "value", - "name": "toDateString", - "docstrings": [ - "Returns the date (day of week, year, month, and day of month) portion of a\n`Date` in English. See\n[`Date.toDateString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toDateString(exampleDate) == \"Thu Nov 29 1973\"\n```" - ], - "signature": "let toDateString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toGMTString", - "kind": "value", - "name": "toGMTString", - "docstrings": [], - "signature": "let toGMTString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toISOString", - "kind": "value", - "name": "toISOString", - "docstrings": [ - "Returns a simplified version of the ISO 8601 format for the date. See\n[`Date.toISOString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toISOString(exampleDate) == \"1973-11-29T21:30:54.321Z\"\n```" - ], - "signature": "let toISOString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toJSON", - "kind": "value", - "name": "toJSON", - "docstrings": [], - "signature": "let toJSON: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toJSONUnsafe", - "kind": "value", - "name": "toJSONUnsafe", - "docstrings": [ - "Returns a string representation of the given date. See\n[`Date.toJSON`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON)\non MDN." - ], - "signature": "let toJSONUnsafe: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toLocaleDateString", - "kind": "value", - "name": "toLocaleDateString", - "docstrings": [ - "Returns the year, month, and day for the given `Date` in the current locale\nformat. See\n[`Date.toLocaleDateString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toLocaleDateString(exampleDate) == \"11/29/1973\" // for en_US.utf8\nJs.Date.toLocaleDateString(exampleDate) == \"29.11.73\" // for de_DE.utf8\n```" - ], - "signature": "let toLocaleDateString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Returns the time and date for the given `Date` in the current locale format.\nSee\n[`Date.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toLocaleString(exampleDate) == \"11/29/1973, 10:30:54 PM\" // for en_US.utf8\nJs.Date.toLocaleString(exampleDate) == \"29.11.1973, 22:30:54\" // for de_DE.utf8\n```" - ], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toLocaleTimeString", - "kind": "value", - "name": "toLocaleTimeString", - "docstrings": [ - "Returns the time of day for the given `Date` in the current locale format. See\n[`Date.toLocaleTimeString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toLocaleString(exampleDate) == \"10:30:54 PM\" // for en_US.utf8\nJs.Date.toLocaleString(exampleDate) == \"22:30:54\" // for de_DE.utf8\n```" - ], - "signature": "let toLocaleTimeString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Returns a string representing the date and time of day for the given `Date` in\nthe current locale and time zone. See\n[`Date.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toString(\n exampleDate,\n) == \"Thu Nov 29 1973 22:30:54 GMT+0100 (Central European Standard Time)\"\n```" - ], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toTimeString", - "kind": "value", - "name": "toTimeString", - "docstrings": [ - "Returns a string representing the time of day for the given `Date` in the\ncurrent locale and time zone. See\n[`Date.toTimeString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toTimeString(exampleDate) == \"22:30:54 GMT+0100 (Central European Standard Time)\"\n```" - ], - "signature": "let toTimeString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toUTCString", - "kind": "value", - "name": "toUTCString", - "docstrings": [ - "Returns a string representing the date and time of day for the given `Date` in\nthe current locale and UTC (GMT time zone). See\n[`Date.toUTCString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toUTCString(exampleDate) == \"Thu, 29 Nov 1973 21:30:54 GMT\"\n```" - ], - "signature": "let toUTCString: t => string", - "deprecated": "" - } - ] - }, - "js/promise2": { - "id": "Js.Promise2", - "name": "Promise2", - "docstrings": [ - "Provide bindings to JS Promise" - ], - "items": [ - { - "id": "Js.Promise2.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.error", - "kind": "type", - "name": "error", - "docstrings": [], - "signature": "type error" - }, - { - "id": "Js.Promise2.then", - "kind": "value", - "name": "then", - "docstrings": [ - "Type-safe t-first then" - ], - "signature": "let then: (promise<'a>, 'a => promise<'b>) => promise<'b>", - "deprecated": "" - }, - { - "id": "Js.Promise2.catch", - "kind": "value", - "name": "catch", - "docstrings": [ - "Type-safe t-first catch" - ], - "signature": "let catch: (promise<'a>, error => promise<'a>) => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (\n (~resolve: 'a => unit, ~reject: exn => unit) => unit,\n) => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.resolve", - "kind": "value", - "name": "resolve", - "docstrings": [], - "signature": "let resolve: 'a => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.reject", - "kind": "value", - "name": "reject", - "docstrings": [], - "signature": "let reject: exn => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all", - "kind": "value", - "name": "all", - "docstrings": [], - "signature": "let all: array> => promise>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all2", - "kind": "value", - "name": "all2", - "docstrings": [], - "signature": "let all2: ((promise<'a0>, promise<'a1>)) => promise<('a0, 'a1)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all3", - "kind": "value", - "name": "all3", - "docstrings": [], - "signature": "let all3: (\n (promise<'a0>, promise<'a1>, promise<'a2>),\n) => promise<('a0, 'a1, 'a2)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all4", - "kind": "value", - "name": "all4", - "docstrings": [], - "signature": "let all4: (\n (promise<'a0>, promise<'a1>, promise<'a2>, promise<'a3>),\n) => promise<('a0, 'a1, 'a2, 'a3)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all5", - "kind": "value", - "name": "all5", - "docstrings": [], - "signature": "let all5: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all6", - "kind": "value", - "name": "all6", - "docstrings": [], - "signature": "let all6: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n promise<'a5>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4, 'a5)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.race", - "kind": "value", - "name": "race", - "docstrings": [], - "signature": "let race: array> => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.unsafe_async", - "kind": "value", - "name": "unsafe_async", - "docstrings": [], - "signature": "let unsafe_async: 'a => promise<'a>" - }, - { - "id": "Js.Promise2.unsafe_await", - "kind": "value", - "name": "unsafe_await", - "docstrings": [], - "signature": "let unsafe_await: promise<'a> => 'a" - } - ] - }, - "js/promise": { - "id": "Js.Promise", - "name": "Promise", - "docstrings": [ - "Provide bindings to JS Promise", - "Deprecation note: These bindings are pretty outdated and cannot be used properly\nwith the `->` operator.\n\nMore details on proper Promise usage can be found here:\nhttps://rescript-lang.org/docs/manual/latest/promise#promise-legacy" - ], - "items": [ - { - "id": "Js.Promise.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.error", - "kind": "type", - "name": "error", - "docstrings": [], - "signature": "type error = Js_promise2.error", - "deprecated": "" - }, - { - "id": "Js.Promise.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (\n (~resolve: 'a => unit, ~reject: exn => unit) => unit,\n) => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.resolve", - "kind": "value", - "name": "resolve", - "docstrings": [], - "signature": "let resolve: 'a => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.reject", - "kind": "value", - "name": "reject", - "docstrings": [], - "signature": "let reject: exn => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.all", - "kind": "value", - "name": "all", - "docstrings": [], - "signature": "let all: array> => promise>", - "deprecated": "" - }, - { - "id": "Js.Promise.all2", - "kind": "value", - "name": "all2", - "docstrings": [], - "signature": "let all2: ((promise<'a0>, promise<'a1>)) => promise<('a0, 'a1)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all3", - "kind": "value", - "name": "all3", - "docstrings": [], - "signature": "let all3: (\n (promise<'a0>, promise<'a1>, promise<'a2>),\n) => promise<('a0, 'a1, 'a2)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all4", - "kind": "value", - "name": "all4", - "docstrings": [], - "signature": "let all4: (\n (promise<'a0>, promise<'a1>, promise<'a2>, promise<'a3>),\n) => promise<('a0, 'a1, 'a2, 'a3)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all5", - "kind": "value", - "name": "all5", - "docstrings": [], - "signature": "let all5: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all6", - "kind": "value", - "name": "all6", - "docstrings": [], - "signature": "let all6: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n promise<'a5>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4, 'a5)>", - "deprecated": "" - }, - { - "id": "Js.Promise.race", - "kind": "value", - "name": "race", - "docstrings": [], - "signature": "let race: array> => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.then_", - "kind": "value", - "name": "then_", - "docstrings": [], - "signature": "let then_: ('a => promise<'b>, promise<'a>) => promise<'b>", - "deprecated": "" - }, - { - "id": "Js.Promise.catch", - "kind": "value", - "name": "catch", - "docstrings": [], - "signature": "let catch: (error => promise<'a>, promise<'a>) => promise<'a>", - "deprecated": "" - } - ] - }, - "js/re": { - "id": "Js.Re", - "name": "Re", - "docstrings": [ - "Provide bindings to JS regex expression", - "Provide bindings to JS regular expressions (RegExp).\n\n**Note:** This is not an immutable API. A RegExp object with the `global` (\"g\")\nflag set will modify the [`lastIndex`]() property when the RegExp object is used,\nand subsequent uses will continue the search from the previous [`lastIndex`]()." - ], - "items": [ - { - "id": "Js.Re.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The RegExp object." - ], - "signature": "type t = RegExp.t", - "deprecated": "" - }, - { - "id": "Js.Re.result", - "kind": "type", - "name": "result", - "docstrings": [ - "The result of a executing a RegExp on a string." - ], - "signature": "type result" - }, - { - "id": "Js.Re.captures", - "kind": "value", - "name": "captures", - "docstrings": [ - "An `array` of the match and captures, the first is the full match and the\nremaining are the substring captures." - ], - "signature": "let captures: result => array>", - "deprecated": "" - }, - { - "id": "Js.Re.matches", - "kind": "value", - "name": "matches", - "docstrings": [], - "signature": "let matches: result => array", - "deprecated": "" - }, - { - "id": "Js.Re.index", - "kind": "value", - "name": "index", - "docstrings": [ - "0-based index of the match in the input string." - ], - "signature": "let index: result => int", - "deprecated": "" - }, - { - "id": "Js.Re.input", - "kind": "value", - "name": "input", - "docstrings": [ - "The original input string." - ], - "signature": "let input: result => string", - "deprecated": "" - }, - { - "id": "Js.Re.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Constructs a RegExp object (Js.Re.t) from a `string`.\nRegex literals `/.../` should generally be preferred, but `fromString`\nis useful when you need to dynamically construct a regex using strings,\nexactly like when you do so in JavaScript.\n\n## Examples\n\n```rescript\nlet firstReScriptFileExtension = (filename, content) => {\n let result = Js.Re.fromString(filename ++ \"\\.(res|resi)\")->Js.Re.exec_(content)\n switch result {\n | Some(r) => Js.Nullable.toOption(Js.Re.captures(r)[1])\n | None => None\n }\n}\n\n// outputs \"res\"\nfirstReScriptFileExtension(\"School\", \"School.res School.resi Main.js School.bs.js\")\n```" - ], - "signature": "let fromString: string => t", - "deprecated": "" - }, - { - "id": "Js.Re.fromStringWithFlags", - "kind": "value", - "name": "fromStringWithFlags", - "docstrings": [ - "Constructs a RegExp object (`Js.Re.t`) from a string with the given flags.\nSee `Js.Re.fromString`.\n\nValid flags:\n\n- **g** global\n- **i** ignore case\n- **m** multiline\n- **u** unicode (es2015)\n- **y** sticky (es2015)" - ], - "signature": "let fromStringWithFlags: (string, ~flags: string) => t", - "deprecated": "" - }, - { - "id": "Js.Re.flags", - "kind": "value", - "name": "flags", - "docstrings": [ - "Returns the enabled flags as a string." - ], - "signature": "let flags: t => string", - "deprecated": "" - }, - { - "id": "Js.Re.global", - "kind": "value", - "name": "global", - "docstrings": [ - "Returns a `bool` indicating whether the global flag is set." - ], - "signature": "let global: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.ignoreCase", - "kind": "value", - "name": "ignoreCase", - "docstrings": [ - "Returns a `bool` indicating whether the ignoreCase flag is set." - ], - "signature": "let ignoreCase: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.lastIndex", - "kind": "value", - "name": "lastIndex", - "docstrings": [ - "Returns the index where the next match will start its search. This property\nwill be modified when the RegExp object is used, if the global (\"g\") flag is\nset.\n\n## Examples\n\n```rescript\nlet re = /ab*TODO/g\nlet str = \"abbcdefabh\"\n\nlet break = ref(false)\nwhile !break.contents {\n switch Js.Re.exec_(re, str) {\n | Some(result) =>\n Js.Nullable.iter(Js.Re.captures(result)[0], match_ => {\n let next = Belt.Int.toString(Js.Re.lastIndex(re))\n Js.log(\"Found \" ++ (match_ ++ (\". Next match starts at \" ++ next)))\n })\n | None => break := true\n }\n}\n```\n\nSee\n[`RegExp: lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex)\non MDN." - ], - "signature": "let lastIndex: t => int", - "deprecated": "" - }, - { - "id": "Js.Re.setLastIndex", - "kind": "value", - "name": "setLastIndex", - "docstrings": [ - "Sets the index at which the next match will start its search from." - ], - "signature": "let setLastIndex: (t, int) => unit", - "deprecated": "" - }, - { - "id": "Js.Re.multiline", - "kind": "value", - "name": "multiline", - "docstrings": [ - "Returns a `bool` indicating whether the multiline flag is set." - ], - "signature": "let multiline: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.source", - "kind": "value", - "name": "source", - "docstrings": [ - "Returns the pattern as a `string`." - ], - "signature": "let source: t => string", - "deprecated": "" - }, - { - "id": "Js.Re.sticky", - "kind": "value", - "name": "sticky", - "docstrings": [ - "Returns a `bool` indicating whether the sticky flag is set." - ], - "signature": "let sticky: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.unicode", - "kind": "value", - "name": "unicode", - "docstrings": [ - "Returns a `bool` indicating whether the unicode flag is set." - ], - "signature": "let unicode: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.exec_", - "kind": "value", - "name": "exec_", - "docstrings": [ - "Executes a search on a given string using the given RegExp object.\nReturns `Some(Js.Re.result)` if a match is found, `None` otherwise.\n\n## Examples\n\n```rescript\n/* Match \"quick brown\" followed by \"jumps\", ignoring characters in between\n * Remember \"brown\" and \"jumps\"\n * Ignore case\n */\n\nlet re = /quick\\s(brown).+?(jumps)/ig\nlet result = Js.Re.exec_(re, \"The Quick Brown Fox Jumps Over The Lazy Dog\")\n```\n\nSee [`RegExp.prototype.exec()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec)\non MDN." - ], - "signature": "let exec_: (t, string) => option", - "deprecated": "" - }, - { - "id": "Js.Re.test_", - "kind": "value", - "name": "test_", - "docstrings": [ - "Tests whether the given RegExp object will match a given `string`.\nReturns true if a match is found, false otherwise.\n\n## Examples\n\n```rescript\n/* A simple implementation of Js.String.startsWith */\n\nlet str = \"hello world!\"\n\nlet startsWith = (target, substring) => Js.Re.fromString(\"^\" ++ substring)->Js.Re.test_(target)\n\nJs.log(str->startsWith(\"hello\")) /* prints \"true\" */\n```\n\nSee [`RegExp.prototype.test()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test)\non MDN." - ], - "signature": "let test_: (t, string) => bool", - "deprecated": "" - } - ] - }, - "js/string2": { - "id": "Js.String2", - "name": "String2", - "docstrings": [ - "Provide bindings to JS string", - "Provide bindings to JS string. Optimized for pipe-first." - ], - "items": [ - { - "id": "Js.String2.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = string", - "deprecated": "" - }, - { - "id": "Js.String2.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nJs.String2.make(3.5) == \"3.5\"\nJs.String2.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCharCode", - "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to\nthat number; `n` ranges from 0 to 65535.If out of range, the lower 16 bits of\nthe value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as\n`fromCharCode(0xF63A)`.\n\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCharCode(65) == \"A\"\nJs.String2.fromCharCode(0x3c8) == `ψ`\nJs.String2.fromCharCode(0xd55c) == `한`\nJs.String2.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCharCodeMany", - "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`.\n\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)\non MDN." - ], - "signature": "let fromCharCodeMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCodePoint", - "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point. If the number is not a valid code point, it throws\n`RangeError`. Thus, `fromCodePoint(0x1F63A)` will produce a correct value,\nunlike `fromCharCode(0x1F63A)`, and `fromCodePoint(-5)` will throw a\n`RangeError`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePoint(65) == \"A\"\nJs.String2.fromCodePoint(0x3c8) == `ψ`\nJs.String2.fromCodePoint(0xd55c) == `한`\nJs.String2.fromCodePoint(0x1f63a) == `😺`\n```" - ], - "signature": "let fromCodePoint: int => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCodePointMany", - "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```" - ], - "signature": "let fromCodePointMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String2.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(s)` returns the length of the given `string`.\n\nSee [`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.length(\"abcd\") == 4\n```" - ], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.String2.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(s, n)` returns as a `string` the character at the given index number. If\n`n` is out of range, this function returns `undefined`,so at some point this\nfunction may be modified to return `option`.\n\n## Examples\n\n```rescript\nJs.String2.get(\"Reason\", 0) == \"R\"\nJs.String2.get(\"Reason\", 4) == \"o\"\nJs.String2.get(`Rẽasöń`, 5) == `ń`\n```" - ], - "signature": "let get: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.charAt", - "kind": "value", - "name": "charAt", - "docstrings": [ - "`charAt(s, n)` gets the character at index `n` within string `s`. If `n` is\nnegative or greater than the length of `s`, it returns the empty string. If the\nstring contains characters outside the range \\\\u0000-\\\\uffff, it will return the\nfirst 16-bit value at that position in the string.\n\nSee [`String.charAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.charAt(\"Reason\", 0) == \"R\"\nJs.String2.charAt(\"Reason\", 12) == \"\"\nJs.String2.charAt(`Rẽasöń`, 5) == `ń`\n```" - ], - "signature": "let charAt: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.charCodeAt", - "kind": "value", - "name": "charCodeAt", - "docstrings": [ - "`charCodeAt(s, n)` returns the character code at position `n` in string `s`;\nthe result is in the range 0-65535, unlke `codePointAt`, so it will not work\ncorrectly for characters with code points greater than or equal to 0x10000. The\nreturn type is `float` because this function returns NaN if `n` is less than\nzero or greater than the length of the string.\n\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.charCodeAt(`😺`, 0) == 0xd83d->Belt.Int.toFloat\nJs.String2.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" - ], - "signature": "let charCodeAt: (t, int) => float", - "deprecated": "" - }, - { - "id": "Js.String2.codePointAt", - "kind": "value", - "name": "codePointAt", - "docstrings": [ - "`codePointAt(s, n)` returns the code point at position `n` within string `s` as\na `Some(value)`. The return value handles code points greater than or equal to\n0x10000. If there is no code point at the given position, the function returns\n`None`.\n\nSee [`String.codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.codePointAt(`¿😺?`, 1) == Some(0x1f63a)\nJs.String2.codePointAt(\"abc\", 5) == None\n```" - ], - "signature": "let codePointAt: (t, int) => option", - "deprecated": "" - }, - { - "id": "Js.String2.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(original, append)` returns a new `string` with `append` added after\n`original`.\n\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.concat(\"cow\", \"bell\") == \"cowbell\"\n```" - ], - "signature": "let concat: (t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(original, arr)` returns a new `string` consisting of each item of an\narray of strings added to the `original` string.\n\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.concatMany(\"1st\", [\"2nd\", \"3rd\", \"4th\"]) == \"1st2nd3rd4th\"\n```" - ], - "signature": "let concatMany: (t, array) => t", - "deprecated": "" - }, - { - "id": "Js.String2.endsWith", - "kind": "value", - "name": "endsWith", - "docstrings": [ - "ES2015: `endsWith(str, substr)` returns `true` if the `str` ends with `substr`,\n`false` otherwise.\n\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.endsWith(\"ReScript\", \"Script\") == true\nJs.String2.endsWith(\"C++\", \"Script\") == false\n```" - ], - "signature": "let endsWith: (t, t) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.endsWithFrom", - "kind": "value", - "name": "endsWithFrom", - "docstrings": [ - "`endsWithFrom(str, ending, len)` returns `true` if the first len characters of\n`str` end with `ending`, `false` otherwise. If `len` is greater than or equal\nto the length of `str`, then it works like `endsWith`. (Honestly, this should\nhave been named endsWithAt, but oh well).\n\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.endsWithFrom(\"abcd\", \"cd\", 4) == true\nJs.String2.endsWithFrom(\"abcde\", \"cd\", 3) == false\nJs.String2.endsWithFrom(\"abcde\", \"cde\", 99) == true\nJs.String2.endsWithFrom(\"example.dat\", \"ple\", 7) == true\n```" - ], - "signature": "let endsWithFrom: (t, t, int) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "ES2015: `includes(str, searchValue)` returns `true` if `searchValue` is found\nanywhere within `str`, false otherwise.\n\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.includes(\"programmer\", \"gram\") == true\nJs.String2.includes(\"programmer\", \"er\") == true\nJs.String2.includes(\"programmer\", \"pro\") == true\nJs.String2.includes(\"programmer.dat\", \"xyz\") == false\n```" - ], - "signature": "let includes: (t, t) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.includesFrom", - "kind": "value", - "name": "includesFrom", - "docstrings": [ - "ES2015: `includes(str, searchValue start)` returns `true` if `searchValue` is\nfound anywhere within `str` starting at character number `start` (where 0 is\nthe first character), `false` otherwise.\n\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.includesFrom(\"programmer\", \"gram\", 1) == true\nJs.String2.includesFrom(\"programmer\", \"gram\", 4) == false\nJs.String2.includesFrom(`대한민국`, `한`, 1) == true\n```" - ], - "signature": "let includesFrom: (t, t, int) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "ES2015: `indexOf(str, searchValue)` returns the position at which `searchValue`\nwas first found within `str`, or -1 if `searchValue` is not in `str`.\n\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.indexOf(\"bookseller\", \"ok\") == 2\nJs.String2.indexOf(\"bookseller\", \"sell\") == 4\nJs.String2.indexOf(\"beekeeper\", \"ee\") == 1\nJs.String2.indexOf(\"bookseller\", \"xyz\") == -1\n```" - ], - "signature": "let indexOf: (t, t) => int", - "deprecated": "" - }, - { - "id": "Js.String2.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "`indexOfFrom(str, searchValue, start)` returns the position at which\n`searchValue` was found within `str` starting at character position `start`, or\n\\-1 if `searchValue` is not found in that portion of `str`. The return value is\nrelative to the beginning of the string, no matter where the search started\nfrom.\n\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.indexOfFrom(\"bookseller\", \"ok\", 1) == 2\nJs.String2.indexOfFrom(\"bookseller\", \"sell\", 2) == 4\nJs.String2.indexOfFrom(\"bookseller\", \"sell\", 5) == -1\n```" - ], - "signature": "let indexOfFrom: (t, t, int) => int", - "deprecated": "" - }, - { - "id": "Js.String2.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(str, searchValue)` returns the position of the last occurrence of\n`searchValue` within `str`, searching backwards from the end of the string.\nReturns -1 if `searchValue` is not in `str`. The return value is always\nrelative to the beginning of the string.\n\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.lastIndexOf(\"bookseller\", \"ok\") == 2\nJs.String2.lastIndexOf(\"beekeeper\", \"ee\") == 4\nJs.String2.lastIndexOf(\"abcdefg\", \"xyz\") == -1\n```" - ], - "signature": "let lastIndexOf: (t, t) => int", - "deprecated": "" - }, - { - "id": "Js.String2.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "`lastIndexOfFrom(str, searchValue, start)` returns the position of the last\noccurrence of `searchValue` within `str`, searching backwards from the given\nstart position. Returns -1 if `searchValue` is not in `str`. The return value\nis always relative to the beginning of the string.\n\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.lastIndexOfFrom(\"bookseller\", \"ok\", 6) == 2\nJs.String2.lastIndexOfFrom(\"beekeeper\", \"ee\", 8) == 4\nJs.String2.lastIndexOfFrom(\"beekeeper\", \"ee\", 3) == 1\nJs.String2.lastIndexOfFrom(\"abcdefg\", \"xyz\", 4) == -1\n```" - ], - "signature": "let lastIndexOfFrom: (t, t, int) => int", - "deprecated": "" - }, - { - "id": "Js.String2.localeCompare", - "kind": "value", - "name": "localeCompare", - "docstrings": [ - "`localeCompare(reference, comparison)` returns\n- a negative value if reference comes before comparison in sort order\n- zero if reference and comparison have the same sort order\n- a positive value if reference comes after comparison in sort order\n\nSee [`String.localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.localeCompare(\"zebra\", \"ant\") > 0.0\nJs.String2.localeCompare(\"ant\", \"zebra\") < 0.0\nJs.String2.localeCompare(\"cat\", \"cat\") == 0.0\nJs.String2.localeCompare(\"CAT\", \"cat\") > 0.0\n```" - ], - "signature": "let localeCompare: (t, t) => float", - "deprecated": "" - }, - { - "id": "Js.String2.match_", - "kind": "value", - "name": "match_", - "docstrings": [ - "`match(str, regexp)` matches a `string` against the given `regexp`. If there is\nno match, it returns `None`. For regular expressions without the g modifier, if\nthere is a match, the return value is `Some(array)` where the array contains:\n- The entire matched string\n- Any capture groups if the regexp had parentheses\n For regular expressions with the g modifier, a matched expression returns\n `Some(array)` with all the matched substrings and no capture groups.\n\nSee [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.match_(\"The better bats\", /b[aeiou]t/) == Some([\"bet\"])\nJs.String2.match_(\"The better bats\", /b[aeiou]t/g) == Some([\"bet\", \"bat\"])\nJs.String2.match_(\"Today is 2018-04-05.\", /(\\d+)-(\\d+)-(\\d+)/) ==\n Some([\"2018-04-05\", \"2018\", \"04\", \"05\"])\nJs.String2.match_(\"The large container.\", /b[aeiou]g/) == None\n```" - ], - "signature": "let match_: (t, Js_re.t) => option>>", - "deprecated": "" - }, - { - "id": "Js.String2.normalize", - "kind": "value", - "name": "normalize", - "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\u00e3 or the combination of a lower case letter A\n\\u0061 and a combining tilde \\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)\non MDN. See also [Unicode technical report\n#15](https://unicode.org/reports/tr15/) for details." - ], - "signature": "let normalize: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.normalizeByForm", - "kind": "value", - "name": "normalizeByForm", - "docstrings": [ - "ES2015: `normalize(str, form)` returns the normalized Unicode string using the\nspecified form of normalization, which may be one of:\n- \"NFC\" — Normalization Form Canonical Composition.\n- \"NFD\" — Normalization Form Canonical Decomposition.\n- \"NFKC\" — Normalization Form Compatibility Composition.\n- \"NFKD\" — Normalization Form Compatibility Decomposition.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\nSee also [Unicode technical report #15](https://unicode.org/reports/tr15/) for details." - ], - "signature": "let normalizeByForm: (t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.repeat", - "kind": "value", - "name": "repeat", - "docstrings": [ - "`repeat(str, n)` returns a `string` that consists of `n` repetitions of `str`.\nThrows `RangeError` if `n` is negative.\n\nSee [`String.repeat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.repeat(\"ha\", 3) == \"hahaha\"\nJs.String2.repeat(\"empty\", 0) == \"\"\n```" - ], - "signature": "let repeat: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.replace", - "kind": "value", - "name": "replace", - "docstrings": [ - "ES2015: `replace(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with the first matching instance of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.replace(\"old string\", \"old\", \"new\") == \"new string\"\nJs.String2.replace(\"the cat and the dog\", \"the\", \"this\") == \"this cat and the dog\"\n```" - ], - "signature": "let replace: (t, t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.replaceByRe", - "kind": "value", - "name": "replaceByRe", - "docstrings": [ - "`replaceByRe(str, regex, replacement)` returns a new `string` where occurrences\nmatching regex have been replaced by `replacement`.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.replaceByRe(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nJs.String2.replaceByRe(\"Juan Fulano\", /(\\w+) (\\w+)/, \"$2, $1\") == \"Fulano, Juan\"\n```" - ], - "signature": "let replaceByRe: (t, Js_re.t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy0", - "kind": "value", - "name": "unsafeReplaceBy0", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with no capturing\nparentheses replaced by the value returned from the given function. The\nfunction receives as its parameters the matched string, the offset at which the\nmatch begins, and the whole string being matched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (matchPart, _offset, _wholeString) => Js.String2.toUpperCase(matchPart)\n\nJs.String2.unsafeReplaceBy0(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" - ], - "signature": "let unsafeReplaceBy0: (t, Js_re.t, (t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy1", - "kind": "value", - "name": "unsafeReplaceBy1", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with one set of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstring, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (_match, part1, _offset, _wholeString) => {\n part1 ++ \"41\"\n}\n\nJs.String2.unsafeReplaceBy1(str, re, matchFn) == \"Jony is 41\"\n```" - ], - "signature": "let unsafeReplaceBy1: (t, Js_re.t, (t, t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy2", - "kind": "value", - "name": "unsafeReplaceBy2", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with two sets of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstrings, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (_match, p1, p2, _offset, _wholeString) => {\n switch (Belt.Int.fromString(p1), Belt.Int.fromString(p2)) {\n | (Some(x), Some(y)) => Belt.Int.toString(x * y)\n | _ => \"???\"\n }\n}\n\nJs.String2.unsafeReplaceBy2(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let unsafeReplaceBy2: (t, Js_re.t, (t, t, t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy3", - "kind": "value", - "name": "unsafeReplaceBy3", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with three sets of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstrings, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN." - ], - "signature": "let unsafeReplaceBy3: (t, Js_re.t, (t, t, t, t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.search", - "kind": "value", - "name": "search", - "docstrings": [ - "`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\n\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.search(\"testing 1 2 3\", /\\d+/) == 8\nJs.String2.search(\"no numbers\", /\\d+/) == -1\n```" - ], - "signature": "let search: (t, Js_re.t) => int", - "deprecated": "" - }, - { - "id": "Js.String2.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(str, from:n1, to_:n2)` returns the substring of `str` starting at\ncharacter `n1` up to but not including `n2`.\n- If either `n1` or `n2` is negative, then it is evaluated as `length(str - n1)` or `length(str - n2)`.\n- If `n2` is greater than the length of `str`, then it is treated as `length(str)`.\n- If `n1` is greater than `n2`, slice returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=5) == \"cde\"\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=9) == \"cdefg\"\nJs.String2.slice(\"abcdefg\", ~from=-4, ~to_=-2) == \"de\"\nJs.String2.slice(\"abcdefg\", ~from=5, ~to_=1) == \"\"\n```" - ], - "signature": "let slice: (t, ~from: int, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(str, from:n)` returns the substring of `str` starting at character\n`n` to the end of the string.\n- If `n` is negative, then it is evaluated as `length(str - n)`.\n- If `n` is greater than the length of `str`, then sliceToEnd returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.sliceToEnd(\"abcdefg\", ~from=4) == \"efg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=-2) == \"fg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=7) == \"\"\n```" - ], - "signature": "let sliceToEnd: (t, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nJs.String2.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nJs.String2.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nJs.String2.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```" - ], - "signature": "let split: (t, t) => array", - "deprecated": "" - }, - { - "id": "Js.String2.splitAtMost", - "kind": "value", - "name": "splitAtMost", - "docstrings": [ - "`splitAtMost delimiter ~limit: n str` splits the given `str` at every occurrence of `delimiter` and returns an array of the first `n` resulting substrings. If `n` is negative or greater than the number of substrings, the array will contain all the substrings.\n\n```\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 3 = [|\"ant\"; \"bee\"; \"cat\"|];;\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 0 = [| |];;\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 9 = [|\"ant\"; \"bee\"; \"cat\"; \"dog\"; \"elk\"|];;\n```" - ], - "signature": "let splitAtMost: (t, t, ~limit: int) => array", - "deprecated": "" - }, - { - "id": "Js.String2.splitByRe", - "kind": "value", - "name": "splitByRe", - "docstrings": [ - "`splitByRe(str, regex)` splits the given `str` at every occurrence of `regex`\nand returns an array of the resulting substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.splitByRe(\"art; bed , cog ;dad\", /\\s*[,;]\\s*TODO/) == [\n Some(\"art\"),\n Some(\"bed\"),\n Some(\"cog\"),\n Some(\"dad\"),\n ]\n```" - ], - "signature": "let splitByRe: (t, Js_re.t) => array>", - "deprecated": "" - }, - { - "id": "Js.String2.splitByReAtMost", - "kind": "value", - "name": "splitByReAtMost", - "docstrings": [ - "`splitByReAtMost(str, regex, ~limit:n)` splits the given `str` at every\noccurrence of `regex` and returns an array of the first `n` resulting\nsubstrings. If `n` is negative or greater than the number of substrings, the\narray will contain all the substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=3) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n ]\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=0) == []\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=8) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n Some(\"four\"),\n ]\n```" - ], - "signature": "let splitByReAtMost: (t, Js_re.t, ~limit: int) => array>", - "deprecated": "" - }, - { - "id": "Js.String2.startsWith", - "kind": "value", - "name": "startsWith", - "docstrings": [ - "ES2015: `startsWith(str, substr)` returns `true` if the `str` starts with\n`substr`, `false` otherwise.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWith(\"ReScript\", \"Re\") == true\nJs.String2.startsWith(\"ReScript\", \"\") == true\nJs.String2.startsWith(\"JavaScript\", \"Re\") == false\n```" - ], - "signature": "let startsWith: (t, t) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.startsWithFrom", - "kind": "value", - "name": "startsWithFrom", - "docstrings": [ - "ES2015: `startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, false otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWithFrom(\"ReScript\", \"Scri\", 2) == true\nJs.String2.startsWithFrom(\"ReScript\", \"\", 2) == true\nJs.String2.startsWithFrom(\"JavaScript\", \"Scri\", 2) == false\n```" - ], - "signature": "let startsWithFrom: (t, t, int) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.substr", - "kind": "value", - "name": "substr", - "docstrings": [ - "`substr(str, ~from:n)` returns the substring of `str` from position `n` to the\nend of the string.\n- If `n` is less than zero, the starting position is the length of `str - n`.\n- If `n` is greater than or equal to the length of `str`, returns the empty string.\n\nJavaScript’s `String.substr()` is a legacy function. When possible, use\n`substring()` instead.\n\nSee [`String.substr`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.substr(\"abcdefghij\", ~from=3) == \"defghij\"\nJs.String2.substr(\"abcdefghij\", ~from=-3) == \"hij\"\nJs.String2.substr(\"abcdefghij\", ~from=12) == \"\"\n```" - ], - "signature": "let substr: (t, ~from: int) => t", - "deprecated": "Use `String.substring` instead" - }, - { - "id": "Js.String2.substrAtMost", - "kind": "value", - "name": "substrAtMost", - "docstrings": [ - "`substrAtMost(str, ~from: pos, ~length: n)` returns the substring of `str` of\nlength `n` starting at position `pos`.\n- If `pos` is less than zero, the starting position is the length of `str - pos`.\n- If `pos` is greater than or equal to the length of `str`, returns the empty string.\n- If `n` is less than or equal to zero, returns the empty string.\n\nJavaScript’s `String.substr()` is a legacy function. When possible, use\n`substring()` instead.\n\nSee [`String.substr`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.substrAtMost(\"abcdefghij\", ~from=3, ~length=4) == \"defg\"\nJs.String2.substrAtMost(\"abcdefghij\", ~from=-3, ~length=4) == \"hij\"\nJs.String2.substrAtMost(\"abcdefghij\", ~from=12, ~length=2) == \"\"\n```" - ], - "signature": "let substrAtMost: (t, ~from: int, ~length: int) => t", - "deprecated": "Use `String.substringAtMost` instead" - }, - { - "id": "Js.String2.substring", - "kind": "value", - "name": "substring", - "docstrings": [ - "`substring(str, ~from: start, ~to_: finish)` returns characters `start` up to\nbut not including finish from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `finish` is zero or negative, the empty string is returned.\n- If `start` is greater than `finish`, the `start` and `finish` points are swapped.\n\nSee [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.substring(\"playground\", ~from=3, ~to_=6) == \"ygr\"\nJs.String2.substring(\"playground\", ~from=6, ~to_=3) == \"ygr\"\nJs.String2.substring(\"playground\", ~from=4, ~to_=12) == \"ground\"\n```" - ], - "signature": "let substring: (t, ~from: int, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.substringToEnd", - "kind": "value", - "name": "substringToEnd", - "docstrings": [ - "`substringToEnd(str, ~from: start)` returns the substring of `str` from\nposition `start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string is returned.\n\nSee [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.substringToEnd(\"playground\", ~from=4) == \"ground\"\nJs.String2.substringToEnd(\"playground\", ~from=-3) == \"playground\"\nJs.String2.substringToEnd(\"playground\", ~from=12) == \"\"\n```" - ], - "signature": "let substringToEnd: (t, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.toLowerCase", - "kind": "value", - "name": "toLowerCase", - "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms; one when it is the last\ncharacter in a string and another when it is not.\n\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.toLowerCase(\"ABC\") == \"abc\"\nJs.String2.toLowerCase(`ΣΠ`) == `σπ`\nJs.String2.toLowerCase(`ΠΣ`) == `πς`\n```" - ], - "signature": "let toLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.toLocaleLowerCase", - "kind": "value", - "name": "toLocaleLowerCase", - "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase)\non MDN." - ], - "signature": "let toLocaleLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.toUpperCase", - "kind": "value", - "name": "toUpperCase", - "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result; for example the German ß\ncapitalizes to two Ses in a row.\n\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.toUpperCase(\"abc\") == \"ABC\"\nJs.String2.toUpperCase(`Straße`) == `STRASSE`\nJs.String2.toUpperCase(`πς`) == `ΠΣ`\n```" - ], - "signature": "let toUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.toLocaleUpperCase", - "kind": "value", - "name": "toLocaleUpperCase", - "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\nSee [`String.to:LocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\non MDN." - ], - "signature": "let toLocaleUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.trim", - "kind": "value", - "name": "trim", - "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\n\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.trim(\" abc def \") == \"abc def\"\nJs.String2.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" - ], - "signature": "let trim: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.anchor", - "kind": "value", - "name": "anchor", - "docstrings": [ - "`anchor(anchorText, anchorName)` creates a string with an HTML `` element\nwith name attribute of `anchorName` and `anchorText` as its content. Please do\nnot use this method, as it has been removed from the relevant web standards.\n\nSee [`String.anchor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/anchor)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.anchor(\"Page One\", \"page1\") == \"Page One\"\n```" - ], - "signature": "let anchor: (t, t) => t", - "deprecated": "This function has been removed from the relevant web standards." - }, - { - "id": "Js.String2.link", - "kind": "value", - "name": "link", - "docstrings": [ - "ES2015: `link(linkText, urlText)` creates a string with an HTML `` element\nwith href attribute of `urlText` and `linkText` as its content. Please do not\nuse this method, as it has been removed from the relevant web standards. See\n[`String.link`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/link)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.link(\"Go to page two\", \"page2.html\") == \"Go to page two\"\n```" - ], - "signature": "let link: (t, t) => t", - "deprecated": "This function has been removed from the relevant web standards." - }, - { - "id": "Js.String2.castToArrayLike", - "kind": "value", - "name": "castToArrayLike", - "docstrings": [ - "Casts its argument to an `array_like` entity that can be processed by functions\nsuch as `Js.Array2.fromMap()`\n\n## Examples\n\n```rescript\nlet s = \"abcde\"\nlet arr = Js.Array2.fromMap(Js.String2.castToArrayLike(s), x => x)\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let castToArrayLike: t => Js_array2.array_like", - "deprecated": "" - } - ] - }, - "js/string": { - "id": "Js.String", - "name": "String", - "docstrings": [ - "Provide bindings to JS string", - "JavaScript String API" - ], - "items": [ - { - "id": "Js.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = string", - "deprecated": "" - }, - { - "id": "Js.String.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nJs.String2.make(3.5) == \"3.5\"\nJs.String2.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCharCode", - "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to that number; `n` ranges from 0 to 65535.\nIf out of range, the lower 16 bits of the value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as `fromCharCode(0xF63A)`. See [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCharCode(65) == \"A\"\nJs.String2.fromCharCode(0x3c8) == `ψ`\nJs.String2.fromCharCode(0xd55c) == `한`\nJs.String2.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCharCodeMany", - "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`. See\n[`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)\non MDN." - ], - "signature": "let fromCharCodeMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCodePoint", - "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point. If the number is not a valid code point, it throws\n`RangeError`.Thus, `fromCodePoint(0x1F63A)` will produce a correct value,\nunlike `fromCharCode(0x1F63A)`, and `fromCodePoint(-5)` will throw a\n`RangeError`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePoint(65) == \"A\"\nJs.String2.fromCodePoint(0x3c8) == `ψ`\nJs.String2.fromCodePoint(0xd55c) == `한`\nJs.String2.fromCodePoint(0x1f63a) == `😺`\n```" - ], - "signature": "let fromCodePoint: int => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCodePointMany", - "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```" - ], - "signature": "let fromCodePointMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(s)` returns the length of the given `string`. See\n[`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.length(\"abcd\") == 4\n```" - ], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.String.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(s, n)` returns as a `string` the character at the given index number. If\n`n` is out of range, this function returns `undefined`, so at some point this\nfunction may be modified to return `option`.\n\n## Examples\n\n```rescript\nJs.String2.get(\"Reason\", 0) == \"R\"\nJs.String2.get(\"Reason\", 4) == \"o\"\nJs.String2.get(`Rẽasöń`, 5) == `ń`\n```" - ], - "signature": "let get: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String.charAt", - "kind": "value", - "name": "charAt", - "docstrings": [], - "signature": "let charAt: (int, t) => t" - }, - { - "id": "Js.String.charCodeAt", - "kind": "value", - "name": "charCodeAt", - "docstrings": [], - "signature": "let charCodeAt: (int, t) => float" - }, - { - "id": "Js.String.codePointAt", - "kind": "value", - "name": "codePointAt", - "docstrings": [], - "signature": "let codePointAt: (int, t) => option" - }, - { - "id": "Js.String.concat", - "kind": "value", - "name": "concat", - "docstrings": [], - "signature": "let concat: (t, t) => t" - }, - { - "id": "Js.String.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [], - "signature": "let concatMany: (array, t) => t" - }, - { - "id": "Js.String.endsWith", - "kind": "value", - "name": "endsWith", - "docstrings": [], - "signature": "let endsWith: (t, t) => bool" - }, - { - "id": "Js.String.endsWithFrom", - "kind": "value", - "name": "endsWithFrom", - "docstrings": [], - "signature": "let endsWithFrom: (t, int, t) => bool" - }, - { - "id": "Js.String.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, t) => bool" - }, - { - "id": "Js.String.includesFrom", - "kind": "value", - "name": "includesFrom", - "docstrings": [], - "signature": "let includesFrom: (t, int, t) => bool" - }, - { - "id": "Js.String.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, t) => int" - }, - { - "id": "Js.String.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, int, t) => int" - }, - { - "id": "Js.String.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, t) => int" - }, - { - "id": "Js.String.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, int, t) => int" - }, - { - "id": "Js.String.localeCompare", - "kind": "value", - "name": "localeCompare", - "docstrings": [], - "signature": "let localeCompare: (t, t) => float" - }, - { - "id": "Js.String.match_", - "kind": "value", - "name": "match_", - "docstrings": [], - "signature": "let match_: (Js_re.t, t) => option>>" - }, - { - "id": "Js.String.normalize", - "kind": "value", - "name": "normalize", - "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\u00e3 or the combination of a lower case letter A\n\\u0061 and a combining tilde \\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)\non MDN.\n\nSee also [Unicode technical report #15](https://unicode.org/reports/tr15/) for\ndetails." - ], - "signature": "let normalize: t => t", - "deprecated": "" - }, - { - "id": "Js.String.normalizeByForm", - "kind": "value", - "name": "normalizeByForm", - "docstrings": [], - "signature": "let normalizeByForm: (t, t) => t" - }, - { - "id": "Js.String.repeat", - "kind": "value", - "name": "repeat", - "docstrings": [], - "signature": "let repeat: (int, t) => t" - }, - { - "id": "Js.String.replace", - "kind": "value", - "name": "replace", - "docstrings": [], - "signature": "let replace: (t, t, t) => t" - }, - { - "id": "Js.String.replaceByRe", - "kind": "value", - "name": "replaceByRe", - "docstrings": [], - "signature": "let replaceByRe: (Js_re.t, t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy0", - "kind": "value", - "name": "unsafeReplaceBy0", - "docstrings": [], - "signature": "let unsafeReplaceBy0: (Js_re.t, (t, int, t) => t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy1", - "kind": "value", - "name": "unsafeReplaceBy1", - "docstrings": [], - "signature": "let unsafeReplaceBy1: (Js_re.t, (t, t, int, t) => t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy2", - "kind": "value", - "name": "unsafeReplaceBy2", - "docstrings": [], - "signature": "let unsafeReplaceBy2: (Js_re.t, (t, t, t, int, t) => t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy3", - "kind": "value", - "name": "unsafeReplaceBy3", - "docstrings": [], - "signature": "let unsafeReplaceBy3: (Js_re.t, (t, t, t, t, int, t) => t, t) => t" - }, - { - "id": "Js.String.search", - "kind": "value", - "name": "search", - "docstrings": [], - "signature": "let search: (Js_re.t, t) => int" - }, - { - "id": "Js.String.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~from: int, ~to_: int, t) => t" - }, - { - "id": "Js.String.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [], - "signature": "let sliceToEnd: (~from: int, t) => t" - }, - { - "id": "Js.String.split", - "kind": "value", - "name": "split", - "docstrings": [], - "signature": "let split: (t, t) => array" - }, - { - "id": "Js.String.splitAtMost", - "kind": "value", - "name": "splitAtMost", - "docstrings": [], - "signature": "let splitAtMost: (t, ~limit: int, t) => array" - }, - { - "id": "Js.String.splitByRe", - "kind": "value", - "name": "splitByRe", - "docstrings": [], - "signature": "let splitByRe: (Js_re.t, t) => array>" - }, - { - "id": "Js.String.splitByReAtMost", - "kind": "value", - "name": "splitByReAtMost", - "docstrings": [], - "signature": "let splitByReAtMost: (Js_re.t, ~limit: int, t) => array>" - }, - { - "id": "Js.String.startsWith", - "kind": "value", - "name": "startsWith", - "docstrings": [], - "signature": "let startsWith: (t, t) => bool" - }, - { - "id": "Js.String.startsWithFrom", - "kind": "value", - "name": "startsWithFrom", - "docstrings": [], - "signature": "let startsWithFrom: (t, int, t) => bool" - }, - { - "id": "Js.String.substr", - "kind": "value", - "name": "substr", - "docstrings": [], - "signature": "let substr: (~from: int, t) => t" - }, - { - "id": "Js.String.substrAtMost", - "kind": "value", - "name": "substrAtMost", - "docstrings": [], - "signature": "let substrAtMost: (~from: int, ~length: int, t) => t" - }, - { - "id": "Js.String.substring", - "kind": "value", - "name": "substring", - "docstrings": [], - "signature": "let substring: (~from: int, ~to_: int, t) => t" - }, - { - "id": "Js.String.substringToEnd", - "kind": "value", - "name": "substringToEnd", - "docstrings": [], - "signature": "let substringToEnd: (~from: int, t) => t" - }, - { - "id": "Js.String.toLowerCase", - "kind": "value", - "name": "toLowerCase", - "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms; one when it is the last\ncharacter in a string and another when it is not.\n\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.toLowerCase(\"ABC\") == \"abc\"\nJs.String.toLowerCase(`ΣΠ`) == `σπ`\nJs.String.toLowerCase(`ΠΣ`) == `πς`\n```" - ], - "signature": "let toLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.toLocaleLowerCase", - "kind": "value", - "name": "toLocaleLowerCase", - "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\n\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase)\non MDN." - ], - "signature": "let toLocaleLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.toUpperCase", - "kind": "value", - "name": "toUpperCase", - "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result; for example the German ß\ncapitalizes to two Ses in a row.\n\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.toUpperCase(\"abc\") == \"ABC\"\nJs.String.toUpperCase(`Straße`) == `STRASSE`\nJs.String.toUpperCase(`πς`) == `ΠΣ`\n```" - ], - "signature": "let toUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.toLocaleUpperCase", - "kind": "value", - "name": "toLocaleUpperCase", - "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\n\nSee [`String.to:LocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\non MDN." - ], - "signature": "let toLocaleUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.trim", - "kind": "value", - "name": "trim", - "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\n\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.trim(\" abc def \") == \"abc def\"\nJs.String.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" - ], - "signature": "let trim: t => t", - "deprecated": "" - }, - { - "id": "Js.String.anchor", - "kind": "value", - "name": "anchor", - "docstrings": [], - "signature": "let anchor: (t, t) => t" - }, - { - "id": "Js.String.link", - "kind": "value", - "name": "link", - "docstrings": [], - "signature": "let link: (t, t) => t" - }, - { - "id": "Js.String.castToArrayLike", - "kind": "value", - "name": "castToArrayLike", - "docstrings": [ - "Casts its argument to an `array_like` entity that can be processed by functions\nsuch as `Js.Array2.fromMap()`\n\n## Examples\n\n```rescript\nlet s = \"abcde\"\nlet arr = Js.Array2.fromMap(Js.String.castToArrayLike(s), x => x)\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let castToArrayLike: t => Js_array2.array_like", - "deprecated": "This has been deprecated and will be removed in v13. Use functions from the `String` module instead." - } - ] - }, - "js/array2": { - "id": "Js.Array2", - "name": "Array2", - "docstrings": [ - "Provide bindings to JS array", - "Provides bindings to JavaScript’s `Array` functions. These bindings are optimized for pipe-first (`->`), where the array to be processed is the first parameter in the function.\n\nHere is an example to find the sum of squares of all even numbers in an array.\nWithout pipe first, we must call the functions in reverse order:\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nlet square = x => x * x\nlet result = {\n open Js.Array2\n reduce(map(filter([5, 2, 3, 4, 1], isEven), square), \"+\", 0)\n}\n```\n\nWith pipe first, we call the functions in the “natural” order:\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nlet square = x => x * x\nlet result = {\n open Js.Array2\n [5, 2, 3, 4, 1]->filter(isEven)->map(square)->reduce(\"+\", 0)\n}\n```" - ], - "items": [ - { - "id": "Js.Array2.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type used to describe a JavaScript array." - ], - "signature": "type t<'a> = array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [ - "A type used to describe JavaScript objects that are like an array or are iterable." - ], - "signature": "type array_like<'a> = Array.arrayLike<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.from", - "kind": "value", - "name": "from", - "docstrings": [ - "Creates a shallow copy of an array from an array-like object. See\n[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\non MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nJs.Array2.from(strArr) == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let from: array_like<'a> => array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fromMap", - "kind": "value", - "name": "fromMap", - "docstrings": [ - "Creates a new array by applying a function (the second argument) to each item\nin the `array_like` first argument. See\n[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\non MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nlet code = s => Js.String.charCodeAt(0, s)\nJs.Array2.fromMap(strArr, code) == [97.0, 98.0, 99.0, 100.0]\n```" - ], - "signature": "let fromMap: (array_like<'a>, 'a => 'b) => array<'b>", - "deprecated": "" - }, - { - "id": "Js.Array2.isArray", - "kind": "value", - "name": "isArray", - "docstrings": [ - "Returns `true` if its argument is an array; `false` otherwise. This is a runtime check, which is why the second example returns `true`\\---a list is internally represented as a nested JavaScript array.\n\n## Examples\n\n```rescript\nJs.Array2.isArray([5, 2, 3, 1, 4]) == true\nJs.Array2.isArray(list{5, 2, 3, 1, 4}) == true\nJs.Array2.isArray(\"abcd\") == false\n```" - ], - "signature": "let isArray: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Returns the number of elements in the array. See\n[`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length)\non MDN." - ], - "signature": "let length: array<'a> => int", - "deprecated": "" - }, - { - "id": "Js.Array2.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [ - "Copies from the first element in the given array to the designated `~to_`\nposition, returning the resulting array. *This function modifies the original\narray.* See\n[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.copyWithin(arr, ~to_=2) == [100, 101, 100, 101, 102]\narr == [100, 101, 100, 101, 102]\n```" - ], - "signature": "let copyWithin: (t<'a>, ~to_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [ - "Copies starting at element `~from` in the given array to the designated `~to_`\nposition, returning the resulting array. *This function modifies the original\narray.* See\n[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.copyWithinFrom(arr, ~from=2, ~to_=0) == [102, 103, 104, 103, 104]\narr == [102, 103, 104, 103, 104]\n```" - ], - "signature": "let copyWithinFrom: (t<'a>, ~to_: int, ~from: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [ - "Copies starting at element `~start` in the given array up to but not including\n`~end_` to the designated `~to_` position, returning the resulting array. *This\nfunction modifies the original array.* See\n[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105]\nJs.Array2.copyWithinFromRange(arr, ~start=2, ~end_=5, ~to_=1) == [100, 102, 103, 104, 104, 105]\narr == [100, 102, 103, 104, 104, 105]\n```" - ], - "signature": "let copyWithinFromRange: (t<'a>, ~to_: int, ~start: int, ~end_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [ - "Sets all elements of the given array (the first arumgent) to the designated\nvalue (the secon argument), returning the resulting array. *This function\nmodifies the original array.*\n\nSee\n[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.fillInPlace(arr, 99) == [99, 99, 99, 99, 99]\narr == [99, 99, 99, 99, 99]\n```" - ], - "signature": "let fillInPlace: (t<'a>, 'a) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [ - "Sets all elements of the given array (the first arumgent) from position `~from`\nto the end to the designated value (the second argument), returning the\nresulting array. *This function modifies the original array.* See\n[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.fillFromInPlace(arr, 99, ~from=2) == [100, 101, 99, 99, 99]\narr == [100, 101, 99, 99, 99]\n```" - ], - "signature": "let fillFromInPlace: (t<'a>, 'a, ~from: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [ - "Sets the elements of the given array (the first arumgent) from position\n`~start` up to but not including position `~end_` to the designated value (the\nsecond argument), returning the resulting array. *This function modifies the\noriginal array.* See\n[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.fillRangeInPlace(arr, 99, ~start=1, ~end_=4) == [100, 99, 99, 99, 104]\narr == [100, 99, 99, 99, 104]\n```" - ], - "signature": "let fillRangeInPlace: (t<'a>, 'a, ~start: int, ~end_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "If the array is not empty, removes the last element and returns it as\n`Some(value)`; returns `None` if the array is empty. *This function modifies\nthe original array.* See\n[`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.pop(arr) == Some(104)\narr == [100, 101, 102, 103]\n\nlet empty: array = []\nJs.Array2.pop(empty) == None\n```" - ], - "signature": "let pop: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.push", - "kind": "value", - "name": "push", - "docstrings": [ - "Appends the given value to the array, returning the number of elements in the\nupdated array. *This function modifies the original array.* See\n[`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array2.push(arr, \"dog\") == 4\narr == [\"ant\", \"bee\", \"cat\", \"dog\"]\n```" - ], - "signature": "let push: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.pushMany", - "kind": "value", - "name": "pushMany", - "docstrings": [ - "Appends the values from one array (the second argument) to another (the first\nargument), returning the number of elements in the updated array. *This\nfunction modifies the original array.* See\n[`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array2.pushMany(arr, [\"dog\", \"elk\"]) == 5\narr == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```" - ], - "signature": "let pushMany: (t<'a>, array<'a>) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [ - "Returns an array with the elements of the input array in reverse order. *This\nfunction modifies the original array.* See\n[`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array2.reverseInPlace(arr) == [\"cat\", \"bee\", \"ant\"]\narr == [\"cat\", \"bee\", \"ant\"]\n```" - ], - "signature": "let reverseInPlace: t<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.shift", - "kind": "value", - "name": "shift", - "docstrings": [ - "If the array is not empty, removes the first element and returns it as\n`Some(value)`; returns `None` if the array is empty. *This function modifies\nthe original array.* See\n[`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.shift(arr) == Some(100)\narr == [101, 102, 103, 104]\n\nlet empty: array = []\nJs.Array2.shift(empty) == None\n```" - ], - "signature": "let shift: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [ - "Sorts the given array in place and returns the sorted array. JavaScript sorts\nthe array by converting the arguments to UTF-16 strings and sorting them. See\nthe second example with sorting numbers, which does not do a numeric sort.\n*This function modifies the original array.* See\n[`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\non MDN.\n\n## Examples\n\n```rescript\nlet words = [\"bee\", \"dog\", \"ant\", \"cat\"]\nJs.Array2.sortInPlace(words) == [\"ant\", \"bee\", \"cat\", \"dog\"]\nwords == [\"ant\", \"bee\", \"cat\", \"dog\"]\n\nlet numbers = [3, 30, 10, 1, 20, 2]\nJs.Array2.sortInPlace(numbers) == [1, 10, 2, 20, 3, 30]\nnumbers == [1, 10, 2, 20, 3, 30]\n```" - ], - "signature": "let sortInPlace: t<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [ - "Sorts the given array in place and returns the sorted array. *This function\nmodifies the original array.*\n\nThe first argument to `sortInPlaceWith()` is a function that compares two items\nfrom the array and returns:\n\n* an integer less than zero if the first item is less than the second item \\*\n zero if the items are equal \\* an integer greater than zero if the first item is\n greater than the second item\n\nSee\n[`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\non MDN.\n\n## Examples\n\n```rescript\n// sort by word length\nlet words = [\"horse\", \"aardvark\", \"dog\", \"camel\"]\nlet byLength = (s1, s2) => Js.String.length(s1) - Js.String.length(s2)\n\nJs.Array2.sortInPlaceWith(words, byLength) == [\"dog\", \"horse\", \"camel\", \"aardvark\"]\n\n// sort in reverse numeric order\nlet numbers = [3, 30, 10, 1, 20, 2]\nlet reverseNumeric = (n1, n2) => n2 - n1\nJs.Array2.sortInPlaceWith(numbers, reverseNumeric) == [30, 20, 10, 3, 2, 1]\n```" - ], - "signature": "let sortInPlaceWith: (t<'a>, ('a, 'a) => int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.spliceInPlace", - "kind": "value", - "name": "spliceInPlace", - "docstrings": [ - "Starting at position `~pos`, remove `~remove` elements and then add the\nelements from the `~add` array. Returns an array consisting of the removed\nitems. *This function modifies the original array.* See\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.spliceInPlace(arr, ~pos=2, ~remove=2, ~add=[\"x\", \"y\", \"z\"]) == [\"c\", \"d\"]\narr == [\"a\", \"b\", \"x\", \"y\", \"z\", \"e\", \"f\"]\n\nlet arr2 = [\"a\", \"b\", \"c\", \"d\"]\nJs.Array2.spliceInPlace(arr2, ~pos=3, ~remove=0, ~add=[\"x\", \"y\"]) == []\narr2 == [\"a\", \"b\", \"c\", \"x\", \"y\", \"d\"]\n\nlet arr3 = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.spliceInPlace(arr3, ~pos=9, ~remove=2, ~add=[\"x\", \"y\", \"z\"]) == []\narr3 == [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"x\", \"y\", \"z\"]\n```" - ], - "signature": "let spliceInPlace: (t<'a>, ~pos: int, ~remove: int, ~add: array<'a>) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.removeFromInPlace", - "kind": "value", - "name": "removeFromInPlace", - "docstrings": [ - "Removes elements from the given array starting at position `~pos` to the end of\nthe array, returning the removed elements. *This function modifies the original\narray.* See\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.removeFromInPlace(arr, ~pos=4) == [\"e\", \"f\"]\narr == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let removeFromInPlace: (t<'a>, ~pos: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.removeCountInPlace", - "kind": "value", - "name": "removeCountInPlace", - "docstrings": [ - "Removes `~count` elements from the given array starting at position `~pos`,\nreturning the removed elements. *This function modifies the original array.*\nSee\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.removeCountInPlace(arr, ~pos=2, ~count=3) == [\"c\", \"d\", \"e\"]\narr == [\"a\", \"b\", \"f\"]\n```" - ], - "signature": "let removeCountInPlace: (t<'a>, ~pos: int, ~count: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.unshift", - "kind": "value", - "name": "unshift", - "docstrings": [ - "Adds the given element to the array, returning the new number of elements in\nthe array. *This function modifies the original array.* See\n[`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"b\", \"c\", \"d\"]\nJs.Array2.unshift(arr, \"a\") == 4\narr == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let unshift: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.unshiftMany", - "kind": "value", - "name": "unshiftMany", - "docstrings": [ - "Adds the elements in the second array argument at the beginning of the first\narray argument, returning the new number of elements in the array. *This\nfunction modifies the original array.* See\n[`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"d\", \"e\"]\nJs.Array2.unshiftMany(arr, [\"a\", \"b\", \"c\"]) == 5\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let unshiftMany: (t<'a>, array<'a>) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.append", - "kind": "value", - "name": "append", - "docstrings": [], - "signature": "let append: (t<'a>, 'a) => t<'a>", - "deprecated": "`append` is not type-safe. Use `concat` instead." - }, - { - "id": "Js.Array2.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "Concatenates the second array argument to the first array argument, returning a\nnew array. The original arrays are not modified. See\n[`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.concat([\"a\", \"b\"], [\"c\", \"d\", \"e\"]) == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "The second argument to `concatMany()` is an array of arrays; these are added at\nthe end of the first argument, returning a new array. See\n[`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.concatMany([\"a\", \"b\", \"c\"], [[\"d\", \"e\"], [\"f\", \"g\", \"h\"]]) == [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n ]\n```" - ], - "signature": "let concatMany: (t<'a>, array>) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "Returns true if the given value is in the array, `false` otherwise. See\n[`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.includes([\"a\", \"b\", \"c\"], \"b\") == true\nJs.Array2.includes([\"a\", \"b\", \"c\"], \"x\") == false\n```" - ], - "signature": "let includes: (t<'a>, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "Returns the index of the first element in the array that has the given value.\nIf the value is not in the array, returns -1. See\n[`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.indexOf([100, 101, 102, 103], 102) == 2\nJs.Array2.indexOf([100, 101, 102, 103], 999) == -1\n```" - ], - "signature": "let indexOf: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "Returns the index of the first element in the array with the given value. The\nsearch starts at position `~from`. See\n[`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.indexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\"], \"a\", ~from=2) == 2\nJs.Array2.indexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\"], \"a\", ~from=3) == 4\nJs.Array2.indexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\"], \"b\", ~from=2) == -1\n```" - ], - "signature": "let indexOfFrom: (t<'a>, 'a, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "This function converts each element of the array to a string (via JavaScript)\nand concatenates them, separated by the string given in the first argument,\ninto a single string. See\n[`Array.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.joinWith([\"ant\", \"bee\", \"cat\"], \"--\") == \"ant--bee--cat\"\nJs.Array2.joinWith([\"door\", \"bell\"], \"\") == \"doorbell\"\nJs.Array2.joinWith([2020, 9, 4], \"/\") == \"2020/9/4\"\nJs.Array2.joinWith([2.5, 3.6, 3e-2], \";\") == \"2.5;3.6;0.03\"\n```" - ], - "signature": "let joinWith: (t<'a>, string) => string", - "deprecated": "" - }, - { - "id": "Js.Array2.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "Returns the index of the last element in the array that has the given value. If\nthe value is not in the array, returns -1. See\n[`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.lastIndexOf([\"a\", \"b\", \"a\", \"c\"], \"a\") == 2\nJs.Array2.lastIndexOf([\"a\", \"b\", \"a\", \"c\"], \"x\") == -1\n```" - ], - "signature": "let lastIndexOf: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "Returns the index of the last element in the array that has the given value,\nsearching from position `~from` down to the start of the array. If the value is\nnot in the array, returns -1. See\n[`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.lastIndexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\", \"d\"], \"a\", ~from=3) == 2\nJs.Array2.lastIndexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\", \"d\"], \"c\", ~from=2) == -1\n```" - ], - "signature": "let lastIndexOfFrom: (t<'a>, 'a, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "Returns a shallow copy of the given array from the `~start` index up to but not\nincluding the `~end_` position. Negative numbers indicate an offset from the\nend of the array. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105, 106]\nJs.Array2.slice(arr, ~start=2, ~end_=5) == [102, 103, 104]\nJs.Array2.slice(arr, ~start=-3, ~end_=-1) == [104, 105]\nJs.Array2.slice(arr, ~start=9, ~end_=10) == []\n```" - ], - "signature": "let slice: (t<'a>, ~start: int, ~end_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Returns a copy of the entire array. Same as `Js.Array2.Slice(arr, ~start=0,\n~end_=Js.Array2.length(arr))`. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." - ], - "signature": "let copy: t<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [ - "Returns a shallow copy of the given array from the given index to the end. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." - ], - "signature": "let sliceFrom: (t<'a>, int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts the array to a string. Each element is converted to a string using\nJavaScript. Unlike the JavaScript `Array.toString()`, all elements in a\nReasonML array must have the same type. See\n[`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.toString([3.5, 4.6, 7.8]) == \"3.5,4.6,7.8\"\nJs.Array2.toString([\"a\", \"b\", \"c\"]) == \"a,b,c\"\n```" - ], - "signature": "let toString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array2.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Converts the array to a string using the conventions of the current locale.\nEach element is converted to a string using JavaScript. Unlike the JavaScript\n`Array.toLocaleString()`, all elements in a ReasonML array must have the same\ntype. See\n[`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.toLocaleString([Js.Date.make()])\n// returns \"3/19/2020, 10:52:11 AM\" for locale en_US.utf8\n// returns \"2020-3-19 10:52:11\" for locale de_DE.utf8\n```" - ], - "signature": "let toLocaleString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array2.every", - "kind": "value", - "name": "every", - "docstrings": [ - "The first argument to `every()` is an array. The second argument is a predicate\nfunction that returns a boolean. The `every()` function returns `true` if the\npredicate function is true for all items in the given array. If given an empty\narray, returns `true`. See\n[`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every)\non MDN.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nJs.Array2.every([6, 22, 8, 4], isEven) == true\nJs.Array2.every([6, 22, 7, 4], isEven) == false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [ - "The first argument to `everyi()` is an array. The second argument is a\npredicate function with two arguments: an array element and that element’s\nindex; it returns a boolean. The `everyi()` function returns `true` if the\npredicate function is true for all items in the given array. If given an empty\narray, returns `true`. See\n[`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every)\non MDN.\n\n## Examples\n\n```rescript\n// determine if all even-index items are positive\nlet evenIndexPositive = (item, index) => mod(index, 2) == 0 ? item > 0 : true\n\nJs.Array2.everyi([6, -3, 5, 8], evenIndexPositive) == true\nJs.Array2.everyi([6, 3, -5, 8], evenIndexPositive) == false\n```" - ], - "signature": "let everyi: (t<'a>, ('a, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "Applies the given predicate function (the second argument) to each element in\nthe array; the result is an array of those elements for which the predicate\nfunction returned `true`. See\n[`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\non MDN.\n\n## Examples\n\n```rescript\nlet nonEmpty = s => s != \"\"\nJs.Array2.filter([\"abc\", \"\", \"\", \"def\", \"ghi\"], nonEmpty) == [\"abc\", \"def\", \"ghi\"]\n```" - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [ - "Each element of the given array are passed to the predicate function. The\nreturn value is an array of all those elements for which the predicate function\nreturned `true`.\n\nSee\n[`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\non MDN.\n\n## Examples\n\n```rescript\n// keep only positive elements at odd indices\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array2.filteri([6, 3, 5, 8, 7, -4, 1], positiveOddElement) == [3, 8]\n```" - ], - "signature": "let filteri: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.find", - "kind": "value", - "name": "find", - "docstrings": [ - "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find first negative element\nJs.Array2.find([33, 22, -55, 77, -44], x => x < 0) == Some(-55)\nJs.Array2.find([33, 22, 55, 77, 44], x => x < 0) == None\n```" - ], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.findi", - "kind": "value", - "name": "findi", - "docstrings": [ - "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate. The\npredicate function takes an array element and an index as its parameters. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find first positive item at an odd index\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array2.findi([66, -33, 55, 88, 22], positiveOddElement) == Some(88)\nJs.Array2.findi([66, -33, 55, -88, 22], positiveOddElement) == None\n```" - ], - "signature": "let findi: (t<'a>, ('a, int) => bool) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [ - "Returns the index of the first element in the array that satisifies the given\npredicate function, or -1 if no element satisifies the predicate. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.findIndex([33, 22, -55, 77, -44], x => x < 0) == 2\nJs.Array2.findIndex([33, 22, 55, 77, 44], x => x < 0) == -1\n```" - ], - "signature": "let findIndex: (t<'a>, 'a => bool) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [ - "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate. The\npredicate function takes an array element and an index as its parameters. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find index of first positive item at an odd index\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array2.findIndexi([66, -33, 55, 88, 22], positiveOddElement) == 3\nJs.Array2.findIndexi([66, -33, 55, -88, 22], positiveOddElement) == -1\n```" - ], - "signature": "let findIndexi: (t<'a>, ('a, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "The `forEach()` function applies the function given as the second argument to\neach element in the array. The function you provide returns `unit`, and the\n`forEach()` function also returns `unit`. You use `forEach()` when you need to\nprocess each element in the array but not return any new array or value; for\nexample, to print the items in an array. See\n[`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\non MDN.\n\n## Examples\n\n```rescript\n// display all elements in an array\nJs.Array2.forEach([\"a\", \"b\", \"c\"], x => Js.log(x)) == ()\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Array2.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [ - "The `forEachi()` function applies the function given as the second argument to\neach element in the array. The function you provide takes an item in the array\nand its index number, and returns `unit`. The `forEachi()` function also\nreturns `unit`. You use `forEachi()` when you need to process each element in\nthe array but not return any new array or value; for example, to print the\nitems in an array. See\n[`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\non MDN.\n\n## Examples\n\n```rescript\n// display all elements in an array as a numbered list\nJs.Array2.forEachi([\"a\", \"b\", \"c\"], (item, index) => Js.log2(index + 1, item)) == ()\n```" - ], - "signature": "let forEachi: (t<'a>, ('a, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Array2.map", - "kind": "value", - "name": "map", - "docstrings": [ - "Applies the function (the second argument) to each item in the array, returning\na new array. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]\nJs.Array2.map([\"animal\", \"vegetable\", \"mineral\"], Js.String.length) == [6, 9, 7]\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Array2.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [ - "Applies the function (the second argument) to each item in the array, returning\na new array. The function acceps two arguments: an item from the array and its\nindex number. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array2.mapi([10, 11, 12], product) == [0, 11, 24]\n```" - ], - "signature": "let mapi: (t<'a>, ('a, int) => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Array2.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "The `reduce()` function takes three parameters: an array, a *reducer function*,\nand a beginning accumulator value. The reducer function has two parameters: an\naccumulated value and an element of the array.\n\n`reduce()` first calls the reducer function with the beginning value and the\nfirst element in the array. The result becomes the new accumulator value, which\nis passed in to the reducer function along with the second element in the\narray. `reduce()` proceeds through the array, passing in the result of each\nstage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduce()`. See\n[`Array.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\non MDN.\n\n## Examples\n\n```rescript\nlet sumOfSquares = (accumulator, item) => accumulator + item * item\n\nJs.Array2.reduce([10, 2, 4], sumOfSquares, 0) == 120\nJs.Array2.reduce([10, 2, 4], \"*\", 1) == 80\nJs.Array2.reduce(\n [\"animal\", \"vegetable\", \"mineral\"],\n (acc, item) => acc + Js.String.length(item),\n 0,\n) == 22 // 6 + 9 + 7\nJs.Array2.reduce([2.0, 4.0], (acc, item) => item /. acc, 1.0) == 2.0 // 4.0 / (2.0 / 1.0)\n```" - ], - "signature": "let reduce: (t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [ - "The `reducei()` function takes three parameters: an array, a *reducer\nfunction*, and a beginning accumulator value. The reducer function has three\nparameters: an accumulated value, an element of the array, and the index of\nthat element.\n\n`reducei()` first calls the reducer function with the beginning value, the\nfirst element in the array, and zero (its index). The result becomes the new\naccumulator value, which is passed to the reducer function along with the\nsecond element in the array and one (its index). `reducei()` proceeds from left\nto right through the array, passing in the result of each stage as the\naccumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reducei()`. See\n[`Array.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\non MDN.\n\n## Examples\n\n```rescript\n// find sum of even-index elements in array\nlet sumOfEvens = (accumulator, item, index) =>\n if mod(index, 2) == 0 {\n accumulator + item\n } else {\n accumulator\n }\n\nJs.Array2.reducei([2, 5, 1, 4, 3], sumOfEvens, 0) == 6\n```" - ], - "signature": "let reducei: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [ - "The `reduceRight()` function takes three parameters: an array, a *reducer\nfunction*, and a beginning accumulator value. The reducer function has two\nparameters: an accumulated value and an element of the array.\n\n`reduceRight()` first calls the reducer function with the beginning value and\nthe last element in the array. The result becomes the new accumulator value,\nwhich is passed in to the reducer function along with the next-to-last element\nin the array. `reduceRight()` proceeds from right to left through the array,\npassing in the result of each stage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduceRight()`. See\n[`Array.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight)\non MDN.\n\n**NOTE:** In many cases, `reduce()` and `reduceRight()` give the same result.\nHowever, see the last example here and compare it to the example from\n`reduce()`, where order makes a difference.\n\n## Examples\n\n```rescript\nlet sumOfSquares = (accumulator, item) => accumulator + item * item\n\nJs.Array2.reduceRight([10, 2, 4], sumOfSquares, 0) == 120\nJs.Array2.reduceRight([2.0, 4.0], (acc, item) => item /. acc, 1.0) == 0.5 // 2.0 / (4.0 / 1.0)\n```" - ], - "signature": "let reduceRight: (t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [ - "The `reduceRighti()` function takes three parameters: an array, a *reducer\nfunction*, and a beginning accumulator value. The reducer function has three\nparameters: an accumulated value, an element of the array, and the index of\nthat element. `reduceRighti()` first calls the reducer function with the\nbeginning value, the last element in the array, and its index (length of array\nminus one). The result becomes the new accumulator value, which is passed in to\nthe reducer function along with the second element in the array and one (its\nindex). `reduceRighti()` proceeds from right to left through the array, passing\nin the result of each stage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduceRighti()`. See\n[`Array.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight)\non MDN.\n\n**NOTE:** In many cases, `reducei()` and `reduceRighti()` give the same result.\nHowever, there are cases where the order in which items are processed makes a\ndifference.\n\n## Examples\n\n```rescript\n// find sum of even-index elements in array\nlet sumOfEvens = (accumulator, item, index) =>\n if mod(index, 2) == 0 {\n accumulator + item\n } else {\n accumulator\n }\n\nJs.Array2.reduceRighti([2, 5, 1, 4, 3], sumOfEvens, 0) == 6\n```" - ], - "signature": "let reduceRighti: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Returns `true` if the predicate function given as the second argument to\n`some()` returns `true` for any element in the array; `false` otherwise.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nJs.Array2.some([3, 7, 5, 2, 9], isEven) == true\nJs.Array2.some([3, 7, 5, 1, 9], isEven) == false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.somei", - "kind": "value", - "name": "somei", - "docstrings": [ - "Returns `true` if the predicate function given as the second argument to\n`somei()` returns `true` for any element in the array; `false` otherwise. The\npredicate function has two arguments: an item from the array and the index\nvalue\n\n## Examples\n\n```rescript\n// Does any string in the array\n// have the same length as its index?\n\nlet sameLength = (str, index) => Js.String.length(str) == index\n\n// \"ef\" has length 2 and is it at index 2\nJs.Array2.somei([\"ab\", \"cd\", \"ef\", \"gh\"], sameLength) == true\n// no item has the same length as its index\nJs.Array2.somei([\"a\", \"bc\", \"def\", \"gh\"], sameLength) == false\n```" - ], - "signature": "let somei: (t<'a>, ('a, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [ - "Returns the value at the given position in the array if the position is in\nbounds; returns the JavaScript value `undefined` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array2.unsafe_get(arr, 3) == 103\nJs.Array2.unsafe_get(arr, 4) // returns undefined\n```" - ], - "signature": "let unsafe_get: (array<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Js.Array2.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [ - "Sets the value at the given position in the array if the position is in bounds.\nIf the index is out of bounds, well, “here there be dragons.“\n\n*This function modifies the original array.*\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array2.unsafe_set(arr, 3, 99)\n// result is [100, 101, 102, 99];\n\nJs.Array2.unsafe_set(arr, 4, 88)\n// result is [100, 101, 102, 99, 88]\n\nJs.Array2.unsafe_set(arr, 6, 77)\n// result is [100, 101, 102, 99, 88, <1 empty item>, 77]\n\nJs.Array2.unsafe_set(arr, -1, 66)\n// you don't want to know.\n```" - ], - "signature": "let unsafe_set: (array<'a>, int, 'a) => unit", - "deprecated": "" - } - ] - }, - "js/array": { - "id": "Js.Array", - "name": "Array", - "docstrings": [ - "Provide bindings to JS array", - "Provides bindings to JavaScript’s `Array` functions. These bindings are\noptimized for pipe-last (`|>`), where the array to be processed is the last\nparameter in the function." - ], - "items": [ - { - "id": "Js.Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type used to describe a JavaScript array." - ], - "signature": "type t<'a> = array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [ - "A type used to describe JavaScript objects that are like an array or are iterable." - ], - "signature": "type array_like<'a> = Js_array2.array_like<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.from", - "kind": "value", - "name": "from", - "docstrings": [ - "Creates a shallow copy of an array from an array-like object. See [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nJs.Array.from(strArr) == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let from: array_like<'a> => array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.fromMap", - "kind": "value", - "name": "fromMap", - "docstrings": [ - "Creates a new array by applying a function (the second argument) to each item\nin the `array_like` first argument. See\n[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\non MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nlet code = s => Js.String.charCodeAt(0, s)\nJs.Array.fromMap(strArr, code) == [97.0, 98.0, 99.0, 100.0]\n```" - ], - "signature": "let fromMap: (array_like<'a>, 'a => 'b) => array<'b>", - "deprecated": "" - }, - { - "id": "Js.Array.isArray", - "kind": "value", - "name": "isArray", - "docstrings": [], - "signature": "let isArray: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.Array.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Returns the number of elements in the array. See [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN." - ], - "signature": "let length: array<'a> => int", - "deprecated": "" - }, - { - "id": "Js.Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (~to_: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (~to_: int, ~from: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: ('a, t<'a>) => 'b" - }, - { - "id": "Js.Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: ('a, ~from: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: ('a, ~start: int, ~end_: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "If the array is not empty, removes the last element and returns it as `Some(value)`; returns `None` if the array is empty. *This function modifies the original array.* See [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array.pop(arr) == Some(104)\narr == [100, 101, 102, 103]\n\nlet empty: array = []\nJs.Array.pop(empty) == None\n```" - ], - "signature": "let pop: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.push", - "kind": "value", - "name": "push", - "docstrings": [], - "signature": "let push: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.pushMany", - "kind": "value", - "name": "pushMany", - "docstrings": [], - "signature": "let pushMany: (array<'a>, t<'a>) => int" - }, - { - "id": "Js.Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [ - "Returns an array with the elements of the input array in reverse order. *This function modifies the original array.* See [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array.reverseInPlace(arr) == [\"cat\", \"bee\", \"ant\"]\narr == [\"cat\", \"bee\", \"ant\"]\n```" - ], - "signature": "let reverseInPlace: t<'a> => 'this", - "deprecated": "" - }, - { - "id": "Js.Array.shift", - "kind": "value", - "name": "shift", - "docstrings": [ - "If the array is not empty, removes the first element and returns it as `Some(value)`; returns `None` if the array is empty. *This function modifies the original array.* See [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array.shift(arr) == Some(100)\narr == [101, 102, 103, 104]\n\nlet empty: array = []\nJs.Array.shift(empty) == None\n```" - ], - "signature": "let shift: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [ - "Sorts the given array in place and returns the sorted array. JavaScript sorts the array by converting the arguments to UTF-16 strings and sorting them. See the second example with sorting numbers, which does not do a numeric sort. *This function modifies the original array.* See [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet words = [\"bee\", \"dog\", \"ant\", \"cat\"]\nJs.Array.sortInPlace(words) == [\"ant\", \"bee\", \"cat\", \"dog\"]\nwords == [\"ant\", \"bee\", \"cat\", \"dog\"]\n\nlet numbers = [3, 30, 10, 1, 20, 2]\nJs.Array.sortInPlace(numbers) == [1, 10, 2, 20, 3, 30]\nnumbers == [1, 10, 2, 20, 3, 30]\n```" - ], - "signature": "let sortInPlace: t<'a> => 'this", - "deprecated": "This has been deprecated and will be removed in v13. Use functions from the `Array` module instead." - }, - { - "id": "Js.Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (('a, 'a) => int, t<'a>) => 'b" - }, - { - "id": "Js.Array.spliceInPlace", - "kind": "value", - "name": "spliceInPlace", - "docstrings": [], - "signature": "let spliceInPlace: (~pos: int, ~remove: int, ~add: array<'a>, t<'a>) => 'b" - }, - { - "id": "Js.Array.removeFromInPlace", - "kind": "value", - "name": "removeFromInPlace", - "docstrings": [], - "signature": "let removeFromInPlace: (~pos: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.removeCountInPlace", - "kind": "value", - "name": "removeCountInPlace", - "docstrings": [], - "signature": "let removeCountInPlace: (~pos: int, ~count: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.unshift", - "kind": "value", - "name": "unshift", - "docstrings": [], - "signature": "let unshift: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.unshiftMany", - "kind": "value", - "name": "unshiftMany", - "docstrings": [], - "signature": "let unshiftMany: (array<'a>, t<'a>) => int" - }, - { - "id": "Js.Array.concat", - "kind": "value", - "name": "concat", - "docstrings": [], - "signature": "let concat: ('a, t<'b>) => 'a" - }, - { - "id": "Js.Array.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [], - "signature": "let concatMany: (array<'a>, t<'b>) => 'a" - }, - { - "id": "Js.Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: ('a, t<'a>) => bool" - }, - { - "id": "Js.Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: ('a, ~from: int, t<'a>) => int" - }, - { - "id": "Js.Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (string, t<'a>) => string" - }, - { - "id": "Js.Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: ('a, ~from: int, t<'a>) => int" - }, - { - "id": "Js.Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (int, ~end_: int, ~obj: t<'a>) => 'b" - }, - { - "id": "Js.Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Returns a copy of the entire array. Same as `Js.Array.Slice(~start=0,\n~end_=Js.Array.length(arr), arr)`. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." - ], - "signature": "let copy: t<'a> => 'this", - "deprecated": "" - }, - { - "id": "Js.Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (int, t<'a>) => 'b" - }, - { - "id": "Js.Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts the array to a string. Each element is converted to a string using\nJavaScript. Unlike the JavaScript `Array.toString()`, all elements in a\nReasonML array must have the same type. See\n[`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.toString([3.5, 4.6, 7.8]) == \"3.5,4.6,7.8\"\nJs.Array.toString([\"a\", \"b\", \"c\"]) == \"a,b,c\"\n```" - ], - "signature": "let toString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Converts the array to a string using the conventions of the current locale.\nEach element is converted to a string using JavaScript. Unlike the JavaScript\n`Array.toLocaleString()`, all elements in a ReasonML array must have the same\ntype. See\n[`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.toLocaleString([Js.Date.make()])\n// returns \"3/19/2020, 10:52:11 AM\" for locale en_US.utf8\n// returns \"2020-3-19 10:52:11\" for locale de_DE.utf8\n```" - ], - "signature": "let toLocaleString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: ('a => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (('a, int) => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: ('a => bool, t<'a>) => 'b" - }, - { - "id": "Js.Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (('a, int) => bool, t<'a>) => 'b" - }, - { - "id": "Js.Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: ('a => bool, t<'a>) => option<'a>" - }, - { - "id": "Js.Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (('a, int) => bool, t<'a>) => option<'a>" - }, - { - "id": "Js.Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: ('a => bool, t<'a>) => int" - }, - { - "id": "Js.Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (('a, int) => bool, t<'a>) => int" - }, - { - "id": "Js.Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: ('a => unit, t<'a>) => unit" - }, - { - "id": "Js.Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (('a, int) => unit, t<'a>) => unit" - }, - { - "id": "Js.Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: ('a => 'b, t<'a>) => t<'b>" - }, - { - "id": "Js.Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (('a, int) => 'b, t<'a>) => t<'b>" - }, - { - "id": "Js.Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (('a, 'b) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (('a, 'b, int) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (('a, 'b) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (('a, 'b, int) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: ('a => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (('a, int) => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [ - "Returns the value at the given position in the array if the position is in\nbounds; returns the JavaScript value `undefined` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array.unsafe_get(arr, 3) == 103\nJs.Array.unsafe_get(arr, 4) // returns undefined\n```" - ], - "signature": "let unsafe_get: (array<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Js.Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [ - "Sets the value at the given position in the array if the position is in bounds.\nIf the index is out of bounds, well, “here there be dragons.“ *This function\nmodifies the original array.*\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array.unsafe_set(arr, 3, 99)\n// result is [100, 101, 102, 99]\n\nJs.Array.unsafe_set(arr, 4, 88)\n// result is [100, 101, 102, 99, 88]\n\nJs.Array.unsafe_set(arr, 6, 77)\n// result is [100, 101, 102, 99, 88, <1 empty item>, 77]\n\nJs.Array.unsafe_set(arr, -1, 66)\n// you don't want to know.\n```" - ], - "signature": "let unsafe_set: (array<'a>, int, 'a) => unit", - "deprecated": "" - } - ] - }, - "js/exn": { - "id": "Js.Exn", - "name": "Exn", - "docstrings": [ - "Provide utilities for dealing with Js exceptions", - "Provide utilities for dealing with JS exceptions." - ], - "items": [ - { - "id": "Js.Exn.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JS exception" - ], - "signature": "type t", - "deprecated": "" - }, - { - "id": "Js.Exn.asJsExn", - "kind": "value", - "name": "asJsExn", - "docstrings": [], - "signature": "let asJsExn: exn => option", - "deprecated": "" - }, - { - "id": "Js.Exn.stack", - "kind": "value", - "name": "stack", - "docstrings": [], - "signature": "let stack: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.message", - "kind": "value", - "name": "message", - "docstrings": [], - "signature": "let message: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.name", - "kind": "value", - "name": "name", - "docstrings": [], - "signature": "let name: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [], - "signature": "let fileName: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.anyToExnInternal", - "kind": "value", - "name": "anyToExnInternal", - "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a Exn.Error if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." - ], - "signature": "let anyToExnInternal: 'a => exn", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseError", - "kind": "value", - "name": "raiseError", - "docstrings": [ - "Raise Js exception Error object with stacktrace" - ], - "signature": "let raiseError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseEvalError", - "kind": "value", - "name": "raiseEvalError", - "docstrings": [], - "signature": "let raiseEvalError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseRangeError", - "kind": "value", - "name": "raiseRangeError", - "docstrings": [], - "signature": "let raiseRangeError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseReferenceError", - "kind": "value", - "name": "raiseReferenceError", - "docstrings": [], - "signature": "let raiseReferenceError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseSyntaxError", - "kind": "value", - "name": "raiseSyntaxError", - "docstrings": [], - "signature": "let raiseSyntaxError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseTypeError", - "kind": "value", - "name": "raiseTypeError", - "docstrings": [], - "signature": "let raiseTypeError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseUriError", - "kind": "value", - "name": "raiseUriError", - "docstrings": [], - "signature": "let raiseUriError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(exn)` ignores the provided exn and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit", - "deprecated": "" - } - ] - }, - "js/null_undefined": { - "id": "Js.Null_undefined", - "name": "Null_undefined", - "docstrings": [ - "Contains functionality for dealing with values that can be both `null` and `undefined`" - ], - "items": [ - { - "id": "Js.Null_undefined.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.null_undefined<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [ - "Returns `true` if the given value is null or undefined, `false` otherwise." - ], - "signature": "let isNullable: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The null value of type `Js.null_undefined<'a>`." - ], - "signature": "let null: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The undefined value of type `Js.null_undefined<'a>`." - ], - "signature": "let undefined: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\n\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped, mapped to\na `'b` using the given function `a' => 'b`, then wrapped back up and returned\nas `Js.null_undefined<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.null_undefined) =>\n Js.Null_undefined.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function.\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped and applied to the given function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.null_undefined) =>\n Js.Null_undefined.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.null_undefined<'a>`.\n`Some(a)` => `a`\n`None` => `undefined`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.null_undefined<'a>` to `option<'a>`.\n`a` => `Some(a)`\n`undefined` => `None`\n`null` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - }, - "js/nullable": { - "id": "Js.Nullable", - "name": "Nullable", - "docstrings": [ - "Provide utilities for `Js.null_undefined`", - "Contains functionality for dealing with values that can be both `null` and `undefined`" - ], - "items": [ - { - "id": "Js.Nullable.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined", - "deprecated": "" - }, - { - "id": "Js.Nullable.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.null_undefined<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [ - "Returns `true` if the given value is null or undefined, `false` otherwise." - ], - "signature": "let isNullable: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Nullable.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The null value of type `Js.null_undefined<'a>`." - ], - "signature": "let null: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The undefined value of type `Js.null_undefined<'a>`." - ], - "signature": "let undefined: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\n\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped, mapped to\na `'b` using the given function `a' => 'b`, then wrapped back up and returned\nas `Js.null_undefined<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.null_undefined) =>\n Js.Null_undefined.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Nullable.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function.\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped and applied to the given function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.null_undefined) =>\n Js.Null_undefined.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Nullable.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.null_undefined<'a>`.\n`Some(a)` => `a`\n`None` => `undefined`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.null_undefined<'a>` to `option<'a>`.\n`a` => `Some(a)`\n`undefined` => `None`\n`null` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - }, - "js/undefined": { - "id": "Js.Undefined", - "name": "Undefined", - "docstrings": [ - "Provide utilities for `Js.undefined<'a>`", - "Provides functionality for dealing with the `Js.undefined<'a>` type" - ], - "items": [ - { - "id": "Js.Undefined.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Local alias for `Js.undefined<'a>`" - ], - "signature": "type t<'a> = undefined<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.undefined<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.test", - "kind": "value", - "name": "test", - "docstrings": [ - "Returns `true` if the given value is empty (undefined), `false` otherwise." - ], - "signature": "let test: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Undefined.testAny", - "kind": "value", - "name": "testAny", - "docstrings": [ - "Returns `true` if the given value is empty (undefined).\n\n**since 1.6.1**" - ], - "signature": "let testAny: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.Undefined.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "The empty value, `undefined`" - ], - "signature": "let empty: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [], - "signature": "let getUnsafe: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Undefined.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Undefined.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\nIf `Js.undefined<'a>` contains a value, that value is unwrapped, mapped to a\n`'b` using the given function `a' => 'b`, then wrapped back up and returned as\n`Js.undefined<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.undefined) =>\n Js.Undefined.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Undefined.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function. If\n`Js.undefined<'a>` contains a value, that value is unwrapped and applied to the\ngiven function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.undefined) =>\n Js.Undefined.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Undefined.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.undefined<'a>`.\n`Some(a)` => `a`\n`None` => `empty`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.undefined<'a>` to `option<'a>`\n`a` => `Some(a)`\n`empty` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - }, - "js/null": { - "id": "Js.Null", - "name": "Null", - "docstrings": [ - "Provide utilities for `Js.null<'a>`", - "Provides functionality for dealing with the `Js.null<'a>` type" - ], - "items": [ - { - "id": "Js.Null.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "@unboxed\ntype t<'a> = null<'a> =\n | Value('a)\n | @as(null) Null", - "deprecated": "" - }, - { - "id": "Js.Null.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.null<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.test", - "kind": "value", - "name": "test", - "docstrings": [ - "Returns `true` if the given value is empty (`null`), `false` otherwise." - ], - "signature": "let test: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Null.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "The empty value, `null`" - ], - "signature": "let empty: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [], - "signature": "let getUnsafe: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Null.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Null.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\n\nIf `Js.null<'a>` contains a value, that value is unwrapped, mapped to a `'b`\nusing the given function `'a => 'b`, then wrapped back up and returned as\n`Js.null<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.null) =>\n Js.Null.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Null.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function.\nIf `Js.null<'a>` contains a value, that value is unwrapped and applied to the given function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.null) =>\n Js.Null.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Null.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.null<'a>`.\n`Some(a)` => `a`\n`None` => `empty`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.null<'a>` to `option<'a>`.\n`a` => `Some(a)`\n`empty` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v12.0.2/stdlib.json b/apps/docs/data/api/v12.0.2/stdlib.json deleted file mode 100644 index 45b9433a0..000000000 --- a/apps/docs/data/api/v12.0.2/stdlib.json +++ /dev/null @@ -1,12742 +0,0 @@ -{ - "stdlib": { - "id": "Stdlib", - "name": "Stdlib", - "docstrings": [], - "items": [ - { - "id": "Stdlib.timeoutId", - "kind": "type", - "name": "timeoutId", - "docstrings": [ - "An `id` representing a timeout started via `setTimeout`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN." - ], - "signature": "type timeoutId = Global.timeoutId" - }, - { - "id": "Stdlib.setTimeout", - "kind": "value", - "name": "setTimeout", - "docstrings": [ - "`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200)\n```" - ], - "signature": "let setTimeout: (unit => unit, int) => timeoutId" - }, - { - "id": "Stdlib.setTimeoutFloat", - "kind": "value", - "name": "setTimeoutFloat", - "docstrings": [ - "`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200.)\n```" - ], - "signature": "let setTimeoutFloat: (unit => unit, float) => timeoutId" - }, - { - "id": "Stdlib.clearTimeout", - "kind": "value", - "name": "clearTimeout", - "docstrings": [ - "`clearTimeout(timeoutId)` clears a scheduled timeout if it hasn't already executed.\n\nSee [`clearTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout) on MDN.\n\n## Examples\n\n```rescript\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 2 seconds.\")\n}, 2000)\n\n// Clearing the timeout right away, before 2 seconds has passed, means that the above callback logging to the console will never run.\nclearTimeout(timeoutId)\n```" - ], - "signature": "let clearTimeout: timeoutId => unit" - }, - { - "id": "Stdlib.intervalId", - "kind": "type", - "name": "intervalId", - "docstrings": [ - "An `id` representing an interval started via `setInterval`.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN." - ], - "signature": "type intervalId = Global.intervalId" - }, - { - "id": "Stdlib.setInterval", - "kind": "value", - "name": "setInterval", - "docstrings": [ - "`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 200 ms (200 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 200 ms.\")\n}, 200)\n\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```" - ], - "signature": "let setInterval: (unit => unit, int) => intervalId" - }, - { - "id": "Stdlib.setIntervalFloat", - "kind": "value", - "name": "setIntervalFloat", - "docstrings": [ - "`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 2 seconds (200 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 200 ms\")\n}, 200.)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeoutFloat(() => {\n clearInterval(intervalId)\n}, 500.0)\n```" - ], - "signature": "let setIntervalFloat: (unit => unit, float) => intervalId" - }, - { - "id": "Stdlib.clearInterval", - "kind": "value", - "name": "clearInterval", - "docstrings": [ - "`clearInterval(intervalId)` clears a scheduled interval.\n\nSee [`clearInterval`](https://developer.mozilla.org/en-US/docs/Web/API/clearInterval) on MDN.\n\n## Examples\n\n```rescript\nlet intervalId = setInterval(() => {\n Console.log(\"This prints in 100 ms\")\n}, 100)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```" - ], - "signature": "let clearInterval: intervalId => unit" - }, - { - "id": "Stdlib.encodeURI", - "kind": "value", - "name": "encodeURI", - "docstrings": [ - "Encodes a URI by replacing characters in the provided string that aren't valid in a URL.\n\nThis is intended to operate on full URIs, so it encodes fewer characters than what `encodeURIComponent` does.\nIf you're looking to encode just parts of a URI, like a query parameter, prefer `encodeURIComponent`.\n\nSee [`encodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI) on MDN.\n\n## Examples\n```rescript\nConsole.log(encodeURI(\"https://rescript-lang.org?array=[someValue]\"))\n// Logs \"https://rescript-lang.org?array=%5BsomeValue%5D\" to the console.\n```" - ], - "signature": "let encodeURI: string => string" - }, - { - "id": "Stdlib.decodeURI", - "kind": "value", - "name": "decodeURI", - "docstrings": [ - "Decodes a previously encoded URI back to a regular string.\n\nThis is intended to operate on full URIs, so it decodes fewer characters than what `decodeURIComponent` does.\nIf you're looking to decode just parts of a URI, like a query parameter, prefer `decodeURIComponent`.\n\nSee [`decodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI) on MDN.\n\n## Examples\n```rescript\nConsole.log(decodeURI(\"https://rescript-lang.org?array=%5BsomeValue%5D\"))\n// Logs \"https://rescript-lang.org?array=[someValue]\" to the console.\n```" - ], - "signature": "let decodeURI: string => string" - }, - { - "id": "Stdlib.encodeURIComponent", - "kind": "value", - "name": "encodeURIComponent", - "docstrings": [ - "Encodes a string so it can be used as part of a URI.\n\nSee [`encodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) on MDN.\n\n## Examples\n```rescript\nConsole.log(encodeURIComponent(\"array=[someValue]\"))\n// Logs \"array%3D%5BsomeValue%5D\" to the console.\n```" - ], - "signature": "let encodeURIComponent: string => string" - }, - { - "id": "Stdlib.decodeURIComponent", - "kind": "value", - "name": "decodeURIComponent", - "docstrings": [ - "Decodes a previously URI encoded string back to its original form.\n\nSee [`decodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) on MDN.\n\n## Examples\n```rescript\nConsole.log(decodeURIComponent(\"array%3D%5BsomeValue%5D\"))\n// Logs \"array=[someValue]\" to the console.\n```" - ], - "signature": "let decodeURIComponent: string => string" - }, - { - "id": "Stdlib.date", - "kind": "type", - "name": "date", - "docstrings": [], - "signature": "type date = Date.t" - }, - { - "id": "Stdlib.null", - "kind": "type", - "name": "null", - "docstrings": [], - "signature": "type null<'a> = null<'a>" - }, - { - "id": "Stdlib.undefined", - "kind": "type", - "name": "undefined", - "docstrings": [], - "signature": "type undefined<'a> = undefined<'a>" - }, - { - "id": "Stdlib.nullable", - "kind": "type", - "name": "nullable", - "docstrings": [], - "signature": "type nullable<'a> = nullable<'a>" - }, - { - "id": "Stdlib.lazy_t", - "kind": "type", - "name": "lazy_t", - "docstrings": [], - "signature": "type lazy_t<'a> = Lazy.t<'a>", - "deprecated": "Use Lazy.t instead" - }, - { - "id": "Stdlib.window", - "kind": "value", - "name": "window", - "docstrings": [], - "signature": "let window: Dom.window", - "deprecated": "Use rescript-webapi instead" - }, - { - "id": "Stdlib.document", - "kind": "value", - "name": "document", - "docstrings": [], - "signature": "let document: Dom.document", - "deprecated": "Use rescript-webapi instead" - }, - { - "id": "Stdlib.globalThis", - "kind": "value", - "name": "globalThis", - "docstrings": [ - "`globalThis` gives you the host global object (`window` in browsers, `global` in Node, etc.).\nYou can reach shared globals from any runtime without special checks.\n\n## Examples\n\n**Note:** These are demonstrative examples. In real code, prefer writing your own type-safe bindings.\nSee [`Bind to Global JS Values`](https://rescript-lang.org/docs/manual/v12.0.0/bind-to-global-js-values).\n\n\n```rescript\ntypeof(globalThis[\"setTimeout\"]) == #function\n\nglobalThis[\"myAppName\"] = \"SuperApp\";\nglobalThis[\"myAppName\"] == \"SuperApp\"\n```" - ], - "signature": "let globalThis: {..}" - }, - { - "id": "Stdlib.import", - "kind": "value", - "name": "import", - "docstrings": [ - "`import(value)` dynamically import a value or function from a ReScript\nmodule. The import call will return a `promise`, resolving to the dynamically loaded\nvalue.\n\n## Examples\n\n`Array.res` file:\n\n```rescript\n@send external indexOf: (array<'a>, 'a) => int = \"indexOf\"\n\nlet indexOfOpt = (arr, item) =>\n switch arr->indexOf(item) {\n | -1 => None\n | index => Some(index)\n }\n```\nIn other file you can import the `indexOfOpt` value defined in `Array.res`\n\n```rescript\nlet main = async () => {\n let indexOfOpt = await import(Array.indexOfOpt)\n let index = indexOfOpt([1, 2], 2)\n Console.log(index)\n}\n```\n\nCompiles to:\n\n```javascript\nasync function main() {\n var add = await import(\"./Array.mjs\").then(function(m) {\n return m.indexOfOpt;\n });\n var index = indexOfOpt([1, 2], 2);\n console.log(index);\n}\n```" - ], - "signature": "let import: 'a => promise<'a>" - }, - { - "id": "Stdlib.panic", - "kind": "value", - "name": "panic", - "docstrings": [ - "`panic(message)` throws a JavaScript `Error` prefixed with `Panic!`.\nCall it when something went wrong and the program should stop right away.\n\n## Examples\n\n```rescript\nlet caught = try panic(\"Invariant violated\") catch {\n| JsExn(err) => JsExn.message(err)->Option.getOrThrow\n}\n\ncaught == \"Panic! Invariant violated\"\n```" - ], - "signature": "let panic: string => 'a" - }, - { - "id": "Stdlib.assertEqual", - "kind": "value", - "name": "assertEqual", - "docstrings": [ - "`assertEqual(a, b)` check if `a` is equal `b`. If not throw a panic exception\n\n## Examples\n\n```rescript\nlist{1, 2}->List.tailExn == list{2}\n```" - ], - "signature": "let assertEqual: ('a, 'a) => unit" - }, - { - "id": "Stdlib.null", - "kind": "value", - "name": "null", - "docstrings": [ - "`null` returns the JavaScript `null` value as a `nullable<'a>`.\nUse the `Nullable` helpers to convert it into an `option` or to read the value.\n\n## Examples\n\n```rescript\nnull->Nullable.toOption == None\n```" - ], - "signature": "let null: nullable<'a>" - }, - { - "id": "Stdlib.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "`undefined` returns the JavaScript `undefined` value as a `nullable<'a>`.\nUse the `Nullable` helpers to convert it into an `option` or to read the value.\n\n## Examples\n\n```rescript\nundefined->Nullable.toOption == None\n```" - ], - "signature": "let undefined: nullable<'a>" - }, - { - "id": "Stdlib.typeof", - "kind": "value", - "name": "typeof", - "docstrings": [ - "`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```" - ], - "signature": "let typeof: 'a => Type.t" - } - ] - }, - "stdlib/intl/numberformat/grouping": { - "id": "Stdlib.Intl.NumberFormat.Grouping", - "name": "Grouping", - "docstrings": [ - "Represents the `useGrouping` option accepted by `Intl.NumberFormat`.\n\nSee [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) on MDN for full option details." - ], - "items": [ - { - "id": "Stdlib.Intl.NumberFormat.Grouping.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.parsed", - "kind": "type", - "name": "parsed", - "docstrings": [], - "signature": "type parsed = [#always | #auto | #bool(bool) | #min2]" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.fromBool", - "kind": "value", - "name": "fromBool", - "docstrings": [ - "Constructs a grouping setting from a boolean.\n\n## Examples\n\n```rescript\nlet formatter =\n Intl.NumberFormat.make(\n ~locales=[\"en-US\"],\n ~options={useGrouping: Intl.NumberFormat.Grouping.fromBool(false)},\n )\nformatter->Intl.NumberFormat.format(1234.) == \"1234\"\n```" - ], - "signature": "let fromBool: bool => t" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Constructs a grouping setting from a string literal.\n\n## Examples\n\n```rescript\nlet formatter =\n Intl.NumberFormat.make(\n ~locales=[\"en-US\"],\n ~options={useGrouping: Intl.NumberFormat.Grouping.fromString(#always)},\n )\nformatter->Intl.NumberFormat.format(1234.) == \"1,234\"\n```" - ], - "signature": "let fromString: [#always | #auto | #min2] => t" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.parseJsValue", - "kind": "value", - "name": "parseJsValue", - "docstrings": [ - "`parseJsValue(value)` attempts to interpret a JavaScript `value` as a grouping setting.\n\n## Examples\n\n```rescript\nIntl.NumberFormat.Grouping.parseJsValue(Js.Json.string(\"auto\")) == Some(#auto)\n```" - ], - "signature": "let parseJsValue: 'a => option<[> #always | #auto | #bool(bool) | #min2]>" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(grouping)` ignores the provided grouping and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/biguint64array/constants": { - "id": "Stdlib.BigUint64Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigUint64Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/bigint64array/constants": { - "id": "Stdlib.BigInt64Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigInt64Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint8clampedarray/constants": { - "id": "Stdlib.Uint8ClampedArray.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8ClampedArray.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint32array/constants": { - "id": "Stdlib.Uint32Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint32Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint16array/constants": { - "id": "Stdlib.Uint16Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint16Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint8array/constants": { - "id": "Stdlib.Uint8Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/int32array/constants": { - "id": "Stdlib.Int32Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int32Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/int16array/constants": { - "id": "Stdlib.Int16Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int16Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/int8array/constants": { - "id": "Stdlib.Int8Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int8Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/float64array/constants": { - "id": "Stdlib.Float64Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float64Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/float32array/constants": { - "id": "Stdlib.Float32Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float32Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/type/classify": { - "id": "Stdlib.Type.Classify", - "name": "Classify", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Type.Classify.function", - "kind": "type", - "name": "function", - "docstrings": [ - "An abstract type representing a JavaScript function.\n\n See [`function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) on MDN." - ], - "signature": "type function" - }, - { - "id": "Stdlib.Type.Classify.object", - "kind": "type", - "name": "object", - "docstrings": [ - "An abstract type representing a JavaScript object.\n\n See [`object`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) on MDN." - ], - "signature": "type object" - }, - { - "id": "Stdlib.Type.Classify.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type representing a classified JavaScript value." - ], - "signature": "type t =\n | Bool(bool)\n | Null\n | Undefined\n | String(string)\n | Number(float)\n | Object(object)\n | Function(function)\n | Symbol(Symbol.t)\n | BigInt(bigint)" - }, - { - "id": "Stdlib.Type.Classify.classify", - "kind": "value", - "name": "classify", - "docstrings": [ - "`classify(anyValue)`\nClassifies a JavaScript value.\n\n## Examples\n```rescript\nswitch %raw(`null`)->Type.Classify.classify {\n| Null => Console.log(\"Yup, that's null.\")\n| _ => Console.log(\"This doesn't actually appear to be null...\")\n}\n```" - ], - "signature": "let classify: 'a => t" - } - ] - }, - "stdlib/regexp/result": { - "id": "Stdlib.RegExp.Result", - "name": "Result", - "docstrings": [], - "items": [ - { - "id": "Stdlib.RegExp.Result.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing the result of a `RegExp` execution." - ], - "signature": "type t = array>" - }, - { - "id": "Stdlib.RegExp.Result.fullMatch", - "kind": "value", - "name": "fullMatch", - "docstrings": [ - "`fullMatch(regExpResult)` returns the full string that matched in this result.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n \n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints the full string that matched, \"ReScript is\"\n }\n ```" - ], - "signature": "let fullMatch: t => string" - }, - { - "id": "Stdlib.RegExp.Result.matches", - "kind": "value", - "name": "matches", - "docstrings": [ - "`matches(regExpResult)` returns all matches for `regExpResult`.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n \n // This below will log \"ReScript\" and \"is\" to the console.\n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) =>\n switch result->RegExp.Result.matches->Array.keepSome {\n | [firstWord, secondWord] => Console.log2(firstWord, secondWord)\n | _ => Console.log(\"Didn't find exactly two words...\")\n }\n }\n ```" - ], - "signature": "let matches: t => array>" - }, - { - "id": "Stdlib.RegExp.Result.index", - "kind": "value", - "name": "index", - "docstrings": [], - "signature": "let index: t => int" - }, - { - "id": "Stdlib.RegExp.Result.input", - "kind": "value", - "name": "input", - "docstrings": [ - "`input(regExpResult)` returns the full input string that was passed to what produced the `RegExp.Result.t`.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n \n // This below will log the full input string \"ReScript is pretty cool, right?\" to the console.\n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) => Console.log(result->RegExp.Result.input)\n }\n ```" - ], - "signature": "let input: t => string" - } - ] - }, - "stdlib/math/int": { - "id": "Stdlib.Math.Int", - "name": "Int", - "docstrings": [ - "Provide Math utilities for `int`" - ], - "items": [ - { - "id": "Stdlib.Math.Int.abs", - "kind": "value", - "name": "abs", - "docstrings": [ - "`abs(v)` returns absolute value of `v`.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.abs(-2) == 2\n Math.Int.abs(3) == 3\n ```" - ], - "signature": "let abs: int => int" - }, - { - "id": "Stdlib.Math.Int.clz32", - "kind": "value", - "name": "clz32", - "docstrings": [ - "`clz32(v)` returns the number of leading zero bits of the argument's 32 bit\nint representation.\nSee [`Math.clz32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32) on MDN.\n\n ## Examples\n\n ```rescript\n // 00000000000000000000000000000001\n Math.Int.clz32(1) == 31\n // 00000000000000000000000000000100\n Math.Int.clz32(4) == 29\n ```" - ], - "signature": "let clz32: int => int" - }, - { - "id": "Stdlib.Math.Int.imul", - "kind": "value", - "name": "imul", - "docstrings": [ - "`imul(a, b)` returns 32-bit integer multiplication. Use this only when you\nneed to optimize performance of multiplication of numbers stored as 32-bit\nintegers.\nSee [`Math.imul`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.imul(3, 4) == 12\n Math.Int.imul(-5, 12) == -60\n ```" - ], - "signature": "let imul: (int, int) => int" - }, - { - "id": "Stdlib.Math.Int.min", - "kind": "value", - "name": "min", - "docstrings": [ - "`min(a, b)` returns the minimum of its two integer arguments.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.min(1, 2) == 1\n Math.Int.min(-1, -2) == -2\n ```" - ], - "signature": "let min: (int, int) => int" - }, - { - "id": "Stdlib.Math.Int.minMany", - "kind": "value", - "name": "minMany", - "docstrings": [ - "`minMany(arr)` returns the minimum of the integers in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.minMany([1, 2]) == 1\n Math.Int.minMany([-1, -2]) == -2\n Math.Int.minMany([])->Int.toFloat->Float.isFinite == false\n ```" - ], - "signature": "let minMany: array => int" - }, - { - "id": "Stdlib.Math.Int.max", - "kind": "value", - "name": "max", - "docstrings": [ - "`max(a, b)` returns the maximum of its two integer arguments.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.max(1, 2) == 2\n Math.Int.max(-1, -2) == -1\n ```" - ], - "signature": "let max: (int, int) => int" - }, - { - "id": "Stdlib.Math.Int.maxMany", - "kind": "value", - "name": "maxMany", - "docstrings": [ - "`maxMany(arr)` returns the maximum of the integers in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.maxMany([1, 2]) == 2\n Math.Int.maxMany([-1, -2]) == -1\n Math.Int.maxMany([])->Int.toFloat->Float.isFinite == false\n ```" - ], - "signature": "let maxMany: array => int" - }, - { - "id": "Stdlib.Math.Int.pow", - "kind": "value", - "name": "pow", - "docstrings": [ - "`pow(a, ~exp)` throws the given base `a` to the given exponent `exp`.\nSee [`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.pow(2, ~exp=4) == 16\n Math.Int.pow(3, ~exp=4) == 81\n ```" - ], - "signature": "let pow: (int, ~exp: int) => int" - }, - { - "id": "Stdlib.Math.Int.sign", - "kind": "value", - "name": "sign", - "docstrings": [ - "`sign(v)` returns the sign of its integer argument: `-1` if negative, `0` if\nzero, `1` if positive.\nSee [`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.sign(3) == 1\n Math.Int.sign(-3) == -1\n Math.Int.sign(0) == 0\n ```" - ], - "signature": "let sign: int => int" - }, - { - "id": "Stdlib.Math.Int.floor", - "kind": "value", - "name": "floor", - "docstrings": [ - "floor(v) returns the largest `int` less than or equal to the argument;\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.floor(3.7) == 3\n Math.Int.floor(3.0) == 3\n Math.Int.floor(-3.1) == -4\n ```" - ], - "signature": "let floor: float => int" - }, - { - "id": "Stdlib.Math.Int.ceil", - "kind": "value", - "name": "ceil", - "docstrings": [ - "ceil(v) returns the smallest `int` greater than or equal to the argument;\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.ceil(3.7) == 4\n Math.Int.ceil(3.0) == 3\n Math.Int.ceil(-3.1) == -3\n ```" - ], - "signature": "let ceil: float => int" - }, - { - "id": "Stdlib.Math.Int.random", - "kind": "value", - "name": "random", - "docstrings": [ - "`random(minVal, maxVal)` returns a random integer number in the half-closed interval \\[minVal, maxVal).\nSee [`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\non MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.random(2, 5)\n Math.Int.random(505, 2000)\n Math.Int.random(-7, -2)\n ```" - ], - "signature": "let random: (int, int) => int" - } - ] - }, - "stdlib/math/constants": { - "id": "Stdlib.Math.Constants", - "name": "Constants", - "docstrings": [ - "Mathematical Constants" - ], - "items": [ - { - "id": "Stdlib.Math.Constants.e", - "kind": "value", - "name": "e", - "docstrings": [ - "`Math.Constants.e` returns Euler's number, ≈ 2.718281828459045.\nSee [`Math.E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.e\n ```" - ], - "signature": "let e: float" - }, - { - "id": "Stdlib.Math.Constants.ln2", - "kind": "value", - "name": "ln2", - "docstrings": [ - "`Math.Constants.ln2` returns Natural logarithm of 2, ≈ 0.6931471805599453.\nSee [`Math.LN2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN2) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.ln2\n ```" - ], - "signature": "let ln2: float" - }, - { - "id": "Stdlib.Math.Constants.ln10", - "kind": "value", - "name": "ln10", - "docstrings": [ - "`Math.Constants.ln10` returns Natural logarithm of 10, ≈ 2.302585092994046.\nSee [`Math.LN10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN10) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.ln10\n ```" - ], - "signature": "let ln10: float" - }, - { - "id": "Stdlib.Math.Constants.log2e", - "kind": "value", - "name": "log2e", - "docstrings": [ - "`Math.Constants.log2e` returns Base 2 logarithm of E, ≈ 1.4426950408889634.\nSee [`Math.LOG2E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG2E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.log2e\n ```" - ], - "signature": "let log2e: float" - }, - { - "id": "Stdlib.Math.Constants.log10e", - "kind": "value", - "name": "log10e", - "docstrings": [ - "`Math.Constants.log10e` returns Base 10 logarithm of E, ≈ 0.4342944819032518.\nSee [`Math.LOG10E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG10E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.log10e\n ```" - ], - "signature": "let log10e: float" - }, - { - "id": "Stdlib.Math.Constants.pi", - "kind": "value", - "name": "pi", - "docstrings": [ - "`Math.Constants.pi` returns Pi - ratio of the circumference to the diameter\nof a circle, ≈ 3.141592653589793.\nSee [`Math.PI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/PI) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.pi\n ```" - ], - "signature": "let pi: float" - }, - { - "id": "Stdlib.Math.Constants.sqrt1_2", - "kind": "value", - "name": "sqrt1_2", - "docstrings": [ - "`Math.Constants.sqrt1_2` returns Square root of 1/2, ≈ 0.7071067811865476.\nSee [`Math.SQRT1_2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.sqrt1_2\n ```" - ], - "signature": "let sqrt1_2: float" - }, - { - "id": "Stdlib.Math.Constants.sqrt2", - "kind": "value", - "name": "sqrt2", - "docstrings": [ - "`Math.Constants.e` returns Absolute value for integer argument.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.sqrt2\n ```" - ], - "signature": "let sqrt2: float" - } - ] - }, - "stdlib/json/decode": { - "id": "Stdlib.JSON.Decode", - "name": "Decode", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JSON.Decode.bool", - "kind": "value", - "name": "bool", - "docstrings": [ - "Decodes a single JSON value. If the value is a bool, it will return `Some(bool)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`true`)->JSON.Decode.bool\n // Some(true)\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.bool\n // None\n ```" - ], - "signature": "let bool: t => option" - }, - { - "id": "Stdlib.JSON.Decode.null", - "kind": "value", - "name": "null", - "docstrings": [ - "Decodes a single JSON value. If the value is null, it will return `Some(Null.t)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`null`)->JSON.Decode.null\n // Some(null)\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.null\n // None\n ```" - ], - "signature": "let null: t => option>" - }, - { - "id": "Stdlib.JSON.Decode.string", - "kind": "value", - "name": "string", - "docstrings": [ - "Decodes a single JSON value. If the value is a string, it will return `Some(string)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.string\n // Some(\"hello world\")\n \n JSON.parseOrThrow(`42`)->JSON.Decode.string\n // None\n ```" - ], - "signature": "let string: t => option" - }, - { - "id": "Stdlib.JSON.Decode.float", - "kind": "value", - "name": "float", - "docstrings": [ - "Decodes a single JSON value. If the value is a float, it will return `Some(float)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`42.0`)->JSON.Decode.float\n // Some(42.0)\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.float\n // None\n ```" - ], - "signature": "let float: t => option" - }, - { - "id": "Stdlib.JSON.Decode.object", - "kind": "value", - "name": "object", - "docstrings": [ - "Decodes a single JSON value. If the value is an object, it will return `Some(dict)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`{\"foo\":\"bar\"}`)->JSON.Decode.object\n // Some({ foo: 'bar' })\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.object\n // None\n ```" - ], - "signature": "let object: t => option>" - }, - { - "id": "Stdlib.JSON.Decode.array", - "kind": "value", - "name": "array", - "docstrings": [ - "Decodes a single JSON value. If the value is an array, it will return `Some(array)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`[\"foo\", \"bar\"]`)->JSON.Decode.array\n // Some([ 'foo', 'bar' ])\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.array\n // None\n ```" - ], - "signature": "let array: t => option>" - } - ] - }, - "stdlib/json/encode": { - "id": "Stdlib.JSON.Encode", - "name": "Encode", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JSON.Encode.bool", - "kind": "value", - "name": "bool", - "docstrings": [ - "Returns a boolean as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.bool(true)\n ```" - ], - "signature": "let bool: bool => t" - }, - { - "id": "Stdlib.JSON.Encode.null", - "kind": "value", - "name": "null", - "docstrings": [ - "Returns null as a JSON value.\n\n ## Examples\n ```rescript\n JSON.Encode.null\n ```" - ], - "signature": "let null: t" - }, - { - "id": "Stdlib.JSON.Encode.string", - "kind": "value", - "name": "string", - "docstrings": [ - "Returns a string as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.string(\"hello world\")\n ```" - ], - "signature": "let string: string => t" - }, - { - "id": "Stdlib.JSON.Encode.int", - "kind": "value", - "name": "int", - "docstrings": [ - "Returns an int as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.int(42)\n ```" - ], - "signature": "let int: int => t" - }, - { - "id": "Stdlib.JSON.Encode.float", - "kind": "value", - "name": "float", - "docstrings": [ - "Returns a float as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.float(42.0)\n ```" - ], - "signature": "let float: float => t" - }, - { - "id": "Stdlib.JSON.Encode.object", - "kind": "value", - "name": "object", - "docstrings": [ - "Returns a dict as a JSON object.\n\n ## Examples\n ```rescript\n let dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n ])\n \n JSON.Encode.object(dict)\n ```" - ], - "signature": "let object: dict => t" - }, - { - "id": "Stdlib.JSON.Encode.array", - "kind": "value", - "name": "array", - "docstrings": [ - "Returns an array as JSON.\n\n ## Examples\n ```rescript\n let array = [JSON.Encode.string(\"hello world\"), JSON.Encode.int(42)]\n \n JSON.Encode.array(array)\n ```" - ], - "signature": "let array: array => t" - }, - { - "id": "Stdlib.JSON.Encode.stringArray", - "kind": "value", - "name": "stringArray", - "docstrings": [ - "Returns an array of strings as a JSON object." - ], - "signature": "let stringArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.floatArray", - "kind": "value", - "name": "floatArray", - "docstrings": [ - "Returns an array of floats as a JSON object." - ], - "signature": "let floatArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.intArray", - "kind": "value", - "name": "intArray", - "docstrings": [ - "Returns an array of integers as a JSON object." - ], - "signature": "let intArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.boolArray", - "kind": "value", - "name": "boolArray", - "docstrings": [ - "Returns an array of booleans as a JSON object." - ], - "signature": "let boolArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.objectArray", - "kind": "value", - "name": "objectArray", - "docstrings": [ - "Returns an array of objects as a JSON object." - ], - "signature": "let objectArray: array> => t" - } - ] - }, - "stdlib/json/classify": { - "id": "Stdlib.JSON.Classify", - "name": "Classify", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JSON.Classify.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a JavaScript type." - ], - "signature": "type t =\n | Bool(bool)\n | Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)" - }, - { - "id": "Stdlib.JSON.Classify.classify", - "kind": "value", - "name": "classify", - "docstrings": [ - "Returns the JSON type of any value.\n\n ## Examples\n ```rescript\n JSON.Classify.classify(\"hello world\")\n // String(\"hello world\")\n \n JSON.Classify.classify(42)\n // Number(42)\n ```" - ], - "signature": "let classify: 'a => t", - "deprecated": "Directly switch on the JSON object instead" - } - ] - }, - "stdlib/jserror/urierror": { - "id": "Stdlib.JsError.URIError", - "name": "URIError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.URIError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `URIError` with the provided `message`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.URIError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `URIError` with the provided `message` and throws it.\n\n `JsError.URIError.throwWithMessage(\"message\")` is equivalent to `JsError.URIError.make(\"message\")->JsError.throw`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/typeerror": { - "id": "Stdlib.JsError.TypeError", - "name": "TypeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.TypeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `TypeError` with the provided `message`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.TypeError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `TypeError` with the provided `message` and throws it.\n\n `JsError.TypeError.throwWithMessage(\"message\")` is equivalent to `JsError.TypeError.make(\"message\")->JsError.throw`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/syntaxerror": { - "id": "Stdlib.JsError.SyntaxError", - "name": "SyntaxError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.SyntaxError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `SyntaxError` with the provided `message`.\n\n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.SyntaxError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `SyntaxError` with the provided `message` and throws it.\n \n `JsError.SyntaxError.throwWithMessage(\"message\")` is equivalent to `JsError.SyntaxError.make(\"message\")->JsError.throw`.\n \n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/referenceerror": { - "id": "Stdlib.JsError.ReferenceError", - "name": "ReferenceError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.ReferenceError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `ReferenceError` with the provided `message`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.ReferenceError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `ReferenceError` with the provided `message` and throws it.\n\n `JsError.ReferenceError.throwWithMessage(\"message\")` is equivalent to `JsError.ReferenceError.make(\"message\")->JsError.throw`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/rangeerror": { - "id": "Stdlib.JsError.RangeError", - "name": "RangeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.RangeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `RangeError` with the provided `message`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.RangeError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `RangeError` with the provided `message` and throws it.\n \n `JsError.RangeError.throwWithMessage(\"message\")` is equivalent to `JsError.RangeError.make(\"message\")->JsError.throw`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/evalerror": { - "id": "Stdlib.JsError.EvalError", - "name": "EvalError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.EvalError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `EvalError` with the provided `message`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.EvalError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `EvalError` with the provided `message` and throws it.\n\n `JsError.EvalError.throwWithMessage(\"message\")` is equivalent to `JsError.EvalError.make(\"message\")->JsError.throw`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/intl/segments": { - "id": "Stdlib.Intl.Segments", - "name": "Segments", - "docstrings": [ - "Bindings to `Segments` objects produced by `Intl.Segmenter.segment`.\n A Segments instance is an object that represents the segments of a specific string, subject to the locale and options of its constructing Intl.Segmenter instance.\nhttps://tc39.es/ecma402/#sec-segments-objects.\n\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment) for API details and the [ECMA-402 specification](https://tc39.es/ecma402/#sec-segments-objects) for the object shape." - ], - "items": [ - { - "id": "Stdlib.Intl.Segments.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Segments.segmentData", - "kind": "type", - "name": "segmentData", - "docstrings": [], - "signature": "type segmentData = {\n segment: string,\n index: int,\n isWordLike: option,\n input: string,\n}" - }, - { - "id": "Stdlib.Intl.Segments.containing", - "kind": "value", - "name": "containing", - "docstrings": [ - "`containing(segments)` returns the segment data for the index supplied when iterating.\n\nUse this when consuming `Segments` via iteration helpers where the index is already implied." - ], - "signature": "let containing: t => segmentData" - }, - { - "id": "Stdlib.Intl.Segments.containingWithIndex", - "kind": "value", - "name": "containingWithIndex", - "docstrings": [ - "`containingWithIndex(segments, index)` returns the segment that contains `index` within the original string.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #word})\nlet segments = segmenter->Intl.Segmenter.segment(\"Hello world\")\nIntl.Segments.containingWithIndex(segments, 0).segment == \"Hello\"\n```" - ], - "signature": "let containingWithIndex: (t, int) => segmentData" - }, - { - "id": "Stdlib.Intl.Segments.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(segments)` ignores the provided segments and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/segmenter": { - "id": "Stdlib.Intl.Segmenter", - "name": "Segmenter", - "docstrings": [ - "Bindings to JavaScript's `Intl.Segmenter`.\n\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter) for API details." - ], - "items": [ - { - "id": "Stdlib.Intl.Segmenter.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Segmenter.granularity", - "kind": "type", - "name": "granularity", - "docstrings": [], - "signature": "type granularity = [#grapheme | #sentence | #word]" - }, - { - "id": "Stdlib.Intl.Segmenter.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n granularity?: granularity,\n}" - }, - { - "id": "Stdlib.Intl.Segmenter.pluralCategories", - "kind": "type", - "name": "pluralCategories", - "docstrings": [], - "signature": "type pluralCategories = [\n | #few\n | #many\n | #one\n | #other\n | #two\n | #zero\n]" - }, - { - "id": "Stdlib.Intl.Segmenter.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n granularity: granularity,\n}" - }, - { - "id": "Stdlib.Intl.Segmenter.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.Segmenter.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.Segmenter` instance for segmenting strings.\n\nSee [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter) on MDN.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #word})\nIntl.Segmenter.resolvedOptions(segmenter).granularity == #word\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.Segmenter.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for segmentation.\n\nSee [`Intl.Segmenter.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.Segmenter.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.Segmenter.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(segmenter)` returns the locale and granularity currently in use.\n\nSee [`Intl.Segmenter.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #sentence})\nIntl.Segmenter.resolvedOptions(segmenter).granularity == #sentence\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.Segmenter.segment", - "kind": "value", - "name": "segment", - "docstrings": [ - "`segment(segmenter, input)` returns a `Segments` object describing `input`.\n\nSee [`Intl.Segmenter.prototype.segment`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment) on MDN.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #word})\nlet segments = segmenter->Intl.Segmenter.segment(\"Hello world\")\nIntl.Segments.containingWithIndex(segments, 0).segment == \"Hello\"\n```" - ], - "signature": "let segment: (t, string) => Intl_Segments.t" - }, - { - "id": "Stdlib.Intl.Segmenter.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(segmenter)` ignores the provided segmenter and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/relativetimeformat": { - "id": "Stdlib.Intl.RelativeTimeFormat", - "name": "RelativeTimeFormat", - "docstrings": [ - "Bindings to JavaScript's `Intl.RelativeTimeFormat`.\n\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) for API details." - ], - "items": [ - { - "id": "Stdlib.Intl.RelativeTimeFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.numeric", - "kind": "type", - "name": "numeric", - "docstrings": [], - "signature": "type numeric = [#always | #auto]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.style", - "kind": "type", - "name": "style", - "docstrings": [], - "signature": "type style = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.timeUnit", - "kind": "type", - "name": "timeUnit", - "docstrings": [], - "signature": "type timeUnit = [\n | #day\n | #hour\n | #minute\n | #month\n | #quarter\n | #second\n | #week\n | #year\n]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n numeric?: numeric,\n style?: style,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n numeric: numeric,\n style: style,\n numberingSystem: string,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.relativeTimePartComponent", - "kind": "type", - "name": "relativeTimePartComponent", - "docstrings": [], - "signature": "type relativeTimePartComponent = [#integer | #literal]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.relativeTimePart", - "kind": "type", - "name": "relativeTimePart", - "docstrings": [], - "signature": "type relativeTimePart = {\n \\\"type\": relativeTimePartComponent,\n value: string,\n unit?: timeUnit,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.RelativeTimeFormat` instance for formatting relative time strings.\n\nSee [`Intl.RelativeTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en-US\"])\nformatter->Intl.RelativeTimeFormat.format(1, #day)->String.length > 0\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for relative time formatting.\n\nSee [`Intl.RelativeTimeFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.RelativeTimeFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the locale and options currently in use.\n\nSee [`Intl.RelativeTimeFormat.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en-US\"])\nIntl.RelativeTimeFormat.resolvedOptions(formatter).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, value, unit)` returns the formatted string for `value` expressed in `unit`.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en\"])\nformatter->Intl.RelativeTimeFormat.format(-1, #day)->String.length > 0\n```" - ], - "signature": "let format: (t, int, timeUnit) => string" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, value, unit)` returns an array describing how the output string is assembled.\n\nSee [`Intl.RelativeTimeFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en\"])\nformatter->Intl.RelativeTimeFormat.formatToParts(-1, #day)->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, int, timeUnit) => array" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(relativeTimeFormat)` ignores the provided relativeTimeFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/pluralrules": { - "id": "Stdlib.Intl.PluralRules", - "name": "PluralRules", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.PluralRules.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.PluralRules.localeType", - "kind": "type", - "name": "localeType", - "docstrings": [], - "signature": "type localeType = [#cardinal | #ordinal]" - }, - { - "id": "Stdlib.Intl.PluralRules.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n \\\"type\"?: localeType,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" - }, - { - "id": "Stdlib.Intl.PluralRules.pluralCategories", - "kind": "type", - "name": "pluralCategories", - "docstrings": [], - "signature": "type pluralCategories = [\n | #few\n | #many\n | #one\n | #other\n | #two\n | #zero\n]" - }, - { - "id": "Stdlib.Intl.PluralRules.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n pluralCategories: array,\n \\\"type\": localeType,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" - }, - { - "id": "Stdlib.Intl.PluralRules.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.PluralRules.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.PluralRules` instance to determine plural categories.\n\nSee [`Intl.PluralRules`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules) on MDN.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nlet category = rules->Intl.PluralRules.select(1.0)\ncategory == #one\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.PluralRules.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for plural rules.\n\nSee [`Intl.PluralRules.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.PluralRules.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.PluralRules.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(rules)` returns the plural rule configuration in use.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nIntl.PluralRules.resolvedOptions(rules).locale == \"en\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.PluralRules.rule", - "kind": "type", - "name": "rule", - "docstrings": [], - "signature": "type rule = [#few | #many | #one | #other | #two | #zero]" - }, - { - "id": "Stdlib.Intl.PluralRules.select", - "kind": "value", - "name": "select", - "docstrings": [ - "`select(rules, value)` returns the plural category for the given number.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.select(1.) == #one\n```" - ], - "signature": "let select: (t, float) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.selectInt", - "kind": "value", - "name": "selectInt", - "docstrings": [ - "`selectInt(rules, value)` is like `select` but accepts an integer.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.selectInt(2) == #other\n```" - ], - "signature": "let selectInt: (t, int) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.selectRange", - "kind": "value", - "name": "selectRange", - "docstrings": [ - "`selectRange(rules, ~start, ~end)` returns the category for numbers in the range.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.selectRange(~start=1., ~end=2.) == #other\n```" - ], - "signature": "let selectRange: (t, ~start: float, ~end: float) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.selectRangeInt", - "kind": "value", - "name": "selectRangeInt", - "docstrings": [ - "`selectRangeInt(rules, ~start, ~end)` is the integer version of `selectRange`.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.selectRangeInt(~start=1, ~end=1) == #other\n```" - ], - "signature": "let selectRangeInt: (t, ~start: int, ~end: int) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(pluralRules)` ignores the provided pluralRules and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/numberformat": { - "id": "Stdlib.Intl.NumberFormat", - "name": "NumberFormat", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.NumberFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.NumberFormat.currency", - "kind": "type", - "name": "currency", - "docstrings": [ - "An ISO 4217 currency code. e.g. USD, EUR, CNY" - ], - "signature": "type currency = string" - }, - { - "id": "Stdlib.Intl.NumberFormat.currencyDisplay", - "kind": "type", - "name": "currencyDisplay", - "docstrings": [], - "signature": "type currencyDisplay = [\n | #code\n | #name\n | #narrowSymbol\n | #symbol\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.currencySign", - "kind": "type", - "name": "currencySign", - "docstrings": [], - "signature": "type currencySign = [#accounting | #standard]" - }, - { - "id": "Stdlib.Intl.NumberFormat.notation", - "kind": "type", - "name": "notation", - "docstrings": [], - "signature": "type notation = [\n | #compact\n | #engineering\n | #scientific\n | #standard\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.compactDisplay", - "kind": "type", - "name": "compactDisplay", - "docstrings": [ - "Used only when notation is #compact" - ], - "signature": "type compactDisplay = [#long | #short]" - }, - { - "id": "Stdlib.Intl.NumberFormat.signDisplay", - "kind": "type", - "name": "signDisplay", - "docstrings": [], - "signature": "type signDisplay = [\n | #always\n | #auto\n | #exceptZero\n | #negative\n | #never\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.style", - "kind": "type", - "name": "style", - "docstrings": [], - "signature": "type style = [#currency | #decimal | #percent | #unit]" - }, - { - "id": "Stdlib.Intl.NumberFormat.unitSystem", - "kind": "type", - "name": "unitSystem", - "docstrings": [ - "Defined in https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier\nOnly used when style is #unit" - ], - "signature": "type unitSystem = string" - }, - { - "id": "Stdlib.Intl.NumberFormat.unitDisplay", - "kind": "type", - "name": "unitDisplay", - "docstrings": [ - "Only used when style is #unit" - ], - "signature": "type unitDisplay = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.NumberFormat.rounding", - "kind": "type", - "name": "rounding", - "docstrings": [], - "signature": "type rounding = [\n | #ceil\n | #expand\n | #floor\n | #halfCeil\n | #halfEven\n | #halfExpand\n | #halfFloor\n | #halfTrunc\n | #trunc\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.roundingPriority", - "kind": "type", - "name": "roundingPriority", - "docstrings": [], - "signature": "type roundingPriority = [\n | #auto\n | #lessPrecision\n | #morePrecision\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.roundingIncrement", - "kind": "type", - "name": "roundingIncrement", - "docstrings": [], - "signature": "type roundingIncrement = [\n | #1\n | #10\n | #100\n | #1000\n | #2\n | #20\n | #200\n | #2000\n | #25\n | #250\n | #2500\n | #5\n | #50\n | #500\n | #5000\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.trailingZeroDisplay", - "kind": "type", - "name": "trailingZeroDisplay", - "docstrings": [], - "signature": "type trailingZeroDisplay = [\n | #auto\n | #lessPrecision\n | #stripIfInteger\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n compactDisplay?: compactDisplay,\n numberingSystem?: Intl_Common.numberingSystem,\n currency?: currency,\n currencyDisplay?: currencyDisplay,\n currencySign?: currencySign,\n localeMatcher?: Intl_Common.localeMatcher,\n notation?: notation,\n signDisplay?: signDisplay,\n style?: style,\n unit?: unitSystem,\n unitDisplay?: unitDisplay,\n useGrouping?: Grouping.t,\n roundingMode?: rounding,\n roundingPriority?: roundingPriority,\n roundingIncrement?: roundingIncrement,\n trailingZeroDisplay?: trailingZeroDisplay,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n currency?: currency,\n currencyDisplay?: currencyDisplay,\n currencySign?: currencySign,\n compactDisplay?: compactDisplay,\n unit: unitSystem,\n unitDisplay: unitDisplay,\n roundingMode?: rounding,\n roundingPriority?: roundingPriority,\n roundingIncrement?: roundingIncrement,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n locale: string,\n notation: notation,\n numberingSystem: Intl_Common.numberingSystem,\n signDisplay: signDisplay,\n style: style,\n useGrouping: Grouping.t,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.numberFormatPartType", - "kind": "type", - "name": "numberFormatPartType", - "docstrings": [], - "signature": "type numberFormatPartType = [\n | #compact\n | #currency\n | #decimal\n | #exponentInteger\n | #exponentMinusSign\n | #exponentSeparator\n | #fraction\n | #group\n | #infinity\n | #integer\n | #literal\n | #minusSign\n | #nan\n | #percentSign\n | #plusSign\n | #unit\n | #unknown\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.numberFormatPart", - "kind": "type", - "name": "numberFormatPart", - "docstrings": [], - "signature": "type numberFormatPart = {\n \\\"type\": numberFormatPartType,\n value: string,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.rangeSource", - "kind": "type", - "name": "rangeSource", - "docstrings": [], - "signature": "type rangeSource = [#endRange | #shared | #startRange]" - }, - { - "id": "Stdlib.Intl.NumberFormat.numberFormatRangePart", - "kind": "type", - "name": "numberFormatRangePart", - "docstrings": [], - "signature": "type numberFormatRangePart = {\n \\\"type\": numberFormatPartType,\n value: string,\n source: rangeSource,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.NumberFormat` instance for locale-aware number formatting.\n\nSee [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"], ~options={style: #currency, currency: \"USD\"})\nformatter->Intl.NumberFormat.format(1234.5) == \"$1,234.50\"\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.NumberFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for number formatting.\n\nSee [`Intl.NumberFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.NumberFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the actual options being used.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nIntl.NumberFormat.resolvedOptions(formatter).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.NumberFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, value)` returns the formatted representation of `value`.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.format(1234.5) == \"1,234.5\"\n```" - ], - "signature": "let format: (t, float) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatRange", - "kind": "value", - "name": "formatRange", - "docstrings": [ - "`formatRange(formatter, ~start, ~end)` formats numbers representing a range.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.formatRange(~start=1., ~end=2.)->String.length > 0\n```" - ], - "signature": "let formatRange: (t, ~start: float, ~end: float) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, value)` breaks the formatted result into parts.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.formatToParts(123)->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, float) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatRangeToParts", - "kind": "value", - "name": "formatRangeToParts", - "docstrings": [ - "`formatRangeToParts(formatter, ~start, ~end)` returns how the range would be rendered.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.formatRangeToParts(~start=1., ~end=2.)->Array.length > 0\n```" - ], - "signature": "let formatRangeToParts: (\n t,\n ~start: float,\n ~end: float,\n) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatInt", - "kind": "value", - "name": "formatInt", - "docstrings": [ - "`formatInt(formatter, value)` formats integer values.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatInt(42) == \"42\"\n```" - ], - "signature": "let formatInt: (t, int) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatIntRange", - "kind": "value", - "name": "formatIntRange", - "docstrings": [ - "`formatIntRange(formatter, ~start, ~end)` formats integer ranges.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatIntRange(~start=1, ~end=3)->String.length > 0\n```" - ], - "signature": "let formatIntRange: (t, ~start: int, ~end: int) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatIntToParts", - "kind": "value", - "name": "formatIntToParts", - "docstrings": [ - "`formatIntToParts(formatter, value)` returns formatting parts for an integer.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatIntToParts(123)->Array.length > 0\n```" - ], - "signature": "let formatIntToParts: (t, int) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatIntRangeToParts", - "kind": "value", - "name": "formatIntRangeToParts", - "docstrings": [ - "`formatIntRangeToParts(formatter, ~start, ~end)` returns how the integer range would be rendered.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatIntRangeToParts(~start=1, ~end=1)->Array.length > 0\n```" - ], - "signature": "let formatIntRangeToParts: (t, ~start: int, ~end: int) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigInt", - "kind": "value", - "name": "formatBigInt", - "docstrings": [ - "`formatBigInt(formatter, value)` formats bigint values." - ], - "signature": "let formatBigInt: (t, bigint) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigIntRange", - "kind": "value", - "name": "formatBigIntRange", - "docstrings": [ - "`formatBigIntRange(formatter, ~start, ~end)` formats a range of bigint values.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatBigIntRange(~start=1n, ~end=2n) == \"1–2\"\n```" - ], - "signature": "let formatBigIntRange: (t, ~start: bigint, ~end: bigint) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigIntToParts", - "kind": "value", - "name": "formatBigIntToParts", - "docstrings": [ - "`formatBigIntToParts(formatter, value)` returns the bigint formatting broken into parts.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatBigIntToParts(5n)->Array.length > 0\n```" - ], - "signature": "let formatBigIntToParts: (t, bigint) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigIntRangeToParts", - "kind": "value", - "name": "formatBigIntRangeToParts", - "docstrings": [ - "`formatBigIntRangeToParts(formatter, ~start, ~end)` describes how the bigint range would be rendered.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatBigIntRangeToParts(~start=3n, ~end=4n)->Array.length > 0\n```" - ], - "signature": "let formatBigIntRangeToParts: (\n t,\n ~start: bigint,\n ~end: bigint,\n) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatString", - "kind": "value", - "name": "formatString", - "docstrings": [ - "`formatString(formatter, value)` interprets `value` as a number string and formats it.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatString(\"1234\") == \"1,234\"\n```" - ], - "signature": "let formatString: (t, string) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatStringToParts", - "kind": "value", - "name": "formatStringToParts", - "docstrings": [ - "`formatStringToParts(formatter, value)` returns formatting parts for a numeric string.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatStringToParts(\"123\")->Array.length > 0\n```" - ], - "signature": "let formatStringToParts: (t, string) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(numberFormat)` ignores the provided numberFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/locale": { - "id": "Stdlib.Intl.Locale", - "name": "Locale", - "docstrings": [ - "Bindings to JavaScript's `Intl.Locale`." - ], - "items": [ - { - "id": "Stdlib.Intl.Locale.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Locale.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n baseName?: string,\n calendar?: Intl_Common.calendar,\n collation?: Intl_Common.collation,\n hourCycle?: [#h11 | #h12 | #h23 | #h24],\n caseFirst?: [#\"false\" | #lower | #upper],\n numberingSystem?: Intl_Common.numberingSystem,\n numeric?: bool,\n language?: string,\n script?: string,\n region?: string,\n}" - }, - { - "id": "Stdlib.Intl.Locale.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.Locale` object from a locale identifier and optional modifiers.\n\nSee [`Intl.Locale`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en-US\")\nlocale->Intl.Locale.language == \"en\"\n```" - ], - "signature": "let make: (string, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.Locale.baseName", - "kind": "value", - "name": "baseName", - "docstrings": [ - "`baseName(locale)` returns the canonical base name (without Unicode extensions).\n\nSee [`Intl.Locale.prototype.baseName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/baseName) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"fr-CA\")\nlocale->Intl.Locale.baseName == \"fr-CA\"\n```" - ], - "signature": "let baseName: t => string" - }, - { - "id": "Stdlib.Intl.Locale.calendar", - "kind": "value", - "name": "calendar", - "docstrings": [ - "`calendar(locale)` returns the specified calendar, if present.\n\nSee [`Intl.Locale.prototype.calendar`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/calendar) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={calendar: #gregory})\nlocale->Intl.Locale.calendar == Some(\"gregory\")\n```" - ], - "signature": "let calendar: t => option" - }, - { - "id": "Stdlib.Intl.Locale.caseFirst", - "kind": "value", - "name": "caseFirst", - "docstrings": [ - "`caseFirst(locale)` returns the case-first ordering setting, if present.\n\nSee [`Intl.Locale.prototype.caseFirst`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/caseFirst) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={caseFirst: #upper})\nlocale->Intl.Locale.caseFirst == Some(\"upper\")\n```" - ], - "signature": "let caseFirst: t => option" - }, - { - "id": "Stdlib.Intl.Locale.collation", - "kind": "value", - "name": "collation", - "docstrings": [ - "`collation(locale)` returns the collation type, if present.\n\nSee [`Intl.Locale.prototype.collation`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/collation) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={collation: #phonebk})\nlocale->Intl.Locale.collation == Some(\"phonebk\")\n```" - ], - "signature": "let collation: t => option" - }, - { - "id": "Stdlib.Intl.Locale.hourCycle", - "kind": "value", - "name": "hourCycle", - "docstrings": [ - "`hourCycle(locale)` returns the preferred hour cycle, if present.\n\nSee [`Intl.Locale.prototype.hourCycle`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={hourCycle: #h12})\nlocale->Intl.Locale.hourCycle == Some(\"h12\")\n```" - ], - "signature": "let hourCycle: t => option" - }, - { - "id": "Stdlib.Intl.Locale.language", - "kind": "value", - "name": "language", - "docstrings": [ - "`language(locale)` returns the primary language subtag.\n\nSee [`Intl.Locale.prototype.language`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/language) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"pt-BR\")\nlocale->Intl.Locale.language == \"pt\"\n```" - ], - "signature": "let language: t => string" - }, - { - "id": "Stdlib.Intl.Locale.numberingSystem", - "kind": "value", - "name": "numberingSystem", - "docstrings": [ - "`numberingSystem(locale)` returns the numbering system identifier, if present.\n\nSee [`Intl.Locale.prototype.numberingSystem`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/numberingSystem) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={numberingSystem: #latn})\nlocale->Intl.Locale.numberingSystem == Some(\"latn\")\n```" - ], - "signature": "let numberingSystem: t => option" - }, - { - "id": "Stdlib.Intl.Locale.numeric", - "kind": "value", - "name": "numeric", - "docstrings": [ - "`numeric(locale)` indicates whether numeric ordering should be used for region subtags.\n\nSee [`Intl.Locale.prototype.numeric`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/numeric) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={numeric: true})\nlocale->Intl.Locale.numeric == true\n```" - ], - "signature": "let numeric: t => bool" - }, - { - "id": "Stdlib.Intl.Locale.region", - "kind": "value", - "name": "region", - "docstrings": [ - "`region(locale)` returns the region subtag, if present.\n\nSee [`Intl.Locale.prototype.region`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/region) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en-US\")\nlocale->Intl.Locale.region == Some(\"US\")\n```" - ], - "signature": "let region: t => option" - }, - { - "id": "Stdlib.Intl.Locale.script", - "kind": "value", - "name": "script", - "docstrings": [ - "`script(locale)` returns the script subtag, if present.\n\nSee [`Intl.Locale.prototype.script`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/script) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"sr-Cyrl\")\nlocale->Intl.Locale.script == Some(\"Cyrl\")\n```" - ], - "signature": "let script: t => option" - }, - { - "id": "Stdlib.Intl.Locale.maximize", - "kind": "value", - "name": "maximize", - "docstrings": [ - "`maximize(locale)` adds likely subtags to produce the most specific locale.\n\nSee [`Intl.Locale.prototype.maximize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/maximize) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\")\nlocale->Intl.Locale.maximize->Intl.Locale.region == Some(\"US\")\n```" - ], - "signature": "let maximize: t => t" - }, - { - "id": "Stdlib.Intl.Locale.minimize", - "kind": "value", - "name": "minimize", - "docstrings": [ - "`minimize(locale)` removes unnecessary subtags while preserving semantics.\n\nSee [`Intl.Locale.prototype.minimize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/minimize) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en-Latn-US\")\nlocale->Intl.Locale.minimize->Intl.Locale.baseName == \"en\"\n```" - ], - "signature": "let minimize: t => t" - }, - { - "id": "Stdlib.Intl.Locale.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(locale)` ignores the provided locale and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/listformat": { - "id": "Stdlib.Intl.ListFormat", - "name": "ListFormat", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.ListFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.ListFormat.listType", - "kind": "type", - "name": "listType", - "docstrings": [], - "signature": "type listType = [#conjunction | #disjunction | #unit]" - }, - { - "id": "Stdlib.Intl.ListFormat.style", - "kind": "type", - "name": "style", - "docstrings": [], - "signature": "type style = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.ListFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n \\\"type\"?: listType,\n style?: style,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.listPartComponentType", - "kind": "type", - "name": "listPartComponentType", - "docstrings": [], - "signature": "type listPartComponentType = [#element | #literal]" - }, - { - "id": "Stdlib.Intl.ListFormat.listPart", - "kind": "type", - "name": "listPart", - "docstrings": [], - "signature": "type listPart = {\n \\\"type\": listPartComponentType,\n value: string,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n style: style,\n \\\"type\": listType,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.ListFormat` instance for formatting lists.\n\nSee [`Intl.ListFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"], ~options={\\\"type\": #conjunction})\nformatter->Intl.ListFormat.format([\"apples\", \"bananas\", \"cherries\"]) == \"apples, bananas, and cherries\"\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.ListFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for list formatting.\n\nSee [`Intl.ListFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.ListFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.ListFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the actual options being used.\n\nSee [`Intl.ListFormat.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"])\nIntl.ListFormat.resolvedOptions(formatter).locale == \"en\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.ListFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, items)` returns the formatted list string.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"])\nformatter->Intl.ListFormat.format([\"a\", \"b\"]) == \"a and b\"\n```" - ], - "signature": "let format: (t, array) => string" - }, - { - "id": "Stdlib.Intl.ListFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, items)` returns the list as an array of parts describing how it would be rendered.\n\nSee [`Intl.ListFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/formatToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"])\nformatter->Intl.ListFormat.formatToParts([\"a\", \"b\"])->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, array) => array" - }, - { - "id": "Stdlib.Intl.ListFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(listFormat)` ignores the provided listFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/datetimeformat": { - "id": "Stdlib.Intl.DateTimeFormat", - "name": "DateTimeFormat", - "docstrings": [ - "Bindings to JavaScript's `Intl.DateTimeFormat`." - ], - "items": [ - { - "id": "Stdlib.Intl.DateTimeFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateStyle", - "kind": "type", - "name": "dateStyle", - "docstrings": [], - "signature": "type dateStyle = [#full | #long | #medium | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.timeStyle", - "kind": "type", - "name": "timeStyle", - "docstrings": [], - "signature": "type timeStyle = [#full | #long | #medium | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dayPeriod", - "kind": "type", - "name": "dayPeriod", - "docstrings": [], - "signature": "type dayPeriod = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.weekday", - "kind": "type", - "name": "weekday", - "docstrings": [], - "signature": "type weekday = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.era", - "kind": "type", - "name": "era", - "docstrings": [], - "signature": "type era = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.year", - "kind": "type", - "name": "year", - "docstrings": [], - "signature": "type year = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.month", - "kind": "type", - "name": "month", - "docstrings": [], - "signature": "type month = [\n | #\"2-digit\"\n | #long\n | #narrow\n | #numeric\n | #short\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.day", - "kind": "type", - "name": "day", - "docstrings": [], - "signature": "type day = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.hour", - "kind": "type", - "name": "hour", - "docstrings": [], - "signature": "type hour = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.minute", - "kind": "type", - "name": "minute", - "docstrings": [], - "signature": "type minute = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.second", - "kind": "type", - "name": "second", - "docstrings": [], - "signature": "type second = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.timeZoneName", - "kind": "type", - "name": "timeZoneName", - "docstrings": [ - "Firefox also supports IANA time zone names here\nNode v19+ supports \"shortOffset\", \"shortGeneric\", \"longOffset\", and \"longGeneric\"." - ], - "signature": "type timeZoneName = [\n | #long\n | #longGeneric\n | #longOffset\n | #short\n | #shortGeneric\n | #shortOffset\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.hourCycle", - "kind": "type", - "name": "hourCycle", - "docstrings": [], - "signature": "type hourCycle = [#h11 | #h12 | #h23 | #h24]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatMatcher", - "kind": "type", - "name": "formatMatcher", - "docstrings": [], - "signature": "type formatMatcher = [#basic | #\"best fit\"]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.fractionalSecondDigits", - "kind": "type", - "name": "fractionalSecondDigits", - "docstrings": [], - "signature": "type fractionalSecondDigits = [#0 | #1 | #2 | #3]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n dateStyle?: dateStyle,\n timeStyle?: timeStyle,\n calendar?: Intl_Common.calendar,\n dayPeriod?: dayPeriod,\n numberingSystem?: Intl_Common.numberingSystem,\n localeMatcher?: Intl_Common.localeMatcher,\n timeZone?: string,\n hour12?: bool,\n hourCycle?: hourCycle,\n formatMatcher?: formatMatcher,\n weekday?: weekday,\n era?: era,\n year?: year,\n month?: month,\n day?: day,\n hour?: hour,\n minute?: minute,\n second?: second,\n fractionalSecondDigits?: fractionalSecondDigits,\n timeZoneName?: timeZoneName,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n dateStyle?: dateStyle,\n timeStyle?: timeStyle,\n weekday?: weekday,\n era?: era,\n year?: year,\n month?: month,\n day?: day,\n hour?: hour,\n minute?: minute,\n second?: second,\n fractionalSecondDigits?: fractionalSecondDigits,\n timeZoneName?: timeZoneName,\n calendar: Intl_Common.calendar,\n hour12: bool,\n hourCycle: hourCycle,\n locale: string,\n numberingSystem: Intl_Common.numberingSystem,\n timeZone: string,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimeComponent", - "kind": "type", - "name": "dateTimeComponent", - "docstrings": [], - "signature": "type dateTimeComponent = [\n | #day\n | #dayPeriod\n | #era\n | #fractionalSecond\n | #hour\n | #literal\n | #minute\n | #month\n | #relatedYear\n | #second\n | #timeZone\n | #weekday\n | #year\n | #yearName\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimePart", - "kind": "type", - "name": "dateTimePart", - "docstrings": [], - "signature": "type dateTimePart = {\n \\\"type\": dateTimeComponent,\n value: string,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimeRangeSource", - "kind": "type", - "name": "dateTimeRangeSource", - "docstrings": [], - "signature": "type dateTimeRangeSource = [\n | #endRange\n | #shared\n | #startRange\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimeRangePart", - "kind": "type", - "name": "dateTimeRangePart", - "docstrings": [], - "signature": "type dateTimeRangePart = {\n \\\"type\": dateTimeComponent,\n value: string,\n source: dateTimeRangeSource,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.DateTimeFormat` instance for formatting date values.\n\nSee [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"], ~options={timeStyle: #short})\nlet sampleDate = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nformatter->Intl.DateTimeFormat.format(sampleDate)->String.length > 0\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported by the runtime for date/time formatting.\n\nSee [`Intl.DateTimeFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.DateTimeFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the actual locale and formatting options in use.\n\nSee [`Intl.DateTimeFormat.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"])\nIntl.DateTimeFormat.resolvedOptions(formatter).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, date)` returns the formatted string for `date`.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en\"])\nlet date = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nformatter->Intl.DateTimeFormat.format(date)->String.length > 0\n```" - ], - "signature": "let format: (t, Date.t) => string" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, date)` breaks the formatted output into an array of parts.\n\nSee [`Intl.DateTimeFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en\"])\nlet date = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nformatter->Intl.DateTimeFormat.formatToParts(date)->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, Date.t) => array" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatRange", - "kind": "value", - "name": "formatRange", - "docstrings": [ - "`formatRange(formatter, ~startDate, ~endDate)` formats the range between `startDate` and `endDate`.\n\nSee [`Intl.DateTimeFormat.prototype.formatRange`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatRange) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"], ~options={dateStyle: #short})\nlet startDate = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nlet endDate = Js.Date.makeWithYMD(~year=2024, ~month=1, ~date=1)\nformatter->Intl.DateTimeFormat.formatRange(~startDate=startDate, ~endDate=endDate)->String.length > 0\n```" - ], - "signature": "let formatRange: (t, ~startDate: Date.t, ~endDate: Date.t) => string" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatRangeToParts", - "kind": "value", - "name": "formatRangeToParts", - "docstrings": [ - "`formatRangeToParts(formatter, ~startDate, ~endDate)` returns an array describing how the range would be rendered.\n\nSee [`Intl.DateTimeFormat.prototype.formatRangeToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatRangeToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"], ~options={dateStyle: #short})\nlet startDate = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nlet endDate = Js.Date.makeWithYMD(~year=2024, ~month=1, ~date=1)\nformatter->Intl.DateTimeFormat.formatRangeToParts(~startDate=startDate, ~endDate=endDate)->Array.length > 0\n```" - ], - "signature": "let formatRangeToParts: (\n t,\n ~startDate: Date.t,\n ~endDate: Date.t,\n) => array" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(dateTimeFormat)` ignores the provided dateTimeFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/collator": { - "id": "Stdlib.Intl.Collator", - "name": "Collator", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.Collator.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Collator.usage", - "kind": "type", - "name": "usage", - "docstrings": [], - "signature": "type usage = [#search | #sort]" - }, - { - "id": "Stdlib.Intl.Collator.sensitivity", - "kind": "type", - "name": "sensitivity", - "docstrings": [], - "signature": "type sensitivity = [#accent | #base | #case | #variant]" - }, - { - "id": "Stdlib.Intl.Collator.caseFirst", - "kind": "type", - "name": "caseFirst", - "docstrings": [], - "signature": "type caseFirst = [#\"false\" | #lower | #upper]" - }, - { - "id": "Stdlib.Intl.Collator.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n usage?: usage,\n sensitivity?: sensitivity,\n ignorePunctuation?: bool,\n numeric?: bool,\n caseFirst?: caseFirst,\n}" - }, - { - "id": "Stdlib.Intl.Collator.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n usage: usage,\n sensitivity: sensitivity,\n ignorePunctuation: bool,\n collation: [\n | #compat\n | #default\n | #dict\n | #emoji\n | #eor\n | #phonebk\n | #phonetic\n | #pinyin\n | #stroke\n | #trad\n | #unihan\n | #zhuyin\n ],\n numeric?: bool,\n caseFirst?: caseFirst,\n}" - }, - { - "id": "Stdlib.Intl.Collator.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.Collator.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.Collator` instance that can compare strings using locale-aware rules.\n\nSee [`Intl.Collator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) on MDN.\n\n## Examples\n\n```rescript\nlet collator = Intl.Collator.make(~locales=[\"en\"])\ncollator->Intl.Collator.compare(\"apple\", \"banana\") < 0\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.Collator.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported by the runtime for collation.\n\nSee [`Intl.Collator.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.Collator.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.Collator.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(collator)` returns the locale and collation settings in use.\n\nSee [`Intl.Collator.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet collator = Intl.Collator.make(~locales=[\"en-US\"])\nIntl.Collator.resolvedOptions(collator).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.Collator.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(collator, a, b)` compares two strings using the rules of `collator`. Returns a negative number when `a` comes before `b`, `0` when equal, and a positive number otherwise.\n\n## Examples\n\n```rescript\nlet collator = Intl.Collator.make(~locales=[\"en-US\"])\ncollator->Intl.Collator.compare(\"apple\", \"banana\") < 0\n```" - ], - "signature": "let compare: (t, string, string) => int" - }, - { - "id": "Stdlib.Intl.Collator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(collator)` ignores the provided collator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/common": { - "id": "Stdlib.Intl.Common", - "name": "Common", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.Common.localeMatcher", - "kind": "type", - "name": "localeMatcher", - "docstrings": [], - "signature": "type localeMatcher = [#\"best fit\" | #lookup]" - }, - { - "id": "Stdlib.Intl.Common.calendar", - "kind": "type", - "name": "calendar", - "docstrings": [], - "signature": "type calendar = [\n | #buddhist\n | #chinese\n | #coptic\n | #dangi\n | #ethioaa\n | #ethiopic\n | #gregory\n | #hebrew\n | #indian\n | #islamic\n | #\"islamic-civil\"\n | #\"islamic-rgsa\"\n | #\"islamic-tbla\"\n | #\"islamic-umalqura\"\n | #iso8601\n | #japanese\n | #persian\n | #roc\n]" - }, - { - "id": "Stdlib.Intl.Common.collation", - "kind": "type", - "name": "collation", - "docstrings": [], - "signature": "type collation = [\n | #compat\n | #dict\n | #emoji\n | #eor\n | #phonebk\n | #phonetic\n | #pinyin\n | #stroke\n | #trad\n | #unihan\n | #zhuyin\n]" - }, - { - "id": "Stdlib.Intl.Common.numberingSystem", - "kind": "type", - "name": "numberingSystem", - "docstrings": [], - "signature": "type numberingSystem = [\n | #adlm\n | #ahom\n | #arab\n | #arabext\n | #bali\n | #beng\n | #bhks\n | #brah\n | #cakm\n | #cham\n | #deva\n | #diak\n | #fullwide\n | #gong\n | #gonm\n | #gujr\n | #guru\n | #hanidec\n | #hmng\n | #hmnp\n | #java\n | #kali\n | #kawi\n | #khmr\n | #knda\n | #lana\n | #lanatham\n | #laoo\n | #latn\n | #lepc\n | #limb\n | #mathbold\n | #mathdbl\n | #mathmono\n | #mathsanb\n | #mathsans\n | #mlym\n | #modi\n | #mong\n | #mroo\n | #mtei\n | #mymr\n | #mymrshan\n | #mymrtlng\n | #nagm\n | #newa\n | #nkoo\n | #olck\n | #orya\n | #osma\n | #rohg\n | #saur\n | #segment\n | #shrd\n | #sind\n | #sinh\n | #sora\n | #sund\n | #takr\n | #talu\n | #tamldec\n | #telu\n | #thai\n | #tibt\n | #tirh\n | #tnsa\n | #vaii\n | #wara\n | #wcho\n]" - }, - { - "id": "Stdlib.Intl.Common.oneTo21", - "kind": "type", - "name": "oneTo21", - "docstrings": [], - "signature": "type oneTo21 = [\n | #1\n | #10\n | #11\n | #12\n | #13\n | #14\n | #15\n | #16\n | #17\n | #18\n | #19\n | #2\n | #20\n | #21\n | #3\n | #4\n | #5\n | #6\n | #7\n | #8\n | #9\n]" - }, - { - "id": "Stdlib.Intl.Common.zeroTo20", - "kind": "type", - "name": "zeroTo20", - "docstrings": [], - "signature": "type zeroTo20 = [\n | #0\n | #1\n | #10\n | #11\n | #12\n | #13\n | #14\n | #15\n | #16\n | #17\n | #18\n | #19\n | #2\n | #20\n | #3\n | #4\n | #5\n | #6\n | #7\n | #8\n | #9\n]" - } - ] - }, - "stdlib/int/ref": { - "id": "Stdlib.Int.Ref", - "name": "Ref", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int.Ref.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = ref" - }, - { - "id": "Stdlib.Int.Ref.increment", - "kind": "value", - "name": "increment", - "docstrings": [ - "`increment(intRef)` increments the value of the provided reference by 1.\n\n ## Examples\n\n ```rescript\n let myRef = ref(4)\n Int.Ref.increment(myRef)\n myRef.contents == 5\n ```" - ], - "signature": "let increment: ref => unit" - }, - { - "id": "Stdlib.Int.Ref.decrement", - "kind": "value", - "name": "decrement", - "docstrings": [ - "`decrement(intRef)` decrements the value of the provided reference by 1.\n\n ## Examples\n\n ```rescript\n let myRef = ref(4)\n Int.Ref.decrement(myRef)\n myRef.contents == 3\n ```" - ], - "signature": "let decrement: ref => unit" - } - ] - }, - "stdlib/int/bitwise": { - "id": "Stdlib.Int.Bitwise", - "name": "Bitwise", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int.Bitwise.land", - "kind": "value", - "name": "land", - "docstrings": [], - "signature": "let land: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lor", - "kind": "value", - "name": "lor", - "docstrings": [], - "signature": "let lor: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lxor", - "kind": "value", - "name": "lxor", - "docstrings": [], - "signature": "let lxor: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lsl", - "kind": "value", - "name": "lsl", - "docstrings": [], - "signature": "let lsl: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lsr", - "kind": "value", - "name": "lsr", - "docstrings": [], - "signature": "let lsr: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.asr", - "kind": "value", - "name": "asr", - "docstrings": [], - "signature": "let asr: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lnot", - "kind": "value", - "name": "lnot", - "docstrings": [], - "signature": "let lnot: int => int", - "deprecated": "" - } - ] - }, - "stdlib/int/constants": { - "id": "Stdlib.Int.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int.Constants.minValue", - "kind": "value", - "name": "minValue", - "docstrings": [ - "The smallest positive number represented in JavaScript.\nSee [`Number.MIN_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE)\non MDN.\n\n ## Examples\n\n ```rescript\n Console.log(Int.Constants.minValue)\n ```" - ], - "signature": "let minValue: int" - }, - { - "id": "Stdlib.Int.Constants.maxValue", - "kind": "value", - "name": "maxValue", - "docstrings": [ - "The largest positive number represented in JavaScript.\nSee [`Number.MAX_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE)\non MDN.\n\n ## Examples\n\n ```rescript\n Console.log(Int.Constants.maxValue)\n ```" - ], - "signature": "let maxValue: int" - } - ] - }, - "stdlib/float/constants": { - "id": "Stdlib.Float.Constants", - "name": "Constants", - "docstrings": [ - "Float constants." - ], - "items": [ - { - "id": "Stdlib.Float.Constants.nan", - "kind": "value", - "name": "nan", - "docstrings": [ - "The special value \"Not a Number\"\nSee [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.nan\n ```" - ], - "signature": "let nan: float" - }, - { - "id": "Stdlib.Float.Constants.epsilon", - "kind": "value", - "name": "epsilon", - "docstrings": [ - "Represents the difference between 1 and the smallest floating point number greater than 1.\nSee [`Number.EPSILON`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.epsilon\n ```" - ], - "signature": "let epsilon: float" - }, - { - "id": "Stdlib.Float.Constants.positiveInfinity", - "kind": "value", - "name": "positiveInfinity", - "docstrings": [ - "The positive Infinity value\nSee [`Number.POSITIVE_INFINITY`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/POSITIVE_INFINITY) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.positiveInfinity\n ```" - ], - "signature": "let positiveInfinity: float" - }, - { - "id": "Stdlib.Float.Constants.negativeInfinity", - "kind": "value", - "name": "negativeInfinity", - "docstrings": [ - "The negative Infinity value\nSee [`Number.NEGATIVE_INFINITY`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.negativeInfinity\n ```" - ], - "signature": "let negativeInfinity: float" - }, - { - "id": "Stdlib.Float.Constants.minValue", - "kind": "value", - "name": "minValue", - "docstrings": [ - "The smallest positive numeric value representable in JavaScript.\nSee [`Number.MIN_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.minValue\n ```" - ], - "signature": "let minValue: float" - }, - { - "id": "Stdlib.Float.Constants.maxValue", - "kind": "value", - "name": "maxValue", - "docstrings": [ - "The maximum positive numeric value representable in JavaScript.\nSee [`Number.MAX_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.minValue\n ```" - ], - "signature": "let maxValue: float" - } - ] - }, - "stdlib/error/urierror": { - "id": "Stdlib.Error.URIError", - "name": "URIError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.URIError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `URIError` with the provided `message`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/typeerror": { - "id": "Stdlib.Error.TypeError", - "name": "TypeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.TypeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `TypeError` with the provided `message`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/syntaxerror": { - "id": "Stdlib.Error.SyntaxError", - "name": "SyntaxError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.SyntaxError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `SyntaxError` with the provided `message`.\n\n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/referenceerror": { - "id": "Stdlib.Error.ReferenceError", - "name": "ReferenceError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.ReferenceError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `ReferenceError` with the provided `message`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/rangeerror": { - "id": "Stdlib.Error.RangeError", - "name": "RangeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.RangeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `RangeError` with the provided `message`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/evalerror": { - "id": "Stdlib.Error.EvalError", - "name": "EvalError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.EvalError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `EvalError` with the provided `message`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/date/utc": { - "id": "Stdlib.Date.UTC", - "name": "UTC", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Date.UTC.makeWithYM", - "kind": "value", - "name": "makeWithYM", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYM(~year=2023, ~month=0)\n // 1672531200000\n \n Date.UTC.makeWithYM(~year=2023, ~month=11)\n // 1701388800000\n \n Date.UTC.makeWithYM(~year=2023, ~month=12)\n // 1704067200000\n \n Date.UTC.makeWithYM(~year=2023, ~month=-1)\n // 1669852800000\n ```" - ], - "signature": "let makeWithYM: (~year: int, ~month: int) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMD", - "kind": "value", - "name": "makeWithYMD", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=20)\n // 1676851200000\n \n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=-1)\n // 1675036800000\n \n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=29)\n // 1677628800000\n ```" - ], - "signature": "let makeWithYMD: (~year: int, ~month: int, ~day: int) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDH", - "kind": "value", - "name": "makeWithYMDH", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=16)\n // 1676908800000\n \n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=24)\n // 1676937600000\n \n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=-1)\n // 1676847600000\n ```" - ], - "signature": "let makeWithYMDH: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDHM", - "kind": "value", - "name": "makeWithYMDHM", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40)\n // 1676911200000\n \n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=60)\n // 1676912400000\n \n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=-1)\n // 1676908740000\n ```" - ], - "signature": "let makeWithYMDHM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDHMS", - "kind": "value", - "name": "makeWithYMDHMS", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0)\n // 1676911200000\n \n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=60)\n // 1676911260000\n \n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=-1)\n // 1676911199000\n ```" - ], - "signature": "let makeWithYMDHMS: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDHMSM", - "kind": "value", - "name": "makeWithYMDHMSM", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=0,\n )->Console.log\n // 1676911200000\n \n Date.UTC.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=1000,\n )->Console.log\n // 1676911201000\n \n Date.UTC.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=-1,\n )->Console.log\n // 1676911199999\n ```" - ], - "signature": "let makeWithYMDHMSM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => msSinceEpoch" - } - ] - }, - "stdlib/biguint64array": { - "id": "Stdlib.BigUint64Array", - "name": "BigUint64Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigUint64Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `BigUint64Array` typed array represents an array of 64-bit unsigned integers in platform byte order. See [BigUint64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.BigUint64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `BigUint64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.BigUint64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `BigUint64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.BigUint64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigUint64Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigUint64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `BigUint64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.BigUint64Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `BigUint64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => bigint=?) => t" - }, - { - "id": "Stdlib.BigUint64Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `BigUint64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigUint64Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bigUintArray)` ignores the provided bigUintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/bigint64array": { - "id": "Stdlib.BigInt64Array", - "name": "BigInt64Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigInt64Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `BigInt64Array` typed array represents an array of 64-bit signed integers in platform byte order. See [BigInt64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.BigInt64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `BigInt64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.BigInt64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `BigInt64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.BigInt64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt64Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `BigInt64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.BigInt64Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `BigInt64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => bigint=?) => t" - }, - { - "id": "Stdlib.BigInt64Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `BigInt64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt64Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bigIntArray)` ignores the provided bigIntArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint8clampedarray": { - "id": "Stdlib.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8ClampedArray.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint8ClampedArray` typed array represents an array of 8-bit unsigned integers clamped to 0-255. See [Uint8ClampedArray on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint8ClampedArray` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint8ClampedArray` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint8ClampedArray` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint8ClampedArray` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8ClampedArray.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint32array": { - "id": "Stdlib.Uint32Array", - "name": "Uint32Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint32Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint32Array` typed array represents an array of 32-bit unsigned integers in platform byte order. See [Uint32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint32Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint32Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint32Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint32Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint32Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint16array": { - "id": "Stdlib.Uint16Array", - "name": "Uint16Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint16Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint16Array` typed array represents an array of 16-bit unsigned integers in platform byte order. See [Uint16Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint16Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint16Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint16Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint16Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint16Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint16Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint16Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint16Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint16Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint16Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint16Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint16Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint8array": { - "id": "Stdlib.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint8Array` typed array represents an array of 8-bit unsigned integers. See [Uint8Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint8Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint8Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint8Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint8Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint8Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint8Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint8Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint8Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint8Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint8Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/int32array": { - "id": "Stdlib.Int32Array", - "name": "Int32Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int32Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Int32Array` typed array represents an array of twos-complemenet 32-bit signed integers in platform byte order. See [Int32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Int32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Int32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Int32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Int32Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Int32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int32Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Int32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Int32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Int32Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Int32Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int32Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/int16array": { - "id": "Stdlib.Int16Array", - "name": "Int16Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int16Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Int16Array` typed array represents an array of twos-complement 16-bit signed integers in platform byte order. See [Int16Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Int16Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int16Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Int16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Int16Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Int16Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int16Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Int16Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Int16Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int16Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Int16Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int16Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int16Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/int8array": { - "id": "Stdlib.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int8Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Int8Array` typed array represents an array of twos-complement 8-bit signed integers. See [Int8Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Int8Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int8Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Int8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Int8Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Int8Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int8Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Int8Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Int8Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int8Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Int8Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int8Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int8Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/float64array": { - "id": "Stdlib.Float64Array", - "name": "Float64Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float64Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Float64Array` typed array represents an array of 64-bit floating point numbers in platform byte order. See [Float64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Float64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Float64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Float64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Float64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Float64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float64Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Float64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Float64Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Float64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => float=?) => t" - }, - { - "id": "Stdlib.Float64Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Float64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float64Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/float32array": { - "id": "Stdlib.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float32Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Float32Array` typed array represents an array of 32-bit floating point numbers in platform byte order. See [Float32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Float32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Float32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Float32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Float32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Float32Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float32Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Float32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Float32Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Float32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => float=?) => t" - }, - { - "id": "Stdlib.Float32Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Float32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float32Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/typedarray": { - "id": "Stdlib.TypedArray", - "name": "TypedArray", - "docstrings": [], - "items": [ - { - "id": "Stdlib.TypedArray.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.TypedArray.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```" - ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```" - ], - "signature": "let set: (t<'a>, int, 'a) => unit" - }, - { - "id": "Stdlib.TypedArray.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [ - "`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN." - ], - "signature": "let buffer: t<'a> => ArrayBuffer.t" - }, - { - "id": "Stdlib.TypedArray.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [ - "`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```" - ], - "signature": "let byteLength: t<'a> => int" - }, - { - "id": "Stdlib.TypedArray.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [ - "`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN." - ], - "signature": "let byteOffset: t<'a> => int" - }, - { - "id": "Stdlib.TypedArray.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [ - "`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```" - ], - "signature": "let setArray: (t<'a>, array<'a>) => unit" - }, - { - "id": "Stdlib.TypedArray.setArrayFrom", - "kind": "value", - "name": "setArrayFrom", - "docstrings": [ - "`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```" - ], - "signature": "let setArrayFrom: (t<'a>, array<'a>, int) => unit" - }, - { - "id": "Stdlib.TypedArray.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```" - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Stdlib.TypedArray.copyAllWithin", - "kind": "value", - "name": "copyAllWithin", - "docstrings": [ - "`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```" - ], - "signature": "let copyAllWithin: (t<'a>, ~target: int) => array<'a>" - }, - { - "id": "Stdlib.TypedArray.copyWithinToEnd", - "kind": "value", - "name": "copyWithinToEnd", - "docstrings": [ - "`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```" - ], - "signature": "let copyWithinToEnd: (t<'a>, ~target: int, ~start: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [ - "`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```" - ], - "signature": "let copyWithin: (t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>" - }, - { - "id": "Stdlib.TypedArray.fillAll", - "kind": "value", - "name": "fillAll", - "docstrings": [ - "`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```" - ], - "signature": "let fillAll: (t<'a>, 'a) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.fillToEnd", - "kind": "value", - "name": "fillToEnd", - "docstrings": [ - "`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array." - ], - "signature": "let fillToEnd: (t<'a>, 'a, ~start: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.fill", - "kind": "value", - "name": "fill", - "docstrings": [ - "`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```" - ], - "signature": "let fill: (t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN." - ], - "signature": "let reverse: t<'a> => unit" - }, - { - "id": "Stdlib.TypedArray.toReversed", - "kind": "value", - "name": "toReversed", - "docstrings": [ - "`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```" - ], - "signature": "let toReversed: t<'a> => t<'a>" - }, - { - "id": "Stdlib.TypedArray.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN." - ], - "signature": "let sort: (t<'a>, ('a, 'a) => Ordering.t) => unit" - }, - { - "id": "Stdlib.TypedArray.toSorted", - "kind": "value", - "name": "toSorted", - "docstrings": [ - "`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```" - ], - "signature": "let toSorted: (t<'a>, ('a, 'a) => Ordering.t) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.with", - "kind": "value", - "name": "with", - "docstrings": [ - "`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```" - ], - "signature": "let with: (t<'a>, int, 'a) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```" - ], - "signature": "let includes: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.TypedArray.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN." - ], - "signature": "let indexOf: (t<'a>, 'a) => int" - }, - { - "id": "Stdlib.TypedArray.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`." - ], - "signature": "let indexOfFrom: (t<'a>, 'a, int) => int" - }, - { - "id": "Stdlib.TypedArray.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```" - ], - "signature": "let joinWith: (t<'a>, string) => string" - }, - { - "id": "Stdlib.TypedArray.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN." - ], - "signature": "let lastIndexOf: (t<'a>, 'a) => int" - }, - { - "id": "Stdlib.TypedArray.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`." - ], - "signature": "let lastIndexOfFrom: (t<'a>, 'a, int) => int" - }, - { - "id": "Stdlib.TypedArray.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN." - ], - "signature": "let slice: (t<'a>, ~start: int, ~end: int=?) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array." - ], - "signature": "let sliceToEnd: (t<'a>, ~start: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(typedArray)` produces a shallow copy of the typed array." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Stdlib.TypedArray.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN." - ], - "signature": "let subarray: (t<'a>, ~start: int, ~end: int=?) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.subarrayToEnd", - "kind": "value", - "name": "subarrayToEnd", - "docstrings": [ - "`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer." - ], - "signature": "let subarrayToEnd: (t<'a>, ~start: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```" - ], - "signature": "let toString: t<'a> => string" - }, - { - "id": "Stdlib.TypedArray.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN." - ], - "signature": "let toLocaleString: t<'a> => string" - }, - { - "id": "Stdlib.TypedArray.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN." - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.everyWithIndex", - "kind": "value", - "name": "everyWithIndex", - "docstrings": [ - "`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`." - ], - "signature": "let everyWithIndex: (t<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN." - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`." - ], - "signature": "let filterWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN." - ], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findWithIndex", - "kind": "value", - "name": "findWithIndex", - "docstrings": [ - "`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index." - ], - "signature": "let findWithIndex: (t<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findLast", - "kind": "value", - "name": "findLast", - "docstrings": [ - "`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN." - ], - "signature": "let findLast: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findLastWithIndex", - "kind": "value", - "name": "findLastWithIndex", - "docstrings": [ - "`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`." - ], - "signature": "let findLastWithIndex: (t<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [ - "`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN." - ], - "signature": "let findIndex: (t<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.TypedArray.findIndexWithIndex", - "kind": "value", - "name": "findIndexWithIndex", - "docstrings": [ - "`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`." - ], - "signature": "let findIndexWithIndex: (t<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.TypedArray.findLastIndex", - "kind": "value", - "name": "findLastIndex", - "docstrings": [ - "`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN." - ], - "signature": "let findLastIndex: (t<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.TypedArray.findLastIndexWithIndex", - "kind": "value", - "name": "findLastIndexWithIndex", - "docstrings": [ - "`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`." - ], - "signature": "let findLastIndexWithIndex: (t<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.TypedArray.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN." - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.TypedArray.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index." - ], - "signature": "let forEachWithIndex: (t<'a>, ('a, int) => unit) => unit" - }, - { - "id": "Stdlib.TypedArray.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.TypedArray.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index." - ], - "signature": "let mapWithIndex: (t<'a>, ('a, int) => 'b) => t<'b>" - }, - { - "id": "Stdlib.TypedArray.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN." - ], - "signature": "let reduce: (t<'a>, ('b, 'a) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`." - ], - "signature": "let reduceWithIndex: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [ - "`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN." - ], - "signature": "let reduceRight: (t<'a>, ('b, 'a) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.reduceRightWithIndex", - "kind": "value", - "name": "reduceRightWithIndex", - "docstrings": [ - "`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`." - ], - "signature": "let reduceRightWithIndex: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN." - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.someWithIndex", - "kind": "value", - "name": "someWithIndex", - "docstrings": [ - "`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index." - ], - "signature": "let someWithIndex: (t<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/arraybuffer": { - "id": "Stdlib.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [ - "Functions for interacting with JavaScript ArrayBuffer.\nSee: [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)." - ], - "items": [ - { - "id": "Stdlib.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an ArrayBuffer object used to represent a generic raw binary data buffer." - ], - "signature": "type t" - }, - { - "id": "Stdlib.ArrayBuffer.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(length)` creates a new ArrayBuffer with the specified length in bytes.\nSee [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/ArrayBuffer) on MDN.\n\n## Examples\n\n```rescript\nlet buffer = ArrayBuffer.make(8)\nArrayBuffer.byteLength(buffer) == 8\n```\n\n## Exceptions\n\n- `RangeError`: If `length` is larger than `Number.MAX_SAFE_INTEGER` or negative." - ], - "signature": "let make: int => t" - }, - { - "id": "Stdlib.ArrayBuffer.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [ - "`byteLength(arrayBuffer)` returns the size, in bytes, of the ArrayBuffer.\nSee [`ArrayBuffer.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet buffer = ArrayBuffer.make(16)\nArrayBuffer.byteLength(buffer) == 16\n```" - ], - "signature": "let byteLength: t => int" - }, - { - "id": "Stdlib.ArrayBuffer.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(arrayBuffer, ~start, ~end)` returns a new ArrayBuffer whose contents are a copy of this ArrayBuffer's bytes from `start`, inclusive, up to `end`, exclusive.\nSee [`ArrayBuffer.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/slice) on MDN.\n\n## Examples\n\n```rescript\nlet buffer = ArrayBuffer.make(16)\nlet sliced = buffer->ArrayBuffer.slice(~start=4, ~end=12)\nArrayBuffer.byteLength(sliced) == 8\n```" - ], - "signature": "let slice: (t, ~start: int=?, ~end: int=?) => t" - }, - { - "id": "Stdlib.ArrayBuffer.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [], - "signature": "let sliceToEnd: (t, ~start: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.ArrayBuffer.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(arrayBuffer)` ignores the provided arrayBuffer and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/weakset": { - "id": "Stdlib.WeakSet", - "name": "WeakSet", - "docstrings": [ - "Bindings to JavaScript's `WeakSet`.\n\nWeak sets store references to objects without preventing those objects from being garbage collected." - ], - "items": [ - { - "id": "Stdlib.WeakSet.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Mutable weak set storing object references of type `'a`." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.WeakSet.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates an empty weak set.\n\nSee [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) on MDN.\n\n## Examples\n\n```rescript\nlet visited = WeakSet.make()\nWeakSet.has(visited, Object.make()) == false\n```" - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Stdlib.WeakSet.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(set, value)` inserts `value` into the weak set and returns the set for chaining.\n\nSee [`WeakSet.prototype.add`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/add) on MDN.\n\n## Examples\n\n```rescript\nlet set = WeakSet.make()\nlet node = Object.make()\nWeakSet.add(set, node)\nWeakSet.has(set, node) == true\n```" - ], - "signature": "let add: (t<'a>, 'a) => t<'a>" - }, - { - "id": "Stdlib.WeakSet.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "`delete(set, value)` removes `value` and returns `true` if an entry existed.\n\nSee [`WeakSet.prototype.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/delete) on MDN.\n\n## Examples\n\n```rescript\nlet set = WeakSet.make()\nlet node = Object.make()\nlet _ = WeakSet.add(set, node)\nWeakSet.delete(set, node) == true\nWeakSet.delete(set, node) == false\n```" - ], - "signature": "let delete: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.WeakSet.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(set, value)` checks whether `value` exists in the weak set.\n\nSee [`WeakSet.prototype.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/has) on MDN.\n\n## Examples\n\n```rescript\nlet set = WeakSet.make()\nlet node = Object.make()\nWeakSet.has(set, node) == false\nlet _ = WeakSet.add(set, node)\nWeakSet.has(set, node) == true\n```" - ], - "signature": "let has: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.WeakSet.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(weakSet)` ignores the provided weakSet and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/set": { - "id": "Stdlib.Set", - "name": "Set", - "docstrings": [ - "Bindings to the mutable JavaScript `Set`.\n\nSee [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) on MDN." - ], - "items": [ - { - "id": "Stdlib.Set.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an instance of `Set`." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.Set.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new, mutable JavaScript `Set`. A `Set` is a collection of unique values.\n\nSee [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) on MDN.\n\n\n\n## Examples\n```rescript\n// You can annotate the type of your set if you want to\nlet mySet: Set.t = Set.make()\n\n// Or you can let ReScript infer what's in your Set\nlet set = Set.make()\nset->Set.add(\"Fine name\") // Inferred as Set.t\n```\n\n## Alternatives\nA JavaScript `Set` is mutable. If you're looking for an immutable alternative, check out `Belt.Set`." - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Stdlib.Set.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Turns an array of values into a Set. Meaning only unique values are preserved.\n\n## Examples\n```rescript\ntype languages = ReScript | JavaScript | TypeScript\nlet languageRank = [ReScript, JavaScript, TypeScript]\n\nlet set = Set.fromArray(languageRank) // Set.t\n\nswitch set->Set.has(ReScript) {\n| true => Console.log(\"Yay, ReScript is in there!\")\n| false => Console.log(\"Uh-oh, something is _terribly_ wrong with this program... abort.\")\n}\n```" - ], - "signature": "let fromArray: array<'a> => t<'a>" - }, - { - "id": "Stdlib.Set.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "Turns an iterator into a `Set`.\n\n## Examples\n\n```rescript\n// Let's pretend we have an interator\nlet iterator: Iterator.t = %raw(`\n (() => {\n var array1 = ['a', 'b', 'c'];\n var iterator1 = array1[Symbol.iterator]();\n return iterator1\n })()\n`)\n\niterator\n->Set.fromIterator\n->Set.size == 3\n```" - ], - "signature": "let fromIterator: Iterator.t<'a> => t<'a>" - }, - { - "id": "Stdlib.Set.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns the size, the number of unique values, of the set.\n\nSee [`Set.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/size) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\n\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue2\")\n\nlet size = set->Set.size // 2\n```" - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Stdlib.Set.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(set)` returns `true` if the set has no values, `false` otherwise.\n\n## Examples\n```rescript\nlet emptySet = Set.make()\nemptySet->Set.isEmpty->assertEqual(true)\n\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.isEmpty->assertEqual(false)\n\n// After clearing the set\nset->Set.clear\nset->Set.isEmpty->assertEqual(true)\n```" - ], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Stdlib.Set.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Clears all entries in the set.\n\nSee [`Set.clear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/clear) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\n\nset->Set.add(\"someKey\")\nset->Set.size // 1\n\nset->Set.clear\nset->Set.size // 0\n```" - ], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Stdlib.Set.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds a new value to the set.\n\nSee [`Set.add`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/add) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\n```" - ], - "signature": "let add: (t<'a>, 'a) => unit" - }, - { - "id": "Stdlib.Set.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "Deletes the provided `value` from the set. Returns a `bool` for whether the value existed, and was deleted.\n\nSee [`Set.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nlet didDeleteValue = set->Set.delete(\"someValue\")\nConsole.log(didDeleteValue) // Logs `true` to the console, becuase the set had the value, so it was successfully deleted\n\nlet didDeleteValue = set->Set.delete(\"someNonExistantKey\")\nConsole.log(didDeleteValue) // Logs `false` to the console, becuase the value did not exist in the set\n```" - ], - "signature": "let delete: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.Set.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks whether the set has a specific value.\n\nSee [`Set.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/has) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\n\nswitch set->Set.has(\"someValue\") {\n| false => Console.log(\"Nope, didn't have it.\")\n| true => Console.log(\"Yay, we have the value!\")\n}\n```" - ], - "signature": "let has: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.Set.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Iterates through all values of the set.\n\nSee [`Set.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/forEach) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue2\")\n\nset->Set.forEach(value => {\n Console.log(value)\n})\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Set.values", - "kind": "value", - "name": "values", - "docstrings": [ - "Returns an iterator that holds all values of the set.\n\nSee [`Set.values`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/values) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.add(\"anotherValue\")\n\nlet values = set->Set.values\n\n// Logs the first value\nConsole.log(Iterator.next(values).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh values iterator to get an array of all values, since we consumed a value via `next` above already.\nConsole.log(set->Set.values->Iterator.toArray)\n```" - ], - "signature": "let values: t<'a> => Iterator.t<'a>" - }, - { - "id": "Stdlib.Set.difference", - "kind": "value", - "name": "difference", - "docstrings": [ - "Returns a new set with the values of the set that are not in the other set.\n\nSee [`Set.difference`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/difference) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.difference(set2) // Set.fromArray([\"orange\"])\n```" - ], - "signature": "let difference: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.symmetricDifference", - "kind": "value", - "name": "symmetricDifference", - "docstrings": [ - "Returns a new set with the values containing the values which are in either the set, but not in both.\n\nSee [`Set.symmetricDifference`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/symmetricDifference) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.symmetricDifference(set2) // Set.fromArray([\"orange\", \"pear\"])\n```" - ], - "signature": "let symmetricDifference: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.intersection", - "kind": "value", - "name": "intersection", - "docstrings": [ - "Returns a new set with the values containing the values which are in both the set and the other set.\n\nSee [`Set.intersection`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/intersection) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.intersection(set2) // Set.fromArray([\"apple\", \"banana\"])\n```" - ], - "signature": "let intersection: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.isDisjointFrom", - "kind": "value", - "name": "isDisjointFrom", - "docstrings": [ - "Returns a bool indicating if this set has no elements in common with the given set.\n\nSee [`Set.isDisjointFrom`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isDisjointFrom) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"kiwi\", \"melon\", \"pear\"])\nset1->Set.isDisjointFrom(set2) // true\n```" - ], - "signature": "let isDisjointFrom: (t<'a>, t<'a>) => bool" - }, - { - "id": "Stdlib.Set.isSubsetOf", - "kind": "value", - "name": "isSubsetOf", - "docstrings": [ - "Returns a bool indicating if the all values in the set are in the given set.\n\nSee [`Set.isSubsetOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isSubsetOf) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.isSubsetOf(set2) // true\n```" - ], - "signature": "let isSubsetOf: (t<'a>, t<'a>) => bool" - }, - { - "id": "Stdlib.Set.isSupersetOf", - "kind": "value", - "name": "isSupersetOf", - "docstrings": [ - "Returns a bool indicating if the all values in the given set are in the set.\n\nSee [`Set.isSupersetOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isSupersetOf) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\"])\nset1->Set.isSupersetOf(set2) // true\n```" - ], - "signature": "let isSupersetOf: (t<'a>, t<'a>) => bool" - }, - { - "id": "Stdlib.Set.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns a new set with the values of the set that are in both the set and the other set.\n\nSee [`Set.union`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/union) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.union(set2) // Set.fromArray([\"apple\", \"orange\", \"banana\", \"pear\"])\n```" - ], - "signature": "let union: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(set)` returns an array of all values of the set.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n```rescript\nlet set = Set.fromArray([\"apple\", \"orange\", \"apple\", \"banana\"])\nset->Set.toArray // [\"apple\", \"orange\", \"banana\"]\n```" - ], - "signature": "let toArray: t<'a> => array<'a>" - }, - { - "id": "Stdlib.Set.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(set)` ignores the provided set and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/weakmap": { - "id": "Stdlib.WeakMap", - "name": "WeakMap", - "docstrings": [ - "Bindings to JavaScript's `WeakMap`.\n\nWeak maps keep key/value pairs where keys must be objects and the references do not prevent garbage collection." - ], - "items": [ - { - "id": "Stdlib.WeakMap.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Mutable weak map storing values of type `'v` with object keys `'k`." - ], - "signature": "type t<'k, 'v>" - }, - { - "id": "Stdlib.WeakMap.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates an empty weak map.\n\nSee [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nWeakMap.get(cache, Object.make()) == None\n```" - ], - "signature": "let make: unit => t<'k, 'v>" - }, - { - "id": "Stdlib.WeakMap.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(map, key)` returns `Some(value)` when `key` exists, otherwise `None`.\n\nSee [`WeakMap.prototype.get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/get) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nWeakMap.get(cache, key) == None\nlet _ = WeakMap.set(cache, key, \"user\")\nWeakMap.get(cache, key) == Some(\"user\")\n```" - ], - "signature": "let get: (t<'k, 'v>, 'k) => option<'v>" - }, - { - "id": "Stdlib.WeakMap.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(map, key)` checks whether `key` exists in the weak map.\n\nSee [`WeakMap.prototype.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/has) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nWeakMap.has(cache, key) == false\nlet _ = WeakMap.set(cache, key, ())\nWeakMap.has(cache, key) == true\n```" - ], - "signature": "let has: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.WeakMap.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(map, key, value)` stores `value` for `key` and returns the map for chaining.\n\nSee [`WeakMap.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/set) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nlet _ = WeakMap.set(cache, key, 42)\nWeakMap.get(cache, key) == Some(42)\n```" - ], - "signature": "let set: (t<'k, 'v>, 'k, 'v) => t<'k, 'v>" - }, - { - "id": "Stdlib.WeakMap.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "`delete(map, key)` removes `key` and returns `true` if an entry existed.\n\nSee [`WeakMap.prototype.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/delete) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nWeakMap.delete(cache, key) == false\nlet _ = WeakMap.set(cache, key, 1)\nWeakMap.delete(cache, key) == true\n```" - ], - "signature": "let delete: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.WeakMap.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(weakMap)` ignores the provided weakMap and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'k, 'v> => unit" - } - ] - }, - "stdlib/map": { - "id": "Stdlib.Map", - "name": "Map", - "docstrings": [ - "Bindings to the mutable JavaScript `Map`.\n\nSee [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) on MDN." - ], - "items": [ - { - "id": "Stdlib.Map.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an instance of `Map`." - ], - "signature": "type t<'k, 'v>" - }, - { - "id": "Stdlib.Map.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new, mutable JavaScript `Map`. A `Map` can have any values as both keys and values.\n\nSee [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) on MDN.\n\n\n\n## Examples\n```rescript\n`make()`\n// You can annotate the type of your map if you want to\nlet myMap: Map.t = Map.make()\n\n// Or you can let ReScript infer what's in your map\nlet map = Map.make()\nmap->Map.set(\"lang\", \"ReScript\") // Inferred as Map.t\n```\n\n## Alternatives\nA JavaScript `Map` is mutable. If you're looking for an immutable alternative, check out`Belt.Map`." - ], - "signature": "let make: unit => t<'k, 'v>" - }, - { - "id": "Stdlib.Map.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Turns an array of key/value pairs into a Map.\n\n## Examples\n```rescript\ntype languages = ReScript | JavaScript | TypeScript\nlet languageRank = [(ReScript, 1), (JavaScript, 2), (TypeScript, 3)]\n\nlet map = Map.fromArray(languageRank) // Map.t\n\nswitch map->Map.get(ReScript) {\n| Some(1) => Console.log(\"Yay, ReScript is #1!\")\n| _ => Console.log(\"Uh-oh, something is _terribly_ wrong with this program... abort.\")\n}\n```" - ], - "signature": "let fromArray: array<('k, 'v)> => t<'k, 'v>" - }, - { - "id": "Stdlib.Map.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "Turns an iterator in the shape of `('key, 'value)` into a `Map`.\n\n## Examples\n\n```rescript\n// Let's pretend we have an interator in the correct shape\nlet iterator: Iterator.t<(string, string)> = %raw(`\n (() => {\n var map1 = new Map();\n\n map1.set('first', '1');\n map1.set('second', '2');\n\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\n\niterator\n->Map.fromIterator\n->Map.size == 2\n```" - ], - "signature": "let fromIterator: Iterator.t<('k, 'v)> => t<'k, 'v>" - }, - { - "id": "Stdlib.Map.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns the size, the number of key/value pairs, of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\n\nmap->Map.set(\"someKey\", \"someValue\")\n\nlet size = map->Map.size // 1\n```" - ], - "signature": "let size: t<'k, 'v> => int" - }, - { - "id": "Stdlib.Map.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(map)` returns `true` if the map has no key/value pairs, `false` otherwise.\n\n## Examples\n```rescript\nlet emptyMap = Map.make()\nemptyMap->Map.isEmpty->assertEqual(true)\n\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.isEmpty->assertEqual(false)\n\n// After clearing the map\nmap->Map.clear\nmap->Map.isEmpty->assertEqual(true)\n```" - ], - "signature": "let isEmpty: t<'k, 'v> => bool" - }, - { - "id": "Stdlib.Map.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Clears all entries in the map.\n\n## Examples\n```rescript\nlet map = Map.make()\n\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.size // 1\n\nmap->Map.clear\nmap->Map.size // 0\n```" - ], - "signature": "let clear: t<'k, 'v> => unit" - }, - { - "id": "Stdlib.Map.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Iterates through all values of the map.\n\n> Please note that this is *without the keys*, just the values. If you need the key as well, use `Map.forEachWithKey`.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\nmap->Map.forEach(value => {\n Console.log(value)\n})\n```" - ], - "signature": "let forEach: (t<'k, 'v>, 'v => unit) => unit" - }, - { - "id": "Stdlib.Map.forEachWithKey", - "kind": "value", - "name": "forEachWithKey", - "docstrings": [ - "Iterates through all values of the map, including the key for each value.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\nmap->Map.forEachWithKey((value, key) => {\n Console.log2(value, key)\n})\n```" - ], - "signature": "let forEachWithKey: (t<'k, 'v>, ('v, 'k) => unit) => unit" - }, - { - "id": "Stdlib.Map.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the value for a key, if a value exists at that key.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n\nswitch map->Map.get(\"someKey\") {\n| None => Console.log(\"Nope, didn't have it.\")\n| Some(value) => Console.log2(\"Yay, had the value, and it's:\", value)\n}\n```" - ], - "signature": "let get: (t<'k, 'v>, 'k) => option<'v>" - }, - { - "id": "Stdlib.Map.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks whether the map has a specific key.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n\nswitch map->Map.has(\"someKey\") {\n| false => Console.log(\"Nope, didn't have it.\")\n| true => Console.log(\"Yay, we have the value!\")\n}\n```" - ], - "signature": "let has: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.Map.set", - "kind": "value", - "name": "set", - "docstrings": [ - "Sets the provided `value` to the provided `key`.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n```" - ], - "signature": "let set: (t<'k, 'v>, 'k, 'v) => unit" - }, - { - "id": "Stdlib.Map.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "Deletes the provided `key` and its value from the map. Returns a `bool` for whether the key existed, and was deleted.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nlet didDeleteKey = map->Map.delete(\"someKey\")\nConsole.log(didDeleteKey) // Logs `true` to the console, becuase the map had the key, so it was successfully deleted\n\nlet didDeleteKey = map->Map.delete(\"someNonExistantKey\")\nConsole.log(didDeleteKey) // Logs `false` to the console, becuase the key did not exist\n```" - ], - "signature": "let delete: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.Map.keys", - "kind": "value", - "name": "keys", - "docstrings": [ - "Returns an iterator that holds all keys of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet keys = map->Map.keys\n\n// Logs the first key\nConsole.log(Iterator.next(keys).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh keys iterator to get an array of all keys, since we consumed a value via `next` above already.\nConsole.log(map->Map.keys->Iterator.toArray)\n```" - ], - "signature": "let keys: t<'k, 'v> => Iterator.t<'k>" - }, - { - "id": "Stdlib.Map.values", - "kind": "value", - "name": "values", - "docstrings": [ - "Returns an iterator that holds all values of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet values = map->Map.values\n\n// Logs the first value\nConsole.log(Iterator.next(values).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh values iterator to get an array of all values, since we consumed a value via `next` above already.\nConsole.log(map->Map.values->Iterator.toArray)\n```" - ], - "signature": "let values: t<'k, 'v> => Iterator.t<'v>" - }, - { - "id": "Stdlib.Map.entries", - "kind": "value", - "name": "entries", - "docstrings": [ - "Returns an iterator that holds all entries of the map.\nAn entry is represented as a tuple of `('key, 'value)`,\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet entries = map->Map.entries\n\n// Logs the first value\nConsole.log(Iterator.next(entries).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes entries. We'll need a fresh entries iterator to get an array of all entries, since we consumed a value via `next` above already.\nConsole.log(map->Map.entries->Iterator.toArray)\n```" - ], - "signature": "let entries: t<'k, 'v> => Iterator.t<('k, 'v)>" - }, - { - "id": "Stdlib.Map.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(map)` ignores the provided map and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'k, 'v> => unit" - } - ] - }, - "stdlib/asynciterator": { - "id": "Stdlib.AsyncIterator", - "name": "AsyncIterator", - "docstrings": [ - "Bindings to async iterators, a way to do async iteration in JavaScript.\n\nSee [async iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) on MDN." - ], - "items": [ - { - "id": "Stdlib.AsyncIterator.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type representing an async iterator." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.AsyncIterator.value", - "kind": "type", - "name": "value", - "docstrings": [], - "signature": "type value<'a> = {done: bool, value: option<'a>}" - }, - { - "id": "Stdlib.AsyncIterator.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(nextFn)`\n\nCreates an async iterator from a function that returns the next value of the iterator.\n\n## Examples\n\n- A simple example, creating an async iterator that returns 1, 2, 3:\n\n```rescript\nlet context = ref(0)\n\nlet asyncIterator = AsyncIterator.make(async () => {\n let currentValue = context.contents\n // Increment current value\n context := currentValue + 1\n\n {\n AsyncIterator.value: Some(currentValue),\n done: currentValue >= 3,\n }\n})\n\n// This will log 1, 2, 3\nlet main = async () =>\n await asyncIterator->AsyncIterator.forEach(value =>\n switch value {\n | Some(value) => Console.log(value)\n | None => ()\n }\n )\n\nmain()->ignore\n```" - ], - "signature": "let make: (unit => promise>) => t<'value>" - }, - { - "id": "Stdlib.AsyncIterator.value", - "kind": "value", - "name": "value", - "docstrings": [ - "`value(value)`\n\nShorthand for creating a value object with the provided value, and the `done` property set to false.\n\n## Examples\n\n```rescript\nlet context = ref(0)\n\nlet asyncIterator = AsyncIterator.make(async () => {\n let currentValue = context.contents\n // Increment current value\n context := currentValue + 1\n\n if currentValue >= 3 {\n AsyncIterator.done()\n } else {\n AsyncIterator.value(currentValue)\n }\n})\n```" - ], - "signature": "let value: 'value => value<'value>" - }, - { - "id": "Stdlib.AsyncIterator.done", - "kind": "value", - "name": "done", - "docstrings": [ - "`done(~finalValue=?)`\n\n Shorthand for creating a value object with the `done` property set to true, and the provided value as the final value, if any.\n\n ## Examples\n ```rescript\n let context = ref(0)\n \n let asyncIterator = AsyncIterator.make(async () => {\n let currentValue = context.contents\n // Increment current value\n context := currentValue + 1\n \n if currentValue >= 3 {\n AsyncIterator.done()\n } else {\n AsyncIterator.value(currentValue)\n }\n })\n ```" - ], - "signature": "let done: (~finalValue: 'value=?) => value<'value>" - }, - { - "id": "Stdlib.AsyncIterator.next", - "kind": "value", - "name": "next", - "docstrings": [ - "`next(asyncIterator)`\n\nReturns the next value of the iterator, if any.\n\nSee [async iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) on MDN.\n\n## Examples\n\n- A simple example, getting the next value:\n\n```rescript\nlet asyncIterator: AsyncIterator.t<(string, string)> = %raw(`\n (() => {\n var map1 = new Map();\n\n map1.set('first', '1');\n map1.set('second', '2');\n\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\n\nlet processMyAsyncIterator = async () => {\n // ReScript doesn't have `for ... of` loops, but it's easy to mimic using a while loop.\n let break = ref(false)\n\n while !break.contents {\n // Await the next iterator value\n let {value, done} = await asyncIterator->AsyncIterator.next\n\n // Exit the while loop if the iterator says it's done\n break := done\n\n if done {\n value->Option.isNone == true\n }\n }\n}\n\nprocessMyAsyncIterator()->ignore\n```" - ], - "signature": "let next: t<'a> => promise>" - }, - { - "id": "Stdlib.AsyncIterator.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(iterator, fn)` consumes all values in the async iterator and runs the callback `fn` for each value.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n\n```rescript\n// Let's pretend we get an async iterator returning ints from somewhere.\nlet asyncIterator: AsyncIterator.t<(string, string)> = %raw(`\n (() => {\n var map1 = new Map();\n\n map1.set('first', '1');\n map1.set('second', '2');\n\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\n\nlet main = async () =>\n await asyncIterator->AsyncIterator.forEach(v => {\n switch v {\n | Some((\"second\", value)) => value == \"2\"\n | _ => ()\n }\n })\n\nmain()->ignore\n```" - ], - "signature": "let forEach: (t<'a>, option<'a> => unit) => promise" - }, - { - "id": "Stdlib.AsyncIterator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(iterator)` ignores the provided async iterator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/iterator": { - "id": "Stdlib.Iterator", - "name": "Iterator", - "docstrings": [ - "Bindings to JavaScript iterators.\n\nSee [`Iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) on MDN." - ], - "items": [ - { - "id": "Stdlib.Iterator.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type representing an iterator." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.Iterator.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The current value of an iterator." - ], - "signature": "type value<'a> = {done: bool, value: option<'a>}" - }, - { - "id": "Stdlib.Iterator.next", - "kind": "value", - "name": "next", - "docstrings": [ - "Returns the next value of the iterator, if any.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n\n```rescript\nlet iterator: Iterator.t = %raw(`\n (() => {\n var array1 = ['a'];\n var iterator1 = array1[Symbol.iterator]();\n return iterator1\n })()\n`)\n(iterator->Iterator.next).done == false\n(iterator->Iterator.next).done == true\n```" - ], - "signature": "let next: t<'a> => value<'a>" - }, - { - "id": "Stdlib.Iterator.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Turns an iterator into an array of the remaining values.\nRemember that each invocation of `next` of an iterator consumes a value. `Iterator.toArray` will consume all remaining values of the iterator and return them in an array to you.\n\nSee [Iterator.prototype.toArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/toArray) on MDN.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\n// `Map.keys` returns all keys of the map as an iterator.\nlet mapKeysAsArray = map->Map.keys->Iterator.toArray\n\nmapKeysAsArray == [\"someKey\", \"someKey2\"]\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let toArray: t<'a> => array<'a>" - }, - { - "id": "Stdlib.Iterator.toArrayWithMapper", - "kind": "value", - "name": "toArrayWithMapper", - "docstrings": [ - "`toArray(iterator)` turns `iterator` into an array of its remaining values, applying the provided mapper function on each item.\nRemember that each invocation of `next` of an iterator consumes a value. `Iterator.toArrayWithMapper` will consume all remaining values of the iterator and return them in an array to you.\n\nSee [Iterator.prototype.toArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/toArray) on MDN.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\n// `Map.keys` returns all keys of the map as an iterator.\nlet mapKeysAsArray =\n map\n ->Map.keys\n ->Iterator.toArrayWithMapper(key => key->String.length)\n\nmapKeysAsArray == [7, 8]\n```" - ], - "signature": "let toArrayWithMapper: (t<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Stdlib.Iterator.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(iterator, fn)` consumes all values in the iterator and runs the callback `fn` for each value.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n```rescript\nlet iterator: Iterator.t = [\"a\", \"b\", \"c\"]->Array.values\nlet acc = ref(\"\")\niterator->Iterator.forEach(v => {\n acc := acc.contents ++ v\n})\n\nacc.contents == \"abc\"\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Iterator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(iterator)` ignores the provided iterator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - }, - { - "id": "Stdlib.Iterator.drop", - "kind": "value", - "name": "drop", - "docstrings": [ - "`drop(iterator, n)` returns a new iterator helper object that skips the given number of elements at the start of this iterator.\n\nSee [Iterator.prototype.drop](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/drop) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.drop(2)\nseq->Iterator.next == {done: false, value: Some(2)}\nseq->Iterator.next == {done: false, value: Some(3)}\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let drop: (t<'a>, int) => t<'a>" - }, - { - "id": "Stdlib.Iterator.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(iterator, fn)` tests whether all elements in the iterator pass the test implemented by the provided function.\n\nSee [Iterator.prototype.every](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/every) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet areAllEven = fibonacci->Iterator.every(n => n % 2 == 0)\nareAllEven == false\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Iterator.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(iterator, fn)` returns a new iterator helper object that contains the elements of the original iterator that pass the test implemented by the provided function.\n\nSee [Iterator.prototype.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/filter) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.filter(n => n % 2 == 0)\nseq->Iterator.next == {done: false, value: Some(2)}\nseq->Iterator.next == {done: false, value: Some(8)}\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Stdlib.Iterator.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(iterator, fn)` returns the value of the first element in the iterator that satisfies the provided testing function.\n\nSee [Iterator.prototype.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/find) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.find(n => n % 2 == 0)\nseq == Some(2)\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Iterator.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(iterator, fn)` returns a new iterator helper object that contains the elements of the original iterator that pass the test implemented by the provided function.\n\nSee [Iterator.prototype.flatMap](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/flatMap) on MDN.\n\n## Examples\n```rescript\nlet map1 = Map.fromArray([(\"a\", 1), (\"b\", 2), (\"c\", 3)])\nlet map2 = Map.fromArray([(\"d\", 4), (\"e\", 5), (\"f\", 6)])\n\nlet letters =\n [map1, map2]\n ->Array.values\n ->Iterator.flatMap(m => Map.keys(m))\n ->Array.fromIterator\nletters == [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Iterator.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(iterator, fn)` returns a new iterator helper object that yields elements of the iterator, each transformed by a mapping function.\n\nSee [Iterator.prototype.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/map) on MDN.\n\n## Examples\n```rescript\nlet map = Map.fromArray([(\"a\", 1), (\"b\", 2), (\"c\", 3)])\nlet letters = map->Map.keys->Iterator.map(v => v->String.toUpperCase)->Array.fromIterator\nletters == [\"A\", \"B\", \"C\"]\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Iterator.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(iterator, fn, initialValue)` applies a function against an accumulator and each element in the iterator (from left to right) to reduce it to a single value.\n\nSee [Iterator.prototype.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/reduce) on MDN.\n\n## Examples\n```rescript\nlet numbers: Iterator.t = [1, 2, 3]->Array.values\n\nlet sum = numbers->Iterator.reduce((acc, n) => acc + n, ~initialValue=0)\nsum == 6\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let reduce: (t<'a>, ('acc, 'a) => 'acc, ~initialValue: 'acc=?) => 'acc" - }, - { - "id": "Stdlib.Iterator.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(iterator, fn)` The some() method of Iterator instances is similar to Array.some:\nit tests whether at least one element produced by the iterator passes the test implemented by the provided function.\nIt returns a boolean value.\n\nSee [Iterator.prototype.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/some) on MDN.\n\n## Examples\n```rescript\nlet numbers: Iterator.t = [1, 2, 3]->Array.values\n\nlet hasEven = numbers->Iterator.some(n => n % 2 == 0)\nhasEven == true\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Iterator.take", - "kind": "value", - "name": "take", - "docstrings": [ - "`take((iterator, n))` returns a new iterator helper object that contains the first `n` elements of this iterator.\n\nSee [Iterator.prototype.take](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/take) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.take(2)\nseq->Iterator.next == {done: false, value: Some(1)}\nseq->Iterator.next == {done: false, value: Some(1)}\nseq->Iterator.next == {done: true, value: None}\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let take: (t<'a>, int) => t<'a>" - } - ] - }, - "stdlib/type": { - "id": "Stdlib.Type", - "name": "Type", - "docstrings": [ - "Utilities for classifying the type of JavaScript values at runtime." - ], - "items": [ - { - "id": "Stdlib.Type.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The possible types of JavaScript values." - ], - "signature": "type t = [\n | #bigint\n | #boolean\n | #function\n | #number\n | #object\n | #string\n | #symbol\n | #undefined\n]" - }, - { - "id": "Stdlib.Type.typeof", - "kind": "value", - "name": "typeof", - "docstrings": [ - "`typeof(someValue)`\n\nReturns the underlying JavaScript type of any runtime value.\n\nSee [`typeof`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof) on MDN.\n\n## Examples\n```rescript\nConsole.log(Type.typeof(\"Hello\")) // Logs \"string\" to the console.\n\nlet someVariable = true\n\nswitch someVariable->Type.typeof {\n| #boolean => Console.log(\"This is a bool, yay!\")\n| _ => Console.log(\"Oh, not a bool sadly...\")\n}\n```" - ], - "signature": "let typeof: 'a => t" - }, - { - "id": "Stdlib.Type.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(type)` ignores the provided type and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/symbol": { - "id": "Stdlib.Symbol", - "name": "Symbol", - "docstrings": [ - "A built-in object that serves as a namespace for globally-unique identifiers.\n\nCompiles to a regular JavaScript Symbol." - ], - "items": [ - { - "id": "Stdlib.Symbol.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a Symbol." - ], - "signature": "type t" - }, - { - "id": "Stdlib.Symbol.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(key)`\n\nMakes a new unique Symbol value.\n\n## Examples\n\n```rescript\nSymbol.make(\"sym1\")->Symbol.description == Some(\"sym1\")\n```" - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.Symbol.getFor", - "kind": "value", - "name": "getFor", - "docstrings": [ - "`getFor(key)`\n\nSearches for existing registered Symbols in the global Symbol registry with the given key and returns it if found.\nOtherwise a new Symbol gets created and registered with key.\n\n## Examples\n\n```rescript\nSymbol.getFor(\"sym1\") == Symbol.getFor(\"sym1\")\n```" - ], - "signature": "let getFor: string => option" - }, - { - "id": "Stdlib.Symbol.keyFor", - "kind": "value", - "name": "keyFor", - "docstrings": [ - "`keyFor(key)`\n\nRetrieves a shared Symbol key from the global Symbol registry for the given Symbol.\n\n## Examples\n\n```rescript\nlet globalSym = Symbol.getFor(\"sym1\") // Global symbol\n\nglobalSym->Option.flatMap(Symbol.description) == Some(\"sym1\")\n```" - ], - "signature": "let keyFor: t => option" - }, - { - "id": "Stdlib.Symbol.description", - "kind": "value", - "name": "description", - "docstrings": [ - "`description`\n\nReturns `Some(string)` containing the description of this symbol, or `None` if the symbol has no description.\n## Examples\n\n```rescript\nlet sym = Symbol.make(\"sym1\")\nSymbol.description(sym) == Some(\"sym1\")\n```" - ], - "signature": "let description: t => option" - }, - { - "id": "Stdlib.Symbol.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString`\n\n// Returns a string representing this symbol value.\n\n## Examples\n\n```rescript\nlet sym = Symbol.make(\"sym1\")\n\nSymbol.toString(sym) == \"Symbol(sym1)\"\n```" - ], - "signature": "let toString: t => string" - }, - { - "id": "Stdlib.Symbol.asyncIterator", - "kind": "value", - "name": "asyncIterator", - "docstrings": [ - "`asyncIterator` is the well-known symbol used by asynchronous iterables.\n\nSee [`Symbol.asyncIterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator) on MDN." - ], - "signature": "let asyncIterator: t" - }, - { - "id": "Stdlib.Symbol.hasInstance", - "kind": "value", - "name": "hasInstance", - "docstrings": [ - "`hasInstance` is used by custom `instanceof` checks.\n\nSee [`Symbol.hasInstance`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance) on MDN." - ], - "signature": "let hasInstance: t" - }, - { - "id": "Stdlib.Symbol.isConcatSpreadable", - "kind": "value", - "name": "isConcatSpreadable", - "docstrings": [ - "`isConcatSpreadable` controls whether objects are flattened when passed to `Array.concat`.\n\nSee [`Symbol.isConcatSpreadable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/isConcatSpreadable) on MDN." - ], - "signature": "let isConcatSpreadable: t" - }, - { - "id": "Stdlib.Symbol.iterator", - "kind": "value", - "name": "iterator", - "docstrings": [ - "`iterator` is returned by objects that can be iterated with `for..of`.\n\nSee [`Symbol.iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/iterator) on MDN." - ], - "signature": "let iterator: t" - }, - { - "id": "Stdlib.Symbol.match", - "kind": "value", - "name": "match", - "docstrings": [ - "`match` customises how values respond to `String.prototype.match`.\n\nSee [`Symbol.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/match) on MDN." - ], - "signature": "let match: t" - }, - { - "id": "Stdlib.Symbol.matchAll", - "kind": "value", - "name": "matchAll", - "docstrings": [ - "`matchAll` customises how values respond to `String.prototype.matchAll`.\n\nSee [`Symbol.matchAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/matchAll) on MDN." - ], - "signature": "let matchAll: t" - }, - { - "id": "Stdlib.Symbol.replace", - "kind": "value", - "name": "replace", - "docstrings": [ - "`replace` customises how values respond to `String.prototype.replace`.\n\nSee [`Symbol.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/replace) on MDN." - ], - "signature": "let replace: t" - }, - { - "id": "Stdlib.Symbol.search", - "kind": "value", - "name": "search", - "docstrings": [ - "`search` customises how values respond to `String.prototype.search`.\n\nSee [`Symbol.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) on MDN." - ], - "signature": "let search: t" - }, - { - "id": "Stdlib.Symbol.species", - "kind": "value", - "name": "species", - "docstrings": [ - "`species` lets constructors return a different derived constructor when methods create new instances.\n\nSee [`Symbol.species`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/species) on MDN." - ], - "signature": "let species: t" - }, - { - "id": "Stdlib.Symbol.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split` customises how values respond to `String.prototype.split`.\n\nSee [`Symbol.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/split) on MDN." - ], - "signature": "let split: t" - }, - { - "id": "Stdlib.Symbol.toPrimitive", - "kind": "value", - "name": "toPrimitive", - "docstrings": [ - "`toPrimitive` customises how objects convert to primitive values.\n\nSee [`Symbol.toPrimitive`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toPrimitive) on MDN." - ], - "signature": "let toPrimitive: t" - }, - { - "id": "Stdlib.Symbol.toStringTag", - "kind": "value", - "name": "toStringTag", - "docstrings": [ - "`toStringTag` customises the default tag shown by `Object.prototype.toString`.\n\nSee [`Symbol.toStringTag`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag) on MDN." - ], - "signature": "let toStringTag: t" - }, - { - "id": "Stdlib.Symbol.unscopables", - "kind": "value", - "name": "unscopables", - "docstrings": [ - "`unscopables` marks properties that should be skipped by `with`.\n\nSee [`Symbol.unscopables`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/unscopables) on MDN." - ], - "signature": "let unscopables: t" - }, - { - "id": "Stdlib.Symbol.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(symbol)` ignores the provided symbol and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/string": { - "id": "Stdlib.String", - "name": "String", - "docstrings": [ - "Functions for interacting with JavaScript strings.\nSee: [`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)." - ], - "items": [ - { - "id": "Stdlib.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a string." - ], - "signature": "type t = string" - }, - { - "id": "Stdlib.String.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nString.make(3.5) == \"3.5\"\nString.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => string" - }, - { - "id": "Stdlib.String.fromCharCode", - "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to\nthat number, `n` ranges from 0 to 65535. If out of range, the lower 16 bits of\nthe value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as\n`fromCharCode(0xF63A)`.\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nString.fromCharCode(65) == \"A\"\nString.fromCharCode(0x3c8) == `ψ`\nString.fromCharCode(0xd55c) == `한`\nString.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => string" - }, - { - "id": "Stdlib.String.fromCharCodeMany", - "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`.\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nString.fromCharCodeMany([189, 43, 190, 61]) == \"½+¾=\"\nString.fromCharCodeMany([65, 66, 67]) == \"ABC\"\n```" - ], - "signature": "let fromCharCodeMany: array => string" - }, - { - "id": "Stdlib.String.fromCodePoint", - "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point.\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint) on MDN.\n\n## Examples\n\n```rescript\nString.fromCodePoint(65) == \"A\"\nString.fromCodePoint(0x3c8) == `ψ`\nString.fromCodePoint(0xd55c) == `한`\nString.fromCodePoint(0x1f63a) == `😺`\n```\n\n## Exceptions\n\n- `RangeError`: If the number is not a valid code point, like `fromCharCode(-5)`." - ], - "signature": "let fromCodePoint: int => string" - }, - { - "id": "Stdlib.String.fromCodePointMany", - "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint) on MDN.\n\n## Examples\n\n```rescript\nString.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```\n\n## Exceptions\n\n- `RangeError`: If one of the number is not a valid code point, like\n `fromCharCode([1, -5])`." - ], - "signature": "let fromCodePointMany: array => string" - }, - { - "id": "Stdlib.String.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(str1, str2)` checks if two strings are equal.\n\n## Examples\n\n```rescript\nString.equal(\"hello\", \"hello\") == true\nString.equal(\"hello\", \"world\") == false\nString.equal(\"\", \"\") == true\n```" - ], - "signature": "let equal: (string, string) => bool" - }, - { - "id": "Stdlib.String.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(str1, str2)` compares two strings, returns an `Ordering.t` value.\n\n## Examples\n\n```rescript\nString.compare(\"hello\", \"hello\") == Ordering.equal\nString.compare(\"apple\", \"banana\") == Ordering.less\nString.compare(\"zebra\", \"apple\") == Ordering.greater\n```" - ], - "signature": "let compare: (string, string) => Ordering.t" - }, - { - "id": "Stdlib.String.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(str)` returns the length of the given `string`.\nSee [`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length) on MDN.\n\n## Examples\n\n```rescript\nString.length(\"abcd\") == 4\n```" - ], - "signature": "let length: string => int" - }, - { - "id": "Stdlib.String.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(str, index)` returns an `option` at the given `index` number. If\n`index` is out of range, this function returns `None`.\n\n## Examples\n\n```rescript\nString.get(\"ReScript\", 0) == Some(\"R\")\nString.get(\"Hello\", 4) == Some(\"o\")\nString.get(`JS`, 4) == None\n```" - ], - "signature": "let get: (string, int) => option" - }, - { - "id": "Stdlib.String.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(str, index)` returns an `string` at the given `index` number.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `string`.\n\nUse `String.getUnsafe` only when you are sure the `index` exists.\n## Examples\n\n```rescript\nString.getUnsafe(\"ReScript\", 0) == \"R\"\nString.getUnsafe(\"Hello\", 4) == \"o\"\n```" - ], - "signature": "let getUnsafe: (string, int) => string" - }, - { - "id": "Stdlib.String.charAt", - "kind": "value", - "name": "charAt", - "docstrings": [ - "`charAt(str, index)` gets the character at `index` within string `str`. If\n`index` is negative or greater than the length of `str`, it returns the empty\nstring. If the string contains characters outside the range \\\\u0000-\\\\uffff, it\nwill return the first 16-bit value at that position in the string.\nSee [`String.charAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt) on MDN.\n\n## Examples\n\n```rescript\nString.charAt(\"ReScript\", 0) == \"R\"\nString.charAt(\"Hello\", 12) == \"\"\nString.charAt(`JS`, 5) == \"\"\n```" - ], - "signature": "let charAt: (string, int) => string" - }, - { - "id": "Stdlib.String.charCodeAt", - "kind": "value", - "name": "charCodeAt", - "docstrings": [ - "`charCodeAt(str, index)` returns the character code at position `index` in\nstring `str` the result is in the range 0-65535, unlike `codePointAt`, so it\nwill not work correctly for characters with code points greater than or equal\nto 0x10000.\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt) on MDN.\n\n## Examples\n\n```rescript\nString.charCodeAt(`😺`, 0) == Some(0xd83d)\nString.charCodeAt(\"\", 0) == None\nString.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" - ], - "signature": "let charCodeAt: (string, int) => option" - }, - { - "id": "Stdlib.String.charCodeAtUnsafe", - "kind": "value", - "name": "charCodeAtUnsafe", - "docstrings": [ - "`charCodeAtUnsafe(str, index)` returns the character code at position `index` in\nstring `str` the result is in the range 0-65535, unlike `codePointAt`, so it\nwill not work correctly for characters with code points greater than or equal\nto 0x10000.\nBeware: If the index is out of range, it will return `NaN` which is not actually a valid int.\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt) on MDN.\n\n## Examples\n\n```rescript\nString.charCodeAtUnsafe(`😺`, 0) == 0xd83d\nString.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" - ], - "signature": "let charCodeAtUnsafe: (string, int) => int" - }, - { - "id": "Stdlib.String.codePointAt", - "kind": "value", - "name": "codePointAt", - "docstrings": [ - "`codePointAt(str, index)` returns the code point at position `index` within\nstring `str` as a `Some(value)`. The return value handles code points greater\nthan or equal to 0x10000. If there is no code point at the given position, the\nfunction returns `None`.\nSee [`String.codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) on MDN.\n\n## Examples\n\n```rescript\nString.codePointAt(`¿😺?`, 1) == Some(0x1f63a)\nString.codePointAt(\"abc\", 5) == None\n```" - ], - "signature": "let codePointAt: (string, int) => option" - }, - { - "id": "Stdlib.String.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(original, append)` returns a new `string` with `append` added after\n`original`.\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat) on MDN.\n\n## Examples\n\n```rescript\nString.concat(\"cow\", \"bell\") == \"cowbell\"\nString.concat(\"Re\", \"Script\") == \"ReScript\"\n```" - ], - "signature": "let concat: (string, string) => string" - }, - { - "id": "Stdlib.String.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(original, arr)` returns a new `string` consisting of each item of an\narray of strings added to the `original` string.\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat) on MDN.\n\n## Examples\n\n```rescript\nString.concatMany(\"1st\", [\"2nd\", \"3rd\", \"4th\"]) == \"1st2nd3rd4th\"\n```" - ], - "signature": "let concatMany: (string, array) => string" - }, - { - "id": "Stdlib.String.endsWith", - "kind": "value", - "name": "endsWith", - "docstrings": [ - "`endsWith(str, substr)` returns `true` if the `str` ends with `substr`, `false`\notherwise.\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith) on MDN.\n\n## Examples\n\n```rescript\nString.endsWith(\"BuckleScript\", \"Script\") == true\nString.endsWith(\"BuckleShoes\", \"Script\") == false\n```" - ], - "signature": "let endsWith: (string, string) => bool" - }, - { - "id": "Stdlib.String.endsWithFrom", - "kind": "value", - "name": "endsWithFrom", - "docstrings": [ - "`endsWithFrom(str, ending, len)` returns `true` if the first len characters of\n`str` end with `ending`, `false` otherwise. If `len` is greater than or equal\nto the length of `str`, then it works like `endsWith`.\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith) on MDN.\n\n## Examples\n\n```rescript\nString.endsWithFrom(\"abcd\", \"cd\", 4) == true\nString.endsWithFrom(\"abcde\", \"cd\", 3) == false\nString.endsWithFrom(\"abcde\", \"cde\", 99) == true\nString.endsWithFrom(\"example.dat\", \"ple\", 7) == true\n```" - ], - "signature": "let endsWithFrom: (string, string, int) => bool" - }, - { - "id": "Stdlib.String.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "`includes(str, searchValue)` returns `true` if `searchValue` is found anywhere\nwithin `str`, `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includes(\"programmer\", \"gram\") == true\nString.includes(\"programmer\", \"er\") == true\nString.includes(\"programmer\", \"pro\") == true\nString.includes(\"programmer.dat\", \"xyz\") == false\n```" - ], - "signature": "let includes: (string, string) => bool" - }, - { - "id": "Stdlib.String.includesFrom", - "kind": "value", - "name": "includesFrom", - "docstrings": [ - "`includesFrom(str, searchValue, start)` returns `true` if `searchValue` is found\nanywhere within `str` starting at character number `start` (where 0 is the\nfirst character), `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includesFrom(\"programmer\", \"gram\", 1) == true\nString.includesFrom(\"programmer\", \"gram\", 4) == false\nString.includesFrom(`대한민국`, `한`, 1) == true\n```" - ], - "signature": "let includesFrom: (string, string, int) => bool" - }, - { - "id": "Stdlib.String.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "`indexOf(str, searchValue)` returns the position at which `searchValue` was\nfirst found within `str`, or `-1` if `searchValue` is not in `str`.\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) on MDN.\n\n## Examples\n\n```rescript\nString.indexOf(\"bookseller\", \"ok\") == 2\nString.indexOf(\"bookseller\", \"sell\") == 4\nString.indexOf(\"beekeeper\", \"ee\") == 1\nString.indexOf(\"bookseller\", \"xyz\") == -1\n```" - ], - "signature": "let indexOf: (string, string) => int" - }, - { - "id": "Stdlib.String.indexOfOpt", - "kind": "value", - "name": "indexOfOpt", - "docstrings": [ - "`indexOfOpt(str, searchValue)`. Like `indexOf`, but return an `option`.\n\n## Examples\n\n```rescript\nString.indexOfOpt(\"bookseller\", \"ok\") == Some(2)\nString.indexOfOpt(\"bookseller\", \"xyz\") == None\n```" - ], - "signature": "let indexOfOpt: (string, string) => option" - }, - { - "id": "Stdlib.String.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "`indexOfFrom(str, searchValue, start)` returns the position at which\n`searchValue` was found within `str` starting at character position `start`, or\n`-1` if `searchValue` is not found in that portion of `str`. The return value is\nrelative to the beginning of the string, no matter where the search started\nfrom.\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) on MDN.\n\n## Examples\n\n```rescript\nString.indexOfFrom(\"bookseller\", \"ok\", 1) == 2\nString.indexOfFrom(\"bookseller\", \"sell\", 2) == 4\nString.indexOfFrom(\"bookseller\", \"sell\", 5) == -1\n```" - ], - "signature": "let indexOfFrom: (string, string, int) => int" - }, - { - "id": "Stdlib.String.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(str, searchValue)` returns the position of the last occurrence of\n`searchValue` within `str`, searching backwards from the end of the string.\nReturns `-1` if `searchValue` is not in `str`. The return value is always\nrelative to the beginning of the string.\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\nString.lastIndexOf(\"bookseller\", \"ok\") == 2\nString.lastIndexOf(\"beekeeper\", \"ee\") == 4\nString.lastIndexOf(\"abcdefg\", \"xyz\") == -1\n```" - ], - "signature": "let lastIndexOf: (string, string) => int" - }, - { - "id": "Stdlib.String.lastIndexOfOpt", - "kind": "value", - "name": "lastIndexOfOpt", - "docstrings": [ - "`lastIndexOfOpt(str, searchValue)`. Like `lastIndexOfOpt`, but return an\n`option`.\n\n## Examples\n\n```rescript\nString.lastIndexOfOpt(\"bookseller\", \"ok\") == Some(2)\nString.lastIndexOfOpt(\"beekeeper\", \"ee\") == Some(4)\nString.lastIndexOfOpt(\"abcdefg\", \"xyz\") == None\n```" - ], - "signature": "let lastIndexOfOpt: (string, string) => option" - }, - { - "id": "Stdlib.String.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "`lastIndexOfFrom(str, searchValue, start)` returns the position of the last\noccurrence of `searchValue` within `str`, searching backwards from the given\nstart position. Returns `-1` if `searchValue` is not in `str`. The return value\nis always relative to the beginning of the string.\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\nString.lastIndexOfFrom(\"bookseller\", \"ok\", 6) == 2\nString.lastIndexOfFrom(\"beekeeper\", \"ee\", 8) == 4\nString.lastIndexOfFrom(\"beekeeper\", \"ee\", 3) == 1\nString.lastIndexOfFrom(\"abcdefg\", \"xyz\", 4) == -1\n```" - ], - "signature": "let lastIndexOfFrom: (string, string, int) => int" - }, - { - "id": "Stdlib.String.match", - "kind": "value", - "name": "match", - "docstrings": [ - "`match(str, regexp)` matches a `string` against the given `regexp`. If there is\nno match, it returns `None`. For regular expressions without the g modifier, if\nthere is a match, the return value is `Some(array)` where the array contains:\n- The entire matched string\n- Any capture groups if the regexp had parentheses\n For regular expressions with the g modifier, a matched expression returns\n `Some(array)` with all the matched substrings and no capture groups.\n See [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match) on MDN.\n\n## Examples\n\n```rescript\nString.match(\"The better bats\", /b[aeiou]t/) == Some([Some(\"bet\")])\nString.match(\"The better bats\", /b[aeiou]t/g) == Some([Some(\"bet\"), Some(\"bat\")])\nString.match(\"Today is 2018-04-05.\", /(\\d+)-(\\d+)-(\\d+)/) ==\n Some([Some(\"2018-04-05\"), Some(\"2018\"), Some(\"04\"), Some(\"05\")])\nString.match(\"The optional example\", /(foo)?(example)/) ==\n Some([Some(\"example\"), None, Some(\"example\")])\nString.match(\"The large container.\", /b[aeiou]g/) == None\n```" - ], - "signature": "let match: (string, RegExp.t) => option<\\\"RegExp.Result\".t>" - }, - { - "id": "Stdlib.String.normalize", - "kind": "value", - "name": "normalize", - "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\\\u00e3 or the combination of a lower case letter A\n\\\\u0061 and a combining tilde \\\\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\nSee also [Unicode technical report \\#15](https://unicode.org/reports/tr15/) for details.\n\n## Examples\n\n```rescript\nlet string1 = \"\\u00F1\"\nlet string2 = \"\\u006E\\u0303\"\n\nassert(string1 != string2) // true\nString.normalize(string1) == String.normalize(string2)\n```" - ], - "signature": "let normalize: string => string" - }, - { - "id": "Stdlib.String.normalizeForm", - "kind": "type", - "name": "normalizeForm", - "docstrings": [ - "`normalizeByForm(str, form)` returns the normalized Unicode string using the\nspecified form of normalization, which may be one of:\n- \"NFC\" — Normalization Form Canonical Composition.\n- \"NFD\" — Normalization Form Canonical Decomposition.\n- \"NFKC\" — Normalization Form Compatibility Composition.\n- \"NFKD\" — Normalization Form Compatibility Decomposition.\n See [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\n See also [Unicode technical report \\#15](https://unicode.org/reports/tr15/) for\n details.\n\n## Examples\n\n```rescript\nlet string1 = \"\\uFB00\"\nlet string2 = \"\\u0066\\u0066\"\nConsole.log(string1 == string2) // false\n\nlet normalizeString1 = String.normalizeByForm(string1, #NFKD)\nlet normalizeString2 = String.normalizeByForm(string2, #NFKD)\nConsole.log(normalizeString1 == normalizeString2) // true\n```" - ], - "signature": "type normalizeForm = [#NFC | #NFD | #NFKC | #NFKD]" - }, - { - "id": "Stdlib.String.normalizeByForm", - "kind": "value", - "name": "normalizeByForm", - "docstrings": [], - "signature": "let normalizeByForm: (string, normalizeForm) => string" - }, - { - "id": "Stdlib.String.repeat", - "kind": "value", - "name": "repeat", - "docstrings": [ - "`repeat(str, n)` returns a `string` that consists of `n` repetitions of `str`.\nSee [`String.repeat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat) on MDN.\n\n## Examples\n\n```rescript\nString.repeat(\"ha\", 3) == \"hahaha\"\nString.repeat(\"empty\", 0) == \"\"\n```\n\n## Exceptions\n\n- `RangeError`: if `n` is negative." - ], - "signature": "let repeat: (string, int) => string" - }, - { - "id": "Stdlib.String.replace", - "kind": "value", - "name": "replace", - "docstrings": [ - "`replace(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with the first matching instance of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nString.replace(\"old string\", \"old\", \"new\") == \"new string\"\nString.replace(\"the cat and the dog\", \"the\", \"this\") == \"this cat and the dog\"\n```" - ], - "signature": "let replace: (string, string, string) => string" - }, - { - "id": "Stdlib.String.replaceRegExp", - "kind": "value", - "name": "replaceRegExp", - "docstrings": [ - "`replaceRegExp(str, regex, replacement)` returns a new `string` where\noccurrences matching regex have been replaced by `replacement`.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nString.replaceRegExp(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nString.replaceRegExp(\"Juan Fulano\", /(\\w+) (\\w+)/, \"$2, $1\") == \"Fulano, Juan\"\n```" - ], - "signature": "let replaceRegExp: (string, RegExp.t, string) => string" - }, - { - "id": "Stdlib.String.replaceAll", - "kind": "value", - "name": "replaceAll", - "docstrings": [ - "`replaceAll(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with all matching instances of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\nSee [`String.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) on MDN.\n\n## Examples\n\n```rescript\nString.replaceAll(\"old old string\", \"old\", \"new\") == \"new new string\"\nString.replaceAll(\"the cat and the dog\", \"the\", \"this\") == \"this cat and this dog\"\n```" - ], - "signature": "let replaceAll: (string, string, string) => string" - }, - { - "id": "Stdlib.String.replaceAllRegExp", - "kind": "value", - "name": "replaceAllRegExp", - "docstrings": [ - "`replaceAllRegExp(str, regex, replacement)` returns a new `string` where\nall occurrences matching regex have been replaced by `replacement`.\nThe pattern must include the global (`g`) flag or a runtime TypeError will be thrown.\nSee [`String.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) on MDN.\n\n## Examples\n\n```rescript\nString.replaceAllRegExp(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nString.replaceAllRegExp(\"aabbcc\", /b/g, \".\") == \"aa..cc\"\n```" - ], - "signature": "let replaceAllRegExp: (string, RegExp.t, string) => string" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy0", - "kind": "value", - "name": "unsafeReplaceRegExpBy0", - "docstrings": [ - "`unsafeReplaceRegExpBy0(str, regex, f)` returns a new `string` with some or all\nmatches of a pattern with no capturing parentheses replaced by the value\nreturned from the given function. The function receives as its parameters the\nmatched string, the offset at which the match begins, and the whole string being\nmatched.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (~match, ~offset as _, ~input as _) => String.toUpperCase(match)\nString.unsafeReplaceRegExpBy0(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy0: (\n string,\n RegExp.t,\n (~match: string, ~offset: int, ~input: string) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy1", - "kind": "value", - "name": "unsafeReplaceRegExpBy1", - "docstrings": [ - "`unsafeReplaceRegExpBy1(str, regexp, f)`. Like `unsafeReplaceRegExpBy0`, but `f`\nhas `group1` parameter.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (~match as _, ~group1, ~offset as _, ~input as _) => {\n group1 ++ \"41\"\n}\nString.unsafeReplaceRegExpBy1(str, re, matchFn) == \"Jony is 41\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy1: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy2", - "kind": "value", - "name": "unsafeReplaceRegExpBy2", - "docstrings": [ - "`unsafeReplaceRegExpBy2(str, regexp, f)`. Like `unsafeReplaceRegExpBy1`, but `f`\nhas two group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (~match as _, ~group1, ~group2, ~offset as _, ~input as _) => {\n switch (Int.fromString(group1), Int.fromString(group2)) {\n | (Some(x), Some(y)) => Int.toString(x * y)\n | _ => \"???\"\n }\n}\nString.unsafeReplaceRegExpBy2(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy2: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy3", - "kind": "value", - "name": "unsafeReplaceRegExpBy3", - "docstrings": [ - "`unsafeReplaceRegExpBy3(str, regexp, f)`. Like `unsafeReplaceRegExpBy2`, but `f`\nhas three group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN." - ], - "signature": "let unsafeReplaceRegExpBy3: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~group3: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.replaceRegExpBy0Unsafe", - "kind": "value", - "name": "replaceRegExpBy0Unsafe", - "docstrings": [ - "`replaceRegExpBy0Unsafe(str, regex, f)` returns a new `string` with some or all\nmatches of a pattern with no capturing parentheses replaced by the value\nreturned from the given function. The function receives as its parameters the\nmatched string, the offset at which the match begins, and the whole string being\nmatched.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (~match, ~offset as _, ~input as _) => String.toUpperCase(match)\nString.replaceRegExpBy0Unsafe(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" - ], - "signature": "let replaceRegExpBy0Unsafe: (\n string,\n RegExp.t,\n (~match: string, ~offset: int, ~input: string) => string,\n) => string" - }, - { - "id": "Stdlib.String.replaceRegExpBy1Unsafe", - "kind": "value", - "name": "replaceRegExpBy1Unsafe", - "docstrings": [ - "`replaceRegExpBy1Unsafe(str, regexp, f)`. Like `replaceRegExpBy0Unsafe`, but `f`\nhas `group1` parameter.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (~match as _, ~group1, ~offset as _, ~input as _) => {\n group1 ++ \"41\"\n}\nString.replaceRegExpBy1Unsafe(str, re, matchFn) == \"Jony is 41\"\n```" - ], - "signature": "let replaceRegExpBy1Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" - }, - { - "id": "Stdlib.String.replaceRegExpBy2Unsafe", - "kind": "value", - "name": "replaceRegExpBy2Unsafe", - "docstrings": [ - "`replaceRegExpBy2Unsafe(str, regexp, f)`. Like `replaceRegExpBy1Unsafe`, but `f`\nhas two group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (~match as _, ~group1, ~group2, ~offset as _, ~input as _) => {\n switch (Int.fromString(group1), Int.fromString(group2)) {\n | (Some(x), Some(y)) => Int.toString(x * y)\n | _ => \"???\"\n }\n}\nString.replaceRegExpBy2Unsafe(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let replaceRegExpBy2Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" - }, - { - "id": "Stdlib.String.replaceRegExpBy3Unsafe", - "kind": "value", - "name": "replaceRegExpBy3Unsafe", - "docstrings": [ - "`replaceRegExpBy3Unsafe(str, regexp, f)`. Like `replaceRegExpBy2Unsafe`, but `f`\nhas three group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN." - ], - "signature": "let replaceRegExpBy3Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~group3: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" - }, - { - "id": "Stdlib.String.search", - "kind": "value", - "name": "search", - "docstrings": [ - "`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search) on MDN.\n\n## Examples\n\n```rescript\nString.search(\"testing 1 2 3\", /\\d+/) == 8\nString.search(\"no numbers\", /\\d+/) == -1\n```" - ], - "signature": "let search: (string, RegExp.t) => int" - }, - { - "id": "Stdlib.String.searchOpt", - "kind": "value", - "name": "searchOpt", - "docstrings": [ - "`searchOpt(str, regexp)`. Like `search`, but return an `option`.\n\n## Examples\n\n```rescript\nString.searchOpt(\"testing 1 2 3\", /\\d+/) == Some(8)\nString.searchOpt(\"no numbers\", /\\d+/) == None\n```" - ], - "signature": "let searchOpt: (string, RegExp.t) => option" - }, - { - "id": "Stdlib.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(str)` returns `true` if the string is empty (has zero length), \n`false` otherwise.\n\n## Examples\n\n```rescript\nString.isEmpty(\"\") == true\nString.isEmpty(\"hello\") == false\nString.isEmpty(\" \") == false\n```" - ], - "signature": "let isEmpty: string => bool" - }, - { - "id": "Stdlib.String.capitalize", - "kind": "value", - "name": "capitalize", - "docstrings": [ - "`capitalize(str)` returns a new string with the first character converted to \nuppercase and the remaining characters unchanged. If the string is empty, \nreturns the empty string.\n\n## Examples\n\n```rescript\nString.capitalize(\"hello\") == \"Hello\"\nString.capitalize(\"HELLO\") == \"HELLO\"\nString.capitalize(\"hello world\") == \"Hello world\"\nString.capitalize(\"\") == \"\"\n```" - ], - "signature": "let capitalize: string => string" - }, - { - "id": "Stdlib.String.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```" - ], - "signature": "let slice: (string, ~start: int, ~end: int=?) => string" - }, - { - "id": "Stdlib.String.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```" - ], - "signature": "let sliceToEnd: (string, ~start: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nString.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nString.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nString.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```" - ], - "signature": "let split: (string, string) => array" - }, - { - "id": "Stdlib.String.splitAtMost", - "kind": "value", - "name": "splitAtMost", - "docstrings": [ - "`splitAtMost(str, delimiter, ~limit)` splits the given `str` at every\noccurrence of `delimiter` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings,\nthe array will contain all the substrings.\n\n## Examples\n\n```rescript\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=3) == [\"ant\", \"bee\", \"cat\"]\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=0) == []\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=9) == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```" - ], - "signature": "let splitAtMost: (string, string, ~limit: int) => array" - }, - { - "id": "Stdlib.String.splitByRegExp", - "kind": "value", - "name": "splitByRegExp", - "docstrings": [ - "`splitByRegExp(str, regexp)` splits the given `str` at every occurrence of\n`regexp` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExp(\"Jan,Feb,Mar\", /,/) == [Some(\"Jan\"), Some(\"Feb\"), Some(\"Mar\")]\n```" - ], - "signature": "let splitByRegExp: (string, RegExp.t) => array>" - }, - { - "id": "Stdlib.String.splitByRegExpAtMost", - "kind": "value", - "name": "splitByRegExpAtMost", - "docstrings": [ - "`splitByRegExpAtMost(str, regexp, ~limit)` splits the given `str` at every\noccurrence of `regexp` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings, the\narray will contain all the substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExpAtMost(\"Hello World. How are you doing?\", / /, ~limit=3) == [\n Some(\"Hello\"),\n Some(\"World.\"),\n Some(\"How\"),\n ]\n```" - ], - "signature": "let splitByRegExpAtMost: (string, RegExp.t, ~limit: int) => array>" - }, - { - "id": "Stdlib.String.startsWith", - "kind": "value", - "name": "startsWith", - "docstrings": [ - "`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```" - ], - "signature": "let startsWith: (string, string) => bool" - }, - { - "id": "Stdlib.String.startsWithFrom", - "kind": "value", - "name": "startsWithFrom", - "docstrings": [ - "`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```" - ], - "signature": "let startsWithFrom: (string, string, int) => bool" - }, - { - "id": "Stdlib.String.substring", - "kind": "value", - "name": "substring", - "docstrings": [ - "`substring(str, ~start, ~end)` returns characters `start` up to but not\nincluding end from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `end` is zero or negative, the empty string is returned.\n- If `start` is greater than `end`, the `start` and `end` points are swapped.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substring(\"playground\", ~start=3, ~end=6) == \"ygr\"\nString.substring(\"playground\", ~start=6, ~end=3) == \"ygr\"\nString.substring(\"playground\", ~start=4, ~end=12) == \"ground\"\nString.substring(\"playground\", ~start=4) == \"ground\"\nString.substring(\"Hello World\", ~start=6) == \"World\"\n```" - ], - "signature": "let substring: (string, ~start: int, ~end: int=?) => string" - }, - { - "id": "Stdlib.String.substringToEnd", - "kind": "value", - "name": "substringToEnd", - "docstrings": [ - "`substringToEnd(str, ~start)` returns the substring of `str` from position\n`start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string\n is returned.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substringToEnd(\"playground\", ~start=4) == \"ground\"\nString.substringToEnd(\"playground\", ~start=-3) == \"playground\"\nString.substringToEnd(\"playground\", ~start=12) == \"\"\n```" - ], - "signature": "let substringToEnd: (string, ~start: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.toLowerCase", - "kind": "value", - "name": "toLowerCase", - "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms, one when it is the last\ncharacter in a string and another when it is not.\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase) on MDN.\n\n## Examples\n\n```rescript\nString.toLowerCase(\"ABC\") == \"abc\"\nString.toLowerCase(`ΣΠ`) == `σπ`\nString.toLowerCase(`ΠΣ`) == `πς`\n```" - ], - "signature": "let toLowerCase: string => string" - }, - { - "id": "Stdlib.String.toLocaleLowerCase", - "kind": "value", - "name": "toLocaleLowerCase", - "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase) on MDN." - ], - "signature": "let toLocaleLowerCase: string => string" - }, - { - "id": "Stdlib.String.toUpperCase", - "kind": "value", - "name": "toUpperCase", - "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result, for example the German ß\ncapitalizes to two Ses in a row.\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) on MDN.\n\n## Examples\n\n```rescript\nString.toUpperCase(\"abc\") == \"ABC\"\nString.toUpperCase(`Straße`) == `STRASSE`\nString.toUpperCase(`πς`) == `ΠΣ`\n```" - ], - "signature": "let toUpperCase: string => string" - }, - { - "id": "Stdlib.String.toLocaleUpperCase", - "kind": "value", - "name": "toLocaleUpperCase", - "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\nSee [`String.toLocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase) on MDN." - ], - "signature": "let toLocaleUpperCase: string => string" - }, - { - "id": "Stdlib.String.trim", - "kind": "value", - "name": "trim", - "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim) on MDN.\n\n## Examples\n\n```rescript\nString.trim(\" abc def \") == \"abc def\"\nString.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" - ], - "signature": "let trim: string => string" - }, - { - "id": "Stdlib.String.trimStart", - "kind": "value", - "name": "trimStart", - "docstrings": [ - "`trimStart(str)` returns a string that is `str` with whitespace stripped from\nthe beginning of a string. Internal whitespace is not removed.\nSee [`String.trimStart`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimStart) on MDN.\n\n## Examples\n\n```rescript\nString.trimStart(\" Hello world! \") == \"Hello world! \"\nString.trimStart(\" Hello world! \") == \"Hello world! \"\n```" - ], - "signature": "let trimStart: string => string" - }, - { - "id": "Stdlib.String.trimEnd", - "kind": "value", - "name": "trimEnd", - "docstrings": [ - "`trimEnd(str)` returns a string that is `str` with whitespace stripped from the\nend of a string. Internal whitespace is not removed.\nSee [`String.trimEnd`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd) on MDN.\n\n## Examples\n\n```rescript\nString.trimEnd(\" Hello world! \") == \" Hello world!\"\nString.trimEnd(\" Hello world! \") == \" Hello world!\"\n```" - ], - "signature": "let trimEnd: string => string" - }, - { - "id": "Stdlib.String.padStart", - "kind": "value", - "name": "padStart", - "docstrings": [ - "`padStart(str, n, padStr)` returns a string that has been padded with `padStr`\n(multiple times, if needed) until the resulting string reaches the given `n`\nlength. The padding is applied from the start of the current string.\nSee [`String.padStart`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart) on MDN.\n\n## Examples\n\n```rescript\nString.padStart(\"abc\", 5, \" \") == \" abc\"\nString.padStart(\"abc\", 6, \"123465\") == \"123abc\"\n```" - ], - "signature": "let padStart: (string, int, string) => string" - }, - { - "id": "Stdlib.String.padEnd", - "kind": "value", - "name": "padEnd", - "docstrings": [ - "`padEnd(str, n, padStr)` returns a string that has been padded with `padStr`\n(multiple times, if needed) until the resulting string reaches the given `n`\nlength. The padding is applied from the end of the current string.\nSee [`String.padEnd`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd) on MDN.\n\n## Examples\n\n```rescript\nString.padEnd(\"Hello\", 10, \".\") == \"Hello.....\"\nString.padEnd(\"abc\", 1, \"\") == \"abc\"\n```" - ], - "signature": "let padEnd: (string, int, string) => string" - }, - { - "id": "Stdlib.String.localeCompare", - "kind": "value", - "name": "localeCompare", - "docstrings": [ - "`localeCompare(referenceStr, compareStr)` returns a float than indicatings\nwhether a reference string comes before or after, or is the same as the given\nstring in sort order. If `referenceStr` occurs before `compareStr` positive if\nthe `referenceStr` occurs after `compareStr`, `0` if they are equivalent.\nDo not rely on exact return values of `-1` or `1`\nSee [`String.localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare) on MDN.\n\n## Examples\n\n```rescript\nString.localeCompare(\"a\", \"c\") < 0.0 == true\nString.localeCompare(\"a\", \"a\") == 0.0\n```" - ], - "signature": "let localeCompare: (string, string) => float" - }, - { - "id": "Stdlib.String.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(string)` ignores the provided string and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: string => unit" - }, - { - "id": "Stdlib.String.getSymbolUnsafe", - "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [ - "`getSymbolUnsafe(str, symbol)` returns the value of the symbol property of a string.\n\n## Examples\n\n```rescript\nlet it: Iterator.t = (\"foo\"->String.getSymbolUnsafe(Symbol.iterator))()\nNullable.make(it)->Nullable.isNullable == false\n```" - ], - "signature": "let getSymbolUnsafe: (string, Symbol.t) => 'a" - } - ] - }, - "stdlib/result": { - "id": "Stdlib.Result", - "name": "Result", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Result.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Result types are really useful to describe the result of a certain operation\n without relying on exceptions or `option` types.\n\n This module gives you useful utilities to create and combine `Result` data." - ], - "signature": "type t<'res, 'err> = result<'res, 'err> =\n | Ok('res)\n | Error('err)" - }, - { - "id": "Stdlib.Result.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getExn(Result.Ok(42)) == 42\n \n switch Result.getExn(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getExn(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```" - ], - "signature": "let getExn: (result<'a, 'b>, ~message: string=?) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Result.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getOrThrow(Result.Ok(42)) == 42\n \n switch Result.getOrThrow(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getOrThrow(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```" - ], - "signature": "let getOrThrow: (result<'a, 'b>, ~message: string=?) => 'a" - }, - { - "id": "Stdlib.Result.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(res, default, f)`: When res is `Ok(n)`, returns `f(n)`, otherwise `default`.\n\n## Examples\n\n```rescript\nlet ok = Ok(42)\nResult.mapOr(ok, 0, x => x / 2) == 21\n\nlet error = Error(\"Invalid data\")\nResult.mapOr(error, 0, x => x / 2) == 0\n```" - ], - "signature": "let mapOr: (result<'a, 'c>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Result.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (result<'a, 'c>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Result.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(res, f)`: When res is `Ok(n)`, returns `Ok(f(n))`. Otherwise returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns an\nordinary value.\n\n## Examples\n\n```rescript\nlet f = x => sqrt(Int.toFloat(x))\n\nResult.map(Ok(64), f) == Ok(8.0)\n\nResult.map(Error(\"Invalid data\"), f) == Error(\"Invalid data\")\n```" - ], - "signature": "let map: (result<'a, 'c>, 'a => 'b) => result<'b, 'c>" - }, - { - "id": "Stdlib.Result.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(res, f)`: When res is `Ok(n)`, returns `f(n)`. Otherwise, returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns a\n`Result`.\n\n## Examples\n\n```rescript\nlet recip = x =>\n if x !== 0.0 {\n Ok(1.0 /. x)\n } else {\n Error(\"Divide by zero\")\n }\n\nResult.flatMap(Ok(2.0), recip) == Ok(0.5)\n\nResult.flatMap(Ok(0.0), recip) == Error(\"Divide by zero\")\n\nResult.flatMap(Error(\"Already bad\"), recip) == Error(\"Already bad\")\n```" - ], - "signature": "let flatMap: (result<'a, 'c>, 'a => result<'b, 'c>) => result<'b, 'c>" - }, - { - "id": "Stdlib.Result.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`, otherwise `default`\n\n## Examples\n\n```rescript\nResult.getOr(Ok(42), 0) == 42\n\nResult.getOr(Error(\"Invalid Data\"), 0) == 0\n```" - ], - "signature": "let getOr: (result<'a, 'b>, 'a) => 'a" - }, - { - "id": "Stdlib.Result.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (result<'a, 'b>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Result.isOk", - "kind": "value", - "name": "isOk", - "docstrings": [ - "`isOk(res)`: Returns `true` if `res` is of the form `Ok(n)`, `false` if it is the `Error(e)` variant." - ], - "signature": "let isOk: result<'a, 'b> => bool" - }, - { - "id": "Stdlib.Result.isError", - "kind": "value", - "name": "isError", - "docstrings": [ - "`isError(res)`: Returns `true` if `res` is of the form `Error(e)`, `false` if it is the `Ok(n)` variant." - ], - "signature": "let isError: result<'a, 'b> => bool" - }, - { - "id": "Stdlib.Result.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(res1, res2, eqOk, eqError)`: Determine if two `Result` variables are equal with\nrespect to equality functions. If `res1` and `res2` are of the form `Ok(n)`\nand `Ok(m)`, return the result of `eqOk(n, m)`. If one of `res1` and `res2` are of\nthe form `Error(e)`, return false If both `res1` and `res2` are of the form\n`Error(e)`, return the result of `eqError(e1, e2)`.\n\n## Examples\n\n```rescript\nlet good1 = Ok(42)\n\nlet good2 = Ok(32)\n\nlet bad1 = Error(\"invalid\")\n\nlet bad2 = Error(\"really invalid\")\n\nlet mod10equal = (a, b) => mod(a, 10) === mod(b, 10)\n\nResult.equal(good1, good2, mod10equal, String.equal) == true\n\nResult.equal(good1, bad1, mod10equal, String.equal) == false\n\nResult.equal(bad2, good2, mod10equal, String.equal) == false\n\nResult.equal(bad1, bad2, mod10equal, String.equal) == false\n```" - ], - "signature": "let equal: (\n result<'a, 'c>,\n result<'b, 'd>,\n ('a, 'b) => bool,\n ('c, 'd) => bool,\n) => bool" - }, - { - "id": "Stdlib.Result.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(res1, res2, cmpOk, cmpError)`: Compare two `Result` variables with respect to a\ncomparison function. The comparison function returns -1. if the first variable\nis \"less than\" the second, 0. if the two variables are equal, and 1. if the first\nis \"greater than\" the second.\n\nIf `res1` and `res2` are of the form `Ok(n)` and `Ok(m)`, return the result of\n`cmpOk(n, m)`. If `res1` is of the form `Error(e)` and `res2` of the form `Ok(n)`,\nreturn -1. (nothing is less than something) If `res1` is of the form `Ok(n)` and\n`res2` is of the form `Error(e)`, return 1. (something is greater than nothing) If\nboth `res1` and `res2` are of the form `Error(e)`, return cmpError(e1, e2).\n\n## Examples\n\n```rescript\nlet good1 = Ok(59)\n\nlet good2 = Ok(37)\n\nlet bad1 = Error(\"invalid\")\n\nlet bad2 = Error(\"really invalid\")\n\nlet mod10cmp = (a, b) => Int.compare(mod(a, 10), mod(b, 10))\n\nResult.compare(Ok(39), Ok(57), mod10cmp, String.compare) == 1.\n\nResult.compare(Ok(57), Ok(39), mod10cmp, String.compare) == -1.\n\nResult.compare(Ok(39), Error(\"y\"), mod10cmp, String.compare) == 1.\n\nResult.compare(Error(\"x\"), Ok(57), mod10cmp, String.compare) == -1.\n\nResult.compare(Error(\"x\"), Error(\"y\"), mod10cmp, String.compare) == -1.\n```" - ], - "signature": "let compare: (\n result<'a, 'c>,\n result<'b, 'd>,\n ('a, 'b) => Ordering.t,\n ('c, 'd) => Ordering.t,\n) => Ordering.t" - }, - { - "id": "Stdlib.Result.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(res, f)` runs the provided function `f` on the `Ok` value. If `res` is `Error`, nothing happens.\n\n## Examples\n\n```rescript\nResult.forEach(Ok(3), Console.log) // Logs \"3\", returns ()\nResult.forEach(Error(\"x\"), Console.log) // Does nothing, returns ()\n```" - ], - "signature": "let forEach: (result<'a, 'b>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Result.mapError", - "kind": "value", - "name": "mapError", - "docstrings": [ - "`mapError(r, f)` generates a new `result` by applying the function `f` to the `Error` value. If the source is `Ok`, return it as-is.\n\n## Examples\n\n```rescript\nlet format = n => `Error code: ${n->Int.toString}`\nResult.mapError(Error(14), format) == Error(\"Error code: 14\")\nResult.mapError(Ok(\"abc\"), format) == Ok(\"abc\")\n```" - ], - "signature": "let mapError: (result<'a, 'b>, 'b => 'c) => result<'a, 'c>" - }, - { - "id": "Stdlib.Result.all", - "kind": "value", - "name": "all", - "docstrings": [ - "`all(results)` returns a result of array if all options are Ok, otherwise returns Error.\n## Examples\n```rescript\nResult.all([Ok(1), Ok(2), Ok(3)]) == Ok([1, 2, 3])\nResult.all([Ok(1), Error(1)]) == Error(1)\n```" - ], - "signature": "let all: array> => result, 'b>" - }, - { - "id": "Stdlib.Result.all2", - "kind": "value", - "name": "all2", - "docstrings": [ - "`all2((r1, r2))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all2: (\n (result<'r1, 'e>, result<'r2, 'e>),\n) => result<('r1, 'r2), 'e>" - }, - { - "id": "Stdlib.Result.all3", - "kind": "value", - "name": "all3", - "docstrings": [ - "`all3((r1, r2, r3))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all3: (\n (result<'r1, 'e>, result<'r2, 'e>, result<'r3, 'e>),\n) => result<('r1, 'r2, 'r3), 'e>" - }, - { - "id": "Stdlib.Result.all4", - "kind": "value", - "name": "all4", - "docstrings": [ - "`all4((r1, r2, r3, r4))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all4: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4), 'e>" - }, - { - "id": "Stdlib.Result.all5", - "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((r1, r2, r3, r4, r5))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all5: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n result<'r5, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4, 'r5), 'e>" - }, - { - "id": "Stdlib.Result.all6", - "kind": "value", - "name": "all6", - "docstrings": [ - "`all6((r1, r2, r3, r4, r5, r6))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all6: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n result<'r5, 'e>,\n result<'r6, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4, 'r5, 'r6), 'e>" - }, - { - "id": "Stdlib.Result.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(result)` ignores the provided result and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: result<'res, 'err> => unit" - }, - { - "id": "Stdlib.Result.mapOkAsync", - "kind": "value", - "name": "mapOkAsync", - "docstrings": [ - "`mapOkAsync(res, f)`: Asynchronously maps over the Ok value of a Result. When `res` is `Ok(n)`, \napplies the async function `f` to `n` and wraps the result in `Ok`. \nWhen `res` is `Error`, returns the error unchanged.\n\n## Examples\n\n```rescript\n let square = x => x * x\n\n let result1 = await Result.mapOkAsync(Promise.resolve(Ok(4)), square)\n result1 == Ok(16)\n\n let result2 = await Result.mapOkAsync(\n Promise.resolve(Error(\"invalid\")),\n square,\n )\n result2 == Error(\"invalid\")\n```" - ], - "signature": "let mapOkAsync: (\n promise>,\n 'ok => 'mappedOk,\n) => promise>" - }, - { - "id": "Stdlib.Result.mapErrorAsync", - "kind": "value", - "name": "mapErrorAsync", - "docstrings": [ - "`mapErrorAsync(res, f)`: Asynchronously maps over the Error value of a Result. When `res` is `Error(e)`, \napplies the async function `f` to `e` and wraps the result in `Error`. \nWhen `res` is `Ok`, returns the ok value unchanged.\n\n## Examples\n\n```rescript\nlet formatError = e => `Error: ${e}`\n\nlet result1 = await Result.mapErrorAsync(Promise.resolve(Ok(42)), formatError)\nresult1 == Ok(42)\n\nlet result2 = await Result.mapErrorAsync(Promise.resolve(Error(\"invalid\")), formatError)\nresult2 == Error(\"Error: invalid\")\n```" - ], - "signature": "let mapErrorAsync: (\n promise>,\n 'error => 'mappedError,\n) => promise>" - }, - { - "id": "Stdlib.Result.flatMapOkAsync", - "kind": "value", - "name": "flatMapOkAsync", - "docstrings": [ - "`flatMapOkAsync(res, f)`: Asynchronously flat-maps over the Ok value of a Result. When `res` is `Ok(n)`, \napplies the async function `f` to `n` which returns a Promise of a Result. \nWhen `res` is `Error`, returns the error unchanged.\n\n## Examples\n\n```rescript\nlet asyncValidate = async x =>\n if x > 0 {\n Ok(x * 2)\n } else {\n Error(\"Must be positive\")\n }\n\nlet result1 = await Result.flatMapOkAsync(Promise.resolve(Ok(5)), asyncValidate)\nresult1 == Ok(10)\n\nlet result2 = await Result.flatMapOkAsync(\n Promise.resolve(Error(\"Already failed\")),\n asyncValidate,\n)\nresult2 == Error(\"Already failed\")\n```" - ], - "signature": "let flatMapOkAsync: (\n promise>,\n 'ok => promise>,\n) => promise>" - }, - { - "id": "Stdlib.Result.flatMapErrorAsync", - "kind": "value", - "name": "flatMapErrorAsync", - "docstrings": [ - "`flatMapErrorAsync(res, f)`: Asynchronously flat-maps over the Error value of a Result. When `res` is `Error(e)`, \napplies the async function `f` to `e` which returns a Promise of a Result. \nWhen `res` is `Ok`, returns the ok value unchanged.\n\n## Examples\n\n```rescript\nlet asyncRecover = async error =>\n if error === \"timeout\" {\n Ok(\"default\")\n } else {\n Error(error)\n }\n\nlet result1 = await Result.flatMapErrorAsync(\n Promise.resolve(Error(\"timeout\")),\n asyncRecover,\n)\nresult1 == Ok(\"default\")\n\nlet result2 = await Result.flatMapErrorAsync(\n Promise.resolve(Ok(\"default\")),\n asyncRecover,\n)\nresult2 == Ok(\"default\")\n```" - ], - "signature": "let flatMapErrorAsync: (\n promise>,\n 'error => promise>,\n) => promise>" - } - ] - }, - "stdlib/regexp": { - "id": "Stdlib.RegExp", - "name": "RegExp", - "docstrings": [ - "Functions for handling RegExp's in ReScript.\n\nSee [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) on MDN." - ], - "items": [ - { - "id": "Stdlib.RegExp.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an instantiated `RegExp`." - ], - "signature": "type t" - }, - { - "id": "Stdlib.RegExp.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(string)` creates a `RegExp.t` from the provided string. This can then be used to match on strings using `RegExp.exec`.\n\nSee [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n\n// Match 'foo' with case insensitive flag\nlet regexp = RegExp.fromString(\"foo\", ~flags=\"i\")\n\nswitch regexp->RegExp.exec(\"FOO\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"FOO\"\n}\n```" - ], - "signature": "let fromString: (string, ~flags: string=?) => t" - }, - { - "id": "Stdlib.RegExp.fromStringWithFlags", - "kind": "value", - "name": "fromStringWithFlags", - "docstrings": [ - "`fromStringWithFlags(string)` creates a `RegExp.t` from the provided string, using the provided `flags`. This can then be used to match on strings using `RegExp.exec`.\n\nSee [`RegExp parameters`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp#parameters) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```" - ], - "signature": "let fromStringWithFlags: (string, ~flags: string) => t", - "deprecated": "" - }, - { - "id": "Stdlib.RegExp.escape", - "kind": "value", - "name": "escape", - "docstrings": [ - "`escape(string)` escapes any potential regex syntax characters in a string.\n\nSee [`RegExp.escape`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/escape) on MDN.\n\n## Examples\n```rescript\nlet literal = \"foo[bar]\"\nlet regexp = literal->RegExp.escape->RegExp.fromString\nregexp->RegExp.test(\"foo[bar]\") == true\n```\n\n## Remark\n\nSince May 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let escape: string => string" - }, - { - "id": "Stdlib.RegExp.test", - "kind": "value", - "name": "test", - "docstrings": [ - "`test(regexp, string)` tests whether the provided `regexp` matches on the provided string.\n\nSee [`RegExp.test`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nif regexp->RegExp.test(\"ReScript is cool!\") {\n Console.log(\"Yay, there's a word in there.\")\n}\n```" - ], - "signature": "let test: (t, string) => bool" - }, - { - "id": "Stdlib.RegExp.exec", - "kind": "value", - "name": "exec", - "docstrings": [ - "`exec(regexp, string)` executes the provided regexp on the provided string, optionally returning a `RegExp.Result.t` if the regexp matches on the string.\n\nSee [`RegExp.exec`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```" - ], - "signature": "let exec: (t, string) => option" - }, - { - "id": "Stdlib.RegExp.lastIndex", - "kind": "value", - "name": "lastIndex", - "docstrings": [ - "`lastIndex(regexp)` returns the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `0` to the console\n\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `4` to the console\n```" - ], - "signature": "let lastIndex: t => int" - }, - { - "id": "Stdlib.RegExp.setLastIndex", - "kind": "value", - "name": "setLastIndex", - "docstrings": [ - "`setLastIndex(regexp, index)` set the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nregexp->RegExp.setLastIndex(4)\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `10` to the console\n```" - ], - "signature": "let setLastIndex: (t, int) => unit" - }, - { - "id": "Stdlib.RegExp.ignoreCase", - "kind": "value", - "name": "ignoreCase", - "docstrings": [ - "`ignoreCase(regexp)` returns whether the ignore case (`i`) flag is set on this `RegExp`.\n\nSee [`RegExp.ignoreCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/ignoreCase) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.ignoreCase) // Logs `false`, since `i` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.ignoreCase) // Logs `true`, since `i` is set\n```" - ], - "signature": "let ignoreCase: t => bool" - }, - { - "id": "Stdlib.RegExp.global", - "kind": "value", - "name": "global", - "docstrings": [ - "`global(regexp)` returns whether the global (`g`) flag is set on this `RegExp`.\n\nSee [`RegExp.global`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/global) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.global) // Logs `true`, since `g` is set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.global) // Logs `false`, since `g` is not set\n```" - ], - "signature": "let global: t => bool" - }, - { - "id": "Stdlib.RegExp.multiline", - "kind": "value", - "name": "multiline", - "docstrings": [ - "`multiline(regexp)` returns whether the multiline (`m`) flag is set on this `RegExp`.\n\nSee [`RegExp.multiline`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/multiline) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.multiline) // Logs `false`, since `m` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mi\")\nConsole.log(regexp2->RegExp.multiline) // Logs `true`, since `m` is set\n```" - ], - "signature": "let multiline: t => bool" - }, - { - "id": "Stdlib.RegExp.source", - "kind": "value", - "name": "source", - "docstrings": [ - "`source(regexp)` returns the source text for this `RegExp`, without the two forward slashes (if present), and without any set flags.\n\nSee [`RegExp.source`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/source) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp->RegExp.source) // Logs `\\w+`, the source text of the `RegExp`\n```" - ], - "signature": "let source: t => string" - }, - { - "id": "Stdlib.RegExp.sticky", - "kind": "value", - "name": "sticky", - "docstrings": [ - "`sticky(regexp)` returns whether the sticky (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.sticky`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `y` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"my\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `y` is set\n```" - ], - "signature": "let sticky: t => bool" - }, - { - "id": "Stdlib.RegExp.unicode", - "kind": "value", - "name": "unicode", - "docstrings": [ - "`unicode(regexp)` returns whether the unicode (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.unicode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `u` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mu\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `u` is set\n```" - ], - "signature": "let unicode: t => bool" - }, - { - "id": "Stdlib.RegExp.flags", - "kind": "value", - "name": "flags", - "docstrings": [ - "`flags(regexp)` returns a string consisting of all the flags set on this `RegExp`.\n\nSee [`RegExp.flags`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromString(\"\\\\w+\", ~flags=\"gi\")\nConsole.log(regexp->RegExp.flags) // Logs \"gi\", all the flags set on the RegExp\n```" - ], - "signature": "let flags: t => string" - }, - { - "id": "Stdlib.RegExp.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(regExp)` ignores the provided regExp and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/promise": { - "id": "Stdlib.Promise", - "name": "Promise", - "docstrings": [ - "Functions for interacting with JavaScript Promise.\nSee: [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)." - ], - "items": [ - { - "id": "Stdlib.Promise.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>" - }, - { - "id": "Stdlib.Promise.resolve", - "kind": "value", - "name": "resolve", - "docstrings": [ - "`resolve(value)` creates a resolved Promise with a given `value`.\nSee [`Promise.resolve`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve) on MDN.\n\n## Examples\n\n```rescript\nlet p = Promise.resolve(5) // promise\n```" - ], - "signature": "let resolve: 'a => t<'a>" - }, - { - "id": "Stdlib.Promise.reject", - "kind": "value", - "name": "reject", - "docstrings": [ - "`reject(exn)` reject a Promise.\nSee [`Promise.reject`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject) on MDN.\n\n## Examples\n\n```rescript\nexception TestError(string)\n\nTestError(\"some rejected value\")\n->Promise.reject\n->Promise.catch(v => {\n switch v {\n | TestError(msg) => msg == \"some rejected value\"\n | _ => assert(false)\n }\n Promise.resolve()\n})\n->ignore\n```" - ], - "signature": "let reject: exn => t<'a>" - }, - { - "id": "Stdlib.Promise.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(callback)` creates a new Promise based on a `callback` that receives two\nuncurried functions `resolve` and `reject` for defining the Promise's result.\n\n## Examples\n\n```rescript\nopen Promise\n\nlet n = 4\nPromise.make((resolve, reject) => {\n if n < 5 {\n resolve(\"success\")\n } else {\n reject(\"failed\")\n }\n})\n->then(str => {\n Console.log(str)->resolve\n})\n->catch(_ => {\n Console.log(\"Error occurred\")\n resolve()\n})\n->ignore\n```" - ], - "signature": "let make: (('a => unit, 'e => unit) => unit) => t<'a>" - }, - { - "id": "Stdlib.Promise.promiseAndResolvers", - "kind": "type", - "name": "promiseAndResolvers", - "docstrings": [], - "signature": "type promiseAndResolvers<'a> = {\n promise: t<'a>,\n resolve: 'a => unit,\n reject: exn => unit,\n}" - }, - { - "id": "Stdlib.Promise.withResolvers", - "kind": "value", - "name": "withResolvers", - "docstrings": [ - "`withResolvers()` returns a object containing a new promise with functions to resolve or reject it. See [`Promise.withResolvers`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\n\nlet {promise, resolve, _} = Promise.withResolvers()\n\nsetTimeout(() => {\n resolve(\"success\")\n}, 1000)->TimeoutId.ignore\n\npromise\n->thenResolve(str => {\n Console.log(str)\n})\n->ignore\n```" - ], - "signature": "let withResolvers: unit => promiseAndResolvers<'a>" - }, - { - "id": "Stdlib.Promise.catch", - "kind": "value", - "name": "catch", - "docstrings": [ - "`catch(promise, errorCallback)` registers an exception handler in a promise chain.\nThe `errorCallback` receives an `exn` value that can later be refined into a JS\nerror or ReScript error. The `errorCallback` needs to return a promise with the\nsame type as the consumed promise. See [`Promise.catch`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\n\nexception SomeError(string)\n\nreject(SomeError(\"this is an error\"))\n->then(_ => {\n Ok(\"This result will never be returned\")->resolve\n})\n->catch(e => {\n let msg = switch e {\n | SomeError(msg) => \"ReScript error occurred: \" ++ msg\n | JsExn(obj) =>\n switch JsExn.message(obj) {\n | Some(msg) => \"JS exception occurred: \" ++ msg\n | None => \"Some other JS value has been thrown\"\n }\n | _ => \"Unexpected error occurred\"\n }\n\n Error(msg)->resolve\n})\n->then(result => {\n switch result {\n | Ok(r) => Console.log2(\"Operation successful: \", r)\n | Error(msg) => Console.log2(\"Operation failed: \", msg)\n }->resolve\n})\n->ignore // Ignore needed for side-effects\n```\n\nIn case you want to return another promise in your `callback`, consider using\n`then` instead." - ], - "signature": "let catch: (t<'a>, exn => t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Promise.then", - "kind": "value", - "name": "then", - "docstrings": [ - "`then(promise, callback)` returns a new promise based on the result of `promise`'s\nvalue. The `callback` needs to explicitly return a new promise via `resolve`.\nIt is **not allowed** to resolve a nested promise (like `resolve(resolve(1))`).\nSee [`Promise.then`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) on MDN.\n## Examples\n\n```rescript\nopen Promise\nresolve(5)\n->then(num => {\n resolve(num + 5)\n})\n->then(num => {\n Console.log2(\"Your lucky number is: \", num)\n resolve()\n})\n->ignore\n```" - ], - "signature": "let then: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Promise.thenResolve", - "kind": "value", - "name": "thenResolve", - "docstrings": [ - "`thenResolve(promise, callback)` converts an encapsulated value of a promise\ninto another promise wrapped value. It is **not allowed** to return a promise\nwithin the provided callback (e.g. `thenResolve(value => resolve(value))`).\n\n## Examples\n\n```rescript\nopen Promise\nresolve(\"Anna\")\n->thenResolve(str => {\n \"Hello \" ++ str\n})\n->thenResolve(str => {\n Console.log(str)\n})\n->ignore // Ignore needed for side-effects\n```\n\nIn case you want to return another promise in your `callback`, consider using\n`then` instead." - ], - "signature": "let thenResolve: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Promise.finally", - "kind": "value", - "name": "finally", - "docstrings": [ - "`finally(promise, callback)` is used to execute a function that is called no\nmatter if a promise was resolved or rejected. It will return the same `promise`\nit originally received. See [`Promise.finally`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/finally) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nexception SomeError(string)\nlet isDone = ref(false)\n\nresolve(5)\n->then(_ => {\n reject(SomeError(\"test\"))\n})\n->then(v => {\n Console.log2(\"final result\", v)\n resolve()\n})\n->catch(_ => {\n Console.log(\"Error handled\")\n resolve()\n})\n->finally(() => {\n Console.log(\"finally\")\n isDone := true\n})\n->then(() => {\n Console.log2(\"isDone:\", isDone.contents)\n resolve()\n})\n->ignore\n```" - ], - "signature": "let finally: (t<'a>, unit => unit) => t<'a>" - }, - { - "id": "Stdlib.Promise.race", - "kind": "value", - "name": "race", - "docstrings": [ - "`race(arr)` runs all promises concurrently and returns promise settles with the eventual state of the first promise that settles. See [`Promise.race`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nlet racer = (ms, name) => {\n Promise.make((resolve, _) => {\n setTimeout(() => {\n resolve(name)\n }, ms)->TimeoutId.ignore\n })\n}\n\nlet promises = [racer(1000, \"Turtle\"), racer(500, \"Hare\"), racer(100, \"Eagle\")]\n\nrace(promises)->then(winner => {\n Console.log(\"The winner is \" ++ winner)\n resolve()\n})\n```" - ], - "signature": "let race: array> => t<'a>" - }, - { - "id": "Stdlib.Promise.any", - "kind": "value", - "name": "any", - "docstrings": [ - "`any(arr)` runs all promises concurrently and returns promise fulfills when any of the input's promises fulfills, with this first fulfillment value. See [`Promise.any`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/any) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nlet racer = (ms, name) => {\n Promise.make((resolve, _) => {\n setTimeout(() => {\n resolve(name)\n }, ms)->TimeoutId.ignore\n })\n}\n\nlet promises = [racer(1000, \"Turtle\"), racer(500, \"Hare\"), racer(100, \"Eagle\")]\n\nany(promises)->then(winner => {\n Console.log(\"The winner is \" ++ winner)\n resolve()\n})\n```" - ], - "signature": "let any: array> => t<'a>" - }, - { - "id": "Stdlib.Promise.all", - "kind": "value", - "name": "all", - "docstrings": [ - "`all(promises)` runs all promises concurrently and returns a promise fulfills when all of the input's promises fulfill, with an array of the fulfillment values. See [`Promise.all`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all) on MDN.\n\n```rescript\nopen Promise\nlet promises = [resolve(1), resolve(2), resolve(3)]\n\nall(promises)\n->then(results => {\n results->Array.forEach(num => {\n Console.log2(\"Number: \", num)\n })\n\n resolve()\n})\n->ignore\n```" - ], - "signature": "let all: array> => t>" - }, - { - "id": "Stdlib.Promise.all2", - "kind": "value", - "name": "all2", - "docstrings": [ - "`all2((p1, p2))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all2: ((t<'a>, t<'b>)) => t<('a, 'b)>" - }, - { - "id": "Stdlib.Promise.all3", - "kind": "value", - "name": "all3", - "docstrings": [ - "`all3((p1, p2, p3))`. Like `all()`, but with a fixed size tuple of 3" - ], - "signature": "let all3: ((t<'a>, t<'b>, t<'c>)) => t<('a, 'b, 'c)>" - }, - { - "id": "Stdlib.Promise.all4", - "kind": "value", - "name": "all4", - "docstrings": [ - "`all4((p1, p2, p3, p4))`. Like `all()`, but with a fixed size tuple of 4" - ], - "signature": "let all4: ((t<'a>, t<'b>, t<'c>, t<'d>)) => t<('a, 'b, 'c, 'd)>" - }, - { - "id": "Stdlib.Promise.all5", - "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((p1, p2, p3, p4, p5))`. Like `all()`, but with a fixed size tuple of 5" - ], - "signature": "let all5: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>),\n) => t<('a, 'b, 'c, 'd, 'e)>" - }, - { - "id": "Stdlib.Promise.all6", - "kind": "value", - "name": "all6", - "docstrings": [ - "`all6((p1, p2, p4, p5, p6))`. Like `all()`, but with a fixed size tuple of 6\n\")" - ], - "signature": "let all6: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>, t<'f>),\n) => t<('a, 'b, 'c, 'd, 'e, 'f)>" - }, - { - "id": "Stdlib.Promise.settledResult", - "kind": "type", - "name": "settledResult", - "docstrings": [], - "signature": "type settledResult<'a> =\n | Fulfilled({value: 'a})\n | Rejected({reason: exn})" - }, - { - "id": "Stdlib.Promise.allSettled", - "kind": "value", - "name": "allSettled", - "docstrings": [ - "`allSettled(promises)` runs all promises concurrently and returns promise fulfills when all of the input's promises settle with an array of objects that describe the outcome of each promise. See [`Promise.allSettled`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled) on MDN.\n\n```rescript\nopen Promise\n\nexception TestError(string)\n\nlet promises = [resolve(1), resolve(2), reject(TestError(\"some rejected promise\"))]\n\nallSettled(promises)\n->then(results => {\n results->Array.forEach(result => {\n switch result {\n | Fulfilled({value: num}) => Console.log2(\"Number: \", num)\n | Rejected({reason}) => Console.log(reason)\n }\n })\n\n resolve()\n})\n->ignore\n```" - ], - "signature": "let allSettled: array> => t>>" - }, - { - "id": "Stdlib.Promise.allSettled2", - "kind": "value", - "name": "allSettled2", - "docstrings": [ - "`allSettled2((p1, p2))`. Like `allSettled()`, but with a fixed size tuple of 2" - ], - "signature": "let allSettled2: (\n (t<'a>, t<'b>),\n) => t<(settledResult<'a>, settledResult<'b>)>" - }, - { - "id": "Stdlib.Promise.allSettled3", - "kind": "value", - "name": "allSettled3", - "docstrings": [ - "`allSettled3((p1, p2, p3))`. Like `allSettled()`, but with a fixed size tuple of 3" - ], - "signature": "let allSettled3: (\n (t<'a>, t<'b>, t<'c>),\n) => t<\n (settledResult<'a>, settledResult<'b>, settledResult<'c>),\n>" - }, - { - "id": "Stdlib.Promise.allSettled4", - "kind": "value", - "name": "allSettled4", - "docstrings": [ - "`allSettled4((p1, p2, p3, p4))`. Like `allSettled()`, but with a fixed size tuple of 4" - ], - "signature": "let allSettled4: (\n (t<'a>, t<'b>, t<'c>, t<'d>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n ),\n>" - }, - { - "id": "Stdlib.Promise.allSettled5", - "kind": "value", - "name": "allSettled5", - "docstrings": [ - "`allSettled5((p1, p2, p3, p4, p5))`. Like `allSettled()`, but with a fixed size tuple of 5" - ], - "signature": "let allSettled5: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n settledResult<'e>,\n ),\n>" - }, - { - "id": "Stdlib.Promise.allSettled6", - "kind": "value", - "name": "allSettled6", - "docstrings": [ - "`allSettled6((p1, p2, p4, p5, p6))`. Like `allSettled()`, but with a fixed size tuple of 6\n\")" - ], - "signature": "let allSettled6: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>, t<'f>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n settledResult<'e>,\n settledResult<'f>,\n ),\n>" - }, - { - "id": "Stdlib.Promise.done", - "kind": "value", - "name": "done", - "docstrings": [ - "`done(p)` is a safe way to ignore a promise. If a value is anything else than a\npromise, it will throw a type error." - ], - "signature": "let done: promise<'a> => unit", - "deprecated": "" - }, - { - "id": "Stdlib.Promise.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(promise)` ignores the provided promise and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: promise<'a> => unit" - } - ] - }, - "stdlib/pair": { - "id": "Stdlib.Pair", - "name": "Pair", - "docstrings": [ - "This module provides functions to work with pairs, which are 2-element tuples." - ], - "items": [ - { - "id": "Stdlib.Pair.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a, 'b> = ('a, 'b)" - }, - { - "id": "Stdlib.Pair.first", - "kind": "value", - "name": "first", - "docstrings": [ - "`first(pair)` returns the first element of a pair.\n\n## Examples\n\n```rescript\nPair.first((1, 2)) == 1\n```" - ], - "signature": "let first: (('a, 'b)) => 'a" - }, - { - "id": "Stdlib.Pair.second", - "kind": "value", - "name": "second", - "docstrings": [ - "`second(pair)` returns the second element of a pair.\n\n## Examples\n\n```rescript\nPair.second((1, 2)) == 2\n```" - ], - "signature": "let second: (('a, 'b)) => 'b" - }, - { - "id": "Stdlib.Pair.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(pair)` ignores the provided pair and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Pair.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(pair1, pair2, f1, f2)` check equality of `pair2` and `pair2` using `f1` for\nequality on the first element and `f2` for equality on the second element.\n\n## Examples\n\n```rescript\nPair.equal((1, \"test\"), (1, \"test\"), Int.equal, String.equal) == true\n\nPair.equal((1, \"test\"), (2, \"test\"), Int.equal, String.equal) == false\n```" - ], - "signature": "let equal: (\n ('a, 'b),\n ('c, 'd),\n ('a, 'c) => bool,\n ('b, 'd) => bool,\n) => bool" - }, - { - "id": "Stdlib.Pair.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(pair1, pair2, f1, f2)` compares two pairs, using `f1` to compare the first element\nand `f2` to compare the second element. Ordering is based on the first element,\nif they are equal, the second element is compared.\n\n## Examples\n\n```rescript\nPair.compare((1, \"a\"), (1, \"a\"), Int.compare, String.compare) == Ordering.equal\nPair.compare((1, \"a\"), (1, \"b\"), Int.compare, String.compare) == Ordering.less\nPair.compare((2, \"a\"), (1, \"b\"), Int.compare, String.compare) == Ordering.greater\n```" - ], - "signature": "let compare: (\n ('a, 'b),\n ('c, 'd),\n ('a, 'c) => float,\n ('b, 'd) => float,\n) => float" - } - ] - }, - "stdlib/ordering": { - "id": "Stdlib.Ordering", - "name": "Ordering", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Ordering.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Ordering values represent the result of a comparison: `less`, `equal`, or `greater`." - ], - "signature": "type t = float" - }, - { - "id": "Stdlib.Ordering.less", - "kind": "value", - "name": "less", - "docstrings": [], - "signature": "let less: float" - }, - { - "id": "Stdlib.Ordering.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: float" - }, - { - "id": "Stdlib.Ordering.greater", - "kind": "value", - "name": "greater", - "docstrings": [], - "signature": "let greater: float" - }, - { - "id": "Stdlib.Ordering.isLess", - "kind": "value", - "name": "isLess", - "docstrings": [ - "`isLess(ordering)` returns `true` when `ordering` equals `Ordering.less`.\n\n## Examples\n\n```rescript\nOrdering.isLess(Ordering.less) == true\nOrdering.isLess(Ordering.equal) == false\n```" - ], - "signature": "let isLess: float => bool" - }, - { - "id": "Stdlib.Ordering.isEqual", - "kind": "value", - "name": "isEqual", - "docstrings": [ - "`isEqual(ordering)` returns `true` when `ordering` equals `Ordering.equal`.\n\n## Examples\n\n```rescript\nOrdering.isEqual(Ordering.equal) == true\nOrdering.isEqual(Ordering.greater) == false\n```" - ], - "signature": "let isEqual: float => bool" - }, - { - "id": "Stdlib.Ordering.isGreater", - "kind": "value", - "name": "isGreater", - "docstrings": [ - "`isGreater(ordering)` returns `true` when `ordering` equals `Ordering.greater`.\n\n## Examples\n\n```rescript\nOrdering.isGreater(Ordering.greater) == true\nOrdering.isGreater(Ordering.less) == false\n```" - ], - "signature": "let isGreater: float => bool" - }, - { - "id": "Stdlib.Ordering.invert", - "kind": "value", - "name": "invert", - "docstrings": [ - "`invert(ordering)` flips the ordering result (less becomes greater and vice versa).\n\n## Examples\n\n```rescript\nOrdering.invert(Ordering.less) == Ordering.greater\nOrdering.invert(Ordering.equal) == Ordering.equal\n```" - ], - "signature": "let invert: float => float" - }, - { - "id": "Stdlib.Ordering.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "`fromInt(n)` converts an integer comparison result into an ordering.\n\n## Examples\n\n```rescript\nOrdering.fromInt(-5) == Ordering.less\nOrdering.fromInt(0) == Ordering.equal\nOrdering.fromInt(3) == Ordering.greater\n```" - ], - "signature": "let fromInt: int => float" - }, - { - "id": "Stdlib.Ordering.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(ordering)` ignores the provided ordering and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/option": { - "id": "Stdlib.Option", - "name": "Option", - "docstrings": [ - "We represent the existence and nonexistence of a value by wrapping it with\nthe `option` type. In order to make it a bit more convenient to work with\noption-types, we provide utility-functions for it.\n\nThe `option` type is a part of the ReScript standard library which is defined\nlike this:\n\n```rescript\ntype option<'a> = None | Some('a)\n```\n\n```rescript\nlet someString: option = Some(\"hello\")\n```" - ], - "items": [ - { - "id": "Stdlib.Option.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an option of type 'a." - ], - "signature": "type t<'a> = option<'a> = None | Some('a)" - }, - { - "id": "Stdlib.Option.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(opt, f)` applies `f` to `opt`, if `f` returns `true`, then it returns `Some(value)`, otherwise returns `None`.\n\n## Examples\n\n```rescript\nOption.filter(Some(10), x => x > 5) // Some(10)\nOption.filter(Some(4), x => x > 5) // None\nOption.filter(None, x => x > 5) // None\n```" - ], - "signature": "let filter: (option<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Option.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(opt, f)` call `f` on `opt`. if `opt` is `Some(value)`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nOption.forEach(Some(\"thing\"), x => Console.log(x)) // logs \"thing\"\nOption.forEach(None, x => Console.log(x)) // returns ()\n```" - ], - "signature": "let forEach: (option<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Option.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(opt, ~message=?)` returns `value` if `opt` is `Some(value)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n```rescript\nOption.getExn(Some(3)) == 3\n\nswitch Option.getExn(None) {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n\nswitch Option.getExn(None, ~message=\"was None!\") {\n| exception _ => assert(true) // Throws a JsError with the message \"was None!\"\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an error if `opt` is `None`" - ], - "signature": "let getExn: (option<'a>, ~message: string=?) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Option.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(opt, ~message=?)` returns `value` if `opt` is `Some(value)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n```rescript\nOption.getOrThrow(Some(3)) == 3\n\nswitch Option.getOrThrow(None) {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n\nswitch Option.getOrThrow(None, ~message=\"was None!\") {\n| exception _ => assert(true) // Throws a JsError with the message \"was None!\"\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an error if `opt` is `None`" - ], - "signature": "let getOrThrow: (option<'a>, ~message: string=?) => 'a" - }, - { - "id": "Stdlib.Option.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(opt)` returns `value` if `opt` is `Some(value)`, otherwise `undefined`.\n\n## Examples\n\n```rescript\nOption.getUnsafe(Some(3)) == 3\nOption.getUnsafe((None: option)) // Returns `undefined`, which is not a valid `int`\n```\n\n## Notes\n\n- This is an unsafe operation. It assumes `value` is not `None`, and may cause undefined behaviour if it is." - ], - "signature": "let getUnsafe: option<'a> => 'a" - }, - { - "id": "Stdlib.Option.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(opt, default, f)` returns `f(value)` if `opt` is `Some(value)`, otherwise `default`.\n\n## Examples\n\n```rescript\nlet someValue = Some(3)\nsomeValue->Option.mapOr(0, x => x + 5) // 8\n\nlet noneValue = None\nnoneValue->Option.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (option<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Option.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (option<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Option.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(opt, f)` returns `Some(f(value))` if `opt` is `Some(value)`, otherwise `None`.\n\n## Examples\n\n```rescript\nOption.map(Some(3), x => x * x) // Some(9)\nOption.map(None, x => x * x) // None\n```" - ], - "signature": "let map: (option<'a>, 'a => 'b) => option<'b>" - }, - { - "id": "Stdlib.Option.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(opt, f)` returns `f(value)` if `opt` is `Some(value)`, otherwise `None`.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Some(value + 1)\n } else {\n None\n }\n\nOption.flatMap(Some(2), addIfAboveOne) // Some(3)\nOption.flatMap(Some(-4), addIfAboveOne) // None\nOption.flatMap(None, addIfAboveOne) // None\n```" - ], - "signature": "let flatMap: (option<'a>, 'a => option<'b>) => option<'b>" - }, - { - "id": "Stdlib.Option.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(opt, default)` returns `value` if `opt` is `Some(value)`, otherwise `default`.\n\n## Examples\n\n```rescript\nOption.getOr(None, \"Banana\") // Banana\nOption.getOr(Some(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nSome(\"Jane\")->greet // \"Greetings Jane\"\nNone->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (option<'a>, 'a) => 'a" - }, - { - "id": "Stdlib.Option.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (option<'a>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Option.orElse", - "kind": "value", - "name": "orElse", - "docstrings": [ - "`orElse(opt1, opt2)` returns `opt2` if `opt1` is `None`, otherwise `opt1`.\n\n## Examples\n\n```rescript\nOption.orElse(Some(1812), Some(1066)) == Some(1812)\nOption.orElse(None, Some(1066)) == Some(1066)\nOption.orElse(None, None) == None\n```" - ], - "signature": "let orElse: (option<'a>, option<'a>) => option<'a>" - }, - { - "id": "Stdlib.Option.isSome", - "kind": "value", - "name": "isSome", - "docstrings": [ - "`isSome(opt)` returns `true` if `opt` is `Some(value)`, otherwise returns `false`.\n\n## Examples\n\n```rescript\nOption.isSome(None) // false\nOption.isSome(Some(1)) // true\n```" - ], - "signature": "let isSome: option<'a> => bool" - }, - { - "id": "Stdlib.Option.isNone", - "kind": "value", - "name": "isNone", - "docstrings": [ - "`isNone(opt)` returns `true` if `opt` is `None`, false otherwise.\n\n## Examples\n\n```rescript\nOption.isNone(None) // true\nOption.isNone(Some(1)) // false\n```" - ], - "signature": "let isNone: option<'a> => bool" - }, - { - "id": "Stdlib.Option.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(opt1, opt2, f)` evaluates two optional values for equality with respect to a predicate function `f`. If both `opt1` and `opt2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, the predicate function `f` must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Option\n\nequal(Some(3), Some(15), clockEqual) // true\nequal(Some(3), None, clockEqual) // false\nequal(None, Some(3), clockEqual) // false\nequal(None, None, clockEqual) // true\n```" - ], - "signature": "let equal: (option<'a>, option<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.Option.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(opt1, opt2, f)` compares two optional values with respect to given `f`.\n\nIf both `opt1` and `opt2` are `None`, it returns `0.`. If the first argument is `Some(value1)` and the second is `None`, returns `1.` (something is greater than nothing).\n\nIf the first argument is `None` and the second is `Some(value2)`, returns `-1.`\n(nothing is less than something).\n\nIf the arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, `f` takes two arguments and returns `-1.` if the first\nargument is less than the second, `0.` if the arguments are equal, and `1.` if\nthe first argument is greater than the second.\n\n## Examples\n\n```rescript\nlet clockCompare = (a, b) => Int.compare(mod(a, 12), mod(b, 12))\n\nOption.compare(Some(3), Some(15), clockCompare) // 0.\nOption.compare(Some(3), Some(14), clockCompare) // 1.\nOption.compare(Some(2), Some(15), clockCompare) // (-1.)\nOption.compare(None, Some(15), clockCompare) // (-1.)\nOption.compare(Some(14), None, clockCompare) // 1.\nOption.compare(None, None, clockCompare) // 0.\n```" - ], - "signature": "let compare: (\n option<'a>,\n option<'b>,\n ('a, 'b) => Ordering.t,\n) => Ordering.t" - }, - { - "id": "Stdlib.Option.all", - "kind": "value", - "name": "all", - "docstrings": [ - "`all(options)` returns an option of array if all options are Some, otherwise returns None.\n\n## Examples\n\n```rescript\nOption.all([Some(1), Some(2), Some(3)]) // Some([1, 2, 3])\nOption.all([Some(1), None]) // None\n```" - ], - "signature": "let all: array> => option>" - }, - { - "id": "Stdlib.Option.all2", - "kind": "value", - "name": "all2", - "docstrings": [ - "`all2((o1, o2))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all2: ((option<'a>, option<'b>)) => option<('a, 'b)>" - }, - { - "id": "Stdlib.Option.all3", - "kind": "value", - "name": "all3", - "docstrings": [ - "`all3((o1, o2, o3))`. Like `all()`, but with a fixed size tuple of 3" - ], - "signature": "let all3: (\n (option<'a>, option<'b>, option<'c>),\n) => option<('a, 'b, 'c)>" - }, - { - "id": "Stdlib.Option.all4", - "kind": "value", - "name": "all4", - "docstrings": [ - "`all4((o1, o2, o3, o4))`. Like `all()`, but with a fixed size tuple of 4" - ], - "signature": "let all4: (\n (option<'a>, option<'b>, option<'c>, option<'d>),\n) => option<('a, 'b, 'c, 'd)>" - }, - { - "id": "Stdlib.Option.all5", - "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((o1, o2, o3, o4, o5))`. Like `all()`, but with a fixed size tuple of 5" - ], - "signature": "let all5: (\n (\n option<'a>,\n option<'b>,\n option<'c>,\n option<'d>,\n option<'e>,\n ),\n) => option<('a, 'b, 'c, 'd, 'e)>" - }, - { - "id": "Stdlib.Option.all6", - "kind": "value", - "name": "all6", - "docstrings": [ - "`all6((o1, o2, o3, o4, o5, o6))`. Like `all()`, but with a fixed size tuple of 6" - ], - "signature": "let all6: (\n (\n option<'a>,\n option<'b>,\n option<'c>,\n option<'d>,\n option<'e>,\n option<'f>,\n ),\n) => option<('a, 'b, 'c, 'd, 'e, 'f)>" - }, - { - "id": "Stdlib.Option.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(option)` ignores the provided option and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: option<'a> => unit" - } - ] - }, - "stdlib/object": { - "id": "Stdlib.Object", - "name": "Object", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Object.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make` create a new object that inherits the properties and methods from the standard built-in Object, such as `toString`. See [Object on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)\n\n## Examples\n\n```rescript\nlet x = Object.make()\nx->Object.keysToArray->Array.length // 0\nx->Object.get(\"toString\")->Option.isSome // true\n```" - ], - "signature": "let make: unit => {..}" - }, - { - "id": "Stdlib.Object.is", - "kind": "value", - "name": "is", - "docstrings": [ - "`is` determines if two objects are identical in all contexts. Objects, arrays, records, and other non-primitives are only identical if they reference the **exact** same object in memory. Primitives like ints, floats, and strings are identical if they have the same value. `+0` and `-0` are distinct. NaN is equal to itself. See [Object.is on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)\n\nIn most scenarios use `==` or `===` or the custom `equals` function (if provided) for the type.\n\n## Examples\n\n```rescript\nObject.is(25, 13) // false\nObject.is(\"abc\", \"abc\") // true\nObject.is(undefined, undefined) // true\nObject.is(undefined, null) // false\nObject.is(-0.0, 0.0) // false\nObject.is(list{1, 2}, list{1, 2}) // false\n\nObject.is([1, 2, 3], [1, 2, 3]) // false\n[1, 2, 3] == [1, 2, 3] // true\n[1, 2, 3] === [1, 2, 3] // false\n\nlet fruit = {\"name\": \"Apple\"}\nObject.is(fruit, fruit) // true\nObject.is(fruit, {\"name\": \"Apple\"}) // false\nfruit == {\"name\": \"Apple\"} // true\nfruit === {\"name\": \"Apple\"} // false\n```" - ], - "signature": "let is: ('a, 'a) => bool" - }, - { - "id": "Stdlib.Object.create", - "kind": "value", - "name": "create", - "docstrings": [ - "`create` creates a new object, using an existing object as the prototype of the new object. See [Object.create on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\n\n**Note:** ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object) and [records](https://rescript-lang.org/docs/manual/latest/record). This is often safer and more convenient than using `create` and other functions in this module.\n\n## Examples\n\n```rescript\nlet x = {\"fruit\": \"banana\"}\nlet y = Object.create(x)\ny->Object.get(\"fruit\") // Some(\"banana\")\n```" - ], - "signature": "let create: {..} => {..}" - }, - { - "id": "Stdlib.Object.createWithProperties", - "kind": "value", - "name": "createWithProperties", - "docstrings": [ - "`createWithProperties(proto, descriptors)` creates a new object that delegates to `proto` and defines additional properties using descriptor objects.\n\nSee [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) on MDN.\n\n## Examples\n\n```rescript\nlet proto = {\"kind\": \"fruit\"}\nlet obj = Object.createWithProperties(proto, {\"name\": {\"value\": \"banana\"}})\nobj->Object.get(\"name\") == Some(\"banana\")\nobj->Object.get(\"kind\") == Some(\"fruit\")\n```" - ], - "signature": "let createWithProperties: ({..}, {..}) => {..}" - }, - { - "id": "Stdlib.Object.createWithNull", - "kind": "value", - "name": "createWithNull", - "docstrings": [ - "`createWithNull()` creates an object with a `null` prototype (no inherited properties).\n\nSee [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) on MDN.\n\n## Examples\n\n```rescript\nlet obj = Object.createWithNull()\nobj->Object.get(\"toString\") == None\n```" - ], - "signature": "let createWithNull: unit => {..}" - }, - { - "id": "Stdlib.Object.createWithNullAndProperties", - "kind": "value", - "name": "createWithNullAndProperties", - "docstrings": [ - "`createWithNullAndProperties(descriptors)` creates an object with a `null` prototype and defines properties using descriptor objects.\n\nSee [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) on MDN.\n\n## Examples\n\n```rescript\nlet obj = Object.createWithNullAndProperties({\"name\": {\"value\": \"banana\"}})\nobj->Object.get(\"name\") == Some(\"banana\")\nobj->Object.get(\"toString\") == None\n```" - ], - "signature": "let createWithNullAndProperties: {..} => {..}" - }, - { - "id": "Stdlib.Object.assign", - "kind": "value", - "name": "assign", - "docstrings": [ - "`assign(target, source)` copies enumerable own properties from the source to the target, overwriting properties with the same name. It returns the modified target object. A deep clone is not created; properties are copied by reference.\n\n**Warning:** ReScript provides compile-time support for type-safe access to JavaScript objects. This eliminates common errors such as accessing properties that do not exist, or using a property of type x as if it were a y. Using `assign` can bypass these safety checks and lead to run-time errors (if you are not careful). ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object) and [records](https://rescript-lang.org/docs/manual/latest/record). This is often safer and more convenient than using `assign` and other functions in this module.\n\nSee [Object.assign on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) or [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign).\n\n## Examples\n\n```rescript\nObject.assign({\"a\": 1}, {\"a\": 2}) // {\"a\": 2}\nObject.assign({\"a\": 1, \"b\": 2}, {\"a\": 0}) // {\"a\": 0, \"b\": 2}\nObject.assign({\"a\": 1}, {\"a\": null}) // {\"a\": null}\n```" - ], - "signature": "let assign: ({..}, {..}) => {..}" - }, - { - "id": "Stdlib.Object.assignMany", - "kind": "value", - "name": "assignMany", - "docstrings": [ - "`assignMany(target, sources)` copies enumerable own properties from each source to the target, overwriting properties with the same name. Later sources' properties overwrite earlier ones. It returns the modified target object. A deep clone is not created; properties are copied by reference.\n\n**Note:** ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object), including spreading one object into another. This is often more convenient than using `assign` or `assignMany`. \n\nSee [Object.assign on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) or [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign)." - ], - "signature": "let assignMany: ({..}, array<{..}>) => {..}" - }, - { - "id": "Stdlib.Object.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(object)` creates a shallow copy of `object`.\n\nSee [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) on MDN.\n\n## Examples\n\n```rescript\nlet original = {\"name\": \"banana\"}\nlet cloned = Object.copy(original)\ncloned->Object.get(\"name\") == Some(\"banana\")\nObject.is(original, cloned) == false\n```" - ], - "signature": "let copy: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get` gets the value of a property by name. Returns `None` if the property does not exist or has the value `undefined`. Otherwise returns `Some`, including if the value is `null`.\n\n## Examples\n\n```rescript\n{\"a\": 1}->Object.get(\"a\") // Some(1)\n{\"a\": 1}->Object.get(\"b\") // None\n{\"a\": undefined}->Object.get(\"a\") // None\n{\"a\": null}->Object.get(\"a\") // Some(null)\n{\"a\": 1}->Object.get(\"toString\")->Option.isSome // true\n```" - ], - "signature": "let get: ({..}, string) => option<'a>" - }, - { - "id": "Stdlib.Object.getSymbol", - "kind": "value", - "name": "getSymbol", - "docstrings": [ - "`getSymbol` gets the value of a property by symbol. Returns `None` if the property does not exist or has the value `undefined`. Otherwise returns `Some`, including if the value is `null`.\n\n## Examples\n\n```rescript\nlet fruit = Symbol.make(\"fruit\")\nlet x = Object.make()\nx->Object.setSymbol(fruit, \"banana\")\nx->Object.getSymbol(fruit) == Some(\"banana\")\n```" - ], - "signature": "let getSymbol: ({..}, Symbol.t) => option<'a>" - }, - { - "id": "Stdlib.Object.getSymbolUnsafe", - "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [ - "`getSymbolUnsafe(object, key)` reads the value stored under the symbol `key` without any optional check.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet obj = Object.make()\nobj->Object.setSymbol(key, \"hello\")\nObject.getSymbolUnsafe(obj, key) == \"hello\"\n```" - ], - "signature": "let getSymbolUnsafe: ({..}, Symbol.t) => 'a" - }, - { - "id": "Stdlib.Object.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(name, value)` assigns a value to the named object property, overwriting the previous value if any. See [Working with Objects on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#objects_and_properties)\n\n## Examples\n\n```rescript\n{\"a\": 1}->Object.set(\"a\", 2) // {\"a\": 2}\n{\"a\": 1}->Object.set(\"a\", None) // {\"a\": None}\n{\"a\": 1}->Object.set(\"b\", 2) // {\"a\": 1, \"b\": 2}\n```" - ], - "signature": "let set: ({..}, string, 'a) => unit" - }, - { - "id": "Stdlib.Object.setSymbol", - "kind": "value", - "name": "setSymbol", - "docstrings": [ - "`setSymbol(object, key, value)` stores `value` under the symbol `key` on `object`.\n\nBeware this will *mutate* the object.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"count\")\nlet obj = Object.make()\nobj->Object.setSymbol(key, 5)\nObject.getSymbol(obj, key) == Some(5)\n```" - ], - "signature": "let setSymbol: ({..}, Symbol.t, 'a) => unit" - }, - { - "id": "Stdlib.Object.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "`keysToArray` returns an array of an object's own enumerable string-keyed property names. See [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.keys)\nor [Object.keys on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys).\n\n## Examples\n\n```rescript\n{\"a\": 1, \"b\": 2}->Object.keysToArray // [\"a\", \"b\"]\n{\"a\": None}->Object.keysToArray // [\"a\"]\nObject.make()->Object.keysToArray // []\n```" - ], - "signature": "let keysToArray: {..} => array" - }, - { - "id": "Stdlib.Object.hasOwnProperty", - "kind": "value", - "name": "hasOwnProperty", - "docstrings": [ - "`hasOwnProperty` determines whether the object has the specified property as its **own** property, as opposed to inheriting it. See [hasOwnProperty on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 2}\n{\"a\": 1}->Object.hasOwnProperty(\"a\") // true\n{\"a\": 1}->Object.hasOwnProperty(\"b\") // false\n{\"a\": 1}->Object.hasOwnProperty(\"toString\") // false\n```" - ], - "signature": "let hasOwnProperty: ({..}, string) => bool" - }, - { - "id": "Stdlib.Object.seal", - "kind": "value", - "name": "seal", - "docstrings": [ - "`seal` seals an object. Sealing an object prevents extensions and makes existing properties non-configurable. A sealed object has a fixed set of properties. Unlike `freeze`, values of existing properties can still be changed as long as they are writable.\n\n**Note:** `seal` returns the same object that was passed in; it does not create a copy. Any attempt to delete or add properties to a sealed object will fail, either silently or by throwing an error.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.seal) and [Object.seal on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 2}\npoint->Object.set(\"x\", -7) // succeeds\npoint->Object.seal->ignore\n\ntry {\n point->Object.set(\"z\", 9) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n\npoint->Object.set(\"x\", 13) // succeeds\n```" - ], - "signature": "let seal: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.preventExtensions", - "kind": "value", - "name": "preventExtensions", - "docstrings": [ - "`preventExtensions` prevents new properties from being added to the object. It modifies the object (rather than creating a copy) and returns it.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.preventextensions) and [Object.preventExtensions on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/preventExtensions)\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.set(\"b\", 2) // succeeds\nobj->Object.preventExtensions->ignore\ntry {\n obj->Object.set(\"c\", 3) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let preventExtensions: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.freeze", - "kind": "value", - "name": "freeze", - "docstrings": [ - "`freeze` freezes an object. Freezing an object makes existing properties non-writable and prevents extensions. Once an object is frozen, new properties cannot be be added, existing properties cannot be removed, and their values cannot be changed.\n\n**Note:** `freeze` returns the same object that was passed in; it does not create a frozen copy. Any attempt to change a frozen object will fail, either silently or by throwing an exception.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isfrozen) and [Object.isFrozen on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen).\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.set(\"a\", 2) // succeeds\nobj->Object.freeze->ignore\n\ntry {\n obj->Object.set(\"a\", 3) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let freeze: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.isSealed", - "kind": "value", - "name": "isSealed", - "docstrings": [ - "`isSealed` determines if an object is sealed. A sealed object has a fixed set of properties.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.issealed) and [Object.isSealed on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 3}->Object.seal\nlet pointIsSealed = point->Object.isSealed // true\nlet fruit = {\"name\": \"Apple\"}\nlet fruitIsSealed = fruit->Object.isSealed // false\n```" - ], - "signature": "let isSealed: 'a => bool" - }, - { - "id": "Stdlib.Object.isFrozen", - "kind": "value", - "name": "isFrozen", - "docstrings": [ - "`isFrozen` determines if an object is frozen. An object is frozen if an only if it is not extensible, all its properties are non-configurable, and all its data properties are non-writable.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isfrozen) and [Object.isFrozen on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen).\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 3}->Object.freeze\nlet pointIsFrozen = point->Object.isFrozen // true\nlet fruit = {\"name\": \"Apple\"}\nlet fruitIsFrozen = fruit->Object.isFrozen // false\n```" - ], - "signature": "let isFrozen: 'a => bool" - }, - { - "id": "Stdlib.Object.isExtensible", - "kind": "value", - "name": "isExtensible", - "docstrings": [ - "`isExtensible` determines if an object is extensible (whether it can have new properties added to it).\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isextensible) and [Object.isExtensible on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible)\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.isExtensible // true\nobj->Object.preventExtensions->ignore\nobj->Object.isExtensible // false\n```" - ], - "signature": "let isExtensible: 'a => bool" - }, - { - "id": "Stdlib.Object.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(object)` ignores the provided object and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: {..} => unit" - } - ] - }, - "stdlib/nullable": { - "id": "Stdlib.Nullable", - "name": "Nullable", - "docstrings": [ - "Functions for handling nullable values.\n\nPrimarily useful when interoping with JavaScript when you don't know whether you'll get a value, `null` or `undefined`." - ], - "items": [ - { - "id": "Stdlib.Nullable.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a nullable value.\nA nullable value can be the value `'a`, `null` or `undefined`." - ], - "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined" - }, - { - "id": "Stdlib.Nullable.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The value `null`.\n\nSee [`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null) on MDN.\n\n## Examples\n```rescript\nConsole.log(Nullable.null) // Logs `null` to the console.\n```" - ], - "signature": "let null: t<'a>" - }, - { - "id": "Stdlib.Nullable.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The value `undefined`.\n\nSee [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/undefined) on MDN.\n\n## Examples\n```rescript\nConsole.log(undefined) // Logs `undefined` to the console.\n```" - ], - "signature": "let undefined: t<'a>" - }, - { - "id": "Stdlib.Nullable.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [ - "`isNullable(a)` returns `true` if `a` is null or undefined, `false` otherwise.\n\n## Examples\n\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Check if asNullable is not null or undefined\nswitch asNullable->Nullable.isNullable {\n| true => assert(false)\n| false => assert(true)\n}\n```" - ], - "signature": "let isNullable: t<'a> => bool" - }, - { - "id": "Stdlib.Nullable.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new nullable value from the provided value.\nThis means the compiler will enforce null checks for the new value.\n\n## Examples\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Need to do this\nswitch asNullable->Nullable.toOption {\n| Some(value) if value == myStr => Console.log(\"Yay, values matched!\")\n| _ => Console.log(\"Values did not match.\")\n}\n```" - ], - "signature": "let make: 'a => t<'a>" - }, - { - "id": "Stdlib.Nullable.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.Nullable.compare", - "kind": "value", - "name": "compare", - "docstrings": [], - "signature": "let compare: (t<'a>, t<'b>, ('a, 'b) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.Nullable.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Converts a nullable value into an option, so it can be pattern matched on.\nWill convert both `null` and `undefined` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullableString = Nullable.make(\"Hello\")\n\nswitch nullableString->Nullable.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```" - ], - "signature": "let toOption: t<'a> => option<'a>" - }, - { - "id": "Stdlib.Nullable.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Turns an `option` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet optString = Some(\"Hello\")\nlet asNullable = optString->Nullable.fromOption // Nullable.t\n```" - ], - "signature": "let fromOption: option<'a> => t<'a>" - }, - { - "id": "Stdlib.Nullable.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(value, default)` returns `value` if not `null` or `undefined`,\notherwise return `default`.\n\n## Examples\n\n```rescript\nNullable.getOr(Nullable.null, \"Banana\") // Banana\nNullable.getOr(Nullable.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNullable.make(\"Jane\")->Nullable.toOption->greet // \"Greetings Jane\"\nNullable.null->Nullable.toOption->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (t<'a>, 'a) => 'a" - }, - { - "id": "Stdlib.Nullable.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Nullable.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getExn(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getExn(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`" - ], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Nullable.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getOrThrow(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getOrThrow(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`" - ], - "signature": "let getOrThrow: t<'a> => 'a" - }, - { - "id": "Stdlib.Nullable.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNullable.getUnsafe(Nullable.make(3)) == 3\nNullable.getUnsafe(Nullable.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null` or `undefined`." - ], - "signature": "let getUnsafe: t<'a> => 'a" - }, - { - "id": "Stdlib.Nullable.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(value, f)` call `f` on `value`. if `value` is not `null` or `undefined`,\nthen if calls `f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNullable.forEach(Nullable.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNullable.forEach(Nullable.null, x => Console.log(x)) // returns ()\nNullable.forEach(undefined, x => Console.log(x)) // returns ()\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Nullable.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nNullable.map(Nullable.make(3), x => x * x) // Nullable.make(9)\nNullable.map(undefined, x => x * x) // undefined\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Nullable.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`\nor `undefined`, otherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Nullable.make(3)\nsomeValue->Nullable.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Nullable.null\nnoneValue->Nullable.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (t<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Nullable.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (t<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Nullable.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Nullable.make(value + 1)\n } else {\n Nullable.null\n }\n\nNullable.flatMap(Nullable.make(2), addIfAboveOne) // Nullable.make(3)\nNullable.flatMap(Nullable.make(-4), addIfAboveOne) // undefined\nNullable.flatMap(Nullable.null, addIfAboveOne) // undefined\n```" - ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Nullable.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(nullable)` ignores the provided nullable and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/null": { - "id": "Stdlib.Null", - "name": "Null", - "docstrings": [ - "Functions for handling values that could be `null`.\n\nIf you also need to cover `undefined`, check out `Nullable` instead." - ], - "items": [ - { - "id": "Stdlib.Null.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a value that can be either `'a` or `null`." - ], - "signature": "@unboxed\ntype t<'a> = null<'a> =\n | Value('a)\n | @as(null) Null" - }, - { - "id": "Stdlib.Null.asNullable", - "kind": "value", - "name": "asNullable", - "docstrings": [ - "Converts a `Null.t` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet nullValue = Null.make(\"Hello\")\nlet asNullable = nullValue->Null.asNullable // Nullable.t\n```" - ], - "signature": "let asNullable: t<'a> => Nullable.t<'a>" - }, - { - "id": "Stdlib.Null.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The value `null`.\n\nSee [`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null) on MDN.\n\n## Examples\n```rescript\nConsole.log(null) // Logs `null` to the console.\n```" - ], - "signature": "let null: t<'a>" - }, - { - "id": "Stdlib.Null.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Null.t` from the provided value.\nThis means the compiler will enforce null checks for the new value.\n\n## Examples\n```rescript\nlet myStr = \"Hello\"\nlet asNullValue = myStr->Null.make // The compiler now thinks this can be `string` or `null`.\n```" - ], - "signature": "let make: 'a => t<'a>" - }, - { - "id": "Stdlib.Null.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(a, b, eq)` checks if `a` and `b` are equal.\nIf both are `Null.Value`, it will use function `eq` to check if the values are equal.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\nNull.equal(a, b, Int.equal) == false\nNull.equal(a, c, Int.equal) == false\nNull.equal(Null.null, Null.null, Int.equal) == true\n```" - ], - "signature": "let equal: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.Null.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(a, b, cmp)` compares `a` and `b`.\nIf both are `Null.Value`, it will use function `cmp` to compare the values.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\n// A value is greater than null\nNull.compare(a, b, Int.compare) == Ordering.greater\n// A value is less than null\nNull.compare(b, a, Int.compare) == Ordering.less\n// A null is equal to null\nNull.compare(Null.null, Null.null, Int.compare) == Ordering.equal\n// The compare function is used if both are `Null.Value`\nNull.compare(a, c, Int.compare) == Ordering.less\n```" - ], - "signature": "let compare: (t<'a>, t<'b>, ('a, 'b) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.Null.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Converts a nullable value into an option, so it can be pattern matched on.\nWill convert `null` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullStr = Null.make(\"Hello\")\n\nswitch nullStr->Null.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```" - ], - "signature": "let toOption: t<'a> => option<'a>" - }, - { - "id": "Stdlib.Null.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Turns an `option` into a `Null.t`. `None` will be converted to `null`.\n\n## Examples\n```rescript\nlet optString: option = None\nlet asNull = optString->Null.fromOption // Null.t\nConsole.log(asNull == Null.null) // Logs `true` to the console.\n```" - ], - "signature": "let fromOption: option<'a> => t<'a>" - }, - { - "id": "Stdlib.Null.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(value, default)` returns `value` if not `null`, otherwise return\n`default`.\n\n## Examples\n\n```rescript\nNull.getOr(Null.null, \"Banana\") // Banana\nNull.getOr(Null.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNull.make(\"Jane\")->Null.toOption->greet // \"Greetings Jane\"\nNull.null->Null.toOption->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (t<'a>, 'a) => 'a" - }, - { - "id": "Stdlib.Null.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Null.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getExn(Null.make(3)) == 3\n\nswitch Null.getExn(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`" - ], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Null.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getOrThrow(Null.make(3)) == 3\n\nswitch Null.getOrThrow(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`" - ], - "signature": "let getOrThrow: t<'a> => 'a" - }, - { - "id": "Stdlib.Null.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNull.getUnsafe(Null.make(3)) == 3\nNull.getUnsafe(Null.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null`." - ], - "signature": "let getUnsafe: t<'a> => 'a" - }, - { - "id": "Stdlib.Null.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(value, f)` call `f` on `value`. if `value` is not `null`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNull.forEach(Null.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNull.forEach(Null.null, x => Console.log(x)) // logs nothing\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Null.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(value, f)` returns `f(value)` if `value` is not `null`, otherwise returns\n`value` unchanged.\n\n## Examples\n\n```rescript\nNull.map(Null.make(3), x => x * x) // Null.make(9)\nNull.map(Null.null, x => x * x) // null\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Null.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`,\notherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Null.make(3)\nsomeValue->Null.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Null.null\nnoneValue->Null.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (t<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Null.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (t<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Null.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(value, f)` returns `f(value)` if `value` is not `null`, otherwise\nreturns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Null.make(value + 1)\n } else {\n Null.null\n }\n\nNull.flatMap(Null.make(2), addIfAboveOne) // Null.make(3)\nNull.flatMap(Null.make(-4), addIfAboveOne) // null\nNull.flatMap(Null.null, addIfAboveOne) // null\n```" - ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Null.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(null)` ignores the provided null and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/math": { - "id": "Stdlib.Math", - "name": "Math", - "docstrings": [ - "Functions for interacting with JavaScript Math.\nSee: [`Math`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math)." - ], - "items": [ - { - "id": "Stdlib.Math.abs", - "kind": "value", - "name": "abs", - "docstrings": [ - "`abs(v)` returns absolute value of `v`.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n## Examples\n\n```rescript\nMath.abs(-2.0) == 2.0\nMath.abs(3.0) == 3.0\n```" - ], - "signature": "let abs: float => float" - }, - { - "id": "Stdlib.Math.acos", - "kind": "value", - "name": "acos", - "docstrings": [ - "`acos(v)` returns arccosine (in radians) of argument `v`, returns `NaN` if the\nargument is outside the range \\[-1.0, 1.0\\].\nSee [`Math.acos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acos) on MDN.\n\n## Examples\n\n```rescript\nMath.acos(-1.0) == 3.141592653589793\nMath.acos(-3.0)->Float.isNaN == true\n```" - ], - "signature": "let acos: float => float" - }, - { - "id": "Stdlib.Math.acosh", - "kind": "value", - "name": "acosh", - "docstrings": [ - "`acosh(v)` returns the inverse hyperbolic arccosine (in radians) of argument `v`,\nreturns `NaN` if the argument is less than `1.0`.\nSee [`Math.acosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acosh) on MDN.\n\n## Examples\n\n```rescript\nMath.acosh(1.0) == 0.0\nMath.acosh(0.5)->Float.isNaN == true\n```" - ], - "signature": "let acosh: float => float" - }, - { - "id": "Stdlib.Math.asin", - "kind": "value", - "name": "asin", - "docstrings": [ - "`asin(v)` returns the inverse sine (in radians) of argument `v`, returns `NaN`\nif the argument `v` is outside the range \\[-1.0, 1.0\\].\nSee [`Math.asin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asin) on MDN.\n\n## Examples\n\n```rescript\nMath.asin(-1.0) == -1.5707963267948966\nMath.asin(-2.0)->Float.isNaN == true\n```" - ], - "signature": "let asin: float => float" - }, - { - "id": "Stdlib.Math.asinh", - "kind": "value", - "name": "asinh", - "docstrings": [ - "`asinh(v)` returns the inverse hyperbolic sine of argument `v`.\nSee [`Math.asinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh) on MDN.\n\n## Examples\n\n```rescript\nMath.asinh(-1.0) == -0.881373587019543\nMath.asinh(-0.0) == -0.0\n```" - ], - "signature": "let asinh: float => float" - }, - { - "id": "Stdlib.Math.atan", - "kind": "value", - "name": "atan", - "docstrings": [ - "`atan(v)` returns the inverse tangent (in radians) of argument `v`.\nSee [`Math.atan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan) on MDN.\n\n## Examples\n\n```rescript\nMath.atan(-0.0) == -0.0\nMath.atan(0.0) == 0.0\nMath.atan(1.0) == 0.7853981633974483\n```" - ], - "signature": "let atan: float => float" - }, - { - "id": "Stdlib.Math.atanh", - "kind": "value", - "name": "atanh", - "docstrings": [ - "`atanh(v)` returns the invert hyperbolic tangent of argument `v`. Returns `NaN`\nif the argument `v` is is outside the range \\[-1.0, 1.0\\] and `Infinity` if `v`\nis `-1.0` or `1.0`.\nSee [`Math.atanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh) on MDN.\n\n## Examples\n\n```rescript\nMath.atanh(-2.0)->Float.isNaN == true\nMath.atanh(-1.0)->Float.isFinite == false\nMath.atanh(-0.0) == -0.0\nMath.atanh(0.0) == 0.0\nMath.atanh(0.5) == 0.5493061443340548\n```" - ], - "signature": "let atanh: float => float" - }, - { - "id": "Stdlib.Math.atan2", - "kind": "value", - "name": "atan2", - "docstrings": [ - "`atan2(~y, ~x)` returns the angle (in radians) of the quotient `y /. x`. It is\nalso the angle between the *x*\\-axis and point (*x*, *y*).\nSee [`Math.atan2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2) on MDN.\n\n## Examples\n\n```rescript\nMath.atan2(~y=0.0, ~x=10.0) == 0.0\nMath.atan2(~x=5.0, ~y=5.0) == Math.Constants.pi /. 4.0\nMath.atan2(~x=90.0, ~y=15.0) == 0.16514867741462683\nMath.atan2(~x=15.0, ~y=90.0) == 1.4056476493802699\n```" - ], - "signature": "let atan2: (~y: float, ~x: float) => float" - }, - { - "id": "Stdlib.Math.cbrt", - "kind": "value", - "name": "cbrt", - "docstrings": [ - "`cbrt(v)` returns the cube root of argument `v`.\nSee [`Math.cbrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt) on MDN.\n\n## Examples\n\n```rescript\nMath.cbrt(-1.0) == -1.0\nMath.cbrt(-0.0) == -0.0\nMath.cbrt(0.0) == 0.0\n```" - ], - "signature": "let cbrt: float => float" - }, - { - "id": "Stdlib.Math.ceil", - "kind": "value", - "name": "ceil", - "docstrings": [ - "`ceil(v)` returns the smallest integral value greater than or equal to the\nargument `v`. The result is a `float` and is not restricted to the `int` data\ntype range.\nSee [`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil) on MDN.\n\n## Examples\n\n```rescript\nMath.ceil(3.1) == 4.0\nMath.ceil(3.0) == 3.0\nMath.ceil(-3.1) == -3.0\nMath.ceil(2_150_000_000.3) == 2_150_000_001.0\n```" - ], - "signature": "let ceil: float => float" - }, - { - "id": "Stdlib.Math.cos", - "kind": "value", - "name": "cos", - "docstrings": [ - "`cos(v)` returns the cosine of argument `v`, which must be specified in radians.\nSee [`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos) on MDN.\n\n## Examples\n\n```rescript\nMath.cos(-0.0) == 1.0\nMath.cos(0.0) == 1.0\nMath.cos(1.0) == 0.5403023058681398\n```" - ], - "signature": "let cos: float => float" - }, - { - "id": "Stdlib.Math.cosh", - "kind": "value", - "name": "cosh", - "docstrings": [ - "`cosh(v)` returns the hyperbolic cosine of argument `v`, which must be specified\nin radians.\nSee [`Math.cosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh) on MDN.\n\n## Examples\n\n```rescript\nMath.cosh(-1.0) == 1.5430806348152437\nMath.cosh(-0.0) == 1.0\nMath.cosh(0.0) == 1.0\n```" - ], - "signature": "let cosh: float => float" - }, - { - "id": "Stdlib.Math.exp", - "kind": "value", - "name": "exp", - "docstrings": [ - "`exp(v)` returns natural exponentional, returns *e* (the base of natural logarithms)\nto the power of the given argument `v`.\nSee [`Math.exp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/exp) on MDN.\n\n## Examples\n\n```rescript\nMath.exp(-1.0) == 0.36787944117144233\nMath.exp(0.0) == 1.0\n```" - ], - "signature": "let exp: float => float" - }, - { - "id": "Stdlib.Math.expm1", - "kind": "value", - "name": "expm1", - "docstrings": [ - "`expm1(v)` returns *e* (the base of natural logarithms) to the power of the given\nargument `v` minus 1.\nSee [`Math.expm1`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1) on MDN.\n\n## Examples\n\n```rescript\nMath.expm1(-1.0) == -0.6321205588285577\nMath.expm1(-0.0) == -0.0\n```" - ], - "signature": "let expm1: float => float" - }, - { - "id": "Stdlib.Math.floor", - "kind": "value", - "name": "floor", - "docstrings": [ - "`floor(v)` returns the largest integral value less than or equal to the argument\n`v`. The result is a `float` and is not restricted to the `int` data type range.\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor) on MDN.\n\n## Examples\n\n```rescript\nMath.floor(-45.95) == -46.0\nMath.floor(-45.05) == -46.0\nMath.floor(-0.0) == -0.0\n```" - ], - "signature": "let floor: float => float" - }, - { - "id": "Stdlib.Math.fround", - "kind": "value", - "name": "fround", - "docstrings": [ - "`fround(v)` returns the nearest single precision float.\nSee [`Math.fround`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround) on MDN.\n\n## Examples\n\n```rescript\nMath.fround(5.5) == 5.5\nMath.fround(5.05) == 5.050000190734863\n```" - ], - "signature": "let fround: float => float" - }, - { - "id": "Stdlib.Math.hypot", - "kind": "value", - "name": "hypot", - "docstrings": [ - "`hypot(a, b)` returns the square root of the sum of squares of its two arguments\n(the Pythagorean formula).\nSee [`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot) on MDN.\n\n## Examples\n\n```rescript\nMath.hypot(3.0, 4.0) == 5.0\nMath.hypot(3.0, 5.0) == 5.8309518948453\n```" - ], - "signature": "let hypot: (float, float) => float" - }, - { - "id": "Stdlib.Math.hypotMany", - "kind": "value", - "name": "hypotMany", - "docstrings": [ - "`hypotMany(arr)` returns the square root of the sum of squares of the numbers in\nthe array argument (generalized Pythagorean equation). Using an array allows you\nto have more than two items. If `arr` is an empty array then returns `0.0`.\nSee [`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot) on MDN.\n\n## Examples\n\n```rescript\nMath.hypotMany([3.0, 4.0, 5.0]) == 7.0710678118654755\nMath.hypotMany([]) == 0.0\n```" - ], - "signature": "let hypotMany: array => float" - }, - { - "id": "Stdlib.Math.log", - "kind": "value", - "name": "log", - "docstrings": [ - "`log(v)` returns the natural logarithm of argument `v`, this is the number *x*\nsuch that `e^x` equals the argument. Returns `NaN` for negative arguments and\n`Infinity` for `0.0` or `-0.0`.\nSee [`Math.log`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log) on MDN.\n\n## Examples\n\n```rescript\nMath.log(-1.0)->Float.isNaN == true\nMath.log(-0.0)->Float.isFinite == false\nMath.log(0.0)->Float.isFinite == false\nMath.log(1.0) == 0.0\n```" - ], - "signature": "let log: float => float" - }, - { - "id": "Stdlib.Math.log1p", - "kind": "value", - "name": "log1p", - "docstrings": [ - "`log1p(v)` returns the natural logarithm of one plus the argument `v`.\nReturns `NaN` for arguments less than `-1` and `Infinity` if `v` is `-1.0`.\nSee [`Math.log1p`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log1p) on MDN.\n\n## Examples\n\n```rescript\nMath.log1p(-2.0)->Float.isNaN == true\nMath.log1p(-1.0)->Float.isFinite == false\nMath.log1p(-0.0) == -0.0\n```" - ], - "signature": "let log1p: float => float" - }, - { - "id": "Stdlib.Math.log10", - "kind": "value", - "name": "log10", - "docstrings": [ - "`log10(v)` returns the base 10 logarithm of argument `v`. Returns `NaN` for\nnegative `v`. If `v` is `-0.0` or `0.0` returns `Infinity`.\nSee [`Math.log10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log10) on MDN.\n\n## Examples\n\n```rescript\nMath.log10(-2.0)->Float.isNaN == true\nMath.log10(-0.0)->Float.isFinite == false\nMath.log10(0.0)->Float.isFinite == false\nMath.log10(1.0) == 0.0\n```" - ], - "signature": "let log10: float => float" - }, - { - "id": "Stdlib.Math.log2", - "kind": "value", - "name": "log2", - "docstrings": [ - "`log2(v)` returns the base 2 logarithm of argument `v`. Returns `NaN` for\nnegative `v` and `Infinity` if `v` is `-0.0` or `0.0`.\nSee [`Math.log2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2) on MDN.\n\n## Examples\n\n```rescript\nMath.log2(-2.0)->Float.isNaN == true\nMath.log2(-0.0)->Float.isFinite == false\nMath.log2(0.0)->Float.isFinite == false\nMath.log2(1.0) == 0.0\n```" - ], - "signature": "let log2: float => float" - }, - { - "id": "Stdlib.Math.min", - "kind": "value", - "name": "min", - "docstrings": [ - "`min(a, b)` returns the minimum of its two float arguments.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n## Examples\n\n```rescript\nMath.min(1.0, 2.0) == 1.0\nMath.min(-1.0, -2.0) == -2.0\n```" - ], - "signature": "let min: (float, float) => float" - }, - { - "id": "Stdlib.Math.minMany", - "kind": "value", - "name": "minMany", - "docstrings": [ - "`minMany(arr)` returns the minimum of the float in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n## Examples\n\n```rescript\nMath.minMany([1.0, 2.0]) == 1.0\nMath.minMany([-1.0, -2.0]) == -2.0\nMath.minMany([])->Float.isFinite == false\n```" - ], - "signature": "let minMany: array => float" - }, - { - "id": "Stdlib.Math.max", - "kind": "value", - "name": "max", - "docstrings": [ - "`max(a, b)` returns the maximum of its two float arguments.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n## Examples\n\n```rescript\nMath.max(1.0, 2.0) == 2.0\nMath.max(-1.0, -2.0) == -1.0\n```" - ], - "signature": "let max: (float, float) => float" - }, - { - "id": "Stdlib.Math.maxMany", - "kind": "value", - "name": "maxMany", - "docstrings": [ - "`maxMany(arr)` returns the maximum of the float in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n## Examples\n\n```rescript\nMath.maxMany([1.0, 2.0]) == 2.0\nMath.maxMany([-1.0, -2.0]) == -1.0\nMath.maxMany([])->Float.isFinite == false\n```" - ], - "signature": "let maxMany: array => float" - }, - { - "id": "Stdlib.Math.pow", - "kind": "value", - "name": "pow", - "docstrings": [ - "`pow(a, ~exp)` throws the given base `a` to the given exponent `exp`.\nSee [`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow) on MDN.\n\n## Examples\n\n```rescript\nMath.pow(2.0, ~exp=4.0) == 16.0\nMath.pow(3.0, ~exp=4.0) == 81.0\n```" - ], - "signature": "let pow: (float, ~exp: float) => float" - }, - { - "id": "Stdlib.Math.random", - "kind": "value", - "name": "random", - "docstrings": [ - "`random()` returns a random number in the half-closed interval \\[0,1\\].\nSee [`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random) on MDN.\n\n## Examples\n\n```rescript\nMath.random()\n```" - ], - "signature": "let random: unit => float" - }, - { - "id": "Stdlib.Math.round", - "kind": "value", - "name": "round", - "docstrings": [ - "`round(v)` returns then value of `v` rounded to nearest integral value\n(expressed as a float). If the fractional portion of the argument `v` is greater\nthan `0.5`, the argument `v` is rounded to the float with the next higher\nabsolute value.\nSee [`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round) on MDN.\n\n## Examples\n\n```rescript\nMath.round(-20.5) == -20.0\nMath.round(-0.1) == -0.0\nMath.round(0.0) == 0.0\nMath.round(-0.0) == -0.0\n```" - ], - "signature": "let round: float => float" - }, - { - "id": "Stdlib.Math.sign", - "kind": "value", - "name": "sign", - "docstrings": [ - "`sign(v)` returns the sign of its foat argument: `-1` if negative, `0` if\nzero, `1` if positive.\nSee [`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign) on MDN.\n\n## Examples\n\n```rescript\nMath.sign(3.0) == 1.0\nMath.sign(-3.0) == -1.0\nMath.sign(0.0) == 0.0\n```" - ], - "signature": "let sign: float => float" - }, - { - "id": "Stdlib.Math.sin", - "kind": "value", - "name": "sin", - "docstrings": [ - "`sin(v)` returns the sine of argument `v`, which must be specified in radians.\nSee [`Math.sin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin) on MDN.\n\n## Examples\n\n```rescript\nMath.sin(-0.0) == -0.0\nMath.sin(0.0) == 0.0\nMath.sin(1.0) == 0.8414709848078965\n```" - ], - "signature": "let sin: float => float" - }, - { - "id": "Stdlib.Math.sinh", - "kind": "value", - "name": "sinh", - "docstrings": [ - "`sinh(v)` returns then hyperbolic sine of argument `v`, which must be specified\nin radians.\nSee [`Math.sinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sinh) on MDN.\n\n## Examples\n\n```rescript\nMath.sinh(-0.0) == -0.0\nMath.sinh(0.0) == 0.0\nMath.sinh(1.0) == 1.1752011936438014\n```" - ], - "signature": "let sinh: float => float" - }, - { - "id": "Stdlib.Math.sqrt", - "kind": "value", - "name": "sqrt", - "docstrings": [ - "`sqrt(v)` returns the square root of `v`. If `v` is negative returns `NaN`.\nSee [`Math.sqrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt) on MDN.\n\n## Examples\n\n```rescript\nMath.sqrt(-1.0)->Float.isNaN == true\nMath.sqrt(-0.0) == -0.0\nMath.sqrt(0.0) == 0.0\nMath.sqrt(1.0) == 1.0\nMath.sqrt(9.0) == 3.0\n```" - ], - "signature": "let sqrt: float => float" - }, - { - "id": "Stdlib.Math.tan", - "kind": "value", - "name": "tan", - "docstrings": [ - "`tan(v)` returns the tangent of argument `v`, which must be specified in\nradians. Returns `NaN` if `v` is positive `Infinity` or negative `Infinity`.\nSee [`Math.tan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tan) on MDN.\n\n## Examples\n\n```rescript\nMath.tan(-0.0) == -0.0\nMath.tan(0.0) == 0.0\nMath.tan(1.0) == 1.5574077246549023\n```" - ], - "signature": "let tan: float => float" - }, - { - "id": "Stdlib.Math.tanh", - "kind": "value", - "name": "tanh", - "docstrings": [ - "`tanh(v)` returns the hyperbolic tangent of argument `v`, which must be\nspecified in radians.\nSee [`Math.tanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tanh) on MDN.\n\n## Examples\n\n```rescript\nMath.tanh(-0.0) == -0.0\nMath.tanh(0.0) == 0.0\nMath.tanh(1.0) == 0.7615941559557649\n```" - ], - "signature": "let tanh: float => float" - }, - { - "id": "Stdlib.Math.trunc", - "kind": "value", - "name": "trunc", - "docstrings": [ - "`trunc(v)` truncates the argument `v`, i.e., removes fractional digits.\nSee [`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc) on MDN.\n\n## Examples\n\n```rescript\nMath.trunc(0.123) == 0.0\nMath.trunc(1.999) == 1.0\nMath.trunc(13.37) == 13.0\nMath.trunc(42.84) == 42.0\n```" - ], - "signature": "let trunc: float => float" - } - ] - }, - "stdlib/list": { - "id": "Stdlib.List", - "name": "List", - "docstrings": [], - "items": [ - { - "id": "Stdlib.List.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Collection functions for manipulating the `list` data structures, a singly-linked list.\n\n**Prefer Array** if you need any of the following:\n\n- Random access of element\n- Better interop with JavaScript\n- Better memory usage & performance." - ], - "signature": "type t<'a> = list<'a>" - }, - { - "id": "Stdlib.List.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(list)` returns the length of `list`.\n\n## Examples\n\n```rescript\nList.length(list{1, 2, 3}) == 3\n```" - ], - "signature": "let length: list<'a> => int" - }, - { - "id": "Stdlib.List.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(list)`. See [`length`](#length)\n\n## Examples\n\n```rescript\nList.size(list{1, 2, 3}) == 3\n```" - ], - "signature": "let size: list<'a> => int" - }, - { - "id": "Stdlib.List.head", - "kind": "value", - "name": "head", - "docstrings": [ - "`head(list)` returns `Some(value)` where `value` is the first element in the\nlist, or `None` if `list` is an empty list.\n\n## Examples\n\n```rescript\nList.head(list{}) == None\nList.head(list{1, 2, 3}) == Some(1)\n```" - ], - "signature": "let head: list<'a> => option<'a>" - }, - { - "id": "Stdlib.List.headExn", - "kind": "value", - "name": "headExn", - "docstrings": [ - "`headExn(list)` same as [`head`](#head).\n\n## Examples\n\n```rescript\nList.headExn(list{1, 2, 3}) == 1\n\nswitch List.headExn(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let headExn: list<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.List.headOrThrow", - "kind": "value", - "name": "headOrThrow", - "docstrings": [ - "`headOrThrow(list)` same as [`head`](#head).\n\n## Examples\n\n```rescript\nList.headOrThrow(list{1, 2, 3}) == 1\n\nswitch List.headOrThrow(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let headOrThrow: list<'a> => 'a" - }, - { - "id": "Stdlib.List.tail", - "kind": "value", - "name": "tail", - "docstrings": [ - "`tail(list)` returns `None` if `list` is empty, otherwise it returns `Some(tail)`\nwhere `tail` is everything except the first element of `list`.\n\n## Examples\n\n```rescript\nList.tail(list{1, 2, 3}) == Some(list{2, 3})\n\nList.tail(list{}) == None\n```" - ], - "signature": "let tail: list<'a> => option>" - }, - { - "id": "Stdlib.List.tailExn", - "kind": "value", - "name": "tailExn", - "docstrings": [ - "`tailExn(list)` same as [`tail`](#tail).\n\n## Examples\n\n```rescript\nList.tailExn(list{1, 2, 3}) == list{2, 3}\n\nswitch List.tailExn(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let tailExn: list<'a> => list<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.List.tailOrThrow", - "kind": "value", - "name": "tailOrThrow", - "docstrings": [ - "`tailOrThrow(list)` same as [`tail`](#tail).\n\n## Examples\n\n```rescript\nList.tailOrThrow(list{1, 2, 3}) == list{2, 3}\n\nswitch List.tailOrThrow(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let tailOrThrow: list<'a> => list<'a>" - }, - { - "id": "Stdlib.List.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(list, value)` adds a `value` to the beginning of list `list`.\n\n## Examples\n\n```rescript\nList.add(list{2, 3}, 1) == list{1, 2, 3}\n\nList.add(list{\"World\", \"!\"}, \"Hello\") == list{\"Hello\", \"World\", \"!\"}\n```" - ], - "signature": "let add: (list<'a>, 'a) => list<'a>" - }, - { - "id": "Stdlib.List.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(list, index)` return the `index` element in `list`, or `None` if `index`\nis larger than the length of list `list`.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.get(1) == Some(\"B\")\n\nabc->List.get(4) == None\n```" - ], - "signature": "let get: (list<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.List.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(list, index)` same as [`get`](#get).\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.getExn(1) == \"B\"\n\nswitch abc->List.getExn(4) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if `index` is larger than the length of list." - ], - "signature": "let getExn: (list<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.List.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(list, index)` same as [`get`](#get).\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.getOrThrow(1) == \"B\"\n\nswitch abc->List.getOrThrow(4) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if `index` is larger than the length of list." - ], - "signature": "let getOrThrow: (list<'a>, int) => 'a" - }, - { - "id": "Stdlib.List.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(length, value)` returns a list of length `length` with each element filled\nwith `value`. Returns an empty list if `value` is negative.\n\n## Examples\n\n```rescript\nList.make(~length=3, 1) == list{1, 1, 1}\n```" - ], - "signature": "let make: (~length: int, 'a) => list<'a>" - }, - { - "id": "Stdlib.List.fromInitializer", - "kind": "value", - "name": "fromInitializer", - "docstrings": [ - "`fromInitializer(length, f)` return a list of length `length` with element initialized\nwith `f`. Returns an empty list if `length` is negative.\n\n## Examples\n\n```rescript\nList.fromInitializer(~length=5, i => i) == list{0, 1, 2, 3, 4}\n\nList.fromInitializer(~length=5, i => i * i) == list{0, 1, 4, 9, 16}\n```" - ], - "signature": "let fromInitializer: (~length: int, int => 'a) => list<'a>" - }, - { - "id": "Stdlib.List.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "`shuffle(list)` returns a new list in random order.\n\n## Examples\n\n```rescript\nList.shuffle(list{1, 2, 3}) // list{2, 1, 3}\n```" - ], - "signature": "let shuffle: list<'a> => list<'a>" - }, - { - "id": "Stdlib.List.toShuffled", - "kind": "value", - "name": "toShuffled", - "docstrings": [ - "`toShuffled(list)` returns a new list in random order.\n\n## Examples\n\n```rescript\nList.toShuffled(list{1, 2, 3}) // list{2, 1, 3}\n```" - ], - "signature": "let toShuffled: list<'a> => list<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.List.drop", - "kind": "value", - "name": "drop", - "docstrings": [ - "`drop(list, value)` return a new list, dropping the first `value` element.\nReturns `None` if `list` has fewer than `value` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.drop(2) == Some(list{3})\n\nlist{1, 2, 3}->List.drop(3) == Some(list{})\n\nlist{1, 2, 3}->List.drop(4) == None\n```" - ], - "signature": "let drop: (list<'a>, int) => option>" - }, - { - "id": "Stdlib.List.take", - "kind": "value", - "name": "take", - "docstrings": [ - "`take(list, value)` returns a list with the first `value` elements from `list`,\nor `None` if `list` has fewer than `value` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.take(1) == Some(list{1})\n\nlist{1, 2, 3}->List.take(2) == Some(list{1, 2})\n\nlist{1, 2, 3}->List.take(4) == None\n```" - ], - "signature": "let take: (list<'a>, int) => option>" - }, - { - "id": "Stdlib.List.splitAt", - "kind": "value", - "name": "splitAt", - "docstrings": [ - "`splitAt(list, n)` split the list `list` at `n`. Returns `None` when the length\nof `list` is less than `n`.\n\n## Examples\n\n```rescript\nlist{\"Hello\", \"World\"}->List.splitAt(1) == Some((list{\"Hello\"}, list{\"World\"}))\n\nlist{0, 1, 2, 3, 4}->List.splitAt(2) == Some((list{0, 1}, list{2, 3, 4}))\n```" - ], - "signature": "let splitAt: (list<'a>, int) => option<(list<'a>, list<'a>)>" - }, - { - "id": "Stdlib.List.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(list1, list2)` returns the list obtained by adding `list2` after `list1`.\n\n## Examples\n\n```rescript\nList.concat(list{1, 2, 3}, list{4, 5}) == list{1, 2, 3, 4, 5}\n```" - ], - "signature": "let concat: (list<'a>, list<'a>) => list<'a>" - }, - { - "id": "Stdlib.List.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(arr)` returns the list obtained by concatenating all the lists in\narray `arr`, in order.\n\n## Examples\n\n```rescript\nList.concatMany([list{1, 2, 3}, list{}, list{3}]) == list{1, 2, 3, 3}\n```" - ], - "signature": "let concatMany: array> => list<'a>" - }, - { - "id": "Stdlib.List.reverseConcat", - "kind": "value", - "name": "reverseConcat", - "docstrings": [ - "`reverseConcat(list1, list2)` is equivalent to writing: `concat(reverse(list1, list2)`\n\n## Examples\n\n```rescript\nList.reverseConcat(list{1, 2}, list{3, 4}) == list{2, 1, 3, 4}\n```" - ], - "signature": "let reverseConcat: (list<'a>, list<'a>) => list<'a>" - }, - { - "id": "Stdlib.List.flat", - "kind": "value", - "name": "flat", - "docstrings": [ - "`flat(list)` return the list obtained by concatenating all the lists in\n`list`, in order.\n\n## Examples\n\n```rescript\nList.flat(list{list{1, 2, 3}, list{}, list{3}}) == list{1, 2, 3, 3}\n```" - ], - "signature": "let flat: list> => list<'a>" - }, - { - "id": "Stdlib.List.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nlist{1, 2}->List.map(x => x + 1) == list{2, 3}\n```" - ], - "signature": "let map: (list<'a>, 'a => 'b) => list<'b>" - }, - { - "id": "Stdlib.List.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "`zip(list1, list2)` returns a list of pairs from the two lists with the length\nof the shorter list.\n\n## Examples\n\n```rescript\nList.zip(list{1, 2}, list{3, 4, 5}) == list{(1, 3), (2, 4)}\n```" - ], - "signature": "let zip: (list<'a>, list<'b>) => list<('a, 'b)>" - }, - { - "id": "Stdlib.List.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "`zipBy(list1, list2, f)`. See [`zip`](#zip)\n\n## Examples\n\n```rescript\nList.zipBy(list{1, 2, 3}, list{4, 5}, (a, b) => 2 * a + b) == list{6, 9}\n```" - ], - "signature": "let zipBy: (list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>" - }, - { - "id": "Stdlib.List.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(list, f)` applies `f` to each element of `list`. Function `f`\ntakes two arguments: the index starting from 0 and the element from `list`, in\nthat order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.mapWithIndex((x, index) => index + x) == list{1, 3, 5}\n```" - ], - "signature": "let mapWithIndex: (list<'a>, ('a, int) => 'b) => list<'b>" - }, - { - "id": "Stdlib.List.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(arr)` converts the given array `arr` to a list.\n\n## Examples\n\n```rescript\nList.fromArray([1, 2, 3]) == list{1, 2, 3}\n```" - ], - "signature": "let fromArray: array<'a> => list<'a>" - }, - { - "id": "Stdlib.List.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(list)` converts the given list `list` to an array.\n\n## Examples\n\n```rescript\nList.toArray(list{1, 2, 3}) == [1, 2, 3]\n```" - ], - "signature": "let toArray: list<'a> => array<'a>" - }, - { - "id": "Stdlib.List.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(list)` returns a new list whose elements are those of `list` in\nreversed order.\n\n## Examples\n\n```rescript\nList.reverse(list{1, 2, 3}) == list{3, 2, 1}\n```" - ], - "signature": "let reverse: list<'a> => list<'a>" - }, - { - "id": "Stdlib.List.mapReverse", - "kind": "value", - "name": "mapReverse", - "docstrings": [ - "`mapReverse(list, f)` is equivalent to `map` function.\n\n## Examples\n\n```rescript\nlet f = x => x * x\nlet l = list{3, 4, 5}\n\nlet withMap = List.map(l, f)->List.reverse\nlet withMapReverse = l->List.mapReverse(f)\n\nConsole.log(withMap == withMapReverse) // true\n```" - ], - "signature": "let mapReverse: (list<'a>, 'a => 'b) => list<'b>" - }, - { - "id": "Stdlib.List.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(list, f)` call `f` on each element of `list` from the beginning to end.\n`f` returns `unit`, so no new array is created. Use `forEach` when you are primarily\nconcerned with repetitively creating side effects.\n\n## Examples\n\n```rescript\nList.forEach(list{\"a\", \"b\", \"c\"}, x => Console.log(\"Item: \" ++ x))\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\n```" - ], - "signature": "let forEach: (list<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.List.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(list, f, index)` call `f` on each element of `list` from beginning\nto end. Function `f` takes two arguments: the `index` starting from 0 and the\nelement from `list`. `f` returns `unit`.\n\n## Examples\n\n```rescript\nList.forEachWithIndex(list{\"a\", \"b\", \"c\"}, (x, index) => {\n Console.log(\"Item \" ++ Int.toString(index) ++ \" is \" ++ x)\n})\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\n```" - ], - "signature": "let forEachWithIndex: (list<'a>, ('a, int) => unit) => unit" - }, - { - "id": "Stdlib.List.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(list, initialValue, f)` applies `f` to each element of `list` from\nbeginning to end. Function `f` has two parameters: the item from the list and\nan \"accumulator\", which starts with a value of `initialValue`. `reduce` returns\nthe final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduce(0, (a, b) => a + b) == 10\n\n// same as\n\nlist{1, 2, 3, 4}->List.reduce(0, (acc, item) => acc + item) == 10\n```" - ], - "signature": "let reduce: (list<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.List.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(list, initialValue, f)` applies `f` to each element of `list`\nfrom beginning to end. Function `f` has three parameters: the item from the list\nand an \"accumulator\", which starts with a value of `initialValue` and the index\nof each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduceWithIndex(0, (acc, item, index) => acc + item + index) == 16\n```" - ], - "signature": "let reduceWithIndex: (list<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Stdlib.List.reduceReverse", - "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "`reduceReverse(list, initialValue, f)` works like `reduce`, except that\nfunction `f` is applied to each item of `list` from the last back to the first.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduceReverse(0, (a, b) => a + b) == 10\n\nlist{1, 2, 3, 4}->List.reduceReverse(10, (a, b) => a - b) == 0\n\nlist{1, 2, 3, 4}->List.reduceReverse(list{}, List.add) == list{1, 2, 3, 4}\n```" - ], - "signature": "let reduceReverse: (list<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.List.mapReverse2", - "kind": "value", - "name": "mapReverse2", - "docstrings": [ - "`mapReverse2(list1, list2, f)` is equivalent to `List.zipBy(list1, list2, f)->List.reverse`.\n\n## Examples\n\n```rescript\nList.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) == list{4, 2}\n```" - ], - "signature": "let mapReverse2: (list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>" - }, - { - "id": "Stdlib.List.forEach2", - "kind": "value", - "name": "forEach2", - "docstrings": [ - "`forEach2(list1, list2, f)` is similar to `forEach`, but accepts two lists and\nstops at the length of the shorter list.\n\n## Examples\n\n```rescript\nList.forEach2(list{\"Z\", \"Y\"}, list{\"A\", \"B\", \"C\"}, (x, y) => Console.log2(x, y))\n\n/*\n prints:\n \"Z\" \"A\"\n \"Y\" \"B\"\n*/\n```" - ], - "signature": "let forEach2: (list<'a>, list<'b>, ('a, 'b) => 'c) => unit" - }, - { - "id": "Stdlib.List.reduce2", - "kind": "value", - "name": "reduce2", - "docstrings": [ - "`reduce2(list1, list2, initialValue, f)` applies `f` to each element of `list1`\nand `list2` from beginning to end. Stops with the shorter list. Function `f` has\nthree parameters: an accumulator which starts with a value of `initialValue`, an\nitem from `l1`, and an item from `l2`. `reduce2` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nList.reduce2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduce2: (list<'b>, list<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a" - }, - { - "id": "Stdlib.List.reduceReverse2", - "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "`reduceReverse2(list1, list2, initialValue, f)` applies `f` to each element of\n`list1` and `list2`from end to beginning. Stops with the shorter list. Function\n`f` has three parameters: an accumulator which starts with a value of\n`initialValue`, an item from `l1`, and an item from `l2`. `reduce2` returns the\nfinal value of the accumulator.\n\n## Examples\n\n```rescript\nList.reduceReverse2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduceReverse2: (list<'a>, list<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" - }, - { - "id": "Stdlib.List.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(list, f)` returns `true` if all elements in `list` satisfy `f`, where `f`\nis a predicate: a function taking an element and returning a bool.\n\n## Examples\n\n```rescript\nlet isBelow10 = value => value < 10\n\nlist{1, 9, 8, 2}->List.every(isBelow10) == true\n\nlist{1, 99, 8, 2}->List.every(isBelow10) == false\n```" - ], - "signature": "let every: (list<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.List.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(list, f)` returns `true` if at least _one_ of the elements in `list`\nsatisfies `f`, where `f` is a predicate: a function taking an element and\nreturning a bool.\n\n## Examples\n\n```rescript\nlet isAbove100 = value => value > 100\n\nlist{101, 1, 2, 3}->List.some(isAbove100) == true\n\nlist{1, 2, 3, 4}->List.some(isAbove100) == false\n```" - ], - "signature": "let some: (list<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.List.every2", - "kind": "value", - "name": "every2", - "docstrings": [ - "`every2(list1, list2, f)` returns `true` if predicate `f` is `true` for all\npairs of elements up to the shorter length (i.e. `min(length(list1), length(list2))`)\n\n## Examples\n\n```rescript\nList.every2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nList.every2(list{}, list{1}, (a, b) => a > b) == true\n\nList.every2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nList.every2(list{0, 1}, list{5, 0}, (a, b) => a > b) == false\n```" - ], - "signature": "let every2: (list<'a>, list<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.List.some2", - "kind": "value", - "name": "some2", - "docstrings": [ - "`some2(list1, list2, f)` returns `true` if predicate `f` is `true` for any pair\nof elements up to the shorter length (i.e. `min(length(list1), length(list2))`)\n\n## Examples\n\n```rescript\nList.some2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nList.some2(list{}, list{1}, (a, b) => a > b) == false\n\nList.some2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nList.some2(list{0, 1}, list{5, 0}, (a, b) => a > b) == true\n```" - ], - "signature": "let some2: (list<'a>, list<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.List.compareLength", - "kind": "value", - "name": "compareLength", - "docstrings": [ - "`compareLength(list1, list2)` compare two lists solely by length. Returns `-1.` if\n`length(list1)` is less than `length(list2)`, `0.` if `length(list1)` equals\n`length(list2)`, and `1.` if `length(list1)` is greater than `length(list2)`.\n\n## Examples\n\n```rescript\nList.compareLength(list{1, 2}, list{3, 4, 5, 6}) == -1.\n\nList.compareLength(list{1, 2, 3}, list{4, 5, 6}) == 0.\n\nList.compareLength(list{1, 2, 3, 4}, list{5, 6}) == 1.\n```" - ], - "signature": "let compareLength: (list<'a>, list<'a>) => Ordering.t" - }, - { - "id": "Stdlib.List.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(list1, list2, f)` compare elements one by one `f`. `f` returns a negative\nnumber if `list1` is \"less than\" `list2`, zero if `list1` is \"equal to\" `list2`,\na positive number if `list1` is \"greater than\" `list2`.\n\nThe comparison returns the first non-zero result of `f`, or zero if `f` returns\nzero for all `list1` and `list2`.\n\n- If all items have compared equal, but `list1` is exhausted first, return `-1.`. (`list1` is shorter).\n- If all items have compared equal, but `list2` is exhausted first, return `1.` (`list1` is longer).\n\n## Examples\n\n```rescript\nList.compare(list{3}, list{3, 7}, (a, b) => Int.compare(a, b)) == -1.\nList.compare(list{5, 3}, list{5}, (a, b) => Int.compare(a, b)) == 1.\nList.compare(list{1, 3, 5}, list{1, 4, 2}, (a, b) => Int.compare(a, b)) == -1.\nList.compare(list{1, 3, 5}, list{1, 2, 3}, (a, b) => Int.compare(a, b)) == 1.\nList.compare(list{1, 3, 5}, list{1, 3, 5}, (a, b) => Int.compare(a, b)) == 0.\n```\n\n**Please note:** The total ordering of List is different from Array,\nfor Array, we compare the length first and, only if the lengths are equal, elements one by one.\nFor lists, we just compare elements one by one." - ], - "signature": "let compare: (list<'a>, list<'a>, ('a, 'a) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.List.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(list1, list2, f)` check equality of `list2` and `list2` using `f` for\nequality on elements, where `f` is a function that returns `true` if items `x` and\n`y` meet some criterion for equality, `false` otherwise. equal `false` if length\nof `list1` and `list2` are not the same.\n\n## Examples\n\n```rescript\nList.equal(list{1, 2, 3}, list{1, 2}, (a, b) => a == b) == false\n\nList.equal(list{1, 2}, list{1, 2}, (a, b) => a == b) == true\n\nList.equal(list{1, 2, 3}, list{-1, -2, -3}, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let equal: (list<'a>, list<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Stdlib.List.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(list, element, f)` returns `true` if the list contains at least one\n`element` for which `f` returns \\`true'.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.has(2, (a, b) => a == b) == true\n\nlist{1, 2, 3}->List.has(4, (a, b) => a == b) == false\n\nlist{-1, -2, -3}->List.has(2, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let has: (list<'a>, 'b, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.List.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(list, f)` returns `Some(value)` for the first value in `list` that\nsatisfies the predicate function `f`. Returns `None` if no element satisfies\nthe function.\n\n## Examples\n\n```rescript\nList.find(list{1, 4, 3, 2}, x => x > 3) == Some(4)\n\nList.find(list{1, 4, 3, 2}, x => x > 4) == None\n```" - ], - "signature": "let find: (list<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.List.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(list, f)` returns a list of all elements in `list` which satisfy the\npredicate function `f`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nList.filter(list{1, 2, 3, 4}, isEven) == list{2, 4}\n\nList.filter(list{None, Some(2), Some(3), None}, Option.isSome) == list{Some(2), Some(3)}\n```" - ], - "signature": "let filter: (list<'a>, 'a => bool) => list<'a>" - }, - { - "id": "Stdlib.List.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(list, f)` returns a list of all elements in `list` which\nsatisfy the predicate function `f`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nList.filterWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) == list{1, 3}\n```" - ], - "signature": "let filterWithIndex: (list<'a>, ('a, int) => bool) => list<'a>" - }, - { - "id": "Stdlib.List.filterMap", - "kind": "value", - "name": "filterMap", - "docstrings": [ - "`filterMap(list, f)` applies `f` to each element of `list`. If `f` returns\n`Some(value)`, then `value` is _kept_ in the resulting list. If `f` returns\n`None`, the element is _not_ retained in the result.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nlist{1, 2, 3, 4}->List.filterMap(x =>\n if isEven(x) {\n Some(x)\n } else {\n None\n }\n) // list{2, 4}\n\nlist{Some(1), Some(2), None}->List.filterMap(x => x) == list{1, 2}\n```" - ], - "signature": "let filterMap: (list<'a>, 'a => option<'b>) => list<'b>" - }, - { - "id": "Stdlib.List.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(list, f)` creates a pair of lists; the first list consists of all\nelements of `list` that satisfy the predicate function `f`, the second list\nconsists of all elements of `list` that _do not_ satisfy `f`.\n\n## Examples\n\n```rescript\n// (elementsThatSatisfies, elementsThatDoesNotSatisfy)\n\nList.partition(list{1, 2, 3, 4}, x => x > 2) == (list{3, 4}, list{1, 2})\n```" - ], - "signature": "let partition: (list<'a>, 'a => bool) => (list<'a>, list<'a>)" - }, - { - "id": "Stdlib.List.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "`unzip(list)` takes a list of pairs and creates a pair of lists. The first list\ncontains all the first items of the pairs, the second list contains all the\nsecond items.\n\n## Examples\n\n```rescript\nList.unzip(list{(1, 2), (3, 4)}) // (list{1, 3}, list{2, 4})\n\nList.unzip(list{(\"H\", \"W\"), (\"e\", \"o\"), (\"l\", \"r\"), (\"l\", \"l\"), (\"o\", \"d\"), (\" \", \"!\")}) ==\n (list{\"H\", \"e\", \"l\", \"l\", \"o\", \" \"}, list{\"W\", \"o\", \"r\", \"l\", \"d\", \"!\"})\n```" - ], - "signature": "let unzip: list<('a, 'b)> => (list<'a>, list<'b>)" - }, - { - "id": "Stdlib.List.getAssoc", - "kind": "value", - "name": "getAssoc", - "docstrings": [ - "`getAssoc(list, k, f)` return the second element of a pair in `list` where\nthe first element equals `k` as per the predicate function `f`, or `None` if\nnot found.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.getAssoc(3, (a, b) => a == b) // Some(\"c\")\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->List.getAssoc(15, (k, item) =>\n k /* 15 */ == item\n) == Some(\"afternoon\")\n/* 9, 5, 22 */\n```" - ], - "signature": "let getAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.hasAssoc", - "kind": "value", - "name": "hasAssoc", - "docstrings": [ - "`hasAssoc(list, k, f)` returns `true` if there is a pair in `list` where the\nfirst element equals `k` as per the predicate function `f`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.hasAssoc(1, (a, b) => a == b) // true\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->List.hasAssoc(25, (k, item) =>\n k /* 25 */ == item\n) == false\n/* 9, 5, 22 */\n```" - ], - "signature": "let hasAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => bool", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.removeAssoc", - "kind": "value", - "name": "removeAssoc", - "docstrings": [ - "`removeAssoc(list, k, f)` return a list after removing the first pair whose\nfirst value is `k` per the equality predicate `f`, if not found, return a new\nlist identical to `list`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.removeAssoc(1, (a, b) => a == b) // list{(2, \"b\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->List.removeAssoc(9, (k, item) =>\n k /* 9 */ == item\n) == list{(15, \"afternoon\"), (22, \"night\")}\n/* 9, 5, 22 */\n```" - ], - "signature": "let removeAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => list<('a, 'c)>", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.setAssoc", - "kind": "value", - "name": "setAssoc", - "docstrings": [ - "`setAssoc(list, k, v, f)`. If `k` exists in `list` by satisfying the `f`\npredicate, return a new list with the key and value replaced by the new `k` and\n`v`, otherwise, return a new list with the pair `k`, `v` added to the head of\n`list`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.setAssoc(2, \"x\", (a, b) => a == b) ==\n list{(1, \"a\"), (2, \"x\"), (3, \"c\")}\n\nlist{(1, \"a\"), (3, \"c\")}->List.setAssoc(2, \"b\", (a, b) => a == b) ==\n list{(2, \"b\"), (1, \"a\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (3, \"morning?!\"), (22, \"night\")}->List.setAssoc(15, \"afternoon\", (a, b) =>\n mod(a, 12) == mod(b, 12)\n) == list{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n```\n\n**Please note**: In the last example, since: `15 mod 12` equals `3 mod 12`. Both\nthe key _and_ the value are replaced in the list." - ], - "signature": "let setAssoc: (list<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => list<('a, 'c)>", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(list, f)` returns a sorted list.\n\n## Examples\n\n```rescript\nList.sort(list{5, 4, 9, 3, 7}, Int.compare) == list{3, 4, 5, 7, 9}\n```" - ], - "signature": "let sort: (list<'a>, ('a, 'a) => Ordering.t) => list<'a>" - }, - { - "id": "Stdlib.List.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(list)` ignores the provided list and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: list<'a> => unit" - } - ] - }, - "stdlib/lazy": { - "id": "Stdlib.Lazy", - "name": "Lazy", - "docstrings": [ - "This module provides a type `Lazy.t` and functions to create and\n manipulate lazy values. A lazy value is a value that is not\n computed until it is needed. This is useful for deferring\n computations that may be expensive or unnecessary." - ], - "items": [ - { - "id": "Stdlib.Lazy.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of a lazy value. `Lazy.t<'a>` represents a lazy value\n that will eventually yield a value of type `'a` when accessed.\n The value is computed only once, and the result is cached for\n subsequent accesses. If the computation throws an exception,\n the same exception is thrown again on subsequent accesses." - ], - "signature": "type t<+'a>" - }, - { - "id": "Stdlib.Lazy.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`Lazy.make(f)` creates a lazy value from `f` which is the\n computation to be deferred of type `unit => 'a`. \n The function returns a lazy value of type `Lazy.t<'a>`. \n The computation is not executed until the lazy value is accessed.\n\n ## Examples \n ```rescript \n let lazyValue = Lazy.make(() => {\n // Some expensive computation\n Console.log(\"Computing...\")\n 42\n });\n lazyValue->Lazy.get->assertEqual(42)\n ```" - ], - "signature": "let make: (unit => 'a) => t<'a>" - }, - { - "id": "Stdlib.Lazy.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`Lazy.get(x)` forces the suspension `x` and returns its result.\n If `x` has already been forced, `Lazy.get(x)` returns the\n same value again without recomputing it. If it threw an\n exception, the same exception is thrown again.\n Throw `Undefined` if the forcing of `x` tries to force `x` itself\n recursively. This is a runtime error." - ], - "signature": "let get: t<'a> => 'a" - }, - { - "id": "Stdlib.Lazy.isEvaluated", - "kind": "value", - "name": "isEvaluated", - "docstrings": [ - "`Lazy.isEvaluated(x)` returns `true` if the suspension `x` has\n already been forced and did not throw an exception. Otherwise, \n it returns `false`. This is useful for checking if a lazy value\n has been computed before accessing it.\n\n ## Examples\n ```rescript \n let lazyValue = Lazy.make(() => {\n // Some expensive computation\n Console.log(\"Computing...\")\n 42\n })\n Lazy.isEvaluated(lazyValue)->assertEqual(false)\n lazyValue->Lazy.get->assertEqual(42)\n lazyValue->Lazy.isEvaluated->assertEqual(true)\n ```" - ], - "signature": "let isEvaluated: t<'a> => bool" - }, - { - "id": "Stdlib.Lazy.force", - "kind": "value", - "name": "force", - "docstrings": [ - "`force(x)` forces the suspension `x` and returns its result.\n If `x` has already been forced, `Lazy.force(x)` returns the\n same value again without recomputing it. If it threw an exception,\n the same exception is thrown again.\n Throw `Undefined` if the forcing of `x` tries to force `x` itself\n recursively." - ], - "signature": "let force: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.force_val", - "kind": "value", - "name": "force_val", - "docstrings": [ - "`force_val(x)` forces the suspension `x` and returns its\n result. If `x` has already been forced, `force_val(x)`\n returns the same value again without recomputing it.\n Throw `Undefined` if the forcing of `x` tries to force `x` itself\n recursively.\n If the computation of `x` throws an exception, it is unspecified\n whether `force_val(x)` throws the same exception or `Undefined`." - ], - "signature": "let force_val: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.from_fun", - "kind": "value", - "name": "from_fun", - "docstrings": [ - "`Lazy.from_fun(f)` creates a lazy value from `f` which is the\n computation to be deferred of type `unit => 'a`. \n The function returns a lazy value of type `Lazy.t<'a>`. \n The computation is not executed until the lazy value is accessed." - ], - "signature": "let from_fun: (unit => 'a) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.from_val", - "kind": "value", - "name": "from_val", - "docstrings": [ - "`from_val(v)` returns an already-forced suspension of `v`.\n This is for special purposes only." - ], - "signature": "let from_val: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.is_val", - "kind": "value", - "name": "is_val", - "docstrings": [ - "`is_val(x)` returns `true` if `x has already been forced and\n did not throw an exception." - ], - "signature": "let is_val: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(lazyValue)` ignores the provided lazy value and returns unit.\n\n This helper is useful when you want to discard a lazy value (for example, when only its side effects matter)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/json": { - "id": "Stdlib.JSON", - "name": "JSON", - "docstrings": [ - "Functions for interacting with JSON." - ], - "items": [ - { - "id": "Stdlib.JSON.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a JSON object." - ], - "signature": "@unboxed\ntype t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)" - }, - { - "id": "Stdlib.JSON.replacer", - "kind": "type", - "name": "replacer", - "docstrings": [], - "signature": "@unboxed\ntype replacer =\n | Keys(array)\n | Replacer((string, t) => t)" - }, - { - "id": "Stdlib.JSON.parseOrThrow", - "kind": "value", - "name": "parseOrThrow", - "docstrings": [ - "`parseOrThrow(string, ~reviver=?)`\n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\ntry {\n let _ = JSON.parseOrThrow(`{\"foo\":\"bar\",\"hello\":\"world\"}`)\n // { foo: 'bar', hello: 'world' }\n\n let _ = JSON.parseOrThrow(\"\")\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\ntry {\n JSON.parseOrThrow(jsonString, ~reviver)->Console.log\n // { hello: 'WORLD', someNumber: 42 }\n\n JSON.parseOrThrow(\"\", ~reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions\n\n- Throws a SyntaxError (Exn.t) if the string isn't valid JSON." - ], - "signature": "let parseOrThrow: (string, ~reviver: (string, t) => t=?) => t" - }, - { - "id": "Stdlib.JSON.parseExn", - "kind": "value", - "name": "parseExn", - "docstrings": [ - "`parseExn(string, ~reviver=?)`\n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\ntry {\n let _ = JSON.parseExn(`{\"foo\":\"bar\",\"hello\":\"world\"}`)\n // { foo: 'bar', hello: 'world' }\n\n let _ = JSON.parseExn(\"\")\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\ntry {\n JSON.parseExn(jsonString, ~reviver)->Console.log\n // { hello: 'WORLD', someNumber: 42 }\n\n JSON.parseExn(\"\", ~reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions\n\n- Throws a SyntaxError (Exn.t) if the string isn't valid JSON." - ], - "signature": "let parseExn: (string, ~reviver: (string, t) => t=?) => t", - "deprecated": "Use `parseOrThrow` instead" - }, - { - "id": "Stdlib.JSON.parseExnWithReviver", - "kind": "value", - "name": "parseExnWithReviver", - "docstrings": [ - "`parseExnWithReviver(string, reviver)`\n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\nJSON.parseExnWithReviver(jsonString, reviver)->Console.log\n// { hello: 'WORLD', someNumber: 42 }\n\ntry {\n JSON.parseExnWithReviver(\"\", reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions\n\n- Throws a SyntaxError if the string is not a valid JSON." - ], - "signature": "let parseExnWithReviver: (string, (string, t) => t) => t", - "deprecated": "Use `parseOrThrow` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringify", - "kind": "value", - "name": "stringify", - "docstrings": [ - "`stringify(json, ~replacer=?, ~space=?)`\n\nConverts a JSON object to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value,\nor an array of keys which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAny` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringify(json)\n// {\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}\n\nJSON.stringify(json, ~space=2)\n// {\n// \"foo\": \"bar\",\n// \"hello\": \"world\",\n// \"someNumber\": 42\n// }\n\nJSON.stringify(json, ~replacer=Keys([\"foo\", \"someNumber\"]))\n// {\"foo\":\"bar\",\"someNumber\":42}\n\nlet replacer = JSON.Replacer(\n (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n },\n)\n\nJSON.stringify(json, ~replacer)\n// {\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}\n```" - ], - "signature": "let stringify: (t, ~replacer: replacer=?, ~space: int=?) => string" - }, - { - "id": "Stdlib.JSON.stringifyWithIndent", - "kind": "value", - "name": "stringifyWithIndent", - "docstrings": [ - "`stringifyWithIndent(json, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nIf you want to stringify any type, use `JSON.stringifyAnyWithIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithIndent(json, 2)\n// {\n// \"foo\": \"bar\",\n// \"hello\": \"world\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithIndent: (t, int) => string", - "deprecated": "Use `stringify` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyWithReplacer", - "kind": "value", - "name": "stringifyWithReplacer", - "docstrings": [ - "`stringifyWithReplacer(json, replacer)`\n\nConverts a JSON object to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nIf you want to stringify any type, use `JSON.stringifyAnyWithReplacer` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\nJSON.stringifyWithReplacer(json, replacer)\n// {\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}\n```" - ], - "signature": "let stringifyWithReplacer: (t, (string, t) => t) => string", - "deprecated": "Use `stringify` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyWithReplacerAndIndent", - "kind": "value", - "name": "stringifyWithReplacerAndIndent", - "docstrings": [ - "`stringifyWithReplacerAndIndent(json, replacer, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nIf you want to stringify any type, use `JSON.stringifyAnyWithReplacerAndIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\nJSON.stringifyWithReplacerAndIndent(json, replacer, 2)\n// {\n// \"foo\": \"BAR\",\n// \"hello\": \"WORLD\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithReplacerAndIndent: (t, (string, t) => t, int) => string", - "deprecated": "Use `stringify` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.stringifyWithFilter", - "kind": "value", - "name": "stringifyWithFilter", - "docstrings": [ - "`stringifyWithFilter(json, filter)`\n\nConverts a JSON object to a JSON string.\nThe filter is an array of keys, which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAnyWithFilter` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithFilter(json, [\"foo\", \"someNumber\"])\n// {\"foo\":\"bar\",\"someNumber\":42}\n```" - ], - "signature": "let stringifyWithFilter: (t, array) => string", - "deprecated": "Use `stringify` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyWithFilterAndIndent", - "kind": "value", - "name": "stringifyWithFilterAndIndent", - "docstrings": [ - "`stringifyWithFilterAndIndent(json, filter, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nThe filter is an array of keys, which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAnyWithFilterAndIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithFilterAndIndent(json, [\"foo\", \"someNumber\"], 2)\n// {\n// \"foo\": \"bar\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithFilterAndIndent: (t, array, int) => string", - "deprecated": "Use `stringify` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.stringifyAny", - "kind": "value", - "name": "stringifyAny", - "docstrings": [ - "`stringifyAny(any, ~replacer=?, ~space=?)`\n\nConverts any type to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringify` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAny\n->Option.getUnsafe == `{\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}`\n\ndict\n->JSON.stringifyAny(~space=2)\n->Option.getUnsafe == `{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`\n\ndict\n->JSON.stringifyAny(~replacer=Keys([\"foo\", \"someNumber\"]))\n->Option.getUnsafe == `{\"foo\":\"bar\",\"someNumber\":42}`\n\nlet replacer = JSON.Replacer(\n (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n },\n)\n\ndict\n->JSON.stringifyAny(~replacer)\n->Option.getUnsafe == `{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\n// Throw a exception\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAny: ('a, ~replacer: replacer=?, ~space: int=?) => option" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithIndent", - "kind": "value", - "name": "stringifyAnyWithIndent", - "docstrings": [ - "`stringifyAnyWithIndent(any, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAnyWithIndent(2)\n->Option.getUnsafe == `{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithIndent: ('a, int) => option", - "deprecated": "Use `stringifyAny` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithReplacer", - "kind": "value", - "name": "stringifyAnyWithReplacer", - "docstrings": [ - "`stringifyAnyWithReplacer(json, replacer)`\n\nConverts any type to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithReplacer` instead.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\ndict\n->JSON.stringifyAnyWithReplacer(replacer)\n->Option.getUnsafe == `{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithReplacer: ('a, (string, t) => t) => option", - "deprecated": "Use `stringifyAny` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithReplacerAndIndent", - "kind": "value", - "name": "stringifyAnyWithReplacerAndIndent", - "docstrings": [ - "`stringifyAnyWithReplacerAndIndent(json, replacer, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithReplacerAndIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\ndict\n->JSON.stringifyAnyWithReplacer(replacer)\n->Option.getUnsafe == `{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithReplacerAndIndent: ('a, (string, t) => t, int) => option", - "deprecated": "Use `stringifyAny` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithFilter", - "kind": "value", - "name": "stringifyAnyWithFilter", - "docstrings": [ - "`stringifyAnyWithFilter(json, filter)`\n\nConverts any type to a JSON string.\nThe filter is an array of keys, which should be included in the output.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithFilter` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict->JSON.stringifyAnyWithFilter([\"foo\", \"someNumber\"]) == `{\"foo\":\"bar\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithFilter: ('a, array) => string", - "deprecated": "Use `stringifyAny` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithFilterAndIndent", - "kind": "value", - "name": "stringifyAnyWithFilterAndIndent", - "docstrings": [ - "`stringifyAnyWithFilterAndIndent(json, filter, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nThe filter is an array of keys, which should be included in the output.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithFilterAndIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAny\n->Option.getUnsafe == `{\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}`\n\ndict\n->JSON.stringifyAny(~space=2)\n->Option.getUnsafe == `{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`\n\ndict\n->JSON.stringifyAny(~replacer=Keys([\"foo\", \"someNumber\"]))\n->Option.getUnsafe == `{\"foo\":\"bar\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithFilterAndIndent: ('a, array, int) => string", - "deprecated": "Use `stringifyAny` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(json)` ignores the provided json and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/jsexn": { - "id": "Stdlib.JsExn", - "name": "JsExn", - "docstrings": [ - "Provide utilities for dealing with JS exceptions.\n\nJS exceptions can be of any type, even though they *should* be of type `Error` of one of its subclasses.\n\nSee [`throw`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/throw) on MDN." - ], - "items": [ - { - "id": "Stdlib.JsExn.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JS exception" - ], - "signature": "type t = unknown" - }, - { - "id": "Stdlib.JsExn.fromException", - "kind": "value", - "name": "fromException", - "docstrings": [], - "signature": "let fromException: exn => option" - }, - { - "id": "Stdlib.JsExn.anyToExnInternal", - "kind": "value", - "name": "anyToExnInternal", - "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a JsExn if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." - ], - "signature": "let anyToExnInternal: 'a => exn" - }, - { - "id": "Stdlib.JsExn.stack", - "kind": "value", - "name": "stack", - "docstrings": [ - "`stack(jsExn)` retrieves the `stack` property of the exception, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\ntry {JsError.make(\"error\")->JsError.throw} catch {\n| JsExn(e) => Console.log(JsExn.stack(e)) // Logs `stack`\n| _ => assert(false)\n}\n```" - ], - "signature": "let stack: t => option" - }, - { - "id": "Stdlib.JsExn.message", - "kind": "value", - "name": "message", - "docstrings": [ - "`message(error)` retrieves the `message` property of the error, if it exists.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\ntry {JsError.SyntaxError.throwWithMessage(\"Some message here\")} catch {\n| JsExn(e) => e->JsExn.message->Option.getExn == \"Some message here\"\n| _ => assert(false)\n}\n```" - ], - "signature": "let message: t => option" - }, - { - "id": "Stdlib.JsExn.name", - "kind": "value", - "name": "name", - "docstrings": [ - "`name(error)` retrieves the `name` property of the error, if it exists.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\ntry {JsError.SyntaxError.throwWithMessage(\"Some message here\")} catch {\n| JsExn(e) => e->JsExn.name->Option.getExn == \"SyntaxError\"\n| _ => assert(false)\n}\n```" - ], - "signature": "let name: t => option" - }, - { - "id": "Stdlib.JsExn.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [ - "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." - ], - "signature": "let fileName: t => option" - }, - { - "id": "Stdlib.JsExn.throw", - "kind": "value", - "name": "throw", - "docstrings": [ - "Throws the given value, terminating execution unless caught by a surrounding try/catch block.\n\nThis is meant to be used when a JS API is based on throwing values that are not of type `Error` or its subclasses." - ], - "signature": "let throw: 'a => 'b" - }, - { - "id": "Stdlib.JsExn.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(jsExn)` ignores the provided JS exception and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/jserror": { - "id": "Stdlib.JsError", - "name": "JsError", - "docstrings": [ - "Functions for working with JavaScript errors.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) on MDN." - ], - "items": [ - { - "id": "Stdlib.JsError.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JavaScript error." - ], - "signature": "type t" - }, - { - "id": "Stdlib.JsError.stack", - "kind": "value", - "name": "stack", - "docstrings": [ - "`stack(error)` retrieves the `stack` property of the error, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\nlet error = JsError.make(\"error\")\nConsole.log(error->JsError.stack) // Logs `stack` if it exists on `someError`\n```" - ], - "signature": "let stack: t => option" - }, - { - "id": "Stdlib.JsError.message", - "kind": "value", - "name": "message", - "docstrings": [ - "`message(error)` retrieves the `message` property of the error.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\nlet error = JsError.SyntaxError.make(\"Some message here\")\nerror->JsError.message == \"Some message here\"\n```" - ], - "signature": "let message: t => string" - }, - { - "id": "Stdlib.JsError.name", - "kind": "value", - "name": "name", - "docstrings": [ - "`name(error)` retrieves the `name` property of the error.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\nlet error = JsError.SyntaxError.make(\"Some message here\")\nerror->JsError.name == \"SyntaxError\"\n```" - ], - "signature": "let name: t => string" - }, - { - "id": "Stdlib.JsError.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [ - "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." - ], - "signature": "let fileName: t => option" - }, - { - "id": "Stdlib.JsError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(message)` creates a new error, setting its `message` to the provided value.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error) on MDN.\n\n## Example\n```rescript\nlet error = JsError.make(\"Some message here\")\nerror->JsError.message == \"Some message here\"\nerror->JsError.name == \"Error\"\n```" - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.throw", - "kind": "value", - "name": "throw", - "docstrings": [ - "Throws the given error, terminating execution unless caught by a surrounding try/catch block.\n\n## Examples\n\n```rescript\nlet error = JsError.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n JsError.throw(error)\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" - ], - "signature": "let throw: t => 'a" - }, - { - "id": "Stdlib.JsError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `Error` with the provided `message` and throws it.\n\n`JsError.throwWithMessage(\"message\")` is equivalent to `JsError.make(\"message\")->JsError.throw`." - ], - "signature": "let throwWithMessage: string => 'a" - }, - { - "id": "Stdlib.JsError.panic", - "kind": "value", - "name": "panic", - "docstrings": [ - "Throws a panic exception with the given message.\n\nA panic exception is a native JavaScript exception that is not intended to be caught and\nhandled. Compared to a ReScript exception this will give a better stack trace and\ndebugging experience.\n\n## Examples\n\n```rescript\ntry {\n JsError.panic(\"Uh oh. This was unexpected!\")\n} catch {\n| JsExn(obj) =>\n switch JsExn.message(obj) {\n | Some(m) => assert(m == \"Panic! Uh oh. This was unexpected!\")\n | None => assert(false)\n }\n| _ => assert(false)\n}\n```" - ], - "signature": "let panic: string => 'a" - }, - { - "id": "Stdlib.JsError.toJsExn", - "kind": "value", - "name": "toJsExn", - "docstrings": [ - "Casts a `JsError.t` to a `JsExn.t`. \n\nThis is useful when you want to compare a JS exception and a JS error." - ], - "signature": "let toJsExn: t => JsExn.t" - }, - { - "id": "Stdlib.JsError.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(error)` ignores the provided error and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl": { - "id": "Stdlib.Intl", - "name": "Intl", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.getCanonicalLocalesExn", - "kind": "value", - "name": "getCanonicalLocalesExn", - "docstrings": [ - "`getCanonicalLocalesExn(locale)` returns the canonical form of `locale`.\n\nThrows `RangeError` when the locale string is malformed.\n\nSee [`Intl.getCanonicalLocales`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales) on MDN.\n\n## Examples\n\n```rescript\nIntl.getCanonicalLocalesExn(\"EN-US\") == [\"en-US\"]\n```" - ], - "signature": "let getCanonicalLocalesExn: string => array" - }, - { - "id": "Stdlib.Intl.getCanonicalLocalesManyExn", - "kind": "value", - "name": "getCanonicalLocalesManyExn", - "docstrings": [ - "`getCanonicalLocalesManyExn(locales)` canonicalises every locale in `locales`.\n\nThrows `RangeError` when any locale string is malformed.\n\nSee [`Intl.getCanonicalLocales`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales) on MDN.\n\n## Examples\n\n```rescript\nIntl.getCanonicalLocalesManyExn([\"EN-US\", \"fr\"]) == [\"en-US\", \"fr\"]\n```" - ], - "signature": "let getCanonicalLocalesManyExn: array => array" - }, - { - "id": "Stdlib.Intl.supportedValuesOfExn", - "kind": "value", - "name": "supportedValuesOfExn", - "docstrings": [ - "`supportedValuesOfExn(key)` returns the list of values supported by the runtime for the feature identified by `key`.\n\nThrows `RangeError` when `key` is unsupported.\n\nSee [`Intl.supportedValuesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.supportedValuesOfExn(\"calendar\")->Array.includes(\"gregory\") == true\n```" - ], - "signature": "let supportedValuesOfExn: string => array" - } - ] - }, - "stdlib/int": { - "id": "Stdlib.Int", - "name": "Int", - "docstrings": [ - "Functions for interacting with JavaScript Number.\nSee: [`Number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)." - ], - "items": [ - { - "id": "Stdlib.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an int." - ], - "signature": "type t = int" - }, - { - "id": "Stdlib.Int.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (int, int) => bool" - }, - { - "id": "Stdlib.Int.compare", - "kind": "value", - "name": "compare", - "docstrings": [], - "signature": "let compare: (int, int) => Ordering.t" - }, - { - "id": "Stdlib.Int.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponential: (int, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Int.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponentialWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toFixed", - "kind": "value", - "name": "toFixed", - "docstrings": [ - "`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixed: (int, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Int.toFixedWithPrecision", - "kind": "value", - "name": "toFixedWithPrecision", - "docstrings": [ - "`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixedWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecision: (int, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Int.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecisionWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." - ], - "signature": "let toString: (int, ~radix: int=?) => string" - }, - { - "id": "Stdlib.Int.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." - ], - "signature": "let toStringWithRadix: (int, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```" - ], - "signature": "let toLocaleString: int => string" - }, - { - "id": "Stdlib.Int.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [ - "`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```" - ], - "signature": "let toFloat: int => float" - }, - { - "id": "Stdlib.Int.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "`fromFloat(n)` return an `int` representing the given value. The conversion is\ndone by truncating the decimal part.\n\n## Examples\n\n```rescript\nInt.fromFloat(2.0) == 2\nInt.fromFloat(1.999) == 1\nInt.fromFloat(1.5) == 1\nInt.fromFloat(0.9999) == 0\n```" - ], - "signature": "let fromFloat: float => int" - }, - { - "id": "Stdlib.Int.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(str, ~radix=?)` return an `option` representing the given value\n`str`. `~radix` specifies the radix base to use for the formatted number.\n\n## Examples\n\n```rescript\nInt.fromString(\"0\") == Some(0)\nInt.fromString(\"NaN\") == None\nInt.fromString(\"6\", ~radix=2) == None\n```" - ], - "signature": "let fromString: (string, ~radix: int=?) => option" - }, - { - "id": "Stdlib.Int.mod", - "kind": "value", - "name": "mod", - "docstrings": [ - "`mod(n1, n2)` calculates the modulo (remainder after division) of two integers.\n\n## Examples\n\n```rescript\nInt.mod(7, 4) == 3\n```" - ], - "signature": "let mod: (int, int) => int" - }, - { - "id": "Stdlib.Int.rangeOptions", - "kind": "type", - "name": "rangeOptions", - "docstrings": [ - "The options for `range`." - ], - "signature": "type rangeOptions = {step?: int, inclusive?: bool}" - }, - { - "id": "Stdlib.Int.range", - "kind": "value", - "name": "range", - "docstrings": [ - "`range(start, end, ~options=?)` returns an int array of the sequence of integers in the\nrange `[start, end)`. That is, including `start` but excluding `end`.\n\nIf `step` is not set and `start < end`, the sequence will be increasing in steps of 1.\n\nIf `step` is not set and `start > end`, the sequence will be decreasing in steps of -1.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nthrown as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.range(3, 6) == [3, 4, 5]\nInt.range(-3, -1) == [-3, -2]\nInt.range(3, 1) == [3, 2]\nInt.range(3, 7, ~options={step: 2}) == [3, 5]\nInt.range(3, 7, ~options={step: 2, inclusive: true}) == [3, 5, 7]\nInt.range(3, 6, ~options={step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`." - ], - "signature": "let range: (int, int, ~options: rangeOptions=?) => array" - }, - { - "id": "Stdlib.Int.rangeWithOptions", - "kind": "value", - "name": "rangeWithOptions", - "docstrings": [ - "`rangeWithOptions(start, end, options)` is like `range`, but with `step` and\n`inclusive` options configurable.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nraised as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.rangeWithOptions(3, 7, {step: 2}) == [3, 5]\nInt.rangeWithOptions(3, 7, {step: 2, inclusive: true}) == [3, 5, 7]\nInt.rangeWithOptions(3, 6, {step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`." - ], - "signature": "let rangeWithOptions: (int, int, rangeOptions) => array", - "deprecated": "" - }, - { - "id": "Stdlib.Int.clamp", - "kind": "value", - "name": "clamp", - "docstrings": [ - "`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nInt.clamp(42) == 42\nInt.clamp(42, ~min=50) == 50\nInt.clamp(42, ~max=40) == 40\nInt.clamp(42, ~min=50, ~max=40) == 50\n```" - ], - "signature": "let clamp: (~min: int=?, ~max: int=?, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseAnd", - "kind": "value", - "name": "bitwiseAnd", - "docstrings": [ - "`bitwiseAnd(n1, n2)` calculates the bitwise AND of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseAnd(7, 4) == 4\n```" - ], - "signature": "let bitwiseAnd: (int, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseOr", - "kind": "value", - "name": "bitwiseOr", - "docstrings": [ - "`bitwiseOr(n1, n2)` calculates the bitwise OR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseOr(7, 4) == 7\n```" - ], - "signature": "let bitwiseOr: (int, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseXor", - "kind": "value", - "name": "bitwiseXor", - "docstrings": [ - "`bigwiseXor(n1, n2)` calculates the bitwise XOR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseXor(7, 4) == 3\n```" - ], - "signature": "let bitwiseXor: (int, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseNot", - "kind": "value", - "name": "bitwiseNot", - "docstrings": [ - "`bitwiseNot(n)` calculates the bitwise NOT of an integer.\n\n## Examples\n\n```rescript\nInt.bitwiseNot(2) == -3\n```" - ], - "signature": "let bitwiseNot: int => int" - }, - { - "id": "Stdlib.Int.shiftLeft", - "kind": "value", - "name": "shiftLeft", - "docstrings": [ - "`shiftLeft(n, length)` calculates the shifted value of an integer `n` by `length` bits to the left.\n\n## Examples\n\n```rescript\nInt.shiftLeft(4, 1) == 8\n```" - ], - "signature": "let shiftLeft: (int, int) => int" - }, - { - "id": "Stdlib.Int.shiftRight", - "kind": "value", - "name": "shiftRight", - "docstrings": [ - "`shiftRight(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\n\nAlso known as \"arithmetic right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRight(8, 1) == 4\n```" - ], - "signature": "let shiftRight: (int, int) => int" - }, - { - "id": "Stdlib.Int.shiftRightUnsigned", - "kind": "value", - "name": "shiftRightUnsigned", - "docstrings": [ - "`shiftRightUnsigned(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\nExcess bits shifted off to the right are discarded, and zero bits are shifted in from the left.\n\nAlso known as \"zero-filling right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRightUnsigned(4, 1) == 2\n```" - ], - "signature": "let shiftRightUnsigned: (int, int) => int" - }, - { - "id": "Stdlib.Int.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(int)` ignores the provided int and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: int => unit" - } - ] - }, - "stdlib/float": { - "id": "Stdlib.Float", - "name": "Float", - "docstrings": [ - "Functions for interacting with float." - ], - "items": [ - { - "id": "Stdlib.Float.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a float." - ], - "signature": "type t = float" - }, - { - "id": "Stdlib.Float.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "Checks if two floating point numbers are equal.\n\n## Examples\n```rescript\nFloat.equal(1.0, 1.0) == true\nFloat.equal(1.0, 2.0) == false\n```" - ], - "signature": "let equal: (float, float) => bool" - }, - { - "id": "Stdlib.Float.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "Compares two floating point numbers, returns an `Ordering.t` value.\n\n## Examples\n```rescript\nFloat.compare(1.0, 1.0) == Ordering.equal\nFloat.compare(1.0, 2.0) == Ordering.less\nFloat.compare(2.0, 1.0) == Ordering.greater\n```" - ], - "signature": "let compare: (float, float) => Ordering.t" - }, - { - "id": "Stdlib.Float.isNaN", - "kind": "value", - "name": "isNaN", - "docstrings": [ - "`isNaN(v)` tests if the given `v` is `NaN`.\nSee [`isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) on MDN.\n\n## Examples\n\n```rescript\nFloat.isNaN(3.0) // false\nFloat.isNaN(Float.Constants.nan) // true\n```" - ], - "signature": "let isNaN: float => bool" - }, - { - "id": "Stdlib.Float.isFinite", - "kind": "value", - "name": "isFinite", - "docstrings": [ - "`isFinite(v)` tests if the given `v` is finite.\nSee [`isFinite`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite) on MDN.\n\n## Examples\n\n```rescript\nFloat.isFinite(1.0) == true\nFloat.isFinite(Float.Constants.nan) == false\nFloat.isFinite(Float.Constants.positiveInfinity) == false\n```" - ], - "signature": "let isFinite: float => bool" - }, - { - "id": "Stdlib.Float.parseFloat", - "kind": "value", - "name": "parseFloat", - "docstrings": [ - "`parseFloat(v)` parse the given `v` and returns a float. Leading whitespace in\n`v` is ignored. Returns `NaN` if `v` can't be parsed. Use \\[`fromString`\\] to\nensure it returns a valid float and not `NaN`.\nSee [`parseFloat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseFloat(\"1.0\") == 1.0\nFloat.parseFloat(\" 3.14 \") == 3.14\nFloat.parseFloat(\"3.0\") == 3.0\nFloat.parseFloat(\"3.14some non-digit characters\") == 3.14\nFloat.parseFloat(\"error\")->Float.isNaN == true\n```" - ], - "signature": "let parseFloat: string => float" - }, - { - "id": "Stdlib.Float.parseInt", - "kind": "value", - "name": "parseInt", - "docstrings": [ - "`parseInt(v, ~radix=?)` parse the given `v` and returns a float. Leading\nwhitespace in this argument `v`is ignored. `radix` specifies the radix base to\nuse for the formatted number. The value must be in the range \\[2, 36\\] (inclusive).\nReturns `NaN` if `v` can't be parsed and `radix` is smaller than 2 or bigger\nthan 36.\nSee [`parseInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseInt(\"1.0\") == 1.0\nFloat.parseInt(\" 3.14 \") == 3.0\nFloat.parseInt(3) == 3.0\nFloat.parseInt(\"3.14some non-digit characters\") == 3.0\nFloat.parseInt(\"error\")->Float.isNaN == true\nFloat.parseInt(\"10.0\", ~radix=2) == 2.0\nFloat.parseInt(\"15 * 3\", ~radix=10) == 15.0\nFloat.parseInt(\"12\", ~radix=13) == 15.0\nFloat.parseInt(\"17\", ~radix=40)->Float.isNaN == true\n```" - ], - "signature": "let parseInt: ('a, ~radix: int=?) => float" - }, - { - "id": "Stdlib.Float.parseIntWithRadix", - "kind": "value", - "name": "parseIntWithRadix", - "docstrings": [ - "`parseIntWithRadix(v, ~radix)` parse the given `v` and returns a float. Leading\nwhitespace in this argument `v`is ignored. `radix` specifies the radix base to\nuse for the formatted number. The value must be in the range \\[2, 36\\] (inclusive).\nReturns `NaN` if `v` can't be parsed and `radix` is smaller than 2 or bigger\nthan 36.\nSee [`parseInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseIntWithRadix(\"10.0\", ~radix=2) == 2.0\nFloat.parseIntWithRadix(\"15 * 3\", ~radix=10) == 15.0\nFloat.parseIntWithRadix(\"12\", ~radix=13) == 15.0\nFloat.parseIntWithRadix(\"17\", ~radix=40)->Float.isNaN == true\n```" - ], - "signature": "let parseIntWithRadix: ('a, ~radix: int) => float", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "`toExponential(v, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponential(1000.0) == \"1e+3\"\nFloat.toExponential(-1000.0) == \"-1e+3\"\nFloat.toExponential(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponential(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponential: (float, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Float.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "`toExponential(v, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponentialWithPrecision(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponentialWithPrecision(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponentialWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toFixed", - "kind": "value", - "name": "toFixed", - "docstrings": [ - "`toFixed(v, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixed(123456.0) == \"123456\"\nFloat.toFixed(10.0) == \"10\"\nFloat.toFixed(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixed(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixed: (float, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Float.toFixedWithPrecision", - "kind": "value", - "name": "toFixedWithPrecision", - "docstrings": [ - "`toFixedWithPrecision(v, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixedWithPrecision(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixedWithPrecision(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixedWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "`toPrecision(v, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecision(100.0) == \"100\"\nFloat.toPrecision(1.0) == \"1\"\nFloat.toPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecision: (float, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Float.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "`toPrecisionWithPrecision(v, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecisionWithPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecisionWithPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecisionWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(v)` return a `string` representing the given value.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toString(1000.0) == \"1000\"\nFloat.toString(-1000.0) == \"-1000\"\n```" - ], - "signature": "let toString: (float, ~radix: int=?) => string" - }, - { - "id": "Stdlib.Float.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "`toStringWithRadix(v, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toStringWithRadix(6.0, ~radix=2) == \"110\"\nFloat.toStringWithRadix(3735928559.0, ~radix=16) == \"deadbeef\"\nFloat.toStringWithRadix(123456.0, ~radix=36) == \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." - ], - "signature": "let toStringWithRadix: (float, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(v)` return a `string` with language-sensitive representing the\ngiven value.\nSee [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nFloat.toLocaleString(1000.0) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nFloat.toLocaleString(1000.0) // \"1.000\"\n```" - ], - "signature": "let toLocaleString: float => string" - }, - { - "id": "Stdlib.Float.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(str)` return an `option` representing the given value `str`.\n\n## Examples\n\n```rescript\nFloat.fromString(\"0\") == Some(0.0)\nFloat.fromString(\"NaN\") == None\nFloat.fromString(\"6\") == Some(6.0)\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.Float.toInt", - "kind": "value", - "name": "toInt", - "docstrings": [ - "`toInt(v)` returns an int to given float `v`.\n\n## Examples\n\n```rescript\nFloat.toInt(2.0) == 2\nFloat.toInt(1.0) == 1\nFloat.toInt(1.1) == 1\nFloat.toInt(1.6) == 1\n```" - ], - "signature": "let toInt: float => int" - }, - { - "id": "Stdlib.Float.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "`fromInt(v)` returns a float to given int `v`.\n\n## Examples\n\n```rescript\nFloat.fromInt(2) == 2.0\nFloat.fromInt(1) == 1.0\n```" - ], - "signature": "let fromInt: int => float" - }, - { - "id": "Stdlib.Float.mod", - "kind": "value", - "name": "mod", - "docstrings": [ - "`mod(n1, n2)` calculates the modulo (remainder after division) of two floats.\n\n## Examples\n\n```rescript\nFloat.mod(7.0, 4.0) == 3.0\n```" - ], - "signature": "let mod: (float, float) => float" - }, - { - "id": "Stdlib.Float.clamp", - "kind": "value", - "name": "clamp", - "docstrings": [ - "`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nFloat.clamp(4.2) == 4.2\nFloat.clamp(4.2, ~min=4.3) == 4.3\nFloat.clamp(4.2, ~max=4.1) == 4.1\nFloat.clamp(4.2, ~min=4.3, ~max=4.1) == 4.3\n```" - ], - "signature": "let clamp: (~min: float=?, ~max: float=?, float) => float" - }, - { - "id": "Stdlib.Float.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(float)` ignores the provided float and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: float => unit" - } - ] - }, - "stdlib/error": { - "id": "Stdlib.Error", - "name": "Error", - "docstrings": [ - "Functions for working with JavaScript exceptions.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) on MDN." - ], - "items": [ - { - "id": "Stdlib.Error.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JavaScript exception." - ], - "signature": "type t = Exn.t", - "deprecated": "" - }, - { - "id": "Stdlib.Error.fromException", - "kind": "value", - "name": "fromException", - "docstrings": [], - "signature": "let fromException: exn => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.toException", - "kind": "value", - "name": "toException", - "docstrings": [ - "Turns an `Error.t` into an `exn`.\n\n## Examples\n```rescript\nlet error = Error.make(\"Something went wrong.\")\n\nlet asExn = error->Error.toException // `asExn` is now type `exn`\n```" - ], - "signature": "let toException: t => exn", - "deprecated": "Use functions from `JsExn` instead" - }, - { - "id": "Stdlib.Error.stack", - "kind": "value", - "name": "stack", - "docstrings": [ - "`stack(error)` retrieves the `stack` property of the error, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\nlet error = Error.make(\"error\")\nConsole.log(error->Error.stack) // Logs `stack` if it exists on `someError`\n```" - ], - "signature": "let stack: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.message", - "kind": "value", - "name": "message", - "docstrings": [ - "`message(error)` retrieves the `message` property of the error, if it exists.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\nlet error = Error.SyntaxError.make(\"Some message here\")\nConsole.log(error->Error.message) // Logs \"Some message here\" to the console\n```" - ], - "signature": "let message: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.name", - "kind": "value", - "name": "name", - "docstrings": [ - "`name(error)` retrieves the `name` property of the error, if it exists.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\nlet error = Error.SyntaxError.make(\"Some message here\")\nConsole.log(error->Error.name) // Logs \"SyntaxError\" to the console\n```" - ], - "signature": "let name: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [ - "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." - ], - "signature": "let fileName: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(message)` creates a new error, setting its `message` to the provided value.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error) on MDN.\n\n## Example\n```rescript\nlet error = Error.make(\"Some message here\")\nConsole.log(error->Error.message) // Logs \"Some message here\" to the console\nConsole.log(error->Error.name) // Logs \"Error\" to the console, because this is a regular error\n```" - ], - "signature": "let make: string => t", - "deprecated": "" - }, - { - "id": "Stdlib.Error.raise", - "kind": "value", - "name": "raise", - "docstrings": [ - "Raises (throws in JavaScript language) the provided `Error.t`, which will stop execution.\n\n## Examples\n```rescript\nlet error = Error.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n error->Error.raise\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" - ], - "signature": "let raise: t => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Error.throw", - "kind": "value", - "name": "throw", - "docstrings": [ - "Throws the given exception, terminating execution unless caught by a surrounding try/catch block.\n\n## Examples\n\n```rescript\nlet error = Error.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n Error.throw(error)\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" - ], - "signature": "let throw: t => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Error.panic", - "kind": "value", - "name": "panic", - "docstrings": [ - "Throws a panic exception with the given message.\n\nA panic exception is a native JavaScript exception that is not intended to be caught and\nhandled. Compared to a ReScript exception this will give a better stack trace and\ndebugging experience.\n\n## Examples\n\n```rescript\ntry {\n Error.panic(\"Uh oh. This was unexpected!\")\n} catch {\n| Exn.Error(obj) =>\n switch Exn.message(obj) {\n | Some(m) => assert(m == \"Panic! Uh oh. This was unexpected!\")\n | None => assert(false)\n }\n| _ => assert(false)\n}\n```" - ], - "signature": "let panic: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Error.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(error)` ignores the provided error and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit", - "deprecated": "" - } - ] - }, - "stdlib/exn": { - "id": "Stdlib.Exn", - "name": "Exn", - "docstrings": [ - "Provide utilities for dealing with JS exceptions." - ], - "items": [ - { - "id": "Stdlib.Exn.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JS exception" - ], - "signature": "type t", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.asJsExn", - "kind": "value", - "name": "asJsExn", - "docstrings": [], - "signature": "let asJsExn: exn => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.stack", - "kind": "value", - "name": "stack", - "docstrings": [], - "signature": "let stack: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.message", - "kind": "value", - "name": "message", - "docstrings": [], - "signature": "let message: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.name", - "kind": "value", - "name": "name", - "docstrings": [], - "signature": "let name: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [], - "signature": "let fileName: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.anyToExnInternal", - "kind": "value", - "name": "anyToExnInternal", - "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a Exn.Error if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." - ], - "signature": "let anyToExnInternal: 'a => exn", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseError", - "kind": "value", - "name": "raiseError", - "docstrings": [ - "Raise Js exception Error object with stacktrace" - ], - "signature": "let raiseError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseEvalError", - "kind": "value", - "name": "raiseEvalError", - "docstrings": [], - "signature": "let raiseEvalError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseRangeError", - "kind": "value", - "name": "raiseRangeError", - "docstrings": [], - "signature": "let raiseRangeError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseReferenceError", - "kind": "value", - "name": "raiseReferenceError", - "docstrings": [], - "signature": "let raiseReferenceError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseSyntaxError", - "kind": "value", - "name": "raiseSyntaxError", - "docstrings": [], - "signature": "let raiseSyntaxError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseTypeError", - "kind": "value", - "name": "raiseTypeError", - "docstrings": [], - "signature": "let raiseTypeError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseUriError", - "kind": "value", - "name": "raiseUriError", - "docstrings": [], - "signature": "let raiseUriError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(exn)` ignores the provided exn and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit", - "deprecated": "" - } - ] - }, - "stdlib/dict": { - "id": "Stdlib.Dict", - "name": "Dict", - "docstrings": [ - "A mutable dictionary with string keys.\n\nCompiles to a regular JavaScript object." - ], - "items": [ - { - "id": "Stdlib.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a dictionary of value `'a`." - ], - "signature": "type t<'a> = dict<'a>" - }, - { - "id": "Stdlib.Dict.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(dict, key)` Returns the `value` at the provided `key`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `key` does not exist in `dict`.\n\nUse `Dict.getUnsafe` only when you are sure the key exists (i.e. when iterating `Dict.keys` result).\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\nlet value = dict->Dict.getUnsafe(\"key1\")\nConsole.log(value) // value1\n```" - ], - "signature": "let getUnsafe: (dict<'a>, string) => 'a" - }, - { - "id": "Stdlib.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the value at the provided key, if it exists. Returns an option.\n\n## Examples\n```rescript\nlet dict = dict{\"someKey\": \"someValue\"}\n\nswitch dict->Dict.get(\"someKey\") {\n| None => Console.log(\"Nope, didn't have the key.\")\n| Some(value) => Console.log(value)\n}\n```\n\n## Alternative: Pattern Matching with `dict{}`\n\nFor nested dictionary access, consider using the more concise `dict{}` pattern matching syntax:\n\n```rescript\n// More concise approach using pattern matching\nlet decodeImageUrl = (json: JSON.t) => {\n switch json {\n | JSON.Object(dict{\"data\": JSON.Object(dict{\"image_url\": JSON.String(url)})}) => Some(url)\n | _ => None\n }\n}\n\n// Alternative using Dict.get\nlet decodeImageUrl = (json: JSON.t) => {\n switch json {\n | JSON.Object(obj) =>\n switch Dict.get(obj, \"data\") {\n | Some(JSON.Object(data)) =>\n switch Dict.get(data, \"image_url\") {\n | Some(JSON.String(url)) => Some(url)\n | _ => None\n }\n | _ => None\n }\n | _ => None\n }\n}\n```" - ], - "signature": "let get: (dict<'a>, string) => option<'a>" - }, - { - "id": "Stdlib.Dict.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(dictionary, key, value)` sets the value at the provided key to the provided value.\n\n## Examples\n```rescript\nlet dict = Dict.make()\n\ndict->Dict.set(\"someKey\", \"someValue\")\n```" - ], - "signature": "let set: (dict<'a>, string, 'a) => unit" - }, - { - "id": "Stdlib.Dict.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "`delete(dictionary, key)` deletes the value at `key`, if it exists.\n\n## Examples\n```rescript\nlet dict = dict{\"someKey\": \"someValue\"}\n\ndict->Dict.delete(\"someKey\")\n```" - ], - "signature": "let delete: (dict<'a>, string) => unit" - }, - { - "id": "Stdlib.Dict.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make()` creates a new, empty dictionary.\n\n## Examples\n```rescript\nlet dict1: dict = Dict.make() // You can annotate the type of the values of your dict yourself if you want\n\nlet dict2 = Dict.make() // Or you can let ReScript infer it via usage.\ndict2->Dict.set(\"someKey\", 12)\n```" - ], - "signature": "let make: unit => dict<'a>" - }, - { - "id": "Stdlib.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(entries)` creates a new dictionary from the provided array of key/value pairs.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([(\"key1\", \"value1\"), (\"key2\", \"value2\")])\n```" - ], - "signature": "let fromArray: array<(string, 'a)> => dict<'a>" - }, - { - "id": "Stdlib.Dict.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "`fromIterator(entries)` creates a new dictionary from the provided iterator of key/value pairs.\n\n## Examples\n\n```rescript\nlet iterator: Iterator.t<(string, int)> = %raw(`\n (() => {\n var map1 = new Map();\n map1.set('first', 1);\n map1.set('second', 2);\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\niterator\n->Dict.fromIterator\n->Dict.valuesToArray == [1, 2]\n```" - ], - "signature": "let fromIterator: Iterator.t<(string, 'a)> => dict<'a>" - }, - { - "id": "Stdlib.Dict.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(dictionary)` returns an array of all the key/value pairs of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet asArray = dict->Dict.toArray\nConsole.log(asArray) // Logs `[[\"someKey\", 1], [\"someKey2\", 2]]` to the console\n```" - ], - "signature": "let toArray: dict<'a> => array<(string, 'a)>" - }, - { - "id": "Stdlib.Dict.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "`keysToArray(dictionary)` returns an array of all the keys of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet keys = dict->Dict.keysToArray\nConsole.log(keys) // Logs `[\"someKey\", \"someKey2\"]` to the console\n```" - ], - "signature": "let keysToArray: dict<'a> => array" - }, - { - "id": "Stdlib.Dict.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(dictionary)` returns the number of key/value pairs in the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.size->assertEqual(0)\n\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\ndict->Dict.size->assertEqual(2)\n\n// After deleting a key\ndict->Dict.delete(\"someKey\")\ndict->Dict.size->assertEqual(1)\n```" - ], - "signature": "let size: dict<'a> => int" - }, - { - "id": "Stdlib.Dict.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(dictionary)` returns `true` if the dictionary is empty (has no key/value pairs), `false` otherwise.\n\n## Examples\n```rescript\nlet emptyDict = Dict.make()\nemptyDict->Dict.isEmpty->assertEqual(true)\n\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.isEmpty->assertEqual(false)\n\n// After clearing all keys\ndict->Dict.delete(\"someKey\")\ndict->Dict.isEmpty->assertEqual(true)\n```" - ], - "signature": "let isEmpty: dict<'a> => bool" - }, - { - "id": "Stdlib.Dict.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [ - "`valuesToArray(dictionary)` returns an array of all the values of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet values = dict->Dict.valuesToArray\nConsole.log(values) // Logs `[1, 2]` to the console\n```" - ], - "signature": "let valuesToArray: dict<'a> => array<'a>" - }, - { - "id": "Stdlib.Dict.assign", - "kind": "value", - "name": "assign", - "docstrings": [ - "`assign(dictionary1, dictionary2)` [shallowly](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) merges dictionary2 into dictionary1, and returns dictionary1.\n\nBeware this will *mutate* dictionary1. If you're looking for a way to copy a dictionary, check out `Dict.copy`.\n\n## Examples\n```rescript\nlet dict1 = Dict.make()\ndict1->Dict.set(\"firstKey\", 1)\nConsole.log(dict1->Dict.keysToArray) // Logs `[\"firstKey\"]`\n\nlet dict2 = Dict.make()\ndict2->Dict.set(\"someKey\", 2)\ndict2->Dict.set(\"someKey2\", 3)\n\nlet dict1 = dict1->Dict.assign(dict2)\n\nConsole.log(dict1->Dict.keysToArray) // Logs `[\"firstKey\", \"someKey\", \"someKey2\"]`\n```" - ], - "signature": "let assign: (dict<'a>, dict<'a>) => dict<'a>" - }, - { - "id": "Stdlib.Dict.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(dictionary)` [shallowly copies](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) the provided dictionary to a new dictionary.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\nlet dict2 = dict->Dict.copy\n\n// Both log `[\"key1\", \"key2\"]` here.\nConsole.log2(dict->Dict.keysToArray, dict2->Dict.keysToArray)\n```" - ], - "signature": "let copy: dict<'a> => dict<'a>" - }, - { - "id": "Stdlib.Dict.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(dictionary, f)` iterates through all values of the dict.\n\n> Please note that this is *without the keys*, just the values. If you need the key as well, use `Dict.forEachWithKey`.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\n\ndict->Dict.forEach(value => {\n Console.log(value)\n})\n```" - ], - "signature": "let forEach: (dict<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Dict.forEachWithKey", - "kind": "value", - "name": "forEachWithKey", - "docstrings": [ - "`forEachWithKey(dictionary, f)` iterates through all values of the dict, including the key for each value.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\n\ndict->Dict.forEachWithKey((value, key) => {\n Console.log2(value, key)\n})\n```" - ], - "signature": "let forEachWithKey: (dict<'a>, ('a, string) => unit) => unit" - }, - { - "id": "Stdlib.Dict.mapValues", - "kind": "value", - "name": "mapValues", - "docstrings": [ - "`mapValues(dictionary, f)` returns a new dictionary with the same keys, and `f` applied to each value in the original dictionary.\n\n## Examples\n\n```rescript\nlet dict = dict{\"key1\": 1, \"key2\": 2}\n\ndict->Dict.mapValues(v => v + 10)->Dict.toArray // [(\"key1\", 11), (\"key2\", 12)]\ndict->Dict.mapValues(v => Int.toString(v))->Dict.toArray // [(\"key1\", \"1\"), (\"key2\", \"2\")]\n```" - ], - "signature": "let mapValues: (dict<'a>, 'a => 'b) => dict<'b>" - }, - { - "id": "Stdlib.Dict.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(dictionary, \"key\")` returns true if the \"key\" is present in the dictionary.\n\nBe aware that it uses the JavaScript `in` operator under the hood.\n\n## Examples\n\n```rescript\nlet dict = dict{\"key1\": Some(1), \"key2\": None}\n\ndict->Dict.has(\"key1\") == true\ndict->Dict.has(\"key2\") == true\ndict->Dict.has(\"key3\") == false\ndict->Dict.has(\"toString\") == true\n```" - ], - "signature": "let has: (dict<'a>, string) => bool" - }, - { - "id": "Stdlib.Dict.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(dict)` ignores the provided dict and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: dict<'a> => unit" - } - ] - }, - "stdlib/date": { - "id": "Stdlib.Date", - "name": "Date", - "docstrings": [ - "Functions for interacting with JavaScript Dates." - ], - "items": [ - { - "id": "Stdlib.Date.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a JavaScript date." - ], - "signature": "type t" - }, - { - "id": "Stdlib.Date.msSinceEpoch", - "kind": "type", - "name": "msSinceEpoch", - "docstrings": [ - "Time, in milliseconds, since / until the UNIX epoch (January 1, 1970 00:00:00 UTC).\nPositive numbers represent dates after, negative numbers dates before epoch." - ], - "signature": "type msSinceEpoch = float" - }, - { - "id": "Stdlib.Date.localeOptions", - "kind": "type", - "name": "localeOptions", - "docstrings": [ - "A type representing date time format options.\n\nNote: There are some properties missing:\n- fractionalSecondDigits\n- dayPeriod\n- calendar\n- numberingSystem\n- localeMatcher\n- timeZone\n- hour12\n- hourCycle\n- formatMatcher\n\nSee full spec at https://tc39.es/ecma402/#datetimeformat-objects" - ], - "signature": "type localeOptions = {\n dateStyle?: [#full | #long | #medium | #short],\n timeStyle?: [#full | #long | #medium | #short],\n weekday?: [#long | #narrow | #short],\n era?: [#long | #narrow | #short],\n year?: [#\"2-digit\" | #numeric],\n month?: [\n | #\"2-digit\"\n | #long\n | #narrow\n | #numeric\n | #short\n ],\n day?: [#\"2-digit\" | #numeric],\n hour?: [#\"2-digit\" | #numeric],\n minute?: [#\"2-digit\" | #numeric],\n second?: [#\"2-digit\" | #numeric],\n timeZoneName?: [#long | #short],\n}" - }, - { - "id": "Stdlib.Date.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make()`\n\nCreates a date object with the current date time as value.\n\n## Examples\n```rescript\nDate.make()\n```" - ], - "signature": "let make: unit => t" - }, - { - "id": "Stdlib.Date.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(dateTimeString)`\n\nCreates a date object from given date time string.\nThe string has to be in the ISO 8601 format YYYY-MM-DDTHH:mm:ss.sssZ (https://tc39.es/ecma262/\\#sec-date-time-string-format).\n\nInvalid date time strings will create invalid dates.\nYou can use the result like any valid date, but many functions like `toString` will return \"Invalid Date\" or functions like `Date.getTime` will return NaN.\n\n## Examples\n```rescript\nDate.fromString(\"2023\") // 2023-01-01T00:00:00.000Z\n\nDate.fromString(\"2023-02-20\") // 2023-02-20T00:00:00.000Z\n\nDate.fromString(\"2023-02-20T16:40:00.00Z\") // 2023-02-20T16:40:00.000Z\n\nDate.fromString(\"\") // Invalid Date\n\nDate.fromString(\"\")->Date.getTime // NaN\n```" - ], - "signature": "let fromString: string => t" - }, - { - "id": "Stdlib.Date.fromTime", - "kind": "value", - "name": "fromTime", - "docstrings": [ - "`fromTime(msSinceEpoch)`\n\nCreates a date object from the given time in milliseconds since / until UNIX epoch (January 1, 1970 00:00:00 UTC).\nPositive numbers create dates after epoch, negative numbers create dates before epoch.\n\n## Examples\n```rescript\nDate.fromTime(0.0)\n// 1970-01-01T00:00:00.000Z\n\nDate.fromTime(-86_400_000.0)\n// 1969-12-31T00:00:00.000Z\n\nDate.fromTime(86_400_000.0)\n// 1970-01-02T00:00:00.000Z\n```" - ], - "signature": "let fromTime: msSinceEpoch => t" - }, - { - "id": "Stdlib.Date.makeWithYM", - "kind": "value", - "name": "makeWithYM", - "docstrings": [ - "Creates a date object with the given year and month.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYM(~year=2023, ~month=0)\n// 2023-01-01T00:00:00.000Z\n\nDate.makeWithYM(~year=2023, ~month=11)\n// 2023-12-01T00:00:00.000Z\n\nDate.makeWithYM(~year=2023, ~month=12)\n// 2024-01-01T00:00:00.000Z\n\nDate.makeWithYM(~year=2023, ~month=-1)\n// 2022-12-01T00:00:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYM: (~year: int, ~month: int) => t" - }, - { - "id": "Stdlib.Date.makeWithYMD", - "kind": "value", - "name": "makeWithYMD", - "docstrings": [ - "Creates a date object with the given year, month and date (day of month).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMD(~year=2023, ~month=1, ~day=20)\n// 2023-02-20T00:00:00.000Z\n\nDate.makeWithYMD(~year=2023, ~month=1, ~day=-1)\n// 2022-11-29T00:00:00.000Z\n\nDate.makeWithYMD(~year=2023, ~month=1, ~day=29)\n// 2023-03-01T00:00:00.000Z\n```" - ], - "signature": "let makeWithYMD: (~year: int, ~month: int, ~day: int) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDH", - "kind": "value", - "name": "makeWithYMDH", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month) and hours.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=16)\n// 2023-02-20T16:00:00.000Z\n\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=24)\n// 2023-02-21T00:00:00.000Z\n\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=-1)\n// 2023-02-19T23:00:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDH: (~year: int, ~month: int, ~day: int, ~hours: int) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDHM", - "kind": "value", - "name": "makeWithYMDHM", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours and minutes.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=60)\n// 2023-02-20T17:00:00.000Z\n\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=-1)\n// 2023-02-20T15:59:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDHM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDHMS", - "kind": "value", - "name": "makeWithYMDHMS", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours, minutes and seconds.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=60)\n// 2023-02-20T16:41:00.000Z\n\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=-1)\n// 2023-02-20T16:39:59.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDHMS: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDHMSM", - "kind": "value", - "name": "makeWithYMDHMSM", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours, minutes, seconds and milliseconds.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=0,\n)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=1000,\n)\n// 2023-02-20T16:40:01.000Z\n\nDate.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=-1,\n)\n// 2023-02-20T16:39:59.999Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDHMSM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => t" - }, - { - "id": "Stdlib.Date.now", - "kind": "value", - "name": "now", - "docstrings": [ - "`now()`\n\nReturns the time, in milliseconds, between UNIX epoch (January 1, 1970 00:00:00 UTC) and the current date time." - ], - "signature": "let now: unit => msSinceEpoch" - }, - { - "id": "Stdlib.Date.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(date1, date2)` checks if two dates represent the same point in time.\n\n## Examples\n```rescript\nDate.equal(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-01\")) == true\nDate.equal(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-02\")) == false\n```" - ], - "signature": "let equal: (t, t) => bool" - }, - { - "id": "Stdlib.Date.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(date1, date2)` compares two dates chronologically, returns an `Ordering.t` value.\n\n## Examples\n```rescript\nDate.compare(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-01\")) == Ordering.equal\nDate.compare(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-02\")) == Ordering.less\nDate.compare(Date.fromString(\"2023-01-02\"), Date.fromString(\"2023-01-01\")) == Ordering.greater\n```" - ], - "signature": "let compare: (t, t) => Ordering.t" - }, - { - "id": "Stdlib.Date.getTime", - "kind": "value", - "name": "getTime", - "docstrings": [ - "`getTime(date)`\n\nReturns the time, in milliseconds, between UNIX epoch (January 1, 1970 00:00:00 UTC) and the current date time.\nInvalid dates will return NaN.\nDates before epoch will return negative numbers.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20\")->Date.getTime\n// 1676851200000\n```" - ], - "signature": "let getTime: t => msSinceEpoch" - }, - { - "id": "Stdlib.Date.getTimezoneOffset", - "kind": "value", - "name": "getTimezoneOffset", - "docstrings": [ - "`getTimezoneOffset(date)`\n\nReturns the time in minutes between the UTC time and the locale time.\nThe timezone of the given date doesn't matter.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01\")->Date.getTimezoneOffset\n// -60 with local time zone = Europe/Berlin\n\nDate.fromString(\"2023-06-01\")->Date.getTimezoneOffset\n// -120 with local time zone = Europe/Berlin\n```" - ], - "signature": "let getTimezoneOffset: t => int" - }, - { - "id": "Stdlib.Date.getFullYear", - "kind": "value", - "name": "getFullYear", - "docstrings": [ - "`getFullYear(date)`\n\nReturns the year of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20\")->Date.getFullYear\n// 2023\n```" - ], - "signature": "let getFullYear: t => int" - }, - { - "id": "Stdlib.Date.getMonth", - "kind": "value", - "name": "getMonth", - "docstrings": [ - "`getMonth(date)`\n\nReturns the month (0-indexed) of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01\")->Date.getMonth\n// 0\n```" - ], - "signature": "let getMonth: t => int" - }, - { - "id": "Stdlib.Date.getDate", - "kind": "value", - "name": "getDate", - "docstrings": [ - "`getDate(date)`\n\nReturns the date (day of month) of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getDate\n// 20\n```" - ], - "signature": "let getDate: t => int" - }, - { - "id": "Stdlib.Date.getHours", - "kind": "value", - "name": "getHours", - "docstrings": [ - "`getHours(date)`\n\nReturns the hours of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getHours\n// 16\n```" - ], - "signature": "let getHours: t => int" - }, - { - "id": "Stdlib.Date.getMinutes", - "kind": "value", - "name": "getMinutes", - "docstrings": [ - "`getMinutes(date)`\n\nReturns the minutes of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getMinutes\n// 40\n```" - ], - "signature": "let getMinutes: t => int" - }, - { - "id": "Stdlib.Date.getSeconds", - "kind": "value", - "name": "getSeconds", - "docstrings": [ - "`getSeconds(date)`\n\nReturns the seconds of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getSeconds\n// 0\n```" - ], - "signature": "let getSeconds: t => int" - }, - { - "id": "Stdlib.Date.getMilliseconds", - "kind": "value", - "name": "getMilliseconds", - "docstrings": [ - "`getMilliseconds(date)`\n\nReturns the milliseconds of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getMilliseconds\n// 0\n```" - ], - "signature": "let getMilliseconds: t => int" - }, - { - "id": "Stdlib.Date.getDay", - "kind": "value", - "name": "getDay", - "docstrings": [ - "`getDay(date)`\n\nReturns the day of week of a given date (according to local time).\n0 = Sunday, 1 = Monday, ... 6 = Saturday\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getDay\n// 1\n```" - ], - "signature": "let getDay: t => int" - }, - { - "id": "Stdlib.Date.setFullYear", - "kind": "value", - "name": "setFullYear", - "docstrings": [ - "`setFullYear(date, year)`\n\nSets the year of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYear(2024)\n```" - ], - "signature": "let setFullYear: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setFullYearM", - "kind": "value", - "name": "setFullYearM", - "docstrings": [ - "`setFullYearM(date, ~year, ~month)`\n\nSets the year and month of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYearM(~year=2024, ~month=0)\n```" - ], - "signature": "let setFullYearM: (t, ~year: int, ~month: int) => unit" - }, - { - "id": "Stdlib.Date.setFullYearMD", - "kind": "value", - "name": "setFullYearMD", - "docstrings": [ - "`setFullYearMD(date, ~year, ~month, ~day)`\n\nSets the year, month and date (day of month) of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYearMD(~year=2024, ~month=0, ~day=1)\n```" - ], - "signature": "let setFullYearMD: (t, ~year: int, ~month: int, ~day: int) => unit" - }, - { - "id": "Stdlib.Date.setMonth", - "kind": "value", - "name": "setMonth", - "docstrings": [ - "`setMonth(date, month)`\n\nSets the month of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMonth(0)\n```" - ], - "signature": "let setMonth: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setDate", - "kind": "value", - "name": "setDate", - "docstrings": [ - "`setDate(date, day)`\n\nSets the date (day of month) of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setDate(1)\n```" - ], - "signature": "let setDate: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setHours", - "kind": "value", - "name": "setHours", - "docstrings": [ - "`setHours(date, hours)`\n\nSets the hours of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHours(0)\n```" - ], - "signature": "let setHours: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setHoursM", - "kind": "value", - "name": "setHoursM", - "docstrings": [ - "`setHoursM(date, ~hours, ~minutes)`\n\nSets the hours and minutes of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHoursM(~hours=0, ~minutes=0)\n```" - ], - "signature": "let setHoursM: (t, ~hours: int, ~minutes: int) => unit" - }, - { - "id": "Stdlib.Date.setHoursMS", - "kind": "value", - "name": "setHoursMS", - "docstrings": [ - "`setHoursMS(date, ~hours, ~minutes, ~seconds)`\n\nSets the hours, minutes and seconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHoursMS(~hours=0, ~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setHoursMS: (t, ~hours: int, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setHoursMSMs", - "kind": "value", - "name": "setHoursMSMs", - "docstrings": [ - "`setHoursMSMs(date, ~hours, ~minutes, ~seconds, ~milliseconds)`\n\nSets the hours, minutes, seconds and milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHoursMSMs(\n ~hours=0,\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setHoursMSMs: (\n t,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setMinutes", - "kind": "value", - "name": "setMinutes", - "docstrings": [ - "`setMinutes(date, minutes)`\n\nSets the minutes of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMinutes(0)\n```" - ], - "signature": "let setMinutes: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setMinutesS", - "kind": "value", - "name": "setMinutesS", - "docstrings": [ - "`setMinutesS(date, ~minutes, ~seconds)`\n\nSets the minutes and seconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMinutesS(~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setMinutesS: (t, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setMinutesSMs", - "kind": "value", - "name": "setMinutesSMs", - "docstrings": [ - "`setMinutesSMs(date, ~minutes, ~seconds, ~milliseconds)`\n\nSets the minutes, seconds and milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMinutesSMs(\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setMinutesSMs: (\n t,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setSeconds", - "kind": "value", - "name": "setSeconds", - "docstrings": [ - "`setSeconds(date, seconds)`\n\nSets the seconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setSeconds(0)\n```" - ], - "signature": "let setSeconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setSecondsMs", - "kind": "value", - "name": "setSecondsMs", - "docstrings": [ - "`setSecondsMs(date, ~seconds, ~milliseconds)`\n\nSets the seconds and milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setSecondsMs(~seconds=0, ~milliseconds=0)\n```" - ], - "signature": "let setSecondsMs: (t, ~seconds: int, ~milliseconds: int) => unit" - }, - { - "id": "Stdlib.Date.setMilliseconds", - "kind": "value", - "name": "setMilliseconds", - "docstrings": [ - "`setMilliseconds(date, milliseconds)`\n\nSets the milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMilliseconds(0)\n```" - ], - "signature": "let setMilliseconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.getUTCFullYear", - "kind": "value", - "name": "getUTCFullYear", - "docstrings": [ - "`getUTCFullYear(date)`\n\nReturns the year of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCFullYear // 2022\n```" - ], - "signature": "let getUTCFullYear: t => int" - }, - { - "id": "Stdlib.Date.getUTCMonth", - "kind": "value", - "name": "getUTCMonth", - "docstrings": [ - "`getUTCMonth(date)`\n\nReturns the month of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCMonth // 11\n```" - ], - "signature": "let getUTCMonth: t => int" - }, - { - "id": "Stdlib.Date.getUTCDate", - "kind": "value", - "name": "getUTCDate", - "docstrings": [ - "`getUTCDate(date)`\n\nReturns the date (day of month) of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCDate // 31\n```" - ], - "signature": "let getUTCDate: t => int" - }, - { - "id": "Stdlib.Date.getUTCHours", - "kind": "value", - "name": "getUTCHours", - "docstrings": [ - "`getUTCHours(date)`\n\nReturns the hours of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCHours // 23\n```" - ], - "signature": "let getUTCHours: t => int" - }, - { - "id": "Stdlib.Date.getUTCMinutes", - "kind": "value", - "name": "getUTCMinutes", - "docstrings": [ - "`getUTCMinutes(date)`\n\nReturns the minutes of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCMinutes // 0\n```" - ], - "signature": "let getUTCMinutes: t => int" - }, - { - "id": "Stdlib.Date.getUTCSeconds", - "kind": "value", - "name": "getUTCSeconds", - "docstrings": [ - "`getUTCSeconds(date)`\n\nReturns the seconds of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCSeconds // 0\n```" - ], - "signature": "let getUTCSeconds: t => int" - }, - { - "id": "Stdlib.Date.getUTCMilliseconds", - "kind": "value", - "name": "getUTCMilliseconds", - "docstrings": [ - "`getUTCMilliseconds(date)`\n\nReturns the milliseconds of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCMilliseconds // 0\n```" - ], - "signature": "let getUTCMilliseconds: t => int" - }, - { - "id": "Stdlib.Date.getUTCDay", - "kind": "value", - "name": "getUTCDay", - "docstrings": [ - "`getUTCDay(date)`\n\nReturns the day (day of week) of a given date (according to UTC time).\n0 = Sunday, 1 = Monday, ... 6 = Saturday\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCDay // 6\n```" - ], - "signature": "let getUTCDay: t => int" - }, - { - "id": "Stdlib.Date.setUTCFullYear", - "kind": "value", - "name": "setUTCFullYear", - "docstrings": [ - "`setUTCFullYear(date, year)`\n\nSets the year of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYear(2024)\n```" - ], - "signature": "let setUTCFullYear: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCFullYearM", - "kind": "value", - "name": "setUTCFullYearM", - "docstrings": [ - "`setUTCFullYearM(date, ~year, ~month)`\n\nSets the year and month of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYearM(~year=2024, ~month=0)\n```" - ], - "signature": "let setUTCFullYearM: (t, ~year: int, ~month: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCFullYearMD", - "kind": "value", - "name": "setUTCFullYearMD", - "docstrings": [ - "`setUTCFullYearMD(date, ~year, ~month, ~day)`\n\nSets the year, month and date (day of month) of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYearMD(~year=2024, ~month=0, ~day=1)\n```" - ], - "signature": "let setUTCFullYearMD: (t, ~year: int, ~month: int, ~day: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMonth", - "kind": "value", - "name": "setUTCMonth", - "docstrings": [ - "`setUTCMonth(date, month)`\n\nSets the month of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMonth(0)\n```" - ], - "signature": "let setUTCMonth: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCDate", - "kind": "value", - "name": "setUTCDate", - "docstrings": [ - "`setDate(date, day)`\n\nSets the date (day of month) of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCDate(1)\n```" - ], - "signature": "let setUTCDate: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHours", - "kind": "value", - "name": "setUTCHours", - "docstrings": [ - "`setUTCHours(date, hours)`\n\nSets the hours of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHours(0)\n```" - ], - "signature": "let setUTCHours: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHoursM", - "kind": "value", - "name": "setUTCHoursM", - "docstrings": [ - "`setHoursM(date, ~hours, ~minutes)`\n\nSets the hours and minutes of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHoursM(~hours=0, ~minutes=0)\n```" - ], - "signature": "let setUTCHoursM: (t, ~hours: int, ~minutes: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHoursMS", - "kind": "value", - "name": "setUTCHoursMS", - "docstrings": [ - "`setUTCHoursMS(date, ~hours, ~minutes, ~seconds)`\n\nSets the hours, minutes and seconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHoursMS(~hours=0, ~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setUTCHoursMS: (t, ~hours: int, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHoursMSMs", - "kind": "value", - "name": "setUTCHoursMSMs", - "docstrings": [ - "`setUTCHoursMSMs(date, ~hours, ~minutes, ~seconds, ~milliseconds)`\n\nSets the hours, minutes, seconds and milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHoursMSMs(\n ~hours=0,\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setUTCHoursMSMs: (\n t,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setUTCMinutes", - "kind": "value", - "name": "setUTCMinutes", - "docstrings": [ - "`setUTCMinutes(date, minutes)`\n\nSets the minutes of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMinutes(0)\n```" - ], - "signature": "let setUTCMinutes: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMinutesS", - "kind": "value", - "name": "setUTCMinutesS", - "docstrings": [ - "`setUTCMinutesS(date, ~minutes, ~seconds)`\n\nSets the minutes and seconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMinutesS(~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setUTCMinutesS: (t, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMinutesSMs", - "kind": "value", - "name": "setUTCMinutesSMs", - "docstrings": [ - "`setUTCMinutesSMs(date, ~minutes, ~seconds, ~milliseconds)`\n\nSets the minutes, seconds and milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMinutesSMs(\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setUTCMinutesSMs: (\n t,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setUTCSeconds", - "kind": "value", - "name": "setUTCSeconds", - "docstrings": [ - "`setUTCSeconds(date, seconds)`\n\nSets the seconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCSeconds(0)\n```" - ], - "signature": "let setUTCSeconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCSecondsMs", - "kind": "value", - "name": "setUTCSecondsMs", - "docstrings": [ - "`setUTCSecondsMs(date, ~seconds, ~milliseconds)`\n\nSets the seconds and milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCSecondsMs(~seconds=0, ~milliseconds=0)\n```" - ], - "signature": "let setUTCSecondsMs: (t, ~seconds: int, ~milliseconds: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMilliseconds", - "kind": "value", - "name": "setUTCMilliseconds", - "docstrings": [ - "`setUTCMilliseconds(date, milliseconds)`\n\nSets the milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMilliseconds(0)\n```" - ], - "signature": "let setUTCMilliseconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.toDateString", - "kind": "value", - "name": "toDateString", - "docstrings": [ - "`toDateString(date)`\n\nConverts a JavaScript date to a standard date string. The date will be mapped to the current time zone.\nIf you want to convert it to a localized string, use `Date.toLocaleDateString` instead.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.toDateString->Console.log\n// Sun Jan 01 2023\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toDateString->Console.log\n// Sat Dec 31 2022\n```" - ], - "signature": "let toDateString: t => string" - }, - { - "id": "Stdlib.Date.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(date)`\n\nConverts a JavaScript date to a standard date time string. The date will be mapped to the current time zone.\nIf you want to convert it to a localized string, use `Date.toLocaleString` instead.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.toString->Console.log\n// Sun Jan 01 2023 00:00:00 GMT+0100 (Central European Standard Time)\n\nDate.fromString(\"2023-06-01T00:00:00.00+01:00\")->Date.toString->Console.log\n// Thu Jun 01 2023 01:00:00 GMT+0200 (Central European Summer Time)\n```" - ], - "signature": "let toString: t => string" - }, - { - "id": "Stdlib.Date.toTimeString", - "kind": "value", - "name": "toTimeString", - "docstrings": [ - "`toTimeString(date)`\n\nConverts a JavaScript date to a standard time string. The date will be mapped to the current time zone.\nIf you want to convert it to a localized string, use `Date.toLocaleStimeString` instead.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.toTimeString->Console.log\n// 00:00:00 GMT+0100 (Central European Standard Time)\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toTimeString->Console.log\n// 17:00:00 GMT+0100 (Central European Standard Time)\n```" - ], - "signature": "let toTimeString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleDateString", - "kind": "value", - "name": "toLocaleDateString", - "docstrings": [ - "`toLocaleDateString(date)`\n\nConverts a JavaScript date to a localized date string. It will use the current locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleDateString->Console.log\n// 2/19/2023\n```" - ], - "signature": "let toLocaleDateString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleDateStringWithLocale", - "kind": "value", - "name": "toLocaleDateStringWithLocale", - "docstrings": [ - "`toLocaleDateStringWithLocale(date, locale)`\n\nConverts a JavaScript date to a localized date string. It will use the specified locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleDateStringWithLocale(\"en-US\")->Console.log\n// 2/19/2023\n```" - ], - "signature": "let toLocaleDateStringWithLocale: (t, string) => string" - }, - { - "id": "Stdlib.Date.toLocaleDateStringWithLocaleAndOptions", - "kind": "value", - "name": "toLocaleDateStringWithLocaleAndOptions", - "docstrings": [ - "`toLocaleDateStringWithLocaleAndOptions(date, locale, options)`\n\nConverts a JavaScript date to a localized date string. It will use the specified locale and formatting options.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleDateStringWithLocaleAndOptions(\"en-US\", {dateStyle: #long})->Console.log\n// February 19, 2023\n\nDate.make()\n->Date.toLocaleDateStringWithLocaleAndOptions(\"de\", {hour: #\"2-digit\", minute: #\"2-digit\"})\n->Console.log\n// 19.2.2023, 15:40\n\nDate.make()->Date.toLocaleDateStringWithLocaleAndOptions(\"de\", {year: #numeric})->Console.log\n// 2023\n```" - ], - "signature": "let toLocaleDateStringWithLocaleAndOptions: (t, string, localeOptions) => string" - }, - { - "id": "Stdlib.Date.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(date)`\n\nConverts a JavaScript date to a localized date-time string. It will use the current locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleString->Console.log\n// 2/19/2023, 3:40:00 PM\n```" - ], - "signature": "let toLocaleString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleStringWithLocale", - "kind": "value", - "name": "toLocaleStringWithLocale", - "docstrings": [ - "`toLocaleStringWithLocale(date, locale)`\n\nConverts a JavaScript date to a localized date-time string. It will use the specified locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleStringWithLocale(\"en-US\")->Console.log\n// 2/19/2023, 3:40:00 PM\n```" - ], - "signature": "let toLocaleStringWithLocale: (t, string) => string" - }, - { - "id": "Stdlib.Date.toLocaleStringWithLocaleAndOptions", - "kind": "value", - "name": "toLocaleStringWithLocaleAndOptions", - "docstrings": [ - "`toLocaleStringWithLocaleAndOptions(date, locale, options)`\n\nConverts a JavaScript date to a localized date-time string. It will use the specified locale and formatting options.\n\n## Examples\n```rescript\nDate.make()\n->Date.toLocaleStringWithLocaleAndOptions(\"en\", {dateStyle: #short, timeStyle: #short})\n->Console.log\n// 2/19/23, 3:40 PM\n\nDate.make()\n->Date.toLocaleStringWithLocaleAndOptions(\n \"en\",\n {\n era: #long,\n year: #numeric,\n month: #\"2-digit\",\n day: #\"2-digit\",\n hour: #numeric,\n timeZoneName: #short,\n },\n)\n->Console.log\n// 02/19/2023 Anno Domini, 3 PM GMT+1\n```" - ], - "signature": "let toLocaleStringWithLocaleAndOptions: (t, string, localeOptions) => string" - }, - { - "id": "Stdlib.Date.toLocaleTimeString", - "kind": "value", - "name": "toLocaleTimeString", - "docstrings": [ - "`toLocaleTimeString(date)`\n\nConverts a JavaScript date to a localized time string. It will use the current locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleTimeString->Console.log\n// 3:40:00 PM\n```" - ], - "signature": "let toLocaleTimeString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleTimeStringWithLocale", - "kind": "value", - "name": "toLocaleTimeStringWithLocale", - "docstrings": [ - "`toLocaleTimeStringWithLocale(date, locale)`\n\nConverts a JavaScript date to a localized time string. It will use the specified locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleTimeStringWithLocale(\"en-US\")->Console.log\n// 3:40:00 PM\n```" - ], - "signature": "let toLocaleTimeStringWithLocale: (t, string) => string" - }, - { - "id": "Stdlib.Date.toLocaleTimeStringWithLocaleAndOptions", - "kind": "value", - "name": "toLocaleTimeStringWithLocaleAndOptions", - "docstrings": [ - "`toLocaleTimeStringWithLocaleAndOptions(date, locale, options)`\n\nConverts a JavaScript date to a localized time string. It will use the specified locale and formatting options.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleTimeStringWithLocaleAndOptions(\"en-US\", {timeStyle: #long})->Console.log\n// 3:40:00 PM GMT+1\n\nDate.make()\n->Date.toLocaleTimeStringWithLocaleAndOptions(\"de\", {hour: #\"2-digit\", minute: #\"2-digit\"})\n->Console.log\n// 15:40\n```" - ], - "signature": "let toLocaleTimeStringWithLocaleAndOptions: (t, string, localeOptions) => string" - }, - { - "id": "Stdlib.Date.toISOString", - "kind": "value", - "name": "toISOString", - "docstrings": [ - "`toISOString(date)`\n\nConverts a JavaScript date to a ISO 8601 string (YYYY-MM-DDTHH:mm:ss.sssZ). The date will be mapped to the UTC time.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toISOString->Console.log\n// 2023-01-01T00:00:00.000Z\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toISOString->Console.log\n// 2022-12-31T16:00:00.000Z\n```" - ], - "signature": "let toISOString: t => string" - }, - { - "id": "Stdlib.Date.toUTCString", - "kind": "value", - "name": "toUTCString", - "docstrings": [ - "`toUTCString(date)`\n\nConverts a JavaScript date to date time string. The date will be mapped to the UTC time.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toUTCString->Console.log\n// Sun, 01 Jan 2023 00:00:00 GMT\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toUTCString->Console.log\n// Sat, 31 Dec 2022 16:00:00 GMT\n```" - ], - "signature": "let toUTCString: t => string" - }, - { - "id": "Stdlib.Date.toJSON", - "kind": "value", - "name": "toJSON", - "docstrings": [ - "`toJSON(date)`\n\nConverts a JavaScript date to a string.\nIf the date is valid, the function will return the same result as `Date.toISOString`.\nInvalid dates will return `None`.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toJSON\n// Some(\"2023-01-01T00:00:00.000Z\")\n\nDate.fromString(\"\")->Date.toJSON\n// None\n```" - ], - "signature": "let toJSON: t => option" - }, - { - "id": "Stdlib.Date.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(date)` ignores the provided date and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/dataview": { - "id": "Stdlib.DataView", - "name": "DataView", - "docstrings": [ - "Functions for interacting with DataView.\n\nSee [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN." - ], - "items": [ - { - "id": "Stdlib.DataView.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a DataView." - ], - "signature": "type t" - }, - { - "id": "Stdlib.DataView.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer(buffer)` creates a DataView for the entire ArrayBuffer.\n\nSee [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN.\n\n## Examples\n\n```rescript\nDataView.fromBuffer(ArrayBuffer.make(16))\nDataView.fromBuffer(ArrayBuffer.make(16), ~byteOffset=4)\nDataView.fromBuffer(ArrayBuffer.make(16), ~byteOffset=4, ~length=8)\n```" - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.DataView.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd(buffer, ~byteOffset)` creates a DataView starting at a given byte offset. See [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN.\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.\n\n## Examples\n\n```rescript\nDataView.fromBufferToEnd(buffer, ~byteOffset=4)\n```" - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.DataView.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange(buffer, ~byteOffset, ~length)` creates a DataView for a specific byte range.\n\nSee [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN.\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.\n\n## Examples\n\n```rescript\nDataView.fromBufferWithRange(ArrayBuffer.make(16), ~byteOffset=2, ~length=8)\n```" - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.DataView.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [ - "`buffer(dataView)` returns the underlying ArrayBuffer referenced by this DataView.\n\nSee [`DataView.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/buffer) on MDN.\n\n## Examples\n\n```rescript\nlet array_buffer = ArrayBuffer.make(16)\nlet dv = DataView.fromBuffer(array_buffer)\nDataView.buffer(dv) == array_buffer\n```" - ], - "signature": "let buffer: t => ArrayBuffer.t" - }, - { - "id": "Stdlib.DataView.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [ - "`byteLength(dataView)` returns the length (in bytes) of this DataView.\n\nSee [`DataView.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet array_buffer = ArrayBuffer.make(16)\nlet dv = DataView.fromBuffer(array_buffer)\nDataView.byteLength(dv) == 16\n```" - ], - "signature": "let byteLength: t => int" - }, - { - "id": "Stdlib.DataView.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [ - "`byteOffset(dataView)` returns the byte offset of this DataView from the start of its ArrayBuffer.\n\nSee [`DataView.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/byteOffset) on MDN.\n\n## Examples\n\n```rescript\nlet array_buffer = ArrayBuffer.make(16)\nlet dv = DataView.fromBuffer(array_buffer, ~byteOffset=4)\nDataView.byteOffset(dv) == 4\n```" - ], - "signature": "let byteOffset: t => int" - }, - { - "id": "Stdlib.DataView.getInt8", - "kind": "value", - "name": "getInt8", - "docstrings": [ - "`getInt8(dataView, offset)` reads an 8-bit signed integer at the specified byte offset.\n\nSee [`DataView.getInt8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setInt8(0, -12)\nDataView.getInt8(dv, 0) == -12\n```" - ], - "signature": "let getInt8: (t, int) => int" - }, - { - "id": "Stdlib.DataView.getUint8", - "kind": "value", - "name": "getUint8", - "docstrings": [ - "`getUint8(dataView, offset)` reads an 8-bit unsigned integer at the specified byte offset.\n\nSee [`DataView.getUint8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setUint8(1, 255)\nDataView.getUint8(dv, 1) == 255\n```" - ], - "signature": "let getUint8: (t, int) => int" - }, - { - "id": "Stdlib.DataView.getInt16", - "kind": "value", - "name": "getInt16", - "docstrings": [ - "`getInt16(dataView, offset, ~littleEndian=?)` reads a 16-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getInt16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setInt16(0, -1234)\ndv->DataView.setInt16(2, -1234, ~littleEndian=true)\nDataView.getInt16(dv, 0) == -1234\nDataView.getInt16(dv, 2, ~littleEndian=true) == -1234\n```" - ], - "signature": "let getInt16: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getUint16", - "kind": "value", - "name": "getUint16", - "docstrings": [ - "`getUint16(dataView, offset, ~littleEndian=?)` reads a 16-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getUint16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setUint16(0, 1234)\ndv->DataView.setUint16(2, 1234, ~littleEndian=true)\nDataView.getUint16(dv, 0) == 1234\nDataView.getUint16(dv, 2, ~littleEndian=true) == 1234\n```" - ], - "signature": "let getUint16: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getInt32", - "kind": "value", - "name": "getInt32", - "docstrings": [ - "`getInt32(dataView, offset, ~littleEndian=?)` reads a 32-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getInt32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setInt32(0, -123456)\ndv->DataView.setInt32(4, -123456, ~littleEndian=true)\nDataView.getInt32(dv, 0) == -123456\nDataView.getInt32(dv, 4, ~littleEndian=true) == -123456\n```" - ], - "signature": "let getInt32: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getUint32", - "kind": "value", - "name": "getUint32", - "docstrings": [ - "`getUint32(dataView, offset, ~littleEndian=?)` reads a 32-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getUint32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setUint32(0, 123456)\ndv->DataView.setUint32(4, 123456, ~littleEndian=true)\nDataView.getUint32(dv, 0) == 123456\nDataView.getUint32(dv, 4, ~littleEndian=true) == 123456\n```" - ], - "signature": "let getUint32: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getFloat16", - "kind": "value", - "name": "getFloat16", - "docstrings": [ - "`getFloat16(dataView, offset, ~littleEndian=?)` reads a 16-bit floating point number (if supported) at the specified byte offset, with optional endianness.\n\nSee [`DataView.getFloat16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat16) on MDN.\n\n## Examples\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setFloat16(0, 1.5)\ndv->DataView.setFloat16(2, 1.5, ~littleEndian=true)\nDataView.getFloat16(dv, 0) == 1.5\nDataView.getFloat16(dv, 2, ~littleEndian=true) == 1.5\n```" - ], - "signature": "let getFloat16: (t, int, ~littleEndian: bool=?) => float" - }, - { - "id": "Stdlib.DataView.getFloat32", - "kind": "value", - "name": "getFloat32", - "docstrings": [ - "`getFloat32(dataView, offset, ~littleEndian=?)` reads a 32-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.getFloat32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setFloat32(0, 3.14)\ndv->DataView.setFloat32(4, 3.14, ~littleEndian=true)\n// DataView.getFloat32(dv, 0) == 3.14\n// DataView.getFloat32(dv, 4, ~littleEndian=true) == 3.14\n```" - ], - "signature": "let getFloat32: (t, int, ~littleEndian: bool=?) => float" - }, - { - "id": "Stdlib.DataView.getFloat64", - "kind": "value", - "name": "getFloat64", - "docstrings": [ - "`getFloat64(dataView, offset, ~littleEndian=?)` reads a 64-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.getFloat64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setFloat64(0, 6.28)\ndv->DataView.setFloat64(8, 6.28, ~littleEndian=true)\nDataView.getFloat64(dv, 0) == 6.28\nDataView.getFloat64(dv, 8, ~littleEndian=true) == 6.28\n```" - ], - "signature": "let getFloat64: (t, int, ~littleEndian: bool=?) => float" - }, - { - "id": "Stdlib.DataView.getBigInt64", - "kind": "value", - "name": "getBigInt64", - "docstrings": [ - "`getBigInt64(dataView, offset, ~littleEndian=?)` reads a 64-bit signed integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.getBigInt64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getBigInt64) on MDN.\n\n## Examples\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setBigInt64(0, -123456789n)\ndv->DataView.setBigInt64(8, -123456789n, ~littleEndian=true)\nDataView.getBigInt64(dv, 0) == -123456789n\nDataView.getBigInt64(dv, 8, ~littleEndian=true) == -123456789n\n```" - ], - "signature": "let getBigInt64: (t, int, ~littleEndian: bool=?) => bigint" - }, - { - "id": "Stdlib.DataView.getBigUint64", - "kind": "value", - "name": "getBigUint64", - "docstrings": [ - "`getBigUint64(dataView, offset, ~littleEndian=?)` reads a 64-bit unsigned integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.getBigUint64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getBigUint64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setBigUint64(0, 123456789n)\ndv->DataView.setBigUint64(8, 123456789n, ~littleEndian=true)\nDataView.getBigUint64(dv, 0) == 123456789n\nDataView.getBigUint64(dv, 8, ~littleEndian=true) == 123456789n\n```" - ], - "signature": "let getBigUint64: (t, int, ~littleEndian: bool=?) => bigint" - }, - { - "id": "Stdlib.DataView.setInt8", - "kind": "value", - "name": "setInt8", - "docstrings": [ - "`setInt8(dataView, offset, value)` writes an 8-bit signed integer at the specified byte offset.\n\nSee [`DataView.setInt8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setInt8(dv, 0, -12)\ndv->DataView.getInt8(0) == -12\n```" - ], - "signature": "let setInt8: (t, int, int) => unit" - }, - { - "id": "Stdlib.DataView.setUint8", - "kind": "value", - "name": "setUint8", - "docstrings": [ - "`setUint8(dataView, offset, value)` writes an 8-bit unsigned integer at the specified byte offset.\n\nSee [`DataView.setUint8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setUint8(dv, 0, 255)\ndv->DataView.getUint8(0) == 255\n```" - ], - "signature": "let setUint8: (t, int, int) => unit" - }, - { - "id": "Stdlib.DataView.setInt16", - "kind": "value", - "name": "setInt16", - "docstrings": [ - "`setInt16(dataView, offset, value, ~littleEndian=?)` writes a 16-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setInt16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setInt16(dv, 0, -1234)\nDataView.setInt16(dv, 2, -1234, ~littleEndian=true)\ndv->DataView.getInt16(0) == -1234\ndv->DataView.getInt16(2, ~littleEndian=true) == -1234\n```" - ], - "signature": "let setInt16: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setUint16", - "kind": "value", - "name": "setUint16", - "docstrings": [ - "`setUint16(dataView, offset, value, ~littleEndian=?)` writes a 16-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setUint16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setUint16(dv, 0, 1234)\nDataView.setUint16(dv, 2, 1234, ~littleEndian=true)\ndv->DataView.getUint16(0) == 1234\ndv->DataView.getUint16(2, ~littleEndian=true) == 1234\n```" - ], - "signature": "let setUint16: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setInt32", - "kind": "value", - "name": "setInt32", - "docstrings": [ - "`setInt32(dataView, offset, value, ~littleEndian=?)` writes a 32-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setInt32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setInt32(dv, 0, -123456)\nDataView.setInt32(dv, 4, -123456, ~littleEndian=true)\ndv->DataView.getInt32(0) == -123456\ndv->DataView.getInt32(4, ~littleEndian=true) == -123456\n```" - ], - "signature": "let setInt32: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setUint32", - "kind": "value", - "name": "setUint32", - "docstrings": [ - "`setUint32(dataView, offset, value, ~littleEndian=?)` writes a 32-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setUint32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setUint32(dv, 0, 123456)\nDataView.setUint32(dv, 4, 123456, ~littleEndian=true)\ndv->DataView.getUint32(0) == 123456\ndv->DataView.getUint32(4, ~littleEndian=true) == 123456\n```" - ], - "signature": "let setUint32: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setFloat16", - "kind": "value", - "name": "setFloat16", - "docstrings": [ - "`setFloat16(dataView, offset, value, ~littleEndian=?)` writes a 16-bit floating point number (if supported) at the specified byte offset, with optional endianness.\n\nSee [`DataView.setFloat16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setFloat16(dv, 0, 1.5)\nDataView.setFloat16(dv, 2, 1.5, ~littleEndian=true)\ndv->DataView.getFloat16(0) == 1.5\ndv->DataView.getFloat16(2, ~littleEndian=true) == 1.5\n```" - ], - "signature": "let setFloat16: (t, int, float, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setFloat32", - "kind": "value", - "name": "setFloat32", - "docstrings": [ - "`setFloat32(dataView, offset, value, ~littleEndian=?)` writes a 32-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.setFloat32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setFloat32(dv, 0, 3.14)\nDataView.setFloat32(dv, 4, 3.14, ~littleEndian=true)\n// dv->DataView.getFloat32(0) == 3.14\n// dv->DataView.getFloat32(4, ~littleEndian=true) == 3.14\n```" - ], - "signature": "let setFloat32: (t, int, float, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setFloat64", - "kind": "value", - "name": "setFloat64", - "docstrings": [ - "`setFloat64(dataView, offset, value, ~littleEndian=?)` writes a 64-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.setFloat64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setFloat64(dv, 0, 6.28)\nDataView.setFloat64(dv, 8, 6.28, ~littleEndian=true)\ndv->DataView.getFloat64(0) == 6.28\ndv->DataView.getFloat64(8, ~littleEndian=true) == 6.28\n```" - ], - "signature": "let setFloat64: (t, int, float, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setBigInt64", - "kind": "value", - "name": "setBigInt64", - "docstrings": [ - "`setBigInt64(dataView, offset, value, ~littleEndian=?)` writes a 64-bit signed integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.setBigInt64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setBigInt64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setBigInt64(dv, 0, -123456789n)\nDataView.setBigInt64(dv, 8, -123456789n, ~littleEndian=true)\ndv->DataView.getBigInt64(0) == -123456789n\ndv->DataView.getBigInt64(8, ~littleEndian=true) == -123456789n\n```" - ], - "signature": "let setBigInt64: (t, int, bigint, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setBigUint64", - "kind": "value", - "name": "setBigUint64", - "docstrings": [ - "`setBigUint64(dataView, offset, value, ~littleEndian=?)` writes a 64-bit unsigned integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.setBigUint64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setBigUint64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setBigUint64(dv, 0, 123456789n)\nDataView.setBigUint64(dv, 8, 123456789n, ~littleEndian=true)\ndv->DataView.getBigUint64(0) == 123456789n\ndv->DataView.getBigUint64(8, ~littleEndian=true) == 123456789n\n```" - ], - "signature": "let setBigUint64: (t, int, bigint, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(dataView)` ignores the provided DataView and returns unit.\n\nThis helper is useful when you want to discard a value (for example, the result of an operation with side effects) without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/console": { - "id": "Stdlib.Console", - "name": "Console", - "docstrings": [ - "Functions for interacting with JavaScript console.\n\nSee: [`console`](https://developer.mozilla.org/en-US/docs/Web/API/Console)." - ], - "items": [ - { - "id": "Stdlib.Console.assert_", - "kind": "value", - "name": "assert_", - "docstrings": [ - "`assert_(assertion, value)` print a message to console if `assertion` evaluates `false`. Does nothing if it's `true`.\n\nSee [`console.assert`](https://developer.mozilla.org/en-US/docs/Web/API/console/assert)\non MDN.\n\n## Examples\n\n```rescript\nConsole.assert_(false, \"Hello World!\")\nConsole.assert_(42 === 42, \"The answer\")\n```" - ], - "signature": "let assert_: (bool, 'a) => unit" - }, - { - "id": "Stdlib.Console.assert2", - "kind": "value", - "name": "assert2", - "docstrings": [ - "`assert2(v1, v2)`. Like `assert_`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.assert2(false, \"Hello\", \"World\")\nConsole.assert2(42 === 42, [1, 2, 3], '4')\n```" - ], - "signature": "let assert2: (bool, 'a, 'b) => unit" - }, - { - "id": "Stdlib.Console.assert3", - "kind": "value", - "name": "assert3", - "docstrings": [ - "`assert3(v1, v2, v3)`. Like `assert_`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.assert3(false, \"Hello\", \"World\", \"ReScript\")\nConsole.assert3(42 === 42, \"One\", 2, #3)\n```" - ], - "signature": "let assert3: (bool, 'a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.assert4", - "kind": "value", - "name": "assert4", - "docstrings": [ - "`assert4(v1, v2, v3, v4)`. Like `assert_`, but with four arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert4(false, \"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.assert4(value === 42, [1, 2], (3, 4), [#5, #6], #polyvar)\n```" - ], - "signature": "let assert4: (bool, 'a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.assert5", - "kind": "value", - "name": "assert5", - "docstrings": [ - "`assert5(v1, v2, v3, v4, v5)`. Like `assert_`, but with five arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert5(false, \"Hello\", \"World\", \"JS\", '!', '!')\nConsole.assert5(value === 42, [1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let assert5: (bool, 'a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.assert6", - "kind": "value", - "name": "assert6", - "docstrings": [ - "`assert6(v1, v2)`. Like `assert_`, but with six arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert6(false, \"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.assert6(value === 42, [1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let assert6: (bool, 'a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.assertMany", - "kind": "value", - "name": "assertMany", - "docstrings": [ - "`assertMany(assertion, arr)`. Like `assert_`, but variadic.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assertMany(false, [\"Hello\", \"World\"])\nConsole.assertMany(value === 42, [1, 2, 3])\n```" - ], - "signature": "let assertMany: (bool, array<'a>) => unit" - }, - { - "id": "Stdlib.Console.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "`clear()` clears the console, if allowed.\n\nSee [`console.clear`](https://developer.mozilla.org/en-US/docs/Web/API/console/clear)\non MDN.\n\n## Examples\n\n```rescript\nConsole.clear()\n```" - ], - "signature": "let clear: unit => unit" - }, - { - "id": "Stdlib.Console.count", - "kind": "value", - "name": "count", - "docstrings": [ - "`count(label)` prints to the console the number of times it's been called with the given label.\n\nSee [`console.count`](https://developer.mozilla.org/en-US/docs/Web/API/console/count)\non MDN.\n\n## Examples\n\n```rescript\nConsole.count(\"rescript\")\n```" - ], - "signature": "let count: string => unit" - }, - { - "id": "Stdlib.Console.countReset", - "kind": "value", - "name": "countReset", - "docstrings": [ - "`countReset(label)` resets the count for the given label to 0.\n\nSee [`console.countReset`](https://developer.mozilla.org/en-US/docs/Web/API/console/countReset)\non MDN.\n\n## Examples\n\n```rescript\nConsole.countReset(\"rescript\")\n```" - ], - "signature": "let countReset: string => unit" - }, - { - "id": "Stdlib.Console.debug", - "kind": "value", - "name": "debug", - "docstrings": [ - "`debug(value)` print a debug message to console.\n\nSee [`console.debug`](https://developer.mozilla.org/en-US/docs/Web/API/console/debug)\non MDN.\n\n## Examples\n\n```rescript\nConsole.debug(\"Hello\")\nlet obj = {\"name\": \"ReScript\", \"version\": 10}\nConsole.debug(obj)\n```" - ], - "signature": "let debug: 'a => unit" - }, - { - "id": "Stdlib.Console.debug2", - "kind": "value", - "name": "debug2", - "docstrings": [ - "`debug2(v1, v2)`. Like `debug`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.debug2(\"Hello\", \"World\")\nConsole.debug2([1, 2, 3], '4')\n```" - ], - "signature": "let debug2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.debug3", - "kind": "value", - "name": "debug3", - "docstrings": [ - "`debug3(v1, v2, v3)`. Like `debug`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.debug3(\"Hello\", \"World\", \"ReScript\")\nConsole.debug3(\"One\", 2, #3)\n```" - ], - "signature": "let debug3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.debug4", - "kind": "value", - "name": "debug4", - "docstrings": [ - "`debug4(v1, v2, v3, v4)`. Like `debug`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.debug4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.debug4([1, 2], (3, 4), [#5, #6], #polyvar)\n```" - ], - "signature": "let debug4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.debug5", - "kind": "value", - "name": "debug5", - "docstrings": [ - "`debug5(v1, v2, v3, v4, v5)`. Like `debug`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.debug5(\"Hello\", \"World\", \"JS\", '!', '!')\nConsole.debug5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let debug5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.debug6", - "kind": "value", - "name": "debug6", - "docstrings": [ - "`debug6(v1, v2, v3, v4, v5, v6)`. Like `debug`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.debug6(\"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.debug6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let debug6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.debugMany", - "kind": "value", - "name": "debugMany", - "docstrings": [ - "`debugMany(arr)`. Like `debug`, but variadic.\n\n## Examples\n\n```rescript\nConsole.debugMany([\"Hello\", \"World\"])\nConsole.debugMany([1, 2, 3])\n```" - ], - "signature": "let debugMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.dirOptions", - "kind": "type", - "name": "dirOptions", - "docstrings": [], - "signature": "type dirOptions = {\n colors?: bool,\n depth?: Nullable.t,\n showHidden?: bool,\n}" - }, - { - "id": "Stdlib.Console.dir", - "kind": "value", - "name": "dir", - "docstrings": [ - "`dir(object, options)` displays an interactive view of the object in the console.\n\nSee [`console.dir`](https://developer.mozilla.org/en-US/docs/Web/API/console/dir)\non MDN.\n\n## Examples\n\n```rescript\nConsole.dir({\"language\": \"rescript\", \"version\": \"10.1.2\"})\nConsole.dir(\n {\"language\": \"rescript\", \"version\": {\"major\": \"10\", \"minor\": \"1\", \"patch\": \"2\"}},\n ~options={depth: null},\n)\n```" - ], - "signature": "let dir: ('a, ~options: dirOptions=?) => unit" - }, - { - "id": "Stdlib.Console.dirxml", - "kind": "value", - "name": "dirxml", - "docstrings": [ - "`dirxml(object)` displays an interactive tree view of an XML/HTML element in the console.\n\nSee [`console.dirxml`](https://developer.mozilla.org/en-US/docs/Web/API/console/dirxml)\non MDN." - ], - "signature": "let dirxml: 'a => unit" - }, - { - "id": "Stdlib.Console.error", - "kind": "value", - "name": "error", - "docstrings": [ - "`error(value)` prints an error message to console.\n\nSee [`console.error`](https://developer.mozilla.org/en-US/docs/Web/API/console/error)\non MDN.\n\n## Examples\n\n```rescript\nConsole.error(\"error message\")\nConsole.error((\"error\", \"invalid value\"))\n```" - ], - "signature": "let error: 'a => unit" - }, - { - "id": "Stdlib.Console.error2", - "kind": "value", - "name": "error2", - "docstrings": [ - "`error(v1, v2)`. Like `error`, but two arguments.\n\n## Examples\n\n```rescript\nConsole.error2(\"Error\", \"here\")\nConsole.error2((\"log\", \"error\"), \"message\")\n```" - ], - "signature": "let error2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.error3", - "kind": "value", - "name": "error3", - "docstrings": [ - "`error3(v1, v2, v3)`. Like `error`, but three arguments.\n\n## Examples\n\n```rescript\nConsole.error3(\"Hello\", \"World\", \"!!!\")\nConsole.error3(#first, #second, #third)\n```" - ], - "signature": "let error3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.error4", - "kind": "value", - "name": "error4", - "docstrings": [ - "`error4(v1, v2, v3, v4)`. Like `error`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.error4(\"Hello\", \"World\", \"ReScript\", '!')\nConsole.error4(#first, #second, #third, \"fourth\")\n```" - ], - "signature": "let error4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.error5", - "kind": "value", - "name": "error5", - "docstrings": [ - "`error5(v1, v2, v3, v4, v5)`. Like `error`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.error5('e', 'r', 'r', 'o', 'r')\nConsole.error5(1, #second, #third, \"fourth\", 'c')\n```" - ], - "signature": "let error5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.error6", - "kind": "value", - "name": "error6", - "docstrings": [ - "`error6(v1, v2, v3, v4, v5, v6)`. Like `error`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.error6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.error6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let error6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.group", - "kind": "value", - "name": "group", - "docstrings": [ - "`group(label)` creates a new \"group\" level with the given label.\n\nSee [`console.group`](https://developer.mozilla.org/en-US/docs/Web/API/console/group)\non MDN.\n\n## Example\n\n```rescript\nConsole.group(\"first group\")\nConsole.group(\"second group\")\nConsole.log(\"a message on the second level\")\nConsole.groupEnd()\nConsole.log(\"a message message on the first level\")\nConsole.groupEnd()\n```" - ], - "signature": "let group: string => unit" - }, - { - "id": "Stdlib.Console.groupCollapsed", - "kind": "value", - "name": "groupCollapsed", - "docstrings": [ - "`groupCollapsed(label)`. Like `group` but collapses the group initially.\n\nSee [`console.groupCollapsed`](https://developer.mozilla.org/en-US/docs/Web/API/console/groupCollapsed)\non MDN." - ], - "signature": "let groupCollapsed: string => unit" - }, - { - "id": "Stdlib.Console.groupEnd", - "kind": "value", - "name": "groupEnd", - "docstrings": [ - "`groupEnd()` ends the current group.\n\nSee [`console.groupEnd`](https://developer.mozilla.org/en-US/docs/Web/API/console/groupEnd)\non MDN." - ], - "signature": "let groupEnd: unit => unit" - }, - { - "id": "Stdlib.Console.errorMany", - "kind": "value", - "name": "errorMany", - "docstrings": [ - "`errorMany(arr)`. Like `error`, but variadic.\n\n## Examples\n\n```rescript\nConsole.errorMany([\"Hello\", \"World\"])\nConsole.errorMany([1, 2, 3])\n```" - ], - "signature": "let errorMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.info", - "kind": "value", - "name": "info", - "docstrings": [ - "`info(value)` print an informational message to console.\n\nSee [`console.info`](https://developer.mozilla.org/en-US/docs/Web/API/console/info)\non MDN.\n\n## Examples\n\n```rescript\nConsole.info(\"Information\")\nConsole.info((\"Hello\", \"JS\"))\n```" - ], - "signature": "let info: 'a => unit" - }, - { - "id": "Stdlib.Console.info2", - "kind": "value", - "name": "info2", - "docstrings": [ - "`info2(v1, v2)`. Like `info`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.info2(\"Info\", \"failed to download\")\nConsole.info2(#info, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let info2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.info3", - "kind": "value", - "name": "info3", - "docstrings": [ - "`info3(v1, v2, v3)`. Like `info`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.info3(\"Hello\", \"World\", \"ReScript\")\nConsole.info3([1, 2, 3], #4, #5)\n```" - ], - "signature": "let info3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.info4", - "kind": "value", - "name": "info4", - "docstrings": [ - "`info4(v1, v2, v3, v4)`. Like `info`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.info4(\"Hello\", \"World\", \"ReScript\", '!')\nConsole.info4([1, 2, 3], #4, #5, #lastinfo)\n```" - ], - "signature": "let info4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.info5", - "kind": "value", - "name": "info5", - "docstrings": [ - "`info5(v1, v2, v3, v4, v5)`. Like `info`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.info5(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\")\nConsole.info5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let info5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.info6", - "kind": "value", - "name": "info6", - "docstrings": [ - "`info6(v1, v2, v3, v4, v5, v6)`. Like `info`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.info6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.info6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let info6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.infoMany", - "kind": "value", - "name": "infoMany", - "docstrings": [ - "`infoMany(arr)`. Like `info`, but variadic.\n\n## Examples\n\n```rescript\nConsole.infoMany([\"Hello\", \"World\"])\nConsole.infoMany([1, 2, 3])\n```" - ], - "signature": "let infoMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.log", - "kind": "value", - "name": "log", - "docstrings": [ - "`log(value)` print a message to console.\n\nSee [`console.log`](https://developer.mozilla.org/en-US/docs/Web/API/console/log)\non MDN.\n\n## Examples\n\n```rescript\nConsole.log(\"Hello\")\nlet obj = {\"name\": \"ReScript\", \"version\": 10}\nConsole.log(obj)\n```" - ], - "signature": "let log: 'a => unit" - }, - { - "id": "Stdlib.Console.log2", - "kind": "value", - "name": "log2", - "docstrings": [ - "`log2(v1, v2)`. Like `log`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.log2(\"Hello\", \"World\")\nConsole.log2([1, 2, 3], '4')\n```" - ], - "signature": "let log2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.log3", - "kind": "value", - "name": "log3", - "docstrings": [ - "`log3(v1, v2, v3)`. Like `log`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.log3(\"Hello\", \"World\", \"ReScript\")\nConsole.log3(\"One\", 2, #3)\n```" - ], - "signature": "let log3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.log4", - "kind": "value", - "name": "log4", - "docstrings": [ - "`log4(v1, v2, v3, v4)`. Like `log`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.log4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.log4([1, 2], (3, 4), [#5, #6], #polyvar)\n```" - ], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.log5", - "kind": "value", - "name": "log5", - "docstrings": [ - "`log5(v1, v2, v3, v4, v5)`. Like `log`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.log5(\"Hello\", \"World\", \"JS\", '!', '!')\nConsole.log5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let log5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.log6", - "kind": "value", - "name": "log6", - "docstrings": [ - "`log6(v1, v2, v3, v4, v5, v6)`. Like `log`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.log6(\"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.log6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let log6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.logMany", - "kind": "value", - "name": "logMany", - "docstrings": [ - "`logMany(arr)`. Like `log`, but variadic.\n\n## Examples\n\n```rescript\nConsole.logMany([\"Hello\", \"World\"])\nConsole.logMany([1, 2, 3])\n```" - ], - "signature": "let logMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.table", - "kind": "value", - "name": "table", - "docstrings": [ - "`table(object)` displays an tabular view of the object in the console.\n\nSee [`console.table`](https://developer.mozilla.org/en-US/docs/Web/API/console/table)\non MDN.\n\n## Examples\n\n```rescript\nConsole.table({\"language\": \"rescript\", \"version\": \"10.1.2\"})\n```" - ], - "signature": "let table: 'a => unit" - }, - { - "id": "Stdlib.Console.time", - "kind": "value", - "name": "time", - "docstrings": [ - "`time(label)` creates a timer to measure how long an operation takes. `label`\nmust be a unique name. Call `console.timeEnd` with the same `label` to print\noutput time.\n\nSee [`console.time`](https://developer.mozilla.org/en-US/docs/Web/API/console/time)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let time: string => unit" - }, - { - "id": "Stdlib.Console.timeEnd", - "kind": "value", - "name": "timeEnd", - "docstrings": [ - "`timeEnd(label)` stops a timer created by `time`.\n\nSee [`console.timeEnd`](https://developer.mozilla.org/en-US/docs/Web/API/console/timeEnd)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let timeEnd: string => unit" - }, - { - "id": "Stdlib.Console.timeLog", - "kind": "value", - "name": "timeLog", - "docstrings": [ - "`timeLog(label)` prints the current elapsed time of the given timer to the console.\n\nSee [`console.timeLog`](https://developer.mozilla.org/en-US/docs/Web/API/console/timeLog)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let timeLog: string => unit" - }, - { - "id": "Stdlib.Console.trace", - "kind": "value", - "name": "trace", - "docstrings": [ - "`trace()` print a stack trace to console.\n\nSee [`console.trace`](https://developer.mozilla.org/en-US/docs/Web/API/console/trace)\non MDN.\n\n## Examples\n\n```rescript\nlet main = () => {\n Console.trace()\n}\nmain()\n// In the console, the following trace will be displayed:\n// main\n// \n```" - ], - "signature": "let trace: unit => unit" - }, - { - "id": "Stdlib.Console.warn", - "kind": "value", - "name": "warn", - "docstrings": [ - "`warn(value)` print a warning message to console.\n\nSee [`console.warn`](https://developer.mozilla.org/en-US/docs/Web/API/console/warn)\non MDN.\n\n## Examples\n\n```rescript\nConsole.warn(\"Warning\")\nConsole.warn((\"Warning\", \"invalid number\"))\n```" - ], - "signature": "let warn: 'a => unit" - }, - { - "id": "Stdlib.Console.warn2", - "kind": "value", - "name": "warn2", - "docstrings": [ - "`warn2(v1, v2)`. Like `warn`, but two arguments.\n\n## Examples\n\n```rescript\nConsole.warn2(\"Hello\", \"World\")\nConsole.warn2([1, 2, 3], 4)\n```" - ], - "signature": "let warn2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.warn3", - "kind": "value", - "name": "warn3", - "docstrings": [ - "`warn3(v1, v2, v3)`. Like `warn`, but three arguments.\n\n## Examples\n\n```rescript\nConsole.warn3(\"Hello\", \"World\", \"ReScript\")\nConsole.warn3([1, 2, 3], #4, #5)\n```" - ], - "signature": "let warn3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.warn4", - "kind": "value", - "name": "warn4", - "docstrings": [ - "`warn4(v1, v2, v3, v4)`. Like `warn`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.warn4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.warn4(#first, #second, #third, \"fourth\")\n```" - ], - "signature": "let warn4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.warn5", - "kind": "value", - "name": "warn5", - "docstrings": [ - "`warn5(v1, v2, v3, v4, v5)`. Like `warn`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.warn5(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\")\nConsole.warn5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let warn5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.warn6", - "kind": "value", - "name": "warn6", - "docstrings": [ - "`warn6(v1, v2, v3, v4, v5, v6)`. Like `warn`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.warn6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.warn6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let warn6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.warnMany", - "kind": "value", - "name": "warnMany", - "docstrings": [ - "`warnMany(arr)`. Like `warn`, but variadic.\n\n## Examples\n\n```rescript\nConsole.warnMany([\"Hello\", \"World\"])\nConsole.warnMany([1, 2, 3])\n```" - ], - "signature": "let warnMany: array<'a> => unit" - } - ] - }, - "stdlib/bool": { - "id": "Stdlib.Bool", - "name": "Bool", - "docstrings": [ - "Functions for interacting with JavaScript booleans.\nSee: [`Boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)" - ], - "items": [ - { - "id": "Stdlib.Bool.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a boolean." - ], - "signature": "type t = bool" - }, - { - "id": "Stdlib.Bool.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts a boolean to a string.\n\n## Examples\n```rescript\nBool.toString(true) == \"true\"\nBool.toString(false) == \"false\"\n```" - ], - "signature": "let toString: bool => string" - }, - { - "id": "Stdlib.Bool.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Converts a string to a boolean.\n\n## Examples\n```rescript\nBool.fromString(\"true\") == Some(true)\nBool.fromString(\"false\") == Some(false)\nBool.fromString(\"notAValidBoolean\") == None\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.Bool.fromStringOrThrow", - "kind": "value", - "name": "fromStringOrThrow", - "docstrings": [ - "Converts a string to a boolean.\nThrows an `Invalid_argument` exception if the string is not a valid boolean.\n\n## Examples\n```rescript\nBool.fromStringOrThrow(\"true\") == true\nBool.fromStringOrThrow(\"false\") == false\nswitch Bool.fromStringOrThrow(\"notAValidBoolean\") {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let fromStringOrThrow: string => bool" - }, - { - "id": "Stdlib.Bool.fromStringExn", - "kind": "value", - "name": "fromStringExn", - "docstrings": [ - "Converts a string to a boolean.\nBeware, this function will throw an `Invalid_argument` exception\nif the string is not a valid boolean.\n\n## Examples\n```rescript\nBool.fromStringExn(\"true\") == true\nBool.fromStringExn(\"false\") == false\nswitch Bool.fromStringExn(\"notAValidBoolean\") {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let fromStringExn: string => bool", - "deprecated": "" - }, - { - "id": "Stdlib.Bool.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "Compares two booleans, returns an `Ordering.t` value.\n\n## Examples\n```rescript\nBool.compare(true, true) == Ordering.equal\nBool.compare(false, false) == Ordering.equal\nBool.compare(true, false) == Ordering.greater\nBool.compare(false, true) == Ordering.less\n```" - ], - "signature": "let compare: (bool, bool) => Ordering.t" - }, - { - "id": "Stdlib.Bool.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "Checks if two booleans are equal and have the same value.\n\n## Examples\n```rescript\nBool.equal(true, true) == true\nBool.equal(false, false) == true\nBool.equal(true, false) == false\nBool.equal(false, true) == false\n```" - ], - "signature": "let equal: (bool, bool) => bool" - }, - { - "id": "Stdlib.Bool.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bool)` ignores the provided boolean and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: bool => unit" - } - ] - }, - "stdlib/bigint": { - "id": "Stdlib.BigInt", - "name": "BigInt", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigInt.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a bigint." - ], - "signature": "type t = bigint" - }, - { - "id": "Stdlib.BigInt.asIntN", - "kind": "value", - "name": "asIntN", - "docstrings": [ - "`asIntN(~width, bigint)` returns a bigint value truncated to the given number of bits as a signed integer.\n\nSee [`BigInt.asIntN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/asIntN) on MDN.\n\n## Examples\n\n```rescript\nBigInt.asIntN(~width=4, 25n) == -7n\nBigInt.asIntN(~width=4, 3n) == 3n\n```" - ], - "signature": "let asIntN: (~width: int, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.asUintN", - "kind": "value", - "name": "asUintN", - "docstrings": [ - "`asUintN(~width, bigint)` returns a bigint value truncated to the given number of bits as an unsigned integer.\n\nSee [`BigInt.asUintN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/asUintN) on MDN.\n\n## Examples\n\n```rescript\nBigInt.asUintN(~width=4, 25n) == 9n\nBigInt.asUintN(~width=4, 3n) == 3n\n```" - ], - "signature": "let asUintN: (~width: int, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.fromStringOrThrow", - "kind": "value", - "name": "fromStringOrThrow", - "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Return the\nnumber as a `bigint` if successfully parsed. Throws a syntax exception otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromStringOrThrow(\"123\") == 123n\n\nBigInt.fromStringOrThrow(\"\") == 0n\n\nBigInt.fromStringOrThrow(\"0x11\") == 17n\n\nBigInt.fromStringOrThrow(\"0b11\") == 3n\n\nBigInt.fromStringOrThrow(\"0o11\") == 9n\n\n/* catch exception */\nswitch BigInt.fromStringOrThrow(\"a\") {\n| exception JsExn(_error) => assert(true)\n| _bigInt => assert(false)\n}\n```" - ], - "signature": "let fromStringOrThrow: string => bigint" - }, - { - "id": "Stdlib.BigInt.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Returns\n`Some(bigint)` if the string can be parsed, `None` otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromString(\"123\") == Some(123n)\n\nBigInt.fromString(\"\") == Some(0n)\n\nBigInt.fromString(\"0x11\") == Some(17n)\n\nBigInt.fromString(\"0b11\") == Some(3n)\n\nBigInt.fromString(\"0o11\") == Some(9n)\n\nBigInt.fromString(\"invalid\") == None\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.BigInt.fromStringExn", - "kind": "value", - "name": "fromStringExn", - "docstrings": [], - "signature": "let fromStringExn: string => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "`fromInt(int)` converts an `int` to a `bigint`.\n\n## Examples\n\n```rescript\nBigInt.fromInt(123) == 123n\nBigInt.fromInt(0) == 0n\nBigInt.fromInt(-456) == -456n\n```" - ], - "signature": "let fromInt: int => bigint" - }, - { - "id": "Stdlib.BigInt.fromFloatOrThrow", - "kind": "value", - "name": "fromFloatOrThrow", - "docstrings": [ - "Converts a `float` to a `bigint` using JavaScript semantics.\nThrows an exception if the float is not an integer or is infinite/NaN.\n\n## Examples\n\n```rescript\nBigInt.fromFloatOrThrow(123.0) == 123n\n\nBigInt.fromFloatOrThrow(0.0) == 0n\n\nBigInt.fromFloatOrThrow(-456.0) == -456n\n\n/* This will throw an exception */\nswitch BigInt.fromFloatOrThrow(123.5) {\n| exception JsExn(_error) => assert(true)\n| _bigInt => assert(false)\n}\n```" - ], - "signature": "let fromFloatOrThrow: float => bigint" - }, - { - "id": "Stdlib.BigInt.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "`fromFloat(float)` converts a `float` to a `bigint` using JavaScript semantics.\nReturns `Some(bigint)` if the float is a valid `bigint`, `None` otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromFloat(123.0) == Some(123n)\nBigInt.fromFloat(0.0) == Some(0n)\nBigInt.fromFloat(-456.0) == Some(-456n)\nBigInt.fromFloat(123.5) == None\n```" - ], - "signature": "let fromFloat: float => option" - }, - { - "id": "Stdlib.BigInt.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats a `bigint` as a string. Return a `string` representing the given value.\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nBigInt.toString(123n) == \"123\"\n```" - ], - "signature": "let toString: (bigint, ~radix: int=?) => string" - }, - { - "id": "Stdlib.BigInt.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [], - "signature": "let toStringWithRadix: (bigint, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Returns a string with a language-sensitive representation of this BigInt value.\n\n## Examples\n\n```rescript\nBigInt.toString(123n) == \"123\"\n```" - ], - "signature": "let toLocaleString: bigint => string" - }, - { - "id": "Stdlib.BigInt.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [ - "`toFloat(bigint)` converts a `bigint` to a `float`.\n\n## Examples\n\n```rescript\nBigInt.toFloat(123n) == 123.0\nBigInt.toFloat(0n) == 0.0\nBigInt.toFloat(-456n) == -456.0\n```" - ], - "signature": "let toFloat: bigint => float" - }, - { - "id": "Stdlib.BigInt.toInt", - "kind": "value", - "name": "toInt", - "docstrings": [ - "`toInt(bigint)` converts a `bigint` to an `int`.\n\n## Examples\n\n```rescript\nBigInt.toInt(123n) == 123\nBigInt.toInt(0n) == 0\nBigInt.toInt(-456n) == -456\n```" - ], - "signature": "let toInt: bigint => int" - }, - { - "id": "Stdlib.BigInt.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(a, b)` calculates the sum of two bigints.\n\n## Examples\n\n```rescript\nBigInt.add(5n, 3n) == 8n\nBigInt.add(-2n, 7n) == 5n\n```" - ], - "signature": "let add: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.sub", - "kind": "value", - "name": "sub", - "docstrings": [ - "`sub(a, b)` calculates the difference of two bigints.\n\n## Examples\n\n```rescript\nBigInt.sub(8n, 3n) == 5n\nBigInt.sub(2n, 7n) == -5n\n```" - ], - "signature": "let sub: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.mul", - "kind": "value", - "name": "mul", - "docstrings": [ - "`mul(a, b)` calculates the product of two bigints.\n\n## Examples\n\n```rescript\nBigInt.mul(5n, 3n) == 15n\nBigInt.mul(-2n, 7n) == -14n\n```" - ], - "signature": "let mul: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.div", - "kind": "value", - "name": "div", - "docstrings": [ - "`div(a, b)` calculates the quotient of two bigints.\n\n## Examples\n\n```rescript\nBigInt.div(15n, 3n) == 5n\nBigInt.div(14n, 3n) == 4n\n```" - ], - "signature": "let div: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.mod", - "kind": "value", - "name": "mod", - "docstrings": [ - "`mod(a, b)` calculates the remainder of dividing two bigints.\n\n## Examples\n\n```rescript\nBigInt.mod(15n, 4n) == 3n\nBigInt.mod(14n, 3n) == 2n\n```" - ], - "signature": "let mod: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseAnd", - "kind": "value", - "name": "bitwiseAnd", - "docstrings": [ - "`bitwiseAnd(a, b)` calculates the bitwise AND of two bigints.\n\n## Examples\n\n```rescript\nBigInt.bitwiseAnd(7n, 4n) == 4n\nBigInt.bitwiseAnd(15n, 8n) == 8n\n```" - ], - "signature": "let bitwiseAnd: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseOr", - "kind": "value", - "name": "bitwiseOr", - "docstrings": [ - "`bitwiseOr(a, b)` calculates the bitwise OR of two bigints.\n\n## Examples\n\n```rescript\nBigInt.bitwiseOr(7n, 4n) == 7n\nBigInt.bitwiseOr(8n, 4n) == 12n\n```" - ], - "signature": "let bitwiseOr: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseXor", - "kind": "value", - "name": "bitwiseXor", - "docstrings": [ - "`bitwiseXor(a, b)` calculates the bitwise XOR of two bigints.\n\n## Examples\n\n```rescript\nBigInt.bitwiseXor(7n, 4n) == 3n\nBigInt.bitwiseXor(15n, 8n) == 7n\n```" - ], - "signature": "let bitwiseXor: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseNot", - "kind": "value", - "name": "bitwiseNot", - "docstrings": [ - "`bitwiseNot(bigint)` calculates the bitwise NOT of a bigint.\n\n## Examples\n\n```rescript\nBigInt.bitwiseNot(2n) == -3n\nBigInt.bitwiseNot(-1n) == 0n\n```" - ], - "signature": "let bitwiseNot: bigint => bigint" - }, - { - "id": "Stdlib.BigInt.shiftLeft", - "kind": "value", - "name": "shiftLeft", - "docstrings": [ - "`shiftLeft(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the left.\n\n## Examples\n\n```rescript\nBigInt.shiftLeft(4n, 1n) == 8n\nBigInt.shiftLeft(1n, 3n) == 8n\n```" - ], - "signature": "let shiftLeft: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.shiftRight", - "kind": "value", - "name": "shiftRight", - "docstrings": [ - "`shiftRight(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the right.\n\n## Examples\n\n```rescript\nBigInt.shiftRight(8n, 1n) == 4n\nBigInt.shiftRight(16n, 2n) == 4n\n```" - ], - "signature": "let shiftRight: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bigint)` ignores the provided bigint and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: bigint => unit" - }, - { - "id": "Stdlib.BigInt.land", - "kind": "value", - "name": "land", - "docstrings": [ - "`land(a, b)` calculates the bitwise AND of two bigints.\n\n**Deprecated:** Use `&&&` operator or `bitwiseAnd` instead.\n\n## Examples\n\n```rescript\nBigInt.land(7n, 4n) == 4n\n```" - ], - "signature": "let land: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lor", - "kind": "value", - "name": "lor", - "docstrings": [ - "`lor(a, b)` calculates the bitwise OR of two bigints.\n\n**Deprecated:** Use `|||` operator or `bitwiseOr` instead.\n\n## Examples\n\n```rescript\nBigInt.lor(7n, 4n) == 7n\n```" - ], - "signature": "let lor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lxor", - "kind": "value", - "name": "lxor", - "docstrings": [ - "`lxor(a, b)` calculates the bitwise XOR of two bigints.\n\n**Deprecated:** Use `^^^` operator or `bitwiseXor` instead.\n\n## Examples\n\n```rescript\nBigInt.lxor(7n, 4n) == 3n\n```" - ], - "signature": "let lxor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lnot", - "kind": "value", - "name": "lnot", - "docstrings": [ - "`lnot(bigint)` calculates the bitwise NOT of a bigint.\n\n**Deprecated:** Use `~~~` operator or `bitwiseNot` instead.\n\n## Examples\n\n```rescript\nBigInt.lnot(2n) == -3n\n```" - ], - "signature": "let lnot: bigint => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lsl", - "kind": "value", - "name": "lsl", - "docstrings": [ - "`lsl(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the left.\n\n**Deprecated:** Use `<<` operator or `shiftLeft` instead.\n\n## Examples\n\n```rescript\nBigInt.lsl(4n, 1n) == 8n\n```" - ], - "signature": "let lsl: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.asr", - "kind": "value", - "name": "asr", - "docstrings": [ - "`asr(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the right.\n\n**Deprecated:** Use `>>` operator or `shiftRight` instead.\n\n## Examples\n\n```rescript\nBigInt.asr(8n, 1n) == 4n\n```" - ], - "signature": "let asr: (bigint, bigint) => bigint", - "deprecated": "" - } - ] - }, - "stdlib/array": { - "id": "Stdlib.Array", - "name": "Array", - "docstrings": [ - "A mutable array.\n\nCompiles to a regular JavaScript array." - ], - "items": [ - { - "id": "Stdlib.Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an array of value `'a`." - ], - "signature": "type t<'a> = array<'a>" - }, - { - "id": "Stdlib.Array.arrayLike", - "kind": "type", - "name": "arrayLike", - "docstrings": [], - "signature": "type arrayLike<'a>" - }, - { - "id": "Stdlib.Array.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "`fromIterator(iterator)` creates an array from the provided `iterator`\n\n## Examples\n\n```rescript\nMap.fromArray([(\"foo\", 1), (\"bar\", 2)])\n->Map.values\n->Array.fromIterator == [1, 2]\n```" - ], - "signature": "let fromIterator: Iterator.t<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.fromArrayLike", - "kind": "value", - "name": "fromArrayLike", - "docstrings": [ - "`fromArrayLike(source)` converts an array-like value (anything with indexed items and a `length`) into a regular array.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 10, 1: 20, length: 2}`)\nArray.fromArrayLike(source) == [10, 20]\n```" - ], - "signature": "let fromArrayLike: arrayLike<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.fromArrayLikeWithMap", - "kind": "value", - "name": "fromArrayLikeWithMap", - "docstrings": [ - "`fromArrayLikeWithMap(source, map)` converts an array-like value into an array and applies `map` to every element.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 1, 1: 2, length: 2}`)\nArray.fromArrayLikeWithMap(source, x => x * 10) == [10, 20]\n```" - ], - "signature": "let fromArrayLikeWithMap: (arrayLike<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Stdlib.Array.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(str)` creates an array of each character as a separate string from the provided `str`.\n\n## Examples\n\n```rescript\nArray.fromString(\"abcde\") == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let fromString: string => array" - }, - { - "id": "Stdlib.Array.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(~length, init)` creates an array of length `length` initialized with the value of `init`.\n\n## Examples\n\n```rescript\nArray.make(~length=3, #apple) == [#apple, #apple, #apple]\nArray.make(~length=6, 7) == [7, 7, 7, 7, 7, 7]\n```" - ], - "signature": "let make: (~length: int, 'a) => array<'a>" - }, - { - "id": "Stdlib.Array.fromInitializer", - "kind": "value", - "name": "fromInitializer", - "docstrings": [ - "`fromInitializer(~length, f)`\n\nCreates an array of length `length` initialized with the value returned from `f ` for each index.\n\n## Examples\n\n```rescript\nArray.fromInitializer(~length=3, i => i + 3) == [3, 4, 5]\n\nArray.fromInitializer(~length=7, i => i + 3) == [3, 4, 5, 6, 7, 8, 9]\n```" - ], - "signature": "let fromInitializer: (~length: int, int => 'a) => array<'a>" - }, - { - "id": "Stdlib.Array.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(left, right, predicate)` checks if the two arrays contain the same elements according to the equality `predicate`.\n\n## Examples\n\n```rescript\nArray.equal([1, 2, 3], [1, 2, 3], Int.equal) == true\nArray.equal([1, 2, 3], [1, 3, 2], Int.equal) == false\n```" - ], - "signature": "let equal: (array<'a>, array<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Stdlib.Array.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(left, right, comparator)` compares two arrays element by element using `comparator` and returns an `Ordering`.\n\n## Examples\n\n```rescript\nArray.compare([1, 3], [1, 2], Int.compare) == Ordering.greater\nArray.compare([1, 2], [1, 2], Int.compare) == Ordering.equal\n```" - ], - "signature": "let compare: (array<'a>, array<'a>, ('a, 'a) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.Array.isArray", - "kind": "value", - "name": "isArray", - "docstrings": [ - "`isArray(value)` returns `true` when `value` is a JavaScript array and `false` otherwise.\n\nSee [`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) on MDN.\n\n## Examples\n\n```rescript\nArray.isArray([1, 2, 3]) == true\nArray.isArray(\"not an array\") == false\n```" - ], - "signature": "let isArray: 'a => bool" - }, - { - "id": "Stdlib.Array.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(array)` returns the length of (i.e. number of items in) the array.\n\nSee [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.length == 2\n```" - ], - "signature": "let length: array<'a> => int" - }, - { - "id": "Stdlib.Array.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\n[]->Array.isEmpty->assertEqual(true)\n[1, 2, 3]->Array.isEmpty->assertEqual(false)\n\nlet emptyArray = []\nemptyArray->Array.isEmpty->assertEqual(true)\n\nlet nonEmptyArray = [\"hello\"]\nnonEmptyArray->Array.isEmpty->assertEqual(false)\n```" - ], - "signature": "let isEmpty: array<'a> => bool" - }, - { - "id": "Stdlib.Array.copyAllWithin", - "kind": "value", - "name": "copyAllWithin", - "docstrings": [ - "`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyAllWithin(~target=2) == [100, 101, 100, 101, 102]\narr == [100, 101, 100, 101, 102]\n```" - ], - "signature": "let copyAllWithin: (array<'a>, ~target: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Array.copyWithinToEnd", - "kind": "value", - "name": "copyWithinToEnd", - "docstrings": [ - "`copyWithinToEnd(array, ~target, ~start)` copies starting at element `start` in the given array to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyWithinToEnd(~target=0, ~start=2) == [102, 103, 104, 103, 104]\narr == [102, 103, 104, 103, 104]\n```" - ], - "signature": "let copyWithinToEnd: (array<'a>, ~target: int, ~start: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [ - "`copyWithin(array, ~target, ~start, ~end)` copies starting at element `start` in the given array up to but not including `end` to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105]\narr->Array.copyWithin(~target=1, ~start=2, ~end=5) == [100, 102, 103, 104, 104, 105]\narr == [100, 102, 103, 104, 104, 105]\n```" - ], - "signature": "let copyWithin: (\n array<'a>,\n ~target: int,\n ~start: int,\n ~end: int=?,\n) => array<'a>" - }, - { - "id": "Stdlib.Array.fillAll", - "kind": "value", - "name": "fillAll", - "docstrings": [ - "`fillAll(array, value)` fills the entire `array` with `value`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillAll(9)\nmyArray == [9, 9, 9, 9]\n```" - ], - "signature": "let fillAll: (array<'a>, 'a) => unit", - "deprecated": "" - }, - { - "id": "Stdlib.Array.fillToEnd", - "kind": "value", - "name": "fillToEnd", - "docstrings": [ - "`fillToEnd(array, value, ~start)` fills `array` with `value` from the `start` index.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillToEnd(9, ~start=1)\nmyArray == [1, 9, 9, 9]\n```" - ], - "signature": "let fillToEnd: (array<'a>, 'a, ~start: int) => unit", - "deprecated": "" - }, - { - "id": "Stdlib.Array.fill", - "kind": "value", - "name": "fill", - "docstrings": [ - "`fill(array, value, ~start, ~end)` fills `array` with `value` from `start` to `end`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\n\nmyArray->Array.fill(9)\nmyArray == [9, 9, 9, 9]\n\nmyArray->Array.fill(0, ~start=1)\nmyArray == [9, 0, 0, 0]\n\nmyArray->Array.fill(5, ~start=1, ~end=3)\nmyArray == [9, 5, 5, 0]\n```" - ], - "signature": "let fill: (array<'a>, 'a, ~start: int=?, ~end: int=?) => unit" - }, - { - "id": "Stdlib.Array.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "`pop(array)` removes the last item from `array` and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pop == Some(\"hello\")\n\nsomeArray == [\"hi\"] // Notice last item is gone.\n```" - ], - "signature": "let pop: array<'a> => option<'a>" - }, - { - "id": "Stdlib.Array.push", - "kind": "value", - "name": "push", - "docstrings": [ - "`push(array, item)` appends `item` to the end of `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.push(\"yay\")\n\nsomeArray == [\"hi\", \"hello\", \"yay\"]\n```" - ], - "signature": "let push: (array<'a>, 'a) => unit" - }, - { - "id": "Stdlib.Array.pushMany", - "kind": "value", - "name": "pushMany", - "docstrings": [ - "`pushMany(array, itemsArray)` appends many new items to the end of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pushMany([\"yay\", \"wehoo\"])\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let pushMany: (array<'a>, array<'a>) => unit" - }, - { - "id": "Stdlib.Array.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(array)` reverses the order of the items in `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.reverse\n\nsomeArray == [\"hello\", \"hi\"]\n```" - ], - "signature": "let reverse: array<'a> => unit" - }, - { - "id": "Stdlib.Array.shift", - "kind": "value", - "name": "shift", - "docstrings": [ - "`shift(array)` removes the first item in the array, and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.shift == Some(\"hi\")\n\nsomeArray == [\"hello\"] // Notice first item is gone.\n```" - ], - "signature": "let shift: array<'a> => option<'a>" - }, - { - "id": "Stdlib.Array.toSorted", - "kind": "value", - "name": "toSorted", - "docstrings": [ - "`toSorted(array, comparator)` returns a new, sorted array from `array`, using the `comparator` function.\n\nSee [`Array.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [3, 2, 1]\n\nsomeArray->Array.toSorted(Int.compare) == [1, 2, 3]\n\nsomeArray == [3, 2, 1] // Original unchanged\n```" - ], - "signature": "let toSorted: (array<'a>, ('a, 'a) => Ordering.t) => array<'a>" - }, - { - "id": "Stdlib.Array.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(array, comparator)` sorts `array` in-place using the `comparator` function.\n\nBeware this will *mutate* the array.\n\nSee [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet array = [3, 2, 1]\narray->Array.sort((a, b) => float(a - b))\narray == [1, 2, 3]\n```" - ], - "signature": "let sort: (array<'a>, ('a, 'a) => Ordering.t) => unit" - }, - { - "id": "Stdlib.Array.splice", - "kind": "value", - "name": "splice", - "docstrings": [ - "`splice(array, ~start, ~remove, ~insert)` removes `remove` items starting at `start` and inserts the values from `insert`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) on MDN.\n\n## Examples\n\n```rescript\nlet items = [\"a\", \"b\", \"c\"]\nitems->Array.splice(~start=1, ~remove=1, ~insert=[\"x\"])\nitems == [\"a\", \"x\", \"c\"]\n```" - ], - "signature": "let splice: (\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => unit" - }, - { - "id": "Stdlib.Array.toSpliced", - "kind": "value", - "name": "toSpliced", - "docstrings": [ - "`toSpliced(array, ~start, ~remove, ~insert)` returns a new array with the same edits that `splice` would perform, leaving the original unchanged.\n\nSee [`Array.toSpliced`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced) on MDN.\n\n## Examples\n\n```rescript\nlet original = [1, 2, 3]\nlet updated = original->Array.toSpliced(~start=1, ~remove=1, ~insert=[10])\nupdated == [1, 10, 3]\noriginal == [1, 2, 3]\n```" - ], - "signature": "let toSpliced: (\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => array<'a>" - }, - { - "id": "Stdlib.Array.removeInPlace", - "kind": "value", - "name": "removeInPlace", - "docstrings": [ - "`removeInPlace(array, index)` removes the item at the specified `index` from `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = []\narray->Array.removeInPlace(0)\narray == [] // Removing from an empty array does nothing\n\nlet array2 = [\"Hello\", \"Hi\", \"Good bye\"]\narray2->Array.removeInPlace(1)\narray2 == [\"Hello\", \"Good bye\"] // Removes the item at index 1\n```" - ], - "signature": "let removeInPlace: (array<'a>, int) => unit" - }, - { - "id": "Stdlib.Array.with", - "kind": "value", - "name": "with", - "docstrings": [ - "`with(array, index, value)` returns a copy of `array` where the element at `index` is replaced with `value`.\n\nSee [`Array.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/with) on MDN.\n\n## Examples\n\n```rescript\nlet original = [\"a\", \"b\", \"c\"]\nlet replaced = original->Array.with(1, \"x\")\nreplaced == [\"a\", \"x\", \"c\"]\noriginal == [\"a\", \"b\", \"c\"]\n```" - ], - "signature": "let with: (array<'a>, int, 'a) => array<'a>" - }, - { - "id": "Stdlib.Array.unshift", - "kind": "value", - "name": "unshift", - "docstrings": [ - "`unshift(array, item)` inserts a new item at the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshift(\"yay\")\nsomeArray == [\"yay\", \"hi\", \"hello\"]\n```" - ], - "signature": "let unshift: (array<'a>, 'a) => unit" - }, - { - "id": "Stdlib.Array.unshiftMany", - "kind": "value", - "name": "unshiftMany", - "docstrings": [ - "`unshiftMany(array, itemsArray)` inserts many new items to the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshiftMany([\"yay\", \"wehoo\"])\nsomeArray == [\"yay\", \"wehoo\", \"hi\", \"hello\"]\n```" - ], - "signature": "let unshiftMany: (array<'a>, array<'a>) => unit" - }, - { - "id": "Stdlib.Array.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(array1, array2)` concatenates the two arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\", \"wehoo\"]\n\nlet someArray = array1->Array.concat(array2)\n\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let concat: (array<'a>, array<'a>) => array<'a>" - }, - { - "id": "Stdlib.Array.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(array1, arrays)` concatenates array1 with several other arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\"]\nlet array3 = [\"wehoo\"]\n\nlet someArray = array1->Array.concatMany([array2, array3])\n\nConsole.log(someArray) // [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let concatMany: (array<'a>, array>) => array<'a>" - }, - { - "id": "Stdlib.Array.flat", - "kind": "value", - "name": "flat", - "docstrings": [ - "`flat(arrays)` concatenates an array of arrays into a single array.\n\nSee [`Array.flat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) on MDN.\n\n## Examples\n\n```rescript\n[[1], [2], [3, 4]]->Array.flat == [1, 2, 3, 4]\n```" - ], - "signature": "let flat: array> => array<'a>" - }, - { - "id": "Stdlib.Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "`includes(array, item)` checks whether `array` includes `item`, by doing a [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality).\n\nSee [`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.includes(1) == true\n[1, 2]->Array.includes(3) == false\n\n[{\"language\": \"ReScript\"}]->Array.includes({\"language\": \"ReScript\"}) == false // false, because of strict equality\n```" - ], - "signature": "let includes: (array<'a>, 'a) => bool" - }, - { - "id": "Stdlib.Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "`indexOf(array, item, ~from)` returns the index of the provided `item` in `array`, starting the search at `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.indexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOf(2) == 1\n[1, 2]->Array.indexOf(3) == -1\n[1, 2, 1, 2]->Array.indexOf(2, ~from=2) == 3\n\n[{\"language\": \"ReScript\"}]->Array.indexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```" - ], - "signature": "let indexOf: (array<'a>, 'a, ~from: int=?) => int" - }, - { - "id": "Stdlib.Array.indexOfOpt", - "kind": "value", - "name": "indexOfOpt", - "docstrings": [ - "`indexOfOpt(array, item)` returns an option of the index of the provided `item` in `array`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOfOpt(2) == Some(1)\n[1, 2]->Array.indexOfOpt(3) == None\n[{\"language\": \"ReScript\"}]->Array.indexOfOpt({\"language\": \"ReScript\"}) == None // None, because of strict equality\n```" - ], - "signature": "let indexOfOpt: (array<'a>, 'a) => option" - }, - { - "id": "Stdlib.Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (array<'a>, 'a, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Array.join", - "kind": "value", - "name": "join", - "docstrings": [ - "`join(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.join(\" -- \") == \"One -- Two -- Three\"\n```" - ], - "signature": "let join: (array, string) => string" - }, - { - "id": "Stdlib.Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "`joinWith(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinWithUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.joinWith(\" -- \") == \"One -- Two -- Three\"\n```" - ], - "signature": "let joinWith: (array, string) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Array.joinUnsafe", - "kind": "value", - "name": "joinUnsafe", - "docstrings": [ - "`joinUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```" - ], - "signature": "let joinUnsafe: (array<'a>, string) => string" - }, - { - "id": "Stdlib.Array.joinWithUnsafe", - "kind": "value", - "name": "joinWithUnsafe", - "docstrings": [ - "`joinWithUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinWithUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```" - ], - "signature": "let joinWithUnsafe: (array<'a>, string) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(array, item, ~from)` returns the last index of the provided `item` in `array`, searching backwards from `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.lastIndexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 1, 2]->Array.lastIndexOf(2) == 3\n[1, 2]->Array.lastIndexOf(3) == -1\n[1, 2, 1, 2]->Array.lastIndexOf(2, ~from=2) == 1\n\n[{\"language\": \"ReScript\"}]->Array.lastIndexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```" - ], - "signature": "let lastIndexOf: (array<'a>, 'a, ~from: int=?) => int" - }, - { - "id": "Stdlib.Array.lastIndexOfOpt", - "kind": "value", - "name": "lastIndexOfOpt", - "docstrings": [], - "signature": "let lastIndexOfOpt: (array<'a>, 'a) => option" - }, - { - "id": "Stdlib.Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (array<'a>, 'a, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(array, ~start, ~end)` creates a new array of items copied from `array` from `start` until (but not including) `end`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.slice(~start=1, ~end=3) == [2, 3]\n[1, 2, 3, 4]->Array.slice(~start=1) == [2, 3, 4]\n[1, 2, 3, 4]->Array.slice == [1, 2, 3, 4]\n```" - ], - "signature": "let slice: (array<'a>, ~start: int=?, ~end: int=?) => array<'a>" - }, - { - "id": "Stdlib.Array.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(array, start)` creates a new array from `array`, with all items from `array` starting from `start`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.sliceToEnd(~start=1) == [2, 3, 4]\n```" - ], - "signature": "let sliceToEnd: (array<'a>, ~start: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(array)` makes a copy of the array with the items in it, but does not make copies of the items themselves.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3]\nlet copyOfMyArray = myArray->Array.copy\n\ncopyOfMyArray == [1, 2, 3]\n(myArray === copyOfMyArray) == false\n```" - ], - "signature": "let copy: array<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(array)` stringifies `array` by running `toString` on all of the array elements and joining them with \",\".\n\nSee [`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.toString == \"1,2,3,4\"\n```" - ], - "signature": "let toString: array<'a> => string" - }, - { - "id": "Stdlib.Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(array)` converts each element to a locale-aware string and joins them with commas.\n\nSee [`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n[\"apple\", \"banana\"]->Array.toLocaleString == \"apple,banana\"\n```" - ], - "signature": "let toLocaleString: array<'a> => string" - }, - { - "id": "Stdlib.Array.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(array, predicate)` returns true if `predicate` returns true for all items in `array`.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.every(num => num <= 4) == true\n\narray->Array.every(num => num === 1) == false\n```" - ], - "signature": "let every: (array<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Array.everyWithIndex", - "kind": "value", - "name": "everyWithIndex", - "docstrings": [ - "`everyWithIndex(array, checker)` returns true if all items in `array` returns true when running the provided `checker` function.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.everyWithIndex((num, index) => index < 5 && num <= 4) == true\n\narray->Array.everyWithIndex((num, index) => index < 2 && num >= 2) == false\n```" - ], - "signature": "let everyWithIndex: (array<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filter(num => num > 2) == [3, 4]\n```" - ], - "signature": "let filter: (array<'a>, 'a => bool) => array<'a>" - }, - { - "id": "Stdlib.Array.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filterWithIndex((num, index) => index === 0 || num === 2) == [1, 2]\n```" - ], - "signature": "let filterWithIndex: (array<'a>, ('a, int) => bool) => array<'a>" - }, - { - "id": "Stdlib.Array.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.find(item => item == ReScript) == Some(ReScript)\n```" - ], - "signature": "let find: (array<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findWithIndex", - "kind": "value", - "name": "findWithIndex", - "docstrings": [ - "`findWithIndex(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [TypeScript, JavaScript, ReScript]\n\narray->Array.findWithIndex((item, index) => index > 1 && item == ReScript) == Some(ReScript)\n```" - ], - "signature": "let findWithIndex: (array<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findLast", - "kind": "value", - "name": "findLast", - "docstrings": [ - "`findLast(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLast(item => item > 0) == Some(3)\n```" - ], - "signature": "let findLast: (array<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findLastWithIndex", - "kind": "value", - "name": "findLastWithIndex", - "docstrings": [ - "`findLastWithIndex(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLastWithIndex((item, index) => index < 2 && item > 0) == Some(2)\n```" - ], - "signature": "let findLastWithIndex: (array<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [ - "`findIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\narray->Array.findIndex(item => item == ReScript) == 0\n\narray->Array.findIndex(item => item == TypeScript) == -1\n```" - ], - "signature": "let findIndex: (array<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.Array.findIndexWithIndex", - "kind": "value", - "name": "findIndexWithIndex", - "docstrings": [ - "`findIndexWithIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\nlet isReScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == ReScript)\nlet isTypeScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == TypeScript)\n\nisReScriptFirst == 0\nisTypeScriptFirst == -1\n```" - ], - "signature": "let findIndexWithIndex: (array<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.Array.findLastIndex", - "kind": "value", - "name": "findLastIndex", - "docstrings": [ - "`findLastIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, ReScript]\n\narray->Array.findLastIndex(item => item == ReScript) == 2\n\narray->Array.findLastIndex(item => item == TypeScript) == -1\n```" - ], - "signature": "let findLastIndex: (array<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.Array.findLastIndexWithIndex", - "kind": "value", - "name": "findLastIndexWithIndex", - "docstrings": [ - "`findLastIndexWithIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, JavaScript, ReScript]\n\nlet isReScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == ReScript)\nlet isTypeScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == TypeScript)\n\nisReScriptLast == 3\nisTypeScriptLast == -1\n```" - ], - "signature": "let findLastIndexWithIndex: (array<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEach(item => {\n Console.log(item)\n})\n```" - ], - "signature": "let forEach: (array<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Array.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEachWithIndex((item, index) => {\n Console.log(\"At item \" ++ Int.toString(index) ++ \": \" ++ item)\n})\n```" - ], - "signature": "let forEachWithIndex: (array<'a>, ('a, int) => unit) => unit" - }, - { - "id": "Stdlib.Array.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```" - ], - "signature": "let map: (array<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Stdlib.Array.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```" - ], - "signature": "let mapWithIndex: (array<'a>, ('a, int) => 'b) => array<'b>" - }, - { - "id": "Stdlib.Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(xs, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has two parameters: the item from the list and an \"accumulator\"; which starts with a value of `init`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\nArray.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n\n[1, 2, 3]->Array.reduce(list{}, List.add) == list{3, 2, 1}\n\nArray.reduce([], list{}, List.add) == list{}\n```" - ], - "signature": "let reduce: (array<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(x, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has three parameters: the item from the array and an \"accumulator\", which starts with a value of `init` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceWithIndex([1, 2, 3], list{}, (acc, v, i) => list{v + i, ...acc}) == list{5, 3, 1}\n\nArray.reduceWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```" - ], - "signature": "let reduceWithIndex: (array<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [ - "`reduceRight(xs, init, fn)`\n\nWorks like `Array.reduce`; except that function `fn` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nArray.reduceRight([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n\nArray.reduceRight([1, 2, 3], list{}, List.add) == list{1, 2, 3}\n\nArray.reduceRight([], list{}, List.add) == list{}\n```" - ], - "signature": "let reduceRight: (array<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.reduceRightWithIndex", - "kind": "value", - "name": "reduceRightWithIndex", - "docstrings": [ - "`reduceRightWithIndex(xs, init, fn)`\n\nLike `reduceRight`, but with an additional index argument on the callback function.\n\n## Examples\n\n```rescript\nArray.reduceRightWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceRightWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```" - ], - "signature": "let reduceRightWithIndex: (array<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(array, predicate)` returns true if `predicate` returns true for any element in `array`.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.some(greeting => greeting === \"Hello\") == true\n```" - ], - "signature": "let some: (array<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Array.someWithIndex", - "kind": "value", - "name": "someWithIndex", - "docstrings": [ - "`someWithIndex(array, checker)` returns true if running the provided `checker` function on any element in `array` returns true.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.someWithIndex((greeting, index) => greeting === \"Hello\" && index === 0) == true\n```" - ], - "signature": "let someWithIndex: (array<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.Array.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(array, index)` returns the element at `index` of `array`.\n\nReturns `None` if the index does not exist in the array. Equivalent to doing `array[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.get(0) == Some(\"Hello\")\n\narray->Array.get(3) == None\n```" - ], - "signature": "let get: (array<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.Array.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.set(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```" - ], - "signature": "let set: (array<'a>, int, 'a) => unit" - }, - { - "id": "Stdlib.Array.getSymbol", - "kind": "value", - "name": "getSymbol", - "docstrings": [ - "`getSymbol(array, key)` retrieves the value stored under the symbol `key`, if present.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN for more details about symbol keys.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbol(items, key) == Some(\"hello\")\n```" - ], - "signature": "let getSymbol: (array<'a>, Symbol.t) => option<'b>" - }, - { - "id": "Stdlib.Array.getSymbolUnsafe", - "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [ - "`getSymbolUnsafe(array, key)` retrieves the value stored under the symbol `key` without any safety checks.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbolUnsafe(items, key) == \"hello\"\n```" - ], - "signature": "let getSymbolUnsafe: (array<'a>, Symbol.t) => 'b" - }, - { - "id": "Stdlib.Array.setSymbol", - "kind": "value", - "name": "setSymbol", - "docstrings": [ - "`setSymbol(array, key, value)` stores `value` under the symbol `key` on `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"count\")\nlet items = []\nitems->Array.setSymbol(key, 5)\nArray.getSymbol(items, key) == Some(5)\n```" - ], - "signature": "let setSymbol: (array<'a>, Symbol.t, 'b) => unit" - }, - { - "id": "Stdlib.Array.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.getUnsafe` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.getUnsafe(index)\n Console.log(value)\n}\n```" - ], - "signature": "let getUnsafe: (array<'a>, int) => 'a" - }, - { - "id": "Stdlib.Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [ - "`unsafe_get(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.unsafe_get` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.unsafe_get(index)\n Console.log(value)\n}\n```" - ], - "signature": "let unsafe_get: (array<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Array.setUnsafe", - "kind": "value", - "name": "setUnsafe", - "docstrings": [ - "`setUnsafe(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array, and is *unsafe*.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.setUnsafe(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```" - ], - "signature": "let setUnsafe: (array<'a>, int, 'a) => unit" - }, - { - "id": "Stdlib.Array.findIndexOpt", - "kind": "value", - "name": "findIndexOpt", - "docstrings": [ - "`findIndexOpt(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.findIndexOpt(item => item == ReScript) == Some(0)\n```" - ], - "signature": "let findIndexOpt: (array<'a>, 'a => bool) => option" - }, - { - "id": "Stdlib.Array.findLastIndexOpt", - "kind": "value", - "name": "findLastIndexOpt", - "docstrings": [ - "`findIndexOpt(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"hello\", \"world\", \"!\"]\n\narray->Array.findLastIndexOpt(item => item->String.includes(\"o\")) == Some(1)\n```" - ], - "signature": "let findLastIndexOpt: (array<'a>, 'a => bool) => option" - }, - { - "id": "Stdlib.Array.toReversed", - "kind": "value", - "name": "toReversed", - "docstrings": [ - "`toReversed(array)` creates a new array with all items from `array` in reversed order.\n\nSee [`Array.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nlet reversed = someArray->Array.toReversed\n\nreversed == [\"hello\", \"hi\"]\nsomeArray == [\"hi\", \"hello\"] // Original unchanged\n```" - ], - "signature": "let toReversed: array<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.filterMap", - "kind": "value", - "name": "filterMap", - "docstrings": [ - "`filterMap(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMap(item =>\n switch item {\n | \"Hello\" => Some(item->String.length)\n | _ => None\n }\n) == [5]\n\n[1, 2, 3, 4, 5, 6]->Array.filterMap(n => mod(n, 2) == 0 ? Some(n * n) : None) == [4, 16, 36]\n\nArray.filterMap([1, 2, 3, 4, 5, 6], _ => None) == []\n\nArray.filterMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == []\n```" - ], - "signature": "let filterMap: (array<'a>, 'a => option<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.filterMapWithIndex", - "kind": "value", - "name": "filterMapWithIndex", - "docstrings": [ - "`filterMapWithIndex(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMapWithIndex((item, index) =>\n switch item {\n | \"Hello\" => Some(index)\n | _ => None\n }\n) == [0]\n```" - ], - "signature": "let filterMapWithIndex: (array<'a>, ('a, int) => option<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.keepSome", - "kind": "value", - "name": "keepSome", - "docstrings": [ - "`keepSome(arr)`\n\nReturns a new array containing `value` for all elements that are `Some(value)`\nand ignoring every value that is `None`\n\n## Examples\n\n```rescript\nArray.keepSome([Some(1), None, Some(3)]) == [1, 3]\n\nArray.keepSome([Some(1), Some(2), Some(3)]) == [1, 2, 3]\n\nArray.keepSome([None, None, None]) == []\n\nArray.keepSome([]) == []\n```" - ], - "signature": "let keepSome: array> => array<'a>" - }, - { - "id": "Stdlib.Array.toShuffled", - "kind": "value", - "name": "toShuffled", - "docstrings": [ - "`toShuffled(array)` returns a new array with all items in `array` in a random order.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet shuffledArray = array->Array.toShuffled\nConsole.log(shuffledArray)\n\nArray.toShuffled([1, 2, 3])->Array.length == 3\n```" - ], - "signature": "let toShuffled: array<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "`shuffle(array)` randomizes the position of all items in `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.shuffle\nConsole.log(array)\n\nlet array2 = [1, 2, 3]\narray2->Array.shuffle\n\narray2->Array.length == 3\n```" - ], - "signature": "let shuffle: array<'a> => unit" - }, - { - "id": "Stdlib.Array.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMap(item =>\n switch item {\n | ReScript => [1, 2, 3]\n | TypeScript => [4, 5, 6]\n | JavaScript => [7, 8, 9]\n }\n) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\n```" - ], - "signature": "let flatMap: (array<'a>, 'a => array<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.flatMapWithIndex", - "kind": "value", - "name": "flatMapWithIndex", - "docstrings": [ - "`flatMapWithIndex(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMapWithIndex((item, index) =>\n switch item {\n | ReScript => [index]\n | TypeScript => [index, index + 1]\n | JavaScript => [index, index + 1, index + 2]\n }\n) == [0, 1, 2, 2, 3, 4]\n```" - ], - "signature": "let flatMapWithIndex: (array<'a>, ('a, int) => array<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.findMap", - "kind": "value", - "name": "findMap", - "docstrings": [ - "`findMap(arr, fn)`\n\nCalls `fn` for each element and returns the first value from `fn` that is `Some(_)`.\nOtherwise returns `None`\n\n## Examples\n\n```rescript\nArray.findMap([1, 2, 3], n => mod(n, 2) == 0 ? Some(n - 2) : None) == Some(0)\n\nArray.findMap([1, 2, 3, 4, 5, 6], n => mod(n, 2) == 0 ? Some(n - 8) : None) == Some(-6)\n\nArray.findMap([1, 2, 3, 4, 5, 6], _ => None) == None\n\nArray.findMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == None\n```" - ], - "signature": "let findMap: (array<'a>, 'a => option<'b>) => option<'b>" - }, - { - "id": "Stdlib.Array.at", - "kind": "value", - "name": "at", - "docstrings": [ - "`at(array, index)`\n\nGet an element by its index. Negative indices count backwards from the last item.\n\n## Examples\n\n```rescript\n[\"a\", \"b\", \"c\"]->Array.at(0) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(2) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(3) == None\n[\"a\", \"b\", \"c\"]->Array.at(-1) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(-3) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(-4) == None\n```" - ], - "signature": "let at: (array<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.Array.last", - "kind": "value", - "name": "last", - "docstrings": [ - "`last(array)` returns the last element of `array`.\n\nReturns `None` if the array is empty.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.last == Some(\"Good bye\")\n\n[]->Array.last == None\n```" - ], - "signature": "let last: array<'a> => option<'a>" - }, - { - "id": "Stdlib.Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(array)` ignores the provided array and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: array<'a> => unit" - }, - { - "id": "Stdlib.Array.entries", - "kind": "value", - "name": "entries", - "docstrings": [ - "`entries(array)` returns a new array iterator object that contains the key/value pairs for each index in the array.\n\nSee [Array.prototype.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: Iterator.t<(int, int)> = array->Array.entries\niterator->Iterator.next == {done: false, value: Some((0, 5))}\niterator->Iterator.next == {done: false, value: Some((1, 6))}\n```" - ], - "signature": "let entries: array<'a> => Iterator.t<(int, 'a)>" - }, - { - "id": "Stdlib.Array.values", - "kind": "value", - "name": "values", - "docstrings": [ - "`values(array)` returns a new array iterator object that contains the values for each index in the array.\n\nSee [Array.prototype.values](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: Iterator.t = array->Array.values\niterator->Iterator.next == {done: false, value: Some(5)}\niterator->Iterator.next == {done: false, value: Some(6)}\n```" - ], - "signature": "let values: array<'a> => Iterator.t<'a>" - } - ] - }, - "stdlib/intervalid": { - "id": "Stdlib.IntervalId", - "name": "IntervalId", - "docstrings": [], - "items": [] - }, - "stdlib/timeoutid": { - "id": "Stdlib.TimeoutId", - "name": "TimeoutId", - "docstrings": [], - "items": [] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v12.0.2/toc_tree.json b/apps/docs/data/api/v12.0.2/toc_tree.json deleted file mode 100644 index 7304b0e63..000000000 --- a/apps/docs/data/api/v12.0.2/toc_tree.json +++ /dev/null @@ -1 +0,0 @@ -{"belt":{"name":"Belt","path":["belt"],"children":[{"name":"Float","path":["belt","float"],"children":[]},{"name":"Int","path":["belt","int"],"children":[]},{"name":"Result","path":["belt","result"],"children":[]},{"name":"Option","path":["belt","option"],"children":[]},{"name":"HashMap","path":["belt","hashmap"],"children":[{"name":"String","path":["belt","hashmap","string"],"children":[]},{"name":"Int","path":["belt","hashmap","int"],"children":[]}]},{"name":"HashSet","path":["belt","hashset"],"children":[{"name":"String","path":["belt","hashset","string"],"children":[]},{"name":"Int","path":["belt","hashset","int"],"children":[]}]},{"name":"MutableMap","path":["belt","mutablemap"],"children":[{"name":"String","path":["belt","mutablemap","string"],"children":[]},{"name":"Int","path":["belt","mutablemap","int"],"children":[]}]},{"name":"MutableSet","path":["belt","mutableset"],"children":[{"name":"String","path":["belt","mutableset","string"],"children":[]},{"name":"Int","path":["belt","mutableset","int"],"children":[]}]},{"name":"Map","path":["belt","map"],"children":[{"name":"Dict","path":["belt","map","dict"],"children":[]},{"name":"String","path":["belt","map","string"],"children":[]},{"name":"Int","path":["belt","map","int"],"children":[]}]},{"name":"Set","path":["belt","set"],"children":[{"name":"Dict","path":["belt","set","dict"],"children":[]},{"name":"String","path":["belt","set","string"],"children":[]},{"name":"Int","path":["belt","set","int"],"children":[]}]},{"name":"Range","path":["belt","range"],"children":[]},{"name":"List","path":["belt","list"],"children":[]},{"name":"MutableStack","path":["belt","mutablestack"],"children":[]},{"name":"MutableQueue","path":["belt","mutablequeue"],"children":[]},{"name":"SortArray","path":["belt","sortarray"],"children":[{"name":"String","path":["belt","sortarray","string"],"children":[]},{"name":"Int","path":["belt","sortarray","int"],"children":[]}]},{"name":"Array","path":["belt","array"],"children":[]},{"name":"Id","path":["belt","id"],"children":[{"name":"MakeHashable","path":["belt","id","makehashable"],"children":[]},{"name":"MakeHashableU","path":["belt","id","makehashableu"],"children":[]},{"name":"MakeComparable","path":["belt","id","makecomparable"],"children":[]},{"name":"MakeComparableU","path":["belt","id","makecomparableu"],"children":[]}]}]},"dom":{"name":"Dom","path":["dom"],"children":[{"name":"Storage2","path":["dom","storage2"],"children":[]},{"name":"Storage","path":["dom","storage"],"children":[]}]},"js":{"name":"Js","path":["js"],"children":[{"name":"WeakMap","path":["js","weakmap"],"children":[]},{"name":"Map","path":["js","map"],"children":[]},{"name":"WeakSet","path":["js","weakset"],"children":[]},{"name":"Set","path":["js","set"],"children":[]},{"name":"Console","path":["js","console"],"children":[]},{"name":"Result","path":["js","result"],"children":[]},{"name":"Option","path":["js","option"],"children":[]},{"name":"Blob","path":["js","blob"],"children":[]},{"name":"File","path":["js","file"],"children":[]},{"name":"BigInt","path":["js","bigint"],"children":[]},{"name":"Int","path":["js","int"],"children":[]},{"name":"Float","path":["js","float"],"children":[]},{"name":"Types","path":["js","types"],"children":[]},{"name":"TypedArray2","path":["js","typedarray2"],"children":[{"name":"DataView","path":["js","typedarray2","dataview"],"children":[]},{"name":"Float64Array","path":["js","typedarray2","float64array"],"children":[]},{"name":"Float32Array","path":["js","typedarray2","float32array"],"children":[]},{"name":"Uint32Array","path":["js","typedarray2","uint32array"],"children":[]},{"name":"Int32Array","path":["js","typedarray2","int32array"],"children":[]},{"name":"Uint16Array","path":["js","typedarray2","uint16array"],"children":[]},{"name":"Int16Array","path":["js","typedarray2","int16array"],"children":[]},{"name":"Uint8ClampedArray","path":["js","typedarray2","uint8clampedarray"],"children":[]},{"name":"Uint8Array","path":["js","typedarray2","uint8array"],"children":[]},{"name":"Int8Array","path":["js","typedarray2","int8array"],"children":[]},{"name":"ArrayBuffer","path":["js","typedarray2","arraybuffer"],"children":[]}]},{"name":"Typed_array","path":["js","typed_array"],"children":[{"name":"DataView","path":["js","typed_array","dataview"],"children":[]},{"name":"Float64_array","path":["js","typed_array","float64_array"],"children":[]},{"name":"Float64Array","path":["js","typed_array","float64array"],"children":[]},{"name":"Float32_array","path":["js","typed_array","float32_array"],"children":[]},{"name":"Float32Array","path":["js","typed_array","float32array"],"children":[]},{"name":"Uint32Array","path":["js","typed_array","uint32array"],"children":[]},{"name":"Int32_array","path":["js","typed_array","int32_array"],"children":[]},{"name":"Int32Array","path":["js","typed_array","int32array"],"children":[]},{"name":"Uint16Array","path":["js","typed_array","uint16array"],"children":[]},{"name":"Int16Array","path":["js","typed_array","int16array"],"children":[]},{"name":"Uint8ClampedArray","path":["js","typed_array","uint8clampedarray"],"children":[]},{"name":"Uint8Array","path":["js","typed_array","uint8array"],"children":[]},{"name":"Int8Array","path":["js","typed_array","int8array"],"children":[]},{"name":"S","path":["js","typed_array","s"],"children":[]},{"name":"ArrayBuffer","path":["js","typed_array","arraybuffer"],"children":[]},{"name":"Type","path":["js","typed_array","type"],"children":[]}]},{"name":"Obj","path":["js","obj"],"children":[]},{"name":"Math","path":["js","math"],"children":[]},{"name":"Json","path":["js","json"],"children":[{"name":"Kind","path":["js","json","kind"],"children":[]}]},{"name":"Global","path":["js","global"],"children":[]},{"name":"Dict","path":["js","dict"],"children":[]},{"name":"Date","path":["js","date"],"children":[]},{"name":"Promise2","path":["js","promise2"],"children":[]},{"name":"Promise","path":["js","promise"],"children":[]},{"name":"Re","path":["js","re"],"children":[]},{"name":"String2","path":["js","string2"],"children":[]},{"name":"String","path":["js","string"],"children":[]},{"name":"Array2","path":["js","array2"],"children":[]},{"name":"Array","path":["js","array"],"children":[]},{"name":"Exn","path":["js","exn"],"children":[]},{"name":"Null_undefined","path":["js","null_undefined"],"children":[]},{"name":"Nullable","path":["js","nullable"],"children":[]},{"name":"Undefined","path":["js","undefined"],"children":[]},{"name":"Null","path":["js","null"],"children":[]}]},"stdlib":{"name":"Stdlib","path":["stdlib"],"children":[{"name":"BigUint64Array","path":["stdlib","biguint64array"],"children":[{"name":"Constants","path":["stdlib","biguint64array","constants"],"children":[]}]},{"name":"BigInt64Array","path":["stdlib","bigint64array"],"children":[{"name":"Constants","path":["stdlib","bigint64array","constants"],"children":[]}]},{"name":"Uint8ClampedArray","path":["stdlib","uint8clampedarray"],"children":[{"name":"Constants","path":["stdlib","uint8clampedarray","constants"],"children":[]}]},{"name":"Uint32Array","path":["stdlib","uint32array"],"children":[{"name":"Constants","path":["stdlib","uint32array","constants"],"children":[]}]},{"name":"Uint16Array","path":["stdlib","uint16array"],"children":[{"name":"Constants","path":["stdlib","uint16array","constants"],"children":[]}]},{"name":"Uint8Array","path":["stdlib","uint8array"],"children":[{"name":"Constants","path":["stdlib","uint8array","constants"],"children":[]}]},{"name":"Int32Array","path":["stdlib","int32array"],"children":[{"name":"Constants","path":["stdlib","int32array","constants"],"children":[]}]},{"name":"Int16Array","path":["stdlib","int16array"],"children":[{"name":"Constants","path":["stdlib","int16array","constants"],"children":[]}]},{"name":"Int8Array","path":["stdlib","int8array"],"children":[{"name":"Constants","path":["stdlib","int8array","constants"],"children":[]}]},{"name":"Float64Array","path":["stdlib","float64array"],"children":[{"name":"Constants","path":["stdlib","float64array","constants"],"children":[]}]},{"name":"Float32Array","path":["stdlib","float32array"],"children":[{"name":"Constants","path":["stdlib","float32array","constants"],"children":[]}]},{"name":"TypedArray","path":["stdlib","typedarray"],"children":[]},{"name":"ArrayBuffer","path":["stdlib","arraybuffer"],"children":[]},{"name":"WeakSet","path":["stdlib","weakset"],"children":[]},{"name":"Set","path":["stdlib","set"],"children":[]},{"name":"WeakMap","path":["stdlib","weakmap"],"children":[]},{"name":"Map","path":["stdlib","map"],"children":[]},{"name":"AsyncIterator","path":["stdlib","asynciterator"],"children":[]},{"name":"Iterator","path":["stdlib","iterator"],"children":[]},{"name":"Type","path":["stdlib","type"],"children":[{"name":"Classify","path":["stdlib","type","classify"],"children":[]}]},{"name":"Symbol","path":["stdlib","symbol"],"children":[]},{"name":"String","path":["stdlib","string"],"children":[]},{"name":"Result","path":["stdlib","result"],"children":[]},{"name":"RegExp","path":["stdlib","regexp"],"children":[{"name":"Result","path":["stdlib","regexp","result"],"children":[]}]},{"name":"Promise","path":["stdlib","promise"],"children":[]},{"name":"Pair","path":["stdlib","pair"],"children":[]},{"name":"Ordering","path":["stdlib","ordering"],"children":[]},{"name":"Option","path":["stdlib","option"],"children":[]},{"name":"Object","path":["stdlib","object"],"children":[]},{"name":"Nullable","path":["stdlib","nullable"],"children":[]},{"name":"Null","path":["stdlib","null"],"children":[]},{"name":"Math","path":["stdlib","math"],"children":[{"name":"Int","path":["stdlib","math","int"],"children":[]},{"name":"Constants","path":["stdlib","math","constants"],"children":[]}]},{"name":"List","path":["stdlib","list"],"children":[]},{"name":"Lazy","path":["stdlib","lazy"],"children":[]},{"name":"JSON","path":["stdlib","json"],"children":[{"name":"Decode","path":["stdlib","json","decode"],"children":[]},{"name":"Encode","path":["stdlib","json","encode"],"children":[]},{"name":"Classify","path":["stdlib","json","classify"],"children":[]}]},{"name":"JsExn","path":["stdlib","jsexn"],"children":[]},{"name":"JsError","path":["stdlib","jserror"],"children":[{"name":"URIError","path":["stdlib","jserror","urierror"],"children":[]},{"name":"TypeError","path":["stdlib","jserror","typeerror"],"children":[]},{"name":"SyntaxError","path":["stdlib","jserror","syntaxerror"],"children":[]},{"name":"ReferenceError","path":["stdlib","jserror","referenceerror"],"children":[]},{"name":"RangeError","path":["stdlib","jserror","rangeerror"],"children":[]},{"name":"EvalError","path":["stdlib","jserror","evalerror"],"children":[]}]},{"name":"Intl","path":["stdlib","intl"],"children":[{"name":"Segments","path":["stdlib","intl","segments"],"children":[]},{"name":"Segmenter","path":["stdlib","intl","segmenter"],"children":[]},{"name":"RelativeTimeFormat","path":["stdlib","intl","relativetimeformat"],"children":[]},{"name":"PluralRules","path":["stdlib","intl","pluralrules"],"children":[]},{"name":"NumberFormat","path":["stdlib","intl","numberformat"],"children":[{"name":"Grouping","path":["stdlib","intl","numberformat","grouping"],"children":[]}]},{"name":"Locale","path":["stdlib","intl","locale"],"children":[]},{"name":"ListFormat","path":["stdlib","intl","listformat"],"children":[]},{"name":"DateTimeFormat","path":["stdlib","intl","datetimeformat"],"children":[]},{"name":"Collator","path":["stdlib","intl","collator"],"children":[]},{"name":"Common","path":["stdlib","intl","common"],"children":[]}]},{"name":"Int","path":["stdlib","int"],"children":[{"name":"Ref","path":["stdlib","int","ref"],"children":[]},{"name":"Bitwise","path":["stdlib","int","bitwise"],"children":[]},{"name":"Constants","path":["stdlib","int","constants"],"children":[]}]},{"name":"Float","path":["stdlib","float"],"children":[{"name":"Constants","path":["stdlib","float","constants"],"children":[]}]},{"name":"Error","path":["stdlib","error"],"children":[{"name":"URIError","path":["stdlib","error","urierror"],"children":[]},{"name":"TypeError","path":["stdlib","error","typeerror"],"children":[]},{"name":"SyntaxError","path":["stdlib","error","syntaxerror"],"children":[]},{"name":"ReferenceError","path":["stdlib","error","referenceerror"],"children":[]},{"name":"RangeError","path":["stdlib","error","rangeerror"],"children":[]},{"name":"EvalError","path":["stdlib","error","evalerror"],"children":[]}]},{"name":"Exn","path":["stdlib","exn"],"children":[]},{"name":"Dict","path":["stdlib","dict"],"children":[]},{"name":"Date","path":["stdlib","date"],"children":[{"name":"UTC","path":["stdlib","date","utc"],"children":[]}]},{"name":"DataView","path":["stdlib","dataview"],"children":[]},{"name":"Console","path":["stdlib","console"],"children":[]},{"name":"Bool","path":["stdlib","bool"],"children":[]},{"name":"BigInt","path":["stdlib","bigint"],"children":[]},{"name":"Array","path":["stdlib","array"],"children":[]},{"name":"IntervalId","path":["stdlib","intervalid"],"children":[]},{"name":"TimeoutId","path":["stdlib","timeoutid"],"children":[]}]}} \ No newline at end of file diff --git a/apps/docs/data/api/v12.1.0/belt.json b/apps/docs/data/api/v12.1.0/belt.json deleted file mode 100644 index 74e7ee076..000000000 --- a/apps/docs/data/api/v12.1.0/belt.json +++ /dev/null @@ -1,9728 +0,0 @@ -{ - "belt": { - "id": "Belt", - "name": "Belt", - "docstrings": [ - "The ReScript standard library.\n\nBelt is currently mostly covering collection types. It has no string or date functions yet, although Belt.String is in the works. In the meantime, use [Js.String](js/string) for string functions and [Js.Date](js/date) for date functions.\n\n## Motivation\n\nBelt provides:\n\n- The **highest quality** immutable data structures in JavaScript.\n- Safety by default: A Belt function will never throw exceptions, unless it is\n indicated explicitly in the function name (suffix \"Exn\").\n- Better performance and smaller code size running on the JS platform.\n- Ready for [Tree Shaking](https://webpack.js.org/guides/tree-shaking/).\n\n## Usage\n\nTo use modules from Belt, either refer to them by their fully qualified name (`Belt.List`, `Belt.Array` etc.) or open the `Belt` module by putting\n\n## Examples\n\n```rescript\nopen Belt\n```\n\nat the top of your source files. After opening Belt this way, `Array` will refer to `Belt.Array`, `List` will refer to `Belt.List` etc. in the subsequent code.\n\nIf you want to open Belt globally for all files in your project instead, you can put\n\n```json\n{\n \"compiler-flags\": [\"-open Belt\"]\n}\n```\n\ninto your `rescript.json`.\n\n**Note**: this is the **only** `open` we encourage.\n\nExample usage:\n\n## Examples\n\n```rescript\nlet someNumbers = [1, 1, 4, 2, 3, 6, 3, 4, 2]\n\nlet greaterThan2UniqueAndSorted =\n someNumbers\n ->Belt.Array.keep(x => x > 2)\n // convert to and from set to make values unique\n ->Belt.Set.Int.fromArray\n ->Belt.Set.Int.toArray // output is already sorted\n\nJs.log2(\"result\", greaterThan2UniqueAndSorted)\n```\n\n## Specialized Collections\n\nFor collections types like set or map, Belt provides both a generic module as well as specialized, more efficient implementations for string and int keys.\n\nFor example, Belt has the following set modules:\n\n- [Belt.Set](belt/set)\n- [Belt.Set.Int](belt/set/int)\n- [Belt.Set.String](belt/set/string)\n\n## Implementation Details\n\n### Array access runtime safety\n\nOne common confusion comes from the way Belt handles array access. It differs from than the default standard library's.\n\n## Examples\n\n```rescript\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0] // a == \"a\"\nlet capitalA = Js.String.toUpperCase(a)\nlet k = letters[10] // Throws an exception! The 10th index doesn't exist.\n```\n\nBecause Belt avoids exceptions and returns `options` instead, this code behaves differently:\n\n## Examples\n\n```rescript\nopen Belt\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0] // a == Some(\"a\")\nlet captialA = Js.String.toUpperCase(a) // Type error! This code will not compile.\nlet k = letters[10] // k == None\n```\n\nAlthough we've fixed the problem where `k` throws an exception, we now have a type error when trying to capitalize `a`. There are a few things going on here:\n\n- Reason transforms array index access to the function `Array.get`. So `letters[0]` is the same as `Array.get(letters, 0)`.\n- The compiler uses whichever `Array` module is in scope. If you `open Belt`, then it uses `Belt.Array`.\n- `Belt.Array.get` returns values wrapped in options, so `letters[0] == Some(\"a\")`.\n\nFortunately, this is easy to fix:\n\n## Examples\n\n```rescript\nopen Belt\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0]\n\n// Use a switch statement:\nlet capitalA = switch a {\n| Some(a) => Some(Js.String.toUpperCase(a))\n| None => None\n}\n\nlet k = letters[10] // k == None\n```\n\nWith that little bit of tweaking, our code now compiles successfully and is 100% free of runtime errors\\!\n\n### A Special Encoding for Collection Safety\n\nWhen we create a collection library for a custom data type we need a way to provide a comparator function. Take Set for example, suppose its element type is a pair of ints, it needs a custom compare function that takes two tuples and returns their order. The Set could not just be typed as Set.t (int \\* int) , its customized compare function needs to manifest itself in the signature, otherwise, if the user creates another customized compare function, the two collection could mix which would result in runtime error.\n\nWe use a phantom type to solve the problem:\n\n## Examples\n\n```rescript\nmodule Comparable1 = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet1 = Belt.Set.make(~id=module(Comparable1))\n\nmodule Comparable2 = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet2 = Belt.Set.make(~id=module(Comparable2))\n```\n\nHere, the compiler would infer `mySet1` and `mySet2` having different type, so e.g. a `merge` operation that tries to merge these two sets will correctly fail.\n\n## Examples\n\n```rescript\nlet mySet1: t<(int, int), Comparable1.identity> = %todo\nlet mySet2: t<(int, int), Comparable2.identity> = %todo\n```\n\n`Comparable1.identity` and `Comparable2.identity` are not the same using our encoding scheme." - ], - "items": [] - }, - "belt/hashmap/string": { - "id": "Belt.HashMap.String", - "name": "String", - "docstrings": [ - "Specalized when key type is `string`, more efficient than the generic type" - ], - "items": [ - { - "id": "Belt.HashMap.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.HashMap.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'b>" - }, - { - "id": "Belt.HashMap.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t<'b>" - }, - { - "id": "Belt.HashMap.String.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'b> => unit" - }, - { - "id": "Belt.HashMap.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.HashMap.String.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`setDone(tbl, k, v)` if `k` does not exist, add the binding `k,v`, otherwise,\nupdate the old value with the new `v`" - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.HashMap.String.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.HashMap.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.HashMap.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'b>, key) => bool" - }, - { - "id": "Belt.HashMap.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.HashMap.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'b>, (key, 'b) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashMap.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'b>, (key, 'b) => unit) => unit" - }, - { - "id": "Belt.HashMap.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashMap.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c" - }, - { - "id": "Belt.HashMap.String.keepMapInPlaceU", - "kind": "value", - "name": "keepMapInPlaceU", - "docstrings": [], - "signature": "let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit", - "deprecated": "Use `keepMapInPlace` instead" - }, - { - "id": "Belt.HashMap.String.keepMapInPlace", - "kind": "value", - "name": "keepMapInPlace", - "docstrings": [], - "signature": "let keepMapInPlace: (t<'a>, (key, 'a) => option<'a>) => unit" - }, - { - "id": "Belt.HashMap.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.HashMap.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.HashMap.String.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.HashMap.String.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.HashMap.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.HashMap.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'a>, array<(key, 'a)>) => unit" - }, - { - "id": "Belt.HashMap.String.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t<'a> => array" - }, - { - "id": "Belt.HashMap.String.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t<'a> => unit" - } - ] - }, - "belt/hashmap/int": { - "id": "Belt.HashMap.Int", - "name": "Int", - "docstrings": [ - "Specalized when key type is `int`, more efficient than the generic type" - ], - "items": [ - { - "id": "Belt.HashMap.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.HashMap.Int.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'b>" - }, - { - "id": "Belt.HashMap.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t<'b>" - }, - { - "id": "Belt.HashMap.Int.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'b> => unit" - }, - { - "id": "Belt.HashMap.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.HashMap.Int.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`setDone(tbl, k, v)` if `k` does not exist, add the binding `k,v`, otherwise,\nupdate the old value with the new `v`" - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.HashMap.Int.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.HashMap.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.HashMap.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'b>, key) => bool" - }, - { - "id": "Belt.HashMap.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.HashMap.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'b>, (key, 'b) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashMap.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'b>, (key, 'b) => unit) => unit" - }, - { - "id": "Belt.HashMap.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashMap.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c" - }, - { - "id": "Belt.HashMap.Int.keepMapInPlaceU", - "kind": "value", - "name": "keepMapInPlaceU", - "docstrings": [], - "signature": "let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit", - "deprecated": "Use `keepMapInPlace` instead" - }, - { - "id": "Belt.HashMap.Int.keepMapInPlace", - "kind": "value", - "name": "keepMapInPlace", - "docstrings": [], - "signature": "let keepMapInPlace: (t<'a>, (key, 'a) => option<'a>) => unit" - }, - { - "id": "Belt.HashMap.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.HashMap.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.HashMap.Int.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.HashMap.Int.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.HashMap.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.HashMap.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'a>, array<(key, 'a)>) => unit" - }, - { - "id": "Belt.HashMap.Int.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t<'a> => array" - }, - { - "id": "Belt.HashMap.Int.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t<'a> => unit" - } - ] - }, - "belt/hashset/string": { - "id": "Belt.HashSet.String", - "name": "String", - "docstrings": [ - "Specalized when key type is `string`, more efficient than the generic type", - "This module is [`Belt.HashSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.HashSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.HashSet`]()" - ], - "items": [ - { - "id": "Belt.HashSet.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.HashSet.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Belt.HashSet.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t" - }, - { - "id": "Belt.HashSet.String.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Belt.HashSet.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.HashSet.String.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, key) => unit" - }, - { - "id": "Belt.HashSet.String.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.HashSet.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, key) => bool" - }, - { - "id": "Belt.HashSet.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, key) => unit" - }, - { - "id": "Belt.HashSet.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, key => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashSet.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, key => unit) => unit" - }, - { - "id": "Belt.HashSet.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'c, ('c, key) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashSet.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, 'c, ('c, key) => 'c) => 'c" - }, - { - "id": "Belt.HashSet.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.HashSet.String.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t => unit" - }, - { - "id": "Belt.HashSet.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.HashSet.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.HashSet.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.HashSet.String.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t => array" - } - ] - }, - "belt/hashset/int": { - "id": "Belt.HashSet.Int", - "name": "Int", - "docstrings": [ - "Specalized when key type is `int`, more efficient than the generic type", - "This module is [`Belt.HashSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.HashSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.HashSet`]()" - ], - "items": [ - { - "id": "Belt.HashSet.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.HashSet.Int.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Belt.HashSet.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t" - }, - { - "id": "Belt.HashSet.Int.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Belt.HashSet.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.HashSet.Int.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, key) => unit" - }, - { - "id": "Belt.HashSet.Int.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.HashSet.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, key) => bool" - }, - { - "id": "Belt.HashSet.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, key) => unit" - }, - { - "id": "Belt.HashSet.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, key => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashSet.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, key => unit) => unit" - }, - { - "id": "Belt.HashSet.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'c, ('c, key) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashSet.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, 'c, ('c, key) => 'c) => 'c" - }, - { - "id": "Belt.HashSet.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.HashSet.Int.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t => unit" - }, - { - "id": "Belt.HashSet.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.HashSet.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.HashSet.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.HashSet.Int.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t => array" - } - ] - }, - "belt/mutablemap/string": { - "id": "Belt.MutableMap.String", - "name": "String", - "docstrings": [], - "items": [ - { - "id": "Belt.MutableMap.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.MutableMap.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableMap.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableMap.String.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableMap.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a>, key) => bool" - }, - { - "id": "Belt.MutableMap.String.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.MutableMap.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m1, m2, cmp)`. First compare by size, if size is the same, compare by key,\nvalue pair" - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.MutableMap.String.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.MutableMap.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, cmp)`" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, (key, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableMap.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the key as\nfirst argument, and the associated value as second argument. The application \norder of `f` is in increasing order." - ], - "signature": "let forEach: (t<'a>, (key, 'a) => unit) => unit" - }, - { - "id": "Belt.MutableMap.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableMap.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`, where `k1 ... kN` are\nthe keys of all bindings in `m` (in increasing order), and `d1 ... dN` are the\nassociated data." - ], - "signature": "let reduce: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableMap.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableMap.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let every: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableMap.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let some: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableMap.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t<'a> => list<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order" - ], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.MutableMap.String.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.MutableMap.String.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.MutableMap.String.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.String.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.String.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.String.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.MutableMap.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'a>, key) => Js.undefined<'a>" - }, - { - "id": "Belt.MutableMap.String.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, key, 'a) => 'a" - }, - { - "id": "Belt.MutableMap.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` do the in-place modification" - ], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.MutableMap.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'a>, array) => unit" - }, - { - "id": "Belt.MutableMap.String.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` do the in-place modification, return `m` for chaining. If `x` was\nalready bound in `m`, its previous binding disappears." - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.MutableMap.String.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'a>, key, option<'a> => option<'a>) => unit", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.MutableMap.String.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'a>, key, option<'a> => option<'a>) => unit" - }, - { - "id": "Belt.MutableMap.String.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableMap.String.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.MutableMap.String.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'a>, (key, 'a) => 'b) => t<'b>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.MutableMap.String.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'a>, (key, 'a) => 'b) => t<'b>" - } - ] - }, - "belt/mutablemap/int": { - "id": "Belt.MutableMap.Int", - "name": "Int", - "docstrings": [], - "items": [ - { - "id": "Belt.MutableMap.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.MutableMap.Int.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableMap.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableMap.Int.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableMap.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a>, key) => bool" - }, - { - "id": "Belt.MutableMap.Int.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.MutableMap.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m1, m2, cmp)`. First compare by size, if size is the same, compare by key,\nvalue pair" - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.MutableMap.Int.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.MutableMap.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, cmp)`" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, (key, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableMap.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the key as\nfirst argument, and the associated value as second argument. The application \norder of `f` is in increasing order." - ], - "signature": "let forEach: (t<'a>, (key, 'a) => unit) => unit" - }, - { - "id": "Belt.MutableMap.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableMap.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`, where `k1 ... kN` are\nthe keys of all bindings in `m` (in increasing order), and `d1 ... dN` are the\nassociated data." - ], - "signature": "let reduce: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableMap.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableMap.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let every: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableMap.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let some: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableMap.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t<'a> => list<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order" - ], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.MutableMap.Int.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.MutableMap.Int.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.MutableMap.Int.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.Int.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.Int.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.Int.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.MutableMap.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'a>, key) => Js.undefined<'a>" - }, - { - "id": "Belt.MutableMap.Int.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, key, 'a) => 'a" - }, - { - "id": "Belt.MutableMap.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**Throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` do the in-place modification" - ], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.MutableMap.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'a>, array) => unit" - }, - { - "id": "Belt.MutableMap.Int.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` do the in-place modification, return `m` for chaining. If `x` was\nalready bound in `m`, its previous binding disappears." - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.MutableMap.Int.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'a>, key, option<'a> => option<'a>) => unit", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.MutableMap.Int.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'a>, key, option<'a> => option<'a>) => unit" - }, - { - "id": "Belt.MutableMap.Int.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableMap.Int.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.MutableMap.Int.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'a>, (key, 'a) => 'b) => t<'b>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.MutableMap.Int.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'a>, (key, 'a) => 'b) => t<'b>" - } - ] - }, - "belt/mutableset/string": { - "id": "Belt.MutableSet.String", - "name": "String", - "docstrings": [ - "Specialized when key type is `string`, more efficient than the generic type", - "This module is [`Belt.MutableSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.MutableSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.MutableSet`]()" - ], - "items": [ - { - "id": "Belt.MutableSet.String.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = string" - }, - { - "id": "Belt.MutableSet.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.MutableSet.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t" - }, - { - "id": "Belt.MutableSet.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.MutableSet.String.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.MutableSet.String.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.MutableSet.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.MutableSet.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.String.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.String.addCheck", - "kind": "value", - "name": "addCheck", - "docstrings": [], - "signature": "let addCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.String.removeCheck", - "kind": "value", - "name": "removeCheck", - "docstrings": [], - "signature": "let removeCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.String.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.MutableSet.String.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.MutableSet.String.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.MutableSet.String.subset", - "kind": "value", - "name": "subset", - "docstrings": [], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.MutableSet.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableSet.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.MutableSet.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableSet.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.MutableSet.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableSet.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`.\nOrder unspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableSet.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.String.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.MutableSet.String.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(s, p)` returns a fresh copy of the set of all elements in `s` that satisfy\npredicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.MutableSet.String.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.MutableSet.String.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(s, p)` returns a fresh copy pair of sets `(s1, s2)`, where `s1` is\nthe set of all the elements of `s` that satisfy the predicate `p`, and `s2` is\nthe set of all the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.MutableSet.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.MutableSet.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.MutableSet.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.MutableSet.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.MutableSet.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.MutableSet.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.MutableSet.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.MutableSet.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.MutableSet.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.MutableSet.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(s, key)` return a fresh copy of each" - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.MutableSet.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/mutableset/int": { - "id": "Belt.MutableSet.Int", - "name": "Int", - "docstrings": [ - "Specialized when key type is `int`, more efficient than the generic type", - "This module is [`Belt.MutableSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.MutableSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.MutableSet`]()" - ], - "items": [ - { - "id": "Belt.MutableSet.Int.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = int" - }, - { - "id": "Belt.MutableSet.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.MutableSet.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t" - }, - { - "id": "Belt.MutableSet.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.MutableSet.Int.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.MutableSet.Int.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.MutableSet.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.MutableSet.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.Int.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.Int.addCheck", - "kind": "value", - "name": "addCheck", - "docstrings": [], - "signature": "let addCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.Int.removeCheck", - "kind": "value", - "name": "removeCheck", - "docstrings": [], - "signature": "let removeCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.Int.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.MutableSet.Int.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.MutableSet.Int.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.MutableSet.Int.subset", - "kind": "value", - "name": "subset", - "docstrings": [], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.MutableSet.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableSet.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.MutableSet.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableSet.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.MutableSet.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableSet.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`.\nOrder unspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableSet.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.Int.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.MutableSet.Int.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(s, p)` returns a fresh copy of the set of all elements in `s` that satisfy\npredicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.MutableSet.Int.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.MutableSet.Int.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(s, p)` returns a fresh copy pair of sets `(s1, s2)`, where `s1` is\nthe set of all the elements of `s` that satisfy the predicate `p`, and `s2` is\nthe set of all the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.MutableSet.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.MutableSet.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.MutableSet.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.MutableSet.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.MutableSet.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.MutableSet.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.MutableSet.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.MutableSet.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.MutableSet.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.MutableSet.Int.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(s, key)` return a fresh copy of each" - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.MutableSet.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/map/dict": { - "id": "Belt.Map.Dict", - "name": "Dict", - "docstrings": [ - "This module separates identity from data, it is a bit more verbose but\nslightly more efficient due to the fact that there is no need to pack\nidentity and data back after each operation.\n\n**_Advanced usage only_**" - ], - "items": [ - { - "id": "Belt.Map.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'key, 'value, 'id>" - }, - { - "id": "Belt.Map.Dict.cmp", - "kind": "type", - "name": "cmp", - "docstrings": [], - "signature": "type cmp<'key, 'id> = Belt_Id.cmp<'key, 'id>" - }, - { - "id": "Belt.Map.Dict.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.Dict.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'k, 'v, 'id> => bool" - }, - { - "id": "Belt.Map.Dict.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => bool" - }, - { - "id": "Belt.Map.Dict.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (\n t<'k, 'v, 'id>,\n t<'k, 'v, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~vcmp: ('v, 'v) => int,\n) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.Dict.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (\n t<'k, 'v, 'id>,\n t<'k, 'v, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~vcmp: ('v, 'v) => int,\n) => int" - }, - { - "id": "Belt.Map.Dict.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (\n t<'k, 'a, 'id>,\n t<'k, 'a, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~veq: ('a, 'a) => bool,\n) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.Dict.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, cmp)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `cmp` is the\nequality predicate used to compare the data associated with the keys." - ], - "signature": "let eq: (\n t<'k, 'a, 'id>,\n t<'k, 'a, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~veq: ('a, 'a) => bool,\n) => bool" - }, - { - "id": "Belt.Map.Dict.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.Dict.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`findFirstBy(m, p)` uses function `f` to find the first key value pair to\nmatch predicate `p`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Map.Dict.fromArray([(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")], ~cmp=IntCmp.cmp)\n\nBelt.Map.Dict.findFirstBy(s0, (k, _) => k == 4) == Some((4, \"4\"))\n```" - ], - "signature": "let findFirstBy: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>" - }, - { - "id": "Belt.Map.Dict.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.Dict.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the\nkey as first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys." - ], - "signature": "let forEach: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit" - }, - { - "id": "Belt.Map.Dict.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.Dict.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `f(kN, dN ... f(k1, d1, a)...)`, where `k1 ... kN` \nare the keys of all bindings in `m` (in increasing order), and `d1 ... dN` \nare the associated data." - ], - "signature": "let reduce: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b" - }, - { - "id": "Belt.Map.Dict.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.Dict.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let every: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.Map.Dict.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.Dict.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the\npredicate `p`. Order unspecified" - ], - "signature": "let some: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.Map.Dict.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'k, 'a, 'id> => int" - }, - { - "id": "Belt.Map.Dict.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'k, 'a, 'id> => list<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'k, 'a, 'id> => array<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: (array<('k, 'a)>, ~cmp: cmp<'k, 'id>) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.Map.Dict.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'k, 'a, 'id> => array<'k>" - }, - { - "id": "Belt.Map.Dict.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'k, 'a, 'id> => array<'a>" - }, - { - "id": "Belt.Map.Dict.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.Dict.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.Dict.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.Dict.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.Dict.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => option<'a>" - }, - { - "id": "Belt.Map.Dict.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => Js.undefined<'a>" - }, - { - "id": "Belt.Map.Dict.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'k, 'a, 'id>, 'k, 'a, ~cmp: cmp<'k, 'id>) => 'a" - }, - { - "id": "Belt.Map.Dict.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => 'a" - }, - { - "id": "Belt.Map.Dict.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => 'a" - }, - { - "id": "Belt.Map.Dict.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [], - "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit" - }, - { - "id": "Belt.Map.Dict.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` returns a map containing the same bindings as `m`, except\nfor `x` which is unbound in the returned map." - ], - "signature": "let remove: (t<'a, 'b, 'id>, 'a, ~cmp: cmp<'a, 'id>) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (\n t<'a, 'b, 'id>,\n array<'a>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as `m`, plus a\nbinding of `x` to `y`. If `x` was already bound in `m`, its previous\nbinding disappears." - ], - "signature": "let set: (\n t<'a, 'b, 'id>,\n 'a,\n 'b,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (\n t<'a, 'b, 'id>,\n 'a,\n option<'b> => option<'b>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.Dict.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (\n t<'a, 'b, 'id>,\n 'a,\n option<'b> => option<'b>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'a, 'b, 'id>,\n t<'a, 'c, 'id>,\n ('a, option<'b>, option<'c>) => option<'d>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'd, 'id>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.Dict.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'a, 'b, 'id>,\n t<'a, 'c, 'id>,\n ('a, option<'b>, option<'c>) => option<'d>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'd, 'id>" - }, - { - "id": "Belt.Map.Dict.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (\n t<'a, 'b, 'id>,\n array<('a, 'b)>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => t<'k, 'a, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.Dict.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in `m` that satisfy\npredicate `p`." - ], - "signature": "let keep: (t<'k, 'a, 'id>, ('k, 'a) => bool) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.Map.Dict.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'k, 'a, 'id>,\n ('k, 'a) => bool,\n) => (t<'k, 'a, 'id>, t<'k, 'a, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.Dict.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains\nall the bindings of `s` that satisfy the predicate `p`, and `m2` is the map\nwith all the bindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (\n t<'k, 'a, 'id>,\n ('k, 'a) => bool,\n) => (t<'k, 'a, 'id>, t<'k, 'a, 'id>)" - }, - { - "id": "Belt.Map.Dict.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with\nall the bindings of `m` whose key is strictly less than `x`; `r` is the map\nwith all the bindings of `m` whose key is strictly greater than `x`; `data`\nis `None` if `m` contains no binding for `x`, or `Some(v)` if `m` binds `v`\nto `x`." - ], - "signature": "let split: (\n t<'a, 'b, 'id>,\n 'a,\n ~cmp: cmp<'a, 'id>,\n) => ((t<'a, 'b, 'id>, t<'a, 'b, 'id>), option<'b>)" - }, - { - "id": "Belt.Map.Dict.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.Dict.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated\nvalue `a` of all bindings of `m` has been replaced by the result of the\napplication of `f` to `a`. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let map: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.Dict.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>" - } - ] - }, - "belt/map/string": { - "id": "Belt.Map.String", - "name": "String", - "docstrings": [], - "items": [ - { - "id": "Belt.Map.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.Map.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of maps from type `key` to type `'value`." - ], - "signature": "type t<'value>" - }, - { - "id": "Belt.Map.String.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t<'v>" - }, - { - "id": "Belt.Map.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'v> => bool" - }, - { - "id": "Belt.Map.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'v>, key) => bool" - }, - { - "id": "Belt.Map.String.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'v>, t<'v>, ('v, 'v) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t<'v>, t<'v>, ('v, 'v) => int) => int" - }, - { - "id": "Belt.Map.String.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'v>, t<'v>, ('v, 'v) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2)` tests whether the maps `m1` and `m2` are\nequal, that is, contain equal keys and associate them with\nequal data." - ], - "signature": "let eq: (t<'v>, t<'v>, ('v, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.String.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.String.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`findFirstBy(m, p)` uses funcion `f` to find the first key value pair\nto match predicate `p`.\n\n## Examples\n\n```rescript\nlet mapString = Belt.Map.String.fromArray([(\"1\", \"one\"), (\"2\", \"two\"), (\"3\", \"three\")])\n\nmapString->Belt.Map.String.findFirstBy((k, v) => k == \"1\" && v == \"one\") == Some(\"1\", \"one\")\n```" - ], - "signature": "let findFirstBy: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>" - }, - { - "id": "Belt.Map.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'v>, (key, 'v) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`.\n`f` receives the key as first argument, and the associated value\nas second argument. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let forEach: (t<'v>, (key, 'v) => unit) => unit" - }, - { - "id": "Belt.Map.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`,\nwhere `k1 ... kN` are the keys of all bindings in `m`\n(in increasing order), and `d1 ... dN` are the associated data." - ], - "signature": "let reduce: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2" - }, - { - "id": "Belt.Map.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nOrder unspecified" - ], - "signature": "let every: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let some: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'v> => int" - }, - { - "id": "Belt.Map.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'v> => list<(key, 'v)>" - }, - { - "id": "Belt.Map.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'v> => array<(key, 'v)>" - }, - { - "id": "Belt.Map.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'v)> => t<'v>" - }, - { - "id": "Belt.Map.String.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'v> => array" - }, - { - "id": "Belt.Map.String.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'v> => array<'v>" - }, - { - "id": "Belt.Map.String.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.Map.String.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.String.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.Map.String.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'v>, key) => option<'v>" - }, - { - "id": "Belt.Map.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'v>, key) => Js.undefined<'v>" - }, - { - "id": "Belt.Map.String.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'v>, key, 'v) => 'v" - }, - { - "id": "Belt.Map.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.Map.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove m x` returns a map containing the same bindings as\n `m`, except for `x` which is unbound in the returned map." - ], - "signature": "let remove: (t<'v>, key) => t<'v>" - }, - { - "id": "Belt.Map.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'v>, array) => t<'v>" - }, - { - "id": "Belt.Map.String.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as\n`m`, plus a binding of `x` to `y`. If `x` was already bound\nin `m`, its previous binding disappears." - ], - "signature": "let set: (t<'v>, key, 'v) => t<'v>" - }, - { - "id": "Belt.Map.String.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'v>, key, option<'v> => option<'v>) => t<'v>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.String.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'v>, key, option<'v> => option<'v>) => t<'v>" - }, - { - "id": "Belt.Map.String.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.String.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>" - }, - { - "id": "Belt.Map.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'v>, array<(key, 'v)>) => t<'v>" - }, - { - "id": "Belt.Map.String.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'v>, (key, 'v) => bool) => t<'v>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.String.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in `m` that satisfy predicate\n`p`." - ], - "signature": "let keep: (t<'v>, (key, 'v) => bool) => t<'v>" - }, - { - "id": "Belt.Map.String.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.String.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains all the\nbindings of `s` that satisfy the predicate `p`, and `m2` is the map with all the\nbindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)" - }, - { - "id": "Belt.Map.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with all the\nbindings of `m` whose key is strictly less than `x`; `r` is the map with all the\nbindings of `m` whose key is strictly greater than `x`; `data` is `None` if `m`\ncontains no binding for `x`, or `Some(v)` if `m` binds `v` to `x`." - ], - "signature": "let split: (key, t<'v>) => (t<'v>, option<'v>, t<'v>)" - }, - { - "id": "Belt.Map.String.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'v>, 'v => 'v2) => t<'v2>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.String.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'v>, 'v => 'v2) => t<'v2>" - }, - { - "id": "Belt.Map.String.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'v>, (key, 'v) => 'v2) => t<'v2>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.String.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'v>, (key, 'v) => 'v2) => t<'v2>" - } - ] - }, - "belt/map/int": { - "id": "Belt.Map.Int", - "name": "Int", - "docstrings": [ - "## Examples\n\n```rescript\ntype t<'key, 'value, 'identity>\ntype id<'key, 'id> = Belt_Id.comparable<'key, 'id>\n```" - ], - "items": [ - { - "id": "Belt.Map.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.Map.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of maps from type `key` to type `'value`." - ], - "signature": "type t<'value>" - }, - { - "id": "Belt.Map.Int.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t<'v>" - }, - { - "id": "Belt.Map.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'v> => bool" - }, - { - "id": "Belt.Map.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'v>, key) => bool" - }, - { - "id": "Belt.Map.Int.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'v>, t<'v>, ('v, 'v) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t<'v>, t<'v>, ('v, 'v) => int) => int" - }, - { - "id": "Belt.Map.Int.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'v>, t<'v>, ('v, 'v) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2)` tests whether the maps `m1` and `m2` are\nequal, that is, contain equal keys and associate them with\nequal data." - ], - "signature": "let eq: (t<'v>, t<'v>, ('v, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.Int.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.Int.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`findFirstBy(m, p)` uses funcion `f` to find the first key value pair\nto match predicate `p`.\n\n## Examples\n\n```rescript\nlet mapInt = Belt.Map.Int.fromArray([(1, \"one\"), (2, \"two\"), (3, \"three\")])\n\nmapInt->Belt.Map.Int.findFirstBy((k, v) => k == 1 && v == \"one\") == Some(1, \"one\")\n```" - ], - "signature": "let findFirstBy: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'v>, (key, 'v) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`.\n`f` receives the key as first argument, and the associated value\nas second argument. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let forEach: (t<'v>, (key, 'v) => unit) => unit" - }, - { - "id": "Belt.Map.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`,\nwhere `k1 ... kN` are the keys of all bindings in `m`\n(in increasing order), and `d1 ... dN` are the associated data." - ], - "signature": "let reduce: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2" - }, - { - "id": "Belt.Map.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nOrder unspecified" - ], - "signature": "let every: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let some: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'v> => int" - }, - { - "id": "Belt.Map.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'v> => list<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'v> => array<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'v)> => t<'v>" - }, - { - "id": "Belt.Map.Int.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'v> => array" - }, - { - "id": "Belt.Map.Int.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'v> => array<'v>" - }, - { - "id": "Belt.Map.Int.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.Map.Int.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.Int.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.Map.Int.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'v>, key) => option<'v>" - }, - { - "id": "Belt.Map.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'v>, key) => Js.undefined<'v>" - }, - { - "id": "Belt.Map.Int.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'v>, key, 'v) => 'v" - }, - { - "id": "Belt.Map.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.Map.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove m x` returns a map containing the same bindings as\n `m`, except for `x` which is unbound in the returned map." - ], - "signature": "let remove: (t<'v>, key) => t<'v>" - }, - { - "id": "Belt.Map.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'v>, array) => t<'v>" - }, - { - "id": "Belt.Map.Int.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as\n`m`, plus a binding of `x` to `y`. If `x` was already bound\nin `m`, its previous binding disappears." - ], - "signature": "let set: (t<'v>, key, 'v) => t<'v>" - }, - { - "id": "Belt.Map.Int.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'v>, key, option<'v> => option<'v>) => t<'v>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.Int.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'v>, key, option<'v> => option<'v>) => t<'v>" - }, - { - "id": "Belt.Map.Int.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.Int.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>" - }, - { - "id": "Belt.Map.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'v>, array<(key, 'v)>) => t<'v>" - }, - { - "id": "Belt.Map.Int.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'v>, (key, 'v) => bool) => t<'v>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.Int.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in `m` that satisfy predicate\n`p`." - ], - "signature": "let keep: (t<'v>, (key, 'v) => bool) => t<'v>" - }, - { - "id": "Belt.Map.Int.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.Int.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains all the\nbindings of `s` that satisfy the predicate `p`, and `m2` is the map with all the\nbindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)" - }, - { - "id": "Belt.Map.Int.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with all the\nbindings of `m` whose key is strictly less than `x`; `r` is the map with all the\nbindings of `m` whose key is strictly greater than `x`; `data` is `None` if `m`\ncontains no binding for `x`, or `Some(v)` if `m` binds `v` to `x`." - ], - "signature": "let split: (key, t<'v>) => (t<'v>, option<'v>, t<'v>)" - }, - { - "id": "Belt.Map.Int.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'v>, 'v => 'v2) => t<'v2>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.Int.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'v>, 'v => 'v2) => t<'v2>" - }, - { - "id": "Belt.Map.Int.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'v>, (key, 'v) => 'v2) => t<'v2>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.Int.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'v>, (key, 'v) => 'v2) => t<'v2>" - } - ] - }, - "belt/set/dict": { - "id": "Belt.Set.Dict", - "name": "Dict", - "docstrings": [ - "This module separates identity from data, it is a bit more verbose but slightly\nmore efficient due to the fact that there is no need to pack identity and data back\nafter each operation", - "This module separates identity from data. It is a bit more verbose but slightly\nmore efficient due to the fact that there is no need to pack identity and data\nback after each operation." - ], - "items": [ - { - "id": "Belt.Set.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'value, 'identity>" - }, - { - "id": "Belt.Set.Dict.cmp", - "kind": "type", - "name": "cmp", - "docstrings": [ - "Type of compare function." - ], - "signature": "type cmp<'value, 'id> = Belt_Id.cmp<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "## Examples\n\n```rescript\nlet s0 = Belt.Set.Dict.empty\n```" - ], - "signature": "let empty: t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 3, 2, 4], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let fromArray: (array<'value>, ~cmp: cmp<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [ - "The same as [fromArray][#fromarray] except it is after assuming the input array\nis already sorted." - ], - "signature": "let fromSortedArrayUnsafe: array<'value> => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.Set.Dict.fromArray([], ~cmp=IntCmp.cmp)\nlet notEmpty = Belt.Set.Dict.fromArray([1], ~cmp=IntCmp.cmp)\n\nBelt.Set.Dict.isEmpty(empty) == true\nBelt.Set.Dict.isEmpty(notEmpty) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.Set.Dict.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if an element exists in the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.fromArray([1, 4, 2, 5], ~cmp=IntCmp.cmp)\n\nset->Belt.Set.Dict.has(3, ~cmp=IntCmp.cmp) == false\nset->Belt.Set.Dict.has(1, ~cmp=IntCmp.cmp) == true\n```" - ], - "signature": "let has: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => bool" - }, - { - "id": "Belt.Set.Dict.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = s0->Belt.Set.Dict.add(1, ~cmp=IntCmp.cmp)\nlet s2 = s1->Belt.Set.Dict.add(2, ~cmp=IntCmp.cmp)\nlet s3 = s2->Belt.Set.Dict.add(2, ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.toArray == []\ns1->Belt.Set.Dict.toArray == [1]\ns2->Belt.Set.Dict.toArray == [1, 2]\ns3->Belt.Set.Dict.toArray == [1, 2]\ns2 == s3\n```" - ], - "signature": "let add: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "Adds each element of array to set. Unlike [add](#add), the reference of return value might be changed even if all values in array already exist in set\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.empty\n\nlet newSet = set->Belt.Set.Dict.mergeMany([5, 4, 3, 2, 1], ~cmp=IntCmp.cmp)\nnewSet->Belt.Set.Dict.toArray == [1, 2, 3, 4, 5]\n```" - ], - "signature": "let mergeMany: (\n t<'value, 'id>,\n array<'value>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([2, 3, 1, 4, 5], ~cmp=IntCmp.cmp)\nlet s1 = s0->Belt.Set.Dict.remove(1, ~cmp=IntCmp.cmp)\nlet s2 = s1->Belt.Set.Dict.remove(3, ~cmp=IntCmp.cmp)\nlet s3 = s2->Belt.Set.Dict.remove(3, ~cmp=IntCmp.cmp)\n\ns1->Belt.Set.Dict.toArray == [2, 3, 4, 5]\ns2->Belt.Set.Dict.toArray == [2, 4, 5]\ns2 == s3\n```" - ], - "signature": "let remove: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "Removes each element of array from set. Unlike [remove](#remove), the reference of return value might be changed even if any values in array not existed in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.fromArray([1, 2, 3, 4], ~cmp=IntCmp.cmp)\n\nlet newSet = set->Belt.Set.Dict.removeMany([5, 4, 3, 2, 1], ~cmp=IntCmp.cmp)\nnewSet->Belt.Set.Dict.toArray == []\n```" - ], - "signature": "let removeMany: (\n t<'value, 'id>,\n array<'value>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet union = Belt.Set.Dict.union(s0, s1, ~cmp=IntCmp.cmp)\nunion->Belt.Set.Dict.toArray == [1, 2, 3, 4, 5, 6]\n```" - ], - "signature": "let union: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet intersect = Belt.Set.Dict.intersect(s0, s1, ~cmp=IntCmp.cmp)\nintersect->Belt.Set.Dict.toArray == [2, 3, 5]\n```" - ], - "signature": "let intersect: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.diff", - "kind": "value", - "name": "diff", - "docstrings": [ - "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\n\nlet diff1 = Belt.Set.Dict.diff(s0, s1, ~cmp=IntCmp.cmp)\nlet diff2 = Belt.Set.Dict.diff(s1, s0, ~cmp=IntCmp.cmp)\n\ndiff1->Belt.Set.Dict.toArray == [6]\ndiff2->Belt.Set.Dict.toArray == [1, 4]\n```" - ], - "signature": "let diff: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet s2 = Belt.Set.Dict.intersect(s0, s1, ~cmp=IntCmp.cmp)\nBelt.Set.Dict.subset(s2, s0, ~cmp=IntCmp.cmp) == true\nBelt.Set.Dict.subset(s2, s1, ~cmp=IntCmp.cmp) == true\nBelt.Set.Dict.subset(s1, s0, ~cmp=IntCmp.cmp) == false\n```" - ], - "signature": "let subset: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => bool" - }, - { - "id": "Belt.Set.Dict.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets. It compares size first and then iterates over each element following the\norder of elements." - ], - "signature": "let cmp: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => int" - }, - { - "id": "Belt.Set.Dict.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 5], ~cmp=IntCmp.cmp)\n\nBelt.Set.Dict.eq(s0, s1, ~cmp=IntCmp.cmp) == true\n```" - ], - "signature": "let eq: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => bool" - }, - { - "id": "Belt.Set.Dict.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as [forEach](##forEach) but takes uncurried functon." - ], - "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.Dict.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet acc = ref(list{})\ns0->Belt.Set.Dict.forEach(x => acc := Belt.List.add(acc.contents, x))\nacc.contents == list{6, 5, 3, 2}\n```" - ], - "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit" - }, - { - "id": "Belt.Set.Dict.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.Dict.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) == list{6, 5, 3, 2}\n```" - ], - "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a" - }, - { - "id": "Belt.Set.Dict.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.Dict.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.Dict.fromArray([2, 4, 6, 8], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.every(isEven) == true\n```" - ], - "signature": "let every: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.Dict.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.Dict.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 4, 6, 8], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.some(isOdd) == true\n```" - ], - "signature": "let some: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.Dict.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.Dict.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\nlet s1 = s0->Belt.Set.Dict.keep(isEven)\n\ns1->Belt.Set.Dict.toArray == [2, 4]\n```" - ], - "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.Dict.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "Returns a pair of sets, where first is the set of all the elements of set that satisfy the predicate, and second is the set of all the elements of set that do not satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\nlet (s1, s2) = s0->Belt.Set.Dict.partition(isOdd)\n\ns1->Belt.Set.Dict.toArray == [1, 3, 5]\ns2->Belt.Set.Dict.toArray == [2, 4]\n```" - ], - "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)" - }, - { - "id": "Belt.Set.Dict.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.size == 4\n```" - ], - "signature": "let size: t<'value, 'id> => int" - }, - { - "id": "Belt.Set.Dict.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toList == list{1, 2, 3, 5}\n```" - ], - "signature": "let toList: t<'value, 'id> => list<'value>" - }, - { - "id": "Belt.Set.Dict.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toArray == [1, 2, 3, 5]\n```" - ], - "signature": "let toArray: t<'value, 'id> => array<'value>" - }, - { - "id": "Belt.Set.Dict.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.minimum == None\ns1->Belt.Set.Dict.minimum == Some(1)\n```" - ], - "signature": "let minimum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.Dict.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "Returns minimum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.minUndefined == Js.undefined\ns1->Belt.Set.Dict.minUndefined == Js.Undefined.return(1)\n```" - ], - "signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.Dict.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.maximum == None\ns1->Belt.Set.Dict.maximum == Some(5)\n```" - ], - "signature": "let maximum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.Dict.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "Returns maximum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.maxUndefined == Js.undefined\ns1->Belt.Set.Dict.maxUndefined == Js.Undefined.return(5)\n```" - ], - "signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the reference of the value which is equivalent to value using the comparator\nspecifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.get(3, ~cmp=IntCmp.cmp) == Some(3)\ns0->Belt.Set.Dict.get(20, ~cmp=IntCmp.cmp) == None\n```" - ], - "signature": "let get: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => option<'value>" - }, - { - "id": "Belt.Set.Dict.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "Same as [get](#get) but returns `undefined` when element does not exist." - ], - "signature": "let getUndefined: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => Js.undefined<'value>" - }, - { - "id": "Belt.Set.Dict.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getExn: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => 'value" - }, - { - "id": "Belt.Set.Dict.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getOrThrow: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => 'value" - }, - { - "id": "Belt.Set.Dict.split", - "kind": "value", - "name": "split", - "docstrings": [ - "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\n\nlet ((smaller, larger), present) = s0->Belt.Set.Dict.split(3, ~cmp=IntCmp.cmp)\n\npresent == true\nsmaller->Belt.Set.Dict.toArray == [1, 2]\nlarger->Belt.Set.Dict.toArray == [4, 5]\n```" - ], - "signature": "let split: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)" - }, - { - "id": "Belt.Set.Dict.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b> => unit" - } - ] - }, - "belt/set/string": { - "id": "Belt.Set.String", - "name": "String", - "docstrings": [ - "Specialized when value type is `string`, more efficient than the generic type,\nits compare behavior is fixed using the built-in comparison", - "This module is [`Belt.Set`]() specialized with value type to be a primitive type.\nIt is more efficient in general, the API is the same with [`Belt_Set`]() except its value type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.Set`]()" - ], - "items": [ - { - "id": "Belt.Set.String.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = string" - }, - { - "id": "Belt.Set.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.Set.String.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t" - }, - { - "id": "Belt.Set.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.Set.String.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.Set.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.Set.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.Set.String.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(s, x)` If `x` was already in `s`, `s` is returned unchanged." - ], - "signature": "let add: (t, value) => t" - }, - { - "id": "Belt.Set.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => t" - }, - { - "id": "Belt.Set.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` If `x` was not in `m`, `m` is returned reference unchanged." - ], - "signature": "let remove: (t, value) => t" - }, - { - "id": "Belt.Set.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => t" - }, - { - "id": "Belt.Set.String.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.Set.String.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.Set.String.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.Set.String.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "`subset(s1, s2)` tests whether the set `s1` is a subset of the set `s2`." - ], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.Set.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets." - ], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.Set.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(s1, s2)` tests whether the sets `s1` and `s2` are equal, that is, contain\nequal elements." - ], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.Set.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(s, f)` applies `f` in turn to all elements of `s`. In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.Set.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.Set.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`. Order\nunspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.String.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.String.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(p, s)` returns the set of all elements in `s` that satisfy predicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.Set.String.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.String.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(p, s)` returns a pair of sets `(s1, s2)`, where `s1` is the set of\nall the elements of `s` that satisfy the predicate `p`, and `s2` is the set of\nall the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.Set.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.Set.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.Set.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.Set.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.Set.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.Set.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.Set.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.Set.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.Set.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.Set.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, s)` returns a triple `(l, present, r)`, where `l` is the set of\nelements of `s` that are strictly less than `x`;`r` is the set of elements of\n`s` that are strictly greater than `x`; `present` is `false` if `s` contains no\nelement equal to `x`, or `true` if `s` contains an element equal to `x`." - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.Set.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/set/int": { - "id": "Belt.Set.Int", - "name": "Int", - "docstrings": [ - "Specialized when value type is `int`, more efficient than the generic type, its\ncompare behavior is fixed using the built-in comparison", - "This module is [`Belt.Set`]() specialized with value type to be a primitive type.\nIt is more efficient in general, the API is the same with [`Belt_Set`]() except its value type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.Set`]()" - ], - "items": [ - { - "id": "Belt.Set.Int.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = int" - }, - { - "id": "Belt.Set.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.Set.Int.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t" - }, - { - "id": "Belt.Set.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.Set.Int.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.Set.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.Set.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.Set.Int.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(s, x)` If `x` was already in `s`, `s` is returned unchanged." - ], - "signature": "let add: (t, value) => t" - }, - { - "id": "Belt.Set.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => t" - }, - { - "id": "Belt.Set.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` If `x` was not in `m`, `m` is returned reference unchanged." - ], - "signature": "let remove: (t, value) => t" - }, - { - "id": "Belt.Set.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => t" - }, - { - "id": "Belt.Set.Int.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.Set.Int.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.Set.Int.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.Set.Int.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "`subset(s1, s2)` tests whether the set `s1` is a subset of the set `s2`." - ], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.Set.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets." - ], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.Set.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(s1, s2)` tests whether the sets `s1` and `s2` are equal, that is, contain\nequal elements." - ], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.Set.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(s, f)` applies `f` in turn to all elements of `s`. In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.Set.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.Set.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`. Order\nunspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.Int.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.Int.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(p, s)` returns the set of all elements in `s` that satisfy predicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.Set.Int.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.Int.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(p, s)` returns a pair of sets `(s1, s2)`, where `s1` is the set of\nall the elements of `s` that satisfy the predicate `p`, and `s2` is the set of\nall the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.Set.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.Set.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.Set.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.Set.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.Set.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.Set.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.Set.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.Set.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.Set.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.Set.Int.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, s)` returns a triple `(l, present, r)`, where `l` is the set of\nelements of `s` that are strictly less than `x`;`r` is the set of elements of\n`s` that are strictly greater than `x`; `present` is `false` if `s` contains no\nelement equal to `x`, or `true` if `s` contains an element equal to `x`." - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.Set.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/sortarray/string": { - "id": "Belt.SortArray.String", - "name": "String", - "docstrings": [ - "Specalized when key type is `string`, more efficient than the generic type", - "This is a specialized module for [`Belt_SortArray`](), the docs in that module also\napplies here, except the comparator is fixed and inlined" - ], - "items": [ - { - "id": "Belt.SortArray.String.element", - "kind": "type", - "name": "element", - "docstrings": [], - "signature": "type element = string" - }, - { - "id": "Belt.SortArray.String.strictlySortedLength", - "kind": "value", - "name": "strictlySortedLength", - "docstrings": [ - "The same as [`Belt_SortArray.strictlySortedLength`]() except the comparator is fixed\n\n**return** `+n` means increasing order `-n` means negative order" - ], - "signature": "let strictlySortedLength: array => int" - }, - { - "id": "Belt.SortArray.String.isSorted", - "kind": "value", - "name": "isSorted", - "docstrings": [ - "`sorted(xs)` return true if `xs` is in non strict increasing order" - ], - "signature": "let isSorted: array => bool" - }, - { - "id": "Belt.SortArray.String.stableSortInPlace", - "kind": "value", - "name": "stableSortInPlace", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortInPlaceBy`]() except the comparator is fixed" - ], - "signature": "let stableSortInPlace: array => unit" - }, - { - "id": "Belt.SortArray.String.stableSort", - "kind": "value", - "name": "stableSort", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortBy`]() except the comparator is fixed" - ], - "signature": "let stableSort: array => array" - }, - { - "id": "Belt.SortArray.String.binarySearch", - "kind": "value", - "name": "binarySearch", - "docstrings": [ - "If value is not found and value is less than one or more elements in array,\nthe negative number returned is the bitwise complement of the index of the first element\nthat is larger than value.\n\nIf value is not found and value is greater than all elements in array,\nthe negative number returned is the bitwise complement of\n(the index of the last element plus 1)\n\nfor example, if `key` is smaller than all elements return `-1` since `lnot (-1) = 0`\nif `key` is larger than all elements return `- (len + 1)` since `lnot (-(len+1)) = len`" - ], - "signature": "let binarySearch: (array, element) => int" - }, - { - "id": "Belt.SortArray.String.union", - "kind": "value", - "name": "union", - "docstrings": [ - "`union(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp)` assume\n`src` and `src2` is strictly sorted. for equivalent elements, it is picked from\n`src` also assume that `dst` is large enough to store all elements" - ], - "signature": "let union: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.String.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.String.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - } - ] - }, - "belt/sortarray/int": { - "id": "Belt.SortArray.Int", - "name": "Int", - "docstrings": [ - "Specalized when key type is `int`, more efficient than the generic type", - "This is a specialized module for [`Belt_SortArray`](), the docs in that module also\napplies here, except the comparator is fixed and inlined" - ], - "items": [ - { - "id": "Belt.SortArray.Int.element", - "kind": "type", - "name": "element", - "docstrings": [], - "signature": "type element = int" - }, - { - "id": "Belt.SortArray.Int.strictlySortedLength", - "kind": "value", - "name": "strictlySortedLength", - "docstrings": [ - "The same as [`Belt_SortArray.strictlySortedLength`]() except the comparator is fixed\n\n**return** `+n` means increasing order `-n` means negative order" - ], - "signature": "let strictlySortedLength: array => int" - }, - { - "id": "Belt.SortArray.Int.isSorted", - "kind": "value", - "name": "isSorted", - "docstrings": [ - "`sorted(xs)` return true if `xs` is in non strict increasing order" - ], - "signature": "let isSorted: array => bool" - }, - { - "id": "Belt.SortArray.Int.stableSortInPlace", - "kind": "value", - "name": "stableSortInPlace", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortInPlaceBy`]() except the comparator is fixed" - ], - "signature": "let stableSortInPlace: array => unit" - }, - { - "id": "Belt.SortArray.Int.stableSort", - "kind": "value", - "name": "stableSort", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortBy`]() except the comparator is fixed" - ], - "signature": "let stableSort: array => array" - }, - { - "id": "Belt.SortArray.Int.binarySearch", - "kind": "value", - "name": "binarySearch", - "docstrings": [ - "If value is not found and value is less than one or more elements in array,\nthe negative number returned is the bitwise complement of the index of the first element\nthat is larger than value.\n\nIf value is not found and value is greater than all elements in array,\nthe negative number returned is the bitwise complement of\n(the index of the last element plus 1)\n\nfor example, if `key` is smaller than all elements return `-1` since `lnot (-1) = 0`\nif `key` is larger than all elements return `- (len + 1)` since `lnot (-(len+1)) = len`" - ], - "signature": "let binarySearch: (array, element) => int" - }, - { - "id": "Belt.SortArray.Int.union", - "kind": "value", - "name": "union", - "docstrings": [ - "`union(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp)` assume\n`src` and `src2` is strictly sorted. for equivalent elements, it is picked from\n`src` also assume that `dst` is large enough to store all elements" - ], - "signature": "let union: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.Int.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.Int.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - } - ] - }, - "belt/id/makehashable": { - "id": "Belt.Id.MakeHashable", - "name": "MakeHashable", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeHashable.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeHashable.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeHashable.hash", - "kind": "value", - "name": "hash", - "docstrings": [], - "signature": "let hash: hash" - }, - { - "id": "Belt.Id.MakeHashable.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: eq" - } - ] - }, - "belt/id/makehashableu": { - "id": "Belt.Id.MakeHashableU", - "name": "MakeHashableU", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeHashableU.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeHashableU.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeHashableU.hash", - "kind": "value", - "name": "hash", - "docstrings": [], - "signature": "let hash: hash" - }, - { - "id": "Belt.Id.MakeHashableU.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: eq" - } - ] - }, - "belt/id/makecomparable": { - "id": "Belt.Id.MakeComparable", - "name": "MakeComparable", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeComparable.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeComparable.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeComparable.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: cmp" - } - ] - }, - "belt/id/makecomparableu": { - "id": "Belt.Id.MakeComparableU", - "name": "MakeComparableU", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeComparableU.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeComparableU.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeComparableU.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: cmp" - } - ] - }, - "belt/float": { - "id": "Belt.Float", - "name": "Float", - "docstrings": [ - "[`Belt.Float`]()\n\n Utilities for Float.", - "This module includes convenience methods for handling `float` types." - ], - "items": [ - { - "id": "Belt.Float.toInt", - "kind": "value", - "name": "toInt", - "docstrings": [ - "Converts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nBelt.Float.toInt(1.0) == 1\n```" - ], - "signature": "let toInt: float => int" - }, - { - "id": "Belt.Float.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "Converts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nBelt.Float.fromInt(1) == 1.0\n```" - ], - "signature": "let fromInt: int => float" - }, - { - "id": "Belt.Float.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Converts a given `string` to a `float`. Returns `Some(float)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nBelt.Float.fromString(\"1.0\") == Some(1.0)\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Belt.Float.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts a given `float` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nBelt.Float.toString(1.0) == \"1\"\n```" - ], - "signature": "let toString: float => string" - }, - { - "id": "Belt.Float.+", - "kind": "value", - "name": "+", - "docstrings": [ - "Addition of two `float` values.\nCan be opened in a module to avoid dot-notation (`+.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n2.0 + 2.0 == 4.0\n```" - ], - "signature": "let +: (float, float) => float" - }, - { - "id": "Belt.Float.-", - "kind": "value", - "name": "-", - "docstrings": [ - "Subtraction of two `float` values.\nCan be opened in a module to avoid dot-notation (`-.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n2.0 - 1.0 == 1.0\n```" - ], - "signature": "let -: (float, float) => float" - }, - { - "id": "Belt.Float.*", - "kind": "value", - "name": "*", - "docstrings": [ - "Multiplication of two `float` values.\nCan be opened in a module to avoid dot-notation (`*.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n2.0 * 2.0 == 4.0\n```" - ], - "signature": "let *: (float, float) => float" - }, - { - "id": "Belt.Float./", - "kind": "value", - "name": "/", - "docstrings": [ - "Division of two `float` values.\nCan be opened in a module to avoid dot-notation (`/.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n4.0 / 2.0 == 2.0\n```" - ], - "signature": "let /: (float, float) => float" - } - ] - }, - "belt/int": { - "id": "Belt.Int", - "name": "Int", - "docstrings": [ - "[`Belt.Int`]()\n\n Utilities for Int.", - "This module includes convenience methods for handling `int` types." - ], - "items": [ - { - "id": "Belt.Int.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [ - "Converts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nBelt.Int.toFloat(1) == 1.0\n```" - ], - "signature": "let toFloat: int => float" - }, - { - "id": "Belt.Int.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "Converts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nBelt.Int.fromFloat(1.0) == 1\n```" - ], - "signature": "let fromFloat: float => int" - }, - { - "id": "Belt.Int.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Converts a given `string` to an `int`. Returns `Some(int)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nBelt.Int.fromString(\"1\") == Some(1)\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Belt.Int.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nBelt.Int.toString(1) == \"1\"\n```" - ], - "signature": "let toString: int => string" - }, - { - "id": "Belt.Int.+", - "kind": "value", - "name": "+", - "docstrings": [ - "Addition of two `int` values. Same as the addition from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n2 + 2 == 4\n```" - ], - "signature": "let +: (int, int) => int" - }, - { - "id": "Belt.Int.-", - "kind": "value", - "name": "-", - "docstrings": [ - "Subtraction of two `int` values. Same as the subtraction from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n2 - 1 == 1\n```" - ], - "signature": "let -: (int, int) => int" - }, - { - "id": "Belt.Int.*", - "kind": "value", - "name": "*", - "docstrings": [ - "Multiplication of two `int` values. Same as the multiplication from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n2 * 2 == 4\n```" - ], - "signature": "let *: (int, int) => int" - }, - { - "id": "Belt.Int./", - "kind": "value", - "name": "/", - "docstrings": [ - "Division of two `int` values. Same as the division from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n4 / 2 == 2\n```" - ], - "signature": "let /: (int, int) => int" - } - ] - }, - "belt/result": { - "id": "Belt.Result", - "name": "Result", - "docstrings": [ - "[`Belt.Result`]()\n\n Utilities for result data type.", - "Result types are really useful to describe the result of a certain operation\nwithout relying on exceptions or `option` types.\n\nThis module gives you useful utilities to create and combine `Result` data." - ], - "items": [ - { - "id": "Belt.Result.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a, 'b> = result<'a, 'b> = Ok('a) | Error('b)" - }, - { - "id": "Belt.Result.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(res)`: when `res` is `Ok(n)`, returns `n` when `res` is `Error(m)`, throw an exception\n\n## Examples\n\n```rescript\nBelt.Result.Ok(42)->Belt.Result.getExn == 42\n\nswitch Belt.Result.getExn(Belt.Result.Error(\"Invalid data\")) {\n// throw a exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getExn: t<'a, 'b> => 'a" - }, - { - "id": "Belt.Result.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(res)`: when `res` is `Ok(n)`, returns `n` when `res` is `Error(m)`, throw an exception\n\n## Examples\n\n```rescript\nBelt.Result.Ok(42)->Belt.Result.getOrThrow == 42\n\nswitch Belt.Result.getOrThrow(Belt.Result.Error(\"Invalid data\")) {\n// throw a exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getOrThrow: t<'a, 'b> => 'a" - }, - { - "id": "Belt.Result.mapWithDefaultU", - "kind": "value", - "name": "mapWithDefaultU", - "docstrings": [], - "signature": "let mapWithDefaultU: (t<'a, 'c>, 'b, 'a => 'b) => 'b", - "deprecated": "Use `mapWithDefault` instead" - }, - { - "id": "Belt.Result.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [ - "`mapWithDefault(res, default, f)`: When res is `Ok(n)`, returns `f(n)`,\notherwise `default`.\n\n## Examples\n\n```rescript\nlet ok = Belt.Result.Ok(42)\nBelt.Result.mapWithDefault(ok, 0, x => x / 2) == 21\n\nlet error = Belt.Result.Error(\"Invalid data\")\nBelt.Result.mapWithDefault(error, 0, x => x / 2) == 0\n```" - ], - "signature": "let mapWithDefault: (t<'a, 'c>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Belt.Result.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a, 'c>, 'a => 'b) => t<'b, 'c>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Result.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(res, f)`: When res is `Ok(n)`, returns `Ok(f(n))`. Otherwise returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns an\nordinary value.\n\n## Examples\n\n```rescript\nlet f = x => sqrt(Belt.Int.toFloat(x))\n\nBelt.Result.map(Ok(64), f) == Ok(8.0)\n\nBelt.Result.map(Error(\"Invalid data\"), f) == Error(\"Invalid data\")\n```" - ], - "signature": "let map: (t<'a, 'c>, 'a => 'b) => t<'b, 'c>" - }, - { - "id": "Belt.Result.flatMapU", - "kind": "value", - "name": "flatMapU", - "docstrings": [], - "signature": "let flatMapU: (t<'a, 'c>, 'a => t<'b, 'c>) => t<'b, 'c>", - "deprecated": "Use `flatMap` instead" - }, - { - "id": "Belt.Result.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(res, f)`: When res is `Ok(n)`, returns `f(n)`. Otherwise, returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns a\n`Belt.Result`.\n\n## Examples\n\n```rescript\nlet recip = x =>\n if x !== 0.0 {\n Belt.Result.Ok(1.0 /. x)\n } else {\n Belt.Result.Error(\"Divide by zero\")\n }\n\nBelt.Result.flatMap(Ok(2.0), recip) == Ok(0.5)\n\nBelt.Result.flatMap(Ok(0.0), recip) == Error(\"Divide by zero\")\n\nBelt.Result.flatMap(Error(\"Already bad\"), recip) == Error(\"Already bad\")\n```" - ], - "signature": "let flatMap: (t<'a, 'c>, 'a => t<'b, 'c>) => t<'b, 'c>" - }, - { - "id": "Belt.Result.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [ - "`getWithDefault(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`,\notherwise `default`\n\n## Examples\n\n```rescript\nBelt.Result.getWithDefault(Ok(42), 0) == 42\n\nBelt.Result.getWithDefault(Error(\"Invalid Data\"), 0) == 0\n```" - ], - "signature": "let getWithDefault: (t<'a, 'b>, 'a) => 'a" - }, - { - "id": "Belt.Result.isOk", - "kind": "value", - "name": "isOk", - "docstrings": [ - "`isOk(res)`: Returns `true` if `res` is of the form `Ok(n)`, `false` if it is\nthe `Error(e)` variant." - ], - "signature": "let isOk: t<'a, 'b> => bool" - }, - { - "id": "Belt.Result.isError", - "kind": "value", - "name": "isError", - "docstrings": [ - "`isError(res)`: Returns `true` if `res` is of the form `Error(e)`, `false` if\nit is the `Ok(n)` variant." - ], - "signature": "let isError: t<'a, 'b> => bool" - }, - { - "id": "Belt.Result.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Result.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(res1, res2, f)`: Determine if two `Belt.Result` variables are equal with\nrespect to an equality function. If `res1` and `res2` are of the form `Ok(n)`\nand `Ok(m)`, return the result of `f(n, m)`. If one of `res1` and `res2` are of\nthe form `Error(e)`, return false If both `res1` and `res2` are of the form\n`Error(e)`, return true\n\n## Examples\n\n```rescript\nlet good1 = Belt.Result.Ok(42)\n\nlet good2 = Belt.Result.Ok(32)\n\nlet bad1 = Belt.Result.Error(\"invalid\")\n\nlet bad2 = Belt.Result.Error(\"really invalid\")\n\nlet mod10equal = (a, b) => mod(a, 10) === mod(b, 10)\n\nBelt.Result.eq(good1, good2, mod10equal) == true\n\nBelt.Result.eq(good1, bad1, mod10equal) == false\n\nBelt.Result.eq(bad2, good2, mod10equal) == false\n\nBelt.Result.eq(bad1, bad2, mod10equal) == true\n```" - ], - "signature": "let eq: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Result.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Result.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(res1, res2, f)`: Compare two `Belt.Result` variables with respect to a\ncomparison function. The comparison function returns -1 if the first variable\nis \"less than\" the second, 0 if the two variables are equal, and 1 if the first\nis \"greater than\" the second.\n\nIf `res1` and `res2` are of the form `Ok(n)` and `Ok(m)`, return the result of\n`f(n, m)`. If `res1` is of the form `Error(e)` and `res2` of the form `Ok(n)`,\nreturn -1 (nothing is less than something) If `res1` is of the form `Ok(n)` and\n`res2` of the form `Error(e)`, return 1 (something is greater than nothing) If\nboth `res1` and `res2` are of the form `Error(e)`, return 0 (equal)\n\n## Examples\n\n```rescript\nlet good1 = Belt.Result.Ok(59)\n\nlet good2 = Belt.Result.Ok(37)\n\nlet bad1 = Belt.Result.Error(\"invalid\")\n\nlet bad2 = Belt.Result.Error(\"really invalid\")\n\nlet mod10cmp = (a, b) => Pervasives.compare(mod(a, 10), mod(b, 10))\n\nBelt.Result.cmp(Ok(39), Ok(57), mod10cmp) == 1\n\nBelt.Result.cmp(Ok(57), Ok(39), mod10cmp) == -1\n\nBelt.Result.cmp(Ok(39), Error(\"y\"), mod10cmp) == 1\n\nBelt.Result.cmp(Error(\"x\"), Ok(57), mod10cmp) == -1\n\nBelt.Result.cmp(Error(\"x\"), Error(\"y\"), mod10cmp) == 0\n```" - ], - "signature": "let cmp: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => int) => int" - } - ] - }, - "belt/option": { - "id": "Belt.Option", - "name": "Option", - "docstrings": [ - "[`Belt.Option`]()\n\n Utilities for option data type.", - "In Belt we represent the existence and nonexistence of a value by wrapping it\nwith the `option` type. In order to make it a bit more convenient to work with\noption-types, Belt provides utility-functions for it.\n\nThe `option` type is a part of the ReScript standard library which is defined like this:\n\n## Examples\n\n```rescript\ntype option<'a> = None | Some('a)\n```\n\n```rescript\nlet someString: option = Some(\"hello\")\n```" - ], - "items": [ - { - "id": "Belt.Option.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [ - "Uncurried version of `keep`" - ], - "signature": "let keepU: (option<'a>, 'a => bool) => option<'a>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Option.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "If `optionValue` is `Some(value)` and `p(value) = true`, it returns `Some(value)`; otherwise returns `None`\n\n## Examples\n\n```rescript\nBelt.Option.keep(Some(10), x => x > 5) == Some(10)\nBelt.Option.keep(Some(4), x => x > 5) == None\nBelt.Option.keep(None, x => x > 5) == None\n```" - ], - "signature": "let keep: (option<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Belt.Option.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Uncurried version of `forEach`" - ], - "signature": "let forEachU: (option<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Option.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "If `optionValue` is `Some(value`), it calls `f(value)`; otherwise returns `()`\n\n## Examples\n\n```rescript\nBelt.Option.forEach(Some(\"thing\"), x => Js.log(x)) /* logs \"thing\" */\nBelt.Option.forEach(None, x => Js.log(x)) /* returns () */\n```" - ], - "signature": "let forEach: (option<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.Option.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Throws an Error in case `None` is provided. Use with care.\n\n## Examples\n\n```rescript\nSome(3)->Belt.Option.getExn == 3\n\nswitch Belt.Option.getExn(None) {\n// Throws an exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getExn: option<'a> => 'a" - }, - { - "id": "Belt.Option.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Throws an Error in case `None` is provided. Use with care.\n\n## Examples\n\n```rescript\nSome(3)->Belt.Option.getOrThrow == 3\n\nswitch Belt.Option.getOrThrow(None) {\n// Throws an exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getOrThrow: option<'a> => 'a" - }, - { - "id": "Belt.Option.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(x)` returns `x`\n\nThis is an unsafe operation, it assumes `x` is neither `None`\nnor `Some(None(...)))`" - ], - "signature": "let getUnsafe: option<'a> => 'a" - }, - { - "id": "Belt.Option.mapWithDefaultU", - "kind": "value", - "name": "mapWithDefaultU", - "docstrings": [ - "Uncurried version of `mapWithDefault`" - ], - "signature": "let mapWithDefaultU: (option<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "Use `mapWithDefault` instead" - }, - { - "id": "Belt.Option.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [ - "If `optionValue` is of `Some(value)`,\nthis function returns that value applied with `f`, in other words `f(value)`.\n\nIf `optionValue` is `None`, the default is returned.\n\n## Examples\n\n```rescript\nlet someValue = Some(3)\nsomeValue->Belt.Option.mapWithDefault(0, x => x + 5) == 8\n\nlet noneValue = None\nnoneValue->Belt.Option.mapWithDefault(0, x => x + 5) == 0\n```" - ], - "signature": "let mapWithDefault: (option<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Belt.Option.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [ - "Uncurried version of `map`" - ], - "signature": "let mapU: (option<'a>, 'a => 'b) => option<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Option.map", - "kind": "value", - "name": "map", - "docstrings": [ - "If `optionValue` is `Some(value)` this returns `f(value)`, otherwise it returns `None`.\n\n## Examples\n\n```rescript\nBelt.Option.map(Some(3), x => x * x) == Some(9)\n\nBelt.Option.map(None, x => x * x) == None\n```" - ], - "signature": "let map: (option<'a>, 'a => 'b) => option<'b>" - }, - { - "id": "Belt.Option.flatMapU", - "kind": "value", - "name": "flatMapU", - "docstrings": [ - "Uncurried version of `flatMap`" - ], - "signature": "let flatMapU: (option<'a>, 'a => option<'b>) => option<'b>", - "deprecated": "Use `flatMap` instead" - }, - { - "id": "Belt.Option.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "If `optionValue` is `Some(value)`, returns `f(value)`, otherwise returns\n`None`.
\nThe function `f` must have a return type of `option<'b>`.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Some(value + 1)\n } else {\n None\n }\n\nBelt.Option.flatMap(Some(2), addIfAboveOne) == Some(3)\n\nBelt.Option.flatMap(Some(-4), addIfAboveOne) == None\n\nBelt.Option.flatMap(None, addIfAboveOne) == None\n```" - ], - "signature": "let flatMap: (option<'a>, 'a => option<'b>) => option<'b>" - }, - { - "id": "Belt.Option.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [ - "If `optionalValue` is `Some(value)`, returns `value`, otherwise default.\n\n## Examples\n\n```rescript\nBelt.Option.getWithDefault(None, \"Banana\") == \"Banana\"\n\nBelt.Option.getWithDefault(Some(\"Apple\"), \"Banana\") == \"Apple\"\n```\n\n```rescript\nlet greet = (firstName: option) =>\n \"Greetings \" ++ firstName->Belt.Option.getWithDefault(\"Anonymous\")\n\nSome(\"Jane\")->greet == \"Greetings Jane\"\n\nNone->greet == \"Greetings Anonymous\"\n```" - ], - "signature": "let getWithDefault: (option<'a>, 'a) => 'a" - }, - { - "id": "Belt.Option.orElse", - "kind": "value", - "name": "orElse", - "docstrings": [ - "`orElse(optionalValue, otherOptional)` if `optionalValue` is `Some(value)`,\nreturns `Some(value)`, otherwise `otherOptional`\n\n## Examples\n\n```rescript\nBelt.Option.orElse(Some(1812), Some(1066)) == Some(1812)\nBelt.Option.orElse(None, Some(1066)) == Some(1066)\nBelt.Option.orElse(None, None) == None\n```" - ], - "signature": "let orElse: (option<'a>, option<'a>) => option<'a>" - }, - { - "id": "Belt.Option.isSome", - "kind": "value", - "name": "isSome", - "docstrings": [ - "Returns `true` if the argument is `Some(value)`, `false` otherwise.\n\n## Examples\n\n```rescript\nBelt.Option.isSome(None) == false\n\nBelt.Option.isSome(Some(1)) == true\n```" - ], - "signature": "let isSome: option<'a> => bool" - }, - { - "id": "Belt.Option.isNone", - "kind": "value", - "name": "isNone", - "docstrings": [ - "Returns `true` if the argument is `None`, `false` otherwise.\n\n## Examples\n\n```rescript\nBelt.Option.isNone(None) == true\n\nBelt.Option.isNone(Some(1)) == false\n```" - ], - "signature": "let isNone: option<'a> => bool" - }, - { - "id": "Belt.Option.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [ - "Uncurried version of `eq`" - ], - "signature": "let eqU: (option<'a>, option<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Option.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Evaluates two optional values for equality with respect to a predicate\nfunction. If both `optValue1` and `optValue2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\n\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`predicate(value1, value2)`; the predicate function must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Belt.Option\n\neq(Some(3), Some(15), clockEqual) == true\n\neq(Some(3), None, clockEqual) == false\n\neq(None, Some(3), clockEqual) == false\n\neq(None, None, clockEqual) == true\n```" - ], - "signature": "let eq: (option<'a>, option<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Option.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [ - "Uncurried version of `cmp`" - ], - "signature": "let cmpU: (option<'a>, option<'b>, ('a, 'b) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Option.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(optValue1, optValue2, comparisonFunction)` compares two optional values\nwith respect to given `comparisonFunction`.\n\nIf both `optValue1` and `optValue2` are `None`, it returns `0`.\n\nIf the first argument is `Some(value1)` and the second is `None`, returns `1`\n(something is greater than nothing).\n\nIf the first argument is `None` and the second is `Some(value2)`, returns `-1`\n(nothing is less than something).\n\nIf the arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`comparisonFunction(value1, value2)`; comparisonFunction takes two arguments\nand returns `-1` if the first argument is less than the second, `0` if the\narguments are equal, and `1` if the first argument is greater than the second.\n\n## Examples\n\n```rescript\nlet clockCompare = (a, b) => compare(mod(a, 12), mod(b, 12))\n\nopen Belt.Option\n\ncmp(Some(3), Some(15), clockCompare) == 0\n\ncmp(Some(3), Some(14), clockCompare) == 1\n\ncmp(Some(2), Some(15), clockCompare) == -1\n\ncmp(None, Some(15), clockCompare) == -1\n\ncmp(Some(14), None, clockCompare) == 1\n\ncmp(None, None, clockCompare) == 0\n```" - ], - "signature": "let cmp: (option<'a>, option<'b>, ('a, 'b) => int) => int" - } - ] - }, - "belt/hashmap": { - "id": "Belt.HashMap", - "name": "HashMap", - "docstrings": [ - "[`Belt.HashMap`]()\n\n The top level provides generic **mutable** hash map operations.\n\n It also has two specialized inner modules\n [`Belt.HashMap.Int`]() and [`Belt.HashMap.String`]()", - "A **mutable** Hash map which allows customized [`hash`]() behavior.\n\nAll data are parameterized by not its only type but also a unique identity in\nthe time of initialization, so that two _HashMaps of ints_ initialized with different\n_hash_ functions will have different type.\n\n## Examples\n\n```rescript\ntype t = int\nmodule I0 = unpack(Belt.Id.hashable(~hash=(_: t) => 0xff_ff, ~eq=(a, b) => a == b))\nlet s0: Belt.HashMap.t = Belt.HashMap.make(~hintSize=40, ~id=module(I0))\n\nmodule I1 = unpack(Belt.Id.hashable(~hash=(_: t) => 0xff, ~eq=(a, b) => a == b))\nlet s1: Belt.HashMap.t = Belt.HashMap.make(~hintSize=40, ~id=module(I1))\n```\n\nThe invariant must be held: for two elements who are _equal_,\ntheir hashed value should be the same\n\nHere the compiler would infer `s0` and `s1` having different type so that\nit would not mix.\n\n## Examples\n\n```\nlet s0: t\nlet s1: t\n```\n\nWe can add elements to the collection:\n\n## Examples\n\n```rescript\nlet () = {\n Belt.HashMap.set(s0, 0, 3)\n Belt.HashMap.set(s1, 1, \"3\")\n}\n```\n\nSince this is an mutable data strucure, `s1` will contain two pairs." - ], - "items": [ - { - "id": "Belt.HashMap.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of hash tables from type `'key` to type `'value`." - ], - "signature": "type t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making an empty hash map." - ], - "signature": "type id<'a, 'id> = Belt_Id.hashable<'a, 'id>" - }, - { - "id": "Belt.HashMap.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(~hintSize=10, ~id)` creates a new map by taking in the comparator and `hintSize`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\n\nBelt.HashMap.set(hMap, 0, \"a\")\n```" - ], - "signature": "let make: (~hintSize: int, ~id: id<'key, 'id>) => t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Clears a hash table.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.fromArray([(1, \"1\")], ~id=module(IntHash))\nBelt.HashMap.clear(hMap)\nBelt.HashMap.isEmpty(hMap) == true\n```" - ], - "signature": "let clear: t<'key, 'value, 'id> => unit" - }, - { - "id": "Belt.HashMap.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(m)` checks whether a hash map is empty.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nBelt.HashMap.isEmpty(Belt.HashMap.fromArray([(1, \"1\")], ~id=module(IntHash))) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b, 'c> => bool" - }, - { - "id": "Belt.HashMap.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(hMap, k, v)` if `k` does not exist, add the binding `k,v`, otherwise, update the old value with the new `v`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntHash))\n\nBelt.HashMap.set(s0, 2, \"3\")\n\nBelt.HashMap.valuesToArray(s0) == [\"1\", \"3\", \"3\"]\n```" - ], - "signature": "let set: (t<'key, 'value, 'id>, 'key, 'value) => unit" - }, - { - "id": "Belt.HashMap.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Creates copy of a hash map.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntHash))\nlet s1 = Belt.HashMap.copy(s0)\n\nBelt.HashMap.set(s0, 2, \"3\")\n\n(Belt.HashMap.get(s0, 2) != Belt.HashMap.get(s1, 2)) == true\n```" - ], - "signature": "let copy: t<'key, 'value, 'id> => t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns value bound under specific key. If values not exist returns `None`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\n\nBelt.HashMap.get(s0, 1) == Some(\"value1\")\nBelt.HashMap.get(s0, 2) == None\n```" - ], - "signature": "let get: (t<'key, 'value, 'id>, 'key) => option<'value>" - }, - { - "id": "Belt.HashMap.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if `x` is bound in `tbl`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\n\nBelt.HashMap.has(s0, 1) == true\nBelt.HashMap.has(s0, 2) == false\n```" - ], - "signature": "let has: (t<'key, 'value, 'id>, 'key) => bool" - }, - { - "id": "Belt.HashMap.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "If bound exists, removes it from the hash map.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.remove(s0, 1)\nBelt.HashMap.has(s0, 1) == false\n```" - ], - "signature": "let remove: (t<'key, 'value, 'id>, 'key) => unit" - }, - { - "id": "Belt.HashMap.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as [forEach](#forEach) but takes uncurried function." - ], - "signature": "let forEachU: (t<'key, 'value, 'id>, ('key, 'value) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashMap.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(tbl, f)` applies `f` to all bindings in table `tbl`. `f` receives the key as first argument, and the associated value as second argument. Each binding is presented exactly once to `f`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.forEach(s0, (key, value) => Js.log2(key, value))\n// prints (1, \"value1\")\n```" - ], - "signature": "let forEach: (t<'key, 'value, 'id>, ('key, 'value) => unit) => unit" - }, - { - "id": "Belt.HashMap.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashMap.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(tbl, init, f)` computes `(f(kN, dN) ... (f(k1, d1, init))...)`, where `k1 ... kN` are the keys of all bindings in `tbl`, and `d1 ... dN` are the associated values. Each binding is presented exactly once to `f`.\n\nThe order in which the bindings are passed to `f` is unspecified. However, if the table contains several bindings for the same key, they are passed to `f` in reverse order of introduction, that is, the most recent binding is passed first.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\n\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\ns0->Belt.HashMap.reduce(\"\", (acc, _, value) => acc ++ (\", \" ++ value)) == \", value1, value2\"\n```\n\n## More Examples\n\n```rescript\nConsole.log(\"lol\")\n```" - ], - "signature": "let reduce: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c" - }, - { - "id": "Belt.HashMap.keepMapInPlaceU", - "kind": "value", - "name": "keepMapInPlaceU", - "docstrings": [ - "Same as [keepMapInPlace](#keepMapInPlace) but takes uncurried function." - ], - "signature": "let keepMapInPlaceU: (\n t<'key, 'value, 'id>,\n ('key, 'value) => option<'value>,\n) => unit", - "deprecated": "Use `keepMapInPlace` instead" - }, - { - "id": "Belt.HashMap.keepMapInPlace", - "kind": "value", - "name": "keepMapInPlace", - "docstrings": [ - "Filters out values for which function `f` returned `None`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.keepMapInPlace(s0, (key, value) => key == 1 ? None : Some(value))\n```" - ], - "signature": "let keepMapInPlace: (\n t<'key, 'value, 'id>,\n ('key, 'value) => option<'value>,\n) => unit" - }, - { - "id": "Belt.HashMap.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(tbl)` returns the number of bindings in `tbl`. It takes constant time.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.size(s0) == 2\n```" - ], - "signature": "let size: t<'a, 'b, 'c> => int" - }, - { - "id": "Belt.HashMap.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of key value pairs.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.toArray(s0) == [(1, \"value1\"), (2, \"value2\")]\n```" - ], - "signature": "let toArray: t<'key, 'value, 'id> => array<('key, 'value)>" - }, - { - "id": "Belt.HashMap.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "Returns array of keys.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.keysToArray(s0) == [1, 2]\n```" - ], - "signature": "let keysToArray: t<'key, 'a, 'b> => array<'key>" - }, - { - "id": "Belt.HashMap.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [ - "Returns array of values.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.valuesToArray(s0) == [\"value1\", \"value2\"]\n```" - ], - "signature": "let valuesToArray: t<'a, 'value, 'b> => array<'value>" - }, - { - "id": "Belt.HashMap.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new hash map from array of pairs.\n\nReturns array of values.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(1, \"value1\"), (2, \"value2\")], ~id=module(IntHash))\nBelt.HashMap.toArray(s0) == [(1, \"value1\"), (2, \"value2\")]\n```" - ], - "signature": "let fromArray: (\n array<('key, 'value)>,\n ~id: id<'key, 'id>,\n) => t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.mergeMany(hMap, [(1, \"1\"), (2, \"2\")])\n```" - ], - "signature": "let mergeMany: (t<'key, 'value, 'id>, array<('key, 'value)>) => unit" - }, - { - "id": "Belt.HashMap.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(hMap, 1, \"1\")\n\nBelt.HashMap.getBucketHistogram(hMap)\n```" - ], - "signature": "let getBucketHistogram: t<'a, 'b, 'c> => array" - }, - { - "id": "Belt.HashMap.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(hMap, 1, \"1\")\n\nBelt.HashMap.logStats(hMap)\n```" - ], - "signature": "let logStats: t<'a, 'b, 'c> => unit" - } - ] - }, - "belt/hashset": { - "id": "Belt.HashSet", - "name": "HashSet", - "docstrings": [ - "[`Belt.HashSet`]()\n\n The top level provides generic **mutable** hash set operations.\n\n It also has two specialized inner modules\n [`Belt.HashSet.Int`]() and [`Belt.HashSet.String`]()", - "A **mutable** Hash set which allows customized `hash` behavior.\n\nAll data are parameterized by not its only type but also a unique identity in\nthe time of initialization, so that two _HashSets of ints_ initialized with\ndifferent _hash_ functions will have different type.\n\n## Examples\n\n```rescript\nmodule I0 = unpack(Belt.Id.hashable(~hash=(a: int) => land(a, 65535), ~eq=(a, b) => a == b))\n\nlet s0 = Belt.HashSet.make(~id=module(I0), ~hintSize=40)\n\nmodule I1 = unpack(Belt.Id.hashable(~hash=(a: int) => land(a, 255), ~eq=(a, b) => a == b))\n\nlet s1 = Belt.HashSet.make(~id=module(I1), ~hintSize=40)\n\nBelt.HashSet.add(s1, 0)\nBelt.HashSet.add(s1, 1)\n```\n\nThe invariant must be held: for two elements who are equal, their hashed\nvalue should be the same.\n\nHere the compiler would infer `s0` and `s1` having different type so that it\nwould not mix.\n\nSignatures:\n\n```\nlet s0: Belt.HashSet.t\nlet s1: Belt.HashSet.t\n```\n\nWe can add elements to the collection (see last two lines in the example\nabove). Since this is an mutable data structure, `s1` will contain two pairs." - ], - "items": [ - { - "id": "Belt.HashSet.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a, 'id>" - }, - { - "id": "Belt.HashSet.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The type of hash tables from type `'a` to type `'b`." - ], - "signature": "type id<'a, 'id> = Belt_Id.hashable<'a, 'id>" - }, - { - "id": "Belt.HashSet.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int, ~id: id<'a, 'id>) => t<'a, 'id>" - }, - { - "id": "Belt.HashSet.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a, 'id> => unit" - }, - { - "id": "Belt.HashSet.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.HashSet.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t<'a, 'id>, 'a) => unit" - }, - { - "id": "Belt.HashSet.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a, 'id> => t<'a, 'id>" - }, - { - "id": "Belt.HashSet.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a, 'id>, 'a) => bool" - }, - { - "id": "Belt.HashSet.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t<'a, 'id>, 'a) => unit" - }, - { - "id": "Belt.HashSet.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a, 'id>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashSet.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Order unspecified." - ], - "signature": "let forEach: (t<'a, 'id>, 'a => unit) => unit" - }, - { - "id": "Belt.HashSet.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a, 'id>, 'c, ('c, 'a) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashSet.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Order unspecified." - ], - "signature": "let reduce: (t<'a, 'id>, 'c, ('c, 'a) => 'c) => 'c" - }, - { - "id": "Belt.HashSet.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a, 'id> => int" - }, - { - "id": "Belt.HashSet.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t<'a, 'b> => unit" - }, - { - "id": "Belt.HashSet.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'a, 'id> => array<'a>" - }, - { - "id": "Belt.HashSet.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: (array<'a>, ~id: id<'a, 'id>) => t<'a, 'id>" - }, - { - "id": "Belt.HashSet.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'a, 'id>, array<'a>) => unit" - }, - { - "id": "Belt.HashSet.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t<'a, 'b> => array" - } - ] - }, - "belt/mutablemap": { - "id": "Belt.MutableMap", - "name": "MutableMap", - "docstrings": [ - "[`Belt.MutableMap`]()\n\n The top level provides generic **mutable** map operations.\n\n It also has two specialized inner modules\n [`Belt.MutableMap.Int`]() and [`Belt.MutableMap.String`]()" - ], - "items": [ - { - "id": "Belt.MutableMap.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v, 'id>" - }, - { - "id": "Belt.MutableMap.id", - "kind": "type", - "name": "id", - "docstrings": [], - "signature": "type id<'key, 'id> = Belt_Id.comparable<'key, 'id>" - }, - { - "id": "Belt.MutableMap.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~id: id<'k, 'id>) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.MutableMap.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a, 'b, 'c> => unit" - }, - { - "id": "Belt.MutableMap.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a, 'b, 'c> => bool" - }, - { - "id": "Belt.MutableMap.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'k, 'a, 'b>, 'k) => bool" - }, - { - "id": "Belt.MutableMap.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.MutableMap.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m1, m2, cmp)` First compare by size, if size is the same, compare by\nkey, value pair." - ], - "signature": "let cmp: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.MutableMap.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.MutableMap.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, eqf)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `eqf` is the\nequality predicate used to compare the data associated with the keys." - ], - "signature": "let eq: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableMap.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies f to all bindings in map `m`. `f` receives the `'k`\nas first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys." - ], - "signature": "let forEach: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit" - }, - { - "id": "Belt.MutableMap.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableMap.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f), computes`(f(kN, dN) ... (f(k1, d1, a))...)`, where`k1 ...\nkN`are the keys of all bindings in`m`(in increasing order), and`d1 ... dN`\nare the associated data." - ], - "signature": "let reduce: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableMap.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableMap.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`." - ], - "signature": "let every: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableMap.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`." - ], - "signature": "let some: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'k, 'a, 'id> => int" - }, - { - "id": "Belt.MutableMap.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'k, 'a, 'id> => list<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'k, 'a, 'id> => array<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: (array<('k, 'a)>, ~id: id<'k, 'id>) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.MutableMap.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'k, 'a, 'b> => array<'k>" - }, - { - "id": "Belt.MutableMap.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'b, 'a, 'c> => array<'a>" - }, - { - "id": "Belt.MutableMap.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.MutableMap.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.MutableMap.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.MutableMap.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.MutableMap.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'k, 'a, 'id>, 'k) => option<'a>" - }, - { - "id": "Belt.MutableMap.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'k, 'a, 'id>, 'k) => Js.undefined<'a>" - }, - { - "id": "Belt.MutableMap.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'k, 'a, 'id>, 'k, 'a) => 'a" - }, - { - "id": "Belt.MutableMap.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'k, 'a, 'id>, 'k) => 'a" - }, - { - "id": "Belt.MutableMap.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'k, 'a, 'id>, 'k) => 'a" - }, - { - "id": "Belt.MutableMap.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "Throw when invariant is not held." - ], - "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit" - }, - { - "id": "Belt.MutableMap.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` do the in-place modification." - ], - "signature": "let remove: (t<'k, 'a, 'id>, 'k) => unit" - }, - { - "id": "Belt.MutableMap.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'k, 'a, 'id>, array<'k>) => unit" - }, - { - "id": "Belt.MutableMap.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` do the in-place modification" - ], - "signature": "let set: (t<'k, 'a, 'id>, 'k, 'a) => unit" - }, - { - "id": "Belt.MutableMap.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'k, 'a, 'id>, 'k, option<'a> => option<'a>) => unit", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.MutableMap.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'k, 'a, 'id>, 'k, option<'a> => option<'a>) => unit" - }, - { - "id": "Belt.MutableMap.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'k, 'a, 'id>, array<('k, 'a)>) => unit" - }, - { - "id": "Belt.MutableMap.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableMap.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated\nvalue a of all bindings of `m` has been replaced by the result of the\napplication of `f` to `a`. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let map: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>" - }, - { - "id": "Belt.MutableMap.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.MutableMap.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>" - } - ] - }, - "belt/mutableset": { - "id": "Belt.MutableSet", - "name": "MutableSet", - "docstrings": [ - "[`Belt.MutableSet`]()\n\n The top level provides generic **mutable** set operations.\n\n It also has two specialized inner modules\n [`Belt.MutableSet.Int`]() and [`Belt.MutableSet.String`]()", - "A **mutable** sorted set module which allows customized compare behavior.\nThe implementation uses balanced binary trees, and therefore searching and insertion take time logarithmic in the size of the map.\n\nIt also has two specialized inner modules [Belt.MutableSet.Int](mutable-set-int) and [Belt.MutableSet.String](mutable-set-string) - This module separates data from function which is more verbose but slightly more efficient\n\n## Examples\n\n```rescript\nmodule PairComparator = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet = Belt.MutableSet.make(~id=module(PairComparator))\nmySet->Belt.MutableSet.add((1, 2))\n```" - ], - "items": [ - { - "id": "Belt.MutableSet.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'value, 'identity>" - }, - { - "id": "Belt.MutableSet.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making a set from scratch" - ], - "signature": "type id<'value, 'id> = Belt_Id.comparable<'value, 'id>" - }, - { - "id": "Belt.MutableSet.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new set by taking in the comparator" - ], - "signature": "let make: (~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let fromArray: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [ - "The same as [fromArray][#fromarray] except it is after assuming the input array is already sorted." - ], - "signature": "let fromSortedArrayUnsafe: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Returns copy of a set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\nlet copied = s0->Belt.MutableSet.copy\ncopied->Belt.MutableSet.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let copy: t<'value, 'id> => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.MutableSet.fromArray([], ~id=module(IntCmp))\nlet notEmpty = Belt.MutableSet.fromArray([1], ~id=module(IntCmp))\n\nBelt.MutableSet.isEmpty(empty) == true\nBelt.MutableSet.isEmpty(notEmpty) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.MutableSet.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if element exists in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.fromArray([1, 4, 2, 5], ~id=module(IntCmp))\n\nset->Belt.MutableSet.has(3) == false\nset->Belt.MutableSet.has(1) == true\n```" - ], - "signature": "let has: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.MutableSet.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\ns0->Belt.MutableSet.add(1)\ns0->Belt.MutableSet.add(2)\ns0->Belt.MutableSet.add(2)\n\ns0->Belt.MutableSet.toArray == [1, 2]\n```" - ], - "signature": "let add: (t<'value, 'id>, 'value) => unit" - }, - { - "id": "Belt.MutableSet.addCheck", - "kind": "value", - "name": "addCheck", - "docstrings": [], - "signature": "let addCheck: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.MutableSet.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "Adds each element of array to set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.make(~id=module(IntCmp))\n\nset->Belt.MutableSet.mergeMany([5, 4, 3, 2, 1])\nset->Belt.MutableSet.toArray == [1, 2, 3, 4, 5]\n```" - ], - "signature": "let mergeMany: (t<'value, 'id>, array<'value>) => unit" - }, - { - "id": "Belt.MutableSet.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([2, 3, 1, 4, 5], ~id=module(IntCmp))\ns0->Belt.MutableSet.remove(1)\ns0->Belt.MutableSet.remove(3)\ns0->Belt.MutableSet.remove(3)\n\ns0->Belt.MutableSet.toArray == [2, 4, 5]\n```" - ], - "signature": "let remove: (t<'value, 'id>, 'value) => unit" - }, - { - "id": "Belt.MutableSet.removeCheck", - "kind": "value", - "name": "removeCheck", - "docstrings": [], - "signature": "let removeCheck: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.MutableSet.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "Removes each element of array from set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\nset->Belt.MutableSet.removeMany([5, 4, 3, 2, 1])\nset->Belt.MutableSet.toArray == []\n```" - ], - "signature": "let removeMany: (t<'value, 'id>, array<'value>) => unit" - }, - { - "id": "Belt.MutableSet.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet union = Belt.MutableSet.union(s0, s1)\nunion->Belt.MutableSet.toArray == [1, 2, 3, 4, 5, 6]\n```" - ], - "signature": "let union: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet intersect = Belt.MutableSet.intersect(s0, s1)\nintersect->Belt.MutableSet.toArray == [2, 3, 5]\n```" - ], - "signature": "let intersect: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.diff", - "kind": "value", - "name": "diff", - "docstrings": [ - "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nBelt.MutableSet.toArray(Belt.MutableSet.diff(s0, s1)) == [6]\nBelt.MutableSet.toArray(Belt.MutableSet.diff(s1, s0)) == [1, 4]\n```" - ], - "signature": "let diff: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet s2 = Belt.MutableSet.intersect(s0, s1)\nBelt.MutableSet.subset(s2, s0) == true\nBelt.MutableSet.subset(s2, s1) == true\nBelt.MutableSet.subset(s1, s0) == false\n```" - ], - "signature": "let subset: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.MutableSet.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets of sets.\nIt compares size first and then iterates over each element following the order of elements." - ], - "signature": "let cmp: (t<'value, 'id>, t<'value, 'id>) => int" - }, - { - "id": "Belt.MutableSet.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 5], ~id=module(IntCmp))\n\nBelt.MutableSet.eq(s0, s1) == true\n```" - ], - "signature": "let eq: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.MutableSet.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as `Belt.MutableSet.forEach` but takes uncurried functon." - ], - "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableSet.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet acc = ref(list{})\ns0->Belt.MutableSet.forEach(x => acc := Belt.List.add(acc.contents, x))\nacc.contents == list{6, 5, 3, 2}\n```" - ], - "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit" - }, - { - "id": "Belt.MutableSet.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableSet.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\ns0->Belt.MutableSet.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) ==\n list{6, 5, 3, 2}\n```" - ], - "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a" - }, - { - "id": "Belt.MutableSet.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableSet.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.MutableSet.fromArray([2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.MutableSet.every(isEven) == true\n```" - ], - "signature": "let every: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.MutableSet.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableSet.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.MutableSet.some(isOdd) == true\n```" - ], - "signature": "let some: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.MutableSet.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.MutableSet.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.MutableSet.keep(isEven)\n\ns1->Belt.MutableSet.toArray == [2, 4]\n```" - ], - "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.MutableSet.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet (s1, s2) = s0->Belt.MutableSet.partition(isOdd)\n\ns1->Belt.MutableSet.toArray == [1, 3, 5]\ns2->Belt.MutableSet.toArray == [2, 4]\n```" - ], - "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)" - }, - { - "id": "Belt.MutableSet.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.size == 4\n```" - ], - "signature": "let size: t<'value, 'id> => int" - }, - { - "id": "Belt.MutableSet.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toList == list{1, 2, 3, 5}\n```" - ], - "signature": "let toList: t<'value, 'id> => list<'value>" - }, - { - "id": "Belt.MutableSet.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toArray == [1, 2, 3, 5]\n```" - ], - "signature": "let toArray: t<'value, 'id> => array<'value>" - }, - { - "id": "Belt.MutableSet.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.minimum == None\ns1->Belt.MutableSet.minimum == Some(1)\n```" - ], - "signature": "let minimum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.MutableSet.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "Returns minimum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.minUndefined == Js.undefined\ns1->Belt.MutableSet.minUndefined == Js.Undefined.return(1)\n```" - ], - "signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.MutableSet.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.maximum == None\ns1->Belt.MutableSet.maximum == Some(5)\n```" - ], - "signature": "let maximum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.MutableSet.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "Returns maximum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.maxUndefined == Js.undefined\ns1->Belt.MutableSet.maxUndefined == Js.Undefined.return(5)\n```" - ], - "signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.MutableSet.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the reference of the value which is equivalent to value using the comparator specifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.get(3) == Some(3)\ns0->Belt.MutableSet.get(20) == None\n```" - ], - "signature": "let get: (t<'value, 'id>, 'value) => option<'value>" - }, - { - "id": "Belt.MutableSet.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "Same as `Belt.MutableSet.get` but returns `undefined` when element does not exist." - ], - "signature": "let getUndefined: (t<'value, 'id>, 'value) => Js.undefined<'value>" - }, - { - "id": "Belt.MutableSet.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as `Belt.MutableSet.get` but throw when element does not exist." - ], - "signature": "let getExn: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.MutableSet.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as `Belt.MutableSet.get` but throw when element does not exist." - ], - "signature": "let getOrThrow: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.MutableSet.split", - "kind": "value", - "name": "split", - "docstrings": [ - "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\nlet ((smaller, larger), present) = s0->Belt.MutableSet.split(3)\n\npresent == true\nsmaller->Belt.MutableSet.toArray == [1, 2]\nlarger->Belt.MutableSet.toArray == [4, 5]\n```" - ], - "signature": "let split: (\n t<'value, 'id>,\n 'value,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)" - }, - { - "id": "Belt.MutableSet.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b> => unit" - } - ] - }, - "belt/map": { - "id": "Belt.Map", - "name": "Map", - "docstrings": [ - "[`Belt.Map`](),\n\n The top level provides generic **immutable** map operations.\n\n It also has three specialized inner modules\n [`Belt.Map.Int`](), [`Belt.Map.String`]() and\n\n [`Belt.Map.Dict`](): This module separates data from function\n which is more verbose but slightly more efficient", - "The top level provides generic immutable map operations.\n\nIt also has three specialized inner modules `Belt.Map.Int`, `Belt.Map.String`\nand `Belt.Map.Dict`." - ], - "items": [ - { - "id": "Belt.Map.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'key` is the field type\n\n`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'key, 'value, 'identity>" - }, - { - "id": "Belt.Map.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making an empty map." - ], - "signature": "type id<'key, 'id> = Belt_Id.comparable<'key, 'id>" - }, - { - "id": "Belt.Map.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(~id)` creates a new map by taking in the comparator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet m = Belt.Map.make(~id=module(IntCmp))\n\nBelt.Map.set(m, 0, \"a\")\n```" - ], - "signature": "let make: (~id: id<'k, 'id>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(m)` checks whether a map m is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.isEmpty(Belt.Map.fromArray([(1, \"1\")], ~id=module(IntCmp))) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b, 'c> => bool" - }, - { - "id": "Belt.Map.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(m, k)` checks whether `m` has the key `k`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.has(Belt.Map.fromArray([(1, \"1\")], ~id=module(IntCmp)), 1) == true\n```" - ], - "signature": "let has: (t<'k, 'v, 'id>, 'k) => bool" - }, - { - "id": "Belt.Map.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m0, m1, vcmp);`\n\nTotal ordering of map given total ordering of value function.\n\nIt will compare size first and each element following the order one by one." - ], - "signature": "let cmp: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => int) => int" - }, - { - "id": "Belt.Map.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "eq(m1, m2, veq)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `veq` is the\nequality predicate used to compare the data associated with the keys." - ], - "signature": "let eq: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`\nfindFirstBy(m, p)` uses function `f` to find the first key value pair to match predicate `p`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"\")])\n\ns0->Belt.Map.findFirstBy((k, _) => k == 4) == Some(4, \"4\")\n```" - ], - "signature": "let findFirstBy: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>" - }, - { - "id": "Belt.Map.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'k, 'v, 'id>, ('k, 'v) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the\n`'k` as first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")])\n\nlet acc = ref(list{})\n\nBelt.Map.forEach(s0, (k, v) => acc := list{(k, v), ...acc.contents})\n\nacc.contents == list{(4, \"4\"), (3, \"3\"), (2, \"2\"), (1, \"1\")}\n```" - ], - "signature": "let forEach: (t<'k, 'v, 'id>, ('k, 'v) => unit) => unit" - }, - { - "id": "Belt.Map.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'k, 'v, 'id>, 'acc, ('acc, 'k, 'v) => 'acc) => 'acc", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f(kN, dN) ... (f(k1, d1, a))...)`, where `k1\n... kN` are the keys of all bindings in m (in increasing order), and `d1\n... dN` are the associated data.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")])\n\nBelt.Map.reduce(s0, list{}, (acc, k, v) => list{(k, v), ...acc}) ==\n list{(4, \"4\"), (3, \"3\"), (2, \"2\"), (1, \"1\")}\n```" - ], - "signature": "let reduce: (t<'k, 'v, 'id>, 'acc, ('acc, 'k, 'v) => 'acc) => 'acc" - }, - { - "id": "Belt.Map.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let every: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate \n`p`. Order unspecified" - ], - "signature": "let some: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(s)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.size(Belt.Map.fromArray([(2, \"2\"), (2, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == 2\n```" - ], - "signature": "let size: t<'k, 'v, 'id> => int" - }, - { - "id": "Belt.Map.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(s)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.toArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n (1, \"1\"),\n (2, \"2\"),\n (3, \"3\"),\n ]\n```" - ], - "signature": "let toArray: t<'k, 'v, 'id> => array<('k, 'v)>" - }, - { - "id": "Belt.Map.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order. See `Belt.Map.toArray`" - ], - "signature": "let toList: t<'k, 'v, 'id> => list<('k, 'v)>" - }, - { - "id": "Belt.Map.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(kvs, ~id);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.toArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n (1, \"1\"),\n (2, \"2\"),\n (3, \"3\"),\n ]\n```" - ], - "signature": "let fromArray: (array<('k, 'v)>, ~id: id<'k, 'id>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "`keysToArray(s);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.keysToArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n 1,\n 2,\n 3,\n ]\n```" - ], - "signature": "let keysToArray: t<'k, 'v, 'id> => array<'k>" - }, - { - "id": "Belt.Map.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [ - "`valuesToArray(s);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.valuesToArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n \"1\",\n \"2\",\n \"3\",\n ]\n```" - ], - "signature": "let valuesToArray: t<'k, 'v, 'id> => array<'v>" - }, - { - "id": "Belt.Map.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [ - "`minKey(s)` returns the minimum key, None if not exist." - ], - "signature": "let minKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [ - "See `Belt.Map.minKey`" - ], - "signature": "let minKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [ - "`maxKey(s)` returns the maximum key, None if not exist." - ], - "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [ - "See `Belt.Map.maxKey`" - ], - "signature": "let maxKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "`minimum(s)` returns the minimum key value pair, None if not exist." - ], - "signature": "let minimum: t<'k, 'v, 'a> => option<('k, 'v)>" - }, - { - "id": "Belt.Map.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "See `Belt.Map.minimum`" - ], - "signature": "let minUndefined: t<'k, 'v, 'a> => Js.undefined<('k, 'v)>" - }, - { - "id": "Belt.Map.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "`maximum(s)` returns the maximum key value pair, None if not exist." - ], - "signature": "let maximum: t<'k, 'v, 'a> => option<('k, 'v)>" - }, - { - "id": "Belt.Map.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "See `Belt.Map.maximum`" - ], - "signature": "let maxUndefined: t<'k, 'v, 'a> => Js.undefined<('k, 'v)>" - }, - { - "id": "Belt.Map.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(s, k)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.get(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp)), 2) == Some(\"2\")\n\nBelt.Map.get(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp)), 4) == None\n```" - ], - "signature": "let get: (t<'k, 'v, 'id>, 'k) => option<'v>" - }, - { - "id": "Belt.Map.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "See `Belt.Map.get`. Returns `undefined` when not found" - ], - "signature": "let getUndefined: (t<'k, 'v, 'id>, 'k) => Js.undefined<'v>" - }, - { - "id": "Belt.Map.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [ - "`getWithDefault(s, k, default)`\n\nSee `Belt.Map.get`\n\nReturns default when `k` is not found." - ], - "signature": "let getWithDefault: (t<'k, 'v, 'id>, 'k, 'v) => 'v" - }, - { - "id": "Belt.Map.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(s, k)`\n\nSee `Belt.Map.get`\n\nthrow when `k` not exist" - ], - "signature": "let getExn: (t<'k, 'v, 'id>, 'k) => 'v" - }, - { - "id": "Belt.Map.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(s, k)`\n\nSee `Belt.Map.get`\n\nthrow when `k` not exist" - ], - "signature": "let getOrThrow: (t<'k, 'v, 'id>, 'k) => 'v" - }, - { - "id": "Belt.Map.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` when `x` is not in `m`, `m` is returned reference unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))\n\nlet s1 = Belt.Map.remove(s0, 1)\n\nlet s2 = Belt.Map.remove(s1, 1)\n\ns1 == s2\n\nBelt.Map.keysToArray(s1) == [2, 3]\n```" - ], - "signature": "let remove: (t<'k, 'v, 'id>, 'k) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "`removeMany(s, xs)`\n\nRemoving each of `xs` to `s`, note unlike `Belt.Map.remove`, the reference\nof return value might be changed even if none in `xs` exists `s`." - ], - "signature": "let removeMany: (t<'k, 'v, 'id>, array<'k>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as `m`, with a\nnew binding of `x` to `y`. If `x` was already bound in `m`, its previous\nbinding disappears.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))\n\nlet s1 = Belt.Map.set(s0, 2, \"3\")\n\nBelt.Map.valuesToArray(s1) == [\"1\", \"3\", \"3\"]\n```" - ], - "signature": "let set: (t<'k, 'v, 'id>, 'k, 'v) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (\n t<'k, 'v, 'id>,\n 'k,\n option<'v> => option<'v>,\n) => t<'k, 'v, 'id>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.update", - "kind": "value", - "name": "update", - "docstrings": [ - "`update(m, x, f)` returns a map containing the same bindings as `m`, except\nfor the binding of `x`. Depending on the value of `y` where `y` is\n`f(get(m, x))`, the binding of `x` is added, removed or updated. If `y` is\n`None`, the binding is removed if it exists; otherwise, if `y` is `Some(z)`\nthen `x` is associated to `z` in the resulting map." - ], - "signature": "let update: (\n t<'k, 'v, 'id>,\n 'k,\n option<'v> => option<'v>,\n) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "`mergeMany(s, xs)`\n\nAdding each of `xs` to `s`, note unlike `add`, the reference of return\nvalue might be changed even if all values in `xs` exist `s`." - ], - "signature": "let mergeMany: (t<'k, 'v, 'id>, array<('k, 'v)>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'k, 'v, 'id>,\n t<'k, 'v2, 'id>,\n ('k, option<'v>, option<'v2>) => option<'v3>,\n) => t<'k, 'v3, 'id>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'k, 'v, 'id>,\n t<'k, 'v2, 'id>,\n ('k, option<'v>, option<'v2>) => option<'v3>,\n) => t<'k, 'v3, 'id>" - }, - { - "id": "Belt.Map.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => t<'k, 'v, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in m that satisfy\npredicate `p`." - ], - "signature": "let keep: (t<'k, 'v, 'id>, ('k, 'v) => bool) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'k, 'v, 'id>,\n ('k, 'v) => bool,\n) => (t<'k, 'v, 'id>, t<'k, 'v, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains\nall the bindings of `s` that satisfy the predicate `p`, and `m2` is the map\nwith all the bindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (\n t<'k, 'v, 'id>,\n ('k, 'v) => bool,\n) => (t<'k, 'v, 'id>, t<'k, 'v, 'id>)" - }, - { - "id": "Belt.Map.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a tuple `(l, r)`, data, where `l` is the map with all\nthe bindings of `m` whose 'k is strictly less than `x`; `r` is the map with\nall the bindings of m whose 'k is strictly greater than `x`; `data` is\n`None` if `m` contains no binding for `x`, or `Some(v)` if `m` binds `v` to\n`x`." - ], - "signature": "let split: (\n t<'k, 'v, 'id>,\n 'k,\n) => ((t<'k, 'v, 'id>, t<'k, 'v, 'id>), option<'v>)" - }, - { - "id": "Belt.Map.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'k, 'v, 'id>, 'v => 'v2) => t<'k, 'v2, 'id>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'k, 'v, 'id>, 'v => 'v2) => t<'k, 'v2, 'id>" - }, - { - "id": "Belt.Map.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'k, 'v, 'id>, ('k, 'v) => 'v2) => t<'k, 'v2, 'id>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [ - "`mapWithKey(m, f)`\n\nThe same as `Belt.Map.map` except that `f` is supplied with one more\nargument: the key." - ], - "signature": "let mapWithKey: (t<'k, 'v, 'id>, ('k, 'v) => 'v2) => t<'k, 'v2, 'id>" - }, - { - "id": "Belt.Map.getData", - "kind": "value", - "name": "getData", - "docstrings": [ - "`getData(s0)`\n\nAdvanced usage only\n\nReturns the raw data (detached from comparator), but its type is still\nmanifested, so that user can pass identity directly without boxing." - ], - "signature": "let getData: t<'k, 'v, 'id> => Belt_MapDict.t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.getId", - "kind": "value", - "name": "getId", - "docstrings": [ - "Advanced usage only. Returns the identity of s0." - ], - "signature": "let getId: t<'k, 'v, 'id> => id<'k, 'id>" - }, - { - "id": "Belt.Map.packIdData", - "kind": "value", - "name": "packIdData", - "docstrings": [ - "`packIdData(~id, ~data)`\n\nAdvanced usage only\n\nReturns the packed collection." - ], - "signature": "let packIdData: (\n ~id: id<'k, 'id>,\n ~data: Belt_MapDict.t<'k, 'v, 'id>,\n) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit" - } - ] - }, - "belt/set": { - "id": "Belt.Set", - "name": "Set", - "docstrings": [ - "[`Belt.Set`]()\n\n The top level provides generic **immutable** set operations.\n\n It also has three specialized inner modules\n [`Belt.Set.Int`](), [`Belt.Set.String`]() and\n\n [`Belt.Set.Dict`](): This module separates data from function\n which is more verbose but slightly more efficient", - "An _immutable_ sorted set module which allows customized _compare_ behavior.\n\nThe implementation uses balanced binary trees, and therefore searching\nand insertion take time logarithmic in the size of the map.\n\nFor more info on this module's usage of identity, `make` and others, please see\nthe top level documentation of Belt, **A special encoding for collection safety**.\n\n## Examples\n\n```rescript\nmodule PairComparator = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet = Belt.Set.make(~id=module(PairComparator))\nlet mySet2 = Belt.Set.add(mySet, (1, 2))\n```\n\n**Note:** This module's examples will assume a predeclared module for integers\ncalled `IntCmp`. It is declared like this:\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n```" - ], - "items": [ - { - "id": "Belt.Set.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'value, 'identity>" - }, - { - "id": "Belt.Set.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making a set from scratch" - ], - "signature": "type id<'value, 'id> = Belt_Id.comparable<'value, 'id>" - }, - { - "id": "Belt.Set.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new set by taking in the comparator\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.make(~id=module(IntCmp))\n\nBelt.Set.isEmpty(set) == true\n```" - ], - "signature": "let make: (~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\ns0->Belt.Set.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let fromArray: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [ - "The same as [fromArray][#fromarray] except it is after assuming the input array\nis already sorted." - ], - "signature": "let fromSortedArrayUnsafe: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.Set.fromArray([], ~id=module(IntCmp))\nlet notEmpty = Belt.Set.fromArray([1], ~id=module(IntCmp))\n\nBelt.Set.isEmpty(empty) == true\nBelt.Set.isEmpty(notEmpty) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.Set.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if element exists in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.fromArray([1, 4, 2, 5], ~id=module(IntCmp))\n\nset->Belt.Set.has(3) == false\nset->Belt.Set.has(1) == true\n```" - ], - "signature": "let has: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.Set.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\n\nlet s1 = s0->Belt.Set.add(1)\nlet s2 = s1->Belt.Set.add(2)\nlet s3 = s2->Belt.Set.add(2)\n\ns0->Belt.Set.toArray == []\ns1->Belt.Set.toArray == [1]\ns2->Belt.Set.toArray == [1, 2]\ns3->Belt.Set.toArray == [1, 2]\ns2 == s3\n```" - ], - "signature": "let add: (t<'value, 'id>, 'value) => t<'value, 'id>" - }, - { - "id": "Belt.Set.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "Adds each element of array to set. Unlike `Belt.Set.add`\\](\\#add), the reference of return value might be changed even if all values in array already exist in set\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.make(~id=module(IntCmp))\n\nlet newSet = set->Belt.Set.mergeMany([5, 4, 3, 2, 1])\n\nnewSet->Belt.Set.toArray == [1, 2, 3, 4, 5]\n```" - ], - "signature": "let mergeMany: (t<'value, 'id>, array<'value>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([2, 3, 1, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.Set.remove(1)\nlet s2 = s1->Belt.Set.remove(3)\nlet s3 = s2->Belt.Set.remove(3)\n\ns1->Belt.Set.toArray == [2, 3, 4, 5]\ns2->Belt.Set.toArray == [2, 4, 5]\ns2 == s3\n```" - ], - "signature": "let remove: (t<'value, 'id>, 'value) => t<'value, 'id>" - }, - { - "id": "Belt.Set.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "Removes each element of array from set. Unlike [remove](#remove), the reference of return value might be changed even if none of values in array existed in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\nlet newSet = set->Belt.Set.removeMany([5, 4, 3, 2, 1])\n\nnewSet->Belt.Set.toArray == []\n```" - ], - "signature": "let removeMany: (t<'value, 'id>, array<'value>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet union = Belt.Set.union(s0, s1)\n\nunion->Belt.Set.toArray == [1, 2, 3, 4, 5, 6]\n```" - ], - "signature": "let union: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\n\nlet intersect = Belt.Set.intersect(s0, s1)\n\nintersect->Belt.Set.toArray == [2, 3, 5]\n```" - ], - "signature": "let intersect: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.diff", - "kind": "value", - "name": "diff", - "docstrings": [ - "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\n\nBelt.Set.diff(s0, s1)->Belt.Set.toArray == [6]\n\nBelt.Set.diff(s1, s0)->Belt.Set.toArray == [1, 4]\n```" - ], - "signature": "let diff: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet s2 = Belt.Set.intersect(s0, s1)\n\nBelt.Set.subset(s2, s0) == true\nBelt.Set.subset(s2, s1) == true\nBelt.Set.subset(s1, s0) == false\n```" - ], - "signature": "let subset: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.Set.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets. It compares size first and then iterates over each element following\nthe order of elements." - ], - "signature": "let cmp: (t<'value, 'id>, t<'value, 'id>) => int" - }, - { - "id": "Belt.Set.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 5], ~id=module(IntCmp))\n\nBelt.Set.eq(s0, s1) == true\n```" - ], - "signature": "let eq: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.Set.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as [forEach](#forEach) but takes uncurried functon." - ], - "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\n\nlet acc = ref(list{})\n\ns0->Belt.Set.forEach(x => {\n acc := Belt.List.add(acc.contents, x)\n})\n\nacc.contents == list{6, 5, 3, 2}\n```" - ], - "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit" - }, - { - "id": "Belt.Set.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\ns0->Belt.Set.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) == list{6, 5, 3, 2}\n```" - ], - "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a" - }, - { - "id": "Belt.Set.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.fromArray([2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.Set.every(isEven) == true\n```" - ], - "signature": "let every: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.fromArray([1, 2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.Set.some(isOdd) == true\n```" - ], - "signature": "let some: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.Set.keep(isEven)\n\ns1->Belt.Set.toArray == [2, 4]\n```" - ], - "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>" - }, - { - "id": "Belt.Set.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "Returns a pair of sets, where first is the set of all the elements of set that satisfy the predicate, and second is the set of all the elements of set that do not satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet (s1, s2) = s0->Belt.Set.partition(isOdd)\n\ns1->Belt.Set.toArray == [1, 3, 5]\ns2->Belt.Set.toArray == [2, 4]\n```" - ], - "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)" - }, - { - "id": "Belt.Set.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\ns0->Belt.Set.size == 4\n```" - ], - "signature": "let size: t<'value, 'id> => int" - }, - { - "id": "Belt.Set.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.toArray == [1, 2, 3, 5]\n```" - ], - "signature": "let toArray: t<'value, 'id> => array<'value>" - }, - { - "id": "Belt.Set.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.toList == list{1, 2, 3, 5}\n```" - ], - "signature": "let toList: t<'value, 'id> => list<'value>" - }, - { - "id": "Belt.Set.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.minimum == None\ns1->Belt.Set.minimum == Some(1)\n```" - ], - "signature": "let minimum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "Returns minimum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.minUndefined->Js.Undefined.toOption == None\ns1->Belt.Set.minUndefined->Js.Undefined.toOption == Some(1)\n```" - ], - "signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.maximum == None\ns1->Belt.Set.maximum == Some(5)\n```" - ], - "signature": "let maximum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "Returns maximum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0\n->Belt.Set.maxUndefined\n->Js.Undefined.toOption == None\n\ns1\n->Belt.Set.maxUndefined\n->Js.Undefined.toOption == Some(5)\n```" - ], - "signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the reference of the value which is equivalent to value using the comparator specifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.get(3) == Some(3)\ns0->Belt.Set.get(20) == None\n```" - ], - "signature": "let get: (t<'value, 'id>, 'value) => option<'value>" - }, - { - "id": "Belt.Set.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "Same as [get](#get) but returns `undefined` when element does not exist." - ], - "signature": "let getUndefined: (t<'value, 'id>, 'value) => Js.undefined<'value>" - }, - { - "id": "Belt.Set.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getExn: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.Set.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getOrThrow: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.Set.split", - "kind": "value", - "name": "split", - "docstrings": [ - "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\nlet ((smaller, larger), present) = s0->Belt.Set.split(3)\n\npresent == true\nsmaller->Belt.Set.toArray == [1, 2]\nlarger->Belt.Set.toArray == [4, 5]\n```" - ], - "signature": "let split: (\n t<'value, 'id>,\n 'value,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)" - }, - { - "id": "Belt.Set.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b> => unit" - }, - { - "id": "Belt.Set.getData", - "kind": "value", - "name": "getData", - "docstrings": [ - "**Advanced usage only**\n\nReturns the raw data (detached from comparator), but its type is still manifested,\nso that user can pass identity directly without boxing." - ], - "signature": "let getData: t<'value, 'id> => Belt_SetDict.t<'value, 'id>" - }, - { - "id": "Belt.Set.getId", - "kind": "value", - "name": "getId", - "docstrings": [ - "**Advanced usage only**\n\nReturns the identity of set." - ], - "signature": "let getId: t<'value, 'id> => id<'value, 'id>" - }, - { - "id": "Belt.Set.packIdData", - "kind": "value", - "name": "packIdData", - "docstrings": [ - "**Advanced usage only**\n\nReturns the packed collection." - ], - "signature": "let packIdData: (\n ~id: id<'value, 'id>,\n ~data: Belt_SetDict.t<'value, 'id>,\n) => t<'value, 'id>" - } - ] - }, - "belt/range": { - "id": "Belt.Range", - "name": "Range", - "docstrings": [ - "[`Belt.Range`]()\n\n Utilities for a closed range `(from, start)`", - "A small utility module to provide inclusive range operations for `[start, finish]`.\nInternally it is relying on loops instead of creating new arrays, which makes it\npretty performant and memory friendly." - ], - "items": [ - { - "id": "Belt.Range.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (int, int, int => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Range.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(start, finish, action)` equivalent to `Belt.Array.forEach(Belt.Array.range(start, finish), action))`\n\n## Examples\n\n```rescript\nBelt.Range.forEach(0, 4, i => Js.log(i))\n\n// Prints:\n// 0\n// 1\n// 2\n// 3\n// 4\n```" - ], - "signature": "let forEach: (int, int, int => unit) => unit" - }, - { - "id": "Belt.Range.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (int, int, int => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Range.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(start, finish, p)` equivalent to `Belt.Array.every(Belt.Array.range(start, finish), p)`\n## Examples\n\n```rescript\nBelt.Range.every(0, 4, i => i < 5) == true\n\nBelt.Range.every(0, 4, i => i < 4) == false\n```" - ], - "signature": "let every: (int, int, int => bool) => bool" - }, - { - "id": "Belt.Range.everyByU", - "kind": "value", - "name": "everyByU", - "docstrings": [], - "signature": "let everyByU: (int, int, ~step: int, int => bool) => bool", - "deprecated": "Use `everyBy` instead" - }, - { - "id": "Belt.Range.everyBy", - "kind": "value", - "name": "everyBy", - "docstrings": [ - "`everyBy(start, finish, ~step, p)`. See `Belt.Array.rangeBy`, equivalent to\n`Belt.Array.every(Belt.Array.rangeBy(start, finish, ~step), p)`\n\n## Examples\n\n```rescript\nBelt.Range.everyBy(0, 4, ~step=1, i => mod(i, 2) === 0) == false\n\nBelt.Range.everyBy(0, 4, ~step=2, i => mod(i, 2) === 0) == true\n```" - ], - "signature": "let everyBy: (int, int, ~step: int, int => bool) => bool" - }, - { - "id": "Belt.Range.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (int, int, int => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Range.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(start, finish, p)` equivalent to `Belt.Array.some(Belt.Array.range(start, finish), p)`\n\n## Examples\n\n```rescript\nBelt.Range.some(0, 4, i => i > 5) == false\n\nBelt.Range.some(0, 4, i => i > 2) == true\n```" - ], - "signature": "let some: (int, int, int => bool) => bool" - }, - { - "id": "Belt.Range.someByU", - "kind": "value", - "name": "someByU", - "docstrings": [], - "signature": "let someByU: (int, int, ~step: int, int => bool) => bool", - "deprecated": "Use `someBy` instead" - }, - { - "id": "Belt.Range.someBy", - "kind": "value", - "name": "someBy", - "docstrings": [ - "`someBy(start, finish, ~step, p)` See `Belt.Array.rangeBy`, equivalent to\n`Belt.Array.some(Belt.Array.rangeBy(start, finish, ~step), p)`\n\n## Examples\n\n```rescript\nBelt.Range.someBy(1, 5, ~step=2, i => mod(i, 2) === 0) == false\nBelt.Range.someBy(0, 4, ~step=2, i => mod(i, 2) === 0) == true\n```" - ], - "signature": "let someBy: (int, int, ~step: int, int => bool) => bool" - } - ] - }, - "belt/list": { - "id": "Belt.List", - "name": "List", - "docstrings": [ - "[`Belt.List`]()\n\n Utilities for List data type", - "Collection functions for manipulating the `list` data structures, a singly-linked list.\n\n**Prefer Array** if you need any of the following:\n\n- Random access of element\n- Better interop with JavaScript\n- Better memory usage & performance." - ], - "items": [ - { - "id": "Belt.List.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'a t` is compatible with built-in `list` type" - ], - "signature": "type t<'a> = list<'a>" - }, - { - "id": "Belt.List.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Returns the length of a list.\n\n## Examples\n\n```rescript\nBelt.List.length(list{1, 2, 3}) == 3\n```" - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Belt.List.size", - "kind": "value", - "name": "size", - "docstrings": [ - "See `Belt.List.length`" - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.List.head", - "kind": "value", - "name": "head", - "docstrings": [ - "Returns `Some(value)` where `value` is the first element in the list, or\n`None` if `someList` is an empty list.\n\n## Examples\n\n```rescript\nBelt.List.head(list{}) == None\nBelt.List.head(list{1, 2, 3}) == Some(1)\n```" - ], - "signature": "let head: t<'a> => option<'a>" - }, - { - "id": "Belt.List.headExn", - "kind": "value", - "name": "headExn", - "docstrings": [ - "Same as `Belt.List.head` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.headExn(list{1, 2, 3}) == 1\n\nswitch Belt.List.headExn(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let headExn: t<'a> => 'a" - }, - { - "id": "Belt.List.headOrThrow", - "kind": "value", - "name": "headOrThrow", - "docstrings": [ - "Same as `Belt.List.head` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.headOrThrow(list{1, 2, 3}) == 1\n\nswitch Belt.List.headOrThrow(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let headOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.List.tail", - "kind": "value", - "name": "tail", - "docstrings": [ - "Returns `None` if `someList` is empty, otherwise it returns `Some(tail)`\nwhere `tail` is everything except the first element of `someList`.\n\n## Examples\n\n```rescript\nBelt.List.tail(list{1, 2, 3}) == Some(list{2, 3})\n\nBelt.List.tail(list{}) == None\n```" - ], - "signature": "let tail: t<'a> => option>" - }, - { - "id": "Belt.List.tailExn", - "kind": "value", - "name": "tailExn", - "docstrings": [ - "Same as `Belt.List.tail` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.tailExn(list{1, 2, 3}) == list{2, 3}\n\nswitch Belt.List.tailExn(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let tailExn: t<'a> => t<'a>" - }, - { - "id": "Belt.List.tailOrThrow", - "kind": "value", - "name": "tailOrThrow", - "docstrings": [ - "Same as `Belt.List.tail` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.tailOrThrow(list{1, 2, 3}) == list{2, 3}\n\nswitch Belt.List.tailOrThrow(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let tailOrThrow: t<'a> => t<'a>" - }, - { - "id": "Belt.List.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds `value` to the beginning of `someList`.\n\n## Examples\n\n```rescript\nBelt.List.add(list{2, 3}, 1) // list{1, 2, 3}\n\nBelt.List.add(list{\"World\", \"!\"}, \"Hello\") == list{\"Hello\", \"World\", \"!\"}\n```" - ], - "signature": "let add: (t<'a>, 'a) => t<'a>" - }, - { - "id": "Belt.List.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Return the nth element in `someList`, or `None` if `index` is larger than the\nlength.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.get(1) == Some(\"B\")\n\nabc->Belt.List.get(4) == None\n```" - ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, - { - "id": "Belt.List.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as `Belt.List.get` but throws an exception if `index` is larger than the\nlength. Use with care.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.getExn(1) == \"B\"\n\nswitch abc->Belt.List.getExn(4) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getExn: (t<'a>, int) => 'a" - }, - { - "id": "Belt.List.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as `Belt.List.get` but throws an exception if `index` is larger than the\nlength. Use with care.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.getOrThrow(1) == \"B\"\n\nswitch abc->Belt.List.getOrThrow(4) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getOrThrow: (t<'a>, int) => 'a" - }, - { - "id": "Belt.List.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a list of length `numItems` with each element filled with value `v`. Returns an empty list if `numItems` is negative.\n\n## Examples\n\n```rescript\nBelt.List.make(3, 1) == list{1, 1, 1}\n```" - ], - "signature": "let make: (int, 'a) => t<'a>" - }, - { - "id": "Belt.List.makeByU", - "kind": "value", - "name": "makeByU", - "docstrings": [ - "Uncurried version of [makeBy](#makeBy)" - ], - "signature": "let makeByU: (int, int => 'a) => t<'a>", - "deprecated": "Use `makeBy` instead" - }, - { - "id": "Belt.List.makeBy", - "kind": "value", - "name": "makeBy", - "docstrings": [ - "Return a list of length `numItems` with element `i` initialized with `f(i)`.\nReturns an empty list if `numItems` is negative.\n\n## Examples\n\n```rescript\nBelt.List.makeBy(5, i => i) == list{0, 1, 2, 3, 4}\n\nBelt.List.makeBy(5, i => i * i) == list{0, 1, 4, 9, 16}\n```" - ], - "signature": "let makeBy: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.List.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "Returns a new list in random order.\n\n## Examples\n\n```rescript\nBelt.List.shuffle(list{1, 2, 3}) // list{2, 1, 3}\n```" - ], - "signature": "let shuffle: t<'a> => t<'a>" - }, - { - "id": "Belt.List.drop", - "kind": "value", - "name": "drop", - "docstrings": [ - "Return a new list, dropping the first `n` elements. Returns `None` if `someList` has fewer than `n` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.drop(2) == Some(list{3})\n\nlist{1, 2, 3}->Belt.List.drop(3) == Some(list{})\n\nlist{1, 2, 3}->Belt.List.drop(4) == None\n```" - ], - "signature": "let drop: (t<'a>, int) => option>" - }, - { - "id": "Belt.List.take", - "kind": "value", - "name": "take", - "docstrings": [ - "Returns a list with the first `n` elements from `someList`, or `None` if `someList` has fewer than `n` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.take(1) == Some(list{1})\n\nlist{1, 2, 3}->Belt.List.take(2) == Some(list{1, 2})\n\nlist{1, 2, 3}->Belt.List.take(4) == None\n```" - ], - "signature": "let take: (t<'a>, int) => option>" - }, - { - "id": "Belt.List.splitAt", - "kind": "value", - "name": "splitAt", - "docstrings": [ - "Split the list `someList` at `index`. Returns `None` when the length of `someList` is less than `index`.\n\n## Examples\n\n```rescript\nlist{\"Hello\", \"World\"}->Belt.List.splitAt(1) == Some((list{\"Hello\"}, list{\"World\"}))\n\nlist{0, 1, 2, 3, 4}->Belt.List.splitAt(2) == Some((list{0, 1}, list{2, 3, 4}))\n```" - ], - "signature": "let splitAt: (t<'a>, int) => option<(list<'a>, list<'a>)>" - }, - { - "id": "Belt.List.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "Returns the list obtained by adding `secondList` after `firstList`.\n\n## Examples\n\n```rescript\nBelt.List.concat(list{1, 2, 3}, list{4, 5}) == list{1, 2, 3, 4, 5}\n```" - ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Belt.List.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "Returns the list obtained by concatenating all the lists in array `a`, in\norder.\n\n## Examples\n\n```rescript\nBelt.List.concatMany([list{1, 2, 3}, list{}, list{3}]) == list{1, 2, 3, 3}\n```" - ], - "signature": "let concatMany: array> => t<'a>" - }, - { - "id": "Belt.List.reverseConcat", - "kind": "value", - "name": "reverseConcat", - "docstrings": [ - "Equivalent to writing: `concat(reverse(firstList, secondList)`\n\n## Examples\n\n```rescript\nBelt.List.reverseConcat(list{1, 2}, list{3, 4}) == list{2, 1, 3, 4}\n```" - ], - "signature": "let reverseConcat: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Belt.List.flatten", - "kind": "value", - "name": "flatten", - "docstrings": [ - "Return the list obtained by concatenating all the lists in list `ls`, in order.\n\n## Examples\n\n```rescript\nBelt.List.flatten(list{list{1, 2, 3}, list{}, list{3}}) == list{1, 2, 3, 3}\n```" - ], - "signature": "let flatten: t> => t<'a>" - }, - { - "id": "Belt.List.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [ - "Uncurried version of [map](#map)." - ], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.List.map", - "kind": "value", - "name": "map", - "docstrings": [ - "Returns a new list with `f` applied to each element of `someList`.\n\n## Examples\n\n```rescript\nlist{1, 2}->Belt.List.map(x => x + 1) == list{2, 3}\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.List.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "Returns a list of pairs from the two lists with the length of the shorter list.\n\n## Examples\n\n```rescript\nBelt.List.zip(list{1, 2}, list{3, 4, 5}) == list{(1, 3), (2, 4)}\n```" - ], - "signature": "let zip: (t<'a>, t<'b>) => t<('a, 'b)>" - }, - { - "id": "Belt.List.zipByU", - "kind": "value", - "name": "zipByU", - "docstrings": [ - "Uncurried version of [zipBy](#zipBy)." - ], - "signature": "let zipByU: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>", - "deprecated": "Use `zipBy` instead" - }, - { - "id": "Belt.List.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "See [Belt.List.zip](#zip)\n\n## Examples\n\n```rescript\nBelt.List.zipBy(list{1, 2, 3}, list{4, 5}, (a, b) => 2 * a + b) == list{6, 9}\n```" - ], - "signature": "let zipBy: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>" - }, - { - "id": "Belt.List.mapWithIndexU", - "kind": "value", - "name": "mapWithIndexU", - "docstrings": [ - "Uncurried version of [mapWithIndex](#mapWithIndex)." - ], - "signature": "let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => t<'b>", - "deprecated": "Use `mapWithIndex` instead" - }, - { - "id": "Belt.List.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "Applies `f` to each element of `someList`.\nFunction `f` takes two arguments: the index starting from 0 and the element from `someList`, in that order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.mapWithIndex((index, x) => index + x) == list{1, 3, 5}\n```" - ], - "signature": "let mapWithIndex: (t<'a>, (int, 'a) => 'b) => t<'b>" - }, - { - "id": "Belt.List.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Converts the given array to a list.\n\n## Examples\n\n```rescript\nBelt.List.fromArray([1, 2, 3]) == list{1, 2, 3}\n```" - ], - "signature": "let fromArray: array<'a> => t<'a>" - }, - { - "id": "Belt.List.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Converts the given list to an array.\n\n## Examples\n\n```rescript\nBelt.List.toArray(list{1, 2, 3}) == [1, 2, 3]\n```" - ], - "signature": "let toArray: t<'a> => array<'a>" - }, - { - "id": "Belt.List.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "Returns a new list whose elements are those of `someList` in reversed order.\n\n## Examples\n\n```rescript\nBelt.List.reverse(list{1, 2, 3}) == list{3, 2, 1}\n```" - ], - "signature": "let reverse: t<'a> => t<'a>" - }, - { - "id": "Belt.List.mapReverseU", - "kind": "value", - "name": "mapReverseU", - "docstrings": [ - "Uncurried version of [mapReverse](#mapReverse)." - ], - "signature": "let mapReverseU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `mapReverse` instead" - }, - { - "id": "Belt.List.mapReverse", - "kind": "value", - "name": "mapReverse", - "docstrings": [ - "Equivalent to `Belt.List.map(someList, f)->Belt.List.reverse`\n\n## Examples\n\n```rescript\nlist{3, 4, 5}->Belt.List.mapReverse(x => x * x) == list{25, 16, 9}\n```" - ], - "signature": "let mapReverse: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.List.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Uncurried version of [forEach](#forEach)." - ], - "signature": "let forEachU: (t<'a>, 'a => 'b) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.List.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Call `f` on each element of `someList` from the beginning to end.\n`f` returns `unit`, so no new array is created. Use `forEach` when you are primarily concerned with repetitively creating side effects.\n\n## Examples\n\n```rescript\nBelt.List.forEach(list{\"a\", \"b\", \"c\"}, x => Js.log(\"Item: \" ++ x))\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\n```" - ], - "signature": "let forEach: (t<'a>, 'a => 'b) => unit" - }, - { - "id": "Belt.List.forEachWithIndexU", - "kind": "value", - "name": "forEachWithIndexU", - "docstrings": [ - "Uncurried version of [forEachWithIndex](#forEachWithIndex)." - ], - "signature": "let forEachWithIndexU: (t<'a>, (int, 'a) => 'b) => unit", - "deprecated": "Use `forEachWithIndex` instead" - }, - { - "id": "Belt.List.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "Call `f` on each element of `someList` from beginning to end.\nFunction `f` takes two arguments: the index starting from 0 and the element from `someList`. `f` returns `unit`.\n\n## Examples\n\n```rescript\nBelt.List.forEachWithIndex(list{\"a\", \"b\", \"c\"}, (index, x) => {\n Js.log(\"Item \" ++ Belt.Int.toString(index) ++ \" is \" ++ x)\n})\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\n```" - ], - "signature": "let forEachWithIndex: (t<'a>, (int, 'a) => 'b) => unit" - }, - { - "id": "Belt.List.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [ - "Uncurried version of [reduce](#reduce)." - ], - "signature": "let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.List.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies `f` to each element of `someList` from beginning to end. Function `f` has two parameters: the item from the list and an “accumulator”, which starts with a value of `initialValue`. reduce returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduce(0, (a, b) => a + b) == 10\n\n/* same as */\n\nlist{1, 2, 3, 4}->Belt.List.reduce(0, (acc, item) => acc + item) == 10\n```" - ], - "signature": "let reduce: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Belt.List.reduceWithIndexU", - "kind": "value", - "name": "reduceWithIndexU", - "docstrings": [ - "Uncurried version of [reduceWithIndex](#reduceWithIndex)." - ], - "signature": "let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b", - "deprecated": "Use `reduceWithIndex` instead" - }, - { - "id": "Belt.List.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "Applies `f` to each element of `someList` from beginning to end. Function `f` has three parameters: the item from the list and an “accumulator”, which starts with a value of `initialValue` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduceWithIndex(0, (acc, item, index) => acc + item + index) == 16\n```" - ], - "signature": "let reduceWithIndex: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Belt.List.reduceReverseU", - "kind": "value", - "name": "reduceReverseU", - "docstrings": [ - "Uncurried version of [reduceReverse](#reduceReverse)." - ], - "signature": "let reduceReverseU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b", - "deprecated": "Use `reduceReverse` instead" - }, - { - "id": "Belt.List.reduceReverse", - "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "Works like [reduce](#reduce), except that function `f` is applied to each\nitem of `someList` from the last back to the first.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(0, (a, b) => a + b) == 10\n\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(10, (a, b) => a - b) == 0\n\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(list{}, Belt.List.add) == list{1, 2, 3, 4}\n```" - ], - "signature": "let reduceReverse: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Belt.List.mapReverse2U", - "kind": "value", - "name": "mapReverse2U", - "docstrings": [ - "Uncurried version of [mapReverse2](#mapReverse2)." - ], - "signature": "let mapReverse2U: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>", - "deprecated": "Use `mapReverse2` instead" - }, - { - "id": "Belt.List.mapReverse2", - "kind": "value", - "name": "mapReverse2", - "docstrings": [ - "Equivalent to: `zipBy(xs, ys, f)->reverse`\n\n## Examples\n\n```rescript\nBelt.List.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) == list{4, 2}\n```" - ], - "signature": "let mapReverse2: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>" - }, - { - "id": "Belt.List.forEach2U", - "kind": "value", - "name": "forEach2U", - "docstrings": [ - "Uncurried version of [forEach2](#forEach2)." - ], - "signature": "let forEach2U: (t<'a>, t<'b>, ('a, 'b) => 'c) => unit", - "deprecated": "Use `forEach2` instead" - }, - { - "id": "Belt.List.forEach2", - "kind": "value", - "name": "forEach2", - "docstrings": [ - "Stops at the length of the shorter list.\n\n## Examples\n\n```rescript\nBelt.List.forEach2(list{\"Z\", \"Y\"}, list{\"A\", \"B\", \"C\"}, (x, y) => Js.log2(x, y))\n\n/*\n prints:\n \"Z\" \"A\"\n \"Y\" \"B\"\n*/\n```" - ], - "signature": "let forEach2: (t<'a>, t<'b>, ('a, 'b) => 'c) => unit" - }, - { - "id": "Belt.List.reduce2U", - "kind": "value", - "name": "reduce2U", - "docstrings": [ - "Uncurried version of [reduce2](#reduce2)." - ], - "signature": "let reduce2U: (t<'b>, t<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a", - "deprecated": "Use `reduce2` instead" - }, - { - "id": "Belt.List.reduce2", - "kind": "value", - "name": "reduce2", - "docstrings": [ - "Applies `f` to each element of `firstList` and `secondList` from beginning to end. Stops with the shorter list. Function `f` has three parameters: an “accumulator” which starts with a value of `initialValue`, an item from `firstList`, and an item from `secondList`. `reduce2` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nBelt.List.reduce2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduce2: (t<'b>, t<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a" - }, - { - "id": "Belt.List.reduceReverse2U", - "kind": "value", - "name": "reduceReverse2U", - "docstrings": [ - "Uncurried version of [reduceReverse2](#reduceReverse2)." - ], - "signature": "let reduceReverse2U: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c", - "deprecated": "Use `reduceReverse2` instead" - }, - { - "id": "Belt.List.reduceReverse2", - "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "Applies `f` to each element of `firstList` and `secondList` from end to\nbeginning. Stops with the shorter list. Function `f` has three parameters: an\n“accumulator” which starts with a value of init, an item from `firstList`,\nand an item from `secondList`. `reduce2` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nBelt.List.reduceReverse2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduceReverse2: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" - }, - { - "id": "Belt.List.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [ - "Uncurried version of [every](#every)." - ], - "signature": "let everyU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.List.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Returns `true` if all elements satisfy `pred`, where `pred` is a predicate: a function taking an element and returning a bool.\n\n## Examples\n\n```rescript\nlet isBelow10 = value => value < 10\n\nlist{1, 9, 8, 2}->Belt.List.every(isBelow10) == true\n\nlist{1, 99, 8, 2}->Belt.List.every(isBelow10) == false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.List.someU", - "kind": "value", - "name": "someU", - "docstrings": [ - "Uncurried version of [some](#some)." - ], - "signature": "let someU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.List.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Returns `true` if at least _one_ of the elements in `someList` satisfies\n`pred`, where `pred` is a predicate: a function taking an element and\nreturning a bool.\n\n## Examples\n\n```rescript\nlet isAbove100 = value => value > 100\n\nlist{101, 1, 2, 3}->Belt.List.some(isAbove100) == true\n\nlist{1, 2, 3, 4}->Belt.List.some(isAbove100) == false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.List.every2U", - "kind": "value", - "name": "every2U", - "docstrings": [ - "Uncurried version of [every2](#every2)." - ], - "signature": "let every2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `every2` instead" - }, - { - "id": "Belt.List.every2", - "kind": "value", - "name": "every2", - "docstrings": [ - "Returns `true` if predicate `pred(a, b)` is `true` for all pairs of elements\nup to the shorter length (i.e. `min(length(firstList), length(secondList))`)\n\n## Examples\n\n```rescript\nBelt.List.every2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nBelt.List.every2(list{}, list{1}, (a, b) => a > b) == true\n\nBelt.List.every2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nBelt.List.every2(list{0, 1}, list{5, 0}, (a, b) => a > b) == false\n```" - ], - "signature": "let every2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.some2U", - "kind": "value", - "name": "some2U", - "docstrings": [ - "Uncurried version of [some2](#some2)." - ], - "signature": "let some2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `some2` instead" - }, - { - "id": "Belt.List.some2", - "kind": "value", - "name": "some2", - "docstrings": [ - "Returns `true` if predicate `pred(a, b)` is true for any pair of elements up\nto the shorter length (i.e. `min(length(firstList), length(secondList))`)\n\n## Examples\n\n```rescript\nBelt.List.some2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nBelt.List.some2(list{}, list{1}, (a, b) => a > b) == false\n\nBelt.List.some2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nBelt.List.some2(list{0, 1}, list{5, 0}, (a, b) => a > b) == true\n```" - ], - "signature": "let some2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.cmpByLength", - "kind": "value", - "name": "cmpByLength", - "docstrings": [ - "Compare two lists solely by length. Returns `-1` if `length(firstList)` is\nless than `length(secondList)`, `0` if `length(firstList)` equals\n`length(secondList)`, and `1` if `length(firstList)` is greater than\n`length(secondList)`.\n\n## Examples\n\n```rescript\nBelt.List.cmpByLength(list{1, 2}, list{3, 4, 5, 6}) == -1\n\nBelt.List.cmpByLength(list{1, 2, 3}, list{4, 5, 6}) == 0\n\nBelt.List.cmpByLength(list{1, 2, 3, 4}, list{5, 6}) == 1\n```" - ], - "signature": "let cmpByLength: (t<'a>, t<'a>) => int" - }, - { - "id": "Belt.List.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [ - "Uncurried version of [cmp](#cmp)." - ], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.List.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Compare elements one by one `compareFn(a, b)`. `compareFn` returns a negative number if `a` is \"less than\" `b`, zero if `a` is \"equal to\" `b`, a positive number if `a` is \"greater than\" `b`.\n\nThe comparison returns the first non-zero result of `compareFn`, or zero if `compareFn` returns zero for all `a` and `b`.\n\nIf all items have compared equal, but `firstList` is exhausted first, return `-1`. (`firstList` is shorter).\nIf all items have compared equal, but `secondList` is exhausted first, return `1` (`firstList` is longer).\n\n## Examples\n\n```rescript\nBelt.List.cmp(list{3}, list{3, 7}, (a, b) => compare(a, b)) == -1\n\nBelt.List.cmp(list{5, 3}, list{5}, (a, b) => compare(a, b)) == 1\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 4, 2}, (a, b) => compare(a, b)) == -1\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 2, 3}, (a, b) => compare(a, b)) == 1\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 3, 5}, (a, b) => compare(a, b)) == 0\n```\n\n**Please note:** The total ordering of List is different from Array,\nfor Array, we compare the length first and, only if the lengths are equal, elements one by one.\nFor lists, we just compare elements one by one." - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.List.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [ - "Uncurried version of [eq](#eq)." - ], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.List.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Check equality of `firstList` and `secondList` using `eqElem` for equality on\nelements, where `eqElem` is a function that returns `true` if items `x` and\n`y` meet some criterion for equality, `false` otherwise. eq `false` if length\nof `firstList` and `secondList` are not the same.\n\n## Examples\n\n```rescript\nBelt.List.eq(list{1, 2, 3}, list{1, 2}, (a, b) => a == b) == false\n\nBelt.List.eq(list{1, 2}, list{1, 2}, (a, b) => a == b) == true\n\nBelt.List.eq(list{1, 2, 3}, list{-1, -2, -3}, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.List.hasU", - "kind": "value", - "name": "hasU", - "docstrings": [ - "Uncurried version of [has](#has)." - ], - "signature": "let hasU: (t<'a>, 'b, ('a, 'b) => bool) => bool", - "deprecated": "Use `has` instead" - }, - { - "id": "Belt.List.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Returns `true` if the list contains at least one element for which\n`eqFunction(x)` returns true.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.has(2, (a, b) => a == b) == true\n\nlist{1, 2, 3}->Belt.List.has(4, (a, b) => a == b) == false\n\nlist{-1, -2, -3}->Belt.List.has(2, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let has: (t<'a>, 'b, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.getByU", - "kind": "value", - "name": "getByU", - "docstrings": [ - "Uncurried version of [getBy](#getBy)." - ], - "signature": "let getByU: (t<'a>, 'a => bool) => option<'a>", - "deprecated": "Use `getBy` instead" - }, - { - "id": "Belt.List.getBy", - "kind": "value", - "name": "getBy", - "docstrings": [ - "Returns `Some(value)` for the first value in `someList` that satisfies the\npredicate function `pred`. Returns `None` if no element satisfies the function.\n\n## Examples\n\n```rescript\nBelt.List.getBy(list{1, 4, 3, 2}, x => x > 3) == Some(4)\n\nBelt.List.getBy(list{1, 4, 3, 2}, x => x > 4) == None\n```" - ], - "signature": "let getBy: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Belt.List.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [ - "Uncurried version of [keep](#keep)." - ], - "signature": "let keepU: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.List.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.keep(list{1, 2, 3, 4}, isEven) == list{2, 4}\n\nBelt.List.keep(list{None, Some(2), Some(3), None}, Belt.Option.isSome) == list{Some(2), Some(3)}\n```" - ], - "signature": "let keep: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Belt.List.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.filter(list{1, 2, 3, 4}, isEven) == list{2, 4}\n\nBelt.List.filter(list{None, Some(2), Some(3), None}, Belt.Option.isSome) == list{Some(2), Some(3)}\n```" - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "This function will soon be deprecated. Please, use `List.keep` instead." - }, - { - "id": "Belt.List.keepWithIndexU", - "kind": "value", - "name": "keepWithIndexU", - "docstrings": [ - "Uncurried version of [keepWithIndex](#keepWithIndex)." - ], - "signature": "let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "Use `keepWithIndex` instead" - }, - { - "id": "Belt.List.keepWithIndex", - "kind": "value", - "name": "keepWithIndex", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.keepWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) == list{1, 3}\n```" - ], - "signature": "let keepWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" - }, - { - "id": "Belt.List.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.filterWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) == list{1, 3}\n```" - ], - "signature": "let filterWithIndex: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "This function will soon be deprecated. Please, use `List.keepWithIndex` \\\n instead." - }, - { - "id": "Belt.List.keepMapU", - "kind": "value", - "name": "keepMapU", - "docstrings": [ - "Uncurried version of [keepMap](#keepMap)." - ], - "signature": "let keepMapU: (t<'a>, 'a => option<'b>) => t<'b>", - "deprecated": "Use `keepMap` instead" - }, - { - "id": "Belt.List.keepMap", - "kind": "value", - "name": "keepMap", - "docstrings": [ - "Applies `f` to each element of `someList`. If `f(x)` returns `Some(value)`, then `value` is _kept_ in the resulting list.\nIf `f(x)` returns `None`, the element is _not_ retained in the result.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nlist{1, 2, 3, 4}->Belt.List.keepMap(x =>\n if isEven(x) {\n Some(x)\n } else {\n None\n }\n) /* list{2, 4} */\n\nlist{Some(1), Some(2), None}->Belt.List.keepMap(x => x) == list{1, 2}\n```" - ], - "signature": "let keepMap: (t<'a>, 'a => option<'b>) => t<'b>" - }, - { - "id": "Belt.List.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [ - "Uncurried version of [partition](#partition)." - ], - "signature": "let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.List.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "Creates a pair of lists; the first list consists of all elements of `someList` that satisfy the predicate function `pred`; the second list consists of all elements of `someList` that _do not_ satisfy \\`pred.\n\nIn other words:\n\n```\n(elementsThatSatisfies, elementsThatDoesNotSatisfy)\n```\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.partition(x => x > 2) == (list{3, 4}, list{1, 2})\n```" - ], - "signature": "let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)" - }, - { - "id": "Belt.List.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "Takes a list of pairs and creates a pair of lists. The first list contains all the first items of the pairs; the second list contains all the second items.\n\n## Examples\n\n```rescript\nBelt.List.unzip(list{(1, 2), (3, 4)}) == (list{1, 3}, list{2, 4})\n\nBelt.List.unzip(list{(\"H\", \"W\"), (\"e\", \"o\"), (\"l\", \"r\"), (\"l\", \"l\"), (\"o\", \"d\"), (\" \", \"!\")}) ==\n (list{\"H\", \"e\", \"l\", \"l\", \"o\", \" \"}, list{\"W\", \"o\", \"r\", \"l\", \"d\", \"!\"})\n```" - ], - "signature": "let unzip: t<('a, 'b)> => (t<'a>, t<'b>)" - }, - { - "id": "Belt.List.getAssocU", - "kind": "value", - "name": "getAssocU", - "docstrings": [ - "Uncurried version of [getAssoc](#getAssoc)." - ], - "signature": "let getAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>", - "deprecated": "Use `getAssoc` instead" - }, - { - "id": "Belt.List.getAssoc", - "kind": "value", - "name": "getAssoc", - "docstrings": [ - "Return the second element of a pair in `someList` where the first element equals `k` as per the predicate function `eqFunction`, or `None` if not found.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.getAssoc(3, (a, b) => a == b) /* Some(\"c\") */\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.getAssoc(15, (k, item) =>\n k /* 15 */ == item\n) == Some(\"afternoon\")\n/* 9, 5, 22 */\n```" - ], - "signature": "let getAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>" - }, - { - "id": "Belt.List.hasAssocU", - "kind": "value", - "name": "hasAssocU", - "docstrings": [ - "Uncurried version of [hasAssoc](#hasAssoc)." - ], - "signature": "let hasAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => bool", - "deprecated": "Use `hasAssoc` instead" - }, - { - "id": "Belt.List.hasAssoc", - "kind": "value", - "name": "hasAssoc", - "docstrings": [ - "Returns `true` if there is a pair in `someList` where the first element equals `k` as per the predicate function `eqFunction`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.hasAssoc(1, (a, b) => a == b) == true\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.hasAssoc(25, (k, item) =>\n k /* 25 */ == item\n) == false\n/* 9, 5, 22 */\n```" - ], - "signature": "let hasAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.removeAssocU", - "kind": "value", - "name": "removeAssocU", - "docstrings": [ - "Uncurried version of [removeAssoc](#removeAssoc)." - ], - "signature": "let removeAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => t<('a, 'c)>", - "deprecated": "Use `removeAssoc` instead" - }, - { - "id": "Belt.List.removeAssoc", - "kind": "value", - "name": "removeAssoc", - "docstrings": [ - "Return a list after removing the first pair whose first value is `k` per the equality predicate `eqFunction`; if not found, return a new list identical to `someList`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.removeAssoc(1, (a, b) => a == b) ==\n list{(2, \"b\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.removeAssoc(9, (k, item) =>\n k /* 9 */ == item\n) == list{(15, \"afternoon\"), (22, \"night\")}\n/* 9, 5, 22 */\n```" - ], - "signature": "let removeAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => t<('a, 'c)>" - }, - { - "id": "Belt.List.setAssocU", - "kind": "value", - "name": "setAssocU", - "docstrings": [ - "Uncurried version of [setAssoc](#setAssoc)." - ], - "signature": "let setAssocU: (t<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => t<('a, 'c)>", - "deprecated": "Use `setAssoc` instead" - }, - { - "id": "Belt.List.setAssoc", - "kind": "value", - "name": "setAssoc", - "docstrings": [ - "If `k` exists in `someList` by satisfying the `eqFunction` predicate, return a new list with the key and value replaced by the new `k` and `v`; otherwise, return a new list with the pair `k`, `v` added to the head of `someList`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.setAssoc(2, \"x\", (a, b) => a == b) ==\n list{(1, \"a\"), (2, \"x\"), (3, \"c\")}\n\nlist{(1, \"a\"), (3, \"c\")}->Belt.List.setAssoc(2, \"b\", (a, b) => a == b) ==\n list{(2, \"b\"), (1, \"a\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (3, \"morning?!\"), (22, \"night\")}->Belt.List.setAssoc(15, \"afternoon\", (a, b) =>\n mod(a, 12) == mod(b, 12)\n) == list{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n```\n\n**Please note**\n\nIn the last example, since: `15 mod 12` equals `3 mod 12`\n\nBoth the key _and_ the value are replaced in the list." - ], - "signature": "let setAssoc: (t<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => t<('a, 'c)>" - }, - { - "id": "Belt.List.sortU", - "kind": "value", - "name": "sortU", - "docstrings": [ - "Uncurried version of [sort](#sort)." - ], - "signature": "let sortU: (t<'a>, ('a, 'a) => int) => t<'a>", - "deprecated": "Use `sort` instead" - }, - { - "id": "Belt.List.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "Returns a sorted list.\n\n## Examples\n\n```rescript\nBelt.List.sort(list{5, 4, 9, 3, 7}, (a, b) => a - b) == list{3, 4, 5, 7, 9}\n```" - ], - "signature": "let sort: (t<'a>, ('a, 'a) => int) => t<'a>" - } - ] - }, - "belt/mutablestack": { - "id": "Belt.MutableStack", - "name": "MutableStack", - "docstrings": [ - "[`Belt.MutableStack`]()\n\n An FILO(first in last out) stack data structure", - "First in last out stack. This module implements stacks, with in-place\nmodification." - ], - "items": [ - { - "id": "Belt.MutableStack.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableStack.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a new stack, initially empty." - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableStack.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Discard all elements from the stack." - ], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableStack.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(x)` O(1) operation, return a new stack." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.MutableStack.push", - "kind": "value", - "name": "push", - "docstrings": [], - "signature": "let push: (t<'a>, 'a) => unit" - }, - { - "id": "Belt.MutableStack.popUndefined", - "kind": "value", - "name": "popUndefined", - "docstrings": [], - "signature": "let popUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableStack.pop", - "kind": "value", - "name": "pop", - "docstrings": [], - "signature": "let pop: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableStack.topUndefined", - "kind": "value", - "name": "topUndefined", - "docstrings": [], - "signature": "let topUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableStack.top", - "kind": "value", - "name": "top", - "docstrings": [], - "signature": "let top: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableStack.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableStack.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableStack.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableStack.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.MutableStack.dynamicPopIterU", - "kind": "value", - "name": "dynamicPopIterU", - "docstrings": [], - "signature": "let dynamicPopIterU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `dynamicPopIter` instead" - }, - { - "id": "Belt.MutableStack.dynamicPopIter", - "kind": "value", - "name": "dynamicPopIter", - "docstrings": [ - "`dynamicPopIter(s, f)` apply `f` to each element of `s`. The item is poped\nbefore applying `f`, `s` will be empty after this opeartion. This function is\nuseful for worklist algorithm." - ], - "signature": "let dynamicPopIter: (t<'a>, 'a => unit) => unit" - } - ] - }, - "belt/mutablequeue": { - "id": "Belt.MutableQueue", - "name": "MutableQueue", - "docstrings": [ - "[`Belt.MutableQueue`]()\n\n An FIFO(first in first out) queue data structure", - "A FIFO (first in first out) queue data structure." - ], - "items": [ - { - "id": "Belt.MutableQueue.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of queues containing elements of `type('a)`." - ], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableQueue.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a new queue, initially empty." - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableQueue.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Discard all elements from the queue." - ], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableQueue.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Returns `true` if the given queue is empty, `false` otherwise." - ], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableQueue.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` a is equivalent to `Array.forEach(a, add(q, a));`" - ], - "signature": "let fromArray: array<'a> => t<'a>" - }, - { - "id": "Belt.MutableQueue.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(q, x)` adds the element `x` at the end of the queue `q`." - ], - "signature": "let add: (t<'a>, 'a) => unit" - }, - { - "id": "Belt.MutableQueue.peek", - "kind": "value", - "name": "peek", - "docstrings": [ - "`peekOpt(q)` returns the first element in queue `q`, without removing it from the queue." - ], - "signature": "let peek: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableQueue.peekUndefined", - "kind": "value", - "name": "peekUndefined", - "docstrings": [ - "`peekUndefined(q)` returns `undefined` if not found." - ], - "signature": "let peekUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableQueue.peekExn", - "kind": "value", - "name": "peekExn", - "docstrings": [ - "`peekExn(q)` throws an exception if `q` is empty." - ], - "signature": "let peekExn: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.peekOrThrow", - "kind": "value", - "name": "peekOrThrow", - "docstrings": [ - "`peekOrThrow(q)` throws an exception if `q` is empty." - ], - "signature": "let peekOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "`pop(q)` removes and returns the first element in queue `q`." - ], - "signature": "let pop: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableQueue.popUndefined", - "kind": "value", - "name": "popUndefined", - "docstrings": [ - "`popUndefined(q)` removes and returns the first element in queue `q`. it will\nreturn `undefined` if it is already empty." - ], - "signature": "let popUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableQueue.popExn", - "kind": "value", - "name": "popExn", - "docstrings": [ - "`popExn(q)` throw an exception if q is empty." - ], - "signature": "let popExn: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.popOrThrow", - "kind": "value", - "name": "popOrThrow", - "docstrings": [ - "`popOrThrow(q)` throw an exception if q is empty." - ], - "signature": "let popOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(q)` returns a fresh queue." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.MutableQueue.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns the number of elements in a queue." - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableQueue.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableQueue.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.MutableQueue.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableQueue.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(q, f) applies`f`in turn to all elements of`q`, from the least\nrecently entered to the most recently entered. The queue itself is unchanged." - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.MutableQueue.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableQueue.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(q, accu, f)` is equivalent to `List.reduce(l, accu, f)`, where `l` is the\nlist of `q`'s elements. The queue remains unchanged." - ], - "signature": "let reduce: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableQueue.transfer", - "kind": "value", - "name": "transfer", - "docstrings": [ - "`transfer(q1, q2)` adds all of `q1`'s elements at the end of the queue `q2`,\nthen clears `q1`. It is equivalent to the sequence `forEach((x) => add(x, q2), q1)`;\nclear `q1`, but runs in constant time." - ], - "signature": "let transfer: (t<'a>, t<'a>) => unit" - }, - { - "id": "Belt.MutableQueue.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "First added will be in the beginning of the array." - ], - "signature": "let toArray: t<'a> => array<'a>" - } - ] - }, - "belt/sortarray": { - "id": "Belt.SortArray", - "name": "SortArray", - "docstrings": [ - "[`Belt.SortArray`]()\n\n The top level provides some generic sort related utilities.\n\n It also has two specialized inner modules\n [`Belt.SortArray.Int`]() and [`Belt.SortArray.String`]()", - "A module for Array sort relevant utiliites" - ], - "items": [ - { - "id": "Belt.SortArray.strictlySortedLengthU", - "kind": "value", - "name": "strictlySortedLengthU", - "docstrings": [], - "signature": "let strictlySortedLengthU: (array<'a>, ('a, 'a) => bool) => int", - "deprecated": "Use `strictlySortedLength` instead" - }, - { - "id": "Belt.SortArray.strictlySortedLength", - "kind": "value", - "name": "strictlySortedLength", - "docstrings": [ - "`strictlySortedLenght(xs, cmp);` return `+n` means increasing order `-n` means negative order\n\n## Examples\n\n```rescript\nBelt.SortArray.strictlySortedLength([1, 2, 3, 4, 3], (x, y) => x < y) == 4\n\nBelt.SortArray.strictlySortedLength([], (x, y) => x < y) == 0\n\nBelt.SortArray.strictlySortedLength([1], (x, y) => x < y) == 1\n\nBelt.SortArray.strictlySortedLength([4, 3, 2, 1], (x, y) => x < y) == -4\n```" - ], - "signature": "let strictlySortedLength: (array<'a>, ('a, 'a) => bool) => int" - }, - { - "id": "Belt.SortArray.isSortedU", - "kind": "value", - "name": "isSortedU", - "docstrings": [], - "signature": "let isSortedU: (array<'a>, ('a, 'a) => int) => bool", - "deprecated": "Use `isSorted` instead" - }, - { - "id": "Belt.SortArray.isSorted", - "kind": "value", - "name": "isSorted", - "docstrings": [ - "`isSorted(arr, cmp)`: Returns true if array is increasingly sorted (equal is okay)" - ], - "signature": "let isSorted: (array<'a>, ('a, 'a) => int) => bool" - }, - { - "id": "Belt.SortArray.stableSortInPlaceByU", - "kind": "value", - "name": "stableSortInPlaceByU", - "docstrings": [], - "signature": "let stableSortInPlaceByU: (array<'a>, ('a, 'a) => int) => unit", - "deprecated": "Use `stableSortInPlaceBy` instead" - }, - { - "id": "Belt.SortArray.stableSortInPlaceBy", - "kind": "value", - "name": "stableSortInPlaceBy", - "docstrings": [], - "signature": "let stableSortInPlaceBy: (array<'a>, ('a, 'a) => int) => unit" - }, - { - "id": "Belt.SortArray.stableSortByU", - "kind": "value", - "name": "stableSortByU", - "docstrings": [], - "signature": "let stableSortByU: (array<'a>, ('a, 'a) => int) => array<'a>", - "deprecated": "Use `stableSortBy` instead" - }, - { - "id": "Belt.SortArray.stableSortBy", - "kind": "value", - "name": "stableSortBy", - "docstrings": [ - "`stableSortBy(xs, cmp)`: Returns a fresh array Sort `xs` in place using\ncomparator `cmp`, the stable means if the elements are equal, their order will\nbe preserved" - ], - "signature": "let stableSortBy: (array<'a>, ('a, 'a) => int) => array<'a>" - }, - { - "id": "Belt.SortArray.binarySearchByU", - "kind": "value", - "name": "binarySearchByU", - "docstrings": [], - "signature": "let binarySearchByU: (array<'a>, 'a, ('a, 'a) => int) => int", - "deprecated": "Use `binarySearchBy` instead" - }, - { - "id": "Belt.SortArray.binarySearchBy", - "kind": "value", - "name": "binarySearchBy", - "docstrings": [ - "If value is not found and value is less than one or more elements in array, the\nnegative number returned is the bitwise complement of the index of the first\nelement that is larger than value.\n\nIf value is not found and value is greater\nthan all elements in array, the negative number returned is the bitwise\ncomplement of (the index of the last element plus 1)for example, if `key` is\nsmaller than all elements return `-1` since `lnot(-1) == 0` if `key` is larger\nthan all elements return `lnot(-1) == 0` since `lnot(- (len + 1)) == len`\n\n## Examples\n\n```rescript\nBelt.SortArray.binarySearchBy([1, 2, 3, 4, 33, 35, 36], 33, Pervasives.compare) == 4\n\nlnot(Belt.SortArray.binarySearchBy([1, 3, 5, 7], 4, Pervasives.compare)) == 2\n```" - ], - "signature": "let binarySearchBy: (array<'a>, 'a, ('a, 'a) => int) => int" - }, - { - "id": "Belt.SortArray.unionU", - "kind": "value", - "name": "unionU", - "docstrings": [], - "signature": "let unionU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int", - "deprecated": "Use `union` instead" - }, - { - "id": "Belt.SortArray.union", - "kind": "value", - "name": "union", - "docstrings": [ - "`union src src1ofs src1len src2 src2ofs src2len dst dstofs cmp` assume `src` and\n`src2` is strictly sorted. for equivalent elements, it is picked from `src`\nalso assume that `dst` is large enough to store all elements" - ], - "signature": "let union: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int" - }, - { - "id": "Belt.SortArray.intersectU", - "kind": "value", - "name": "intersectU", - "docstrings": [], - "signature": "let intersectU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int", - "deprecated": "Use `intersect` instead" - }, - { - "id": "Belt.SortArray.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "`union src src1ofs src1len src2 src2ofs src2len dst dstofs cmp`\n\n**return** the `offset` in the output array" - ], - "signature": "let intersect: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int" - }, - { - "id": "Belt.SortArray.diffU", - "kind": "value", - "name": "diffU", - "docstrings": [], - "signature": "let diffU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int", - "deprecated": "Use `diff` instead" - }, - { - "id": "Belt.SortArray.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int" - } - ] - }, - "belt/array": { - "id": "Belt.Array", - "name": "Array", - "docstrings": [ - "[`Belt.Array`]()\n\n **mutable array**: Utilities functions", - "Utilities for `Array` functions." - ], - "items": [ - { - "id": "Belt.Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = array<'a>" - }, - { - "id": "Belt.Array.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Return the size of the array\n\n## Examples\n\n```rescript\nBelt.Array.length([\"test\"]) == 1\n```" - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Belt.Array.size", - "kind": "value", - "name": "size", - "docstrings": [ - "See [`Belt.Array.length`]()" - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.Array.get", - "kind": "value", - "name": "get", - "docstrings": [ - "If `i <= 0 <= length(arr)` returns `Some(value)` where `value` is the item at index `i`.\nIf `i` is out of range returns `None`.\n\n## Examples\n\n```rescript\nBelt.Array.get([\"a\", \"b\", \"c\"], 0) == Some(\"a\")\nBelt.Array.get([\"a\", \"b\", \"c\"], 3) == None\nBelt.Array.get([\"a\", \"b\", \"c\"], -1) == None\n```" - ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, - { - "id": "Belt.Array.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Throw an exception if `i` is out of range.\nOtherwise return the value at index `i` in `arr`." - ], - "signature": "let getExn: (t<'a>, int) => 'a" - }, - { - "id": "Belt.Array.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Throw an exception if `i` is out of range.\nOtherwise return the value at index `i` in `arr`." - ], - "signature": "let getOrThrow: (t<'a>, int) => 'a" - }, - { - "id": "Belt.Array.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(arr, i)`\n\n**Unsafe**\n\nno bounds checking; this would cause type error if `i` does not stay within range" - ], - "signature": "let getUnsafe: (t<'a>, int) => 'a" - }, - { - "id": "Belt.Array.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "`getUndefined(arr, i)`\n\nIt does the samething in the runtime as [`getUnsafe`]();\nit is _type safe_ since the return type still track whether it is\nin range or not" - ], - "signature": "let getUndefined: (t<'a>, int) => Js.undefined<'a>" - }, - { - "id": "Belt.Array.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(arr, n, x)` modifies `arr` in place; it replaces the nth element of `arr`\nwith `x`. Returning `false` means not updated due to out of range." - ], - "signature": "let set: (t<'a>, int, 'a) => bool" - }, - { - "id": "Belt.Array.setExn", - "kind": "value", - "name": "setExn", - "docstrings": [ - "`setExn(arr, i, x)` throw an exception if `i` is out of range." - ], - "signature": "let setExn: (t<'a>, int, 'a) => unit" - }, - { - "id": "Belt.Array.setOrThrow", - "kind": "value", - "name": "setOrThrow", - "docstrings": [ - "`setOrThrow(arr, i, x)` throw an exception if `i` is out of range." - ], - "signature": "let setOrThrow: (t<'a>, int, 'a) => unit" - }, - { - "id": "Belt.Array.setUnsafe", - "kind": "value", - "name": "setUnsafe", - "docstrings": [], - "signature": "let setUnsafe: (t<'a>, int, 'a) => unit" - }, - { - "id": "Belt.Array.shuffleInPlace", - "kind": "value", - "name": "shuffleInPlace", - "docstrings": [ - "`shuffleInPlace(arr)` randomly re-orders the items in `arr`" - ], - "signature": "let shuffleInPlace: t<'a> => unit" - }, - { - "id": "Belt.Array.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "Returns a fresh array with items in original array randomly shuffled." - ], - "signature": "let shuffle: t<'a> => t<'a>" - }, - { - "id": "Belt.Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [ - "`reverseInPlace(arr)` reverses items in `arr` in place.\n\n## Examples\n\n```rescript\nlet arr = [10, 11, 12, 13, 14]\n\nlet () = Belt.Array.reverseInPlace(arr)\n\narr == [14, 13, 12, 11, 10]\n```" - ], - "signature": "let reverseInPlace: t<'a> => unit" - }, - { - "id": "Belt.Array.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(arr)` returns a fresh array with items in arr in reverse order.\n\n## Examples\n\n```rescript\nBelt.Array.reverse([10, 11, 12, 13, 14]) == [14, 13, 12, 11, 10]\n```" - ], - "signature": "let reverse: t<'a> => t<'a>" - }, - { - "id": "Belt.Array.makeUninitialized", - "kind": "value", - "name": "makeUninitialized", - "docstrings": [ - "`makeUninitialized(n)` creates an array of length `n` filled with the undefined\nvalue. You must specify the type of data that will eventually fill the array.\n\n## Examples\n\n```rescript\nlet arr: array> = Belt.Array.makeUninitialized(5)\n\nBelt.Array.getExn(arr, 0) == Js.undefined\n```" - ], - "signature": "let makeUninitialized: int => array>" - }, - { - "id": "Belt.Array.makeUninitializedUnsafe", - "kind": "value", - "name": "makeUninitializedUnsafe", - "docstrings": [ - "**Unsafe**\n\n## Examples\n\n```rescript\nlet arr = Belt.Array.makeUninitializedUnsafe(5)\n\nJs.log(Belt.Array.getExn(arr, 0)) // undefined\n\nBelt.Array.setExn(arr, 0, \"example\")\n\nBelt.Array.getExn(arr, 0) == \"example\"\n```" - ], - "signature": "let makeUninitializedUnsafe: int => t<'a>" - }, - { - "id": "Belt.Array.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(n, e)` return an array of size `n` filled with value `e`.\nReturns an empty array when `n` is negative." - ], - "signature": "let make: (int, 'a) => t<'a>" - }, - { - "id": "Belt.Array.range", - "kind": "value", - "name": "range", - "docstrings": [ - "`range(start, finish)` create an inclusive array.\n\n## Examples\n\n```rescript\nBelt.Array.range(0, 3) == [0, 1, 2, 3]\n\nBelt.Array.range(3, 0) == []\n\nBelt.Array.range(3, 3) == [3]\n```" - ], - "signature": "let range: (int, int) => array" - }, - { - "id": "Belt.Array.rangeBy", - "kind": "value", - "name": "rangeBy", - "docstrings": [ - "`rangeBy(start, finish, ~step)` returns empty array when step is 0 or negative.\nIt also return an empty array when `start > finish`.\n\n## Examples\n\n```rescript\nBelt.Array.rangeBy(0, 10, ~step=3) == [0, 3, 6, 9]\n\nBelt.Array.rangeBy(0, 12, ~step=3) == [0, 3, 6, 9, 12]\n\nBelt.Array.rangeBy(33, 0, ~step=1) == []\n\nBelt.Array.rangeBy(33, 0, ~step=-1) == []\n\nBelt.Array.rangeBy(3, 12, ~step=-1) == []\n\nBelt.Array.rangeBy(3, 3, ~step=0) == []\n\nBelt.Array.rangeBy(3, 3, ~step=1) == [3]\n```" - ], - "signature": "let rangeBy: (int, int, ~step: int) => array" - }, - { - "id": "Belt.Array.makeByU", - "kind": "value", - "name": "makeByU", - "docstrings": [], - "signature": "let makeByU: (int, int => 'a) => t<'a>", - "deprecated": "Use `makeBy` instead" - }, - { - "id": "Belt.Array.makeBy", - "kind": "value", - "name": "makeBy", - "docstrings": [ - "`makeBy(n, f)` return an empty array when n is negative return an array of size\nn populated by `f(i)` start from `0` to `n - 1`.\n\n## Examples\n\n```rescript\nBelt.Array.makeBy(5, i => i) == [0, 1, 2, 3, 4]\n\nBelt.Array.makeBy(5, i => i * i) == [0, 1, 4, 9, 16]\n```" - ], - "signature": "let makeBy: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.Array.makeByAndShuffleU", - "kind": "value", - "name": "makeByAndShuffleU", - "docstrings": [], - "signature": "let makeByAndShuffleU: (int, int => 'a) => t<'a>", - "deprecated": "Use `makeByAndShuffle` instead" - }, - { - "id": "Belt.Array.makeByAndShuffle", - "kind": "value", - "name": "makeByAndShuffle", - "docstrings": [ - "Equivalent to `shuffle(makeBy(n, f))`" - ], - "signature": "let makeByAndShuffle: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.Array.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "`zip(a, b)` create an array of pairs from corresponding elements of a and b.\nStop with the shorter array.\n\n## Examples\n\n```rescript\nBelt.Array.zip([1, 2], [3, 4, 5]) == [(1, 3), (2, 4)]\n```" - ], - "signature": "let zip: (t<'a>, array<'b>) => array<('a, 'b)>" - }, - { - "id": "Belt.Array.zipByU", - "kind": "value", - "name": "zipByU", - "docstrings": [], - "signature": "let zipByU: (t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>", - "deprecated": "Use `zipBy` instead" - }, - { - "id": "Belt.Array.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "`zipBy(xs, ys, f)` create an array by applying `f` to corresponding elements of\n`xs` and `ys`. Stops with shorter array.\n\nEquivalent to `map(zip(xs, ys), ((a, b)) => f(a, b))`\n\n## Examples\n\n```rescript\nBelt.Array.zipBy([1, 2, 3], [4, 5], (a, b) => 2 * a + b) == [6, 9]\n```" - ], - "signature": "let zipBy: (t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>" - }, - { - "id": "Belt.Array.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "`unzip(a)` takes an array of pairs and creates a pair of arrays. The first array\ncontains all the first items of the pairs; the second array contains all the\nsecond items.\n\n## Examples\n\n```rescript\nBelt.Array.unzip([(1, 2), (3, 4)]) == ([1, 3], [2, 4])\n\nBelt.Array.unzip([(1, 2), (3, 4), (5, 6), (7, 8)]) == ([1, 3, 5, 7], [2, 4, 6, 8])\n```" - ], - "signature": "let unzip: array<('a, 'b)> => (t<'a>, array<'b>)" - }, - { - "id": "Belt.Array.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(xs, ys)` returns a fresh array containing the concatenation of the arrays\n`v1` and `v2`, so even if `v1` or `v2` is empty; it can not be shared.\n\n## Examples\n\n```rescript\nBelt.Array.concat([1, 2, 3], [4, 5]) == [1, 2, 3, 4, 5]\n\nBelt.Array.concat([], [\"a\", \"b\", \"c\"]) == [\"a\", \"b\", \"c\"]\n```" - ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Belt.Array.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(xss)` returns a fresh array as the concatenation of `xss` (an array of arrays)\n\n## Examples\n\n```rescript\nBelt.Array.concatMany([[1, 2, 3], [4, 5, 6], [7, 8]]) == [1, 2, 3, 4, 5, 6, 7, 8]\n```" - ], - "signature": "let concatMany: array> => t<'a>" - }, - { - "id": "Belt.Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(xs, offset, len)` creates a new array with the len elements of `xs`\nstarting at `offset` for `offset` can be negative;and is evaluated as\n`length(xs) - offset(slice, xs) - 1(1)` means get the last element as a\nsingleton array `slice(xs, ~-len, len)` will return a copy of the array if the\narray does not have enough data; `slice` extracts through the end of sequence.\n\nif `len` is negative; returns the empty array.\n\n## Examples\n\n```rescript\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=2, ~len=3) == [12, 13, 14]\n\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=-4, ~len=3) == [13, 14, 15]\n\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=4, ~len=9) == [14, 15, 16]\n```" - ], - "signature": "let slice: (t<'a>, ~offset: int, ~len: int) => t<'a>" - }, - { - "id": "Belt.Array.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(xs, offset)` creates a new array with the elements of `xs` starting\nat `offset`\n\n`offset` can be negative; and is evaluated as `length(xs) - offset(sliceToEnd, xs) - 1`\nmeans get the last element as a singleton array\n\n`sliceToEnd(xs, 0)` will return a copy of the array\n\n## Examples\n\n```rescript\nBelt.Array.sliceToEnd([10, 11, 12, 13, 14, 15, 16], 2) == [12, 13, 14, 15, 16]\n\nBelt.Array.sliceToEnd([10, 11, 12, 13, 14, 15, 16], -4) == [13, 14, 15, 16]\n```" - ], - "signature": "let sliceToEnd: (t<'a>, int) => t<'a>" - }, - { - "id": "Belt.Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(a)` returns a copy of `a`; that is; a fresh array containing the same\nelements as `a`." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.Array.fill", - "kind": "value", - "name": "fill", - "docstrings": [ - "`fill(arr, ~offset, ~len, x)` modifies `arr` in place, storing `x` in elements\nnumber `offset` to `offset + len - 1`. `offset` can be negative; and is evaluated\nas `length(arr - offset)`.\n\n`fill(arr, ~offset=-1, ~len=1)` means fill the last element, if the array does not have enough data; `fill` will ignore it\n\n## Examples\n\n```rescript\nlet arr = Belt.Array.makeBy(5, i => i)\n\nBelt.Array.fill(arr, ~offset=2, ~len=2, 9)\n\narr == [0, 1, 9, 9, 4]\n\nBelt.Array.fill(arr, ~offset=7, ~len=2, 8)\n\narr == [0, 1, 9, 9, 4]\n```" - ], - "signature": "let fill: (t<'a>, ~offset: int, ~len: int, 'a) => unit" - }, - { - "id": "Belt.Array.blit", - "kind": "value", - "name": "blit", - "docstrings": [ - "`blit(~src=v1, ~srcOffset=o1, ~dst=v2, ~dstOffset=o2, ~len)` copies `len` elements\nfrom array `v1`;starting at element number `o1`;to array `v2`, starting at element\nnumber `o2`. It works correctly even if `v1` and `v2` are the same array and the\nsource and destination chunks overlap.\n\n`offset` can be negative; `-1` means `len - 1`; if `len + offset` is still negative;it will be set as 0\n\nFor each of the examples;presume that `v1 == [10, 11, 12, 13, 14, 15, 16, 17]` and `v2 == [20, 21, 22, 23, 24, 25, 26, 27]`. The result shown is the content of the destination array.\n\n## Examples\n\n```rescript\nlet v1 = [10, 11, 12, 13, 14, 15, 16, 17]\nlet v2 = [20, 21, 22, 23, 24, 25, 26, 27]\n\nBelt.Array.blit(~src=v1, ~srcOffset=4, ~dst=v2, ~dstOffset=2, ~len=3)\nv2 == [20, 21, 14, 15, 16, 25, 26, 27]\n\nBelt.Array.blit(~src=v1, ~srcOffset=4, ~dst=v1, ~dstOffset=2, ~len=3)\nv1 == [10, 11, 14, 15, 16, 15, 16, 17]\n```" - ], - "signature": "let blit: (\n ~src: t<'a>,\n ~srcOffset: int,\n ~dst: t<'a>,\n ~dstOffset: int,\n ~len: int,\n) => unit" - }, - { - "id": "Belt.Array.blitUnsafe", - "kind": "value", - "name": "blitUnsafe", - "docstrings": [ - "Unsafe blit without bounds checking." - ], - "signature": "let blitUnsafe: (\n ~src: t<'a>,\n ~srcOffset: int,\n ~dst: t<'a>,\n ~dstOffset: int,\n ~len: int,\n) => unit" - }, - { - "id": "Belt.Array.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(xs, f)`\n\nCall `f` on each element of `xs` from the beginning to end. `f` returns `unit`\nso no new array is created. Use `forEach` when you are primarily concerned with\nrepetitively creating side effects.\n\n## Examples\n\n```rescript\nBelt.Array.forEach([\"a\", \"b\", \"c\"], x => Js.log(\"Item: \" ++ x))\n\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\nlet total = ref(0)\n\nBelt.Array.forEach([1, 2, 3, 4], x => total := total.contents + x)\n\ntotal.contents == 1 + 2 + 3 + 4\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.Array.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => array<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Array.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(xs, f)` returns a new array by calling `f` for each element of `xs` from\nthe beginning to end.\n\n## Examples\n\n```rescript\nBelt.Array.map([1, 2], x => x + 1) == [2, 3]\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Belt.Array.flatMapU", - "kind": "value", - "name": "flatMapU", - "docstrings": [], - "signature": "let flatMapU: (t<'a>, 'a => array<'b>) => array<'b>", - "deprecated": "Use `flatMap` instead" - }, - { - "id": "Belt.Array.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(xs, f)` returns a new array by calling `f` for each element of `xs` from\nthe beginning to end, concatenating the results.\n\n## Examples\n\n```rescript\nBelt.Array.flatMap([1, 2], x => [x + 10, x + 20]) == [11, 21, 12, 22]\n```" - ], - "signature": "let flatMap: (t<'a>, 'a => array<'b>) => array<'b>" - }, - { - "id": "Belt.Array.getByU", - "kind": "value", - "name": "getByU", - "docstrings": [], - "signature": "let getByU: (t<'a>, 'a => bool) => option<'a>", - "deprecated": "Use `getBy` instead" - }, - { - "id": "Belt.Array.getBy", - "kind": "value", - "name": "getBy", - "docstrings": [ - "`getBy(xs, p)` returns `Some(value)` for the first value in `xs` that satisifies\nthe predicate function `p`; returns `None` if no element satisifies the function.\n\n## Examples\n\n```rescript\nBelt.Array.getBy([1, 4, 3, 2], x => mod(x, 2) == 0) == Some(4)\nBelt.Array.getBy([15, 13, 11], x => mod(x, 2) == 0) == None\n```" - ], - "signature": "let getBy: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Belt.Array.getIndexByU", - "kind": "value", - "name": "getIndexByU", - "docstrings": [], - "signature": "let getIndexByU: (t<'a>, 'a => bool) => option", - "deprecated": "Use `getIndexBy` instead" - }, - { - "id": "Belt.Array.getIndexBy", - "kind": "value", - "name": "getIndexBy", - "docstrings": [ - "`getIndexBy(xs, p)` returns `Some(index)` for the first value in `xs` that\nsatisifies the predicate function `p`; returns `None` if no element satisifies\nthe function.\n\n## Examples\n\n```rescript\nBelt.Array.getIndexBy([1, 4, 3, 2], x => mod(x, 2) == 0) == Some(1)\nBelt.Array.getIndexBy([15, 13, 11], x => mod(x, 2) == 0) == None\n```" - ], - "signature": "let getIndexBy: (t<'a>, 'a => bool) => option" - }, - { - "id": "Belt.Array.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Array.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(xs, p)` returns a new array that keep all elements satisfy `p`." - ], - "signature": "let keep: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Belt.Array.keepWithIndexU", - "kind": "value", - "name": "keepWithIndexU", - "docstrings": [], - "signature": "let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "Use `keepWithIndex` instead" - }, - { - "id": "Belt.Array.keepWithIndex", - "kind": "value", - "name": "keepWithIndex", - "docstrings": [ - "`keepWithIndex(xs, p)` returns a new array that keep all elements satisfy `p`.\n\n## Examples\n\n```rescript\nBelt.Array.keepWithIndex([1, 2, 3], (_x, i) => i == 1) == [2]\n```" - ], - "signature": "let keepWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" - }, - { - "id": "Belt.Array.keepMapU", - "kind": "value", - "name": "keepMapU", - "docstrings": [], - "signature": "let keepMapU: (t<'a>, 'a => option<'b>) => array<'b>", - "deprecated": "Use `keepMap` instead" - }, - { - "id": "Belt.Array.keepMap", - "kind": "value", - "name": "keepMap", - "docstrings": [ - "`keepMap(xs, p)` returns a new array that keep all elements that return a non\nNone applied `p`.\n\n## Examples\n\n```rescript\nBelt.Array.keepMap([1, 2, 3], x =>\n if mod(x, 2) == 0 {\n Some(x)\n } else {\n None\n }\n) == [2]\n```" - ], - "signature": "let keepMap: (t<'a>, 'a => option<'b>) => array<'b>" - }, - { - "id": "Belt.Array.forEachWithIndexU", - "kind": "value", - "name": "forEachWithIndexU", - "docstrings": [], - "signature": "let forEachWithIndexU: (t<'a>, (int, 'a) => unit) => unit", - "deprecated": "Use `forEachWithIndex` instead" - }, - { - "id": "Belt.Array.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(xs, f)` same as `Belt.Array.forEach`, except that `f` is\nsupplied two arguments: the index starting from 0 and the element from `xs`.\n\n## Examples\n\n```rescript\nBelt.Array.forEachWithIndex([\"a\", \"b\", \"c\"], (i, x) =>\n Js.log(\"Item \" ++ Belt.Int.toString(i) ++ \" is \" ++ x)\n)\n\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\nlet total = ref(0)\n\nBelt.Array.forEachWithIndex([10, 11, 12, 13], (i, x) => total := total.contents + x + i)\n\ntotal.contents == 0 + 10 + 1 + 11 + 2 + 12 + 3 + 13\n```" - ], - "signature": "let forEachWithIndex: (t<'a>, (int, 'a) => unit) => unit" - }, - { - "id": "Belt.Array.mapWithIndexU", - "kind": "value", - "name": "mapWithIndexU", - "docstrings": [], - "signature": "let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => array<'b>", - "deprecated": "Use `mapWithIndex` instead" - }, - { - "id": "Belt.Array.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(xs, f)` applies `f` to each element of `xs`. Function `f` takes\ntwo arguments: the index starting from 0 and the element from `xs`.\n\n## Examples\n\n```rescript\nBelt.Array.mapWithIndex([1, 2, 3], (i, x) => i + x) == [0 + 1, 1 + 2, 2 + 3]\n```" - ], - "signature": "let mapWithIndex: (t<'a>, (int, 'a) => 'b) => array<'b>" - }, - { - "id": "Belt.Array.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Array.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(f, a)` split array into tuple of two arrays based on predicate `f`;\nfirst of tuple where predicate cause true, second where predicate cause false\n\n## Examples\n\n```rescript\nBelt.Array.partition([1, 2, 3, 4, 5], x => mod(x, 2) == 0) == ([2, 4], [1, 3, 5])\n\nBelt.Array.partition([1, 2, 3, 4, 5], x => mod(x, 2) != 0) == ([1, 3, 5], [2, 4])\n```" - ], - "signature": "let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)" - }, - { - "id": "Belt.Array.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(xs, init, f)` applies `f` to each element of `xs` from beginning to end.\nFunction `f` has two parameters: the item from the list and an “accumulator”;\nwhich starts with a value of `init`. `reduce` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nBelt.Array.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\nBelt.Array.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n```" - ], - "signature": "let reduce: (array<'b>, 'a, ('a, 'b) => 'a) => 'a" - }, - { - "id": "Belt.Array.reduceReverseU", - "kind": "value", - "name": "reduceReverseU", - "docstrings": [], - "signature": "let reduceReverseU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a", - "deprecated": "Use `reduceReverse` instead" - }, - { - "id": "Belt.Array.reduceReverse", - "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "`reduceReverse(xs, init, f)` works like `Belt.Array.reduce` except that\nfunction `f` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nBelt.Array.reduceReverse([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n```" - ], - "signature": "let reduceReverse: (array<'b>, 'a, ('a, 'b) => 'a) => 'a" - }, - { - "id": "Belt.Array.reduceReverse2U", - "kind": "value", - "name": "reduceReverse2U", - "docstrings": [], - "signature": "let reduceReverse2U: (t<'a>, array<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c", - "deprecated": "Use `reduceReverse2` instead" - }, - { - "id": "Belt.Array.reduceReverse2", - "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "`reduceReverse2(xs, ys, init, f)` reduces two arrays xs and ys;taking items\nstarting at `min(length(xs), length(ys))` down to and including zero.\n\n## Examples\n\n```rescript\nBelt.Array.reduceReverse2([1, 2, 3], [1, 2], 0, (acc, x, y) => acc + x + y) == 6\n```" - ], - "signature": "let reduceReverse2: (t<'a>, array<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" - }, - { - "id": "Belt.Array.reduceWithIndexU", - "kind": "value", - "name": "reduceWithIndexU", - "docstrings": [], - "signature": "let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b", - "deprecated": "Use `reduceWithIndex` instead" - }, - { - "id": "Belt.Array.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "Applies `f` to each element of `xs` from beginning to end. Function `f` has\nthree parameters: the item from the array and an “accumulator”, which starts\nwith a value of `init` and the index of each element. `reduceWithIndex` returns\nthe final value of the accumulator.\n\n## Examples\n\n```rescript\nBelt.Array.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n```" - ], - "signature": "let reduceWithIndex: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Belt.Array.joinWithU", - "kind": "value", - "name": "joinWithU", - "docstrings": [], - "signature": "let joinWithU: (t<'a>, string, 'a => string) => string", - "deprecated": "Use `joinWith` instead" - }, - { - "id": "Belt.Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "`joinWith(xs, sep, toString)`\n\nConcatenates all the elements of `xs` converted to string with `toString`, each\nseparated by `sep`, the string given as the second argument, into a single string.\nIf the array has only one element, then that element will be returned without\nusing the separator. If the array is empty, the empty string will be returned.\n\n## Examples\n\n```rescript\nBelt.Array.joinWith([0, 1], \", \", Js.Int.toString) == \"0, 1\"\nBelt.Array.joinWith([], \" \", Js.Int.toString) == \"\"\nBelt.Array.joinWith([1], \" \", Js.Int.toString) == \"1\"\n```" - ], - "signature": "let joinWith: (t<'a>, string, 'a => string) => string" - }, - { - "id": "Belt.Array.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Array.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(xs, p)` returns true if at least one of the elements in `xs` satifies `p`;\nwhere `p` is a predicate: a function taking an element and returning a `bool`.\n\n## Examples\n\n```rescript\nBelt.Array.some([2, 3, 4], x => mod(x, 2) == 1) == true\n\nBelt.Array.some([-1, -3, -5], x => x > 0) == false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.Array.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Array.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(xs, p)` returns `true` if all elements satisfy `p`; where `p` is a\npredicate: a function taking an element and returning a `bool`.\n\n## Examples\n\n```rescript\nBelt.Array.every([1, 3, 5], x => mod(x, 2) == 1) == true\n\nBelt.Array.every([1, -3, 5], x => x > 0) == false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.Array.every2U", - "kind": "value", - "name": "every2U", - "docstrings": [], - "signature": "let every2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `every2` instead" - }, - { - "id": "Belt.Array.every2", - "kind": "value", - "name": "every2", - "docstrings": [ - "`every2(xs, ys, p)` returns true if `p(xi, yi)` is true for all pairs of\nelements up to the shorter length (i.e. `min(length(xs), length(ys))`)\n\n## Examples\n\n```rescript\nBelt.Array.every2([1, 2, 3], [0, 1], (a, b) => a > b) == true\n\nBelt.Array.every2([], [1], (x, y) => x > y) == true\n\nBelt.Array.every2([2, 3], [1], (x, y) => x > y) == true\n\nBelt.Array.every2([0, 1], [5, 0], (x, y) => x > y) == false\n```" - ], - "signature": "let every2: (t<'a>, array<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Array.some2U", - "kind": "value", - "name": "some2U", - "docstrings": [], - "signature": "let some2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `some2` instead" - }, - { - "id": "Belt.Array.some2", - "kind": "value", - "name": "some2", - "docstrings": [ - "`some2(xs, ys, p)` returns true if `p(xi, yi)` is true for any pair of elements\nup to the shorter length (i.e. `min(length(xs), length(ys))`)\n\n## Examples\n\n```rescript\nBelt.Array.some2([0, 2], [1, 0, 3], (a, b) => a > b) == true\n\nBelt.Array.some2([], [1], (x, y) => x > y) == false\n\nBelt.Array.some2([2, 3], [1, 4], (x, y) => x > y) == true\n```" - ], - "signature": "let some2: (t<'a>, array<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Array.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Array.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(xs, ys, f)` compared by length if `length(xs) != length(ys)`; returning `-1`\nif `length(xs) < length(ys)` or 1 if `length(xs) > length(ys)`. Otherwise\ncompare one by one `f(x, y)`. `f` returns a negative number if `x` is “less than” `y`\nzero if `x` is “equal to” `y` a positive number if `x` is “greater than”\n`y`. The comparison returns the first non-zero result of `f`; or zero if `f`\nreturns zero for all `x` and `y`.\n\n## Examples\n\n```rescript\nBelt.Array.cmp([1, 3, 5], [1, 4, 2], (a, b) => compare(a, b)) == -1\n\nBelt.Array.cmp([1, 3, 5], [1, 2, 3], (a, b) => compare(a, b)) == 1\n\nBelt.Array.cmp([1, 3, 5], [1, 3, 5], (a, b) => compare(a, b)) == 0\n```" - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.Array.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Array.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(xs, ys)` return `false` if length is not the same otherwise compare items\none by one using `f(xi, yi)`; and return true if all results are true false otherwise\n\n## Examples\n\n```rescript\nBelt.Array.eq([1, 2, 3], [-1, -2, -3], (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.Array.truncateToLengthUnsafe", - "kind": "value", - "name": "truncateToLengthUnsafe", - "docstrings": [ - "Unsafe `truncateToLengthUnsafe(xs, n)` sets length of array `xs` to `n`. If `n`\nis greater than the length of `xs`; the extra elements are set to `Js.Null_undefined.null`.\nIf `n` is less than zero; throws a `RangeError`.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n\nBelt.Array.truncateToLengthUnsafe(arr, 3)\n\narr == [\"ant\", \"bee\", \"cat\"]\n```" - ], - "signature": "let truncateToLengthUnsafe: (t<'a>, int) => unit" - }, - { - "id": "Belt.Array.initU", - "kind": "value", - "name": "initU", - "docstrings": [], - "signature": "let initU: (int, int => 'a) => t<'a>", - "deprecated": "Use `init` instead" - }, - { - "id": "Belt.Array.init", - "kind": "value", - "name": "init", - "docstrings": [], - "signature": "let init: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.Array.push", - "kind": "value", - "name": "push", - "docstrings": [ - "`arr->push(item)` pushes an element `item` into an array `arr`." - ], - "signature": "let push: (t<'a>, 'a) => unit" - } - ] - }, - "belt/id": { - "id": "Belt.Id", - "name": "Id", - "docstrings": [ - "[`Belt.Id`]()\n\n Provide utilities to create identified comparators or hashes for\n data structures used below.\n\n It create a unique identifier per module of\n functions so that different data structures with slightly different\n comparison functions won't mix", - "[`Belt.Id`]()\n\nProvide utiliites to create identified comparators or hashes for\ndata structures used below.\n\nIt create a unique identifer per module of functions so that different data structures with slightly different\ncomparison functions won't mix." - ], - "items": [ - { - "id": "Belt.Id.hash", - "kind": "type", - "name": "hash", - "docstrings": [ - "`('a, 'id) hash`\n\nIts runtime represenation is a `hash` function, but signed with a\ntype parameter, so that different hash functions type mismatch" - ], - "signature": "type hash<'a, 'id>" - }, - { - "id": "Belt.Id.eq", - "kind": "type", - "name": "eq", - "docstrings": [ - "`('a, 'id) eq`\n\nIts runtime represenation is an `eq` function, but signed with a\ntype parameter, so that different hash functions type mismatch" - ], - "signature": "type eq<'a, 'id>" - }, - { - "id": "Belt.Id.cmp", - "kind": "type", - "name": "cmp", - "docstrings": [ - "`('a,'id) cmp`\n\nIts runtime representation is a `cmp` function, but signed with a\ntype parameter, so that different hash functions type mismatch" - ], - "signature": "type cmp<'a, 'id>" - }, - { - "id": "Belt.Id.comparable", - "kind": "type", - "name": "comparable", - "docstrings": [ - "`('key, 'id) cmparable` is a module of functions, here it only includes `cmp`.\n\nUnlike normal functions, when created, it comes with a unique identity (guaranteed\nby the type system).\n\nIt can be created using function [`comparableU`]() or [`comparable`]().\n\nThe idea of a unique identity when created is that it makes sure two sets would type\nmismatch if they use different comparison function" - ], - "signature": "type comparable<'key, 'id> = module(Comparable\n with type identity = 'id\n and type t = 'key)" - }, - { - "id": "Belt.Id.comparableU", - "kind": "value", - "name": "comparableU", - "docstrings": [], - "signature": "let comparableU: (\n ~cmp: ('a, 'a) => int,\n) => module(Comparable with type t = 'a)", - "deprecated": "Use `comparable` instead" - }, - { - "id": "Belt.Id.comparable", - "kind": "value", - "name": "comparable", - "docstrings": [], - "signature": "let comparable: (\n ~cmp: ('a, 'a) => int,\n) => module(Comparable with type t = 'a)" - }, - { - "id": "Belt.Id.hashable", - "kind": "type", - "name": "hashable", - "docstrings": [ - "`('key, 'id) hashable` is a module of functions, here it only includes `hash`, `eq`.\n\nUnlike normal functions, when created, it comes with a unique identity (guaranteed\nby the type system).\n\nIt can be created using function [`hashableU`]() or [`hashable`]().\n\nThe idea of a unique identity when created is that it makes sure two hash sets would type\nmismatch if they use different comparison function" - ], - "signature": "type hashable<'key, 'id> = module(Hashable\n with type identity = 'id\n and type t = 'key)" - }, - { - "id": "Belt.Id.hashableU", - "kind": "value", - "name": "hashableU", - "docstrings": [], - "signature": "let hashableU: (\n ~hash: 'a => int,\n ~eq: ('a, 'a) => bool,\n) => module(Hashable with type t = 'a)", - "deprecated": "Use `hashable` instead" - }, - { - "id": "Belt.Id.hashable", - "kind": "value", - "name": "hashable", - "docstrings": [], - "signature": "let hashable: (\n ~hash: 'a => int,\n ~eq: ('a, 'a) => bool,\n) => module(Hashable with type t = 'a)" - }, - { - "id": "Belt.Id.getHashInternal", - "kind": "value", - "name": "getHashInternal", - "docstrings": [], - "signature": "let getHashInternal: hash<'a, 'id> => 'a => int" - }, - { - "id": "Belt.Id.getEqInternal", - "kind": "value", - "name": "getEqInternal", - "docstrings": [], - "signature": "let getEqInternal: eq<'a, 'id> => ('a, 'a) => bool" - }, - { - "id": "Belt.Id.getCmpInternal", - "kind": "value", - "name": "getCmpInternal", - "docstrings": [], - "signature": "let getCmpInternal: cmp<'a, 'id> => ('a, 'a) => int" - } - ] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v12.1.0/dom.json b/apps/docs/data/api/v12.1.0/dom.json deleted file mode 100644 index 2bf0f3038..000000000 --- a/apps/docs/data/api/v12.1.0/dom.json +++ /dev/null @@ -1,1962 +0,0 @@ -{ - "dom": { - "id": "Dom", - "name": "Dom", - "docstrings": [], - "items": [ - { - "id": "Dom._baseClass", - "kind": "type", - "name": "_baseClass", - "docstrings": [], - "signature": "type _baseClass" - }, - { - "id": "Dom.animation", - "kind": "type", - "name": "animation", - "docstrings": [], - "signature": "type animation" - }, - { - "id": "Dom.cssStyleDeclaration", - "kind": "type", - "name": "cssStyleDeclaration", - "docstrings": [], - "signature": "type cssStyleDeclaration" - }, - { - "id": "Dom.cssStyleSheet", - "kind": "type", - "name": "cssStyleSheet", - "docstrings": [], - "signature": "type cssStyleSheet" - }, - { - "id": "Dom.eventTarget_like", - "kind": "type", - "name": "eventTarget_like", - "docstrings": [], - "signature": "type eventTarget_like<'a>" - }, - { - "id": "Dom.eventTarget", - "kind": "type", - "name": "eventTarget", - "docstrings": [], - "signature": "type eventTarget = eventTarget_like<_baseClass>" - }, - { - "id": "Dom._node", - "kind": "type", - "name": "_node", - "docstrings": [], - "signature": "type _node<'a>" - }, - { - "id": "Dom.node_like", - "kind": "type", - "name": "node_like", - "docstrings": [], - "signature": "type node_like<'a> = eventTarget_like<_node<'a>>" - }, - { - "id": "Dom.node", - "kind": "type", - "name": "node", - "docstrings": [], - "signature": "type node = node_like<_baseClass>" - }, - { - "id": "Dom._attr", - "kind": "type", - "name": "_attr", - "docstrings": [], - "signature": "type _attr" - }, - { - "id": "Dom.attr", - "kind": "type", - "name": "attr", - "docstrings": [], - "signature": "type attr = node_like<_attr>" - }, - { - "id": "Dom._characterData", - "kind": "type", - "name": "_characterData", - "docstrings": [], - "signature": "type _characterData<'a>" - }, - { - "id": "Dom.characterData_like", - "kind": "type", - "name": "characterData_like", - "docstrings": [], - "signature": "type characterData_like<'a> = node_like<_characterData<'a>>" - }, - { - "id": "Dom.characterData", - "kind": "type", - "name": "characterData", - "docstrings": [], - "signature": "type characterData = characterData_like<_baseClass>" - }, - { - "id": "Dom._cdataSection", - "kind": "type", - "name": "_cdataSection", - "docstrings": [], - "signature": "type _cdataSection" - }, - { - "id": "Dom.cdataSection", - "kind": "type", - "name": "cdataSection", - "docstrings": [], - "signature": "type cdataSection = characterData_like<_cdataSection>" - }, - { - "id": "Dom._comment", - "kind": "type", - "name": "_comment", - "docstrings": [], - "signature": "type _comment" - }, - { - "id": "Dom.comment", - "kind": "type", - "name": "comment", - "docstrings": [], - "signature": "type comment = characterData_like<_comment>" - }, - { - "id": "Dom._document", - "kind": "type", - "name": "_document", - "docstrings": [], - "signature": "type _document<'a>" - }, - { - "id": "Dom.document_like", - "kind": "type", - "name": "document_like", - "docstrings": [], - "signature": "type document_like<'a> = node_like<_document<'a>>" - }, - { - "id": "Dom.document", - "kind": "type", - "name": "document", - "docstrings": [], - "signature": "type document = document_like<_baseClass>" - }, - { - "id": "Dom._documentFragment", - "kind": "type", - "name": "_documentFragment", - "docstrings": [], - "signature": "type _documentFragment" - }, - { - "id": "Dom.documentFragment", - "kind": "type", - "name": "documentFragment", - "docstrings": [], - "signature": "type documentFragment = node_like<_documentFragment>" - }, - { - "id": "Dom._documentType", - "kind": "type", - "name": "_documentType", - "docstrings": [], - "signature": "type _documentType" - }, - { - "id": "Dom.documentType", - "kind": "type", - "name": "documentType", - "docstrings": [], - "signature": "type documentType = node_like<_documentType>" - }, - { - "id": "Dom.domImplementation", - "kind": "type", - "name": "domImplementation", - "docstrings": [], - "signature": "type domImplementation" - }, - { - "id": "Dom._element", - "kind": "type", - "name": "_element", - "docstrings": [], - "signature": "type _element<'a>" - }, - { - "id": "Dom.element_like", - "kind": "type", - "name": "element_like", - "docstrings": [], - "signature": "type element_like<'a> = node_like<_element<'a>>" - }, - { - "id": "Dom.element", - "kind": "type", - "name": "element", - "docstrings": [], - "signature": "type element = element_like<_baseClass>" - }, - { - "id": "Dom.htmlCollection", - "kind": "type", - "name": "htmlCollection", - "docstrings": [], - "signature": "type htmlCollection" - }, - { - "id": "Dom.htmlFormControlsCollection", - "kind": "type", - "name": "htmlFormControlsCollection", - "docstrings": [], - "signature": "type htmlFormControlsCollection" - }, - { - "id": "Dom.htmlOptionsCollection", - "kind": "type", - "name": "htmlOptionsCollection", - "docstrings": [], - "signature": "type htmlOptionsCollection" - }, - { - "id": "Dom.intersectionObserver", - "kind": "type", - "name": "intersectionObserver", - "docstrings": [], - "signature": "type intersectionObserver" - }, - { - "id": "Dom.intersectionObserverEntry", - "kind": "type", - "name": "intersectionObserverEntry", - "docstrings": [], - "signature": "type intersectionObserverEntry" - }, - { - "id": "Dom.mutationObserver", - "kind": "type", - "name": "mutationObserver", - "docstrings": [], - "signature": "type mutationObserver" - }, - { - "id": "Dom.mutationRecord", - "kind": "type", - "name": "mutationRecord", - "docstrings": [], - "signature": "type mutationRecord" - }, - { - "id": "Dom.performanceObserver", - "kind": "type", - "name": "performanceObserver", - "docstrings": [], - "signature": "type performanceObserver" - }, - { - "id": "Dom.performanceObserverEntryList", - "kind": "type", - "name": "performanceObserverEntryList", - "docstrings": [], - "signature": "type performanceObserverEntryList" - }, - { - "id": "Dom.reportingObserver", - "kind": "type", - "name": "reportingObserver", - "docstrings": [], - "signature": "type reportingObserver" - }, - { - "id": "Dom.reportingObserverOptions", - "kind": "type", - "name": "reportingObserverOptions", - "docstrings": [], - "signature": "type reportingObserverOptions" - }, - { - "id": "Dom.resizeObserver", - "kind": "type", - "name": "resizeObserver", - "docstrings": [], - "signature": "type resizeObserver" - }, - { - "id": "Dom.resizeObserverEntry", - "kind": "type", - "name": "resizeObserverEntry", - "docstrings": [], - "signature": "type resizeObserverEntry" - }, - { - "id": "Dom.namedNodeMap", - "kind": "type", - "name": "namedNodeMap", - "docstrings": [], - "signature": "type namedNodeMap" - }, - { - "id": "Dom.nodeList", - "kind": "type", - "name": "nodeList", - "docstrings": [], - "signature": "type nodeList" - }, - { - "id": "Dom.radioNodeList", - "kind": "type", - "name": "radioNodeList", - "docstrings": [], - "signature": "type radioNodeList" - }, - { - "id": "Dom.processingInstruction", - "kind": "type", - "name": "processingInstruction", - "docstrings": [], - "signature": "type processingInstruction" - }, - { - "id": "Dom._shadowRoot", - "kind": "type", - "name": "_shadowRoot", - "docstrings": [], - "signature": "type _shadowRoot" - }, - { - "id": "Dom.shadowRoot", - "kind": "type", - "name": "shadowRoot", - "docstrings": [], - "signature": "type shadowRoot = node_like<_shadowRoot>" - }, - { - "id": "Dom._text", - "kind": "type", - "name": "_text", - "docstrings": [], - "signature": "type _text" - }, - { - "id": "Dom.text", - "kind": "type", - "name": "text", - "docstrings": [], - "signature": "type text = characterData_like<_text>" - }, - { - "id": "Dom.domRect", - "kind": "type", - "name": "domRect", - "docstrings": [], - "signature": "type domRect" - }, - { - "id": "Dom.dataTransfer", - "kind": "type", - "name": "dataTransfer", - "docstrings": [], - "signature": "type dataTransfer" - }, - { - "id": "Dom.domStringMap", - "kind": "type", - "name": "domStringMap", - "docstrings": [], - "signature": "type domStringMap" - }, - { - "id": "Dom.history", - "kind": "type", - "name": "history", - "docstrings": [], - "signature": "type history" - }, - { - "id": "Dom._htmlDocument", - "kind": "type", - "name": "_htmlDocument", - "docstrings": [], - "signature": "type _htmlDocument" - }, - { - "id": "Dom.htmlDocument", - "kind": "type", - "name": "htmlDocument", - "docstrings": [], - "signature": "type htmlDocument = document_like<_htmlDocument>" - }, - { - "id": "Dom._htmlElement", - "kind": "type", - "name": "_htmlElement", - "docstrings": [], - "signature": "type _htmlElement<'a>" - }, - { - "id": "Dom.htmlElement_like", - "kind": "type", - "name": "htmlElement_like", - "docstrings": [], - "signature": "type htmlElement_like<'a> = element_like<_htmlElement<'a>>" - }, - { - "id": "Dom.htmlElement", - "kind": "type", - "name": "htmlElement", - "docstrings": [], - "signature": "type htmlElement = htmlElement_like<_baseClass>" - }, - { - "id": "Dom._htmlAnchorElement", - "kind": "type", - "name": "_htmlAnchorElement", - "docstrings": [], - "signature": "type _htmlAnchorElement" - }, - { - "id": "Dom.htmlAnchorElement", - "kind": "type", - "name": "htmlAnchorElement", - "docstrings": [], - "signature": "type htmlAnchorElement = htmlElement_like<\n _htmlAnchorElement,\n>" - }, - { - "id": "Dom._htmlAreaElement", - "kind": "type", - "name": "_htmlAreaElement", - "docstrings": [], - "signature": "type _htmlAreaElement" - }, - { - "id": "Dom.htmlAreaElement", - "kind": "type", - "name": "htmlAreaElement", - "docstrings": [], - "signature": "type htmlAreaElement = htmlElement_like<_htmlAreaElement>" - }, - { - "id": "Dom._htmlAudioElement", - "kind": "type", - "name": "_htmlAudioElement", - "docstrings": [], - "signature": "type _htmlAudioElement" - }, - { - "id": "Dom.htmlAudioElement", - "kind": "type", - "name": "htmlAudioElement", - "docstrings": [], - "signature": "type htmlAudioElement = htmlElement_like<_htmlAudioElement>" - }, - { - "id": "Dom._htmlBaseElement", - "kind": "type", - "name": "_htmlBaseElement", - "docstrings": [], - "signature": "type _htmlBaseElement" - }, - { - "id": "Dom.htmlBaseElement", - "kind": "type", - "name": "htmlBaseElement", - "docstrings": [], - "signature": "type htmlBaseElement = htmlElement_like<_htmlBaseElement>" - }, - { - "id": "Dom._htmlBodyElement", - "kind": "type", - "name": "_htmlBodyElement", - "docstrings": [], - "signature": "type _htmlBodyElement" - }, - { - "id": "Dom.htmlBodyElement", - "kind": "type", - "name": "htmlBodyElement", - "docstrings": [], - "signature": "type htmlBodyElement = htmlElement_like<_htmlBodyElement>" - }, - { - "id": "Dom._htmlBrElement", - "kind": "type", - "name": "_htmlBrElement", - "docstrings": [], - "signature": "type _htmlBrElement" - }, - { - "id": "Dom.htmlBrElement", - "kind": "type", - "name": "htmlBrElement", - "docstrings": [], - "signature": "type htmlBrElement = htmlElement_like<_htmlBrElement>" - }, - { - "id": "Dom._htmlButtonElement", - "kind": "type", - "name": "_htmlButtonElement", - "docstrings": [], - "signature": "type _htmlButtonElement" - }, - { - "id": "Dom.htmlButtonElement", - "kind": "type", - "name": "htmlButtonElement", - "docstrings": [], - "signature": "type htmlButtonElement = htmlElement_like<\n _htmlButtonElement,\n>" - }, - { - "id": "Dom._htmlCanvasElement", - "kind": "type", - "name": "_htmlCanvasElement", - "docstrings": [], - "signature": "type _htmlCanvasElement" - }, - { - "id": "Dom.htmlCanvasElement", - "kind": "type", - "name": "htmlCanvasElement", - "docstrings": [], - "signature": "type htmlCanvasElement = htmlElement_like<\n _htmlCanvasElement,\n>" - }, - { - "id": "Dom._htmlDataElement", - "kind": "type", - "name": "_htmlDataElement", - "docstrings": [], - "signature": "type _htmlDataElement" - }, - { - "id": "Dom.htmlDataElement", - "kind": "type", - "name": "htmlDataElement", - "docstrings": [], - "signature": "type htmlDataElement = htmlElement_like<_htmlDataElement>" - }, - { - "id": "Dom._htmlDataListElement", - "kind": "type", - "name": "_htmlDataListElement", - "docstrings": [], - "signature": "type _htmlDataListElement" - }, - { - "id": "Dom.htmlDataListElement", - "kind": "type", - "name": "htmlDataListElement", - "docstrings": [], - "signature": "type htmlDataListElement = htmlElement_like<\n _htmlDataListElement,\n>" - }, - { - "id": "Dom._htmlDialogElement", - "kind": "type", - "name": "_htmlDialogElement", - "docstrings": [], - "signature": "type _htmlDialogElement" - }, - { - "id": "Dom.htmlDialogElement", - "kind": "type", - "name": "htmlDialogElement", - "docstrings": [], - "signature": "type htmlDialogElement = htmlElement_like<\n _htmlDialogElement,\n>" - }, - { - "id": "Dom._htmlDivElement", - "kind": "type", - "name": "_htmlDivElement", - "docstrings": [], - "signature": "type _htmlDivElement" - }, - { - "id": "Dom.htmlDivElement", - "kind": "type", - "name": "htmlDivElement", - "docstrings": [], - "signature": "type htmlDivElement = htmlElement_like<_htmlDivElement>" - }, - { - "id": "Dom._htmlDlistElement", - "kind": "type", - "name": "_htmlDlistElement", - "docstrings": [], - "signature": "type _htmlDlistElement" - }, - { - "id": "Dom.htmlDlistElement", - "kind": "type", - "name": "htmlDlistElement", - "docstrings": [], - "signature": "type htmlDlistElement = htmlElement_like<_htmlDlistElement>" - }, - { - "id": "Dom._htmlEmbedElement", - "kind": "type", - "name": "_htmlEmbedElement", - "docstrings": [], - "signature": "type _htmlEmbedElement" - }, - { - "id": "Dom.htmlEmbedElement", - "kind": "type", - "name": "htmlEmbedElement", - "docstrings": [], - "signature": "type htmlEmbedElement = htmlElement_like<_htmlEmbedElement>" - }, - { - "id": "Dom._htmlFieldSetElement", - "kind": "type", - "name": "_htmlFieldSetElement", - "docstrings": [], - "signature": "type _htmlFieldSetElement" - }, - { - "id": "Dom.htmlFieldSetElement", - "kind": "type", - "name": "htmlFieldSetElement", - "docstrings": [], - "signature": "type htmlFieldSetElement = htmlElement_like<\n _htmlFieldSetElement,\n>" - }, - { - "id": "Dom._htmlFormElement", - "kind": "type", - "name": "_htmlFormElement", - "docstrings": [], - "signature": "type _htmlFormElement" - }, - { - "id": "Dom.htmlFormElement", - "kind": "type", - "name": "htmlFormElement", - "docstrings": [], - "signature": "type htmlFormElement = htmlElement_like<_htmlFormElement>" - }, - { - "id": "Dom._htmlHeadElement", - "kind": "type", - "name": "_htmlHeadElement", - "docstrings": [], - "signature": "type _htmlHeadElement" - }, - { - "id": "Dom.htmlHeadElement", - "kind": "type", - "name": "htmlHeadElement", - "docstrings": [], - "signature": "type htmlHeadElement = htmlElement_like<_htmlHeadElement>" - }, - { - "id": "Dom._htmlHeadingElement", - "kind": "type", - "name": "_htmlHeadingElement", - "docstrings": [], - "signature": "type _htmlHeadingElement" - }, - { - "id": "Dom.htmlHeadingElement", - "kind": "type", - "name": "htmlHeadingElement", - "docstrings": [], - "signature": "type htmlHeadingElement = htmlElement_like<\n _htmlHeadingElement,\n>" - }, - { - "id": "Dom._htmlHrElement", - "kind": "type", - "name": "_htmlHrElement", - "docstrings": [], - "signature": "type _htmlHrElement" - }, - { - "id": "Dom.htmlHrElement", - "kind": "type", - "name": "htmlHrElement", - "docstrings": [], - "signature": "type htmlHrElement = htmlElement_like<_htmlHrElement>" - }, - { - "id": "Dom._htmlHtmlElement", - "kind": "type", - "name": "_htmlHtmlElement", - "docstrings": [], - "signature": "type _htmlHtmlElement" - }, - { - "id": "Dom.htmlHtmlElement", - "kind": "type", - "name": "htmlHtmlElement", - "docstrings": [], - "signature": "type htmlHtmlElement = htmlElement_like<_htmlHtmlElement>" - }, - { - "id": "Dom._htmlIframeElement", - "kind": "type", - "name": "_htmlIframeElement", - "docstrings": [], - "signature": "type _htmlIframeElement" - }, - { - "id": "Dom.htmlIframeElement", - "kind": "type", - "name": "htmlIframeElement", - "docstrings": [], - "signature": "type htmlIframeElement = htmlElement_like<\n _htmlIframeElement,\n>" - }, - { - "id": "Dom._htmlImageElement", - "kind": "type", - "name": "_htmlImageElement", - "docstrings": [], - "signature": "type _htmlImageElement" - }, - { - "id": "Dom.htmlImageElement", - "kind": "type", - "name": "htmlImageElement", - "docstrings": [], - "signature": "type htmlImageElement = htmlElement_like<_htmlImageElement>" - }, - { - "id": "Dom._htmlInputElement", - "kind": "type", - "name": "_htmlInputElement", - "docstrings": [], - "signature": "type _htmlInputElement" - }, - { - "id": "Dom.htmlInputElement", - "kind": "type", - "name": "htmlInputElement", - "docstrings": [], - "signature": "type htmlInputElement = htmlElement_like<_htmlInputElement>" - }, - { - "id": "Dom._htmlLabelElement", - "kind": "type", - "name": "_htmlLabelElement", - "docstrings": [], - "signature": "type _htmlLabelElement" - }, - { - "id": "Dom.htmlLabelElement", - "kind": "type", - "name": "htmlLabelElement", - "docstrings": [], - "signature": "type htmlLabelElement = htmlElement_like<_htmlLabelElement>" - }, - { - "id": "Dom._htmlLegendElement", - "kind": "type", - "name": "_htmlLegendElement", - "docstrings": [], - "signature": "type _htmlLegendElement" - }, - { - "id": "Dom.htmlLegendElement", - "kind": "type", - "name": "htmlLegendElement", - "docstrings": [], - "signature": "type htmlLegendElement = htmlElement_like<\n _htmlLegendElement,\n>" - }, - { - "id": "Dom._htmlLiElement", - "kind": "type", - "name": "_htmlLiElement", - "docstrings": [], - "signature": "type _htmlLiElement" - }, - { - "id": "Dom.htmlLiElement", - "kind": "type", - "name": "htmlLiElement", - "docstrings": [], - "signature": "type htmlLiElement = htmlElement_like<_htmlLiElement>" - }, - { - "id": "Dom._htmlLinkElement", - "kind": "type", - "name": "_htmlLinkElement", - "docstrings": [], - "signature": "type _htmlLinkElement" - }, - { - "id": "Dom.htmlLinkElement", - "kind": "type", - "name": "htmlLinkElement", - "docstrings": [], - "signature": "type htmlLinkElement = htmlElement_like<_htmlLinkElement>" - }, - { - "id": "Dom._htmlMapElement", - "kind": "type", - "name": "_htmlMapElement", - "docstrings": [], - "signature": "type _htmlMapElement" - }, - { - "id": "Dom.htmlMapElement", - "kind": "type", - "name": "htmlMapElement", - "docstrings": [], - "signature": "type htmlMapElement = htmlElement_like<_htmlMapElement>" - }, - { - "id": "Dom._htmlMediaElement", - "kind": "type", - "name": "_htmlMediaElement", - "docstrings": [], - "signature": "type _htmlMediaElement" - }, - { - "id": "Dom.htmlMediaElement", - "kind": "type", - "name": "htmlMediaElement", - "docstrings": [], - "signature": "type htmlMediaElement = htmlElement_like<_htmlMediaElement>" - }, - { - "id": "Dom._htmlMenuElement", - "kind": "type", - "name": "_htmlMenuElement", - "docstrings": [], - "signature": "type _htmlMenuElement" - }, - { - "id": "Dom.htmlMenuElement", - "kind": "type", - "name": "htmlMenuElement", - "docstrings": [], - "signature": "type htmlMenuElement = htmlElement_like<_htmlMenuElement>" - }, - { - "id": "Dom._htmlMetaElement", - "kind": "type", - "name": "_htmlMetaElement", - "docstrings": [], - "signature": "type _htmlMetaElement" - }, - { - "id": "Dom.htmlMetaElement", - "kind": "type", - "name": "htmlMetaElement", - "docstrings": [], - "signature": "type htmlMetaElement = htmlElement_like<_htmlMetaElement>" - }, - { - "id": "Dom._htmlMeterElement", - "kind": "type", - "name": "_htmlMeterElement", - "docstrings": [], - "signature": "type _htmlMeterElement" - }, - { - "id": "Dom.htmlMeterElement", - "kind": "type", - "name": "htmlMeterElement", - "docstrings": [], - "signature": "type htmlMeterElement = htmlElement_like<_htmlMeterElement>" - }, - { - "id": "Dom._htmlModElement", - "kind": "type", - "name": "_htmlModElement", - "docstrings": [], - "signature": "type _htmlModElement" - }, - { - "id": "Dom.htmlModElement", - "kind": "type", - "name": "htmlModElement", - "docstrings": [], - "signature": "type htmlModElement = htmlElement_like<_htmlModElement>" - }, - { - "id": "Dom._htmlOListElement", - "kind": "type", - "name": "_htmlOListElement", - "docstrings": [], - "signature": "type _htmlOListElement" - }, - { - "id": "Dom.htmlOListElement", - "kind": "type", - "name": "htmlOListElement", - "docstrings": [], - "signature": "type htmlOListElement = htmlElement_like<_htmlOListElement>" - }, - { - "id": "Dom._htmlObjectElement", - "kind": "type", - "name": "_htmlObjectElement", - "docstrings": [], - "signature": "type _htmlObjectElement" - }, - { - "id": "Dom.htmlObjectElement", - "kind": "type", - "name": "htmlObjectElement", - "docstrings": [], - "signature": "type htmlObjectElement = htmlElement_like<\n _htmlObjectElement,\n>" - }, - { - "id": "Dom._htmlOptGroupElement", - "kind": "type", - "name": "_htmlOptGroupElement", - "docstrings": [], - "signature": "type _htmlOptGroupElement" - }, - { - "id": "Dom.htmlOptGroupElement", - "kind": "type", - "name": "htmlOptGroupElement", - "docstrings": [], - "signature": "type htmlOptGroupElement = htmlElement_like<\n _htmlOptGroupElement,\n>" - }, - { - "id": "Dom._htmlOptionElement", - "kind": "type", - "name": "_htmlOptionElement", - "docstrings": [], - "signature": "type _htmlOptionElement" - }, - { - "id": "Dom.htmlOptionElement", - "kind": "type", - "name": "htmlOptionElement", - "docstrings": [], - "signature": "type htmlOptionElement = htmlElement_like<\n _htmlOptionElement,\n>" - }, - { - "id": "Dom._htmlOutputElement", - "kind": "type", - "name": "_htmlOutputElement", - "docstrings": [], - "signature": "type _htmlOutputElement" - }, - { - "id": "Dom.htmlOutputElement", - "kind": "type", - "name": "htmlOutputElement", - "docstrings": [], - "signature": "type htmlOutputElement = htmlElement_like<\n _htmlOutputElement,\n>" - }, - { - "id": "Dom._htmlParagraphElement", - "kind": "type", - "name": "_htmlParagraphElement", - "docstrings": [], - "signature": "type _htmlParagraphElement" - }, - { - "id": "Dom.htmlParagraphElement", - "kind": "type", - "name": "htmlParagraphElement", - "docstrings": [], - "signature": "type htmlParagraphElement = htmlElement_like<\n _htmlParagraphElement,\n>" - }, - { - "id": "Dom._htmlParamElement", - "kind": "type", - "name": "_htmlParamElement", - "docstrings": [], - "signature": "type _htmlParamElement" - }, - { - "id": "Dom.htmlParamElement", - "kind": "type", - "name": "htmlParamElement", - "docstrings": [], - "signature": "type htmlParamElement = htmlElement_like<_htmlParamElement>" - }, - { - "id": "Dom._htmlPreElement", - "kind": "type", - "name": "_htmlPreElement", - "docstrings": [], - "signature": "type _htmlPreElement" - }, - { - "id": "Dom.htmlPreElement", - "kind": "type", - "name": "htmlPreElement", - "docstrings": [], - "signature": "type htmlPreElement = htmlElement_like<_htmlPreElement>" - }, - { - "id": "Dom._htmlProgressElement", - "kind": "type", - "name": "_htmlProgressElement", - "docstrings": [], - "signature": "type _htmlProgressElement" - }, - { - "id": "Dom.htmlProgressElement", - "kind": "type", - "name": "htmlProgressElement", - "docstrings": [], - "signature": "type htmlProgressElement = htmlElement_like<\n _htmlProgressElement,\n>" - }, - { - "id": "Dom._htmlQuoteElement", - "kind": "type", - "name": "_htmlQuoteElement", - "docstrings": [], - "signature": "type _htmlQuoteElement" - }, - { - "id": "Dom.htmlQuoteElement", - "kind": "type", - "name": "htmlQuoteElement", - "docstrings": [], - "signature": "type htmlQuoteElement = htmlElement_like<_htmlQuoteElement>" - }, - { - "id": "Dom._htmlScriptElement", - "kind": "type", - "name": "_htmlScriptElement", - "docstrings": [], - "signature": "type _htmlScriptElement" - }, - { - "id": "Dom.htmlScriptElement", - "kind": "type", - "name": "htmlScriptElement", - "docstrings": [], - "signature": "type htmlScriptElement = htmlElement_like<\n _htmlScriptElement,\n>" - }, - { - "id": "Dom._htmlSelectElement", - "kind": "type", - "name": "_htmlSelectElement", - "docstrings": [], - "signature": "type _htmlSelectElement" - }, - { - "id": "Dom.htmlSelectElement", - "kind": "type", - "name": "htmlSelectElement", - "docstrings": [], - "signature": "type htmlSelectElement = htmlElement_like<\n _htmlSelectElement,\n>" - }, - { - "id": "Dom._htmlSlotElement", - "kind": "type", - "name": "_htmlSlotElement", - "docstrings": [], - "signature": "type _htmlSlotElement" - }, - { - "id": "Dom.htmlSlotElement", - "kind": "type", - "name": "htmlSlotElement", - "docstrings": [], - "signature": "type htmlSlotElement = htmlElement_like<_htmlSlotElement>" - }, - { - "id": "Dom._htmlSourceElement", - "kind": "type", - "name": "_htmlSourceElement", - "docstrings": [], - "signature": "type _htmlSourceElement" - }, - { - "id": "Dom.htmlSourceElement", - "kind": "type", - "name": "htmlSourceElement", - "docstrings": [], - "signature": "type htmlSourceElement = htmlElement_like<\n _htmlSourceElement,\n>" - }, - { - "id": "Dom._htmlSpanElement", - "kind": "type", - "name": "_htmlSpanElement", - "docstrings": [], - "signature": "type _htmlSpanElement" - }, - { - "id": "Dom.htmlSpanElement", - "kind": "type", - "name": "htmlSpanElement", - "docstrings": [], - "signature": "type htmlSpanElement = htmlElement_like<_htmlSpanElement>" - }, - { - "id": "Dom._htmlStyleElement", - "kind": "type", - "name": "_htmlStyleElement", - "docstrings": [], - "signature": "type _htmlStyleElement" - }, - { - "id": "Dom.htmlStyleElement", - "kind": "type", - "name": "htmlStyleElement", - "docstrings": [], - "signature": "type htmlStyleElement = htmlElement_like<_htmlStyleElement>" - }, - { - "id": "Dom._htmlTableCaptionElement", - "kind": "type", - "name": "_htmlTableCaptionElement", - "docstrings": [], - "signature": "type _htmlTableCaptionElement" - }, - { - "id": "Dom.htmlTableCaptionElement", - "kind": "type", - "name": "htmlTableCaptionElement", - "docstrings": [], - "signature": "type htmlTableCaptionElement = htmlElement_like<\n _htmlTableCaptionElement,\n>" - }, - { - "id": "Dom._htmlTableCellElement", - "kind": "type", - "name": "_htmlTableCellElement", - "docstrings": [], - "signature": "type _htmlTableCellElement" - }, - { - "id": "Dom.htmlTableCellElement", - "kind": "type", - "name": "htmlTableCellElement", - "docstrings": [], - "signature": "type htmlTableCellElement = htmlElement_like<\n _htmlTableCellElement,\n>" - }, - { - "id": "Dom._htmlTableColElement", - "kind": "type", - "name": "_htmlTableColElement", - "docstrings": [], - "signature": "type _htmlTableColElement" - }, - { - "id": "Dom.htmlTableColElement", - "kind": "type", - "name": "htmlTableColElement", - "docstrings": [], - "signature": "type htmlTableColElement = htmlElement_like<\n _htmlTableColElement,\n>" - }, - { - "id": "Dom._htmlTableDataCellElement", - "kind": "type", - "name": "_htmlTableDataCellElement", - "docstrings": [], - "signature": "type _htmlTableDataCellElement" - }, - { - "id": "Dom.htmlTableDataCellElement", - "kind": "type", - "name": "htmlTableDataCellElement", - "docstrings": [], - "signature": "type htmlTableDataCellElement = htmlElement_like<\n _htmlTableDataCellElement,\n>" - }, - { - "id": "Dom._htmlTableElement", - "kind": "type", - "name": "_htmlTableElement", - "docstrings": [], - "signature": "type _htmlTableElement" - }, - { - "id": "Dom.htmlTableElement", - "kind": "type", - "name": "htmlTableElement", - "docstrings": [], - "signature": "type htmlTableElement = htmlElement_like<_htmlTableElement>" - }, - { - "id": "Dom._htmlTableHeaderCellElement", - "kind": "type", - "name": "_htmlTableHeaderCellElement", - "docstrings": [], - "signature": "type _htmlTableHeaderCellElement" - }, - { - "id": "Dom.htmlTableHeaderCellElement", - "kind": "type", - "name": "htmlTableHeaderCellElement", - "docstrings": [], - "signature": "type htmlTableHeaderCellElement = htmlElement_like<\n _htmlTableHeaderCellElement,\n>" - }, - { - "id": "Dom._htmlTableRowElement", - "kind": "type", - "name": "_htmlTableRowElement", - "docstrings": [], - "signature": "type _htmlTableRowElement" - }, - { - "id": "Dom.htmlTableRowElement", - "kind": "type", - "name": "htmlTableRowElement", - "docstrings": [], - "signature": "type htmlTableRowElement = htmlElement_like<\n _htmlTableRowElement,\n>" - }, - { - "id": "Dom._htmlTableSectionElement", - "kind": "type", - "name": "_htmlTableSectionElement", - "docstrings": [], - "signature": "type _htmlTableSectionElement" - }, - { - "id": "Dom.htmlTableSectionElement", - "kind": "type", - "name": "htmlTableSectionElement", - "docstrings": [], - "signature": "type htmlTableSectionElement = htmlElement_like<\n _htmlTableSectionElement,\n>" - }, - { - "id": "Dom._htmlTextAreaElement", - "kind": "type", - "name": "_htmlTextAreaElement", - "docstrings": [], - "signature": "type _htmlTextAreaElement" - }, - { - "id": "Dom.htmlTextAreaElement", - "kind": "type", - "name": "htmlTextAreaElement", - "docstrings": [], - "signature": "type htmlTextAreaElement = htmlElement_like<\n _htmlTextAreaElement,\n>" - }, - { - "id": "Dom._htmlTimeElement", - "kind": "type", - "name": "_htmlTimeElement", - "docstrings": [], - "signature": "type _htmlTimeElement" - }, - { - "id": "Dom.htmlTimeElement", - "kind": "type", - "name": "htmlTimeElement", - "docstrings": [], - "signature": "type htmlTimeElement = htmlElement_like<_htmlTimeElement>" - }, - { - "id": "Dom._htmlTitleElement", - "kind": "type", - "name": "_htmlTitleElement", - "docstrings": [], - "signature": "type _htmlTitleElement" - }, - { - "id": "Dom.htmlTitleElement", - "kind": "type", - "name": "htmlTitleElement", - "docstrings": [], - "signature": "type htmlTitleElement = htmlElement_like<_htmlTitleElement>" - }, - { - "id": "Dom._htmlTrackElement", - "kind": "type", - "name": "_htmlTrackElement", - "docstrings": [], - "signature": "type _htmlTrackElement" - }, - { - "id": "Dom.htmlTrackElement", - "kind": "type", - "name": "htmlTrackElement", - "docstrings": [], - "signature": "type htmlTrackElement = htmlElement_like<_htmlTrackElement>" - }, - { - "id": "Dom._htmlUlistElement", - "kind": "type", - "name": "_htmlUlistElement", - "docstrings": [], - "signature": "type _htmlUlistElement" - }, - { - "id": "Dom.htmlUlistElement", - "kind": "type", - "name": "htmlUlistElement", - "docstrings": [], - "signature": "type htmlUlistElement = htmlElement_like<_htmlUlistElement>" - }, - { - "id": "Dom._htmlUnknownElement", - "kind": "type", - "name": "_htmlUnknownElement", - "docstrings": [], - "signature": "type _htmlUnknownElement" - }, - { - "id": "Dom.htmlUnknownElement", - "kind": "type", - "name": "htmlUnknownElement", - "docstrings": [], - "signature": "type htmlUnknownElement = htmlElement_like<\n _htmlUnknownElement,\n>" - }, - { - "id": "Dom._htmlVideoElement", - "kind": "type", - "name": "_htmlVideoElement", - "docstrings": [], - "signature": "type _htmlVideoElement" - }, - { - "id": "Dom.htmlVideoElement", - "kind": "type", - "name": "htmlVideoElement", - "docstrings": [], - "signature": "type htmlVideoElement = htmlElement_like<_htmlVideoElement>" - }, - { - "id": "Dom.location", - "kind": "type", - "name": "location", - "docstrings": [], - "signature": "type location" - }, - { - "id": "Dom.window", - "kind": "type", - "name": "window", - "docstrings": [], - "signature": "type window" - }, - { - "id": "Dom._xmlDocument", - "kind": "type", - "name": "_xmlDocument", - "docstrings": [], - "signature": "type _xmlDocument" - }, - { - "id": "Dom.xmlDocument", - "kind": "type", - "name": "xmlDocument", - "docstrings": [], - "signature": "type xmlDocument = document_like<_xmlDocument>" - }, - { - "id": "Dom.event_like", - "kind": "type", - "name": "event_like", - "docstrings": [], - "signature": "type event_like<'a>" - }, - { - "id": "Dom.event", - "kind": "type", - "name": "event", - "docstrings": [], - "signature": "type event = event_like<_baseClass>" - }, - { - "id": "Dom._uiEvent", - "kind": "type", - "name": "_uiEvent", - "docstrings": [], - "signature": "type _uiEvent<'a>" - }, - { - "id": "Dom.uiEvent_like", - "kind": "type", - "name": "uiEvent_like", - "docstrings": [], - "signature": "type uiEvent_like<'a> = event_like<_uiEvent<'a>>" - }, - { - "id": "Dom.uiEvent", - "kind": "type", - "name": "uiEvent", - "docstrings": [], - "signature": "type uiEvent = uiEvent_like<_baseClass>" - }, - { - "id": "Dom._animationEvent", - "kind": "type", - "name": "_animationEvent", - "docstrings": [], - "signature": "type _animationEvent" - }, - { - "id": "Dom.animationEvent", - "kind": "type", - "name": "animationEvent", - "docstrings": [], - "signature": "type animationEvent = event_like<_animationEvent>" - }, - { - "id": "Dom._beforeUnloadEvent", - "kind": "type", - "name": "_beforeUnloadEvent", - "docstrings": [], - "signature": "type _beforeUnloadEvent" - }, - { - "id": "Dom.beforeUnloadEvent", - "kind": "type", - "name": "beforeUnloadEvent", - "docstrings": [], - "signature": "type beforeUnloadEvent = event_like<_beforeUnloadEvent>" - }, - { - "id": "Dom._clipboardEvent", - "kind": "type", - "name": "_clipboardEvent", - "docstrings": [], - "signature": "type _clipboardEvent" - }, - { - "id": "Dom.clipboardEvent", - "kind": "type", - "name": "clipboardEvent", - "docstrings": [], - "signature": "type clipboardEvent = event_like<_clipboardEvent>" - }, - { - "id": "Dom._closeEvent", - "kind": "type", - "name": "_closeEvent", - "docstrings": [], - "signature": "type _closeEvent" - }, - { - "id": "Dom.closeEvent", - "kind": "type", - "name": "closeEvent", - "docstrings": [], - "signature": "type closeEvent = event_like<_closeEvent>" - }, - { - "id": "Dom._compositionEvent", - "kind": "type", - "name": "_compositionEvent", - "docstrings": [], - "signature": "type _compositionEvent" - }, - { - "id": "Dom.compositionEvent", - "kind": "type", - "name": "compositionEvent", - "docstrings": [], - "signature": "type compositionEvent = uiEvent_like<_compositionEvent>" - }, - { - "id": "Dom._customEvent", - "kind": "type", - "name": "_customEvent", - "docstrings": [], - "signature": "type _customEvent" - }, - { - "id": "Dom.customEvent", - "kind": "type", - "name": "customEvent", - "docstrings": [], - "signature": "type customEvent = event_like<_customEvent>" - }, - { - "id": "Dom._dragEvent", - "kind": "type", - "name": "_dragEvent", - "docstrings": [], - "signature": "type _dragEvent" - }, - { - "id": "Dom.dragEvent", - "kind": "type", - "name": "dragEvent", - "docstrings": [], - "signature": "type dragEvent = event_like<_dragEvent>" - }, - { - "id": "Dom._errorEvent", - "kind": "type", - "name": "_errorEvent", - "docstrings": [], - "signature": "type _errorEvent" - }, - { - "id": "Dom.errorEvent", - "kind": "type", - "name": "errorEvent", - "docstrings": [], - "signature": "type errorEvent = event_like<_errorEvent>" - }, - { - "id": "Dom._focusEvent", - "kind": "type", - "name": "_focusEvent", - "docstrings": [], - "signature": "type _focusEvent" - }, - { - "id": "Dom.focusEvent", - "kind": "type", - "name": "focusEvent", - "docstrings": [], - "signature": "type focusEvent = uiEvent_like<_focusEvent>" - }, - { - "id": "Dom._idbVersionChangeEvent", - "kind": "type", - "name": "_idbVersionChangeEvent", - "docstrings": [], - "signature": "type _idbVersionChangeEvent" - }, - { - "id": "Dom.idbVersionChangeEvent", - "kind": "type", - "name": "idbVersionChangeEvent", - "docstrings": [], - "signature": "type idbVersionChangeEvent = event_like<\n _idbVersionChangeEvent,\n>" - }, - { - "id": "Dom._inputEvent", - "kind": "type", - "name": "_inputEvent", - "docstrings": [], - "signature": "type _inputEvent" - }, - { - "id": "Dom.inputEvent", - "kind": "type", - "name": "inputEvent", - "docstrings": [], - "signature": "type inputEvent = uiEvent_like<_inputEvent>" - }, - { - "id": "Dom._keyboardEvent", - "kind": "type", - "name": "_keyboardEvent", - "docstrings": [], - "signature": "type _keyboardEvent" - }, - { - "id": "Dom.keyboardEvent", - "kind": "type", - "name": "keyboardEvent", - "docstrings": [], - "signature": "type keyboardEvent = uiEvent_like<_keyboardEvent>" - }, - { - "id": "Dom._mouseEvent", - "kind": "type", - "name": "_mouseEvent", - "docstrings": [], - "signature": "type _mouseEvent<'a>" - }, - { - "id": "Dom.mouseEvent_like", - "kind": "type", - "name": "mouseEvent_like", - "docstrings": [], - "signature": "type mouseEvent_like<'a> = uiEvent_like<_mouseEvent<'a>>" - }, - { - "id": "Dom.mouseEvent", - "kind": "type", - "name": "mouseEvent", - "docstrings": [], - "signature": "type mouseEvent = mouseEvent_like<_baseClass>" - }, - { - "id": "Dom._pageTransitionEvent", - "kind": "type", - "name": "_pageTransitionEvent", - "docstrings": [], - "signature": "type _pageTransitionEvent" - }, - { - "id": "Dom.pageTransitionEvent", - "kind": "type", - "name": "pageTransitionEvent", - "docstrings": [], - "signature": "type pageTransitionEvent = event_like<_pageTransitionEvent>" - }, - { - "id": "Dom._pointerEvent", - "kind": "type", - "name": "_pointerEvent", - "docstrings": [], - "signature": "type _pointerEvent" - }, - { - "id": "Dom.pointerEvent", - "kind": "type", - "name": "pointerEvent", - "docstrings": [], - "signature": "type pointerEvent = mouseEvent_like<_pointerEvent>" - }, - { - "id": "Dom._popStateEvent", - "kind": "type", - "name": "_popStateEvent", - "docstrings": [], - "signature": "type _popStateEvent" - }, - { - "id": "Dom.popStateEvent", - "kind": "type", - "name": "popStateEvent", - "docstrings": [], - "signature": "type popStateEvent = event_like<_popStateEvent>" - }, - { - "id": "Dom._progressEvent", - "kind": "type", - "name": "_progressEvent", - "docstrings": [], - "signature": "type _progressEvent" - }, - { - "id": "Dom.progressEvent", - "kind": "type", - "name": "progressEvent", - "docstrings": [], - "signature": "type progressEvent = event_like<_progressEvent>" - }, - { - "id": "Dom._relatedEvent", - "kind": "type", - "name": "_relatedEvent", - "docstrings": [], - "signature": "type _relatedEvent" - }, - { - "id": "Dom.relatedEvent", - "kind": "type", - "name": "relatedEvent", - "docstrings": [], - "signature": "type relatedEvent = event_like<_relatedEvent>" - }, - { - "id": "Dom._storageEvent", - "kind": "type", - "name": "_storageEvent", - "docstrings": [], - "signature": "type _storageEvent" - }, - { - "id": "Dom.storageEvent", - "kind": "type", - "name": "storageEvent", - "docstrings": [], - "signature": "type storageEvent = event_like<_storageEvent>" - }, - { - "id": "Dom._svgZoomEvent", - "kind": "type", - "name": "_svgZoomEvent", - "docstrings": [], - "signature": "type _svgZoomEvent" - }, - { - "id": "Dom.svgZoomEvent", - "kind": "type", - "name": "svgZoomEvent", - "docstrings": [], - "signature": "type svgZoomEvent = event_like<_svgZoomEvent>" - }, - { - "id": "Dom._timeEvent", - "kind": "type", - "name": "_timeEvent", - "docstrings": [], - "signature": "type _timeEvent" - }, - { - "id": "Dom.timeEvent", - "kind": "type", - "name": "timeEvent", - "docstrings": [], - "signature": "type timeEvent = event_like<_timeEvent>" - }, - { - "id": "Dom._touchEvent", - "kind": "type", - "name": "_touchEvent", - "docstrings": [], - "signature": "type _touchEvent" - }, - { - "id": "Dom.touchEvent", - "kind": "type", - "name": "touchEvent", - "docstrings": [], - "signature": "type touchEvent = uiEvent_like<_touchEvent>" - }, - { - "id": "Dom._trackEvent", - "kind": "type", - "name": "_trackEvent", - "docstrings": [], - "signature": "type _trackEvent" - }, - { - "id": "Dom.trackEvent", - "kind": "type", - "name": "trackEvent", - "docstrings": [], - "signature": "type trackEvent = event_like<_trackEvent>" - }, - { - "id": "Dom._transitionEvent", - "kind": "type", - "name": "_transitionEvent", - "docstrings": [], - "signature": "type _transitionEvent" - }, - { - "id": "Dom.transitionEvent", - "kind": "type", - "name": "transitionEvent", - "docstrings": [], - "signature": "type transitionEvent = event_like<_transitionEvent>" - }, - { - "id": "Dom._webGlContextEvent", - "kind": "type", - "name": "_webGlContextEvent", - "docstrings": [], - "signature": "type _webGlContextEvent" - }, - { - "id": "Dom.webGlContextEvent", - "kind": "type", - "name": "webGlContextEvent", - "docstrings": [], - "signature": "type webGlContextEvent = event_like<_webGlContextEvent>" - }, - { - "id": "Dom._wheelEvent", - "kind": "type", - "name": "_wheelEvent", - "docstrings": [], - "signature": "type _wheelEvent" - }, - { - "id": "Dom.wheelEvent", - "kind": "type", - "name": "wheelEvent", - "docstrings": [], - "signature": "type wheelEvent = uiEvent_like<_wheelEvent>" - }, - { - "id": "Dom.range", - "kind": "type", - "name": "range", - "docstrings": [], - "signature": "type range" - }, - { - "id": "Dom.selection", - "kind": "type", - "name": "selection", - "docstrings": [], - "signature": "type selection" - }, - { - "id": "Dom.domTokenList", - "kind": "type", - "name": "domTokenList", - "docstrings": [], - "signature": "type domTokenList" - }, - { - "id": "Dom.domSettableTokenList", - "kind": "type", - "name": "domSettableTokenList", - "docstrings": [], - "signature": "type domSettableTokenList" - }, - { - "id": "Dom.nodeFilter", - "kind": "type", - "name": "nodeFilter", - "docstrings": [], - "signature": "type nodeFilter = {acceptNode: element => int}" - }, - { - "id": "Dom.nodeIterator", - "kind": "type", - "name": "nodeIterator", - "docstrings": [], - "signature": "type nodeIterator" - }, - { - "id": "Dom.treeWalker", - "kind": "type", - "name": "treeWalker", - "docstrings": [], - "signature": "type treeWalker" - }, - { - "id": "Dom.svgRect", - "kind": "type", - "name": "svgRect", - "docstrings": [], - "signature": "type svgRect" - }, - { - "id": "Dom.svgPoint", - "kind": "type", - "name": "svgPoint", - "docstrings": [], - "signature": "type svgPoint" - }, - { - "id": "Dom.eventPointerId", - "kind": "type", - "name": "eventPointerId", - "docstrings": [], - "signature": "type eventPointerId" - } - ] - }, - "dom/storage2": { - "id": "Dom.Storage2", - "name": "Storage2", - "docstrings": [], - "items": [ - { - "id": "Dom.Storage2.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Dom.Storage2.getItem", - "kind": "value", - "name": "getItem", - "docstrings": [], - "signature": "let getItem: (t, string) => option" - }, - { - "id": "Dom.Storage2.setItem", - "kind": "value", - "name": "setItem", - "docstrings": [], - "signature": "let setItem: (t, string, string) => unit" - }, - { - "id": "Dom.Storage2.removeItem", - "kind": "value", - "name": "removeItem", - "docstrings": [], - "signature": "let removeItem: (t, string) => unit" - }, - { - "id": "Dom.Storage2.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Dom.Storage2.key", - "kind": "value", - "name": "key", - "docstrings": [], - "signature": "let key: (t, int) => option" - }, - { - "id": "Dom.Storage2.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int" - }, - { - "id": "Dom.Storage2.localStorage", - "kind": "value", - "name": "localStorage", - "docstrings": [], - "signature": "let localStorage: t" - }, - { - "id": "Dom.Storage2.sessionStorage", - "kind": "value", - "name": "sessionStorage", - "docstrings": [], - "signature": "let sessionStorage: t" - } - ] - }, - "dom/storage": { - "id": "Dom.Storage", - "name": "Storage", - "docstrings": [], - "items": [ - { - "id": "Dom.Storage.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Dom_storage2.t" - }, - { - "id": "Dom.Storage.getItem", - "kind": "value", - "name": "getItem", - "docstrings": [], - "signature": "let getItem: (string, t) => option" - }, - { - "id": "Dom.Storage.setItem", - "kind": "value", - "name": "setItem", - "docstrings": [], - "signature": "let setItem: (string, string, t) => unit" - }, - { - "id": "Dom.Storage.removeItem", - "kind": "value", - "name": "removeItem", - "docstrings": [], - "signature": "let removeItem: (string, t) => unit" - }, - { - "id": "Dom.Storage.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Dom.Storage.key", - "kind": "value", - "name": "key", - "docstrings": [], - "signature": "let key: (int, t) => option" - }, - { - "id": "Dom.Storage.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int" - }, - { - "id": "Dom.Storage.localStorage", - "kind": "value", - "name": "localStorage", - "docstrings": [], - "signature": "let localStorage: t" - }, - { - "id": "Dom.Storage.sessionStorage", - "kind": "value", - "name": "sessionStorage", - "docstrings": [], - "signature": "let sessionStorage: t" - } - ] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v12.1.0/js.json b/apps/docs/data/api/v12.1.0/js.json deleted file mode 100644 index b6d50b8ef..000000000 --- a/apps/docs/data/api/v12.1.0/js.json +++ /dev/null @@ -1,12866 +0,0 @@ -{ - "js": { - "id": "Js", - "name": "Js", - "docstrings": [ - "The Js module mostly contains ReScript bindings to _standard JavaScript APIs_\nlike [console.log](https://developer.mozilla.org/en-US/docs/Web/API/Console/log),\nor the JavaScript\n[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String),\n[Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date), and\n[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\nclasses.\n\nIt is meant as a zero-abstraction interop layer and directly exposes JavaScript functions as they are. If you can find your API in this module, prefer this over an equivalent Belt helper. For example, prefer [Js.Array2](js/array2) over [Belt.Array](belt/array)\n\n## Argument Order\n\nFor historical reasons, some APIs in the Js namespace (e.g. [Js.String](js/string)) are\nusing the data-last argument order whereas others (e.g. [Js.Date](js/date)) are using data-first.\n\nFor more information about these argument orders and the trade-offs between them, see\n[this blog post](https://www.javierchavarri.com/data-first-and-data-last-a-comparison/).\n\n_Eventually, all modules in the Js namespace are going to be migrated to data-first though._\n\n## Js.Xxx2 Modules\n\nPrefer `Js.Array2` over `Js.Array`, `Js.String2` over `Js.String`, etc. The latters are old modules." - ], - "items": [ - { - "id": "Js.t", - "kind": "type", - "name": "t", - "docstrings": [ - "JS object type" - ], - "signature": "type t<'a> = 'a\n constraint 'a = {..}", - "deprecated": "This has been deprecated and will be removed in v13. Use the `{..}` type directly instead." - }, - { - "id": "Js.globalThis", - "kind": "value", - "name": "globalThis", - "docstrings": [ - "JS global object reference" - ], - "signature": "let globalThis: t<{..}>", - "deprecated": "" - }, - { - "id": "Js.null", - "kind": "type", - "name": "null", - "docstrings": [], - "signature": "@unboxed\ntype null<'a> = Js_null.t<'a> = Value('a) | @as(null) Null", - "deprecated": "" - }, - { - "id": "Js.undefined", - "kind": "type", - "name": "undefined", - "docstrings": [], - "signature": "type undefined<'a> = Js_undefined.t<'a>", - "deprecated": "This has been deprecated and will be removed in v13." - }, - { - "id": "Js.nullable", - "kind": "type", - "name": "nullable", - "docstrings": [], - "signature": "@unboxed\ntype nullable<'a> = Js_null_undefined.t<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined", - "deprecated": "" - }, - { - "id": "Js.null_undefined", - "kind": "type", - "name": "null_undefined", - "docstrings": [], - "signature": "type null_undefined<'a> = nullable<'a>", - "deprecated": "" - }, - { - "id": "Js.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [], - "signature": "let toOption: nullable<'a> => option<'a>" - }, - { - "id": "Js.undefinedToOption", - "kind": "value", - "name": "undefinedToOption", - "docstrings": [], - "signature": "let undefinedToOption: undefined<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.nullToOption", - "kind": "value", - "name": "nullToOption", - "docstrings": [], - "signature": "let nullToOption: null<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [], - "signature": "let isNullable: nullable<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.import", - "kind": "value", - "name": "import", - "docstrings": [], - "signature": "let import: 'a => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.testAny", - "kind": "value", - "name": "testAny", - "docstrings": [ - "The same as {!test} except that it is more permissive on the types of input" - ], - "signature": "let testAny: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.promise", - "kind": "type", - "name": "promise", - "docstrings": [ - "The promise type, defined here for interoperation across packages." - ], - "signature": "type promise<+'a, +'e>", - "deprecated": "This is deprecated and will be removed in v13. Use the `promise` type directly instead." - }, - { - "id": "Js.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The same as empty in `Js.Null`. Compiles to `null`." - ], - "signature": "let null: null<'a>", - "deprecated": "" - }, - { - "id": "Js.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The same as empty `Js.Undefined`. Compiles to `undefined`." - ], - "signature": "let undefined: undefined<'a>", - "deprecated": "" - }, - { - "id": "Js.typeof", - "kind": "value", - "name": "typeof", - "docstrings": [ - "`typeof x` will be compiled as `typeof x` in JS. Please consider functions in\n`Js.Types` for a type safe way of reflection." - ], - "signature": "let typeof: 'a => string", - "deprecated": "" - }, - { - "id": "Js.log", - "kind": "value", - "name": "log", - "docstrings": [ - "Equivalent to console.log any value." - ], - "signature": "let log: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.log2", - "kind": "value", - "name": "log2", - "docstrings": [], - "signature": "let log2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.log3", - "kind": "value", - "name": "log3", - "docstrings": [], - "signature": "let log3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.log4", - "kind": "value", - "name": "log4", - "docstrings": [], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.logMany", - "kind": "value", - "name": "logMany", - "docstrings": [ - "A convenience function to console.log more than 4 arguments" - ], - "signature": "let logMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.eqNull", - "kind": "value", - "name": "eqNull", - "docstrings": [], - "signature": "let eqNull: ('a, null<'a>) => bool", - "deprecated": "" - }, - { - "id": "Js.eqUndefined", - "kind": "value", - "name": "eqUndefined", - "docstrings": [], - "signature": "let eqUndefined: ('a, undefined<'a>) => bool", - "deprecated": "" - }, - { - "id": "Js.eqNullable", - "kind": "value", - "name": "eqNullable", - "docstrings": [], - "signature": "let eqNullable: ('a, nullable<'a>) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_lt", - "kind": "value", - "name": "unsafe_lt", - "docstrings": [ - "`unsafe_lt(a, b)` will be compiled as `a < b`.\n It is marked as unsafe, since it is impossible\n to give a proper semantics for comparision which applies to any type" - ], - "signature": "let unsafe_lt: ('a, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_le", - "kind": "value", - "name": "unsafe_le", - "docstrings": [ - "`unsafe_le(a, b)` will be compiled as `a <= b`.\n See also `Js.unsafe_lt`." - ], - "signature": "let unsafe_le: ('a, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_gt", - "kind": "value", - "name": "unsafe_gt", - "docstrings": [ - "`unsafe_gt(a, b)` will be compiled as `a > b`.\n See also `Js.unsafe_lt`." - ], - "signature": "let unsafe_gt: ('a, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_ge", - "kind": "value", - "name": "unsafe_ge", - "docstrings": [ - "`unsafe_ge(a, b)` will be compiled as `a >= b`.\n See also `Js.unsafe_lt`." - ], - "signature": "let unsafe_ge: ('a, 'a) => bool", - "deprecated": "" - } - ] - }, - "js/typedarray2/dataview": { - "id": "Js.TypedArray2.DataView", - "name": "DataView", - "docstrings": [ - "The DataView view provides a low-level interface for reading and writing\nmultiple number types in an ArrayBuffer irrespective of the platform's endianness.\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)" - ], - "items": [ - { - "id": "Js.TypedArray2.DataView.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Js.TypedArray2.DataView.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array_buffer => t" - }, - { - "id": "Js.TypedArray2.DataView.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.DataView.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [], - "signature": "let fromBufferOffset: (array_buffer, int) => t" - }, - { - "id": "Js.TypedArray2.DataView.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t" - }, - { - "id": "Js.TypedArray2.DataView.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.DataView.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.DataView.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt8", - "kind": "value", - "name": "getInt8", - "docstrings": [], - "signature": "let getInt8: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint8", - "kind": "value", - "name": "getUint8", - "docstrings": [], - "signature": "let getUint8: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt16", - "kind": "value", - "name": "getInt16", - "docstrings": [], - "signature": "let getInt16: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt16LittleEndian", - "kind": "value", - "name": "getInt16LittleEndian", - "docstrings": [], - "signature": "let getInt16LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint16", - "kind": "value", - "name": "getUint16", - "docstrings": [], - "signature": "let getUint16: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint16LittleEndian", - "kind": "value", - "name": "getUint16LittleEndian", - "docstrings": [], - "signature": "let getUint16LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt32", - "kind": "value", - "name": "getInt32", - "docstrings": [], - "signature": "let getInt32: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt32LittleEndian", - "kind": "value", - "name": "getInt32LittleEndian", - "docstrings": [], - "signature": "let getInt32LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint32", - "kind": "value", - "name": "getUint32", - "docstrings": [], - "signature": "let getUint32: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint32LittleEndian", - "kind": "value", - "name": "getUint32LittleEndian", - "docstrings": [], - "signature": "let getUint32LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getFloat32", - "kind": "value", - "name": "getFloat32", - "docstrings": [], - "signature": "let getFloat32: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.getFloat32LittleEndian", - "kind": "value", - "name": "getFloat32LittleEndian", - "docstrings": [], - "signature": "let getFloat32LittleEndian: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.getFloat64", - "kind": "value", - "name": "getFloat64", - "docstrings": [], - "signature": "let getFloat64: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.getFloat64LittleEndian", - "kind": "value", - "name": "getFloat64LittleEndian", - "docstrings": [], - "signature": "let getFloat64LittleEndian: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.setInt8", - "kind": "value", - "name": "setInt8", - "docstrings": [], - "signature": "let setInt8: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint8", - "kind": "value", - "name": "setUint8", - "docstrings": [], - "signature": "let setUint8: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt16", - "kind": "value", - "name": "setInt16", - "docstrings": [], - "signature": "let setInt16: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt16LittleEndian", - "kind": "value", - "name": "setInt16LittleEndian", - "docstrings": [], - "signature": "let setInt16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint16", - "kind": "value", - "name": "setUint16", - "docstrings": [], - "signature": "let setUint16: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint16LittleEndian", - "kind": "value", - "name": "setUint16LittleEndian", - "docstrings": [], - "signature": "let setUint16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt32", - "kind": "value", - "name": "setInt32", - "docstrings": [], - "signature": "let setInt32: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt32LittleEndian", - "kind": "value", - "name": "setInt32LittleEndian", - "docstrings": [], - "signature": "let setInt32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint32", - "kind": "value", - "name": "setUint32", - "docstrings": [], - "signature": "let setUint32: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint32LittleEndian", - "kind": "value", - "name": "setUint32LittleEndian", - "docstrings": [], - "signature": "let setUint32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat32", - "kind": "value", - "name": "setFloat32", - "docstrings": [], - "signature": "let setFloat32: (t, int, float) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat32LittleEndian", - "kind": "value", - "name": "setFloat32LittleEndian", - "docstrings": [], - "signature": "let setFloat32LittleEndian: (t, int, float) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat64", - "kind": "value", - "name": "setFloat64", - "docstrings": [], - "signature": "let setFloat64: (t, int, float) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat64LittleEndian", - "kind": "value", - "name": "setFloat64LittleEndian", - "docstrings": [], - "signature": "let setFloat64LittleEndian: (t, int, float) => unit" - } - ] - }, - "js/typedarray2/float64array": { - "id": "Js.TypedArray2.Float64Array", - "name": "Float64Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Float64Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.TypedArray2.Float64Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Float64Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Float64Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Float64Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Float64Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Float64Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Float64Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Float64Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/float32array": { - "id": "Js.TypedArray2.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Float32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.TypedArray2.Float32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Float32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Float32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Float32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Float32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Float32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Float32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Float32Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/uint32array": { - "id": "Js.TypedArray2.Uint32Array", - "name": "Uint32Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint32Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/int32array": { - "id": "Js.TypedArray2.Int32Array", - "name": "Int32Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Int32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Int32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Int32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Int32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Int32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Int32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Int32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Int32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Int32Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/uint16array": { - "id": "Js.TypedArray2.Uint16Array", - "name": "Uint16Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t" - }, - { - "id": "Js.TypedArray2.Uint16Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t" - }, - { - "id": "Js.TypedArray2.Uint16Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>" - }, - { - "id": "Js.TypedArray2.Uint16Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b" - }, - { - "id": "Js.TypedArray2.Uint16Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b" - }, - { - "id": "Js.TypedArray2.Uint16Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b" - }, - { - "id": "Js.TypedArray2.Uint16Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/int16array": { - "id": "Js.TypedArray2.Int16Array", - "name": "Int16Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Int16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Int16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Int16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Int16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Int16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Int16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Int16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Int16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Int16Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int" - }, - { - "id": "Js.TypedArray2.Int16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t" - }, - { - "id": "Js.TypedArray2.Int16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t" - } - ] - }, - "js/typedarray2/uint8clampedarray": { - "id": "Js.TypedArray2.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint8ClampedArray.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/uint8array": { - "id": "Js.TypedArray2.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint8Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t" - }, - { - "id": "Js.TypedArray2.Uint8Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/int8array": { - "id": "Js.TypedArray2.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Int8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Int8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Int8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Int8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Int8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Int8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Int8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Int8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Int8Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Int8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/arraybuffer": { - "id": "Js.TypedArray2.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [ - "The underlying buffer that the typed arrays provide views of\n\n **see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)" - ], - "items": [ - { - "id": "Js.TypedArray2.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = array_buffer" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.make", - "kind": "value", - "name": "make", - "docstrings": [ - "takes length. initializes elements to 0" - ], - "signature": "let make: int => t" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (t, ~start: int, ~end_: int) => array_buffer", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => array_buffer", - "deprecated": "" - } - ] - }, - "js/typed_array/dataview": { - "id": "Js.Typed_array.DataView", - "name": "DataView", - "docstrings": [ - "The DataView view provides a low-level interface for reading and writing\nmultiple number types in an ArrayBuffer irrespective of the platform's endianness.\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)" - ], - "items": [ - { - "id": "Js.Typed_array.DataView.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Js_typed_array2.DataView.t" - }, - { - "id": "Js.Typed_array.DataView.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array_buffer => t" - }, - { - "id": "Js.Typed_array.DataView.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.DataView.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [], - "signature": "let fromBufferOffset: (array_buffer, int) => t" - }, - { - "id": "Js.Typed_array.DataView.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t" - }, - { - "id": "Js.Typed_array.DataView.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.DataView.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.DataView.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.DataView.getInt8", - "kind": "value", - "name": "getInt8", - "docstrings": [], - "signature": "let getInt8: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint8", - "kind": "value", - "name": "getUint8", - "docstrings": [], - "signature": "let getUint8: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt16", - "kind": "value", - "name": "getInt16", - "docstrings": [], - "signature": "let getInt16: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt16LittleEndian", - "kind": "value", - "name": "getInt16LittleEndian", - "docstrings": [], - "signature": "let getInt16LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint16", - "kind": "value", - "name": "getUint16", - "docstrings": [], - "signature": "let getUint16: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint16LittleEndian", - "kind": "value", - "name": "getUint16LittleEndian", - "docstrings": [], - "signature": "let getUint16LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt32", - "kind": "value", - "name": "getInt32", - "docstrings": [], - "signature": "let getInt32: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt32LittleEndian", - "kind": "value", - "name": "getInt32LittleEndian", - "docstrings": [], - "signature": "let getInt32LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint32", - "kind": "value", - "name": "getUint32", - "docstrings": [], - "signature": "let getUint32: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint32LittleEndian", - "kind": "value", - "name": "getUint32LittleEndian", - "docstrings": [], - "signature": "let getUint32LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getFloat32", - "kind": "value", - "name": "getFloat32", - "docstrings": [], - "signature": "let getFloat32: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.getFloat32LittleEndian", - "kind": "value", - "name": "getFloat32LittleEndian", - "docstrings": [], - "signature": "let getFloat32LittleEndian: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.getFloat64", - "kind": "value", - "name": "getFloat64", - "docstrings": [], - "signature": "let getFloat64: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.getFloat64LittleEndian", - "kind": "value", - "name": "getFloat64LittleEndian", - "docstrings": [], - "signature": "let getFloat64LittleEndian: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.setInt8", - "kind": "value", - "name": "setInt8", - "docstrings": [], - "signature": "let setInt8: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint8", - "kind": "value", - "name": "setUint8", - "docstrings": [], - "signature": "let setUint8: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt16", - "kind": "value", - "name": "setInt16", - "docstrings": [], - "signature": "let setInt16: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt16LittleEndian", - "kind": "value", - "name": "setInt16LittleEndian", - "docstrings": [], - "signature": "let setInt16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint16", - "kind": "value", - "name": "setUint16", - "docstrings": [], - "signature": "let setUint16: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint16LittleEndian", - "kind": "value", - "name": "setUint16LittleEndian", - "docstrings": [], - "signature": "let setUint16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt32", - "kind": "value", - "name": "setInt32", - "docstrings": [], - "signature": "let setInt32: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt32LittleEndian", - "kind": "value", - "name": "setInt32LittleEndian", - "docstrings": [], - "signature": "let setInt32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint32", - "kind": "value", - "name": "setUint32", - "docstrings": [], - "signature": "let setUint32: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint32LittleEndian", - "kind": "value", - "name": "setUint32LittleEndian", - "docstrings": [], - "signature": "let setUint32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat32", - "kind": "value", - "name": "setFloat32", - "docstrings": [], - "signature": "let setFloat32: (t, int, float) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat32LittleEndian", - "kind": "value", - "name": "setFloat32LittleEndian", - "docstrings": [], - "signature": "let setFloat32LittleEndian: (t, int, float) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat64", - "kind": "value", - "name": "setFloat64", - "docstrings": [], - "signature": "let setFloat64: (t, int, float) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat64LittleEndian", - "kind": "value", - "name": "setFloat64LittleEndian", - "docstrings": [], - "signature": "let setFloat64LittleEndian: (t, int, float) => unit" - } - ] - }, - "js/typed_array/float64_array": { - "id": "Js.Typed_array.Float64_array", - "name": "Float64_array", - "docstrings": [], - "items": [] - }, - "js/typed_array/float64array": { - "id": "Js.Typed_array.Float64Array", - "name": "Float64Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Float64Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.Typed_array.Float64Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Float64Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Float64Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Float64Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Float64Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Float64Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Float64Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Float64Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Float64Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.create", - "kind": "value", - "name": "create", - "docstrings": [], - "signature": "let create: array => t", - "deprecated": "use `make` instead" - }, - { - "id": "Js.Typed_array.Float64Array.of_buffer", - "kind": "value", - "name": "of_buffer", - "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" - } - ] - }, - "js/typed_array/float32_array": { - "id": "Js.Typed_array.Float32_array", - "name": "Float32_array", - "docstrings": [], - "items": [] - }, - "js/typed_array/float32array": { - "id": "Js.Typed_array.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Float32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.Typed_array.Float32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Float32Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Float32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Float32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Float32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Float32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Float32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Float32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Float32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.create", - "kind": "value", - "name": "create", - "docstrings": [], - "signature": "let create: array => t", - "deprecated": "use `make` instead" - }, - { - "id": "Js.Typed_array.Float32Array.of_buffer", - "kind": "value", - "name": "of_buffer", - "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" - } - ] - }, - "js/typed_array/uint32array": { - "id": "Js.Typed_array.Uint32Array", - "name": "Uint32Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint32Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/int32_array": { - "id": "Js.Typed_array.Int32_array", - "name": "Int32_array", - "docstrings": [], - "items": [] - }, - "js/typed_array/int32array": { - "id": "Js.Typed_array.Int32Array", - "name": "Int32Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Int32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Int32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int32Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Int32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Int32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Int32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Int32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Int32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Int32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Int32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.create", - "kind": "value", - "name": "create", - "docstrings": [], - "signature": "let create: array => t", - "deprecated": "use `make` instead" - }, - { - "id": "Js.Typed_array.Int32Array.of_buffer", - "kind": "value", - "name": "of_buffer", - "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" - } - ] - }, - "js/typed_array/uint16array": { - "id": "Js.Typed_array.Uint16Array", - "name": "Uint16Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint16Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/int16array": { - "id": "Js.Typed_array.Int16Array", - "name": "Int16Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Int16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Int16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int16Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Int16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Int16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Int16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Int16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Int16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Int16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Int16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/uint8clampedarray": { - "id": "Js.Typed_array.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint8ClampedArray.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint8ClampedArray.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/uint8array": { - "id": "Js.Typed_array.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint8Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.Uint8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/int8array": { - "id": "Js.Typed_array.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Int8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Int8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int8Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Int8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Int8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Int8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Int8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Int8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Int8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Int8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "Use `TypedArray.slice` instead." - }, - { - "id": "Js.Typed_array.Int8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "Use `TypedArray.sliceToEnd` instead." - }, - { - "id": "Js.Typed_array.Int8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.Int8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "throw Js.Exn.Error throw Js exception\n\n param offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "throw Js.Exn.Error throws Js exception\n\n param offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/s": { - "id": "Js.Typed_array.S", - "name": "S", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.S.elt", - "kind": "type", - "name": "elt", - "docstrings": [], - "signature": "type elt" - }, - { - "id": "Js.Typed_array.S.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.Typed_array.S.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.S.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.S.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.S.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.S.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.S.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.S.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int" - }, - { - "id": "Js.Typed_array.S.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t" - }, - { - "id": "Js.Typed_array.S.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: elt => bool", - "deprecated": "" - }, - { - "id": "Js.Typed_array.S.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "should we use `bool` or `boolean` seems they are intechangeable here" - ], - "signature": "let filter: (elt => bool) => t" - } - ] - }, - "js/typed_array/arraybuffer": { - "id": "Js.Typed_array.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [ - "The underlying buffer that the typed arrays provide views of\n\n **see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)" - ], - "items": [ - { - "id": "Js.Typed_array.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = array_buffer" - }, - { - "id": "Js.Typed_array.ArrayBuffer.make", - "kind": "value", - "name": "make", - "docstrings": [ - "takes length. initializes elements to 0" - ], - "signature": "let make: int => t" - }, - { - "id": "Js.Typed_array.ArrayBuffer.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - } - ] - }, - "js/typed_array/type": { - "id": "Js.Typed_array.Type", - "name": "Type", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Type.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - } - ] - }, - "js/json/kind": { - "id": "Js.Json.Kind", - "name": "Kind", - "docstrings": [], - "items": [ - { - "id": "Js.Json.Kind.json", - "kind": "type", - "name": "json", - "docstrings": [], - "signature": "type json = t" - }, - { - "id": "Js.Json.Kind.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Underlying type of a JSON value" - ], - "signature": "type t<_> =\n | String: t\n | Number: t\n | Object: t>\n | Array: t>\n | Boolean: t\n | Null: t" - } - ] - }, - "js/weakmap": { - "id": "Js.WeakMap", - "name": "WeakMap", - "docstrings": [ - "Provides bindings for ES6 WeakMap", - "ES6 WeakMap API" - ], - "items": [ - { - "id": "Js.WeakMap.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v> = WeakMap.t<'k, 'v>", - "deprecated": "" - } - ] - }, - "js/map": { - "id": "Js.Map", - "name": "Map", - "docstrings": [ - "Provides bindings for ES6 Map", - "ES6 Map API" - ], - "items": [ - { - "id": "Js.Map.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v> = Map.t<'k, 'v>", - "deprecated": "" - } - ] - }, - "js/weakset": { - "id": "Js.WeakSet", - "name": "WeakSet", - "docstrings": [ - "Provides bindings for ES6 WeakSet", - "ES6 WeakSet API" - ], - "items": [ - { - "id": "Js.WeakSet.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = WeakSet.t<'a>", - "deprecated": "" - } - ] - }, - "js/set": { - "id": "Js.Set", - "name": "Set", - "docstrings": [ - "Provides bindings for ES6 Set", - "ES6 Set API" - ], - "items": [ - { - "id": "Js.Set.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = Set.t<'a>", - "deprecated": "" - } - ] - }, - "js/console": { - "id": "Js.Console", - "name": "Console", - "docstrings": [ - "Provides bindings for console" - ], - "items": [ - { - "id": "Js.Console.log", - "kind": "value", - "name": "log", - "docstrings": [], - "signature": "let log: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.log2", - "kind": "value", - "name": "log2", - "docstrings": [], - "signature": "let log2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.log3", - "kind": "value", - "name": "log3", - "docstrings": [], - "signature": "let log3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.log4", - "kind": "value", - "name": "log4", - "docstrings": [], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.logMany", - "kind": "value", - "name": "logMany", - "docstrings": [], - "signature": "let logMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info", - "kind": "value", - "name": "info", - "docstrings": [], - "signature": "let info: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info2", - "kind": "value", - "name": "info2", - "docstrings": [], - "signature": "let info2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info3", - "kind": "value", - "name": "info3", - "docstrings": [], - "signature": "let info3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info4", - "kind": "value", - "name": "info4", - "docstrings": [], - "signature": "let info4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.infoMany", - "kind": "value", - "name": "infoMany", - "docstrings": [], - "signature": "let infoMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn", - "kind": "value", - "name": "warn", - "docstrings": [], - "signature": "let warn: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn2", - "kind": "value", - "name": "warn2", - "docstrings": [], - "signature": "let warn2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn3", - "kind": "value", - "name": "warn3", - "docstrings": [], - "signature": "let warn3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn4", - "kind": "value", - "name": "warn4", - "docstrings": [], - "signature": "let warn4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warnMany", - "kind": "value", - "name": "warnMany", - "docstrings": [], - "signature": "let warnMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error", - "kind": "value", - "name": "error", - "docstrings": [], - "signature": "let error: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error2", - "kind": "value", - "name": "error2", - "docstrings": [], - "signature": "let error2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error3", - "kind": "value", - "name": "error3", - "docstrings": [], - "signature": "let error3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error4", - "kind": "value", - "name": "error4", - "docstrings": [], - "signature": "let error4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.errorMany", - "kind": "value", - "name": "errorMany", - "docstrings": [], - "signature": "let errorMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.trace", - "kind": "value", - "name": "trace", - "docstrings": [], - "signature": "let trace: unit => unit", - "deprecated": "" - }, - { - "id": "Js.Console.timeStart", - "kind": "value", - "name": "timeStart", - "docstrings": [], - "signature": "let timeStart: string => unit", - "deprecated": "" - }, - { - "id": "Js.Console.timeEnd", - "kind": "value", - "name": "timeEnd", - "docstrings": [], - "signature": "let timeEnd: string => unit", - "deprecated": "" - }, - { - "id": "Js.Console.table", - "kind": "value", - "name": "table", - "docstrings": [], - "signature": "let table: 'a => unit", - "deprecated": "" - } - ] - }, - "js/result": { - "id": "Js.Result", - "name": "Result", - "docstrings": [ - "Define the interface for result" - ], - "items": [ - { - "id": "Js.Result.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'good, 'bad> = Ok('good) | Error('bad)", - "deprecated": "" - } - ] - }, - "js/option": { - "id": "Js.Option", - "name": "Option", - "docstrings": [ - "Provide utilities for option" - ], - "items": [ - { - "id": "Js.Option.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = option<'a>", - "deprecated": "" - }, - { - "id": "Js.Option.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: 'a => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Option.isSome", - "kind": "value", - "name": "isSome", - "docstrings": [], - "signature": "let isSome: option<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Option.isSomeValue", - "kind": "value", - "name": "isSomeValue", - "docstrings": [], - "signature": "let isSomeValue: (('a, 'a) => bool, 'a, option<'a>) => bool", - "deprecated": "Use `Option.equal` instead." - }, - { - "id": "Js.Option.isNone", - "kind": "value", - "name": "isNone", - "docstrings": [], - "signature": "let isNone: option<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Option.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: option<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Option.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (('a, 'b) => bool, option<'a>, option<'b>) => bool", - "deprecated": "" - }, - { - "id": "Js.Option.andThen", - "kind": "value", - "name": "andThen", - "docstrings": [], - "signature": "let andThen: ('a => option<'b>, option<'a>) => option<'b>", - "deprecated": "" - }, - { - "id": "Js.Option.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: ('a => 'b, option<'a>) => option<'b>", - "deprecated": "" - }, - { - "id": "Js.Option.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: ('a, option<'a>) => 'a", - "deprecated": "" - }, - { - "id": "Js.Option.default", - "kind": "value", - "name": "default", - "docstrings": [], - "signature": "let default: ('a, option<'a>) => 'a", - "deprecated": "" - }, - { - "id": "Js.Option.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: ('a => bool, option<'a>) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Option.firstSome", - "kind": "value", - "name": "firstSome", - "docstrings": [], - "signature": "let firstSome: (option<'a>, option<'a>) => option<'a>", - "deprecated": "" - } - ] - }, - "js/blob": { - "id": "Js.Blob", - "name": "Blob", - "docstrings": [ - "Provide utilities for Blob", - "JavaScript Blob API" - ], - "items": [ - { - "id": "Js.Blob.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - } - ] - }, - "js/file": { - "id": "Js.File", - "name": "File", - "docstrings": [ - "Provide utilities for File", - "JavaScript File API" - ], - "items": [ - { - "id": "Js.File.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - } - ] - }, - "js/bigint": { - "id": "Js.BigInt", - "name": "BigInt", - "docstrings": [ - "Provide utilities for bigint", - "JavaScript BigInt API" - ], - "items": [ - { - "id": "Js.BigInt.fromStringExn", - "kind": "value", - "name": "fromStringExn", - "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Return the\nnumber as a `bigint` if successfully parsed. Uncaught syntax exception otherwise.\n\n## Examples\n\n```rescript\n/* returns 123n */\nJs.BigInt.fromStringExn(\"123\")\n\n/* returns 0n */\nJs.BigInt.fromStringExn(\"\")\n\n/* returns 17n */\nJs.BigInt.fromStringExn(\"0x11\")\n\n/* returns 3n */\nJs.BigInt.fromStringExn(\"0b11\")\n\n/* returns 9n */\nJs.BigInt.fromStringExn(\"0o11\")\n\n/* catch exception */\ntry {\n Js.BigInt.fromStringExn(\"a\")\n} catch {\n| _ => Console.error(\"Error parsing bigint\")\n}\n```" - ], - "signature": "let fromStringExn: string => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.~-", - "kind": "value", - "name": "~-", - "docstrings": [], - "signature": "let ~-: bigint => bigint" - }, - { - "id": "Js.BigInt.~+", - "kind": "value", - "name": "~+", - "docstrings": [], - "signature": "let ~+: bigint => bigint" - }, - { - "id": "Js.BigInt.+", - "kind": "value", - "name": "+", - "docstrings": [], - "signature": "let +: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.-", - "kind": "value", - "name": "-", - "docstrings": [], - "signature": "let -: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.*", - "kind": "value", - "name": "*", - "docstrings": [], - "signature": "let *: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt./", - "kind": "value", - "name": "/", - "docstrings": [], - "signature": "let /: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.mod", - "kind": "value", - "name": "mod", - "docstrings": [], - "signature": "let mod: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.**", - "kind": "value", - "name": "**", - "docstrings": [], - "signature": "let **: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.land", - "kind": "value", - "name": "land", - "docstrings": [], - "signature": "let land: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lor", - "kind": "value", - "name": "lor", - "docstrings": [], - "signature": "let lor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lxor", - "kind": "value", - "name": "lxor", - "docstrings": [], - "signature": "let lxor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lnot", - "kind": "value", - "name": "lnot", - "docstrings": [], - "signature": "let lnot: bigint => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lsl", - "kind": "value", - "name": "lsl", - "docstrings": [], - "signature": "let lsl: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.asr", - "kind": "value", - "name": "asr", - "docstrings": [], - "signature": "let asr: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats a `bigint` as a string. Return a `string` representing the given value.\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123\" */\nJs.BigInt.toString(123n)->Js.log\n```" - ], - "signature": "let toString: bigint => string", - "deprecated": "" - }, - { - "id": "Js.BigInt.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Returns a string with a language-sensitive representation of this BigInt value.\n\n## Examples\n\n```rescript\n/* prints \"123\" */\nJs.BigInt.toString(123n)->Js.log\n```" - ], - "signature": "let toLocaleString: bigint => string", - "deprecated": "" - } - ] - }, - "js/int": { - "id": "Js.Int", - "name": "Int", - "docstrings": [ - "Provide utilities for int", - "Provide utilities for handling `int`." - ], - "items": [ - { - "id": "Js.Int.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "Formats an `int` using exponential (scientific) notation.\nReturns a `string` representing the given value in exponential notation.\nThrows `RangeError` if digits is not in the range \\[0, 20\\] (inclusive).\n\nSee [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.7e+1\" */\nJs.log(Js.Int.toExponential(77))\n```" - ], - "signature": "let toExponential: int => string", - "deprecated": "" - }, - { - "id": "Js.Int.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "Formats an `int` using exponential (scientific) notation.\n`digits` specifies how many digits should appear after the decimal point. The value must be in the range \\[0, 20\\] (inclusive).\n\nReturns a `string` representing the given value in exponential notation.\n\nThe output will be rounded or padded with zeroes if necessary.\nThrows `RangeError` if `digits` is not in the range \\[0, 20\\] (inclusive).\n\nSee [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.70e+1\" */\nJs.log(Js.Int.toExponentialWithPrecision(77, ~digits=2))\n\n/* prints \"5.68e+3\" */\nJs.log(Js.Int.toExponentialWithPrecision(5678, ~digits=2))\n```" - ], - "signature": "let toExponentialWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Int.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "Formats an `int` using some fairly arbitrary rules.\nReturns a `string` representing the given value in fixed-point (usually).\n\n`toPrecision` differs from `toFixed` in that the former will format the number with full precision, while the latter will not output any digits after the decimal point.\nThrows `RangeError` if `digits` is not in the range accepted by this function.\n\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123456789\" */\nJs.log(Js.Int.toPrecision(123456789))\n```" - ], - "signature": "let toPrecision: int => string", - "deprecated": "" - }, - { - "id": "Js.Int.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "Formats an `int` using some fairly arbitrary rules.\n`digits` specifies how many digits should appear in total. The value must between 0 and some arbitrary number that's hopefully at least larger than 20 (for Node it's 21. Why? Who knows).\n\nReturns a `string` representing the given value in fixed-point or scientific notation.\n\nThe output will be rounded or padded with zeroes if necessary.\n\n`toPrecisionWithPrecision` differs from `toFixedWithPrecision` in that the former will count all digits against the precision, while the latter will count only the digits after the decimal point.\n`toPrecisionWithPrecision` will also use scientific notation if the specified precision is less than the number of digits before the decimal point.\nThrows `RangeError` if `digits` is not in the range accepted by this function.\n\n\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"1.2e+8\" */\nJs.log(Js.Int.toPrecisionWithPrecision(123456789, ~digits=2))\n\n/* prints \"0.0\" */\nJs.log(Js.Int.toPrecisionWithPrecision(0, ~digits=2))\n```" - ], - "signature": "let toPrecisionWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Int.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats an `int` as a `string`. Returns a `string` representing the given value\nin fixed-point (usually).\n\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123456789\" */\nJs.log(Js.Int.toString(123456789))\n```" - ], - "signature": "let toString: int => string", - "deprecated": "" - }, - { - "id": "Js.Int.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "Formats an `int` as a `string`. `radix` specifies the radix base to use for the\nformatted number. The value must be in the range \\[2, 36\\] (inclusive). Returns\na `string` representing the given value in fixed-point (usually). Throws\n`RangeError` if `radix` is not in the range \\[2, 36\\] (inclusive).\n\n\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"110\" */\nJs.log(Js.Int.toStringWithRadix(6, ~radix=2))\n\n/* prints \"deadbeef\" */\nJs.log(Js.Int.toStringWithRadix(3735928559, ~radix=16))\n\n/* prints \"2n9c\" */\nJs.log(Js.Int.toStringWithRadix(123456, ~radix=36))\n```" - ], - "signature": "let toStringWithRadix: (int, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Js.Int.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [], - "signature": "let toFloat: int => float", - "deprecated": "" - }, - { - "id": "Js.Int.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (int, int) => bool", - "deprecated": "" - }, - { - "id": "Js.Int.max", - "kind": "value", - "name": "max", - "docstrings": [], - "signature": "let max: int" - }, - { - "id": "Js.Int.min", - "kind": "value", - "name": "min", - "docstrings": [], - "signature": "let min: int" - } - ] - }, - "js/float": { - "id": "Js.Float", - "name": "Float", - "docstrings": [ - "Provide utilities for JS float", - "Provide utilities for JS float." - ], - "items": [ - { - "id": "Js.Float._NaN", - "kind": "value", - "name": "_NaN", - "docstrings": [ - "The special value \"Not a Number\". See [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN) on MDN." - ], - "signature": "let _NaN: float", - "deprecated": "" - }, - { - "id": "Js.Float.isNaN", - "kind": "value", - "name": "isNaN", - "docstrings": [ - "Tests if the given value is `_NaN`\n\nNote that both `_NaN = _NaN` and `_NaN == _NaN` will return `false`. `isNaN` is\ntherefore necessary to test for `_NaN`. Return `true` if the given value is\n`_NaN`, `false` otherwise. See [`isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) on MDN." - ], - "signature": "let isNaN: float => bool", - "deprecated": "" - }, - { - "id": "Js.Float.isFinite", - "kind": "value", - "name": "isFinite", - "docstrings": [ - "Tests if the given value is finite. Return `true` if the given value is a finite\nnumber, `false` otherwise. See [`isFinite`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite) on MDN.\n\n## Examples\n\n```rescript\n/* returns [false] */\nJs.Float.isFinite(infinity)\n\n/* returns [false] */\nJs.Float.isFinite(neg_infinity)\n\n/* returns [false] */\nJs.Float.isFinite(Js.Float._NaN)\n\n/* returns [true] */\nJs.Float.isFinite(1234.)\n```" - ], - "signature": "let isFinite: float => bool", - "deprecated": "" - }, - { - "id": "Js.Float.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "Formats a `float` using exponential (scientific) notation. Return a\n`string` representing the given value in exponential notation. Throw\nRangeError if digits is not in the range \\[0, 20\\] (inclusive). See [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.71234e+1\" */\nJs.Float.toExponential(77.1234)->Js.log\n\n/* prints \"7.7e+1\" */\nJs.Float.toExponential(77.)->Js.log\n```" - ], - "signature": "let toExponential: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "Formats a `float` using exponential (scientific) notation. `digits` specifies\nhow many digits should appear after the decimal point. The value must be in\nthe range \\[0, 20\\] (inclusive). Return a `string` representing the given value\nin exponential notation. The output will be rounded or padded with zeroes if\nnecessary. Throw RangeError if `digits` is not in the range \\[0, 20\\] (inclusive).\nSee [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.71e+1\" */\nJs.Float.toExponentialWithPrecision(77.1234, ~digits=2)->Js.log\n```" - ], - "signature": "let toExponentialWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.toFixed", - "kind": "value", - "name": "toFixed", - "docstrings": [ - "Formats a `float` using fixed point notation. Return a `string` representing the\ngiven value in fixed-point notation (usually). Throw RangeError if digits is not\nin the range \\[0, 20\\] (inclusive). See [`toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"12346\" (note the rounding) */\nJs.Float.toFixed(12345.6789)->Js.log\n\n/* print \"1.2e+21\" */\nJs.Float.toFixed(1.2e21)->Js.log\n```" - ], - "signature": "let toFixed: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toFixedWithPrecision", - "kind": "value", - "name": "toFixedWithPrecision", - "docstrings": [ - "Formats a `float` using fixed point notation. `digits` specifies how many digits\nshould appear after the decimal point. The value must be in the range \\[0, 20\\]\n(inclusive). Defaults to `0`. Return a `string` representing the given value in\nfixed-point notation (usually). See [`toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\nThe output will be rounded or padded with zeroes if necessary.\n\nThrow RangeError if digits is not in the range \\[0, 20\\] (inclusive)\n\n## Examples\n\n```rescript\n/* prints \"12345.7\" (note the rounding) */\nJs.Float.toFixedWithPrecision(12345.6789, ~digits=1)->Js.log\n\n/* prints \"0.00\" (note the added zeroes) */\nJs.Float.toFixedWithPrecision(0., ~digits=2)->Js.log\n```" - ], - "signature": "let toFixedWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "Formats a `float` using some fairly arbitrary rules. Return a `string`\nrepresenting the given value in fixed-point (usually). `toPrecision` differs\nfrom `Js.Float.toFixed` in that the former will format the number with full\nprecision, while the latter will not output any digits after the decimal point.\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\nThrow RangeError if digits is not in the range accepted by this function (what do you mean \"vague\"?)\n\n## Examples\n\n```rescript\n/* prints \"12345.6789\" */\nJs.Float.toPrecision(12345.6789)->Js.log\n\n/* print \"1.2e+21\" */\nJs.Float.toPrecision(1.2e21)->Js.log\n```" - ], - "signature": "let toPrecision: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "Formats a `float` using some fairly arbitrary rules. `digits` specifies how many\ndigits should appear in total. The value must between 0 and some arbitrary number\nthat's hopefully at least larger than 20 (for Node it's 21. Why? Who knows).\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\nReturn a `string` representing the given value in fixed-point or scientific\nnotation. The output will be rounded or padded with zeroes if necessary.\n\n`toPrecisionWithPrecision` differs from `toFixedWithPrecision` in that the former\nwill count all digits against the precision, while the latter will count only\nthe digits after the decimal point. `toPrecisionWithPrecision` will also use\nscientific notation if the specified precision is less than the number for digits\nbefore the decimal point.\n\nThrow RangeError if digits is not in the range accepted by this function (what do you mean \"vague\"?)\n\n## Examples\n\n```rescript\n/* prints \"1e+4\" */\nJs.Float.toPrecisionWithPrecision(12345.6789, ~digits=1)->Js.log\n\n/* prints \"0.0\" */\nJs.Float.toPrecisionWithPrecision(0., ~digits=2)->Js.log\n```" - ], - "signature": "let toPrecisionWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats a `float` as a string. Return a `string` representing the given value in\nfixed-point (usually). See [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"12345.6789\" */\nJs.Float.toString(12345.6789)->Js.log\n```" - ], - "signature": "let toString: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "Formats a `float` as a string. `radix` specifies the radix base to use for the\nformatted number. The value must be in the range \\[2, 36\\] (inclusive). Return a\n`string` representing the given value in fixed-point (usually). See [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\nThrow RangeError if radix is not in the range \\[2, 36\\] (inclusive)\n\n## Examples\n\n```rescript\n/* prints \"110\" */\nJs.Float.toStringWithRadix(6., ~radix=2)->Js.log\n\n/* prints \"11.001000111101011100001010001111010111000010100011111\" */\nJs.Float.toStringWithRadix(3.14, ~radix=2)->Js.log\n\n/* prints \"deadbeef\" */\nJs.Float.toStringWithRadix(3735928559., ~radix=16)->Js.log\n\n/* prints \"3f.gez4w97ry0a18ymf6qadcxr\" */\nJs.Float.toStringWithRadix(123.456, ~radix=36)->Js.log\n```" - ], - "signature": "let toStringWithRadix: (float, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Parses the given `string` into a `float` using JavaScript semantics. Return the\nnumber as a `float` if successfully parsed, `_NaN` otherwise.\n\n## Examples\n\n```rescript\n/* returns 123 */\nJs.Float.fromString(\"123\")\n\n/* returns 12.3 */\nJs.Float.fromString(\"12.3\")\n\n/* returns 0 */\nJs.Float.fromString(\"\")\n\n/* returns 17 */\nJs.Float.fromString(\"0x11\")\n\n/* returns 3 */\nJs.Float.fromString(\"0b11\")\n\n/* returns 9 */\nJs.Float.fromString(\"0o11\")\n\n/* returns [_NaN] */\nJs.Float.fromString(\"hello\")\n\n/* returns [_NaN] */\nJs.Float.fromString(\"100a\")\n```" - ], - "signature": "let fromString: string => float", - "deprecated": "" - } - ] - }, - "js/types": { - "id": "Js.Types", - "name": "Types", - "docstrings": [ - "Provide utilities for manipulating JS types", - "Provide utilities for manipulating JS types." - ], - "items": [ - { - "id": "Js.Types.symbol", - "kind": "type", - "name": "symbol", - "docstrings": [ - "Js symbol type (only available in ES6)" - ], - "signature": "type symbol = Symbol.t", - "deprecated": "" - }, - { - "id": "Js.Types.obj_val", - "kind": "type", - "name": "obj_val", - "docstrings": [], - "signature": "type obj_val = \\\"Type.Classify\".object", - "deprecated": "" - }, - { - "id": "Js.Types.undefined_val", - "kind": "type", - "name": "undefined_val", - "docstrings": [ - "This type has only one value `undefined`" - ], - "signature": "type undefined_val", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.null_val", - "kind": "type", - "name": "null_val", - "docstrings": [ - "This type has only one value `null`" - ], - "signature": "type null_val", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.function_val", - "kind": "type", - "name": "function_val", - "docstrings": [], - "signature": "type function_val = \\\"Type.Classify\".function", - "deprecated": "" - }, - { - "id": "Js.Types.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<_> =\n | Undefined: t\n | Null: t\n | Boolean: t\n | Number: t\n | String: t\n | Function: t\n | Object: t\n | Symbol: t\n | BigInt: t", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.test", - "kind": "value", - "name": "test", - "docstrings": [ - "`test(value, t)` returns `true` if `value` is `typeof t`, otherwise `false`.\nThis is useful for doing runtime reflection on any given value.\n\n## Examples\n\n```rescript\ntest(\"test\", String) == true\ntest(() => true, Function) == true\ntest(\"test\", Boolean) == false\n```" - ], - "signature": "let test: ('a, t<'b>) => bool", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.tagged_t", - "kind": "type", - "name": "tagged_t", - "docstrings": [], - "signature": "type tagged_t =\n | JSFalse\n | JSTrue\n | JSNull\n | JSUndefined\n | JSNumber(float)\n | JSString(string)\n | JSFunction(function_val)\n | JSObject(obj_val)\n | JSSymbol(symbol)\n | JSBigInt(bigint)", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.classify", - "kind": "value", - "name": "classify", - "docstrings": [], - "signature": "let classify: 'a => tagged_t", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - } - ] - }, - "js/typedarray2": { - "id": "Js.TypedArray2", - "name": "TypedArray2", - "docstrings": [ - "Provide bindings for JS typed array", - "JavaScript Typed Array API\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)" - ], - "items": [ - { - "id": "Js.TypedArray2.array_buffer", - "kind": "type", - "name": "array_buffer", - "docstrings": [], - "signature": "type array_buffer = ArrayBuffer.t" - }, - { - "id": "Js.TypedArray2.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [], - "signature": "type array_like<'a>" - } - ] - }, - "js/typed_array": { - "id": "Js.Typed_array", - "name": "Typed_array", - "docstrings": [ - "Provide bindings for JS typed array", - "JavaScript Typed Array API\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)" - ], - "items": [ - { - "id": "Js.Typed_array.array_buffer", - "kind": "type", - "name": "array_buffer", - "docstrings": [], - "signature": "type array_buffer = Js_typed_array2.array_buffer", - "deprecated": "" - }, - { - "id": "Js.Typed_array.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [], - "signature": "type array_like<'a> = Js_typed_array2.array_like<'a>", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `TypedArray` module instead." - } - ] - }, - "js/obj": { - "id": "Js.Obj", - "name": "Obj", - "docstrings": [ - "Provide utilities for `Js.t`", - "Provides functions for inspecting and manipulating native JavaScript objects" - ], - "items": [ - { - "id": "Js.Obj.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "`empty()` returns the empty object `{}`" - ], - "signature": "let empty: unit => {..}", - "deprecated": "" - }, - { - "id": "Js.Obj.assign", - "kind": "value", - "name": "assign", - "docstrings": [ - "`assign(target, source)` copies properties from source to target.\nProperties in `target` will be overwritten by properties in `source` if they have the same key.\nReturns `target`.\n\n**See** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\n\n## Examples\n\n```rescript\n/* Copy an object */\n\nlet obj = {\"a\": 1}\n\nlet copy = Js.Obj.assign(Js.Obj.empty(), obj)\n\n/* prints \"{ a: 1 }\" */\nJs.log(copy)\n\n/* Merge objects with same properties */\n\nlet target = {\"a\": 1, \"b\": 1}\nlet source = {\"b\": 2}\n\nlet obj = Js.Obj.assign(target, source)\n\n/* prints \"{ a: 1, b: 2 }\" */\nJs.log(obj)\n\n/* prints \"{ a: 1, b: 2 }\", target is modified */\nJs.log(target)\n```" - ], - "signature": "let assign: ({..}, {..}) => {..}", - "deprecated": "" - }, - { - "id": "Js.Obj.keys", - "kind": "value", - "name": "keys", - "docstrings": [ - "`keys(obj)` returns an `array` of the keys of `obj`'s own enumerable properties." - ], - "signature": "let keys: {..} => array", - "deprecated": "" - } - ] - }, - "js/math": { - "id": "Js.Math", - "name": "Math", - "docstrings": [ - "Provide bindings for JS `Math` object", - "Provide utilities for JS Math. Note: The constants `_E`, `_LN10`, `_LN2`,\n`_LOG10E`, `_LOG2E`, `_PI`, `_SQRT1_2`, and `_SQRT2` begin with an underscore\nbecause ReScript variable names cannot begin with a capital letter. (Module\nnames begin with upper case.)" - ], - "items": [ - { - "id": "Js.Math._E", - "kind": "value", - "name": "_E", - "docstrings": [ - "Euler's number; ≈ 2.718281828459045. See\n[`Math.E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/E)\non MDN." - ], - "signature": "let _E: float", - "deprecated": "" - }, - { - "id": "Js.Math._LN2", - "kind": "value", - "name": "_LN2", - "docstrings": [ - "Natural logarithm of 2; ≈ 0.6931471805599453. See\n[`Math.LN2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN2)\non MDN." - ], - "signature": "let _LN2: float", - "deprecated": "" - }, - { - "id": "Js.Math._LN10", - "kind": "value", - "name": "_LN10", - "docstrings": [ - "Natural logarithm of 10; ≈ 2.302585092994046. See\n[`Math.LN10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN10)\non MDN." - ], - "signature": "let _LN10: float", - "deprecated": "" - }, - { - "id": "Js.Math._LOG2E", - "kind": "value", - "name": "_LOG2E", - "docstrings": [ - "Base 2 logarithm of E; ≈ 1.4426950408889634. See\n[`Math.LOG2E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG2E)\non MDN." - ], - "signature": "let _LOG2E: float", - "deprecated": "" - }, - { - "id": "Js.Math._LOG10E", - "kind": "value", - "name": "_LOG10E", - "docstrings": [ - "Base 10 logarithm of E; ≈ 0.4342944819032518. See\n[`Math.LOG10E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG10E)\non MDN." - ], - "signature": "let _LOG10E: float", - "deprecated": "" - }, - { - "id": "Js.Math._PI", - "kind": "value", - "name": "_PI", - "docstrings": [ - "Pi - ratio of the circumference to the diameter of a circle; ≈ 3.141592653589793. See\n[`Math.PI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/PI)\non MDN." - ], - "signature": "let _PI: float", - "deprecated": "" - }, - { - "id": "Js.Math._SQRT1_2", - "kind": "value", - "name": "_SQRT1_2", - "docstrings": [ - "Square root of 1/2; ≈ 0.7071067811865476. See\n[`Math.SQRT1_2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2)\non MDN." - ], - "signature": "let _SQRT1_2: float", - "deprecated": "" - }, - { - "id": "Js.Math._SQRT2", - "kind": "value", - "name": "_SQRT2", - "docstrings": [ - "Square root of 2; ≈ 1.4142135623730951. See\n[`Math.SQRT2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT2)\non MDN." - ], - "signature": "let _SQRT2: float", - "deprecated": "" - }, - { - "id": "Js.Math.abs_int", - "kind": "value", - "name": "abs_int", - "docstrings": [ - "Absolute value for integer argument. See\n[`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs)\non MDN." - ], - "signature": "let abs_int: int => int", - "deprecated": "" - }, - { - "id": "Js.Math.abs_float", - "kind": "value", - "name": "abs_float", - "docstrings": [ - "Absolute value for float argument. See\n[`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs)\non MDN." - ], - "signature": "let abs_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.acos", - "kind": "value", - "name": "acos", - "docstrings": [ - "Arccosine (in radians) of argument; returns `NaN` if the argument is outside\nthe range [-1.0, 1.0]. See\n[`Math.acos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acos)\non MDN." - ], - "signature": "let acos: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.acosh", - "kind": "value", - "name": "acosh", - "docstrings": [ - "Hyperbolic arccosine (in radians) of argument; returns `NaN` if the argument\nis less than 1.0. See\n[`Math.acosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acosh)\non MDN." - ], - "signature": "let acosh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.asin", - "kind": "value", - "name": "asin", - "docstrings": [ - "Arcsine (in radians) of argument; returns `NaN` if the argument is outside\nthe range [-1.0, 1.0]. See\n[`Math.asin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asin)\non MDN." - ], - "signature": "let asin: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.asinh", - "kind": "value", - "name": "asinh", - "docstrings": [ - "Hyperbolic arcsine (in radians) of argument. See\n[`Math.asinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh)\non MDN." - ], - "signature": "let asinh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.atan", - "kind": "value", - "name": "atan", - "docstrings": [ - "Arctangent (in radians) of argument. See\n[`Math.atan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan)\non MDN." - ], - "signature": "let atan: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.atanh", - "kind": "value", - "name": "atanh", - "docstrings": [ - "Hyperbolic arctangent (in radians) of argument; returns `NaN` if the argument\nis is outside the range [-1.0, 1.0]. Returns `-Infinity` and `Infinity` for\narguments -1.0 and 1.0. See\n[`Math.atanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh)\non MDN." - ], - "signature": "let atanh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.atan2", - "kind": "value", - "name": "atan2", - "docstrings": [ - "Returns the angle (in radians) of the quotient `y /. x`. It is also the angle\nbetween the *x*\\-axis and point (*x*, *y*). See\n[`Math.atan2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.atan2(~y=0.0, ~x=10.0, ()) == 0.0\nJs.Math.atan2(~x=5.0, ~y=5.0, ()) == Js.Math._PI /. 4.0\nJs.Math.atan2(~x=-5.0, ~y=5.0, ())\nJs.Math.atan2(~x=-5.0, ~y=5.0, ()) == 3.0 *. Js.Math._PI /. 4.0\nJs.Math.atan2(~x=-0.0, ~y=-5.0, ()) == -.Js.Math._PI /. 2.0\n```" - ], - "signature": "let atan2: (~y: float, ~x: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Math.cbrt", - "kind": "value", - "name": "cbrt", - "docstrings": [ - "Cube root. See\n[`Math.cbrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt)\non MDN" - ], - "signature": "let cbrt: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_ceil_int", - "kind": "value", - "name": "unsafe_ceil_int", - "docstrings": [ - "Returns the smallest integer greater than or equal to the argument. This\nfunction may return values not representable by `int`, whose range is\n\\-2147483648 to 2147483647. This is because, in JavaScript, there are only\n64-bit floating point numbers, which can represent integers in the range\n±(253\\-1) exactly. See\n[`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.unsafe_ceil_int(3.1) == 4\nJs.Math.unsafe_ceil_int(3.0) == 3\nJs.Math.unsafe_ceil_int(-3.1) == -3\nJs.Math.unsafe_ceil_int(1.0e15) // result is outside range of int datatype\n```" - ], - "signature": "let unsafe_ceil_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_ceil", - "kind": "value", - "name": "unsafe_ceil", - "docstrings": [], - "signature": "let unsafe_ceil: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.ceil_int", - "kind": "value", - "name": "ceil_int", - "docstrings": [ - "Returns the smallest `int` greater than or equal to the argument; the result\nis pinned to the range of the `int` data type: -2147483648 to 2147483647. See\n[`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.ceil_int(3.1) == 4\nJs.Math.ceil_int(3.0) == 3\nJs.Math.ceil_int(-3.1) == -3\nJs.Math.ceil_int(-1.0e15) == -2147483648\nJs.Math.ceil_int(1.0e15) == 2147483647\n```" - ], - "signature": "let ceil_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.ceil", - "kind": "value", - "name": "ceil", - "docstrings": [], - "signature": "let ceil: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.ceil_float", - "kind": "value", - "name": "ceil_float", - "docstrings": [ - "Returns the smallest integral value greater than or equal to the argument.\nThe result is a `float` and is not restricted to the `int` data type range.\nSee\n[`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.ceil_float(3.1) == 4.0\nJs.Math.ceil_float(3.0) == 3.0\nJs.Math.ceil_float(-3.1) == -3.0\nJs.Math.ceil_float(2_150_000_000.3) == 2_150_000_001.0\n```" - ], - "signature": "let ceil_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.clz32", - "kind": "value", - "name": "clz32", - "docstrings": [ - "Number of leading zero bits of the argument's 32 bit int representation. See\n[`Math.clz32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.clz32(0) == 32\nJs.Math.clz32(-1) == 0\nJs.Math.clz32(255) == 24\n```" - ], - "signature": "let clz32: int => int", - "deprecated": "" - }, - { - "id": "Js.Math.cos", - "kind": "value", - "name": "cos", - "docstrings": [ - "Cosine of argument, which must be specified in radians. See\n[`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos)\non MDN." - ], - "signature": "let cos: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.cosh", - "kind": "value", - "name": "cosh", - "docstrings": [ - "Hyperbolic cosine of argument, which must be specified in radians. See\n[`Math.cosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh)\non MDN." - ], - "signature": "let cosh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.exp", - "kind": "value", - "name": "exp", - "docstrings": [ - "Natural exponentional; returns *e* (the base of natural logarithms) to the\npower of the given argument. See\n[`Math.exp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/exp)\non MDN." - ], - "signature": "let exp: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.expm1", - "kind": "value", - "name": "expm1", - "docstrings": [ - "Returns *e* (the base of natural logarithms) to the power of the given\nargument minus 1. See\n[`Math.expm1`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1)\non MDN." - ], - "signature": "let expm1: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_floor_int", - "kind": "value", - "name": "unsafe_floor_int", - "docstrings": [ - "Returns the largest integer less than or equal to the argument. This function\nmay return values not representable by `int`, whose range is -2147483648 to\n2147483647. This is because, in JavaScript, there are only 64-bit floating\npoint numbers, which can represent integers in the range\n±(253\\-1) exactly. See\n[`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.unsafe_floor_int(3.7) == 3\nJs.Math.unsafe_floor_int(3.0) == 3\nJs.Math.unsafe_floor_int(-3.7) == -4\nJs.Math.unsafe_floor_int(1.0e15) // result is outside range of int datatype\n```" - ], - "signature": "let unsafe_floor_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_floor", - "kind": "value", - "name": "unsafe_floor", - "docstrings": [], - "signature": "let unsafe_floor: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.floor_int", - "kind": "value", - "name": "floor_int", - "docstrings": [ - "Returns the largest `int` less than or equal to the argument; the result is\npinned to the range of the `int` data type: -2147483648 to 2147483647. See\n[`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.floor_int(3.7) == 3\nJs.Math.floor_int(3.0) == 3\nJs.Math.floor_int(-3.1) == -4\nJs.Math.floor_int(-1.0e15) == -2147483648\nJs.Math.floor_int(1.0e15) == 2147483647\n```" - ], - "signature": "let floor_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.floor", - "kind": "value", - "name": "floor", - "docstrings": [], - "signature": "let floor: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.floor_float", - "kind": "value", - "name": "floor_float", - "docstrings": [ - "Returns the largest integral value less than or equal to the argument. The\nresult is a `float` and is not restricted to the `int` data type range. See\n[`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.floor_float(3.7) == 3.0\nJs.Math.floor_float(3.0) == 3.0\nJs.Math.floor_float(-3.1) == -4.0\nJs.Math.floor_float(2_150_000_000.3) == 2_150_000_000.0\n```" - ], - "signature": "let floor_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.fround", - "kind": "value", - "name": "fround", - "docstrings": [ - "Round to nearest single precision float. See\n[`Math.fround`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.fround(5.5) == 5.5\nJs.Math.fround(5.05) == 5.050000190734863\n```" - ], - "signature": "let fround: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.hypot", - "kind": "value", - "name": "hypot", - "docstrings": [ - "Returns the square root of the sum of squares of its two arguments (the\nPythagorean formula). See\n[`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot)\non MDN." - ], - "signature": "let hypot: (float, float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.hypotMany", - "kind": "value", - "name": "hypotMany", - "docstrings": [ - "Returns the square root of the sum of squares of the numbers in the array\nargument (generalized Pythagorean equation). Using an array allows you to\nhave more than two items. See\n[`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.hypotMany([3.0, 4.0, 12.0]) == 13.0\n```" - ], - "signature": "let hypotMany: array => float", - "deprecated": "" - }, - { - "id": "Js.Math.imul", - "kind": "value", - "name": "imul", - "docstrings": [ - "32-bit integer multiplication. Use this only when you need to optimize\nperformance of multiplication of numbers stored as 32-bit integers. See\n[`Math.imul`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul)\non MDN." - ], - "signature": "let imul: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.log", - "kind": "value", - "name": "log", - "docstrings": [ - "Returns the natural logarithm of its argument; this is the number *x* such\nthat *e**x* equals the argument. Returns `NaN` for negative\narguments. See\n[`Math.log`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log(Js.Math._E) == 1.0\nJs.Math.log(100.0) == 4.605170185988092\n```" - ], - "signature": "let log: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.log1p", - "kind": "value", - "name": "log1p", - "docstrings": [ - "Returns the natural logarithm of one plus the argument. Returns `NaN` for\narguments less than -1. See\n[`Math.log1p`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log1p)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log1p(Js.Math._E -. 1.0) == 1.0\nJs.Math.log1p(99.0) == 4.605170185988092\n```" - ], - "signature": "let log1p: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.log10", - "kind": "value", - "name": "log10", - "docstrings": [ - "Returns the base 10 logarithm of its argument. Returns `NaN` for negative\narguments. See\n[`Math.log10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log10)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log10(1000.0) == 3.0\nJs.Math.log10(0.01) == -2.0\nJs.Math.log10(Js.Math.sqrt(10.0)) == 0.5\n```" - ], - "signature": "let log10: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.log2", - "kind": "value", - "name": "log2", - "docstrings": [ - "Returns the base 2 logarithm of its argument. Returns `NaN` for negative\narguments. See\n[`Math.log2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log2(512.0) == 9.0\nJs.Math.log2(0.125) == -3.0\nJs.Math.log2(Js.Math._SQRT2) == 0.5000000000000001 // due to precision\n```" - ], - "signature": "let log2: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.max_int", - "kind": "value", - "name": "max_int", - "docstrings": [ - "Returns the maximum of its two integer arguments. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let max_int: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.maxMany_int", - "kind": "value", - "name": "maxMany_int", - "docstrings": [ - "Returns the maximum of the integers in the given array. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let maxMany_int: array => int", - "deprecated": "" - }, - { - "id": "Js.Math.max_float", - "kind": "value", - "name": "max_float", - "docstrings": [ - "Returns the maximum of its two floating point arguments. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let max_float: (float, float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.maxMany_float", - "kind": "value", - "name": "maxMany_float", - "docstrings": [ - "Returns the maximum of the floating point values in the given array. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let maxMany_float: array => float", - "deprecated": "" - }, - { - "id": "Js.Math.min_int", - "kind": "value", - "name": "min_int", - "docstrings": [ - "Returns the minimum of its two integer arguments. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let min_int: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.minMany_int", - "kind": "value", - "name": "minMany_int", - "docstrings": [ - "Returns the minimum of the integers in the given array. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let minMany_int: array => int", - "deprecated": "" - }, - { - "id": "Js.Math.min_float", - "kind": "value", - "name": "min_float", - "docstrings": [ - "Returns the minimum of its two floating point arguments. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let min_float: (float, float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.minMany_float", - "kind": "value", - "name": "minMany_float", - "docstrings": [ - "Returns the minimum of the floating point values in the given array. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let minMany_float: array => float", - "deprecated": "" - }, - { - "id": "Js.Math.pow_int", - "kind": "value", - "name": "pow_int", - "docstrings": [ - "Throws the given base to the given exponent. (Arguments and result are\nintegers.) See\n[`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.pow_int(~base=3, ~exp=4) == 81\n```" - ], - "signature": "let pow_int: (~base: int, ~exp: int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.pow_float", - "kind": "value", - "name": "pow_float", - "docstrings": [ - "Throws the given base to the given exponent. (Arguments and result are\nfloats.) Returns `NaN` if the result would be imaginary. See\n[`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.pow_float(~base=3.0, ~exp=4.0) == 81.0\nJs.Math.pow_float(~base=4.0, ~exp=-2.0) == 0.0625\nJs.Math.pow_float(~base=625.0, ~exp=0.5) == 25.0\nJs.Math.pow_float(~base=625.0, ~exp=-0.5) == 0.04\nJs.Float.isNaN(Js.Math.pow_float(~base=-2.0, ~exp=0.5)) == true\n```" - ], - "signature": "let pow_float: (~base: float, ~exp: float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.random", - "kind": "value", - "name": "random", - "docstrings": [ - "Returns a random number in the half-closed interval [0,1). See\n[`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\non MDN." - ], - "signature": "let random: unit => float", - "deprecated": "" - }, - { - "id": "Js.Math.random_int", - "kind": "value", - "name": "random_int", - "docstrings": [ - "A call to `random_int(minVal, maxVal)` returns a random number in the\nhalf-closed interval [minVal, maxVal). See\n[`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\non MDN." - ], - "signature": "let random_int: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_round", - "kind": "value", - "name": "unsafe_round", - "docstrings": [ - "Rounds its argument to nearest integer. For numbers with a fractional portion\nof exactly 0.5, the argument is rounded to the next integer in the direction\nof positive infinity. This function may return values not representable by\n`int`, whose range is -2147483648 to 2147483647. This is because, in\nJavaScript, there are only 64-bit floating point numbers, which can represent\nintegers in the range ±(253\\-1) exactly. See\n[`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.unsafe_round(3.7) == 4\nJs.Math.unsafe_round(-3.5) == -3\nJs.Math.unsafe_round(2_150_000_000_000.3) // out of range for int\n```" - ], - "signature": "let unsafe_round: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.round", - "kind": "value", - "name": "round", - "docstrings": [ - "Rounds to nearest integral value (expressed as a float). See\n[`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round)\non MDN." - ], - "signature": "let round: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sign_int", - "kind": "value", - "name": "sign_int", - "docstrings": [ - "Returns the sign of its integer argument: -1 if negative, 0 if zero, 1 if\npositive. See\n[`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign)\non MDN." - ], - "signature": "let sign_int: int => int", - "deprecated": "" - }, - { - "id": "Js.Math.sign_float", - "kind": "value", - "name": "sign_float", - "docstrings": [ - "Returns the sign of its float argument: -1.0 if negative, 0.0 if zero, 1.0 if\npositive. See\n[`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign)\non MDN." - ], - "signature": "let sign_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sin", - "kind": "value", - "name": "sin", - "docstrings": [ - "Sine of argument, which must be specified in radians. See\n[`Math.sin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin)\non MDN." - ], - "signature": "let sin: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sinh", - "kind": "value", - "name": "sinh", - "docstrings": [ - "Hyperbolic sine of argument, which must be specified in radians. See\n[`Math.sinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sinh)\non MDN." - ], - "signature": "let sinh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sqrt", - "kind": "value", - "name": "sqrt", - "docstrings": [ - "Square root. If the argument is negative, this function returns `NaN`. See\n[`Math.sqrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt)\non MDN." - ], - "signature": "let sqrt: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.tan", - "kind": "value", - "name": "tan", - "docstrings": [ - "Tangent of argument, which must be specified in radians. Returns `NaN` if the\nargument is positive infinity or negative infinity. See\n[`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos)\non MDN." - ], - "signature": "let tan: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.tanh", - "kind": "value", - "name": "tanh", - "docstrings": [ - "Hyperbolic tangent of argument, which must be specified in radians. See\n[`Math.tanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tanh)\non MDN." - ], - "signature": "let tanh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_trunc", - "kind": "value", - "name": "unsafe_trunc", - "docstrings": [ - "Truncates its argument; i.e., removes fractional digits. This function may\nreturn values not representable by `int`, whose range is -2147483648 to\n2147483647. This is because, in JavaScript, there are only 64-bit floating\npoint numbers, which can represent integers in the range ±(253-1)\nexactly. See\n[`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc)\non MDN." - ], - "signature": "let unsafe_trunc: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.trunc", - "kind": "value", - "name": "trunc", - "docstrings": [ - "Truncates its argument; i.e., removes fractional digits. See\n[`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc)\non MDN." - ], - "signature": "let trunc: float => float", - "deprecated": "" - } - ] - }, - "js/json": { - "id": "Js.Json", - "name": "Json", - "docstrings": [ - "Provide utilities for json", - "Efficient JSON encoding using JavaScript API\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON)" - ], - "items": [ - { - "id": "Js.Json.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The JSON data structure" - ], - "signature": "@unboxed\ntype t = JSON.t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)", - "deprecated": "" - }, - { - "id": "Js.Json.tagged_t", - "kind": "type", - "name": "tagged_t", - "docstrings": [], - "signature": "type tagged_t =\n | JSONFalse\n | JSONTrue\n | JSONNull\n | JSONString(string)\n | JSONNumber(float)\n | JSONObject(dict)\n | JSONArray(array)", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.classify", - "kind": "value", - "name": "classify", - "docstrings": [], - "signature": "let classify: t => tagged_t", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.test", - "kind": "value", - "name": "test", - "docstrings": [ - "`test(v, kind)` returns `true` if `v` is of `kind`." - ], - "signature": "let test: ('a, Kind.t<'b>) => bool", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.decodeString", - "kind": "value", - "name": "decodeString", - "docstrings": [ - "`decodeString(json)` returns `Some(s)` if `json` is a `string`, `None` otherwise." - ], - "signature": "let decodeString: t => option", - "deprecated": "" - }, - { - "id": "Js.Json.decodeNumber", - "kind": "value", - "name": "decodeNumber", - "docstrings": [ - "`decodeNumber(json)` returns `Some(n)` if `json` is a `number`, `None` otherwise." - ], - "signature": "let decodeNumber: t => option", - "deprecated": "" - }, - { - "id": "Js.Json.decodeObject", - "kind": "value", - "name": "decodeObject", - "docstrings": [ - "`decodeObject(json)` returns `Some(o)` if `json` is an `object`, `None` otherwise." - ], - "signature": "let decodeObject: t => option>", - "deprecated": "" - }, - { - "id": "Js.Json.decodeArray", - "kind": "value", - "name": "decodeArray", - "docstrings": [ - "`decodeArray(json)` returns `Some(a)` if `json` is an `array`, `None` otherwise." - ], - "signature": "let decodeArray: t => option>", - "deprecated": "" - }, - { - "id": "Js.Json.decodeBoolean", - "kind": "value", - "name": "decodeBoolean", - "docstrings": [ - "`decodeBoolean(json)` returns `Some(b)` if `json` is a `boolean`, `None` otherwise." - ], - "signature": "let decodeBoolean: t => option", - "deprecated": "" - }, - { - "id": "Js.Json.decodeNull", - "kind": "value", - "name": "decodeNull", - "docstrings": [ - "`decodeNull(json)` returns `Some(null)` if `json` is a `null`, `None` otherwise." - ], - "signature": "let decodeNull: t => option>", - "deprecated": "" - }, - { - "id": "Js.Json.null", - "kind": "value", - "name": "null", - "docstrings": [ - "`null` is the singleton null JSON value." - ], - "signature": "let null: t", - "deprecated": "" - }, - { - "id": "Js.Json.string", - "kind": "value", - "name": "string", - "docstrings": [ - "`string(s)` makes a JSON string of the `string` `s`." - ], - "signature": "let string: string => t", - "deprecated": "" - }, - { - "id": "Js.Json.number", - "kind": "value", - "name": "number", - "docstrings": [ - "`number(n)` makes a JSON number of the `float` `n`." - ], - "signature": "let number: float => t", - "deprecated": "" - }, - { - "id": "Js.Json.boolean", - "kind": "value", - "name": "boolean", - "docstrings": [ - "`boolean(b)` makes a JSON boolean of the `bool` `b`." - ], - "signature": "let boolean: bool => t", - "deprecated": "" - }, - { - "id": "Js.Json.object_", - "kind": "value", - "name": "object_", - "docstrings": [ - "`object_(dict)` makes a JSON object of the `dict`." - ], - "signature": "let object_: dict => t", - "deprecated": "" - }, - { - "id": "Js.Json.array", - "kind": "value", - "name": "array", - "docstrings": [ - "`array_(a)` makes a JSON array of the `Js.Json.t` array `a`." - ], - "signature": "let array: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.stringArray", - "kind": "value", - "name": "stringArray", - "docstrings": [ - "`stringArray(a)` makes a JSON array of the `string` array `a`." - ], - "signature": "let stringArray: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.numberArray", - "kind": "value", - "name": "numberArray", - "docstrings": [ - "`numberArray(a)` makes a JSON array of the `float` array `a`." - ], - "signature": "let numberArray: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.booleanArray", - "kind": "value", - "name": "booleanArray", - "docstrings": [ - "`booleanArray(a)` makes a JSON array of the `bool` array `a`." - ], - "signature": "let booleanArray: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.objectArray", - "kind": "value", - "name": "objectArray", - "docstrings": [ - "`objectArray(a) makes a JSON array of the `JsDict.t` array `a`." - ], - "signature": "let objectArray: array> => t", - "deprecated": "" - }, - { - "id": "Js.Json.parseExn", - "kind": "value", - "name": "parseExn", - "docstrings": [ - "`parseExn(s)` parses the `string` `s` into a JSON data structure.\nReturns a JSON data structure.\nThrows `SyntaxError` if the given string is not a valid JSON. Note: `SyntaxError` is a JavaScript exception.\n\nSee [`parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) on MDN.\n\n## Examples\n\n```rescript\n/* parse a simple JSON string */\n\nlet json = try Js.Json.parseExn(` \"hello\" `) catch {\n| _ => failwith(\"Error parsing JSON string\")\n}\n\nswitch Js.Json.classify(json) {\n| Js.Json.JSONString(value) => Js.log(value)\n| _ => failwith(\"Expected a string\")\n}\n```\n\n```rescript\n/* parse a complex JSON string */\n\nlet getIds = s => {\n let json = try Js.Json.parseExn(s) catch {\n | _ => failwith(\"Error parsing JSON string\")\n }\n\n switch Js.Json.classify(json) {\n | Js.Json.JSONObject(value) =>\n /* In this branch, compiler infer value : Js.Json.t dict */\n switch Js.Dict.get(value, \"ids\") {\n | Some(ids) =>\n switch Js.Json.classify(ids) {\n | Js.Json.JSONArray(ids) => /* In this branch compiler infer ids : Js.Json.t array */\n ids\n | _ => failwith(\"Expected an array\")\n }\n | None => failwith(\"Expected an `ids` property\")\n }\n | _ => failwith(\"Expected an object\")\n }\n}\n\n/* prints `1, 2, 3` */\nJs.log(getIds(` { \"ids\" : [1, 2, 3 ] } `))\n```" - ], - "signature": "let parseExn: string => t", - "deprecated": "" - }, - { - "id": "Js.Json.stringify", - "kind": "value", - "name": "stringify", - "docstrings": [ - "`stringify(json)` formats the JSON data structure as a `string`.\nReturns the string representation of a given JSON data structure.\n\nSee [`stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) on MDN.\n\n## Examples\n\n```rescript\n/* Creates and stringifies a simple JS object */\n\nlet dict = Js.Dict.empty()\nJs.Dict.set(dict, \"name\", Js.Json.string(\"John Doe\"))\nJs.Dict.set(dict, \"age\", Js.Json.number(30.0))\nJs.Dict.set(dict, \"likes\", Js.Json.stringArray([\"ReScript\", \"ocaml\", \"js\"]))\n\nJs.log(Js.Json.stringify(Js.Json.object_(dict)))\n```" - ], - "signature": "let stringify: t => string", - "deprecated": "" - }, - { - "id": "Js.Json.stringifyWithSpace", - "kind": "value", - "name": "stringifyWithSpace", - "docstrings": [ - "`stringifyWithSpace(json)` formats the JSON data structure as a `string`.\nReturns the string representation of a given JSON data structure with spacing.\n\nSee [`stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) on MDN.\n\n## Examples\n\n```rescript\n/* Creates and stringifies a simple JS object with spacing */\n\nlet dict = Js.Dict.empty()\nJs.Dict.set(dict, \"name\", Js.Json.string(\"John Doe\"))\nJs.Dict.set(dict, \"age\", Js.Json.number(30.0))\nJs.Dict.set(dict, \"likes\", Js.Json.stringArray([\"ReScript\", \"ocaml\", \"js\"]))\n\nJs.log(Js.Json.stringifyWithSpace(Js.Json.object_(dict), 2))\n```" - ], - "signature": "let stringifyWithSpace: (t, int) => string", - "deprecated": "" - }, - { - "id": "Js.Json.stringifyAny", - "kind": "value", - "name": "stringifyAny", - "docstrings": [ - "`stringifyAny(value)` formats any value into a JSON string.\n\n## Examples\n\n```rescript\n/* prints `[\"hello\", \"world\"]` */\nJs.log(Js.Json.stringifyAny([\"hello\", \"world\"]))\n```" - ], - "signature": "let stringifyAny: 'a => option", - "deprecated": "" - }, - { - "id": "Js.Json.deserializeUnsafe", - "kind": "value", - "name": "deserializeUnsafe", - "docstrings": [ - "Best-effort serialization, it tries to seralize as\nmany objects as possible and deserialize it back\n\nIt is unsafe in two aspects\n- It may throw during parsing\n- when you cast it to a specific type, it may have a type mismatch" - ], - "signature": "let deserializeUnsafe: string => 'a", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.serializeExn", - "kind": "value", - "name": "serializeExn", - "docstrings": [ - "It will throw in such situations:\n- The object can not be serlialized to a JSON\n- There are cycles\n- Some JS engines can not stringify deeply nested json objects" - ], - "signature": "let serializeExn: 'a => string", - "deprecated": "This functionality has been deprecated and will be removed in v13." - } - ] - }, - "js/global": { - "id": "Js.Global", - "name": "Global", - "docstrings": [ - "Provide bindings to JS global functions in global namespace", - "Contains functions available in the global scope (`window` in a browser context)" - ], - "items": [ - { - "id": "Js.Global.intervalId", - "kind": "type", - "name": "intervalId", - "docstrings": [ - "Identify an interval started by `Js.Global.setInterval`." - ], - "signature": "type intervalId = Global.intervalId", - "deprecated": "" - }, - { - "id": "Js.Global.timeoutId", - "kind": "type", - "name": "timeoutId", - "docstrings": [ - "Identify timeout started by `Js.Global.setTimeout`." - ], - "signature": "type timeoutId = Global.timeoutId", - "deprecated": "" - }, - { - "id": "Js.Global.clearInterval", - "kind": "value", - "name": "clearInterval", - "docstrings": [ - "Clear an interval started by `Js.Global.setInterval`\n\n## Examples\n\n```rescript\n/* API for a somewhat aggressive snoozing alarm clock */\n\nlet punchSleepyGuy = () => Js.log(\"Punch\")\n\nlet interval = ref(Js.Nullable.null)\n\nlet remind = () => {\n Js.log(\"Wake Up!\")\n punchSleepyGuy()\n}\n\nlet snooze = mins => interval := Js.Nullable.return(Js.Global.setInterval(remind, mins * 60 * 1000))\n\nlet cancel = () =>\n Js.Nullable.iter(interval.contents, intervalId => Js.Global.clearInterval(intervalId))\n```" - ], - "signature": "let clearInterval: intervalId => unit", - "deprecated": "" - }, - { - "id": "Js.Global.clearTimeout", - "kind": "value", - "name": "clearTimeout", - "docstrings": [ - "Clear a timeout started by `Js.Global.setTimeout`.\n\n## Examples\n\n```rescript\n/* A simple model of a code monkey's brain */\n\nlet closeHackerNewsTab = () => Js.log(\"close\")\n\nlet timer = ref(Js.Nullable.null)\n\nlet work = () => closeHackerNewsTab()\n\nlet procrastinate = mins => {\n Js.Nullable.iter(timer.contents, timer => Js.Global.clearTimeout(timer))\n timer := Js.Nullable.return(Js.Global.setTimeout(work, mins * 60 * 1000))\n}\n```" - ], - "signature": "let clearTimeout: timeoutId => unit", - "deprecated": "" - }, - { - "id": "Js.Global.setInterval", - "kind": "value", - "name": "setInterval", - "docstrings": [ - "Repeatedly executes a callback with a specified interval (in milliseconds)\nbetween calls. Returns a `Js.Global.intervalId` that can be passed to\n`Js.Global.clearInterval` to cancel the timeout.\n\n## Examples\n\n```rescript\n/* Will count up and print the count to the console every second */\n\nlet count = ref(0)\n\nlet tick = () => {\n count := count.contents + 1\n Js.log(Belt.Int.toString(count.contents))\n}\n\nJs.Global.setInterval(tick, 1000)\n```" - ], - "signature": "let setInterval: (unit => unit, int) => intervalId", - "deprecated": "" - }, - { - "id": "Js.Global.setIntervalFloat", - "kind": "value", - "name": "setIntervalFloat", - "docstrings": [ - "Repeatedly executes a callback with a specified interval (in milliseconds)\nbetween calls. Returns a `Js.Global.intervalId` that can be passed to\n`Js.Global.clearInterval` to cancel the timeout.\n\n## Examples\n\n```rescript\n/* Will count up and print the count to the console every second */\n\nlet count = ref(0)\n\nlet tick = () => {\n count := count.contents + 1\n Js.log(Belt.Int.toString(count.contents))\n}\n\nJs.Global.setIntervalFloat(tick, 1000.0)\n```" - ], - "signature": "let setIntervalFloat: (unit => unit, float) => intervalId", - "deprecated": "" - }, - { - "id": "Js.Global.setTimeout", - "kind": "value", - "name": "setTimeout", - "docstrings": [ - "Execute a callback after a specified delay (in milliseconds). Returns a\n`Js.Global.timeoutId` that can be passed to `Js.Global.clearTimeout` to cancel\nthe timeout.\n\n## Examples\n\n```rescript\n/* Prints \"Timed out!\" in the console after one second */\n\nlet message = \"Timed out!\"\n\nJs.Global.setTimeout(() => Js.log(message), 1000)\n```" - ], - "signature": "let setTimeout: (unit => unit, int) => timeoutId", - "deprecated": "" - }, - { - "id": "Js.Global.setTimeoutFloat", - "kind": "value", - "name": "setTimeoutFloat", - "docstrings": [ - "Execute a callback after a specified delay (in milliseconds). Returns a\n`Js.Global.timeoutId` that can be passed to `Js.Global.clearTimeout` to cancel\nthe timeout.\n\n## Examples\n\n```rescript\n/* Prints \"Timed out!\" in the console after one second */\n\nlet message = \"Timed out!\"\n\nJs.Global.setTimeoutFloat(() => Js.log(message), 1000.0)\n```" - ], - "signature": "let setTimeoutFloat: (unit => unit, float) => timeoutId", - "deprecated": "" - }, - { - "id": "Js.Global.encodeURI", - "kind": "value", - "name": "encodeURI", - "docstrings": [ - "URL-encodes a string.\n\nSee [`encodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI) on MDN." - ], - "signature": "let encodeURI: string => string", - "deprecated": "" - }, - { - "id": "Js.Global.decodeURI", - "kind": "value", - "name": "decodeURI", - "docstrings": [ - "Decodes a URL-enmcoded string produced by `encodeURI`\n\nSee [`decodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI) on MDN." - ], - "signature": "let decodeURI: string => string", - "deprecated": "" - }, - { - "id": "Js.Global.encodeURIComponent", - "kind": "value", - "name": "encodeURIComponent", - "docstrings": [ - "URL-encodes a string, including characters with special meaning in a URI.\n\nSee [`encodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) on MDN." - ], - "signature": "let encodeURIComponent: string => string", - "deprecated": "" - }, - { - "id": "Js.Global.decodeURIComponent", - "kind": "value", - "name": "decodeURIComponent", - "docstrings": [ - "Decodes a URL-enmcoded string produced by `encodeURIComponent`\n\nSee [`decodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) on MDN." - ], - "signature": "let decodeURIComponent: string => string", - "deprecated": "" - } - ] - }, - "js/dict": { - "id": "Js.Dict", - "name": "Dict", - "docstrings": [ - "Provide utilities for JS dictionary object", - "Provide utilities for JS dictionary object.\n\n**Note:** This module's examples will assume this predeclared dictionary:\n\n## Examples\n\n```rescript\nlet ages = Js.Dict.fromList(list{(\"Maria\", 30), (\"Vinh\", 22), (\"Fred\", 49)})\n```" - ], - "items": [ - { - "id": "Js.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = dict<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.key", - "kind": "type", - "name": "key", - "docstrings": [ - "The type for dictionary keys. This means that dictionaries *must* use `string`s as their keys." - ], - "signature": "type key = string", - "deprecated": "" - }, - { - "id": "Js.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`Js.Dict.get(key)` returns `None` if the key is not found in the dictionary,\n`Some(value)` otherwise.\n\n## Examples\n\n```rescript\nJs.Dict.get(ages, \"Vinh\") == Some(22)\nJs.Dict.get(ages, \"Paul\") == None\n```" - ], - "signature": "let get: (t<'a>, key) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.unsafeGet", - "kind": "value", - "name": "unsafeGet", - "docstrings": [ - "`Js.Dict.unsafeGet(key)` returns the value if the key exists, otherwise an `undefined` value is returned. Use this only when you are sure the key exists (i.e. when having used the `keys()` function to check that the key is valid).\n\n## Examples\n\n```rescript\nJs.Dict.unsafeGet(ages, \"Fred\") == 49\nJs.Dict.unsafeGet(ages, \"Paul\") // returns undefined\n```" - ], - "signature": "let unsafeGet: (t<'a>, key) => 'a", - "deprecated": "" - }, - { - "id": "Js.Dict.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`Js.Dict.set(dict, key, value)` sets the key/value in the dictionary `dict`. If\nthe key does not exist, and entry will be created for it.\n\n*This function modifies the original dictionary.*\n\n## Examples\n\n```rescript\nJs.Dict.set(ages, \"Maria\", 31)\nJs.log(ages == Js.Dict.fromList(list{(\"Maria\", 31), (\"Vinh\", 22), (\"Fred\", 49)}))\n\nJs.Dict.set(ages, \"David\", 66)\nJs.log(ages == Js.Dict.fromList(list{(\"Maria\", 31), (\"Vinh\", 22), (\"Fred\", 49), (\"David\", 66)}))\n```" - ], - "signature": "let set: (t<'a>, key, 'a) => unit", - "deprecated": "" - }, - { - "id": "Js.Dict.keys", - "kind": "value", - "name": "keys", - "docstrings": [ - "Returns all the keys in the dictionary `dict`.\n\n## Examples\n\n```rescript\nJs.Dict.keys(ages) == [\"Maria\", \"Vinh\", \"Fred\"]\n```" - ], - "signature": "let keys: t<'a> => array", - "deprecated": "" - }, - { - "id": "Js.Dict.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "Returns an empty dictionary." - ], - "signature": "let empty: unit => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.unsafeDeleteKey", - "kind": "value", - "name": "unsafeDeleteKey", - "docstrings": [ - "Experimental internal function" - ], - "signature": "let unsafeDeleteKey: (t, string) => unit", - "deprecated": "" - }, - { - "id": "Js.Dict.entries", - "kind": "value", - "name": "entries", - "docstrings": [ - "Returns an array of key/value pairs in the given dictionary (ES2017).\n\n## Examples\n\n```rescript\nJs.Dict.entries(ages) == [(\"Maria\", 30), (\"Vinh\", 22), (\"Fred\", 49)]\n```" - ], - "signature": "let entries: t<'a> => array<(key, 'a)>", - "deprecated": "" - }, - { - "id": "Js.Dict.values", - "kind": "value", - "name": "values", - "docstrings": [ - "Returns the values in the given dictionary (ES2017).\n\n## Examples\n\n```rescript\nJs.Dict.values(ages) == [30, 22, 49]\n```" - ], - "signature": "let values: t<'a> => array<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.fromList", - "kind": "value", - "name": "fromList", - "docstrings": [ - "Creates a new dictionary containing each (key, value) pair in its list\nargument.\n\n## Examples\n\n```rescript\nlet capitals = Js.Dict.fromList(list{(\"Japan\", \"Tokyo\"), (\"France\", \"Paris\"), (\"Egypt\", \"Cairo\")})\n```" - ], - "signature": "let fromList: list<(key, 'a)> => t<'a>", - "deprecated": "Use `Dict.fromArray(List.toArray(...))` instead." - }, - { - "id": "Js.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates a new dictionary containing each (key, value) pair in its array\nargument.\n\n## Examples\n\n```rescript\nlet capitals2 = Js.Dict.fromArray([(\"Germany\", \"Berlin\"), (\"Burkina Faso\", \"Ouagadougou\")])\n```" - ], - "signature": "let fromArray: array<(key, 'a)> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(f, dict)` maps `dict` to a new dictionary with the same keys, using the\nfunction `f` to map each value.\n\n## Examples\n\n```rescript\nlet prices = Js.Dict.fromList(list{(\"pen\", 1.00), (\"book\", 5.00), (\"stapler\", 7.00)})\n\nlet discount = price => price *. 0.90\nlet salePrices = Js.Dict.map(discount, prices)\n\nsalePrices == Js.Dict.fromList(list{(\"pen\", 0.90), (\"book\", 4.50), (\"stapler\", 6.30)})\n```" - ], - "signature": "let map: ('a => 'b, t<'a>) => t<'b>", - "deprecated": "" - } - ] - }, - "js/date": { - "id": "Js.Date", - "name": "Date", - "docstrings": [ - "Provide bindings for JS Date", - "Provide bindings to JS date. (See\n[`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)\non MDN.) JavaScript stores dates as the number of milliseconds since the UNIX\n*epoch*, midnight 1 January 1970, UTC." - ], - "items": [ - { - "id": "Js.Date.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Date.t", - "deprecated": "" - }, - { - "id": "Js.Date.valueOf", - "kind": "value", - "name": "valueOf", - "docstrings": [ - "Returns the primitive value of this date, equivalent to `getTime()`. (See\n[`Date.valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/valueOf)\non MDN.)\n\n## Examples\n\n```rescript\nJs.Date.valueOf(exampleDate) == 123456654321.0\n```" - ], - "signature": "let valueOf: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a date representing the current time. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nlet now = Js.Date.make()\n```" - ], - "signature": "let make: unit => t", - "deprecated": "" - }, - { - "id": "Js.Date.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "Returns a date representing the given argument, which is a number of\nmilliseconds since the epoch. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.fromFloat(123456654321.0) == exampleDate\n```" - ], - "signature": "let fromFloat: float => t", - "deprecated": "" - }, - { - "id": "Js.Date.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Returns a `Js.Date.t` represented by the given string. The string can be in\n“IETF-compliant RFC 2822 timestamps, and also strings in a version of ISO8601.”\nReturns `NaN` if given an invalid date string. According to the [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\ndocumentation on MDN, its use is discouraged.\n\n## Examples\n\n```rescript\nJs.Date.fromString(\"Thu, 29 Nov 1973 21:30:54.321 GMT\") == exampleDate\nJs.Date.fromString(\"1973-11-29T21:30:54.321Z00:00\") == exampleDate\nJs.Date.fromString(\"Thor, 32 Lok -19 60:70:80 XYZ\") // returns NaN\n```" - ], - "signature": "let fromString: string => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYM", - "kind": "value", - "name": "makeWithYM", - "docstrings": [ - "Returns a date representing midnight of the first day of the given month and\nyear in the current time zone. Fractional parts of arguments are ignored. See\n[`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nlet november1 = Js.Date.makeWithYM(~year=2020.0, ~month=10.0, ())\n```" - ], - "signature": "let makeWithYM: (~year: float, ~month: float, unit) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMD", - "kind": "value", - "name": "makeWithYMD", - "docstrings": [ - "Returns a date representing midnight of the given date of the given month and\nyear in the current time zone. Fractional parts of arguments are ignored. See\n[`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN." - ], - "signature": "let makeWithYMD: (~year: float, ~month: float, ~date: float, unit) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMDH", - "kind": "value", - "name": "makeWithYMDH", - "docstrings": [ - "Returns a date representing the given date of the given month and year, at zero\nminutes and zero seconds past the given `hours`, in the current time zone.\nFractional parts of arguments are ignored. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN. Fractional parts of the arguments are ignored." - ], - "signature": "let makeWithYMDH: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n unit,\n) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMDHM", - "kind": "value", - "name": "makeWithYMDHM", - "docstrings": [ - "Returns a date representing the given date of the given month and year, at zero\nseconds past the given time in hours and minutes in the current time zone.\nFractional parts of arguments are ignored. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN." - ], - "signature": "let makeWithYMDHM: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n unit,\n) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMDHMS", - "kind": "value", - "name": "makeWithYMDHMS", - "docstrings": [ - "Returns a date representing the given date of the given month and year, at the\ngiven time in hours, minutes, and seconds in the current time zone. Fractional\nparts of arguments are ignored. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.makeWithYMDHMS(\n ~year=1973.0,\n ~month=11.0,\n ~date=29.0,\n ~hours=21.0,\n ~minutes=30.0,\n ~seconds=54.321,\n (),\n) == exampleDate\n```" - ], - "signature": "let makeWithYMDHMS: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => t", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYM", - "kind": "value", - "name": "utcWithYM", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the first day of the given month and year in UTC. Fractional parts\nof arguments are ignored. See\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN.\n\n## Examples\n\n```rescript\nlet november1 = Js.Date.utcWithYM(~year=2020.0, ~month=10.0, ())\n```" - ], - "signature": "let utcWithYM: (~year: float, ~month: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMD", - "kind": "value", - "name": "utcWithYMD", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year in UTC. Fractional parts\nof arguments are ignored. See\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMD: (~year: float, ~month: float, ~date: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMDH", - "kind": "value", - "name": "utcWithYMDH", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year, at zero minutes and\nseconds past the given hours in UTC. Fractional parts of arguments are ignored.\nSee\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMDH: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMDHM", - "kind": "value", - "name": "utcWithYMDHM", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year, at zero seconds past\nthe given number of minutes past the given hours in UTC. Fractional parts of\narguments are ignored. See\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMDHM: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMDHMS", - "kind": "value", - "name": "utcWithYMDHMS", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year, at the given time in\nhours, minutes and seconds in UTC. Fractional parts of arguments are ignored.\n\nSee\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMDHMS: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.now", - "kind": "value", - "name": "now", - "docstrings": [ - "Returns the current time as number of milliseconds since Unix epoch." - ], - "signature": "let now: unit => float", - "deprecated": "" - }, - { - "id": "Js.Date.parse", - "kind": "value", - "name": "parse", - "docstrings": [], - "signature": "let parse: string => t", - "deprecated": "" - }, - { - "id": "Js.Date.parseAsFloat", - "kind": "value", - "name": "parseAsFloat", - "docstrings": [ - "Returns a float with the number of milliseconds past the epoch represented by\nthe given string. The string can be in “IETF-compliant RFC 2822 timestamps, and\nalso strings in a version of ISO8601.” Returns `NaN` if given an invalid date\nstring. According to the\n[`Date.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse)\ndocumentation on MDN, its use is discouraged. Returns `NaN` if passed invalid\ndate string." - ], - "signature": "let parseAsFloat: string => float", - "deprecated": "" - }, - { - "id": "Js.Date.getDate", - "kind": "value", - "name": "getDate", - "docstrings": [ - "Returns the day of the month for its argument. The argument is evaluated in the\ncurrent time zone. See\n[`Date.getDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDate)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getDate(exampleDate) == 29.0\n```" - ], - "signature": "let getDate: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getDay", - "kind": "value", - "name": "getDay", - "docstrings": [ - "Returns the day of the week (0.0-6.0) for its argument, where 0.0 represents\nSunday. The argument is evaluated in the current time zone. See\n[`Date.getDay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDay)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getDay(exampleDate) == 4.0\n```" - ], - "signature": "let getDay: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getFullYear", - "kind": "value", - "name": "getFullYear", - "docstrings": [ - "Returns the full year (as opposed to the range 0-99) for its argument. The\nargument is evaluated in the current time zone. See\n[`Date.getFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getFullYear)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getFullYear(exampleDate) == 1973.0\n```" - ], - "signature": "let getFullYear: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getHours", - "kind": "value", - "name": "getHours", - "docstrings": [ - "Returns the hours for its argument, evaluated in the current time zone. See\n[`Date.getHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getHours)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getHours(exampleDate) == 22.0 // Vienna is in GMT+01:00\n```" - ], - "signature": "let getHours: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getMilliseconds", - "kind": "value", - "name": "getMilliseconds", - "docstrings": [ - "Returns the number of milliseconds for its argument, evaluated in the current\ntime zone. See\n[`Date.getMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getMilliseconds(exampleDate) == 321.0\n```" - ], - "signature": "let getMilliseconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getMinutes", - "kind": "value", - "name": "getMinutes", - "docstrings": [ - "Returns the number of minutes for its argument, evaluated in the current time\nzone. See\n[`Date.getMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMinutes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getMinutes(exampleDate) == 30.0\n```" - ], - "signature": "let getMinutes: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getMonth", - "kind": "value", - "name": "getMonth", - "docstrings": [ - "Returns the month (0.0-11.0) for its argument, evaluated in the current time\nzone. January is month zero. See\n[`Date.getMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMonth)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getMonth(exampleDate) == 10.0\n```" - ], - "signature": "let getMonth: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getSeconds", - "kind": "value", - "name": "getSeconds", - "docstrings": [ - "Returns the seconds for its argument, evaluated in the current time zone. See\n[`Date.getSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getSeconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getSeconds(exampleDate) == 54.0\n```" - ], - "signature": "let getSeconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getTime", - "kind": "value", - "name": "getTime", - "docstrings": [ - "Returns the number of milliseconds since Unix epoch, evaluated in UTC. See\n[`Date.getTime`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getTime(exampleDate) == 123456654321.0\n```" - ], - "signature": "let getTime: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getTimezoneOffset", - "kind": "value", - "name": "getTimezoneOffset", - "docstrings": [ - "Returns the time zone offset in minutes from the current time zone to UTC. See\n[`Date.getTimezoneOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getTimezoneOffset(exampleDate) == -60.0\n```" - ], - "signature": "let getTimezoneOffset: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCDate", - "kind": "value", - "name": "getUTCDate", - "docstrings": [ - "Returns the day of the month of the argument, evaluated in UTC. See\n[`Date.getUTCDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCDate)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCDate(exampleDate) == 29.0\n```" - ], - "signature": "let getUTCDate: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCDay", - "kind": "value", - "name": "getUTCDay", - "docstrings": [ - "Returns the day of the week of the argument, evaluated in UTC. The range of the\nreturn value is 0.0-6.0, where Sunday is zero. See\n[`Date.getUTCDay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCDay)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCDay(exampleDate) == 4.0\n```" - ], - "signature": "let getUTCDay: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCFullYear", - "kind": "value", - "name": "getUTCFullYear", - "docstrings": [ - "Returns the full year (as opposed to the range 0-99) for its argument. The\nargument is evaluated in UTC. See\n[`Date.getUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCFullYear(exampleDate) == 1973.0\n```" - ], - "signature": "let getUTCFullYear: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCHours", - "kind": "value", - "name": "getUTCHours", - "docstrings": [ - "Returns the hours for its argument, evaluated in the current time zone. See\n[`Date.getUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCHours(exampleDate) == 21.0\n```" - ], - "signature": "let getUTCHours: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCMilliseconds", - "kind": "value", - "name": "getUTCMilliseconds", - "docstrings": [ - "Returns the number of milliseconds for its argument, evaluated in UTC. See\n[`Date.getUTCMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCMilliseconds(exampleDate) == 321.0\n```" - ], - "signature": "let getUTCMilliseconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCMinutes", - "kind": "value", - "name": "getUTCMinutes", - "docstrings": [ - "Returns the number of minutes for its argument, evaluated in UTC. See\n[`Date.getUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCMinutes(exampleDate) == 30.0\n```" - ], - "signature": "let getUTCMinutes: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCMonth", - "kind": "value", - "name": "getUTCMonth", - "docstrings": [ - "Returns the month (0.0-11.0) for its argument, evaluated in UTC. January is\nmonth zero. See\n[`Date.getUTCMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMonth)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCMonth(exampleDate) == 10.0\n```" - ], - "signature": "let getUTCMonth: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCSeconds", - "kind": "value", - "name": "getUTCSeconds", - "docstrings": [ - "Returns the seconds for its argument, evaluated in UTC. See\n[`Date.getUTCSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCSeconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCSeconds(exampleDate) == 54.0\n```" - ], - "signature": "let getUTCSeconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getYear", - "kind": "value", - "name": "getYear", - "docstrings": [], - "signature": "let getYear: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.setDate", - "kind": "value", - "name": "setDate", - "docstrings": [ - "Sets the given `Date`’s day of month to the value in the second argument\naccording to the current time zone. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setDate)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet twoWeeksBefore = Js.Date.setDate(date1, 15.0)\ndate1 == Js.Date.fromString(\"1973-11-15T21:30:54.321Z00:00\")\ntwoWeeksBefore == Js.Date.getTime(date1)\n```" - ], - "signature": "let setDate: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setFullYear", - "kind": "value", - "name": "setFullYear", - "docstrings": [ - "Sets the given `Date`’s year to the value in the second argument according to\nthe current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextYear = Js.Date.setFullYear(date1, 1974.0)\ndate1 == Js.Date.fromString(\"1974-11-15T21:30:54.321Z00:00\")\nnextYear == Js.Date.getTime(date1)\n```" - ], - "signature": "let setFullYear: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setFullYearM", - "kind": "value", - "name": "setFullYearM", - "docstrings": [ - "Sets the given `Date`’s year and month to the values in the labeled arguments\naccording to the current time zone. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setFullYearM(date1, ~year=1974.0, ~month=0.0, ())\ndate1 == Js.Date.fromString(\"1974-01-22T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setFullYearM: (t, ~year: float, ~month: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setFullYearMD", - "kind": "value", - "name": "setFullYearMD", - "docstrings": [ - "Sets the given `Date`’s year, month, and day of month to the values in the\nlabeled arguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setFullYearMD(date1, ~year=1974.0, ~month=0.0, ~date=7.0, ())\ndate1 == Js.Date.fromString(\"1974-01-07T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setFullYearMD: (\n t,\n ~year: float,\n ~month: float,\n ~date: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHours", - "kind": "value", - "name": "setHours", - "docstrings": [ - "Sets the given `Date`’s hours to the value in the second argument according to\nthe current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextHour = Js.Date.setHours(date1, 22.0)\ndate1 == Js.Date.fromString(\"1973-11-29T22:30:54.321Z00:00\")\nnextHour == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHours: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHoursM", - "kind": "value", - "name": "setHoursM", - "docstrings": [ - "Sets the given `Date`’s hours and minutes to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setHoursM(date1, ~hours=22.0, ~minutes=46.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:54.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHoursM: (t, ~hours: float, ~minutes: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHoursMS", - "kind": "value", - "name": "setHoursMS", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, and seconds to the values in the\nlabeled arguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setHoursMS(date1, ~hours=22.0, ~minutes=46.0, ~seconds=37.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHoursMS: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHoursMSMs", - "kind": "value", - "name": "setHoursMSMs", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, seconds, and milliseconds to the values\nin the labeled arguments according to the current time zone. Returns the number\nof milliseconds since the epoch of the updated `Date`. *This function modifies\nthe original `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setHoursMSMs(\n date1,\n ~hours=22.0,\n ~minutes=46.0,\n ~seconds=37.0,\n ~milliseconds=494.0,\n (),\n)\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHoursMSMs: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMilliseconds", - "kind": "value", - "name": "setMilliseconds", - "docstrings": [ - "Sets the given `Date`’s milliseconds to the value in the second argument\naccording to the current time zone. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMilliseconds(date1, 494.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:30:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMilliseconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMinutes", - "kind": "value", - "name": "setMinutes", - "docstrings": [ - "Sets the given `Date`’s minutes to the value in the second argument according\nto the current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMinutes(date1, 34.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMinutes: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMinutesS", - "kind": "value", - "name": "setMinutesS", - "docstrings": [ - "Sets the given `Date`’s minutes and seconds to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMinutesS(date1, ~minutes=34.0, ~seconds=56.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMinutesS: (t, ~minutes: float, ~seconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMinutesSMs", - "kind": "value", - "name": "setMinutesSMs", - "docstrings": [ - "Sets the given `Date`’s minutes, seconds, and milliseconds to the values in the\nlabeled arguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMinutesSMs(date1, ~minutes=34.0, ~seconds=56.0, ~milliseconds=789.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMinutesSMs: (\n t,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMonth", - "kind": "value", - "name": "setMonth", - "docstrings": [ - "Sets the given `Date`’s month to the value in the second argument according to\nthe current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMonth(date1, 11.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMonth: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMonthD", - "kind": "value", - "name": "setMonthD", - "docstrings": [ - "Sets the given `Date`’s month and day of month to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMonthD(date1, ~month=11.0, ~date=8.0, ())\ndate1 == Js.Date.fromString(\"1973-12-08T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMonthD: (t, ~month: float, ~date: float, unit) => float", - "deprecated": "Use `Date.setMonth` then `Date.setDate`. No direct 1:1 migration available." - }, - { - "id": "Js.Date.setSeconds", - "kind": "value", - "name": "setSeconds", - "docstrings": [ - "Sets the given `Date`’s seconds to the value in the second argument according\nto the current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setSeconds(date1, 56.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setSeconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setSecondsMs", - "kind": "value", - "name": "setSecondsMs", - "docstrings": [ - "Sets the given `Date`’s seconds and milliseconds to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setSecondsMs(date1, ~seconds=56.0, ~milliseconds=789.0, ())\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setSecondsMs: (t, ~seconds: float, ~milliseconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setTime", - "kind": "value", - "name": "setTime", - "docstrings": [ - "Sets the given `Date`’s value in terms of milliseconds since the epoch. Returns\nthe number of milliseconds since the epoch of the updated `Date`. *This\nfunction modifies the original `Date`.* See\n[`Date.setTime`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setTime)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setTime(date1, 198765432101.0)\n\ndate1 == Js.Date.fromString(\"1976-04-19T12:37:12.101Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setTime: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCDate", - "kind": "value", - "name": "setUTCDate", - "docstrings": [ - "Sets the given `Date`’s day of month to the value in the second argument\naccording to UTC. Returns the number of milliseconds since the epoch of the\nupdated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCDate)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet twoWeeksBefore = Js.Date.setUTCDate(date1, 15.0)\ndate1 == Js.Date.fromString(\"1973-11-15T21:30:54.321Z00:00\")\ntwoWeeksBefore == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCDate: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCFullYear", - "kind": "value", - "name": "setUTCFullYear", - "docstrings": [ - "Sets the given `Date`’s year to the value in the second argument according to\nUTC. Returns the number of milliseconds since the epoch of the updated `Date`.\n*This function modifies the original `Date`.* See\n[`Date.setUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextYear = Js.Date.setUTCFullYear(date1, 1974.0)\ndate1 == Js.Date.fromString(\"1974-11-15T21:30:54.321Z00:00\")\nnextYear == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCFullYear: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCFullYearM", - "kind": "value", - "name": "setUTCFullYearM", - "docstrings": [ - "Sets the given `Date`’s year and month to the values in the labeled arguments\naccording to UTC. Returns the number of milliseconds since the epoch of the\nupdated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setUTCFullYearM(date1, ~year=1974.0, ~month=0.0, ())\ndate1 == Js.Date.fromString(\"1974-01-22T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCFullYearM: (t, ~year: float, ~month: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCFullYearMD", - "kind": "value", - "name": "setUTCFullYearMD", - "docstrings": [ - "Sets the given `Date`’s year, month, and day of month to the values in the\nlabeled arguments according to UTC. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setUTCFullYearMD(date1, ~year=1974.0, ~month=0.0, ~date=7.0, ())\ndate1 == Js.Date.fromString(\"1974-01-07T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCFullYearMD: (\n t,\n ~year: float,\n ~month: float,\n ~date: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHours", - "kind": "value", - "name": "setUTCHours", - "docstrings": [ - "Sets the given `Date`’s hours to the value in the second argument according to\nUTC. Returns the number of milliseconds since the epoch of the updated `Date`.\n*This function modifies the original `Date`.* See\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextHour = Js.Date.setUTCHours(date1, 22.0)\ndate1 == Js.Date.fromString(\"1973-11-29T22:30:54.321Z00:00\")\nnextHour == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHours: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHoursM", - "kind": "value", - "name": "setUTCHoursM", - "docstrings": [ - "Sets the given `Date`’s hours and minutes to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCHoursM(date1, ~hours=22.0, ~minutes=46.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:54.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHoursM: (t, ~hours: float, ~minutes: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHoursMS", - "kind": "value", - "name": "setUTCHoursMS", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, and seconds to the values in the\nlabeled arguments according to UTC. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\n\nSee\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCHoursMS(date1, ~hours=22.0, ~minutes=46.0, ~seconds=37.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHoursMS: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHoursMSMs", - "kind": "value", - "name": "setUTCHoursMSMs", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, seconds, and milliseconds to the values\nin the labeled arguments according to UTC. Returns the number of milliseconds\nsince the epoch of the updated `Date`. *This function modifies the original\n`Date`.* See\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCHoursMSMs(\n date1,\n ~hours=22.0,\n ~minutes=46.0,\n ~seconds=37.0,\n ~milliseconds=494.0,\n (),\n)\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHoursMSMs: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMilliseconds", - "kind": "value", - "name": "setUTCMilliseconds", - "docstrings": [ - "Sets the given `Date`’s milliseconds to the value in the second argument\naccording to UTC. Returns the number of milliseconds since the epoch of the\nupdated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMilliseconds(date1, 494.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:30:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMilliseconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMinutes", - "kind": "value", - "name": "setUTCMinutes", - "docstrings": [ - "Sets the given `Date`’s minutes to the value in the second argument according\nto the current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMinutes(date1, 34.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMinutes: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMinutesS", - "kind": "value", - "name": "setUTCMinutesS", - "docstrings": [ - "Sets the given `Date`’s minutes and seconds to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMinutesS(date1, ~minutes=34.0, ~seconds=56.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMinutesS: (t, ~minutes: float, ~seconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMinutesSMs", - "kind": "value", - "name": "setUTCMinutesSMs", - "docstrings": [ - "Sets the given `Date`’s minutes, seconds, and milliseconds to the values in the\nlabeled arguments according to UTC. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMinutesSMs(\n date1,\n ~minutes=34.0,\n ~seconds=56.0,\n ~milliseconds=789.0,\n (),\n)\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMinutesSMs: (\n t,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMonth", - "kind": "value", - "name": "setUTCMonth", - "docstrings": [ - "Sets the given `Date`’s month to the value in the second argument according to\nUTC. Returns the number of milliseconds since the epoch of the updated `Date`.\n*This function modifies the original `Date`.* See\n[`Date.setUTCMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMonth(date1, 11.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMonth: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMonthD", - "kind": "value", - "name": "setUTCMonthD", - "docstrings": [ - "Sets the given `Date`’s month and day of month to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMonthD(date1, ~month=11.0, ~date=8.0, ())\ndate1 == Js.Date.fromString(\"1973-12-08T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMonthD: (t, ~month: float, ~date: float, unit) => float", - "deprecated": "Use `Date.setUTCMonth` then `Date.setUTCDate`. No direct 1:1 migration available." - }, - { - "id": "Js.Date.setUTCSeconds", - "kind": "value", - "name": "setUTCSeconds", - "docstrings": [ - "Sets the given `Date`’s seconds to the value in the second argument according\nto UTC. Returns the number of milliseconds since the epoch of the updated\n`Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCSeconds(date1, 56.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCSeconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCSecondsMs", - "kind": "value", - "name": "setUTCSecondsMs", - "docstrings": [ - "Sets the given `Date`’s seconds and milliseconds to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCSecondsMs(date1, ~seconds=56.0, ~milliseconds=789.0, ())\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCSecondsMs: (t, ~seconds: float, ~milliseconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCTime", - "kind": "value", - "name": "setUTCTime", - "docstrings": [ - "Same as [`setTime()`](#settime)." - ], - "signature": "let setUTCTime: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setYear", - "kind": "value", - "name": "setYear", - "docstrings": [], - "signature": "let setYear: (t, float) => float", - "deprecated": "Use `setFullYear` instead" - }, - { - "id": "Js.Date.toDateString", - "kind": "value", - "name": "toDateString", - "docstrings": [ - "Returns the date (day of week, year, month, and day of month) portion of a\n`Date` in English. See\n[`Date.toDateString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toDateString(exampleDate) == \"Thu Nov 29 1973\"\n```" - ], - "signature": "let toDateString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toGMTString", - "kind": "value", - "name": "toGMTString", - "docstrings": [], - "signature": "let toGMTString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toISOString", - "kind": "value", - "name": "toISOString", - "docstrings": [ - "Returns a simplified version of the ISO 8601 format for the date. See\n[`Date.toISOString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toISOString(exampleDate) == \"1973-11-29T21:30:54.321Z\"\n```" - ], - "signature": "let toISOString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toJSON", - "kind": "value", - "name": "toJSON", - "docstrings": [], - "signature": "let toJSON: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toJSONUnsafe", - "kind": "value", - "name": "toJSONUnsafe", - "docstrings": [ - "Returns a string representation of the given date. See\n[`Date.toJSON`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON)\non MDN." - ], - "signature": "let toJSONUnsafe: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toLocaleDateString", - "kind": "value", - "name": "toLocaleDateString", - "docstrings": [ - "Returns the year, month, and day for the given `Date` in the current locale\nformat. See\n[`Date.toLocaleDateString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toLocaleDateString(exampleDate) == \"11/29/1973\" // for en_US.utf8\nJs.Date.toLocaleDateString(exampleDate) == \"29.11.73\" // for de_DE.utf8\n```" - ], - "signature": "let toLocaleDateString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Returns the time and date for the given `Date` in the current locale format.\nSee\n[`Date.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toLocaleString(exampleDate) == \"11/29/1973, 10:30:54 PM\" // for en_US.utf8\nJs.Date.toLocaleString(exampleDate) == \"29.11.1973, 22:30:54\" // for de_DE.utf8\n```" - ], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toLocaleTimeString", - "kind": "value", - "name": "toLocaleTimeString", - "docstrings": [ - "Returns the time of day for the given `Date` in the current locale format. See\n[`Date.toLocaleTimeString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toLocaleString(exampleDate) == \"10:30:54 PM\" // for en_US.utf8\nJs.Date.toLocaleString(exampleDate) == \"22:30:54\" // for de_DE.utf8\n```" - ], - "signature": "let toLocaleTimeString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Returns a string representing the date and time of day for the given `Date` in\nthe current locale and time zone. See\n[`Date.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toString(\n exampleDate,\n) == \"Thu Nov 29 1973 22:30:54 GMT+0100 (Central European Standard Time)\"\n```" - ], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toTimeString", - "kind": "value", - "name": "toTimeString", - "docstrings": [ - "Returns a string representing the time of day for the given `Date` in the\ncurrent locale and time zone. See\n[`Date.toTimeString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toTimeString(exampleDate) == \"22:30:54 GMT+0100 (Central European Standard Time)\"\n```" - ], - "signature": "let toTimeString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toUTCString", - "kind": "value", - "name": "toUTCString", - "docstrings": [ - "Returns a string representing the date and time of day for the given `Date` in\nthe current locale and UTC (GMT time zone). See\n[`Date.toUTCString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toUTCString(exampleDate) == \"Thu, 29 Nov 1973 21:30:54 GMT\"\n```" - ], - "signature": "let toUTCString: t => string", - "deprecated": "" - } - ] - }, - "js/promise2": { - "id": "Js.Promise2", - "name": "Promise2", - "docstrings": [ - "Provide bindings to JS Promise" - ], - "items": [ - { - "id": "Js.Promise2.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.error", - "kind": "type", - "name": "error", - "docstrings": [], - "signature": "type error" - }, - { - "id": "Js.Promise2.then", - "kind": "value", - "name": "then", - "docstrings": [ - "Type-safe t-first then" - ], - "signature": "let then: (promise<'a>, 'a => promise<'b>) => promise<'b>", - "deprecated": "" - }, - { - "id": "Js.Promise2.catch", - "kind": "value", - "name": "catch", - "docstrings": [ - "Type-safe t-first catch" - ], - "signature": "let catch: (promise<'a>, error => promise<'a>) => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (\n (~resolve: 'a => unit, ~reject: exn => unit) => unit,\n) => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.resolve", - "kind": "value", - "name": "resolve", - "docstrings": [], - "signature": "let resolve: 'a => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.reject", - "kind": "value", - "name": "reject", - "docstrings": [], - "signature": "let reject: exn => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all", - "kind": "value", - "name": "all", - "docstrings": [], - "signature": "let all: array> => promise>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all2", - "kind": "value", - "name": "all2", - "docstrings": [], - "signature": "let all2: ((promise<'a0>, promise<'a1>)) => promise<('a0, 'a1)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all3", - "kind": "value", - "name": "all3", - "docstrings": [], - "signature": "let all3: (\n (promise<'a0>, promise<'a1>, promise<'a2>),\n) => promise<('a0, 'a1, 'a2)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all4", - "kind": "value", - "name": "all4", - "docstrings": [], - "signature": "let all4: (\n (promise<'a0>, promise<'a1>, promise<'a2>, promise<'a3>),\n) => promise<('a0, 'a1, 'a2, 'a3)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all5", - "kind": "value", - "name": "all5", - "docstrings": [], - "signature": "let all5: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all6", - "kind": "value", - "name": "all6", - "docstrings": [], - "signature": "let all6: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n promise<'a5>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4, 'a5)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.race", - "kind": "value", - "name": "race", - "docstrings": [], - "signature": "let race: array> => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.unsafe_async", - "kind": "value", - "name": "unsafe_async", - "docstrings": [], - "signature": "let unsafe_async: 'a => promise<'a>" - }, - { - "id": "Js.Promise2.unsafe_await", - "kind": "value", - "name": "unsafe_await", - "docstrings": [], - "signature": "let unsafe_await: promise<'a> => 'a" - } - ] - }, - "js/promise": { - "id": "Js.Promise", - "name": "Promise", - "docstrings": [ - "Provide bindings to JS Promise", - "Deprecation note: These bindings are pretty outdated and cannot be used properly\nwith the `->` operator.\n\nMore details on proper Promise usage can be found here:\nhttps://rescript-lang.org/docs/manual/latest/promise#promise-legacy" - ], - "items": [ - { - "id": "Js.Promise.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.error", - "kind": "type", - "name": "error", - "docstrings": [], - "signature": "type error = Js_promise2.error", - "deprecated": "" - }, - { - "id": "Js.Promise.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (\n (~resolve: 'a => unit, ~reject: exn => unit) => unit,\n) => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.resolve", - "kind": "value", - "name": "resolve", - "docstrings": [], - "signature": "let resolve: 'a => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.reject", - "kind": "value", - "name": "reject", - "docstrings": [], - "signature": "let reject: exn => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.all", - "kind": "value", - "name": "all", - "docstrings": [], - "signature": "let all: array> => promise>", - "deprecated": "" - }, - { - "id": "Js.Promise.all2", - "kind": "value", - "name": "all2", - "docstrings": [], - "signature": "let all2: ((promise<'a0>, promise<'a1>)) => promise<('a0, 'a1)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all3", - "kind": "value", - "name": "all3", - "docstrings": [], - "signature": "let all3: (\n (promise<'a0>, promise<'a1>, promise<'a2>),\n) => promise<('a0, 'a1, 'a2)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all4", - "kind": "value", - "name": "all4", - "docstrings": [], - "signature": "let all4: (\n (promise<'a0>, promise<'a1>, promise<'a2>, promise<'a3>),\n) => promise<('a0, 'a1, 'a2, 'a3)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all5", - "kind": "value", - "name": "all5", - "docstrings": [], - "signature": "let all5: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all6", - "kind": "value", - "name": "all6", - "docstrings": [], - "signature": "let all6: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n promise<'a5>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4, 'a5)>", - "deprecated": "" - }, - { - "id": "Js.Promise.race", - "kind": "value", - "name": "race", - "docstrings": [], - "signature": "let race: array> => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.then_", - "kind": "value", - "name": "then_", - "docstrings": [], - "signature": "let then_: ('a => promise<'b>, promise<'a>) => promise<'b>", - "deprecated": "" - }, - { - "id": "Js.Promise.catch", - "kind": "value", - "name": "catch", - "docstrings": [], - "signature": "let catch: (error => promise<'a>, promise<'a>) => promise<'a>", - "deprecated": "" - } - ] - }, - "js/re": { - "id": "Js.Re", - "name": "Re", - "docstrings": [ - "Provide bindings to JS regex expression", - "Provide bindings to JS regular expressions (RegExp).\n\n**Note:** This is not an immutable API. A RegExp object with the `global` (\"g\")\nflag set will modify the [`lastIndex`]() property when the RegExp object is used,\nand subsequent uses will continue the search from the previous [`lastIndex`]()." - ], - "items": [ - { - "id": "Js.Re.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The RegExp object." - ], - "signature": "type t = RegExp.t", - "deprecated": "" - }, - { - "id": "Js.Re.result", - "kind": "type", - "name": "result", - "docstrings": [ - "The result of a executing a RegExp on a string." - ], - "signature": "type result" - }, - { - "id": "Js.Re.captures", - "kind": "value", - "name": "captures", - "docstrings": [ - "An `array` of the match and captures, the first is the full match and the\nremaining are the substring captures." - ], - "signature": "let captures: result => array>", - "deprecated": "" - }, - { - "id": "Js.Re.matches", - "kind": "value", - "name": "matches", - "docstrings": [], - "signature": "let matches: result => array", - "deprecated": "" - }, - { - "id": "Js.Re.index", - "kind": "value", - "name": "index", - "docstrings": [ - "0-based index of the match in the input string." - ], - "signature": "let index: result => int", - "deprecated": "" - }, - { - "id": "Js.Re.input", - "kind": "value", - "name": "input", - "docstrings": [ - "The original input string." - ], - "signature": "let input: result => string", - "deprecated": "" - }, - { - "id": "Js.Re.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Constructs a RegExp object (Js.Re.t) from a `string`.\nRegex literals `/.../` should generally be preferred, but `fromString`\nis useful when you need to dynamically construct a regex using strings,\nexactly like when you do so in JavaScript.\n\n## Examples\n\n```rescript\nlet firstReScriptFileExtension = (filename, content) => {\n let result = Js.Re.fromString(filename ++ \"\\.(res|resi)\")->Js.Re.exec_(content)\n switch result {\n | Some(r) => Js.Nullable.toOption(Js.Re.captures(r)[1])\n | None => None\n }\n}\n\n// outputs \"res\"\nfirstReScriptFileExtension(\"School\", \"School.res School.resi Main.js School.bs.js\")\n```" - ], - "signature": "let fromString: string => t", - "deprecated": "" - }, - { - "id": "Js.Re.fromStringWithFlags", - "kind": "value", - "name": "fromStringWithFlags", - "docstrings": [ - "Constructs a RegExp object (`Js.Re.t`) from a string with the given flags.\nSee `Js.Re.fromString`.\n\nValid flags:\n\n- **g** global\n- **i** ignore case\n- **m** multiline\n- **u** unicode (es2015)\n- **y** sticky (es2015)" - ], - "signature": "let fromStringWithFlags: (string, ~flags: string) => t", - "deprecated": "" - }, - { - "id": "Js.Re.flags", - "kind": "value", - "name": "flags", - "docstrings": [ - "Returns the enabled flags as a string." - ], - "signature": "let flags: t => string", - "deprecated": "" - }, - { - "id": "Js.Re.global", - "kind": "value", - "name": "global", - "docstrings": [ - "Returns a `bool` indicating whether the global flag is set." - ], - "signature": "let global: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.ignoreCase", - "kind": "value", - "name": "ignoreCase", - "docstrings": [ - "Returns a `bool` indicating whether the ignoreCase flag is set." - ], - "signature": "let ignoreCase: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.lastIndex", - "kind": "value", - "name": "lastIndex", - "docstrings": [ - "Returns the index where the next match will start its search. This property\nwill be modified when the RegExp object is used, if the global (\"g\") flag is\nset.\n\n## Examples\n\n```rescript\nlet re = /ab*TODO/g\nlet str = \"abbcdefabh\"\n\nlet break = ref(false)\nwhile !break.contents {\n switch Js.Re.exec_(re, str) {\n | Some(result) =>\n Js.Nullable.iter(Js.Re.captures(result)[0], match_ => {\n let next = Belt.Int.toString(Js.Re.lastIndex(re))\n Js.log(\"Found \" ++ (match_ ++ (\". Next match starts at \" ++ next)))\n })\n | None => break := true\n }\n}\n```\n\nSee\n[`RegExp: lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex)\non MDN." - ], - "signature": "let lastIndex: t => int", - "deprecated": "" - }, - { - "id": "Js.Re.setLastIndex", - "kind": "value", - "name": "setLastIndex", - "docstrings": [ - "Sets the index at which the next match will start its search from." - ], - "signature": "let setLastIndex: (t, int) => unit", - "deprecated": "" - }, - { - "id": "Js.Re.multiline", - "kind": "value", - "name": "multiline", - "docstrings": [ - "Returns a `bool` indicating whether the multiline flag is set." - ], - "signature": "let multiline: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.source", - "kind": "value", - "name": "source", - "docstrings": [ - "Returns the pattern as a `string`." - ], - "signature": "let source: t => string", - "deprecated": "" - }, - { - "id": "Js.Re.sticky", - "kind": "value", - "name": "sticky", - "docstrings": [ - "Returns a `bool` indicating whether the sticky flag is set." - ], - "signature": "let sticky: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.unicode", - "kind": "value", - "name": "unicode", - "docstrings": [ - "Returns a `bool` indicating whether the unicode flag is set." - ], - "signature": "let unicode: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.exec_", - "kind": "value", - "name": "exec_", - "docstrings": [ - "Executes a search on a given string using the given RegExp object.\nReturns `Some(Js.Re.result)` if a match is found, `None` otherwise.\n\n## Examples\n\n```rescript\n/* Match \"quick brown\" followed by \"jumps\", ignoring characters in between\n * Remember \"brown\" and \"jumps\"\n * Ignore case\n */\n\nlet re = /quick\\s(brown).+?(jumps)/ig\nlet result = Js.Re.exec_(re, \"The Quick Brown Fox Jumps Over The Lazy Dog\")\n```\n\nSee [`RegExp.prototype.exec()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec)\non MDN." - ], - "signature": "let exec_: (t, string) => option", - "deprecated": "" - }, - { - "id": "Js.Re.test_", - "kind": "value", - "name": "test_", - "docstrings": [ - "Tests whether the given RegExp object will match a given `string`.\nReturns true if a match is found, false otherwise.\n\n## Examples\n\n```rescript\n/* A simple implementation of Js.String.startsWith */\n\nlet str = \"hello world!\"\n\nlet startsWith = (target, substring) => Js.Re.fromString(\"^\" ++ substring)->Js.Re.test_(target)\n\nJs.log(str->startsWith(\"hello\")) /* prints \"true\" */\n```\n\nSee [`RegExp.prototype.test()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test)\non MDN." - ], - "signature": "let test_: (t, string) => bool", - "deprecated": "" - } - ] - }, - "js/string2": { - "id": "Js.String2", - "name": "String2", - "docstrings": [ - "Provide bindings to JS string", - "Provide bindings to JS string. Optimized for pipe-first." - ], - "items": [ - { - "id": "Js.String2.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = string", - "deprecated": "" - }, - { - "id": "Js.String2.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nJs.String2.make(3.5) == \"3.5\"\nJs.String2.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCharCode", - "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to\nthat number; `n` ranges from 0 to 65535.If out of range, the lower 16 bits of\nthe value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as\n`fromCharCode(0xF63A)`.\n\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCharCode(65) == \"A\"\nJs.String2.fromCharCode(0x3c8) == `ψ`\nJs.String2.fromCharCode(0xd55c) == `한`\nJs.String2.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCharCodeMany", - "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`.\n\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)\non MDN." - ], - "signature": "let fromCharCodeMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCodePoint", - "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point. If the number is not a valid code point, it throws\n`RangeError`. Thus, `fromCodePoint(0x1F63A)` will produce a correct value,\nunlike `fromCharCode(0x1F63A)`, and `fromCodePoint(-5)` will throw a\n`RangeError`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePoint(65) == \"A\"\nJs.String2.fromCodePoint(0x3c8) == `ψ`\nJs.String2.fromCodePoint(0xd55c) == `한`\nJs.String2.fromCodePoint(0x1f63a) == `😺`\n```" - ], - "signature": "let fromCodePoint: int => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCodePointMany", - "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```" - ], - "signature": "let fromCodePointMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String2.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(s)` returns the length of the given `string`.\n\nSee [`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.length(\"abcd\") == 4\n```" - ], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.String2.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(s, n)` returns as a `string` the character at the given index number. If\n`n` is out of range, this function returns `undefined`,so at some point this\nfunction may be modified to return `option`.\n\n## Examples\n\n```rescript\nJs.String2.get(\"Reason\", 0) == \"R\"\nJs.String2.get(\"Reason\", 4) == \"o\"\nJs.String2.get(`Rẽasöń`, 5) == `ń`\n```" - ], - "signature": "let get: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.charAt", - "kind": "value", - "name": "charAt", - "docstrings": [ - "`charAt(s, n)` gets the character at index `n` within string `s`. If `n` is\nnegative or greater than the length of `s`, it returns the empty string. If the\nstring contains characters outside the range \\\\u0000-\\\\uffff, it will return the\nfirst 16-bit value at that position in the string.\n\nSee [`String.charAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.charAt(\"Reason\", 0) == \"R\"\nJs.String2.charAt(\"Reason\", 12) == \"\"\nJs.String2.charAt(`Rẽasöń`, 5) == `ń`\n```" - ], - "signature": "let charAt: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.charCodeAt", - "kind": "value", - "name": "charCodeAt", - "docstrings": [ - "`charCodeAt(s, n)` returns the character code at position `n` in string `s`;\nthe result is in the range 0-65535, unlke `codePointAt`, so it will not work\ncorrectly for characters with code points greater than or equal to 0x10000. The\nreturn type is `float` because this function returns NaN if `n` is less than\nzero or greater than the length of the string.\n\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.charCodeAt(`😺`, 0) == 0xd83d->Belt.Int.toFloat\nJs.String2.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" - ], - "signature": "let charCodeAt: (t, int) => float", - "deprecated": "" - }, - { - "id": "Js.String2.codePointAt", - "kind": "value", - "name": "codePointAt", - "docstrings": [ - "`codePointAt(s, n)` returns the code point at position `n` within string `s` as\na `Some(value)`. The return value handles code points greater than or equal to\n0x10000. If there is no code point at the given position, the function returns\n`None`.\n\nSee [`String.codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.codePointAt(`¿😺?`, 1) == Some(0x1f63a)\nJs.String2.codePointAt(\"abc\", 5) == None\n```" - ], - "signature": "let codePointAt: (t, int) => option", - "deprecated": "" - }, - { - "id": "Js.String2.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(original, append)` returns a new `string` with `append` added after\n`original`.\n\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.concat(\"cow\", \"bell\") == \"cowbell\"\n```" - ], - "signature": "let concat: (t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(original, arr)` returns a new `string` consisting of each item of an\narray of strings added to the `original` string.\n\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.concatMany(\"1st\", [\"2nd\", \"3rd\", \"4th\"]) == \"1st2nd3rd4th\"\n```" - ], - "signature": "let concatMany: (t, array) => t", - "deprecated": "" - }, - { - "id": "Js.String2.endsWith", - "kind": "value", - "name": "endsWith", - "docstrings": [ - "ES2015: `endsWith(str, substr)` returns `true` if the `str` ends with `substr`,\n`false` otherwise.\n\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.endsWith(\"ReScript\", \"Script\") == true\nJs.String2.endsWith(\"C++\", \"Script\") == false\n```" - ], - "signature": "let endsWith: (t, t) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.endsWithFrom", - "kind": "value", - "name": "endsWithFrom", - "docstrings": [ - "`endsWithFrom(str, ending, len)` returns `true` if the first len characters of\n`str` end with `ending`, `false` otherwise. If `len` is greater than or equal\nto the length of `str`, then it works like `endsWith`. (Honestly, this should\nhave been named endsWithAt, but oh well).\n\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.endsWithFrom(\"abcd\", \"cd\", 4) == true\nJs.String2.endsWithFrom(\"abcde\", \"cd\", 3) == false\nJs.String2.endsWithFrom(\"abcde\", \"cde\", 99) == true\nJs.String2.endsWithFrom(\"example.dat\", \"ple\", 7) == true\n```" - ], - "signature": "let endsWithFrom: (t, t, int) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "ES2015: `includes(str, searchValue)` returns `true` if `searchValue` is found\nanywhere within `str`, false otherwise.\n\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.includes(\"programmer\", \"gram\") == true\nJs.String2.includes(\"programmer\", \"er\") == true\nJs.String2.includes(\"programmer\", \"pro\") == true\nJs.String2.includes(\"programmer.dat\", \"xyz\") == false\n```" - ], - "signature": "let includes: (t, t) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.includesFrom", - "kind": "value", - "name": "includesFrom", - "docstrings": [ - "ES2015: `includes(str, searchValue start)` returns `true` if `searchValue` is\nfound anywhere within `str` starting at character number `start` (where 0 is\nthe first character), `false` otherwise.\n\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.includesFrom(\"programmer\", \"gram\", 1) == true\nJs.String2.includesFrom(\"programmer\", \"gram\", 4) == false\nJs.String2.includesFrom(`대한민국`, `한`, 1) == true\n```" - ], - "signature": "let includesFrom: (t, t, int) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "ES2015: `indexOf(str, searchValue)` returns the position at which `searchValue`\nwas first found within `str`, or -1 if `searchValue` is not in `str`.\n\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.indexOf(\"bookseller\", \"ok\") == 2\nJs.String2.indexOf(\"bookseller\", \"sell\") == 4\nJs.String2.indexOf(\"beekeeper\", \"ee\") == 1\nJs.String2.indexOf(\"bookseller\", \"xyz\") == -1\n```" - ], - "signature": "let indexOf: (t, t) => int", - "deprecated": "" - }, - { - "id": "Js.String2.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "`indexOfFrom(str, searchValue, start)` returns the position at which\n`searchValue` was found within `str` starting at character position `start`, or\n\\-1 if `searchValue` is not found in that portion of `str`. The return value is\nrelative to the beginning of the string, no matter where the search started\nfrom.\n\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.indexOfFrom(\"bookseller\", \"ok\", 1) == 2\nJs.String2.indexOfFrom(\"bookseller\", \"sell\", 2) == 4\nJs.String2.indexOfFrom(\"bookseller\", \"sell\", 5) == -1\n```" - ], - "signature": "let indexOfFrom: (t, t, int) => int", - "deprecated": "" - }, - { - "id": "Js.String2.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(str, searchValue)` returns the position of the last occurrence of\n`searchValue` within `str`, searching backwards from the end of the string.\nReturns -1 if `searchValue` is not in `str`. The return value is always\nrelative to the beginning of the string.\n\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.lastIndexOf(\"bookseller\", \"ok\") == 2\nJs.String2.lastIndexOf(\"beekeeper\", \"ee\") == 4\nJs.String2.lastIndexOf(\"abcdefg\", \"xyz\") == -1\n```" - ], - "signature": "let lastIndexOf: (t, t) => int", - "deprecated": "" - }, - { - "id": "Js.String2.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "`lastIndexOfFrom(str, searchValue, start)` returns the position of the last\noccurrence of `searchValue` within `str`, searching backwards from the given\nstart position. Returns -1 if `searchValue` is not in `str`. The return value\nis always relative to the beginning of the string.\n\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.lastIndexOfFrom(\"bookseller\", \"ok\", 6) == 2\nJs.String2.lastIndexOfFrom(\"beekeeper\", \"ee\", 8) == 4\nJs.String2.lastIndexOfFrom(\"beekeeper\", \"ee\", 3) == 1\nJs.String2.lastIndexOfFrom(\"abcdefg\", \"xyz\", 4) == -1\n```" - ], - "signature": "let lastIndexOfFrom: (t, t, int) => int", - "deprecated": "" - }, - { - "id": "Js.String2.localeCompare", - "kind": "value", - "name": "localeCompare", - "docstrings": [ - "`localeCompare(reference, comparison)` returns\n- a negative value if reference comes before comparison in sort order\n- zero if reference and comparison have the same sort order\n- a positive value if reference comes after comparison in sort order\n\nSee [`String.localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.localeCompare(\"zebra\", \"ant\") > 0.0\nJs.String2.localeCompare(\"ant\", \"zebra\") < 0.0\nJs.String2.localeCompare(\"cat\", \"cat\") == 0.0\nJs.String2.localeCompare(\"CAT\", \"cat\") > 0.0\n```" - ], - "signature": "let localeCompare: (t, t) => float", - "deprecated": "" - }, - { - "id": "Js.String2.match_", - "kind": "value", - "name": "match_", - "docstrings": [ - "`match(str, regexp)` matches a `string` against the given `regexp`. If there is\nno match, it returns `None`. For regular expressions without the g modifier, if\nthere is a match, the return value is `Some(array)` where the array contains:\n- The entire matched string\n- Any capture groups if the regexp had parentheses\n For regular expressions with the g modifier, a matched expression returns\n `Some(array)` with all the matched substrings and no capture groups.\n\nSee [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.match_(\"The better bats\", /b[aeiou]t/) == Some([\"bet\"])\nJs.String2.match_(\"The better bats\", /b[aeiou]t/g) == Some([\"bet\", \"bat\"])\nJs.String2.match_(\"Today is 2018-04-05.\", /(\\d+)-(\\d+)-(\\d+)/) ==\n Some([\"2018-04-05\", \"2018\", \"04\", \"05\"])\nJs.String2.match_(\"The large container.\", /b[aeiou]g/) == None\n```" - ], - "signature": "let match_: (t, Js_re.t) => option>>", - "deprecated": "" - }, - { - "id": "Js.String2.normalize", - "kind": "value", - "name": "normalize", - "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\u00e3 or the combination of a lower case letter A\n\\u0061 and a combining tilde \\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)\non MDN. See also [Unicode technical report\n#15](https://unicode.org/reports/tr15/) for details." - ], - "signature": "let normalize: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.normalizeByForm", - "kind": "value", - "name": "normalizeByForm", - "docstrings": [ - "ES2015: `normalize(str, form)` returns the normalized Unicode string using the\nspecified form of normalization, which may be one of:\n- \"NFC\" — Normalization Form Canonical Composition.\n- \"NFD\" — Normalization Form Canonical Decomposition.\n- \"NFKC\" — Normalization Form Compatibility Composition.\n- \"NFKD\" — Normalization Form Compatibility Decomposition.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\nSee also [Unicode technical report #15](https://unicode.org/reports/tr15/) for details." - ], - "signature": "let normalizeByForm: (t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.repeat", - "kind": "value", - "name": "repeat", - "docstrings": [ - "`repeat(str, n)` returns a `string` that consists of `n` repetitions of `str`.\nThrows `RangeError` if `n` is negative.\n\nSee [`String.repeat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.repeat(\"ha\", 3) == \"hahaha\"\nJs.String2.repeat(\"empty\", 0) == \"\"\n```" - ], - "signature": "let repeat: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.replace", - "kind": "value", - "name": "replace", - "docstrings": [ - "ES2015: `replace(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with the first matching instance of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.replace(\"old string\", \"old\", \"new\") == \"new string\"\nJs.String2.replace(\"the cat and the dog\", \"the\", \"this\") == \"this cat and the dog\"\n```" - ], - "signature": "let replace: (t, t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.replaceByRe", - "kind": "value", - "name": "replaceByRe", - "docstrings": [ - "`replaceByRe(str, regex, replacement)` returns a new `string` where occurrences\nmatching regex have been replaced by `replacement`.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.replaceByRe(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nJs.String2.replaceByRe(\"Juan Fulano\", /(\\w+) (\\w+)/, \"$2, $1\") == \"Fulano, Juan\"\n```" - ], - "signature": "let replaceByRe: (t, Js_re.t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy0", - "kind": "value", - "name": "unsafeReplaceBy0", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with no capturing\nparentheses replaced by the value returned from the given function. The\nfunction receives as its parameters the matched string, the offset at which the\nmatch begins, and the whole string being matched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (matchPart, _offset, _wholeString) => Js.String2.toUpperCase(matchPart)\n\nJs.String2.unsafeReplaceBy0(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" - ], - "signature": "let unsafeReplaceBy0: (t, Js_re.t, (t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy1", - "kind": "value", - "name": "unsafeReplaceBy1", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with one set of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstring, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (_match, part1, _offset, _wholeString) => {\n part1 ++ \"41\"\n}\n\nJs.String2.unsafeReplaceBy1(str, re, matchFn) == \"Jony is 41\"\n```" - ], - "signature": "let unsafeReplaceBy1: (t, Js_re.t, (t, t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy2", - "kind": "value", - "name": "unsafeReplaceBy2", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with two sets of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstrings, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (_match, p1, p2, _offset, _wholeString) => {\n switch (Belt.Int.fromString(p1), Belt.Int.fromString(p2)) {\n | (Some(x), Some(y)) => Belt.Int.toString(x * y)\n | _ => \"???\"\n }\n}\n\nJs.String2.unsafeReplaceBy2(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let unsafeReplaceBy2: (t, Js_re.t, (t, t, t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy3", - "kind": "value", - "name": "unsafeReplaceBy3", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with three sets of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstrings, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN." - ], - "signature": "let unsafeReplaceBy3: (t, Js_re.t, (t, t, t, t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.search", - "kind": "value", - "name": "search", - "docstrings": [ - "`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\n\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.search(\"testing 1 2 3\", /\\d+/) == 8\nJs.String2.search(\"no numbers\", /\\d+/) == -1\n```" - ], - "signature": "let search: (t, Js_re.t) => int", - "deprecated": "" - }, - { - "id": "Js.String2.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(str, from:n1, to_:n2)` returns the substring of `str` starting at\ncharacter `n1` up to but not including `n2`.\n- If either `n1` or `n2` is negative, then it is evaluated as `length(str - n1)` or `length(str - n2)`.\n- If `n2` is greater than the length of `str`, then it is treated as `length(str)`.\n- If `n1` is greater than `n2`, slice returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=5) == \"cde\"\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=9) == \"cdefg\"\nJs.String2.slice(\"abcdefg\", ~from=-4, ~to_=-2) == \"de\"\nJs.String2.slice(\"abcdefg\", ~from=5, ~to_=1) == \"\"\n```" - ], - "signature": "let slice: (t, ~from: int, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(str, from:n)` returns the substring of `str` starting at character\n`n` to the end of the string.\n- If `n` is negative, then it is evaluated as `length(str - n)`.\n- If `n` is greater than the length of `str`, then sliceToEnd returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.sliceToEnd(\"abcdefg\", ~from=4) == \"efg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=-2) == \"fg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=7) == \"\"\n```" - ], - "signature": "let sliceToEnd: (t, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nJs.String2.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nJs.String2.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nJs.String2.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```" - ], - "signature": "let split: (t, t) => array", - "deprecated": "" - }, - { - "id": "Js.String2.splitAtMost", - "kind": "value", - "name": "splitAtMost", - "docstrings": [ - "`splitAtMost delimiter ~limit: n str` splits the given `str` at every occurrence of `delimiter` and returns an array of the first `n` resulting substrings. If `n` is negative or greater than the number of substrings, the array will contain all the substrings.\n\n```\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 3 = [|\"ant\"; \"bee\"; \"cat\"|];;\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 0 = [| |];;\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 9 = [|\"ant\"; \"bee\"; \"cat\"; \"dog\"; \"elk\"|];;\n```" - ], - "signature": "let splitAtMost: (t, t, ~limit: int) => array", - "deprecated": "" - }, - { - "id": "Js.String2.splitByRe", - "kind": "value", - "name": "splitByRe", - "docstrings": [ - "`splitByRe(str, regex)` splits the given `str` at every occurrence of `regex`\nand returns an array of the resulting substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.splitByRe(\"art; bed , cog ;dad\", /\\s*[,;]\\s*TODO/) == [\n Some(\"art\"),\n Some(\"bed\"),\n Some(\"cog\"),\n Some(\"dad\"),\n ]\n```" - ], - "signature": "let splitByRe: (t, Js_re.t) => array>", - "deprecated": "" - }, - { - "id": "Js.String2.splitByReAtMost", - "kind": "value", - "name": "splitByReAtMost", - "docstrings": [ - "`splitByReAtMost(str, regex, ~limit:n)` splits the given `str` at every\noccurrence of `regex` and returns an array of the first `n` resulting\nsubstrings. If `n` is negative or greater than the number of substrings, the\narray will contain all the substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=3) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n ]\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=0) == []\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=8) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n Some(\"four\"),\n ]\n```" - ], - "signature": "let splitByReAtMost: (t, Js_re.t, ~limit: int) => array>", - "deprecated": "" - }, - { - "id": "Js.String2.startsWith", - "kind": "value", - "name": "startsWith", - "docstrings": [ - "ES2015: `startsWith(str, substr)` returns `true` if the `str` starts with\n`substr`, `false` otherwise.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWith(\"ReScript\", \"Re\") == true\nJs.String2.startsWith(\"ReScript\", \"\") == true\nJs.String2.startsWith(\"JavaScript\", \"Re\") == false\n```" - ], - "signature": "let startsWith: (t, t) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.startsWithFrom", - "kind": "value", - "name": "startsWithFrom", - "docstrings": [ - "ES2015: `startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, false otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWithFrom(\"ReScript\", \"Scri\", 2) == true\nJs.String2.startsWithFrom(\"ReScript\", \"\", 2) == true\nJs.String2.startsWithFrom(\"JavaScript\", \"Scri\", 2) == false\n```" - ], - "signature": "let startsWithFrom: (t, t, int) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.substr", - "kind": "value", - "name": "substr", - "docstrings": [ - "`substr(str, ~from:n)` returns the substring of `str` from position `n` to the\nend of the string.\n- If `n` is less than zero, the starting position is the length of `str - n`.\n- If `n` is greater than or equal to the length of `str`, returns the empty string.\n\nJavaScript’s `String.substr()` is a legacy function. When possible, use\n`substring()` instead.\n\nSee [`String.substr`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.substr(\"abcdefghij\", ~from=3) == \"defghij\"\nJs.String2.substr(\"abcdefghij\", ~from=-3) == \"hij\"\nJs.String2.substr(\"abcdefghij\", ~from=12) == \"\"\n```" - ], - "signature": "let substr: (t, ~from: int) => t", - "deprecated": "Use `String.substring` instead" - }, - { - "id": "Js.String2.substrAtMost", - "kind": "value", - "name": "substrAtMost", - "docstrings": [ - "`substrAtMost(str, ~from: pos, ~length: n)` returns the substring of `str` of\nlength `n` starting at position `pos`.\n- If `pos` is less than zero, the starting position is the length of `str - pos`.\n- If `pos` is greater than or equal to the length of `str`, returns the empty string.\n- If `n` is less than or equal to zero, returns the empty string.\n\nJavaScript’s `String.substr()` is a legacy function. When possible, use\n`substring()` instead.\n\nSee [`String.substr`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.substrAtMost(\"abcdefghij\", ~from=3, ~length=4) == \"defg\"\nJs.String2.substrAtMost(\"abcdefghij\", ~from=-3, ~length=4) == \"hij\"\nJs.String2.substrAtMost(\"abcdefghij\", ~from=12, ~length=2) == \"\"\n```" - ], - "signature": "let substrAtMost: (t, ~from: int, ~length: int) => t", - "deprecated": "Use `String.substringAtMost` instead" - }, - { - "id": "Js.String2.substring", - "kind": "value", - "name": "substring", - "docstrings": [ - "`substring(str, ~from: start, ~to_: finish)` returns characters `start` up to\nbut not including finish from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `finish` is zero or negative, the empty string is returned.\n- If `start` is greater than `finish`, the `start` and `finish` points are swapped.\n\nSee [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.substring(\"playground\", ~from=3, ~to_=6) == \"ygr\"\nJs.String2.substring(\"playground\", ~from=6, ~to_=3) == \"ygr\"\nJs.String2.substring(\"playground\", ~from=4, ~to_=12) == \"ground\"\n```" - ], - "signature": "let substring: (t, ~from: int, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.substringToEnd", - "kind": "value", - "name": "substringToEnd", - "docstrings": [ - "`substringToEnd(str, ~from: start)` returns the substring of `str` from\nposition `start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string is returned.\n\nSee [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.substringToEnd(\"playground\", ~from=4) == \"ground\"\nJs.String2.substringToEnd(\"playground\", ~from=-3) == \"playground\"\nJs.String2.substringToEnd(\"playground\", ~from=12) == \"\"\n```" - ], - "signature": "let substringToEnd: (t, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.toLowerCase", - "kind": "value", - "name": "toLowerCase", - "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms; one when it is the last\ncharacter in a string and another when it is not.\n\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.toLowerCase(\"ABC\") == \"abc\"\nJs.String2.toLowerCase(`ΣΠ`) == `σπ`\nJs.String2.toLowerCase(`ΠΣ`) == `πς`\n```" - ], - "signature": "let toLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.toLocaleLowerCase", - "kind": "value", - "name": "toLocaleLowerCase", - "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase)\non MDN." - ], - "signature": "let toLocaleLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.toUpperCase", - "kind": "value", - "name": "toUpperCase", - "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result; for example the German ß\ncapitalizes to two Ses in a row.\n\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.toUpperCase(\"abc\") == \"ABC\"\nJs.String2.toUpperCase(`Straße`) == `STRASSE`\nJs.String2.toUpperCase(`πς`) == `ΠΣ`\n```" - ], - "signature": "let toUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.toLocaleUpperCase", - "kind": "value", - "name": "toLocaleUpperCase", - "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\nSee [`String.to:LocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\non MDN." - ], - "signature": "let toLocaleUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.trim", - "kind": "value", - "name": "trim", - "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\n\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.trim(\" abc def \") == \"abc def\"\nJs.String2.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" - ], - "signature": "let trim: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.anchor", - "kind": "value", - "name": "anchor", - "docstrings": [ - "`anchor(anchorText, anchorName)` creates a string with an HTML `` element\nwith name attribute of `anchorName` and `anchorText` as its content. Please do\nnot use this method, as it has been removed from the relevant web standards.\n\nSee [`String.anchor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/anchor)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.anchor(\"Page One\", \"page1\") == \"Page One\"\n```" - ], - "signature": "let anchor: (t, t) => t", - "deprecated": "This function has been removed from the relevant web standards." - }, - { - "id": "Js.String2.link", - "kind": "value", - "name": "link", - "docstrings": [ - "ES2015: `link(linkText, urlText)` creates a string with an HTML `` element\nwith href attribute of `urlText` and `linkText` as its content. Please do not\nuse this method, as it has been removed from the relevant web standards. See\n[`String.link`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/link)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.link(\"Go to page two\", \"page2.html\") == \"Go to page two\"\n```" - ], - "signature": "let link: (t, t) => t", - "deprecated": "This function has been removed from the relevant web standards." - }, - { - "id": "Js.String2.castToArrayLike", - "kind": "value", - "name": "castToArrayLike", - "docstrings": [ - "Casts its argument to an `array_like` entity that can be processed by functions\nsuch as `Js.Array2.fromMap()`\n\n## Examples\n\n```rescript\nlet s = \"abcde\"\nlet arr = Js.Array2.fromMap(Js.String2.castToArrayLike(s), x => x)\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let castToArrayLike: t => Js_array2.array_like", - "deprecated": "" - } - ] - }, - "js/string": { - "id": "Js.String", - "name": "String", - "docstrings": [ - "Provide bindings to JS string", - "JavaScript String API" - ], - "items": [ - { - "id": "Js.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = string", - "deprecated": "" - }, - { - "id": "Js.String.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nJs.String2.make(3.5) == \"3.5\"\nJs.String2.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCharCode", - "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to that number; `n` ranges from 0 to 65535.\nIf out of range, the lower 16 bits of the value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as `fromCharCode(0xF63A)`. See [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCharCode(65) == \"A\"\nJs.String2.fromCharCode(0x3c8) == `ψ`\nJs.String2.fromCharCode(0xd55c) == `한`\nJs.String2.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCharCodeMany", - "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`. See\n[`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)\non MDN." - ], - "signature": "let fromCharCodeMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCodePoint", - "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point. If the number is not a valid code point, it throws\n`RangeError`.Thus, `fromCodePoint(0x1F63A)` will produce a correct value,\nunlike `fromCharCode(0x1F63A)`, and `fromCodePoint(-5)` will throw a\n`RangeError`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePoint(65) == \"A\"\nJs.String2.fromCodePoint(0x3c8) == `ψ`\nJs.String2.fromCodePoint(0xd55c) == `한`\nJs.String2.fromCodePoint(0x1f63a) == `😺`\n```" - ], - "signature": "let fromCodePoint: int => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCodePointMany", - "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```" - ], - "signature": "let fromCodePointMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(s)` returns the length of the given `string`. See\n[`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.length(\"abcd\") == 4\n```" - ], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.String.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(s, n)` returns as a `string` the character at the given index number. If\n`n` is out of range, this function returns `undefined`, so at some point this\nfunction may be modified to return `option`.\n\n## Examples\n\n```rescript\nJs.String2.get(\"Reason\", 0) == \"R\"\nJs.String2.get(\"Reason\", 4) == \"o\"\nJs.String2.get(`Rẽasöń`, 5) == `ń`\n```" - ], - "signature": "let get: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String.charAt", - "kind": "value", - "name": "charAt", - "docstrings": [], - "signature": "let charAt: (int, t) => t" - }, - { - "id": "Js.String.charCodeAt", - "kind": "value", - "name": "charCodeAt", - "docstrings": [], - "signature": "let charCodeAt: (int, t) => float" - }, - { - "id": "Js.String.codePointAt", - "kind": "value", - "name": "codePointAt", - "docstrings": [], - "signature": "let codePointAt: (int, t) => option" - }, - { - "id": "Js.String.concat", - "kind": "value", - "name": "concat", - "docstrings": [], - "signature": "let concat: (t, t) => t" - }, - { - "id": "Js.String.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [], - "signature": "let concatMany: (array, t) => t" - }, - { - "id": "Js.String.endsWith", - "kind": "value", - "name": "endsWith", - "docstrings": [], - "signature": "let endsWith: (t, t) => bool" - }, - { - "id": "Js.String.endsWithFrom", - "kind": "value", - "name": "endsWithFrom", - "docstrings": [], - "signature": "let endsWithFrom: (t, int, t) => bool" - }, - { - "id": "Js.String.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, t) => bool" - }, - { - "id": "Js.String.includesFrom", - "kind": "value", - "name": "includesFrom", - "docstrings": [], - "signature": "let includesFrom: (t, int, t) => bool" - }, - { - "id": "Js.String.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, t) => int" - }, - { - "id": "Js.String.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, int, t) => int" - }, - { - "id": "Js.String.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, t) => int" - }, - { - "id": "Js.String.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, int, t) => int" - }, - { - "id": "Js.String.localeCompare", - "kind": "value", - "name": "localeCompare", - "docstrings": [], - "signature": "let localeCompare: (t, t) => float" - }, - { - "id": "Js.String.match_", - "kind": "value", - "name": "match_", - "docstrings": [], - "signature": "let match_: (Js_re.t, t) => option>>" - }, - { - "id": "Js.String.normalize", - "kind": "value", - "name": "normalize", - "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\u00e3 or the combination of a lower case letter A\n\\u0061 and a combining tilde \\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)\non MDN.\n\nSee also [Unicode technical report #15](https://unicode.org/reports/tr15/) for\ndetails." - ], - "signature": "let normalize: t => t", - "deprecated": "" - }, - { - "id": "Js.String.normalizeByForm", - "kind": "value", - "name": "normalizeByForm", - "docstrings": [], - "signature": "let normalizeByForm: (t, t) => t" - }, - { - "id": "Js.String.repeat", - "kind": "value", - "name": "repeat", - "docstrings": [], - "signature": "let repeat: (int, t) => t" - }, - { - "id": "Js.String.replace", - "kind": "value", - "name": "replace", - "docstrings": [], - "signature": "let replace: (t, t, t) => t" - }, - { - "id": "Js.String.replaceByRe", - "kind": "value", - "name": "replaceByRe", - "docstrings": [], - "signature": "let replaceByRe: (Js_re.t, t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy0", - "kind": "value", - "name": "unsafeReplaceBy0", - "docstrings": [], - "signature": "let unsafeReplaceBy0: (Js_re.t, (t, int, t) => t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy1", - "kind": "value", - "name": "unsafeReplaceBy1", - "docstrings": [], - "signature": "let unsafeReplaceBy1: (Js_re.t, (t, t, int, t) => t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy2", - "kind": "value", - "name": "unsafeReplaceBy2", - "docstrings": [], - "signature": "let unsafeReplaceBy2: (Js_re.t, (t, t, t, int, t) => t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy3", - "kind": "value", - "name": "unsafeReplaceBy3", - "docstrings": [], - "signature": "let unsafeReplaceBy3: (Js_re.t, (t, t, t, t, int, t) => t, t) => t" - }, - { - "id": "Js.String.search", - "kind": "value", - "name": "search", - "docstrings": [], - "signature": "let search: (Js_re.t, t) => int" - }, - { - "id": "Js.String.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~from: int, ~to_: int, t) => t" - }, - { - "id": "Js.String.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [], - "signature": "let sliceToEnd: (~from: int, t) => t" - }, - { - "id": "Js.String.split", - "kind": "value", - "name": "split", - "docstrings": [], - "signature": "let split: (t, t) => array" - }, - { - "id": "Js.String.splitAtMost", - "kind": "value", - "name": "splitAtMost", - "docstrings": [], - "signature": "let splitAtMost: (t, ~limit: int, t) => array" - }, - { - "id": "Js.String.splitByRe", - "kind": "value", - "name": "splitByRe", - "docstrings": [], - "signature": "let splitByRe: (Js_re.t, t) => array>" - }, - { - "id": "Js.String.splitByReAtMost", - "kind": "value", - "name": "splitByReAtMost", - "docstrings": [], - "signature": "let splitByReAtMost: (Js_re.t, ~limit: int, t) => array>" - }, - { - "id": "Js.String.startsWith", - "kind": "value", - "name": "startsWith", - "docstrings": [], - "signature": "let startsWith: (t, t) => bool" - }, - { - "id": "Js.String.startsWithFrom", - "kind": "value", - "name": "startsWithFrom", - "docstrings": [], - "signature": "let startsWithFrom: (t, int, t) => bool" - }, - { - "id": "Js.String.substr", - "kind": "value", - "name": "substr", - "docstrings": [], - "signature": "let substr: (~from: int, t) => t" - }, - { - "id": "Js.String.substrAtMost", - "kind": "value", - "name": "substrAtMost", - "docstrings": [], - "signature": "let substrAtMost: (~from: int, ~length: int, t) => t" - }, - { - "id": "Js.String.substring", - "kind": "value", - "name": "substring", - "docstrings": [], - "signature": "let substring: (~from: int, ~to_: int, t) => t" - }, - { - "id": "Js.String.substringToEnd", - "kind": "value", - "name": "substringToEnd", - "docstrings": [], - "signature": "let substringToEnd: (~from: int, t) => t" - }, - { - "id": "Js.String.toLowerCase", - "kind": "value", - "name": "toLowerCase", - "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms; one when it is the last\ncharacter in a string and another when it is not.\n\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.toLowerCase(\"ABC\") == \"abc\"\nJs.String.toLowerCase(`ΣΠ`) == `σπ`\nJs.String.toLowerCase(`ΠΣ`) == `πς`\n```" - ], - "signature": "let toLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.toLocaleLowerCase", - "kind": "value", - "name": "toLocaleLowerCase", - "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\n\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase)\non MDN." - ], - "signature": "let toLocaleLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.toUpperCase", - "kind": "value", - "name": "toUpperCase", - "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result; for example the German ß\ncapitalizes to two Ses in a row.\n\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.toUpperCase(\"abc\") == \"ABC\"\nJs.String.toUpperCase(`Straße`) == `STRASSE`\nJs.String.toUpperCase(`πς`) == `ΠΣ`\n```" - ], - "signature": "let toUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.toLocaleUpperCase", - "kind": "value", - "name": "toLocaleUpperCase", - "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\n\nSee [`String.to:LocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\non MDN." - ], - "signature": "let toLocaleUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.trim", - "kind": "value", - "name": "trim", - "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\n\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.trim(\" abc def \") == \"abc def\"\nJs.String.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" - ], - "signature": "let trim: t => t", - "deprecated": "" - }, - { - "id": "Js.String.anchor", - "kind": "value", - "name": "anchor", - "docstrings": [], - "signature": "let anchor: (t, t) => t" - }, - { - "id": "Js.String.link", - "kind": "value", - "name": "link", - "docstrings": [], - "signature": "let link: (t, t) => t" - }, - { - "id": "Js.String.castToArrayLike", - "kind": "value", - "name": "castToArrayLike", - "docstrings": [ - "Casts its argument to an `array_like` entity that can be processed by functions\nsuch as `Js.Array2.fromMap()`\n\n## Examples\n\n```rescript\nlet s = \"abcde\"\nlet arr = Js.Array2.fromMap(Js.String.castToArrayLike(s), x => x)\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let castToArrayLike: t => Js_array2.array_like", - "deprecated": "This has been deprecated and will be removed in v13. Use functions from the `String` module instead." - } - ] - }, - "js/array2": { - "id": "Js.Array2", - "name": "Array2", - "docstrings": [ - "Provide bindings to JS array", - "Provides bindings to JavaScript’s `Array` functions. These bindings are optimized for pipe-first (`->`), where the array to be processed is the first parameter in the function.\n\nHere is an example to find the sum of squares of all even numbers in an array.\nWithout pipe first, we must call the functions in reverse order:\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nlet square = x => x * x\nlet result = {\n open Js.Array2\n reduce(map(filter([5, 2, 3, 4, 1], isEven), square), \"+\", 0)\n}\n```\n\nWith pipe first, we call the functions in the “natural” order:\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nlet square = x => x * x\nlet result = {\n open Js.Array2\n [5, 2, 3, 4, 1]->filter(isEven)->map(square)->reduce(\"+\", 0)\n}\n```" - ], - "items": [ - { - "id": "Js.Array2.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type used to describe a JavaScript array." - ], - "signature": "type t<'a> = array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [ - "A type used to describe JavaScript objects that are like an array or are iterable." - ], - "signature": "type array_like<'a> = Array.arrayLike<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.from", - "kind": "value", - "name": "from", - "docstrings": [ - "Creates a shallow copy of an array from an array-like object. See\n[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\non MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nJs.Array2.from(strArr) == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let from: array_like<'a> => array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fromMap", - "kind": "value", - "name": "fromMap", - "docstrings": [ - "Creates a new array by applying a function (the second argument) to each item\nin the `array_like` first argument. See\n[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\non MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nlet code = s => Js.String.charCodeAt(0, s)\nJs.Array2.fromMap(strArr, code) == [97.0, 98.0, 99.0, 100.0]\n```" - ], - "signature": "let fromMap: (array_like<'a>, 'a => 'b) => array<'b>", - "deprecated": "" - }, - { - "id": "Js.Array2.isArray", - "kind": "value", - "name": "isArray", - "docstrings": [ - "Returns `true` if its argument is an array; `false` otherwise. This is a runtime check, which is why the second example returns `true`\\---a list is internally represented as a nested JavaScript array.\n\n## Examples\n\n```rescript\nJs.Array2.isArray([5, 2, 3, 1, 4]) == true\nJs.Array2.isArray(list{5, 2, 3, 1, 4}) == true\nJs.Array2.isArray(\"abcd\") == false\n```" - ], - "signature": "let isArray: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Returns the number of elements in the array. See\n[`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length)\non MDN." - ], - "signature": "let length: array<'a> => int", - "deprecated": "" - }, - { - "id": "Js.Array2.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [ - "Copies from the first element in the given array to the designated `~to_`\nposition, returning the resulting array. *This function modifies the original\narray.* See\n[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.copyWithin(arr, ~to_=2) == [100, 101, 100, 101, 102]\narr == [100, 101, 100, 101, 102]\n```" - ], - "signature": "let copyWithin: (t<'a>, ~to_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [ - "Copies starting at element `~from` in the given array to the designated `~to_`\nposition, returning the resulting array. *This function modifies the original\narray.* See\n[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.copyWithinFrom(arr, ~from=2, ~to_=0) == [102, 103, 104, 103, 104]\narr == [102, 103, 104, 103, 104]\n```" - ], - "signature": "let copyWithinFrom: (t<'a>, ~to_: int, ~from: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [ - "Copies starting at element `~start` in the given array up to but not including\n`~end_` to the designated `~to_` position, returning the resulting array. *This\nfunction modifies the original array.* See\n[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105]\nJs.Array2.copyWithinFromRange(arr, ~start=2, ~end_=5, ~to_=1) == [100, 102, 103, 104, 104, 105]\narr == [100, 102, 103, 104, 104, 105]\n```" - ], - "signature": "let copyWithinFromRange: (t<'a>, ~to_: int, ~start: int, ~end_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [ - "Sets all elements of the given array (the first arumgent) to the designated\nvalue (the secon argument), returning the resulting array. *This function\nmodifies the original array.*\n\nSee\n[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.fillInPlace(arr, 99) == [99, 99, 99, 99, 99]\narr == [99, 99, 99, 99, 99]\n```" - ], - "signature": "let fillInPlace: (t<'a>, 'a) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [ - "Sets all elements of the given array (the first arumgent) from position `~from`\nto the end to the designated value (the second argument), returning the\nresulting array. *This function modifies the original array.* See\n[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.fillFromInPlace(arr, 99, ~from=2) == [100, 101, 99, 99, 99]\narr == [100, 101, 99, 99, 99]\n```" - ], - "signature": "let fillFromInPlace: (t<'a>, 'a, ~from: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [ - "Sets the elements of the given array (the first arumgent) from position\n`~start` up to but not including position `~end_` to the designated value (the\nsecond argument), returning the resulting array. *This function modifies the\noriginal array.* See\n[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.fillRangeInPlace(arr, 99, ~start=1, ~end_=4) == [100, 99, 99, 99, 104]\narr == [100, 99, 99, 99, 104]\n```" - ], - "signature": "let fillRangeInPlace: (t<'a>, 'a, ~start: int, ~end_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "If the array is not empty, removes the last element and returns it as\n`Some(value)`; returns `None` if the array is empty. *This function modifies\nthe original array.* See\n[`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.pop(arr) == Some(104)\narr == [100, 101, 102, 103]\n\nlet empty: array = []\nJs.Array2.pop(empty) == None\n```" - ], - "signature": "let pop: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.push", - "kind": "value", - "name": "push", - "docstrings": [ - "Appends the given value to the array, returning the number of elements in the\nupdated array. *This function modifies the original array.* See\n[`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array2.push(arr, \"dog\") == 4\narr == [\"ant\", \"bee\", \"cat\", \"dog\"]\n```" - ], - "signature": "let push: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.pushMany", - "kind": "value", - "name": "pushMany", - "docstrings": [ - "Appends the values from one array (the second argument) to another (the first\nargument), returning the number of elements in the updated array. *This\nfunction modifies the original array.* See\n[`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array2.pushMany(arr, [\"dog\", \"elk\"]) == 5\narr == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```" - ], - "signature": "let pushMany: (t<'a>, array<'a>) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [ - "Returns an array with the elements of the input array in reverse order. *This\nfunction modifies the original array.* See\n[`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array2.reverseInPlace(arr) == [\"cat\", \"bee\", \"ant\"]\narr == [\"cat\", \"bee\", \"ant\"]\n```" - ], - "signature": "let reverseInPlace: t<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.shift", - "kind": "value", - "name": "shift", - "docstrings": [ - "If the array is not empty, removes the first element and returns it as\n`Some(value)`; returns `None` if the array is empty. *This function modifies\nthe original array.* See\n[`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.shift(arr) == Some(100)\narr == [101, 102, 103, 104]\n\nlet empty: array = []\nJs.Array2.shift(empty) == None\n```" - ], - "signature": "let shift: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [ - "Sorts the given array in place and returns the sorted array. JavaScript sorts\nthe array by converting the arguments to UTF-16 strings and sorting them. See\nthe second example with sorting numbers, which does not do a numeric sort.\n*This function modifies the original array.* See\n[`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\non MDN.\n\n## Examples\n\n```rescript\nlet words = [\"bee\", \"dog\", \"ant\", \"cat\"]\nJs.Array2.sortInPlace(words) == [\"ant\", \"bee\", \"cat\", \"dog\"]\nwords == [\"ant\", \"bee\", \"cat\", \"dog\"]\n\nlet numbers = [3, 30, 10, 1, 20, 2]\nJs.Array2.sortInPlace(numbers) == [1, 10, 2, 20, 3, 30]\nnumbers == [1, 10, 2, 20, 3, 30]\n```" - ], - "signature": "let sortInPlace: t<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [ - "Sorts the given array in place and returns the sorted array. *This function\nmodifies the original array.*\n\nThe first argument to `sortInPlaceWith()` is a function that compares two items\nfrom the array and returns:\n\n* an integer less than zero if the first item is less than the second item \\*\n zero if the items are equal \\* an integer greater than zero if the first item is\n greater than the second item\n\nSee\n[`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\non MDN.\n\n## Examples\n\n```rescript\n// sort by word length\nlet words = [\"horse\", \"aardvark\", \"dog\", \"camel\"]\nlet byLength = (s1, s2) => Js.String.length(s1) - Js.String.length(s2)\n\nJs.Array2.sortInPlaceWith(words, byLength) == [\"dog\", \"horse\", \"camel\", \"aardvark\"]\n\n// sort in reverse numeric order\nlet numbers = [3, 30, 10, 1, 20, 2]\nlet reverseNumeric = (n1, n2) => n2 - n1\nJs.Array2.sortInPlaceWith(numbers, reverseNumeric) == [30, 20, 10, 3, 2, 1]\n```" - ], - "signature": "let sortInPlaceWith: (t<'a>, ('a, 'a) => int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.spliceInPlace", - "kind": "value", - "name": "spliceInPlace", - "docstrings": [ - "Starting at position `~pos`, remove `~remove` elements and then add the\nelements from the `~add` array. Returns an array consisting of the removed\nitems. *This function modifies the original array.* See\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.spliceInPlace(arr, ~pos=2, ~remove=2, ~add=[\"x\", \"y\", \"z\"]) == [\"c\", \"d\"]\narr == [\"a\", \"b\", \"x\", \"y\", \"z\", \"e\", \"f\"]\n\nlet arr2 = [\"a\", \"b\", \"c\", \"d\"]\nJs.Array2.spliceInPlace(arr2, ~pos=3, ~remove=0, ~add=[\"x\", \"y\"]) == []\narr2 == [\"a\", \"b\", \"c\", \"x\", \"y\", \"d\"]\n\nlet arr3 = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.spliceInPlace(arr3, ~pos=9, ~remove=2, ~add=[\"x\", \"y\", \"z\"]) == []\narr3 == [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"x\", \"y\", \"z\"]\n```" - ], - "signature": "let spliceInPlace: (t<'a>, ~pos: int, ~remove: int, ~add: array<'a>) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.removeFromInPlace", - "kind": "value", - "name": "removeFromInPlace", - "docstrings": [ - "Removes elements from the given array starting at position `~pos` to the end of\nthe array, returning the removed elements. *This function modifies the original\narray.* See\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.removeFromInPlace(arr, ~pos=4) == [\"e\", \"f\"]\narr == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let removeFromInPlace: (t<'a>, ~pos: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.removeCountInPlace", - "kind": "value", - "name": "removeCountInPlace", - "docstrings": [ - "Removes `~count` elements from the given array starting at position `~pos`,\nreturning the removed elements. *This function modifies the original array.*\nSee\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.removeCountInPlace(arr, ~pos=2, ~count=3) == [\"c\", \"d\", \"e\"]\narr == [\"a\", \"b\", \"f\"]\n```" - ], - "signature": "let removeCountInPlace: (t<'a>, ~pos: int, ~count: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.unshift", - "kind": "value", - "name": "unshift", - "docstrings": [ - "Adds the given element to the array, returning the new number of elements in\nthe array. *This function modifies the original array.* See\n[`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"b\", \"c\", \"d\"]\nJs.Array2.unshift(arr, \"a\") == 4\narr == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let unshift: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.unshiftMany", - "kind": "value", - "name": "unshiftMany", - "docstrings": [ - "Adds the elements in the second array argument at the beginning of the first\narray argument, returning the new number of elements in the array. *This\nfunction modifies the original array.* See\n[`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"d\", \"e\"]\nJs.Array2.unshiftMany(arr, [\"a\", \"b\", \"c\"]) == 5\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let unshiftMany: (t<'a>, array<'a>) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.append", - "kind": "value", - "name": "append", - "docstrings": [], - "signature": "let append: (t<'a>, 'a) => t<'a>", - "deprecated": "`append` is not type-safe. Use `concat` instead." - }, - { - "id": "Js.Array2.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "Concatenates the second array argument to the first array argument, returning a\nnew array. The original arrays are not modified. See\n[`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.concat([\"a\", \"b\"], [\"c\", \"d\", \"e\"]) == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "The second argument to `concatMany()` is an array of arrays; these are added at\nthe end of the first argument, returning a new array. See\n[`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.concatMany([\"a\", \"b\", \"c\"], [[\"d\", \"e\"], [\"f\", \"g\", \"h\"]]) == [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n ]\n```" - ], - "signature": "let concatMany: (t<'a>, array>) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "Returns true if the given value is in the array, `false` otherwise. See\n[`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.includes([\"a\", \"b\", \"c\"], \"b\") == true\nJs.Array2.includes([\"a\", \"b\", \"c\"], \"x\") == false\n```" - ], - "signature": "let includes: (t<'a>, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "Returns the index of the first element in the array that has the given value.\nIf the value is not in the array, returns -1. See\n[`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.indexOf([100, 101, 102, 103], 102) == 2\nJs.Array2.indexOf([100, 101, 102, 103], 999) == -1\n```" - ], - "signature": "let indexOf: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "Returns the index of the first element in the array with the given value. The\nsearch starts at position `~from`. See\n[`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.indexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\"], \"a\", ~from=2) == 2\nJs.Array2.indexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\"], \"a\", ~from=3) == 4\nJs.Array2.indexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\"], \"b\", ~from=2) == -1\n```" - ], - "signature": "let indexOfFrom: (t<'a>, 'a, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "This function converts each element of the array to a string (via JavaScript)\nand concatenates them, separated by the string given in the first argument,\ninto a single string. See\n[`Array.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.joinWith([\"ant\", \"bee\", \"cat\"], \"--\") == \"ant--bee--cat\"\nJs.Array2.joinWith([\"door\", \"bell\"], \"\") == \"doorbell\"\nJs.Array2.joinWith([2020, 9, 4], \"/\") == \"2020/9/4\"\nJs.Array2.joinWith([2.5, 3.6, 3e-2], \";\") == \"2.5;3.6;0.03\"\n```" - ], - "signature": "let joinWith: (t<'a>, string) => string", - "deprecated": "" - }, - { - "id": "Js.Array2.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "Returns the index of the last element in the array that has the given value. If\nthe value is not in the array, returns -1. See\n[`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.lastIndexOf([\"a\", \"b\", \"a\", \"c\"], \"a\") == 2\nJs.Array2.lastIndexOf([\"a\", \"b\", \"a\", \"c\"], \"x\") == -1\n```" - ], - "signature": "let lastIndexOf: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "Returns the index of the last element in the array that has the given value,\nsearching from position `~from` down to the start of the array. If the value is\nnot in the array, returns -1. See\n[`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.lastIndexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\", \"d\"], \"a\", ~from=3) == 2\nJs.Array2.lastIndexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\", \"d\"], \"c\", ~from=2) == -1\n```" - ], - "signature": "let lastIndexOfFrom: (t<'a>, 'a, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "Returns a shallow copy of the given array from the `~start` index up to but not\nincluding the `~end_` position. Negative numbers indicate an offset from the\nend of the array. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105, 106]\nJs.Array2.slice(arr, ~start=2, ~end_=5) == [102, 103, 104]\nJs.Array2.slice(arr, ~start=-3, ~end_=-1) == [104, 105]\nJs.Array2.slice(arr, ~start=9, ~end_=10) == []\n```" - ], - "signature": "let slice: (t<'a>, ~start: int, ~end_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Returns a copy of the entire array. Same as `Js.Array2.Slice(arr, ~start=0,\n~end_=Js.Array2.length(arr))`. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." - ], - "signature": "let copy: t<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [ - "Returns a shallow copy of the given array from the given index to the end. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." - ], - "signature": "let sliceFrom: (t<'a>, int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts the array to a string. Each element is converted to a string using\nJavaScript. Unlike the JavaScript `Array.toString()`, all elements in a\nReasonML array must have the same type. See\n[`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.toString([3.5, 4.6, 7.8]) == \"3.5,4.6,7.8\"\nJs.Array2.toString([\"a\", \"b\", \"c\"]) == \"a,b,c\"\n```" - ], - "signature": "let toString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array2.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Converts the array to a string using the conventions of the current locale.\nEach element is converted to a string using JavaScript. Unlike the JavaScript\n`Array.toLocaleString()`, all elements in a ReasonML array must have the same\ntype. See\n[`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.toLocaleString([Js.Date.make()])\n// returns \"3/19/2020, 10:52:11 AM\" for locale en_US.utf8\n// returns \"2020-3-19 10:52:11\" for locale de_DE.utf8\n```" - ], - "signature": "let toLocaleString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array2.every", - "kind": "value", - "name": "every", - "docstrings": [ - "The first argument to `every()` is an array. The second argument is a predicate\nfunction that returns a boolean. The `every()` function returns `true` if the\npredicate function is true for all items in the given array. If given an empty\narray, returns `true`. See\n[`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every)\non MDN.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nJs.Array2.every([6, 22, 8, 4], isEven) == true\nJs.Array2.every([6, 22, 7, 4], isEven) == false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [ - "The first argument to `everyi()` is an array. The second argument is a\npredicate function with two arguments: an array element and that element’s\nindex; it returns a boolean. The `everyi()` function returns `true` if the\npredicate function is true for all items in the given array. If given an empty\narray, returns `true`. See\n[`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every)\non MDN.\n\n## Examples\n\n```rescript\n// determine if all even-index items are positive\nlet evenIndexPositive = (item, index) => mod(index, 2) == 0 ? item > 0 : true\n\nJs.Array2.everyi([6, -3, 5, 8], evenIndexPositive) == true\nJs.Array2.everyi([6, 3, -5, 8], evenIndexPositive) == false\n```" - ], - "signature": "let everyi: (t<'a>, ('a, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "Applies the given predicate function (the second argument) to each element in\nthe array; the result is an array of those elements for which the predicate\nfunction returned `true`. See\n[`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\non MDN.\n\n## Examples\n\n```rescript\nlet nonEmpty = s => s != \"\"\nJs.Array2.filter([\"abc\", \"\", \"\", \"def\", \"ghi\"], nonEmpty) == [\"abc\", \"def\", \"ghi\"]\n```" - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [ - "Each element of the given array are passed to the predicate function. The\nreturn value is an array of all those elements for which the predicate function\nreturned `true`.\n\nSee\n[`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\non MDN.\n\n## Examples\n\n```rescript\n// keep only positive elements at odd indices\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array2.filteri([6, 3, 5, 8, 7, -4, 1], positiveOddElement) == [3, 8]\n```" - ], - "signature": "let filteri: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.find", - "kind": "value", - "name": "find", - "docstrings": [ - "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find first negative element\nJs.Array2.find([33, 22, -55, 77, -44], x => x < 0) == Some(-55)\nJs.Array2.find([33, 22, 55, 77, 44], x => x < 0) == None\n```" - ], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.findi", - "kind": "value", - "name": "findi", - "docstrings": [ - "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate. The\npredicate function takes an array element and an index as its parameters. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find first positive item at an odd index\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array2.findi([66, -33, 55, 88, 22], positiveOddElement) == Some(88)\nJs.Array2.findi([66, -33, 55, -88, 22], positiveOddElement) == None\n```" - ], - "signature": "let findi: (t<'a>, ('a, int) => bool) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [ - "Returns the index of the first element in the array that satisifies the given\npredicate function, or -1 if no element satisifies the predicate. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.findIndex([33, 22, -55, 77, -44], x => x < 0) == 2\nJs.Array2.findIndex([33, 22, 55, 77, 44], x => x < 0) == -1\n```" - ], - "signature": "let findIndex: (t<'a>, 'a => bool) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [ - "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate. The\npredicate function takes an array element and an index as its parameters. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find index of first positive item at an odd index\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array2.findIndexi([66, -33, 55, 88, 22], positiveOddElement) == 3\nJs.Array2.findIndexi([66, -33, 55, -88, 22], positiveOddElement) == -1\n```" - ], - "signature": "let findIndexi: (t<'a>, ('a, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "The `forEach()` function applies the function given as the second argument to\neach element in the array. The function you provide returns `unit`, and the\n`forEach()` function also returns `unit`. You use `forEach()` when you need to\nprocess each element in the array but not return any new array or value; for\nexample, to print the items in an array. See\n[`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\non MDN.\n\n## Examples\n\n```rescript\n// display all elements in an array\nJs.Array2.forEach([\"a\", \"b\", \"c\"], x => Js.log(x)) == ()\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Array2.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [ - "The `forEachi()` function applies the function given as the second argument to\neach element in the array. The function you provide takes an item in the array\nand its index number, and returns `unit`. The `forEachi()` function also\nreturns `unit`. You use `forEachi()` when you need to process each element in\nthe array but not return any new array or value; for example, to print the\nitems in an array. See\n[`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\non MDN.\n\n## Examples\n\n```rescript\n// display all elements in an array as a numbered list\nJs.Array2.forEachi([\"a\", \"b\", \"c\"], (item, index) => Js.log2(index + 1, item)) == ()\n```" - ], - "signature": "let forEachi: (t<'a>, ('a, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Array2.map", - "kind": "value", - "name": "map", - "docstrings": [ - "Applies the function (the second argument) to each item in the array, returning\na new array. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]\nJs.Array2.map([\"animal\", \"vegetable\", \"mineral\"], Js.String.length) == [6, 9, 7]\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Array2.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [ - "Applies the function (the second argument) to each item in the array, returning\na new array. The function acceps two arguments: an item from the array and its\nindex number. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array2.mapi([10, 11, 12], product) == [0, 11, 24]\n```" - ], - "signature": "let mapi: (t<'a>, ('a, int) => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Array2.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "The `reduce()` function takes three parameters: an array, a *reducer function*,\nand a beginning accumulator value. The reducer function has two parameters: an\naccumulated value and an element of the array.\n\n`reduce()` first calls the reducer function with the beginning value and the\nfirst element in the array. The result becomes the new accumulator value, which\nis passed in to the reducer function along with the second element in the\narray. `reduce()` proceeds through the array, passing in the result of each\nstage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduce()`. See\n[`Array.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\non MDN.\n\n## Examples\n\n```rescript\nlet sumOfSquares = (accumulator, item) => accumulator + item * item\n\nJs.Array2.reduce([10, 2, 4], sumOfSquares, 0) == 120\nJs.Array2.reduce([10, 2, 4], \"*\", 1) == 80\nJs.Array2.reduce(\n [\"animal\", \"vegetable\", \"mineral\"],\n (acc, item) => acc + Js.String.length(item),\n 0,\n) == 22 // 6 + 9 + 7\nJs.Array2.reduce([2.0, 4.0], (acc, item) => item /. acc, 1.0) == 2.0 // 4.0 / (2.0 / 1.0)\n```" - ], - "signature": "let reduce: (t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [ - "The `reducei()` function takes three parameters: an array, a *reducer\nfunction*, and a beginning accumulator value. The reducer function has three\nparameters: an accumulated value, an element of the array, and the index of\nthat element.\n\n`reducei()` first calls the reducer function with the beginning value, the\nfirst element in the array, and zero (its index). The result becomes the new\naccumulator value, which is passed to the reducer function along with the\nsecond element in the array and one (its index). `reducei()` proceeds from left\nto right through the array, passing in the result of each stage as the\naccumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reducei()`. See\n[`Array.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\non MDN.\n\n## Examples\n\n```rescript\n// find sum of even-index elements in array\nlet sumOfEvens = (accumulator, item, index) =>\n if mod(index, 2) == 0 {\n accumulator + item\n } else {\n accumulator\n }\n\nJs.Array2.reducei([2, 5, 1, 4, 3], sumOfEvens, 0) == 6\n```" - ], - "signature": "let reducei: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [ - "The `reduceRight()` function takes three parameters: an array, a *reducer\nfunction*, and a beginning accumulator value. The reducer function has two\nparameters: an accumulated value and an element of the array.\n\n`reduceRight()` first calls the reducer function with the beginning value and\nthe last element in the array. The result becomes the new accumulator value,\nwhich is passed in to the reducer function along with the next-to-last element\nin the array. `reduceRight()` proceeds from right to left through the array,\npassing in the result of each stage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduceRight()`. See\n[`Array.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight)\non MDN.\n\n**NOTE:** In many cases, `reduce()` and `reduceRight()` give the same result.\nHowever, see the last example here and compare it to the example from\n`reduce()`, where order makes a difference.\n\n## Examples\n\n```rescript\nlet sumOfSquares = (accumulator, item) => accumulator + item * item\n\nJs.Array2.reduceRight([10, 2, 4], sumOfSquares, 0) == 120\nJs.Array2.reduceRight([2.0, 4.0], (acc, item) => item /. acc, 1.0) == 0.5 // 2.0 / (4.0 / 1.0)\n```" - ], - "signature": "let reduceRight: (t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [ - "The `reduceRighti()` function takes three parameters: an array, a *reducer\nfunction*, and a beginning accumulator value. The reducer function has three\nparameters: an accumulated value, an element of the array, and the index of\nthat element. `reduceRighti()` first calls the reducer function with the\nbeginning value, the last element in the array, and its index (length of array\nminus one). The result becomes the new accumulator value, which is passed in to\nthe reducer function along with the second element in the array and one (its\nindex). `reduceRighti()` proceeds from right to left through the array, passing\nin the result of each stage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduceRighti()`. See\n[`Array.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight)\non MDN.\n\n**NOTE:** In many cases, `reducei()` and `reduceRighti()` give the same result.\nHowever, there are cases where the order in which items are processed makes a\ndifference.\n\n## Examples\n\n```rescript\n// find sum of even-index elements in array\nlet sumOfEvens = (accumulator, item, index) =>\n if mod(index, 2) == 0 {\n accumulator + item\n } else {\n accumulator\n }\n\nJs.Array2.reduceRighti([2, 5, 1, 4, 3], sumOfEvens, 0) == 6\n```" - ], - "signature": "let reduceRighti: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Returns `true` if the predicate function given as the second argument to\n`some()` returns `true` for any element in the array; `false` otherwise.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nJs.Array2.some([3, 7, 5, 2, 9], isEven) == true\nJs.Array2.some([3, 7, 5, 1, 9], isEven) == false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.somei", - "kind": "value", - "name": "somei", - "docstrings": [ - "Returns `true` if the predicate function given as the second argument to\n`somei()` returns `true` for any element in the array; `false` otherwise. The\npredicate function has two arguments: an item from the array and the index\nvalue\n\n## Examples\n\n```rescript\n// Does any string in the array\n// have the same length as its index?\n\nlet sameLength = (str, index) => Js.String.length(str) == index\n\n// \"ef\" has length 2 and is it at index 2\nJs.Array2.somei([\"ab\", \"cd\", \"ef\", \"gh\"], sameLength) == true\n// no item has the same length as its index\nJs.Array2.somei([\"a\", \"bc\", \"def\", \"gh\"], sameLength) == false\n```" - ], - "signature": "let somei: (t<'a>, ('a, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [ - "Returns the value at the given position in the array if the position is in\nbounds; returns the JavaScript value `undefined` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array2.unsafe_get(arr, 3) == 103\nJs.Array2.unsafe_get(arr, 4) // returns undefined\n```" - ], - "signature": "let unsafe_get: (array<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Js.Array2.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [ - "Sets the value at the given position in the array if the position is in bounds.\nIf the index is out of bounds, well, “here there be dragons.“\n\n*This function modifies the original array.*\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array2.unsafe_set(arr, 3, 99)\n// result is [100, 101, 102, 99];\n\nJs.Array2.unsafe_set(arr, 4, 88)\n// result is [100, 101, 102, 99, 88]\n\nJs.Array2.unsafe_set(arr, 6, 77)\n// result is [100, 101, 102, 99, 88, <1 empty item>, 77]\n\nJs.Array2.unsafe_set(arr, -1, 66)\n// you don't want to know.\n```" - ], - "signature": "let unsafe_set: (array<'a>, int, 'a) => unit", - "deprecated": "" - } - ] - }, - "js/array": { - "id": "Js.Array", - "name": "Array", - "docstrings": [ - "Provide bindings to JS array", - "Provides bindings to JavaScript’s `Array` functions. These bindings are\noptimized for pipe-last (`|>`), where the array to be processed is the last\nparameter in the function." - ], - "items": [ - { - "id": "Js.Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type used to describe a JavaScript array." - ], - "signature": "type t<'a> = array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [ - "A type used to describe JavaScript objects that are like an array or are iterable." - ], - "signature": "type array_like<'a> = Js_array2.array_like<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.from", - "kind": "value", - "name": "from", - "docstrings": [ - "Creates a shallow copy of an array from an array-like object. See [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nJs.Array.from(strArr) == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let from: array_like<'a> => array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.fromMap", - "kind": "value", - "name": "fromMap", - "docstrings": [ - "Creates a new array by applying a function (the second argument) to each item\nin the `array_like` first argument. See\n[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\non MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nlet code = s => Js.String.charCodeAt(0, s)\nJs.Array.fromMap(strArr, code) == [97.0, 98.0, 99.0, 100.0]\n```" - ], - "signature": "let fromMap: (array_like<'a>, 'a => 'b) => array<'b>", - "deprecated": "" - }, - { - "id": "Js.Array.isArray", - "kind": "value", - "name": "isArray", - "docstrings": [], - "signature": "let isArray: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.Array.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Returns the number of elements in the array. See [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN." - ], - "signature": "let length: array<'a> => int", - "deprecated": "" - }, - { - "id": "Js.Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (~to_: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (~to_: int, ~from: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: ('a, t<'a>) => 'b" - }, - { - "id": "Js.Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: ('a, ~from: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: ('a, ~start: int, ~end_: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "If the array is not empty, removes the last element and returns it as `Some(value)`; returns `None` if the array is empty. *This function modifies the original array.* See [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array.pop(arr) == Some(104)\narr == [100, 101, 102, 103]\n\nlet empty: array = []\nJs.Array.pop(empty) == None\n```" - ], - "signature": "let pop: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.push", - "kind": "value", - "name": "push", - "docstrings": [], - "signature": "let push: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.pushMany", - "kind": "value", - "name": "pushMany", - "docstrings": [], - "signature": "let pushMany: (array<'a>, t<'a>) => int" - }, - { - "id": "Js.Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [ - "Returns an array with the elements of the input array in reverse order. *This function modifies the original array.* See [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array.reverseInPlace(arr) == [\"cat\", \"bee\", \"ant\"]\narr == [\"cat\", \"bee\", \"ant\"]\n```" - ], - "signature": "let reverseInPlace: t<'a> => 'this", - "deprecated": "" - }, - { - "id": "Js.Array.shift", - "kind": "value", - "name": "shift", - "docstrings": [ - "If the array is not empty, removes the first element and returns it as `Some(value)`; returns `None` if the array is empty. *This function modifies the original array.* See [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array.shift(arr) == Some(100)\narr == [101, 102, 103, 104]\n\nlet empty: array = []\nJs.Array.shift(empty) == None\n```" - ], - "signature": "let shift: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [ - "Sorts the given array in place and returns the sorted array. JavaScript sorts the array by converting the arguments to UTF-16 strings and sorting them. See the second example with sorting numbers, which does not do a numeric sort. *This function modifies the original array.* See [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet words = [\"bee\", \"dog\", \"ant\", \"cat\"]\nJs.Array.sortInPlace(words) == [\"ant\", \"bee\", \"cat\", \"dog\"]\nwords == [\"ant\", \"bee\", \"cat\", \"dog\"]\n\nlet numbers = [3, 30, 10, 1, 20, 2]\nJs.Array.sortInPlace(numbers) == [1, 10, 2, 20, 3, 30]\nnumbers == [1, 10, 2, 20, 3, 30]\n```" - ], - "signature": "let sortInPlace: t<'a> => 'this", - "deprecated": "This has been deprecated and will be removed in v13. Use functions from the `Array` module instead." - }, - { - "id": "Js.Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (('a, 'a) => int, t<'a>) => 'b" - }, - { - "id": "Js.Array.spliceInPlace", - "kind": "value", - "name": "spliceInPlace", - "docstrings": [], - "signature": "let spliceInPlace: (~pos: int, ~remove: int, ~add: array<'a>, t<'a>) => 'b" - }, - { - "id": "Js.Array.removeFromInPlace", - "kind": "value", - "name": "removeFromInPlace", - "docstrings": [], - "signature": "let removeFromInPlace: (~pos: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.removeCountInPlace", - "kind": "value", - "name": "removeCountInPlace", - "docstrings": [], - "signature": "let removeCountInPlace: (~pos: int, ~count: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.unshift", - "kind": "value", - "name": "unshift", - "docstrings": [], - "signature": "let unshift: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.unshiftMany", - "kind": "value", - "name": "unshiftMany", - "docstrings": [], - "signature": "let unshiftMany: (array<'a>, t<'a>) => int" - }, - { - "id": "Js.Array.concat", - "kind": "value", - "name": "concat", - "docstrings": [], - "signature": "let concat: ('a, t<'b>) => 'a" - }, - { - "id": "Js.Array.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [], - "signature": "let concatMany: (array<'a>, t<'b>) => 'a" - }, - { - "id": "Js.Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: ('a, t<'a>) => bool" - }, - { - "id": "Js.Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: ('a, ~from: int, t<'a>) => int" - }, - { - "id": "Js.Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (string, t<'a>) => string" - }, - { - "id": "Js.Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: ('a, ~from: int, t<'a>) => int" - }, - { - "id": "Js.Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (int, ~end_: int, ~obj: t<'a>) => 'b" - }, - { - "id": "Js.Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Returns a copy of the entire array. Same as `Js.Array.Slice(~start=0,\n~end_=Js.Array.length(arr), arr)`. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." - ], - "signature": "let copy: t<'a> => 'this", - "deprecated": "" - }, - { - "id": "Js.Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (int, t<'a>) => 'b" - }, - { - "id": "Js.Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts the array to a string. Each element is converted to a string using\nJavaScript. Unlike the JavaScript `Array.toString()`, all elements in a\nReasonML array must have the same type. See\n[`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.toString([3.5, 4.6, 7.8]) == \"3.5,4.6,7.8\"\nJs.Array.toString([\"a\", \"b\", \"c\"]) == \"a,b,c\"\n```" - ], - "signature": "let toString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Converts the array to a string using the conventions of the current locale.\nEach element is converted to a string using JavaScript. Unlike the JavaScript\n`Array.toLocaleString()`, all elements in a ReasonML array must have the same\ntype. See\n[`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.toLocaleString([Js.Date.make()])\n// returns \"3/19/2020, 10:52:11 AM\" for locale en_US.utf8\n// returns \"2020-3-19 10:52:11\" for locale de_DE.utf8\n```" - ], - "signature": "let toLocaleString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: ('a => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (('a, int) => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: ('a => bool, t<'a>) => 'b" - }, - { - "id": "Js.Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (('a, int) => bool, t<'a>) => 'b" - }, - { - "id": "Js.Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: ('a => bool, t<'a>) => option<'a>" - }, - { - "id": "Js.Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (('a, int) => bool, t<'a>) => option<'a>" - }, - { - "id": "Js.Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: ('a => bool, t<'a>) => int" - }, - { - "id": "Js.Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (('a, int) => bool, t<'a>) => int" - }, - { - "id": "Js.Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: ('a => unit, t<'a>) => unit" - }, - { - "id": "Js.Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (('a, int) => unit, t<'a>) => unit" - }, - { - "id": "Js.Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: ('a => 'b, t<'a>) => t<'b>" - }, - { - "id": "Js.Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (('a, int) => 'b, t<'a>) => t<'b>" - }, - { - "id": "Js.Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (('a, 'b) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (('a, 'b, int) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (('a, 'b) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (('a, 'b, int) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: ('a => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (('a, int) => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [ - "Returns the value at the given position in the array if the position is in\nbounds; returns the JavaScript value `undefined` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array.unsafe_get(arr, 3) == 103\nJs.Array.unsafe_get(arr, 4) // returns undefined\n```" - ], - "signature": "let unsafe_get: (array<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Js.Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [ - "Sets the value at the given position in the array if the position is in bounds.\nIf the index is out of bounds, well, “here there be dragons.“ *This function\nmodifies the original array.*\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array.unsafe_set(arr, 3, 99)\n// result is [100, 101, 102, 99]\n\nJs.Array.unsafe_set(arr, 4, 88)\n// result is [100, 101, 102, 99, 88]\n\nJs.Array.unsafe_set(arr, 6, 77)\n// result is [100, 101, 102, 99, 88, <1 empty item>, 77]\n\nJs.Array.unsafe_set(arr, -1, 66)\n// you don't want to know.\n```" - ], - "signature": "let unsafe_set: (array<'a>, int, 'a) => unit", - "deprecated": "" - } - ] - }, - "js/exn": { - "id": "Js.Exn", - "name": "Exn", - "docstrings": [ - "Provide utilities for dealing with Js exceptions", - "Provide utilities for dealing with JS exceptions." - ], - "items": [ - { - "id": "Js.Exn.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JS exception" - ], - "signature": "type t", - "deprecated": "" - }, - { - "id": "Js.Exn.asJsExn", - "kind": "value", - "name": "asJsExn", - "docstrings": [], - "signature": "let asJsExn: exn => option", - "deprecated": "" - }, - { - "id": "Js.Exn.stack", - "kind": "value", - "name": "stack", - "docstrings": [], - "signature": "let stack: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.message", - "kind": "value", - "name": "message", - "docstrings": [], - "signature": "let message: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.name", - "kind": "value", - "name": "name", - "docstrings": [], - "signature": "let name: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [], - "signature": "let fileName: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.anyToExnInternal", - "kind": "value", - "name": "anyToExnInternal", - "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a Exn.Error if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." - ], - "signature": "let anyToExnInternal: 'a => exn", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseError", - "kind": "value", - "name": "raiseError", - "docstrings": [ - "Raise Js exception Error object with stacktrace" - ], - "signature": "let raiseError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseEvalError", - "kind": "value", - "name": "raiseEvalError", - "docstrings": [], - "signature": "let raiseEvalError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseRangeError", - "kind": "value", - "name": "raiseRangeError", - "docstrings": [], - "signature": "let raiseRangeError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseReferenceError", - "kind": "value", - "name": "raiseReferenceError", - "docstrings": [], - "signature": "let raiseReferenceError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseSyntaxError", - "kind": "value", - "name": "raiseSyntaxError", - "docstrings": [], - "signature": "let raiseSyntaxError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseTypeError", - "kind": "value", - "name": "raiseTypeError", - "docstrings": [], - "signature": "let raiseTypeError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseUriError", - "kind": "value", - "name": "raiseUriError", - "docstrings": [], - "signature": "let raiseUriError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(exn)` ignores the provided exn and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit", - "deprecated": "" - } - ] - }, - "js/null_undefined": { - "id": "Js.Null_undefined", - "name": "Null_undefined", - "docstrings": [ - "Contains functionality for dealing with values that can be both `null` and `undefined`" - ], - "items": [ - { - "id": "Js.Null_undefined.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.null_undefined<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [ - "Returns `true` if the given value is null or undefined, `false` otherwise." - ], - "signature": "let isNullable: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The null value of type `Js.null_undefined<'a>`." - ], - "signature": "let null: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The undefined value of type `Js.null_undefined<'a>`." - ], - "signature": "let undefined: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\n\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped, mapped to\na `'b` using the given function `a' => 'b`, then wrapped back up and returned\nas `Js.null_undefined<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.null_undefined) =>\n Js.Null_undefined.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function.\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped and applied to the given function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.null_undefined) =>\n Js.Null_undefined.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.null_undefined<'a>`.\n`Some(a)` => `a`\n`None` => `undefined`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.null_undefined<'a>` to `option<'a>`.\n`a` => `Some(a)`\n`undefined` => `None`\n`null` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - }, - "js/nullable": { - "id": "Js.Nullable", - "name": "Nullable", - "docstrings": [ - "Provide utilities for `Js.null_undefined`", - "Contains functionality for dealing with values that can be both `null` and `undefined`" - ], - "items": [ - { - "id": "Js.Nullable.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined", - "deprecated": "" - }, - { - "id": "Js.Nullable.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.null_undefined<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [ - "Returns `true` if the given value is null or undefined, `false` otherwise." - ], - "signature": "let isNullable: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Nullable.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The null value of type `Js.null_undefined<'a>`." - ], - "signature": "let null: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The undefined value of type `Js.null_undefined<'a>`." - ], - "signature": "let undefined: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\n\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped, mapped to\na `'b` using the given function `a' => 'b`, then wrapped back up and returned\nas `Js.null_undefined<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.null_undefined) =>\n Js.Null_undefined.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Nullable.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function.\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped and applied to the given function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.null_undefined) =>\n Js.Null_undefined.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Nullable.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.null_undefined<'a>`.\n`Some(a)` => `a`\n`None` => `undefined`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.null_undefined<'a>` to `option<'a>`.\n`a` => `Some(a)`\n`undefined` => `None`\n`null` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - }, - "js/undefined": { - "id": "Js.Undefined", - "name": "Undefined", - "docstrings": [ - "Provide utilities for `Js.undefined<'a>`", - "Provides functionality for dealing with the `Js.undefined<'a>` type" - ], - "items": [ - { - "id": "Js.Undefined.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Local alias for `Js.undefined<'a>`" - ], - "signature": "type t<'a> = undefined<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.undefined<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.test", - "kind": "value", - "name": "test", - "docstrings": [ - "Returns `true` if the given value is empty (undefined), `false` otherwise." - ], - "signature": "let test: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Undefined.testAny", - "kind": "value", - "name": "testAny", - "docstrings": [ - "Returns `true` if the given value is empty (undefined).\n\n**since 1.6.1**" - ], - "signature": "let testAny: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.Undefined.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "The empty value, `undefined`" - ], - "signature": "let empty: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [], - "signature": "let getUnsafe: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Undefined.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Undefined.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\nIf `Js.undefined<'a>` contains a value, that value is unwrapped, mapped to a\n`'b` using the given function `a' => 'b`, then wrapped back up and returned as\n`Js.undefined<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.undefined) =>\n Js.Undefined.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Undefined.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function. If\n`Js.undefined<'a>` contains a value, that value is unwrapped and applied to the\ngiven function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.undefined) =>\n Js.Undefined.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Undefined.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.undefined<'a>`.\n`Some(a)` => `a`\n`None` => `empty`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.undefined<'a>` to `option<'a>`\n`a` => `Some(a)`\n`empty` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - }, - "js/null": { - "id": "Js.Null", - "name": "Null", - "docstrings": [ - "Provide utilities for `Js.null<'a>`", - "Provides functionality for dealing with the `Js.null<'a>` type" - ], - "items": [ - { - "id": "Js.Null.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "@unboxed\ntype t<'a> = null<'a> =\n | Value('a)\n | @as(null) Null", - "deprecated": "" - }, - { - "id": "Js.Null.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.null<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.test", - "kind": "value", - "name": "test", - "docstrings": [ - "Returns `true` if the given value is empty (`null`), `false` otherwise." - ], - "signature": "let test: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Null.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "The empty value, `null`" - ], - "signature": "let empty: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [], - "signature": "let getUnsafe: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Null.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Null.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\n\nIf `Js.null<'a>` contains a value, that value is unwrapped, mapped to a `'b`\nusing the given function `'a => 'b`, then wrapped back up and returned as\n`Js.null<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.null) =>\n Js.Null.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Null.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function.\nIf `Js.null<'a>` contains a value, that value is unwrapped and applied to the given function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.null) =>\n Js.Null.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Null.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.null<'a>`.\n`Some(a)` => `a`\n`None` => `empty`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.null<'a>` to `option<'a>`.\n`a` => `Some(a)`\n`empty` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v12.1.0/stdlib.json b/apps/docs/data/api/v12.1.0/stdlib.json deleted file mode 100644 index 45b9433a0..000000000 --- a/apps/docs/data/api/v12.1.0/stdlib.json +++ /dev/null @@ -1,12742 +0,0 @@ -{ - "stdlib": { - "id": "Stdlib", - "name": "Stdlib", - "docstrings": [], - "items": [ - { - "id": "Stdlib.timeoutId", - "kind": "type", - "name": "timeoutId", - "docstrings": [ - "An `id` representing a timeout started via `setTimeout`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN." - ], - "signature": "type timeoutId = Global.timeoutId" - }, - { - "id": "Stdlib.setTimeout", - "kind": "value", - "name": "setTimeout", - "docstrings": [ - "`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200)\n```" - ], - "signature": "let setTimeout: (unit => unit, int) => timeoutId" - }, - { - "id": "Stdlib.setTimeoutFloat", - "kind": "value", - "name": "setTimeoutFloat", - "docstrings": [ - "`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200.)\n```" - ], - "signature": "let setTimeoutFloat: (unit => unit, float) => timeoutId" - }, - { - "id": "Stdlib.clearTimeout", - "kind": "value", - "name": "clearTimeout", - "docstrings": [ - "`clearTimeout(timeoutId)` clears a scheduled timeout if it hasn't already executed.\n\nSee [`clearTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout) on MDN.\n\n## Examples\n\n```rescript\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 2 seconds.\")\n}, 2000)\n\n// Clearing the timeout right away, before 2 seconds has passed, means that the above callback logging to the console will never run.\nclearTimeout(timeoutId)\n```" - ], - "signature": "let clearTimeout: timeoutId => unit" - }, - { - "id": "Stdlib.intervalId", - "kind": "type", - "name": "intervalId", - "docstrings": [ - "An `id` representing an interval started via `setInterval`.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN." - ], - "signature": "type intervalId = Global.intervalId" - }, - { - "id": "Stdlib.setInterval", - "kind": "value", - "name": "setInterval", - "docstrings": [ - "`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 200 ms (200 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 200 ms.\")\n}, 200)\n\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```" - ], - "signature": "let setInterval: (unit => unit, int) => intervalId" - }, - { - "id": "Stdlib.setIntervalFloat", - "kind": "value", - "name": "setIntervalFloat", - "docstrings": [ - "`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 2 seconds (200 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 200 ms\")\n}, 200.)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeoutFloat(() => {\n clearInterval(intervalId)\n}, 500.0)\n```" - ], - "signature": "let setIntervalFloat: (unit => unit, float) => intervalId" - }, - { - "id": "Stdlib.clearInterval", - "kind": "value", - "name": "clearInterval", - "docstrings": [ - "`clearInterval(intervalId)` clears a scheduled interval.\n\nSee [`clearInterval`](https://developer.mozilla.org/en-US/docs/Web/API/clearInterval) on MDN.\n\n## Examples\n\n```rescript\nlet intervalId = setInterval(() => {\n Console.log(\"This prints in 100 ms\")\n}, 100)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```" - ], - "signature": "let clearInterval: intervalId => unit" - }, - { - "id": "Stdlib.encodeURI", - "kind": "value", - "name": "encodeURI", - "docstrings": [ - "Encodes a URI by replacing characters in the provided string that aren't valid in a URL.\n\nThis is intended to operate on full URIs, so it encodes fewer characters than what `encodeURIComponent` does.\nIf you're looking to encode just parts of a URI, like a query parameter, prefer `encodeURIComponent`.\n\nSee [`encodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI) on MDN.\n\n## Examples\n```rescript\nConsole.log(encodeURI(\"https://rescript-lang.org?array=[someValue]\"))\n// Logs \"https://rescript-lang.org?array=%5BsomeValue%5D\" to the console.\n```" - ], - "signature": "let encodeURI: string => string" - }, - { - "id": "Stdlib.decodeURI", - "kind": "value", - "name": "decodeURI", - "docstrings": [ - "Decodes a previously encoded URI back to a regular string.\n\nThis is intended to operate on full URIs, so it decodes fewer characters than what `decodeURIComponent` does.\nIf you're looking to decode just parts of a URI, like a query parameter, prefer `decodeURIComponent`.\n\nSee [`decodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI) on MDN.\n\n## Examples\n```rescript\nConsole.log(decodeURI(\"https://rescript-lang.org?array=%5BsomeValue%5D\"))\n// Logs \"https://rescript-lang.org?array=[someValue]\" to the console.\n```" - ], - "signature": "let decodeURI: string => string" - }, - { - "id": "Stdlib.encodeURIComponent", - "kind": "value", - "name": "encodeURIComponent", - "docstrings": [ - "Encodes a string so it can be used as part of a URI.\n\nSee [`encodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) on MDN.\n\n## Examples\n```rescript\nConsole.log(encodeURIComponent(\"array=[someValue]\"))\n// Logs \"array%3D%5BsomeValue%5D\" to the console.\n```" - ], - "signature": "let encodeURIComponent: string => string" - }, - { - "id": "Stdlib.decodeURIComponent", - "kind": "value", - "name": "decodeURIComponent", - "docstrings": [ - "Decodes a previously URI encoded string back to its original form.\n\nSee [`decodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) on MDN.\n\n## Examples\n```rescript\nConsole.log(decodeURIComponent(\"array%3D%5BsomeValue%5D\"))\n// Logs \"array=[someValue]\" to the console.\n```" - ], - "signature": "let decodeURIComponent: string => string" - }, - { - "id": "Stdlib.date", - "kind": "type", - "name": "date", - "docstrings": [], - "signature": "type date = Date.t" - }, - { - "id": "Stdlib.null", - "kind": "type", - "name": "null", - "docstrings": [], - "signature": "type null<'a> = null<'a>" - }, - { - "id": "Stdlib.undefined", - "kind": "type", - "name": "undefined", - "docstrings": [], - "signature": "type undefined<'a> = undefined<'a>" - }, - { - "id": "Stdlib.nullable", - "kind": "type", - "name": "nullable", - "docstrings": [], - "signature": "type nullable<'a> = nullable<'a>" - }, - { - "id": "Stdlib.lazy_t", - "kind": "type", - "name": "lazy_t", - "docstrings": [], - "signature": "type lazy_t<'a> = Lazy.t<'a>", - "deprecated": "Use Lazy.t instead" - }, - { - "id": "Stdlib.window", - "kind": "value", - "name": "window", - "docstrings": [], - "signature": "let window: Dom.window", - "deprecated": "Use rescript-webapi instead" - }, - { - "id": "Stdlib.document", - "kind": "value", - "name": "document", - "docstrings": [], - "signature": "let document: Dom.document", - "deprecated": "Use rescript-webapi instead" - }, - { - "id": "Stdlib.globalThis", - "kind": "value", - "name": "globalThis", - "docstrings": [ - "`globalThis` gives you the host global object (`window` in browsers, `global` in Node, etc.).\nYou can reach shared globals from any runtime without special checks.\n\n## Examples\n\n**Note:** These are demonstrative examples. In real code, prefer writing your own type-safe bindings.\nSee [`Bind to Global JS Values`](https://rescript-lang.org/docs/manual/v12.0.0/bind-to-global-js-values).\n\n\n```rescript\ntypeof(globalThis[\"setTimeout\"]) == #function\n\nglobalThis[\"myAppName\"] = \"SuperApp\";\nglobalThis[\"myAppName\"] == \"SuperApp\"\n```" - ], - "signature": "let globalThis: {..}" - }, - { - "id": "Stdlib.import", - "kind": "value", - "name": "import", - "docstrings": [ - "`import(value)` dynamically import a value or function from a ReScript\nmodule. The import call will return a `promise`, resolving to the dynamically loaded\nvalue.\n\n## Examples\n\n`Array.res` file:\n\n```rescript\n@send external indexOf: (array<'a>, 'a) => int = \"indexOf\"\n\nlet indexOfOpt = (arr, item) =>\n switch arr->indexOf(item) {\n | -1 => None\n | index => Some(index)\n }\n```\nIn other file you can import the `indexOfOpt` value defined in `Array.res`\n\n```rescript\nlet main = async () => {\n let indexOfOpt = await import(Array.indexOfOpt)\n let index = indexOfOpt([1, 2], 2)\n Console.log(index)\n}\n```\n\nCompiles to:\n\n```javascript\nasync function main() {\n var add = await import(\"./Array.mjs\").then(function(m) {\n return m.indexOfOpt;\n });\n var index = indexOfOpt([1, 2], 2);\n console.log(index);\n}\n```" - ], - "signature": "let import: 'a => promise<'a>" - }, - { - "id": "Stdlib.panic", - "kind": "value", - "name": "panic", - "docstrings": [ - "`panic(message)` throws a JavaScript `Error` prefixed with `Panic!`.\nCall it when something went wrong and the program should stop right away.\n\n## Examples\n\n```rescript\nlet caught = try panic(\"Invariant violated\") catch {\n| JsExn(err) => JsExn.message(err)->Option.getOrThrow\n}\n\ncaught == \"Panic! Invariant violated\"\n```" - ], - "signature": "let panic: string => 'a" - }, - { - "id": "Stdlib.assertEqual", - "kind": "value", - "name": "assertEqual", - "docstrings": [ - "`assertEqual(a, b)` check if `a` is equal `b`. If not throw a panic exception\n\n## Examples\n\n```rescript\nlist{1, 2}->List.tailExn == list{2}\n```" - ], - "signature": "let assertEqual: ('a, 'a) => unit" - }, - { - "id": "Stdlib.null", - "kind": "value", - "name": "null", - "docstrings": [ - "`null` returns the JavaScript `null` value as a `nullable<'a>`.\nUse the `Nullable` helpers to convert it into an `option` or to read the value.\n\n## Examples\n\n```rescript\nnull->Nullable.toOption == None\n```" - ], - "signature": "let null: nullable<'a>" - }, - { - "id": "Stdlib.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "`undefined` returns the JavaScript `undefined` value as a `nullable<'a>`.\nUse the `Nullable` helpers to convert it into an `option` or to read the value.\n\n## Examples\n\n```rescript\nundefined->Nullable.toOption == None\n```" - ], - "signature": "let undefined: nullable<'a>" - }, - { - "id": "Stdlib.typeof", - "kind": "value", - "name": "typeof", - "docstrings": [ - "`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```" - ], - "signature": "let typeof: 'a => Type.t" - } - ] - }, - "stdlib/intl/numberformat/grouping": { - "id": "Stdlib.Intl.NumberFormat.Grouping", - "name": "Grouping", - "docstrings": [ - "Represents the `useGrouping` option accepted by `Intl.NumberFormat`.\n\nSee [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) on MDN for full option details." - ], - "items": [ - { - "id": "Stdlib.Intl.NumberFormat.Grouping.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.parsed", - "kind": "type", - "name": "parsed", - "docstrings": [], - "signature": "type parsed = [#always | #auto | #bool(bool) | #min2]" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.fromBool", - "kind": "value", - "name": "fromBool", - "docstrings": [ - "Constructs a grouping setting from a boolean.\n\n## Examples\n\n```rescript\nlet formatter =\n Intl.NumberFormat.make(\n ~locales=[\"en-US\"],\n ~options={useGrouping: Intl.NumberFormat.Grouping.fromBool(false)},\n )\nformatter->Intl.NumberFormat.format(1234.) == \"1234\"\n```" - ], - "signature": "let fromBool: bool => t" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Constructs a grouping setting from a string literal.\n\n## Examples\n\n```rescript\nlet formatter =\n Intl.NumberFormat.make(\n ~locales=[\"en-US\"],\n ~options={useGrouping: Intl.NumberFormat.Grouping.fromString(#always)},\n )\nformatter->Intl.NumberFormat.format(1234.) == \"1,234\"\n```" - ], - "signature": "let fromString: [#always | #auto | #min2] => t" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.parseJsValue", - "kind": "value", - "name": "parseJsValue", - "docstrings": [ - "`parseJsValue(value)` attempts to interpret a JavaScript `value` as a grouping setting.\n\n## Examples\n\n```rescript\nIntl.NumberFormat.Grouping.parseJsValue(Js.Json.string(\"auto\")) == Some(#auto)\n```" - ], - "signature": "let parseJsValue: 'a => option<[> #always | #auto | #bool(bool) | #min2]>" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(grouping)` ignores the provided grouping and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/biguint64array/constants": { - "id": "Stdlib.BigUint64Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigUint64Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/bigint64array/constants": { - "id": "Stdlib.BigInt64Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigInt64Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint8clampedarray/constants": { - "id": "Stdlib.Uint8ClampedArray.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8ClampedArray.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint32array/constants": { - "id": "Stdlib.Uint32Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint32Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint16array/constants": { - "id": "Stdlib.Uint16Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint16Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint8array/constants": { - "id": "Stdlib.Uint8Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/int32array/constants": { - "id": "Stdlib.Int32Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int32Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/int16array/constants": { - "id": "Stdlib.Int16Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int16Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/int8array/constants": { - "id": "Stdlib.Int8Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int8Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/float64array/constants": { - "id": "Stdlib.Float64Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float64Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/float32array/constants": { - "id": "Stdlib.Float32Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float32Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/type/classify": { - "id": "Stdlib.Type.Classify", - "name": "Classify", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Type.Classify.function", - "kind": "type", - "name": "function", - "docstrings": [ - "An abstract type representing a JavaScript function.\n\n See [`function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) on MDN." - ], - "signature": "type function" - }, - { - "id": "Stdlib.Type.Classify.object", - "kind": "type", - "name": "object", - "docstrings": [ - "An abstract type representing a JavaScript object.\n\n See [`object`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) on MDN." - ], - "signature": "type object" - }, - { - "id": "Stdlib.Type.Classify.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type representing a classified JavaScript value." - ], - "signature": "type t =\n | Bool(bool)\n | Null\n | Undefined\n | String(string)\n | Number(float)\n | Object(object)\n | Function(function)\n | Symbol(Symbol.t)\n | BigInt(bigint)" - }, - { - "id": "Stdlib.Type.Classify.classify", - "kind": "value", - "name": "classify", - "docstrings": [ - "`classify(anyValue)`\nClassifies a JavaScript value.\n\n## Examples\n```rescript\nswitch %raw(`null`)->Type.Classify.classify {\n| Null => Console.log(\"Yup, that's null.\")\n| _ => Console.log(\"This doesn't actually appear to be null...\")\n}\n```" - ], - "signature": "let classify: 'a => t" - } - ] - }, - "stdlib/regexp/result": { - "id": "Stdlib.RegExp.Result", - "name": "Result", - "docstrings": [], - "items": [ - { - "id": "Stdlib.RegExp.Result.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing the result of a `RegExp` execution." - ], - "signature": "type t = array>" - }, - { - "id": "Stdlib.RegExp.Result.fullMatch", - "kind": "value", - "name": "fullMatch", - "docstrings": [ - "`fullMatch(regExpResult)` returns the full string that matched in this result.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n \n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints the full string that matched, \"ReScript is\"\n }\n ```" - ], - "signature": "let fullMatch: t => string" - }, - { - "id": "Stdlib.RegExp.Result.matches", - "kind": "value", - "name": "matches", - "docstrings": [ - "`matches(regExpResult)` returns all matches for `regExpResult`.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n \n // This below will log \"ReScript\" and \"is\" to the console.\n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) =>\n switch result->RegExp.Result.matches->Array.keepSome {\n | [firstWord, secondWord] => Console.log2(firstWord, secondWord)\n | _ => Console.log(\"Didn't find exactly two words...\")\n }\n }\n ```" - ], - "signature": "let matches: t => array>" - }, - { - "id": "Stdlib.RegExp.Result.index", - "kind": "value", - "name": "index", - "docstrings": [], - "signature": "let index: t => int" - }, - { - "id": "Stdlib.RegExp.Result.input", - "kind": "value", - "name": "input", - "docstrings": [ - "`input(regExpResult)` returns the full input string that was passed to what produced the `RegExp.Result.t`.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n \n // This below will log the full input string \"ReScript is pretty cool, right?\" to the console.\n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) => Console.log(result->RegExp.Result.input)\n }\n ```" - ], - "signature": "let input: t => string" - } - ] - }, - "stdlib/math/int": { - "id": "Stdlib.Math.Int", - "name": "Int", - "docstrings": [ - "Provide Math utilities for `int`" - ], - "items": [ - { - "id": "Stdlib.Math.Int.abs", - "kind": "value", - "name": "abs", - "docstrings": [ - "`abs(v)` returns absolute value of `v`.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.abs(-2) == 2\n Math.Int.abs(3) == 3\n ```" - ], - "signature": "let abs: int => int" - }, - { - "id": "Stdlib.Math.Int.clz32", - "kind": "value", - "name": "clz32", - "docstrings": [ - "`clz32(v)` returns the number of leading zero bits of the argument's 32 bit\nint representation.\nSee [`Math.clz32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32) on MDN.\n\n ## Examples\n\n ```rescript\n // 00000000000000000000000000000001\n Math.Int.clz32(1) == 31\n // 00000000000000000000000000000100\n Math.Int.clz32(4) == 29\n ```" - ], - "signature": "let clz32: int => int" - }, - { - "id": "Stdlib.Math.Int.imul", - "kind": "value", - "name": "imul", - "docstrings": [ - "`imul(a, b)` returns 32-bit integer multiplication. Use this only when you\nneed to optimize performance of multiplication of numbers stored as 32-bit\nintegers.\nSee [`Math.imul`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.imul(3, 4) == 12\n Math.Int.imul(-5, 12) == -60\n ```" - ], - "signature": "let imul: (int, int) => int" - }, - { - "id": "Stdlib.Math.Int.min", - "kind": "value", - "name": "min", - "docstrings": [ - "`min(a, b)` returns the minimum of its two integer arguments.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.min(1, 2) == 1\n Math.Int.min(-1, -2) == -2\n ```" - ], - "signature": "let min: (int, int) => int" - }, - { - "id": "Stdlib.Math.Int.minMany", - "kind": "value", - "name": "minMany", - "docstrings": [ - "`minMany(arr)` returns the minimum of the integers in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.minMany([1, 2]) == 1\n Math.Int.minMany([-1, -2]) == -2\n Math.Int.minMany([])->Int.toFloat->Float.isFinite == false\n ```" - ], - "signature": "let minMany: array => int" - }, - { - "id": "Stdlib.Math.Int.max", - "kind": "value", - "name": "max", - "docstrings": [ - "`max(a, b)` returns the maximum of its two integer arguments.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.max(1, 2) == 2\n Math.Int.max(-1, -2) == -1\n ```" - ], - "signature": "let max: (int, int) => int" - }, - { - "id": "Stdlib.Math.Int.maxMany", - "kind": "value", - "name": "maxMany", - "docstrings": [ - "`maxMany(arr)` returns the maximum of the integers in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.maxMany([1, 2]) == 2\n Math.Int.maxMany([-1, -2]) == -1\n Math.Int.maxMany([])->Int.toFloat->Float.isFinite == false\n ```" - ], - "signature": "let maxMany: array => int" - }, - { - "id": "Stdlib.Math.Int.pow", - "kind": "value", - "name": "pow", - "docstrings": [ - "`pow(a, ~exp)` throws the given base `a` to the given exponent `exp`.\nSee [`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.pow(2, ~exp=4) == 16\n Math.Int.pow(3, ~exp=4) == 81\n ```" - ], - "signature": "let pow: (int, ~exp: int) => int" - }, - { - "id": "Stdlib.Math.Int.sign", - "kind": "value", - "name": "sign", - "docstrings": [ - "`sign(v)` returns the sign of its integer argument: `-1` if negative, `0` if\nzero, `1` if positive.\nSee [`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.sign(3) == 1\n Math.Int.sign(-3) == -1\n Math.Int.sign(0) == 0\n ```" - ], - "signature": "let sign: int => int" - }, - { - "id": "Stdlib.Math.Int.floor", - "kind": "value", - "name": "floor", - "docstrings": [ - "floor(v) returns the largest `int` less than or equal to the argument;\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.floor(3.7) == 3\n Math.Int.floor(3.0) == 3\n Math.Int.floor(-3.1) == -4\n ```" - ], - "signature": "let floor: float => int" - }, - { - "id": "Stdlib.Math.Int.ceil", - "kind": "value", - "name": "ceil", - "docstrings": [ - "ceil(v) returns the smallest `int` greater than or equal to the argument;\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.ceil(3.7) == 4\n Math.Int.ceil(3.0) == 3\n Math.Int.ceil(-3.1) == -3\n ```" - ], - "signature": "let ceil: float => int" - }, - { - "id": "Stdlib.Math.Int.random", - "kind": "value", - "name": "random", - "docstrings": [ - "`random(minVal, maxVal)` returns a random integer number in the half-closed interval \\[minVal, maxVal).\nSee [`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\non MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.random(2, 5)\n Math.Int.random(505, 2000)\n Math.Int.random(-7, -2)\n ```" - ], - "signature": "let random: (int, int) => int" - } - ] - }, - "stdlib/math/constants": { - "id": "Stdlib.Math.Constants", - "name": "Constants", - "docstrings": [ - "Mathematical Constants" - ], - "items": [ - { - "id": "Stdlib.Math.Constants.e", - "kind": "value", - "name": "e", - "docstrings": [ - "`Math.Constants.e` returns Euler's number, ≈ 2.718281828459045.\nSee [`Math.E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.e\n ```" - ], - "signature": "let e: float" - }, - { - "id": "Stdlib.Math.Constants.ln2", - "kind": "value", - "name": "ln2", - "docstrings": [ - "`Math.Constants.ln2` returns Natural logarithm of 2, ≈ 0.6931471805599453.\nSee [`Math.LN2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN2) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.ln2\n ```" - ], - "signature": "let ln2: float" - }, - { - "id": "Stdlib.Math.Constants.ln10", - "kind": "value", - "name": "ln10", - "docstrings": [ - "`Math.Constants.ln10` returns Natural logarithm of 10, ≈ 2.302585092994046.\nSee [`Math.LN10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN10) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.ln10\n ```" - ], - "signature": "let ln10: float" - }, - { - "id": "Stdlib.Math.Constants.log2e", - "kind": "value", - "name": "log2e", - "docstrings": [ - "`Math.Constants.log2e` returns Base 2 logarithm of E, ≈ 1.4426950408889634.\nSee [`Math.LOG2E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG2E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.log2e\n ```" - ], - "signature": "let log2e: float" - }, - { - "id": "Stdlib.Math.Constants.log10e", - "kind": "value", - "name": "log10e", - "docstrings": [ - "`Math.Constants.log10e` returns Base 10 logarithm of E, ≈ 0.4342944819032518.\nSee [`Math.LOG10E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG10E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.log10e\n ```" - ], - "signature": "let log10e: float" - }, - { - "id": "Stdlib.Math.Constants.pi", - "kind": "value", - "name": "pi", - "docstrings": [ - "`Math.Constants.pi` returns Pi - ratio of the circumference to the diameter\nof a circle, ≈ 3.141592653589793.\nSee [`Math.PI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/PI) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.pi\n ```" - ], - "signature": "let pi: float" - }, - { - "id": "Stdlib.Math.Constants.sqrt1_2", - "kind": "value", - "name": "sqrt1_2", - "docstrings": [ - "`Math.Constants.sqrt1_2` returns Square root of 1/2, ≈ 0.7071067811865476.\nSee [`Math.SQRT1_2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.sqrt1_2\n ```" - ], - "signature": "let sqrt1_2: float" - }, - { - "id": "Stdlib.Math.Constants.sqrt2", - "kind": "value", - "name": "sqrt2", - "docstrings": [ - "`Math.Constants.e` returns Absolute value for integer argument.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.sqrt2\n ```" - ], - "signature": "let sqrt2: float" - } - ] - }, - "stdlib/json/decode": { - "id": "Stdlib.JSON.Decode", - "name": "Decode", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JSON.Decode.bool", - "kind": "value", - "name": "bool", - "docstrings": [ - "Decodes a single JSON value. If the value is a bool, it will return `Some(bool)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`true`)->JSON.Decode.bool\n // Some(true)\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.bool\n // None\n ```" - ], - "signature": "let bool: t => option" - }, - { - "id": "Stdlib.JSON.Decode.null", - "kind": "value", - "name": "null", - "docstrings": [ - "Decodes a single JSON value. If the value is null, it will return `Some(Null.t)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`null`)->JSON.Decode.null\n // Some(null)\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.null\n // None\n ```" - ], - "signature": "let null: t => option>" - }, - { - "id": "Stdlib.JSON.Decode.string", - "kind": "value", - "name": "string", - "docstrings": [ - "Decodes a single JSON value. If the value is a string, it will return `Some(string)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.string\n // Some(\"hello world\")\n \n JSON.parseOrThrow(`42`)->JSON.Decode.string\n // None\n ```" - ], - "signature": "let string: t => option" - }, - { - "id": "Stdlib.JSON.Decode.float", - "kind": "value", - "name": "float", - "docstrings": [ - "Decodes a single JSON value. If the value is a float, it will return `Some(float)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`42.0`)->JSON.Decode.float\n // Some(42.0)\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.float\n // None\n ```" - ], - "signature": "let float: t => option" - }, - { - "id": "Stdlib.JSON.Decode.object", - "kind": "value", - "name": "object", - "docstrings": [ - "Decodes a single JSON value. If the value is an object, it will return `Some(dict)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`{\"foo\":\"bar\"}`)->JSON.Decode.object\n // Some({ foo: 'bar' })\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.object\n // None\n ```" - ], - "signature": "let object: t => option>" - }, - { - "id": "Stdlib.JSON.Decode.array", - "kind": "value", - "name": "array", - "docstrings": [ - "Decodes a single JSON value. If the value is an array, it will return `Some(array)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`[\"foo\", \"bar\"]`)->JSON.Decode.array\n // Some([ 'foo', 'bar' ])\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.array\n // None\n ```" - ], - "signature": "let array: t => option>" - } - ] - }, - "stdlib/json/encode": { - "id": "Stdlib.JSON.Encode", - "name": "Encode", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JSON.Encode.bool", - "kind": "value", - "name": "bool", - "docstrings": [ - "Returns a boolean as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.bool(true)\n ```" - ], - "signature": "let bool: bool => t" - }, - { - "id": "Stdlib.JSON.Encode.null", - "kind": "value", - "name": "null", - "docstrings": [ - "Returns null as a JSON value.\n\n ## Examples\n ```rescript\n JSON.Encode.null\n ```" - ], - "signature": "let null: t" - }, - { - "id": "Stdlib.JSON.Encode.string", - "kind": "value", - "name": "string", - "docstrings": [ - "Returns a string as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.string(\"hello world\")\n ```" - ], - "signature": "let string: string => t" - }, - { - "id": "Stdlib.JSON.Encode.int", - "kind": "value", - "name": "int", - "docstrings": [ - "Returns an int as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.int(42)\n ```" - ], - "signature": "let int: int => t" - }, - { - "id": "Stdlib.JSON.Encode.float", - "kind": "value", - "name": "float", - "docstrings": [ - "Returns a float as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.float(42.0)\n ```" - ], - "signature": "let float: float => t" - }, - { - "id": "Stdlib.JSON.Encode.object", - "kind": "value", - "name": "object", - "docstrings": [ - "Returns a dict as a JSON object.\n\n ## Examples\n ```rescript\n let dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n ])\n \n JSON.Encode.object(dict)\n ```" - ], - "signature": "let object: dict => t" - }, - { - "id": "Stdlib.JSON.Encode.array", - "kind": "value", - "name": "array", - "docstrings": [ - "Returns an array as JSON.\n\n ## Examples\n ```rescript\n let array = [JSON.Encode.string(\"hello world\"), JSON.Encode.int(42)]\n \n JSON.Encode.array(array)\n ```" - ], - "signature": "let array: array => t" - }, - { - "id": "Stdlib.JSON.Encode.stringArray", - "kind": "value", - "name": "stringArray", - "docstrings": [ - "Returns an array of strings as a JSON object." - ], - "signature": "let stringArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.floatArray", - "kind": "value", - "name": "floatArray", - "docstrings": [ - "Returns an array of floats as a JSON object." - ], - "signature": "let floatArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.intArray", - "kind": "value", - "name": "intArray", - "docstrings": [ - "Returns an array of integers as a JSON object." - ], - "signature": "let intArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.boolArray", - "kind": "value", - "name": "boolArray", - "docstrings": [ - "Returns an array of booleans as a JSON object." - ], - "signature": "let boolArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.objectArray", - "kind": "value", - "name": "objectArray", - "docstrings": [ - "Returns an array of objects as a JSON object." - ], - "signature": "let objectArray: array> => t" - } - ] - }, - "stdlib/json/classify": { - "id": "Stdlib.JSON.Classify", - "name": "Classify", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JSON.Classify.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a JavaScript type." - ], - "signature": "type t =\n | Bool(bool)\n | Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)" - }, - { - "id": "Stdlib.JSON.Classify.classify", - "kind": "value", - "name": "classify", - "docstrings": [ - "Returns the JSON type of any value.\n\n ## Examples\n ```rescript\n JSON.Classify.classify(\"hello world\")\n // String(\"hello world\")\n \n JSON.Classify.classify(42)\n // Number(42)\n ```" - ], - "signature": "let classify: 'a => t", - "deprecated": "Directly switch on the JSON object instead" - } - ] - }, - "stdlib/jserror/urierror": { - "id": "Stdlib.JsError.URIError", - "name": "URIError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.URIError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `URIError` with the provided `message`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.URIError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `URIError` with the provided `message` and throws it.\n\n `JsError.URIError.throwWithMessage(\"message\")` is equivalent to `JsError.URIError.make(\"message\")->JsError.throw`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/typeerror": { - "id": "Stdlib.JsError.TypeError", - "name": "TypeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.TypeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `TypeError` with the provided `message`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.TypeError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `TypeError` with the provided `message` and throws it.\n\n `JsError.TypeError.throwWithMessage(\"message\")` is equivalent to `JsError.TypeError.make(\"message\")->JsError.throw`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/syntaxerror": { - "id": "Stdlib.JsError.SyntaxError", - "name": "SyntaxError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.SyntaxError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `SyntaxError` with the provided `message`.\n\n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.SyntaxError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `SyntaxError` with the provided `message` and throws it.\n \n `JsError.SyntaxError.throwWithMessage(\"message\")` is equivalent to `JsError.SyntaxError.make(\"message\")->JsError.throw`.\n \n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/referenceerror": { - "id": "Stdlib.JsError.ReferenceError", - "name": "ReferenceError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.ReferenceError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `ReferenceError` with the provided `message`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.ReferenceError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `ReferenceError` with the provided `message` and throws it.\n\n `JsError.ReferenceError.throwWithMessage(\"message\")` is equivalent to `JsError.ReferenceError.make(\"message\")->JsError.throw`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/rangeerror": { - "id": "Stdlib.JsError.RangeError", - "name": "RangeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.RangeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `RangeError` with the provided `message`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.RangeError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `RangeError` with the provided `message` and throws it.\n \n `JsError.RangeError.throwWithMessage(\"message\")` is equivalent to `JsError.RangeError.make(\"message\")->JsError.throw`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/evalerror": { - "id": "Stdlib.JsError.EvalError", - "name": "EvalError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.EvalError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `EvalError` with the provided `message`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.EvalError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `EvalError` with the provided `message` and throws it.\n\n `JsError.EvalError.throwWithMessage(\"message\")` is equivalent to `JsError.EvalError.make(\"message\")->JsError.throw`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/intl/segments": { - "id": "Stdlib.Intl.Segments", - "name": "Segments", - "docstrings": [ - "Bindings to `Segments` objects produced by `Intl.Segmenter.segment`.\n A Segments instance is an object that represents the segments of a specific string, subject to the locale and options of its constructing Intl.Segmenter instance.\nhttps://tc39.es/ecma402/#sec-segments-objects.\n\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment) for API details and the [ECMA-402 specification](https://tc39.es/ecma402/#sec-segments-objects) for the object shape." - ], - "items": [ - { - "id": "Stdlib.Intl.Segments.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Segments.segmentData", - "kind": "type", - "name": "segmentData", - "docstrings": [], - "signature": "type segmentData = {\n segment: string,\n index: int,\n isWordLike: option,\n input: string,\n}" - }, - { - "id": "Stdlib.Intl.Segments.containing", - "kind": "value", - "name": "containing", - "docstrings": [ - "`containing(segments)` returns the segment data for the index supplied when iterating.\n\nUse this when consuming `Segments` via iteration helpers where the index is already implied." - ], - "signature": "let containing: t => segmentData" - }, - { - "id": "Stdlib.Intl.Segments.containingWithIndex", - "kind": "value", - "name": "containingWithIndex", - "docstrings": [ - "`containingWithIndex(segments, index)` returns the segment that contains `index` within the original string.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #word})\nlet segments = segmenter->Intl.Segmenter.segment(\"Hello world\")\nIntl.Segments.containingWithIndex(segments, 0).segment == \"Hello\"\n```" - ], - "signature": "let containingWithIndex: (t, int) => segmentData" - }, - { - "id": "Stdlib.Intl.Segments.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(segments)` ignores the provided segments and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/segmenter": { - "id": "Stdlib.Intl.Segmenter", - "name": "Segmenter", - "docstrings": [ - "Bindings to JavaScript's `Intl.Segmenter`.\n\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter) for API details." - ], - "items": [ - { - "id": "Stdlib.Intl.Segmenter.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Segmenter.granularity", - "kind": "type", - "name": "granularity", - "docstrings": [], - "signature": "type granularity = [#grapheme | #sentence | #word]" - }, - { - "id": "Stdlib.Intl.Segmenter.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n granularity?: granularity,\n}" - }, - { - "id": "Stdlib.Intl.Segmenter.pluralCategories", - "kind": "type", - "name": "pluralCategories", - "docstrings": [], - "signature": "type pluralCategories = [\n | #few\n | #many\n | #one\n | #other\n | #two\n | #zero\n]" - }, - { - "id": "Stdlib.Intl.Segmenter.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n granularity: granularity,\n}" - }, - { - "id": "Stdlib.Intl.Segmenter.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.Segmenter.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.Segmenter` instance for segmenting strings.\n\nSee [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter) on MDN.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #word})\nIntl.Segmenter.resolvedOptions(segmenter).granularity == #word\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.Segmenter.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for segmentation.\n\nSee [`Intl.Segmenter.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.Segmenter.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.Segmenter.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(segmenter)` returns the locale and granularity currently in use.\n\nSee [`Intl.Segmenter.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #sentence})\nIntl.Segmenter.resolvedOptions(segmenter).granularity == #sentence\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.Segmenter.segment", - "kind": "value", - "name": "segment", - "docstrings": [ - "`segment(segmenter, input)` returns a `Segments` object describing `input`.\n\nSee [`Intl.Segmenter.prototype.segment`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment) on MDN.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #word})\nlet segments = segmenter->Intl.Segmenter.segment(\"Hello world\")\nIntl.Segments.containingWithIndex(segments, 0).segment == \"Hello\"\n```" - ], - "signature": "let segment: (t, string) => Intl_Segments.t" - }, - { - "id": "Stdlib.Intl.Segmenter.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(segmenter)` ignores the provided segmenter and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/relativetimeformat": { - "id": "Stdlib.Intl.RelativeTimeFormat", - "name": "RelativeTimeFormat", - "docstrings": [ - "Bindings to JavaScript's `Intl.RelativeTimeFormat`.\n\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) for API details." - ], - "items": [ - { - "id": "Stdlib.Intl.RelativeTimeFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.numeric", - "kind": "type", - "name": "numeric", - "docstrings": [], - "signature": "type numeric = [#always | #auto]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.style", - "kind": "type", - "name": "style", - "docstrings": [], - "signature": "type style = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.timeUnit", - "kind": "type", - "name": "timeUnit", - "docstrings": [], - "signature": "type timeUnit = [\n | #day\n | #hour\n | #minute\n | #month\n | #quarter\n | #second\n | #week\n | #year\n]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n numeric?: numeric,\n style?: style,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n numeric: numeric,\n style: style,\n numberingSystem: string,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.relativeTimePartComponent", - "kind": "type", - "name": "relativeTimePartComponent", - "docstrings": [], - "signature": "type relativeTimePartComponent = [#integer | #literal]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.relativeTimePart", - "kind": "type", - "name": "relativeTimePart", - "docstrings": [], - "signature": "type relativeTimePart = {\n \\\"type\": relativeTimePartComponent,\n value: string,\n unit?: timeUnit,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.RelativeTimeFormat` instance for formatting relative time strings.\n\nSee [`Intl.RelativeTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en-US\"])\nformatter->Intl.RelativeTimeFormat.format(1, #day)->String.length > 0\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for relative time formatting.\n\nSee [`Intl.RelativeTimeFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.RelativeTimeFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the locale and options currently in use.\n\nSee [`Intl.RelativeTimeFormat.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en-US\"])\nIntl.RelativeTimeFormat.resolvedOptions(formatter).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, value, unit)` returns the formatted string for `value` expressed in `unit`.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en\"])\nformatter->Intl.RelativeTimeFormat.format(-1, #day)->String.length > 0\n```" - ], - "signature": "let format: (t, int, timeUnit) => string" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, value, unit)` returns an array describing how the output string is assembled.\n\nSee [`Intl.RelativeTimeFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en\"])\nformatter->Intl.RelativeTimeFormat.formatToParts(-1, #day)->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, int, timeUnit) => array" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(relativeTimeFormat)` ignores the provided relativeTimeFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/pluralrules": { - "id": "Stdlib.Intl.PluralRules", - "name": "PluralRules", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.PluralRules.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.PluralRules.localeType", - "kind": "type", - "name": "localeType", - "docstrings": [], - "signature": "type localeType = [#cardinal | #ordinal]" - }, - { - "id": "Stdlib.Intl.PluralRules.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n \\\"type\"?: localeType,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" - }, - { - "id": "Stdlib.Intl.PluralRules.pluralCategories", - "kind": "type", - "name": "pluralCategories", - "docstrings": [], - "signature": "type pluralCategories = [\n | #few\n | #many\n | #one\n | #other\n | #two\n | #zero\n]" - }, - { - "id": "Stdlib.Intl.PluralRules.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n pluralCategories: array,\n \\\"type\": localeType,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" - }, - { - "id": "Stdlib.Intl.PluralRules.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.PluralRules.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.PluralRules` instance to determine plural categories.\n\nSee [`Intl.PluralRules`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules) on MDN.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nlet category = rules->Intl.PluralRules.select(1.0)\ncategory == #one\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.PluralRules.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for plural rules.\n\nSee [`Intl.PluralRules.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.PluralRules.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.PluralRules.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(rules)` returns the plural rule configuration in use.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nIntl.PluralRules.resolvedOptions(rules).locale == \"en\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.PluralRules.rule", - "kind": "type", - "name": "rule", - "docstrings": [], - "signature": "type rule = [#few | #many | #one | #other | #two | #zero]" - }, - { - "id": "Stdlib.Intl.PluralRules.select", - "kind": "value", - "name": "select", - "docstrings": [ - "`select(rules, value)` returns the plural category for the given number.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.select(1.) == #one\n```" - ], - "signature": "let select: (t, float) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.selectInt", - "kind": "value", - "name": "selectInt", - "docstrings": [ - "`selectInt(rules, value)` is like `select` but accepts an integer.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.selectInt(2) == #other\n```" - ], - "signature": "let selectInt: (t, int) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.selectRange", - "kind": "value", - "name": "selectRange", - "docstrings": [ - "`selectRange(rules, ~start, ~end)` returns the category for numbers in the range.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.selectRange(~start=1., ~end=2.) == #other\n```" - ], - "signature": "let selectRange: (t, ~start: float, ~end: float) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.selectRangeInt", - "kind": "value", - "name": "selectRangeInt", - "docstrings": [ - "`selectRangeInt(rules, ~start, ~end)` is the integer version of `selectRange`.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.selectRangeInt(~start=1, ~end=1) == #other\n```" - ], - "signature": "let selectRangeInt: (t, ~start: int, ~end: int) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(pluralRules)` ignores the provided pluralRules and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/numberformat": { - "id": "Stdlib.Intl.NumberFormat", - "name": "NumberFormat", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.NumberFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.NumberFormat.currency", - "kind": "type", - "name": "currency", - "docstrings": [ - "An ISO 4217 currency code. e.g. USD, EUR, CNY" - ], - "signature": "type currency = string" - }, - { - "id": "Stdlib.Intl.NumberFormat.currencyDisplay", - "kind": "type", - "name": "currencyDisplay", - "docstrings": [], - "signature": "type currencyDisplay = [\n | #code\n | #name\n | #narrowSymbol\n | #symbol\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.currencySign", - "kind": "type", - "name": "currencySign", - "docstrings": [], - "signature": "type currencySign = [#accounting | #standard]" - }, - { - "id": "Stdlib.Intl.NumberFormat.notation", - "kind": "type", - "name": "notation", - "docstrings": [], - "signature": "type notation = [\n | #compact\n | #engineering\n | #scientific\n | #standard\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.compactDisplay", - "kind": "type", - "name": "compactDisplay", - "docstrings": [ - "Used only when notation is #compact" - ], - "signature": "type compactDisplay = [#long | #short]" - }, - { - "id": "Stdlib.Intl.NumberFormat.signDisplay", - "kind": "type", - "name": "signDisplay", - "docstrings": [], - "signature": "type signDisplay = [\n | #always\n | #auto\n | #exceptZero\n | #negative\n | #never\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.style", - "kind": "type", - "name": "style", - "docstrings": [], - "signature": "type style = [#currency | #decimal | #percent | #unit]" - }, - { - "id": "Stdlib.Intl.NumberFormat.unitSystem", - "kind": "type", - "name": "unitSystem", - "docstrings": [ - "Defined in https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier\nOnly used when style is #unit" - ], - "signature": "type unitSystem = string" - }, - { - "id": "Stdlib.Intl.NumberFormat.unitDisplay", - "kind": "type", - "name": "unitDisplay", - "docstrings": [ - "Only used when style is #unit" - ], - "signature": "type unitDisplay = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.NumberFormat.rounding", - "kind": "type", - "name": "rounding", - "docstrings": [], - "signature": "type rounding = [\n | #ceil\n | #expand\n | #floor\n | #halfCeil\n | #halfEven\n | #halfExpand\n | #halfFloor\n | #halfTrunc\n | #trunc\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.roundingPriority", - "kind": "type", - "name": "roundingPriority", - "docstrings": [], - "signature": "type roundingPriority = [\n | #auto\n | #lessPrecision\n | #morePrecision\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.roundingIncrement", - "kind": "type", - "name": "roundingIncrement", - "docstrings": [], - "signature": "type roundingIncrement = [\n | #1\n | #10\n | #100\n | #1000\n | #2\n | #20\n | #200\n | #2000\n | #25\n | #250\n | #2500\n | #5\n | #50\n | #500\n | #5000\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.trailingZeroDisplay", - "kind": "type", - "name": "trailingZeroDisplay", - "docstrings": [], - "signature": "type trailingZeroDisplay = [\n | #auto\n | #lessPrecision\n | #stripIfInteger\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n compactDisplay?: compactDisplay,\n numberingSystem?: Intl_Common.numberingSystem,\n currency?: currency,\n currencyDisplay?: currencyDisplay,\n currencySign?: currencySign,\n localeMatcher?: Intl_Common.localeMatcher,\n notation?: notation,\n signDisplay?: signDisplay,\n style?: style,\n unit?: unitSystem,\n unitDisplay?: unitDisplay,\n useGrouping?: Grouping.t,\n roundingMode?: rounding,\n roundingPriority?: roundingPriority,\n roundingIncrement?: roundingIncrement,\n trailingZeroDisplay?: trailingZeroDisplay,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n currency?: currency,\n currencyDisplay?: currencyDisplay,\n currencySign?: currencySign,\n compactDisplay?: compactDisplay,\n unit: unitSystem,\n unitDisplay: unitDisplay,\n roundingMode?: rounding,\n roundingPriority?: roundingPriority,\n roundingIncrement?: roundingIncrement,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n locale: string,\n notation: notation,\n numberingSystem: Intl_Common.numberingSystem,\n signDisplay: signDisplay,\n style: style,\n useGrouping: Grouping.t,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.numberFormatPartType", - "kind": "type", - "name": "numberFormatPartType", - "docstrings": [], - "signature": "type numberFormatPartType = [\n | #compact\n | #currency\n | #decimal\n | #exponentInteger\n | #exponentMinusSign\n | #exponentSeparator\n | #fraction\n | #group\n | #infinity\n | #integer\n | #literal\n | #minusSign\n | #nan\n | #percentSign\n | #plusSign\n | #unit\n | #unknown\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.numberFormatPart", - "kind": "type", - "name": "numberFormatPart", - "docstrings": [], - "signature": "type numberFormatPart = {\n \\\"type\": numberFormatPartType,\n value: string,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.rangeSource", - "kind": "type", - "name": "rangeSource", - "docstrings": [], - "signature": "type rangeSource = [#endRange | #shared | #startRange]" - }, - { - "id": "Stdlib.Intl.NumberFormat.numberFormatRangePart", - "kind": "type", - "name": "numberFormatRangePart", - "docstrings": [], - "signature": "type numberFormatRangePart = {\n \\\"type\": numberFormatPartType,\n value: string,\n source: rangeSource,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.NumberFormat` instance for locale-aware number formatting.\n\nSee [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"], ~options={style: #currency, currency: \"USD\"})\nformatter->Intl.NumberFormat.format(1234.5) == \"$1,234.50\"\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.NumberFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for number formatting.\n\nSee [`Intl.NumberFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.NumberFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the actual options being used.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nIntl.NumberFormat.resolvedOptions(formatter).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.NumberFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, value)` returns the formatted representation of `value`.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.format(1234.5) == \"1,234.5\"\n```" - ], - "signature": "let format: (t, float) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatRange", - "kind": "value", - "name": "formatRange", - "docstrings": [ - "`formatRange(formatter, ~start, ~end)` formats numbers representing a range.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.formatRange(~start=1., ~end=2.)->String.length > 0\n```" - ], - "signature": "let formatRange: (t, ~start: float, ~end: float) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, value)` breaks the formatted result into parts.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.formatToParts(123)->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, float) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatRangeToParts", - "kind": "value", - "name": "formatRangeToParts", - "docstrings": [ - "`formatRangeToParts(formatter, ~start, ~end)` returns how the range would be rendered.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.formatRangeToParts(~start=1., ~end=2.)->Array.length > 0\n```" - ], - "signature": "let formatRangeToParts: (\n t,\n ~start: float,\n ~end: float,\n) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatInt", - "kind": "value", - "name": "formatInt", - "docstrings": [ - "`formatInt(formatter, value)` formats integer values.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatInt(42) == \"42\"\n```" - ], - "signature": "let formatInt: (t, int) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatIntRange", - "kind": "value", - "name": "formatIntRange", - "docstrings": [ - "`formatIntRange(formatter, ~start, ~end)` formats integer ranges.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatIntRange(~start=1, ~end=3)->String.length > 0\n```" - ], - "signature": "let formatIntRange: (t, ~start: int, ~end: int) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatIntToParts", - "kind": "value", - "name": "formatIntToParts", - "docstrings": [ - "`formatIntToParts(formatter, value)` returns formatting parts for an integer.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatIntToParts(123)->Array.length > 0\n```" - ], - "signature": "let formatIntToParts: (t, int) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatIntRangeToParts", - "kind": "value", - "name": "formatIntRangeToParts", - "docstrings": [ - "`formatIntRangeToParts(formatter, ~start, ~end)` returns how the integer range would be rendered.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatIntRangeToParts(~start=1, ~end=1)->Array.length > 0\n```" - ], - "signature": "let formatIntRangeToParts: (t, ~start: int, ~end: int) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigInt", - "kind": "value", - "name": "formatBigInt", - "docstrings": [ - "`formatBigInt(formatter, value)` formats bigint values." - ], - "signature": "let formatBigInt: (t, bigint) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigIntRange", - "kind": "value", - "name": "formatBigIntRange", - "docstrings": [ - "`formatBigIntRange(formatter, ~start, ~end)` formats a range of bigint values.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatBigIntRange(~start=1n, ~end=2n) == \"1–2\"\n```" - ], - "signature": "let formatBigIntRange: (t, ~start: bigint, ~end: bigint) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigIntToParts", - "kind": "value", - "name": "formatBigIntToParts", - "docstrings": [ - "`formatBigIntToParts(formatter, value)` returns the bigint formatting broken into parts.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatBigIntToParts(5n)->Array.length > 0\n```" - ], - "signature": "let formatBigIntToParts: (t, bigint) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigIntRangeToParts", - "kind": "value", - "name": "formatBigIntRangeToParts", - "docstrings": [ - "`formatBigIntRangeToParts(formatter, ~start, ~end)` describes how the bigint range would be rendered.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatBigIntRangeToParts(~start=3n, ~end=4n)->Array.length > 0\n```" - ], - "signature": "let formatBigIntRangeToParts: (\n t,\n ~start: bigint,\n ~end: bigint,\n) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatString", - "kind": "value", - "name": "formatString", - "docstrings": [ - "`formatString(formatter, value)` interprets `value` as a number string and formats it.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatString(\"1234\") == \"1,234\"\n```" - ], - "signature": "let formatString: (t, string) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatStringToParts", - "kind": "value", - "name": "formatStringToParts", - "docstrings": [ - "`formatStringToParts(formatter, value)` returns formatting parts for a numeric string.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatStringToParts(\"123\")->Array.length > 0\n```" - ], - "signature": "let formatStringToParts: (t, string) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(numberFormat)` ignores the provided numberFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/locale": { - "id": "Stdlib.Intl.Locale", - "name": "Locale", - "docstrings": [ - "Bindings to JavaScript's `Intl.Locale`." - ], - "items": [ - { - "id": "Stdlib.Intl.Locale.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Locale.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n baseName?: string,\n calendar?: Intl_Common.calendar,\n collation?: Intl_Common.collation,\n hourCycle?: [#h11 | #h12 | #h23 | #h24],\n caseFirst?: [#\"false\" | #lower | #upper],\n numberingSystem?: Intl_Common.numberingSystem,\n numeric?: bool,\n language?: string,\n script?: string,\n region?: string,\n}" - }, - { - "id": "Stdlib.Intl.Locale.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.Locale` object from a locale identifier and optional modifiers.\n\nSee [`Intl.Locale`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en-US\")\nlocale->Intl.Locale.language == \"en\"\n```" - ], - "signature": "let make: (string, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.Locale.baseName", - "kind": "value", - "name": "baseName", - "docstrings": [ - "`baseName(locale)` returns the canonical base name (without Unicode extensions).\n\nSee [`Intl.Locale.prototype.baseName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/baseName) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"fr-CA\")\nlocale->Intl.Locale.baseName == \"fr-CA\"\n```" - ], - "signature": "let baseName: t => string" - }, - { - "id": "Stdlib.Intl.Locale.calendar", - "kind": "value", - "name": "calendar", - "docstrings": [ - "`calendar(locale)` returns the specified calendar, if present.\n\nSee [`Intl.Locale.prototype.calendar`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/calendar) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={calendar: #gregory})\nlocale->Intl.Locale.calendar == Some(\"gregory\")\n```" - ], - "signature": "let calendar: t => option" - }, - { - "id": "Stdlib.Intl.Locale.caseFirst", - "kind": "value", - "name": "caseFirst", - "docstrings": [ - "`caseFirst(locale)` returns the case-first ordering setting, if present.\n\nSee [`Intl.Locale.prototype.caseFirst`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/caseFirst) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={caseFirst: #upper})\nlocale->Intl.Locale.caseFirst == Some(\"upper\")\n```" - ], - "signature": "let caseFirst: t => option" - }, - { - "id": "Stdlib.Intl.Locale.collation", - "kind": "value", - "name": "collation", - "docstrings": [ - "`collation(locale)` returns the collation type, if present.\n\nSee [`Intl.Locale.prototype.collation`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/collation) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={collation: #phonebk})\nlocale->Intl.Locale.collation == Some(\"phonebk\")\n```" - ], - "signature": "let collation: t => option" - }, - { - "id": "Stdlib.Intl.Locale.hourCycle", - "kind": "value", - "name": "hourCycle", - "docstrings": [ - "`hourCycle(locale)` returns the preferred hour cycle, if present.\n\nSee [`Intl.Locale.prototype.hourCycle`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={hourCycle: #h12})\nlocale->Intl.Locale.hourCycle == Some(\"h12\")\n```" - ], - "signature": "let hourCycle: t => option" - }, - { - "id": "Stdlib.Intl.Locale.language", - "kind": "value", - "name": "language", - "docstrings": [ - "`language(locale)` returns the primary language subtag.\n\nSee [`Intl.Locale.prototype.language`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/language) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"pt-BR\")\nlocale->Intl.Locale.language == \"pt\"\n```" - ], - "signature": "let language: t => string" - }, - { - "id": "Stdlib.Intl.Locale.numberingSystem", - "kind": "value", - "name": "numberingSystem", - "docstrings": [ - "`numberingSystem(locale)` returns the numbering system identifier, if present.\n\nSee [`Intl.Locale.prototype.numberingSystem`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/numberingSystem) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={numberingSystem: #latn})\nlocale->Intl.Locale.numberingSystem == Some(\"latn\")\n```" - ], - "signature": "let numberingSystem: t => option" - }, - { - "id": "Stdlib.Intl.Locale.numeric", - "kind": "value", - "name": "numeric", - "docstrings": [ - "`numeric(locale)` indicates whether numeric ordering should be used for region subtags.\n\nSee [`Intl.Locale.prototype.numeric`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/numeric) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={numeric: true})\nlocale->Intl.Locale.numeric == true\n```" - ], - "signature": "let numeric: t => bool" - }, - { - "id": "Stdlib.Intl.Locale.region", - "kind": "value", - "name": "region", - "docstrings": [ - "`region(locale)` returns the region subtag, if present.\n\nSee [`Intl.Locale.prototype.region`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/region) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en-US\")\nlocale->Intl.Locale.region == Some(\"US\")\n```" - ], - "signature": "let region: t => option" - }, - { - "id": "Stdlib.Intl.Locale.script", - "kind": "value", - "name": "script", - "docstrings": [ - "`script(locale)` returns the script subtag, if present.\n\nSee [`Intl.Locale.prototype.script`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/script) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"sr-Cyrl\")\nlocale->Intl.Locale.script == Some(\"Cyrl\")\n```" - ], - "signature": "let script: t => option" - }, - { - "id": "Stdlib.Intl.Locale.maximize", - "kind": "value", - "name": "maximize", - "docstrings": [ - "`maximize(locale)` adds likely subtags to produce the most specific locale.\n\nSee [`Intl.Locale.prototype.maximize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/maximize) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\")\nlocale->Intl.Locale.maximize->Intl.Locale.region == Some(\"US\")\n```" - ], - "signature": "let maximize: t => t" - }, - { - "id": "Stdlib.Intl.Locale.minimize", - "kind": "value", - "name": "minimize", - "docstrings": [ - "`minimize(locale)` removes unnecessary subtags while preserving semantics.\n\nSee [`Intl.Locale.prototype.minimize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/minimize) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en-Latn-US\")\nlocale->Intl.Locale.minimize->Intl.Locale.baseName == \"en\"\n```" - ], - "signature": "let minimize: t => t" - }, - { - "id": "Stdlib.Intl.Locale.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(locale)` ignores the provided locale and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/listformat": { - "id": "Stdlib.Intl.ListFormat", - "name": "ListFormat", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.ListFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.ListFormat.listType", - "kind": "type", - "name": "listType", - "docstrings": [], - "signature": "type listType = [#conjunction | #disjunction | #unit]" - }, - { - "id": "Stdlib.Intl.ListFormat.style", - "kind": "type", - "name": "style", - "docstrings": [], - "signature": "type style = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.ListFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n \\\"type\"?: listType,\n style?: style,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.listPartComponentType", - "kind": "type", - "name": "listPartComponentType", - "docstrings": [], - "signature": "type listPartComponentType = [#element | #literal]" - }, - { - "id": "Stdlib.Intl.ListFormat.listPart", - "kind": "type", - "name": "listPart", - "docstrings": [], - "signature": "type listPart = {\n \\\"type\": listPartComponentType,\n value: string,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n style: style,\n \\\"type\": listType,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.ListFormat` instance for formatting lists.\n\nSee [`Intl.ListFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"], ~options={\\\"type\": #conjunction})\nformatter->Intl.ListFormat.format([\"apples\", \"bananas\", \"cherries\"]) == \"apples, bananas, and cherries\"\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.ListFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for list formatting.\n\nSee [`Intl.ListFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.ListFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.ListFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the actual options being used.\n\nSee [`Intl.ListFormat.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"])\nIntl.ListFormat.resolvedOptions(formatter).locale == \"en\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.ListFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, items)` returns the formatted list string.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"])\nformatter->Intl.ListFormat.format([\"a\", \"b\"]) == \"a and b\"\n```" - ], - "signature": "let format: (t, array) => string" - }, - { - "id": "Stdlib.Intl.ListFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, items)` returns the list as an array of parts describing how it would be rendered.\n\nSee [`Intl.ListFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/formatToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"])\nformatter->Intl.ListFormat.formatToParts([\"a\", \"b\"])->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, array) => array" - }, - { - "id": "Stdlib.Intl.ListFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(listFormat)` ignores the provided listFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/datetimeformat": { - "id": "Stdlib.Intl.DateTimeFormat", - "name": "DateTimeFormat", - "docstrings": [ - "Bindings to JavaScript's `Intl.DateTimeFormat`." - ], - "items": [ - { - "id": "Stdlib.Intl.DateTimeFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateStyle", - "kind": "type", - "name": "dateStyle", - "docstrings": [], - "signature": "type dateStyle = [#full | #long | #medium | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.timeStyle", - "kind": "type", - "name": "timeStyle", - "docstrings": [], - "signature": "type timeStyle = [#full | #long | #medium | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dayPeriod", - "kind": "type", - "name": "dayPeriod", - "docstrings": [], - "signature": "type dayPeriod = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.weekday", - "kind": "type", - "name": "weekday", - "docstrings": [], - "signature": "type weekday = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.era", - "kind": "type", - "name": "era", - "docstrings": [], - "signature": "type era = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.year", - "kind": "type", - "name": "year", - "docstrings": [], - "signature": "type year = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.month", - "kind": "type", - "name": "month", - "docstrings": [], - "signature": "type month = [\n | #\"2-digit\"\n | #long\n | #narrow\n | #numeric\n | #short\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.day", - "kind": "type", - "name": "day", - "docstrings": [], - "signature": "type day = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.hour", - "kind": "type", - "name": "hour", - "docstrings": [], - "signature": "type hour = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.minute", - "kind": "type", - "name": "minute", - "docstrings": [], - "signature": "type minute = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.second", - "kind": "type", - "name": "second", - "docstrings": [], - "signature": "type second = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.timeZoneName", - "kind": "type", - "name": "timeZoneName", - "docstrings": [ - "Firefox also supports IANA time zone names here\nNode v19+ supports \"shortOffset\", \"shortGeneric\", \"longOffset\", and \"longGeneric\"." - ], - "signature": "type timeZoneName = [\n | #long\n | #longGeneric\n | #longOffset\n | #short\n | #shortGeneric\n | #shortOffset\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.hourCycle", - "kind": "type", - "name": "hourCycle", - "docstrings": [], - "signature": "type hourCycle = [#h11 | #h12 | #h23 | #h24]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatMatcher", - "kind": "type", - "name": "formatMatcher", - "docstrings": [], - "signature": "type formatMatcher = [#basic | #\"best fit\"]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.fractionalSecondDigits", - "kind": "type", - "name": "fractionalSecondDigits", - "docstrings": [], - "signature": "type fractionalSecondDigits = [#0 | #1 | #2 | #3]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n dateStyle?: dateStyle,\n timeStyle?: timeStyle,\n calendar?: Intl_Common.calendar,\n dayPeriod?: dayPeriod,\n numberingSystem?: Intl_Common.numberingSystem,\n localeMatcher?: Intl_Common.localeMatcher,\n timeZone?: string,\n hour12?: bool,\n hourCycle?: hourCycle,\n formatMatcher?: formatMatcher,\n weekday?: weekday,\n era?: era,\n year?: year,\n month?: month,\n day?: day,\n hour?: hour,\n minute?: minute,\n second?: second,\n fractionalSecondDigits?: fractionalSecondDigits,\n timeZoneName?: timeZoneName,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n dateStyle?: dateStyle,\n timeStyle?: timeStyle,\n weekday?: weekday,\n era?: era,\n year?: year,\n month?: month,\n day?: day,\n hour?: hour,\n minute?: minute,\n second?: second,\n fractionalSecondDigits?: fractionalSecondDigits,\n timeZoneName?: timeZoneName,\n calendar: Intl_Common.calendar,\n hour12: bool,\n hourCycle: hourCycle,\n locale: string,\n numberingSystem: Intl_Common.numberingSystem,\n timeZone: string,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimeComponent", - "kind": "type", - "name": "dateTimeComponent", - "docstrings": [], - "signature": "type dateTimeComponent = [\n | #day\n | #dayPeriod\n | #era\n | #fractionalSecond\n | #hour\n | #literal\n | #minute\n | #month\n | #relatedYear\n | #second\n | #timeZone\n | #weekday\n | #year\n | #yearName\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimePart", - "kind": "type", - "name": "dateTimePart", - "docstrings": [], - "signature": "type dateTimePart = {\n \\\"type\": dateTimeComponent,\n value: string,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimeRangeSource", - "kind": "type", - "name": "dateTimeRangeSource", - "docstrings": [], - "signature": "type dateTimeRangeSource = [\n | #endRange\n | #shared\n | #startRange\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimeRangePart", - "kind": "type", - "name": "dateTimeRangePart", - "docstrings": [], - "signature": "type dateTimeRangePart = {\n \\\"type\": dateTimeComponent,\n value: string,\n source: dateTimeRangeSource,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.DateTimeFormat` instance for formatting date values.\n\nSee [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"], ~options={timeStyle: #short})\nlet sampleDate = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nformatter->Intl.DateTimeFormat.format(sampleDate)->String.length > 0\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported by the runtime for date/time formatting.\n\nSee [`Intl.DateTimeFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.DateTimeFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the actual locale and formatting options in use.\n\nSee [`Intl.DateTimeFormat.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"])\nIntl.DateTimeFormat.resolvedOptions(formatter).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, date)` returns the formatted string for `date`.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en\"])\nlet date = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nformatter->Intl.DateTimeFormat.format(date)->String.length > 0\n```" - ], - "signature": "let format: (t, Date.t) => string" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, date)` breaks the formatted output into an array of parts.\n\nSee [`Intl.DateTimeFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en\"])\nlet date = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nformatter->Intl.DateTimeFormat.formatToParts(date)->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, Date.t) => array" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatRange", - "kind": "value", - "name": "formatRange", - "docstrings": [ - "`formatRange(formatter, ~startDate, ~endDate)` formats the range between `startDate` and `endDate`.\n\nSee [`Intl.DateTimeFormat.prototype.formatRange`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatRange) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"], ~options={dateStyle: #short})\nlet startDate = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nlet endDate = Js.Date.makeWithYMD(~year=2024, ~month=1, ~date=1)\nformatter->Intl.DateTimeFormat.formatRange(~startDate=startDate, ~endDate=endDate)->String.length > 0\n```" - ], - "signature": "let formatRange: (t, ~startDate: Date.t, ~endDate: Date.t) => string" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatRangeToParts", - "kind": "value", - "name": "formatRangeToParts", - "docstrings": [ - "`formatRangeToParts(formatter, ~startDate, ~endDate)` returns an array describing how the range would be rendered.\n\nSee [`Intl.DateTimeFormat.prototype.formatRangeToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatRangeToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"], ~options={dateStyle: #short})\nlet startDate = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nlet endDate = Js.Date.makeWithYMD(~year=2024, ~month=1, ~date=1)\nformatter->Intl.DateTimeFormat.formatRangeToParts(~startDate=startDate, ~endDate=endDate)->Array.length > 0\n```" - ], - "signature": "let formatRangeToParts: (\n t,\n ~startDate: Date.t,\n ~endDate: Date.t,\n) => array" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(dateTimeFormat)` ignores the provided dateTimeFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/collator": { - "id": "Stdlib.Intl.Collator", - "name": "Collator", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.Collator.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Collator.usage", - "kind": "type", - "name": "usage", - "docstrings": [], - "signature": "type usage = [#search | #sort]" - }, - { - "id": "Stdlib.Intl.Collator.sensitivity", - "kind": "type", - "name": "sensitivity", - "docstrings": [], - "signature": "type sensitivity = [#accent | #base | #case | #variant]" - }, - { - "id": "Stdlib.Intl.Collator.caseFirst", - "kind": "type", - "name": "caseFirst", - "docstrings": [], - "signature": "type caseFirst = [#\"false\" | #lower | #upper]" - }, - { - "id": "Stdlib.Intl.Collator.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n usage?: usage,\n sensitivity?: sensitivity,\n ignorePunctuation?: bool,\n numeric?: bool,\n caseFirst?: caseFirst,\n}" - }, - { - "id": "Stdlib.Intl.Collator.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n usage: usage,\n sensitivity: sensitivity,\n ignorePunctuation: bool,\n collation: [\n | #compat\n | #default\n | #dict\n | #emoji\n | #eor\n | #phonebk\n | #phonetic\n | #pinyin\n | #stroke\n | #trad\n | #unihan\n | #zhuyin\n ],\n numeric?: bool,\n caseFirst?: caseFirst,\n}" - }, - { - "id": "Stdlib.Intl.Collator.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.Collator.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.Collator` instance that can compare strings using locale-aware rules.\n\nSee [`Intl.Collator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) on MDN.\n\n## Examples\n\n```rescript\nlet collator = Intl.Collator.make(~locales=[\"en\"])\ncollator->Intl.Collator.compare(\"apple\", \"banana\") < 0\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.Collator.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported by the runtime for collation.\n\nSee [`Intl.Collator.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.Collator.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.Collator.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(collator)` returns the locale and collation settings in use.\n\nSee [`Intl.Collator.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet collator = Intl.Collator.make(~locales=[\"en-US\"])\nIntl.Collator.resolvedOptions(collator).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.Collator.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(collator, a, b)` compares two strings using the rules of `collator`. Returns a negative number when `a` comes before `b`, `0` when equal, and a positive number otherwise.\n\n## Examples\n\n```rescript\nlet collator = Intl.Collator.make(~locales=[\"en-US\"])\ncollator->Intl.Collator.compare(\"apple\", \"banana\") < 0\n```" - ], - "signature": "let compare: (t, string, string) => int" - }, - { - "id": "Stdlib.Intl.Collator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(collator)` ignores the provided collator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/common": { - "id": "Stdlib.Intl.Common", - "name": "Common", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.Common.localeMatcher", - "kind": "type", - "name": "localeMatcher", - "docstrings": [], - "signature": "type localeMatcher = [#\"best fit\" | #lookup]" - }, - { - "id": "Stdlib.Intl.Common.calendar", - "kind": "type", - "name": "calendar", - "docstrings": [], - "signature": "type calendar = [\n | #buddhist\n | #chinese\n | #coptic\n | #dangi\n | #ethioaa\n | #ethiopic\n | #gregory\n | #hebrew\n | #indian\n | #islamic\n | #\"islamic-civil\"\n | #\"islamic-rgsa\"\n | #\"islamic-tbla\"\n | #\"islamic-umalqura\"\n | #iso8601\n | #japanese\n | #persian\n | #roc\n]" - }, - { - "id": "Stdlib.Intl.Common.collation", - "kind": "type", - "name": "collation", - "docstrings": [], - "signature": "type collation = [\n | #compat\n | #dict\n | #emoji\n | #eor\n | #phonebk\n | #phonetic\n | #pinyin\n | #stroke\n | #trad\n | #unihan\n | #zhuyin\n]" - }, - { - "id": "Stdlib.Intl.Common.numberingSystem", - "kind": "type", - "name": "numberingSystem", - "docstrings": [], - "signature": "type numberingSystem = [\n | #adlm\n | #ahom\n | #arab\n | #arabext\n | #bali\n | #beng\n | #bhks\n | #brah\n | #cakm\n | #cham\n | #deva\n | #diak\n | #fullwide\n | #gong\n | #gonm\n | #gujr\n | #guru\n | #hanidec\n | #hmng\n | #hmnp\n | #java\n | #kali\n | #kawi\n | #khmr\n | #knda\n | #lana\n | #lanatham\n | #laoo\n | #latn\n | #lepc\n | #limb\n | #mathbold\n | #mathdbl\n | #mathmono\n | #mathsanb\n | #mathsans\n | #mlym\n | #modi\n | #mong\n | #mroo\n | #mtei\n | #mymr\n | #mymrshan\n | #mymrtlng\n | #nagm\n | #newa\n | #nkoo\n | #olck\n | #orya\n | #osma\n | #rohg\n | #saur\n | #segment\n | #shrd\n | #sind\n | #sinh\n | #sora\n | #sund\n | #takr\n | #talu\n | #tamldec\n | #telu\n | #thai\n | #tibt\n | #tirh\n | #tnsa\n | #vaii\n | #wara\n | #wcho\n]" - }, - { - "id": "Stdlib.Intl.Common.oneTo21", - "kind": "type", - "name": "oneTo21", - "docstrings": [], - "signature": "type oneTo21 = [\n | #1\n | #10\n | #11\n | #12\n | #13\n | #14\n | #15\n | #16\n | #17\n | #18\n | #19\n | #2\n | #20\n | #21\n | #3\n | #4\n | #5\n | #6\n | #7\n | #8\n | #9\n]" - }, - { - "id": "Stdlib.Intl.Common.zeroTo20", - "kind": "type", - "name": "zeroTo20", - "docstrings": [], - "signature": "type zeroTo20 = [\n | #0\n | #1\n | #10\n | #11\n | #12\n | #13\n | #14\n | #15\n | #16\n | #17\n | #18\n | #19\n | #2\n | #20\n | #3\n | #4\n | #5\n | #6\n | #7\n | #8\n | #9\n]" - } - ] - }, - "stdlib/int/ref": { - "id": "Stdlib.Int.Ref", - "name": "Ref", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int.Ref.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = ref" - }, - { - "id": "Stdlib.Int.Ref.increment", - "kind": "value", - "name": "increment", - "docstrings": [ - "`increment(intRef)` increments the value of the provided reference by 1.\n\n ## Examples\n\n ```rescript\n let myRef = ref(4)\n Int.Ref.increment(myRef)\n myRef.contents == 5\n ```" - ], - "signature": "let increment: ref => unit" - }, - { - "id": "Stdlib.Int.Ref.decrement", - "kind": "value", - "name": "decrement", - "docstrings": [ - "`decrement(intRef)` decrements the value of the provided reference by 1.\n\n ## Examples\n\n ```rescript\n let myRef = ref(4)\n Int.Ref.decrement(myRef)\n myRef.contents == 3\n ```" - ], - "signature": "let decrement: ref => unit" - } - ] - }, - "stdlib/int/bitwise": { - "id": "Stdlib.Int.Bitwise", - "name": "Bitwise", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int.Bitwise.land", - "kind": "value", - "name": "land", - "docstrings": [], - "signature": "let land: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lor", - "kind": "value", - "name": "lor", - "docstrings": [], - "signature": "let lor: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lxor", - "kind": "value", - "name": "lxor", - "docstrings": [], - "signature": "let lxor: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lsl", - "kind": "value", - "name": "lsl", - "docstrings": [], - "signature": "let lsl: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lsr", - "kind": "value", - "name": "lsr", - "docstrings": [], - "signature": "let lsr: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.asr", - "kind": "value", - "name": "asr", - "docstrings": [], - "signature": "let asr: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lnot", - "kind": "value", - "name": "lnot", - "docstrings": [], - "signature": "let lnot: int => int", - "deprecated": "" - } - ] - }, - "stdlib/int/constants": { - "id": "Stdlib.Int.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int.Constants.minValue", - "kind": "value", - "name": "minValue", - "docstrings": [ - "The smallest positive number represented in JavaScript.\nSee [`Number.MIN_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE)\non MDN.\n\n ## Examples\n\n ```rescript\n Console.log(Int.Constants.minValue)\n ```" - ], - "signature": "let minValue: int" - }, - { - "id": "Stdlib.Int.Constants.maxValue", - "kind": "value", - "name": "maxValue", - "docstrings": [ - "The largest positive number represented in JavaScript.\nSee [`Number.MAX_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE)\non MDN.\n\n ## Examples\n\n ```rescript\n Console.log(Int.Constants.maxValue)\n ```" - ], - "signature": "let maxValue: int" - } - ] - }, - "stdlib/float/constants": { - "id": "Stdlib.Float.Constants", - "name": "Constants", - "docstrings": [ - "Float constants." - ], - "items": [ - { - "id": "Stdlib.Float.Constants.nan", - "kind": "value", - "name": "nan", - "docstrings": [ - "The special value \"Not a Number\"\nSee [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.nan\n ```" - ], - "signature": "let nan: float" - }, - { - "id": "Stdlib.Float.Constants.epsilon", - "kind": "value", - "name": "epsilon", - "docstrings": [ - "Represents the difference between 1 and the smallest floating point number greater than 1.\nSee [`Number.EPSILON`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.epsilon\n ```" - ], - "signature": "let epsilon: float" - }, - { - "id": "Stdlib.Float.Constants.positiveInfinity", - "kind": "value", - "name": "positiveInfinity", - "docstrings": [ - "The positive Infinity value\nSee [`Number.POSITIVE_INFINITY`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/POSITIVE_INFINITY) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.positiveInfinity\n ```" - ], - "signature": "let positiveInfinity: float" - }, - { - "id": "Stdlib.Float.Constants.negativeInfinity", - "kind": "value", - "name": "negativeInfinity", - "docstrings": [ - "The negative Infinity value\nSee [`Number.NEGATIVE_INFINITY`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.negativeInfinity\n ```" - ], - "signature": "let negativeInfinity: float" - }, - { - "id": "Stdlib.Float.Constants.minValue", - "kind": "value", - "name": "minValue", - "docstrings": [ - "The smallest positive numeric value representable in JavaScript.\nSee [`Number.MIN_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.minValue\n ```" - ], - "signature": "let minValue: float" - }, - { - "id": "Stdlib.Float.Constants.maxValue", - "kind": "value", - "name": "maxValue", - "docstrings": [ - "The maximum positive numeric value representable in JavaScript.\nSee [`Number.MAX_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.minValue\n ```" - ], - "signature": "let maxValue: float" - } - ] - }, - "stdlib/error/urierror": { - "id": "Stdlib.Error.URIError", - "name": "URIError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.URIError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `URIError` with the provided `message`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/typeerror": { - "id": "Stdlib.Error.TypeError", - "name": "TypeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.TypeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `TypeError` with the provided `message`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/syntaxerror": { - "id": "Stdlib.Error.SyntaxError", - "name": "SyntaxError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.SyntaxError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `SyntaxError` with the provided `message`.\n\n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/referenceerror": { - "id": "Stdlib.Error.ReferenceError", - "name": "ReferenceError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.ReferenceError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `ReferenceError` with the provided `message`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/rangeerror": { - "id": "Stdlib.Error.RangeError", - "name": "RangeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.RangeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `RangeError` with the provided `message`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/evalerror": { - "id": "Stdlib.Error.EvalError", - "name": "EvalError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.EvalError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `EvalError` with the provided `message`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/date/utc": { - "id": "Stdlib.Date.UTC", - "name": "UTC", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Date.UTC.makeWithYM", - "kind": "value", - "name": "makeWithYM", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYM(~year=2023, ~month=0)\n // 1672531200000\n \n Date.UTC.makeWithYM(~year=2023, ~month=11)\n // 1701388800000\n \n Date.UTC.makeWithYM(~year=2023, ~month=12)\n // 1704067200000\n \n Date.UTC.makeWithYM(~year=2023, ~month=-1)\n // 1669852800000\n ```" - ], - "signature": "let makeWithYM: (~year: int, ~month: int) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMD", - "kind": "value", - "name": "makeWithYMD", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=20)\n // 1676851200000\n \n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=-1)\n // 1675036800000\n \n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=29)\n // 1677628800000\n ```" - ], - "signature": "let makeWithYMD: (~year: int, ~month: int, ~day: int) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDH", - "kind": "value", - "name": "makeWithYMDH", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=16)\n // 1676908800000\n \n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=24)\n // 1676937600000\n \n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=-1)\n // 1676847600000\n ```" - ], - "signature": "let makeWithYMDH: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDHM", - "kind": "value", - "name": "makeWithYMDHM", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40)\n // 1676911200000\n \n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=60)\n // 1676912400000\n \n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=-1)\n // 1676908740000\n ```" - ], - "signature": "let makeWithYMDHM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDHMS", - "kind": "value", - "name": "makeWithYMDHMS", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0)\n // 1676911200000\n \n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=60)\n // 1676911260000\n \n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=-1)\n // 1676911199000\n ```" - ], - "signature": "let makeWithYMDHMS: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDHMSM", - "kind": "value", - "name": "makeWithYMDHMSM", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=0,\n )->Console.log\n // 1676911200000\n \n Date.UTC.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=1000,\n )->Console.log\n // 1676911201000\n \n Date.UTC.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=-1,\n )->Console.log\n // 1676911199999\n ```" - ], - "signature": "let makeWithYMDHMSM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => msSinceEpoch" - } - ] - }, - "stdlib/biguint64array": { - "id": "Stdlib.BigUint64Array", - "name": "BigUint64Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigUint64Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `BigUint64Array` typed array represents an array of 64-bit unsigned integers in platform byte order. See [BigUint64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.BigUint64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `BigUint64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.BigUint64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `BigUint64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.BigUint64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigUint64Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigUint64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `BigUint64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.BigUint64Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `BigUint64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => bigint=?) => t" - }, - { - "id": "Stdlib.BigUint64Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `BigUint64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigUint64Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bigUintArray)` ignores the provided bigUintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/bigint64array": { - "id": "Stdlib.BigInt64Array", - "name": "BigInt64Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigInt64Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `BigInt64Array` typed array represents an array of 64-bit signed integers in platform byte order. See [BigInt64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.BigInt64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `BigInt64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.BigInt64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `BigInt64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.BigInt64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt64Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `BigInt64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.BigInt64Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `BigInt64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => bigint=?) => t" - }, - { - "id": "Stdlib.BigInt64Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `BigInt64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt64Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bigIntArray)` ignores the provided bigIntArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint8clampedarray": { - "id": "Stdlib.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8ClampedArray.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint8ClampedArray` typed array represents an array of 8-bit unsigned integers clamped to 0-255. See [Uint8ClampedArray on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint8ClampedArray` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint8ClampedArray` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint8ClampedArray` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint8ClampedArray` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8ClampedArray.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint32array": { - "id": "Stdlib.Uint32Array", - "name": "Uint32Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint32Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint32Array` typed array represents an array of 32-bit unsigned integers in platform byte order. See [Uint32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint32Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint32Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint32Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint32Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint32Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint16array": { - "id": "Stdlib.Uint16Array", - "name": "Uint16Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint16Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint16Array` typed array represents an array of 16-bit unsigned integers in platform byte order. See [Uint16Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint16Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint16Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint16Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint16Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint16Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint16Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint16Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint16Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint16Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint16Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint16Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint16Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint8array": { - "id": "Stdlib.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint8Array` typed array represents an array of 8-bit unsigned integers. See [Uint8Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint8Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint8Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint8Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint8Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint8Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint8Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint8Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint8Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint8Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint8Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/int32array": { - "id": "Stdlib.Int32Array", - "name": "Int32Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int32Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Int32Array` typed array represents an array of twos-complemenet 32-bit signed integers in platform byte order. See [Int32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Int32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Int32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Int32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Int32Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Int32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int32Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Int32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Int32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Int32Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Int32Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int32Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/int16array": { - "id": "Stdlib.Int16Array", - "name": "Int16Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int16Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Int16Array` typed array represents an array of twos-complement 16-bit signed integers in platform byte order. See [Int16Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Int16Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int16Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Int16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Int16Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Int16Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int16Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Int16Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Int16Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int16Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Int16Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int16Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int16Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/int8array": { - "id": "Stdlib.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int8Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Int8Array` typed array represents an array of twos-complement 8-bit signed integers. See [Int8Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Int8Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int8Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Int8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Int8Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Int8Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int8Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Int8Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Int8Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int8Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Int8Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int8Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int8Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/float64array": { - "id": "Stdlib.Float64Array", - "name": "Float64Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float64Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Float64Array` typed array represents an array of 64-bit floating point numbers in platform byte order. See [Float64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Float64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Float64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Float64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Float64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Float64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float64Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Float64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Float64Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Float64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => float=?) => t" - }, - { - "id": "Stdlib.Float64Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Float64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float64Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/float32array": { - "id": "Stdlib.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float32Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Float32Array` typed array represents an array of 32-bit floating point numbers in platform byte order. See [Float32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Float32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Float32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Float32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Float32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Float32Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float32Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Float32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Float32Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Float32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => float=?) => t" - }, - { - "id": "Stdlib.Float32Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Float32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float32Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/typedarray": { - "id": "Stdlib.TypedArray", - "name": "TypedArray", - "docstrings": [], - "items": [ - { - "id": "Stdlib.TypedArray.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.TypedArray.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```" - ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```" - ], - "signature": "let set: (t<'a>, int, 'a) => unit" - }, - { - "id": "Stdlib.TypedArray.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [ - "`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN." - ], - "signature": "let buffer: t<'a> => ArrayBuffer.t" - }, - { - "id": "Stdlib.TypedArray.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [ - "`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```" - ], - "signature": "let byteLength: t<'a> => int" - }, - { - "id": "Stdlib.TypedArray.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [ - "`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN." - ], - "signature": "let byteOffset: t<'a> => int" - }, - { - "id": "Stdlib.TypedArray.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [ - "`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```" - ], - "signature": "let setArray: (t<'a>, array<'a>) => unit" - }, - { - "id": "Stdlib.TypedArray.setArrayFrom", - "kind": "value", - "name": "setArrayFrom", - "docstrings": [ - "`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```" - ], - "signature": "let setArrayFrom: (t<'a>, array<'a>, int) => unit" - }, - { - "id": "Stdlib.TypedArray.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```" - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Stdlib.TypedArray.copyAllWithin", - "kind": "value", - "name": "copyAllWithin", - "docstrings": [ - "`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```" - ], - "signature": "let copyAllWithin: (t<'a>, ~target: int) => array<'a>" - }, - { - "id": "Stdlib.TypedArray.copyWithinToEnd", - "kind": "value", - "name": "copyWithinToEnd", - "docstrings": [ - "`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```" - ], - "signature": "let copyWithinToEnd: (t<'a>, ~target: int, ~start: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [ - "`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```" - ], - "signature": "let copyWithin: (t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>" - }, - { - "id": "Stdlib.TypedArray.fillAll", - "kind": "value", - "name": "fillAll", - "docstrings": [ - "`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```" - ], - "signature": "let fillAll: (t<'a>, 'a) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.fillToEnd", - "kind": "value", - "name": "fillToEnd", - "docstrings": [ - "`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array." - ], - "signature": "let fillToEnd: (t<'a>, 'a, ~start: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.fill", - "kind": "value", - "name": "fill", - "docstrings": [ - "`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```" - ], - "signature": "let fill: (t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN." - ], - "signature": "let reverse: t<'a> => unit" - }, - { - "id": "Stdlib.TypedArray.toReversed", - "kind": "value", - "name": "toReversed", - "docstrings": [ - "`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```" - ], - "signature": "let toReversed: t<'a> => t<'a>" - }, - { - "id": "Stdlib.TypedArray.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN." - ], - "signature": "let sort: (t<'a>, ('a, 'a) => Ordering.t) => unit" - }, - { - "id": "Stdlib.TypedArray.toSorted", - "kind": "value", - "name": "toSorted", - "docstrings": [ - "`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```" - ], - "signature": "let toSorted: (t<'a>, ('a, 'a) => Ordering.t) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.with", - "kind": "value", - "name": "with", - "docstrings": [ - "`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```" - ], - "signature": "let with: (t<'a>, int, 'a) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```" - ], - "signature": "let includes: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.TypedArray.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN." - ], - "signature": "let indexOf: (t<'a>, 'a) => int" - }, - { - "id": "Stdlib.TypedArray.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`." - ], - "signature": "let indexOfFrom: (t<'a>, 'a, int) => int" - }, - { - "id": "Stdlib.TypedArray.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```" - ], - "signature": "let joinWith: (t<'a>, string) => string" - }, - { - "id": "Stdlib.TypedArray.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN." - ], - "signature": "let lastIndexOf: (t<'a>, 'a) => int" - }, - { - "id": "Stdlib.TypedArray.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`." - ], - "signature": "let lastIndexOfFrom: (t<'a>, 'a, int) => int" - }, - { - "id": "Stdlib.TypedArray.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN." - ], - "signature": "let slice: (t<'a>, ~start: int, ~end: int=?) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array." - ], - "signature": "let sliceToEnd: (t<'a>, ~start: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(typedArray)` produces a shallow copy of the typed array." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Stdlib.TypedArray.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN." - ], - "signature": "let subarray: (t<'a>, ~start: int, ~end: int=?) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.subarrayToEnd", - "kind": "value", - "name": "subarrayToEnd", - "docstrings": [ - "`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer." - ], - "signature": "let subarrayToEnd: (t<'a>, ~start: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```" - ], - "signature": "let toString: t<'a> => string" - }, - { - "id": "Stdlib.TypedArray.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN." - ], - "signature": "let toLocaleString: t<'a> => string" - }, - { - "id": "Stdlib.TypedArray.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN." - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.everyWithIndex", - "kind": "value", - "name": "everyWithIndex", - "docstrings": [ - "`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`." - ], - "signature": "let everyWithIndex: (t<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN." - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`." - ], - "signature": "let filterWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN." - ], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findWithIndex", - "kind": "value", - "name": "findWithIndex", - "docstrings": [ - "`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index." - ], - "signature": "let findWithIndex: (t<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findLast", - "kind": "value", - "name": "findLast", - "docstrings": [ - "`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN." - ], - "signature": "let findLast: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findLastWithIndex", - "kind": "value", - "name": "findLastWithIndex", - "docstrings": [ - "`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`." - ], - "signature": "let findLastWithIndex: (t<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [ - "`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN." - ], - "signature": "let findIndex: (t<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.TypedArray.findIndexWithIndex", - "kind": "value", - "name": "findIndexWithIndex", - "docstrings": [ - "`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`." - ], - "signature": "let findIndexWithIndex: (t<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.TypedArray.findLastIndex", - "kind": "value", - "name": "findLastIndex", - "docstrings": [ - "`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN." - ], - "signature": "let findLastIndex: (t<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.TypedArray.findLastIndexWithIndex", - "kind": "value", - "name": "findLastIndexWithIndex", - "docstrings": [ - "`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`." - ], - "signature": "let findLastIndexWithIndex: (t<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.TypedArray.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN." - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.TypedArray.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index." - ], - "signature": "let forEachWithIndex: (t<'a>, ('a, int) => unit) => unit" - }, - { - "id": "Stdlib.TypedArray.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.TypedArray.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index." - ], - "signature": "let mapWithIndex: (t<'a>, ('a, int) => 'b) => t<'b>" - }, - { - "id": "Stdlib.TypedArray.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN." - ], - "signature": "let reduce: (t<'a>, ('b, 'a) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`." - ], - "signature": "let reduceWithIndex: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [ - "`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN." - ], - "signature": "let reduceRight: (t<'a>, ('b, 'a) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.reduceRightWithIndex", - "kind": "value", - "name": "reduceRightWithIndex", - "docstrings": [ - "`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`." - ], - "signature": "let reduceRightWithIndex: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN." - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.someWithIndex", - "kind": "value", - "name": "someWithIndex", - "docstrings": [ - "`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index." - ], - "signature": "let someWithIndex: (t<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/arraybuffer": { - "id": "Stdlib.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [ - "Functions for interacting with JavaScript ArrayBuffer.\nSee: [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)." - ], - "items": [ - { - "id": "Stdlib.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an ArrayBuffer object used to represent a generic raw binary data buffer." - ], - "signature": "type t" - }, - { - "id": "Stdlib.ArrayBuffer.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(length)` creates a new ArrayBuffer with the specified length in bytes.\nSee [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/ArrayBuffer) on MDN.\n\n## Examples\n\n```rescript\nlet buffer = ArrayBuffer.make(8)\nArrayBuffer.byteLength(buffer) == 8\n```\n\n## Exceptions\n\n- `RangeError`: If `length` is larger than `Number.MAX_SAFE_INTEGER` or negative." - ], - "signature": "let make: int => t" - }, - { - "id": "Stdlib.ArrayBuffer.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [ - "`byteLength(arrayBuffer)` returns the size, in bytes, of the ArrayBuffer.\nSee [`ArrayBuffer.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet buffer = ArrayBuffer.make(16)\nArrayBuffer.byteLength(buffer) == 16\n```" - ], - "signature": "let byteLength: t => int" - }, - { - "id": "Stdlib.ArrayBuffer.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(arrayBuffer, ~start, ~end)` returns a new ArrayBuffer whose contents are a copy of this ArrayBuffer's bytes from `start`, inclusive, up to `end`, exclusive.\nSee [`ArrayBuffer.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/slice) on MDN.\n\n## Examples\n\n```rescript\nlet buffer = ArrayBuffer.make(16)\nlet sliced = buffer->ArrayBuffer.slice(~start=4, ~end=12)\nArrayBuffer.byteLength(sliced) == 8\n```" - ], - "signature": "let slice: (t, ~start: int=?, ~end: int=?) => t" - }, - { - "id": "Stdlib.ArrayBuffer.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [], - "signature": "let sliceToEnd: (t, ~start: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.ArrayBuffer.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(arrayBuffer)` ignores the provided arrayBuffer and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/weakset": { - "id": "Stdlib.WeakSet", - "name": "WeakSet", - "docstrings": [ - "Bindings to JavaScript's `WeakSet`.\n\nWeak sets store references to objects without preventing those objects from being garbage collected." - ], - "items": [ - { - "id": "Stdlib.WeakSet.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Mutable weak set storing object references of type `'a`." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.WeakSet.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates an empty weak set.\n\nSee [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) on MDN.\n\n## Examples\n\n```rescript\nlet visited = WeakSet.make()\nWeakSet.has(visited, Object.make()) == false\n```" - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Stdlib.WeakSet.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(set, value)` inserts `value` into the weak set and returns the set for chaining.\n\nSee [`WeakSet.prototype.add`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/add) on MDN.\n\n## Examples\n\n```rescript\nlet set = WeakSet.make()\nlet node = Object.make()\nWeakSet.add(set, node)\nWeakSet.has(set, node) == true\n```" - ], - "signature": "let add: (t<'a>, 'a) => t<'a>" - }, - { - "id": "Stdlib.WeakSet.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "`delete(set, value)` removes `value` and returns `true` if an entry existed.\n\nSee [`WeakSet.prototype.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/delete) on MDN.\n\n## Examples\n\n```rescript\nlet set = WeakSet.make()\nlet node = Object.make()\nlet _ = WeakSet.add(set, node)\nWeakSet.delete(set, node) == true\nWeakSet.delete(set, node) == false\n```" - ], - "signature": "let delete: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.WeakSet.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(set, value)` checks whether `value` exists in the weak set.\n\nSee [`WeakSet.prototype.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/has) on MDN.\n\n## Examples\n\n```rescript\nlet set = WeakSet.make()\nlet node = Object.make()\nWeakSet.has(set, node) == false\nlet _ = WeakSet.add(set, node)\nWeakSet.has(set, node) == true\n```" - ], - "signature": "let has: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.WeakSet.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(weakSet)` ignores the provided weakSet and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/set": { - "id": "Stdlib.Set", - "name": "Set", - "docstrings": [ - "Bindings to the mutable JavaScript `Set`.\n\nSee [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) on MDN." - ], - "items": [ - { - "id": "Stdlib.Set.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an instance of `Set`." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.Set.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new, mutable JavaScript `Set`. A `Set` is a collection of unique values.\n\nSee [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) on MDN.\n\n\n\n## Examples\n```rescript\n// You can annotate the type of your set if you want to\nlet mySet: Set.t = Set.make()\n\n// Or you can let ReScript infer what's in your Set\nlet set = Set.make()\nset->Set.add(\"Fine name\") // Inferred as Set.t\n```\n\n## Alternatives\nA JavaScript `Set` is mutable. If you're looking for an immutable alternative, check out `Belt.Set`." - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Stdlib.Set.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Turns an array of values into a Set. Meaning only unique values are preserved.\n\n## Examples\n```rescript\ntype languages = ReScript | JavaScript | TypeScript\nlet languageRank = [ReScript, JavaScript, TypeScript]\n\nlet set = Set.fromArray(languageRank) // Set.t\n\nswitch set->Set.has(ReScript) {\n| true => Console.log(\"Yay, ReScript is in there!\")\n| false => Console.log(\"Uh-oh, something is _terribly_ wrong with this program... abort.\")\n}\n```" - ], - "signature": "let fromArray: array<'a> => t<'a>" - }, - { - "id": "Stdlib.Set.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "Turns an iterator into a `Set`.\n\n## Examples\n\n```rescript\n// Let's pretend we have an interator\nlet iterator: Iterator.t = %raw(`\n (() => {\n var array1 = ['a', 'b', 'c'];\n var iterator1 = array1[Symbol.iterator]();\n return iterator1\n })()\n`)\n\niterator\n->Set.fromIterator\n->Set.size == 3\n```" - ], - "signature": "let fromIterator: Iterator.t<'a> => t<'a>" - }, - { - "id": "Stdlib.Set.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns the size, the number of unique values, of the set.\n\nSee [`Set.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/size) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\n\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue2\")\n\nlet size = set->Set.size // 2\n```" - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Stdlib.Set.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(set)` returns `true` if the set has no values, `false` otherwise.\n\n## Examples\n```rescript\nlet emptySet = Set.make()\nemptySet->Set.isEmpty->assertEqual(true)\n\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.isEmpty->assertEqual(false)\n\n// After clearing the set\nset->Set.clear\nset->Set.isEmpty->assertEqual(true)\n```" - ], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Stdlib.Set.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Clears all entries in the set.\n\nSee [`Set.clear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/clear) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\n\nset->Set.add(\"someKey\")\nset->Set.size // 1\n\nset->Set.clear\nset->Set.size // 0\n```" - ], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Stdlib.Set.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds a new value to the set.\n\nSee [`Set.add`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/add) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\n```" - ], - "signature": "let add: (t<'a>, 'a) => unit" - }, - { - "id": "Stdlib.Set.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "Deletes the provided `value` from the set. Returns a `bool` for whether the value existed, and was deleted.\n\nSee [`Set.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nlet didDeleteValue = set->Set.delete(\"someValue\")\nConsole.log(didDeleteValue) // Logs `true` to the console, becuase the set had the value, so it was successfully deleted\n\nlet didDeleteValue = set->Set.delete(\"someNonExistantKey\")\nConsole.log(didDeleteValue) // Logs `false` to the console, becuase the value did not exist in the set\n```" - ], - "signature": "let delete: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.Set.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks whether the set has a specific value.\n\nSee [`Set.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/has) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\n\nswitch set->Set.has(\"someValue\") {\n| false => Console.log(\"Nope, didn't have it.\")\n| true => Console.log(\"Yay, we have the value!\")\n}\n```" - ], - "signature": "let has: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.Set.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Iterates through all values of the set.\n\nSee [`Set.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/forEach) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue2\")\n\nset->Set.forEach(value => {\n Console.log(value)\n})\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Set.values", - "kind": "value", - "name": "values", - "docstrings": [ - "Returns an iterator that holds all values of the set.\n\nSee [`Set.values`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/values) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.add(\"anotherValue\")\n\nlet values = set->Set.values\n\n// Logs the first value\nConsole.log(Iterator.next(values).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh values iterator to get an array of all values, since we consumed a value via `next` above already.\nConsole.log(set->Set.values->Iterator.toArray)\n```" - ], - "signature": "let values: t<'a> => Iterator.t<'a>" - }, - { - "id": "Stdlib.Set.difference", - "kind": "value", - "name": "difference", - "docstrings": [ - "Returns a new set with the values of the set that are not in the other set.\n\nSee [`Set.difference`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/difference) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.difference(set2) // Set.fromArray([\"orange\"])\n```" - ], - "signature": "let difference: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.symmetricDifference", - "kind": "value", - "name": "symmetricDifference", - "docstrings": [ - "Returns a new set with the values containing the values which are in either the set, but not in both.\n\nSee [`Set.symmetricDifference`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/symmetricDifference) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.symmetricDifference(set2) // Set.fromArray([\"orange\", \"pear\"])\n```" - ], - "signature": "let symmetricDifference: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.intersection", - "kind": "value", - "name": "intersection", - "docstrings": [ - "Returns a new set with the values containing the values which are in both the set and the other set.\n\nSee [`Set.intersection`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/intersection) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.intersection(set2) // Set.fromArray([\"apple\", \"banana\"])\n```" - ], - "signature": "let intersection: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.isDisjointFrom", - "kind": "value", - "name": "isDisjointFrom", - "docstrings": [ - "Returns a bool indicating if this set has no elements in common with the given set.\n\nSee [`Set.isDisjointFrom`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isDisjointFrom) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"kiwi\", \"melon\", \"pear\"])\nset1->Set.isDisjointFrom(set2) // true\n```" - ], - "signature": "let isDisjointFrom: (t<'a>, t<'a>) => bool" - }, - { - "id": "Stdlib.Set.isSubsetOf", - "kind": "value", - "name": "isSubsetOf", - "docstrings": [ - "Returns a bool indicating if the all values in the set are in the given set.\n\nSee [`Set.isSubsetOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isSubsetOf) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.isSubsetOf(set2) // true\n```" - ], - "signature": "let isSubsetOf: (t<'a>, t<'a>) => bool" - }, - { - "id": "Stdlib.Set.isSupersetOf", - "kind": "value", - "name": "isSupersetOf", - "docstrings": [ - "Returns a bool indicating if the all values in the given set are in the set.\n\nSee [`Set.isSupersetOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isSupersetOf) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\"])\nset1->Set.isSupersetOf(set2) // true\n```" - ], - "signature": "let isSupersetOf: (t<'a>, t<'a>) => bool" - }, - { - "id": "Stdlib.Set.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns a new set with the values of the set that are in both the set and the other set.\n\nSee [`Set.union`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/union) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.union(set2) // Set.fromArray([\"apple\", \"orange\", \"banana\", \"pear\"])\n```" - ], - "signature": "let union: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(set)` returns an array of all values of the set.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n```rescript\nlet set = Set.fromArray([\"apple\", \"orange\", \"apple\", \"banana\"])\nset->Set.toArray // [\"apple\", \"orange\", \"banana\"]\n```" - ], - "signature": "let toArray: t<'a> => array<'a>" - }, - { - "id": "Stdlib.Set.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(set)` ignores the provided set and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/weakmap": { - "id": "Stdlib.WeakMap", - "name": "WeakMap", - "docstrings": [ - "Bindings to JavaScript's `WeakMap`.\n\nWeak maps keep key/value pairs where keys must be objects and the references do not prevent garbage collection." - ], - "items": [ - { - "id": "Stdlib.WeakMap.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Mutable weak map storing values of type `'v` with object keys `'k`." - ], - "signature": "type t<'k, 'v>" - }, - { - "id": "Stdlib.WeakMap.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates an empty weak map.\n\nSee [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nWeakMap.get(cache, Object.make()) == None\n```" - ], - "signature": "let make: unit => t<'k, 'v>" - }, - { - "id": "Stdlib.WeakMap.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(map, key)` returns `Some(value)` when `key` exists, otherwise `None`.\n\nSee [`WeakMap.prototype.get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/get) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nWeakMap.get(cache, key) == None\nlet _ = WeakMap.set(cache, key, \"user\")\nWeakMap.get(cache, key) == Some(\"user\")\n```" - ], - "signature": "let get: (t<'k, 'v>, 'k) => option<'v>" - }, - { - "id": "Stdlib.WeakMap.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(map, key)` checks whether `key` exists in the weak map.\n\nSee [`WeakMap.prototype.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/has) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nWeakMap.has(cache, key) == false\nlet _ = WeakMap.set(cache, key, ())\nWeakMap.has(cache, key) == true\n```" - ], - "signature": "let has: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.WeakMap.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(map, key, value)` stores `value` for `key` and returns the map for chaining.\n\nSee [`WeakMap.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/set) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nlet _ = WeakMap.set(cache, key, 42)\nWeakMap.get(cache, key) == Some(42)\n```" - ], - "signature": "let set: (t<'k, 'v>, 'k, 'v) => t<'k, 'v>" - }, - { - "id": "Stdlib.WeakMap.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "`delete(map, key)` removes `key` and returns `true` if an entry existed.\n\nSee [`WeakMap.prototype.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/delete) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nWeakMap.delete(cache, key) == false\nlet _ = WeakMap.set(cache, key, 1)\nWeakMap.delete(cache, key) == true\n```" - ], - "signature": "let delete: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.WeakMap.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(weakMap)` ignores the provided weakMap and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'k, 'v> => unit" - } - ] - }, - "stdlib/map": { - "id": "Stdlib.Map", - "name": "Map", - "docstrings": [ - "Bindings to the mutable JavaScript `Map`.\n\nSee [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) on MDN." - ], - "items": [ - { - "id": "Stdlib.Map.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an instance of `Map`." - ], - "signature": "type t<'k, 'v>" - }, - { - "id": "Stdlib.Map.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new, mutable JavaScript `Map`. A `Map` can have any values as both keys and values.\n\nSee [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) on MDN.\n\n\n\n## Examples\n```rescript\n`make()`\n// You can annotate the type of your map if you want to\nlet myMap: Map.t = Map.make()\n\n// Or you can let ReScript infer what's in your map\nlet map = Map.make()\nmap->Map.set(\"lang\", \"ReScript\") // Inferred as Map.t\n```\n\n## Alternatives\nA JavaScript `Map` is mutable. If you're looking for an immutable alternative, check out`Belt.Map`." - ], - "signature": "let make: unit => t<'k, 'v>" - }, - { - "id": "Stdlib.Map.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Turns an array of key/value pairs into a Map.\n\n## Examples\n```rescript\ntype languages = ReScript | JavaScript | TypeScript\nlet languageRank = [(ReScript, 1), (JavaScript, 2), (TypeScript, 3)]\n\nlet map = Map.fromArray(languageRank) // Map.t\n\nswitch map->Map.get(ReScript) {\n| Some(1) => Console.log(\"Yay, ReScript is #1!\")\n| _ => Console.log(\"Uh-oh, something is _terribly_ wrong with this program... abort.\")\n}\n```" - ], - "signature": "let fromArray: array<('k, 'v)> => t<'k, 'v>" - }, - { - "id": "Stdlib.Map.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "Turns an iterator in the shape of `('key, 'value)` into a `Map`.\n\n## Examples\n\n```rescript\n// Let's pretend we have an interator in the correct shape\nlet iterator: Iterator.t<(string, string)> = %raw(`\n (() => {\n var map1 = new Map();\n\n map1.set('first', '1');\n map1.set('second', '2');\n\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\n\niterator\n->Map.fromIterator\n->Map.size == 2\n```" - ], - "signature": "let fromIterator: Iterator.t<('k, 'v)> => t<'k, 'v>" - }, - { - "id": "Stdlib.Map.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns the size, the number of key/value pairs, of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\n\nmap->Map.set(\"someKey\", \"someValue\")\n\nlet size = map->Map.size // 1\n```" - ], - "signature": "let size: t<'k, 'v> => int" - }, - { - "id": "Stdlib.Map.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(map)` returns `true` if the map has no key/value pairs, `false` otherwise.\n\n## Examples\n```rescript\nlet emptyMap = Map.make()\nemptyMap->Map.isEmpty->assertEqual(true)\n\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.isEmpty->assertEqual(false)\n\n// After clearing the map\nmap->Map.clear\nmap->Map.isEmpty->assertEqual(true)\n```" - ], - "signature": "let isEmpty: t<'k, 'v> => bool" - }, - { - "id": "Stdlib.Map.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Clears all entries in the map.\n\n## Examples\n```rescript\nlet map = Map.make()\n\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.size // 1\n\nmap->Map.clear\nmap->Map.size // 0\n```" - ], - "signature": "let clear: t<'k, 'v> => unit" - }, - { - "id": "Stdlib.Map.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Iterates through all values of the map.\n\n> Please note that this is *without the keys*, just the values. If you need the key as well, use `Map.forEachWithKey`.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\nmap->Map.forEach(value => {\n Console.log(value)\n})\n```" - ], - "signature": "let forEach: (t<'k, 'v>, 'v => unit) => unit" - }, - { - "id": "Stdlib.Map.forEachWithKey", - "kind": "value", - "name": "forEachWithKey", - "docstrings": [ - "Iterates through all values of the map, including the key for each value.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\nmap->Map.forEachWithKey((value, key) => {\n Console.log2(value, key)\n})\n```" - ], - "signature": "let forEachWithKey: (t<'k, 'v>, ('v, 'k) => unit) => unit" - }, - { - "id": "Stdlib.Map.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the value for a key, if a value exists at that key.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n\nswitch map->Map.get(\"someKey\") {\n| None => Console.log(\"Nope, didn't have it.\")\n| Some(value) => Console.log2(\"Yay, had the value, and it's:\", value)\n}\n```" - ], - "signature": "let get: (t<'k, 'v>, 'k) => option<'v>" - }, - { - "id": "Stdlib.Map.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks whether the map has a specific key.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n\nswitch map->Map.has(\"someKey\") {\n| false => Console.log(\"Nope, didn't have it.\")\n| true => Console.log(\"Yay, we have the value!\")\n}\n```" - ], - "signature": "let has: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.Map.set", - "kind": "value", - "name": "set", - "docstrings": [ - "Sets the provided `value` to the provided `key`.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n```" - ], - "signature": "let set: (t<'k, 'v>, 'k, 'v) => unit" - }, - { - "id": "Stdlib.Map.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "Deletes the provided `key` and its value from the map. Returns a `bool` for whether the key existed, and was deleted.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nlet didDeleteKey = map->Map.delete(\"someKey\")\nConsole.log(didDeleteKey) // Logs `true` to the console, becuase the map had the key, so it was successfully deleted\n\nlet didDeleteKey = map->Map.delete(\"someNonExistantKey\")\nConsole.log(didDeleteKey) // Logs `false` to the console, becuase the key did not exist\n```" - ], - "signature": "let delete: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.Map.keys", - "kind": "value", - "name": "keys", - "docstrings": [ - "Returns an iterator that holds all keys of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet keys = map->Map.keys\n\n// Logs the first key\nConsole.log(Iterator.next(keys).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh keys iterator to get an array of all keys, since we consumed a value via `next` above already.\nConsole.log(map->Map.keys->Iterator.toArray)\n```" - ], - "signature": "let keys: t<'k, 'v> => Iterator.t<'k>" - }, - { - "id": "Stdlib.Map.values", - "kind": "value", - "name": "values", - "docstrings": [ - "Returns an iterator that holds all values of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet values = map->Map.values\n\n// Logs the first value\nConsole.log(Iterator.next(values).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh values iterator to get an array of all values, since we consumed a value via `next` above already.\nConsole.log(map->Map.values->Iterator.toArray)\n```" - ], - "signature": "let values: t<'k, 'v> => Iterator.t<'v>" - }, - { - "id": "Stdlib.Map.entries", - "kind": "value", - "name": "entries", - "docstrings": [ - "Returns an iterator that holds all entries of the map.\nAn entry is represented as a tuple of `('key, 'value)`,\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet entries = map->Map.entries\n\n// Logs the first value\nConsole.log(Iterator.next(entries).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes entries. We'll need a fresh entries iterator to get an array of all entries, since we consumed a value via `next` above already.\nConsole.log(map->Map.entries->Iterator.toArray)\n```" - ], - "signature": "let entries: t<'k, 'v> => Iterator.t<('k, 'v)>" - }, - { - "id": "Stdlib.Map.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(map)` ignores the provided map and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'k, 'v> => unit" - } - ] - }, - "stdlib/asynciterator": { - "id": "Stdlib.AsyncIterator", - "name": "AsyncIterator", - "docstrings": [ - "Bindings to async iterators, a way to do async iteration in JavaScript.\n\nSee [async iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) on MDN." - ], - "items": [ - { - "id": "Stdlib.AsyncIterator.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type representing an async iterator." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.AsyncIterator.value", - "kind": "type", - "name": "value", - "docstrings": [], - "signature": "type value<'a> = {done: bool, value: option<'a>}" - }, - { - "id": "Stdlib.AsyncIterator.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(nextFn)`\n\nCreates an async iterator from a function that returns the next value of the iterator.\n\n## Examples\n\n- A simple example, creating an async iterator that returns 1, 2, 3:\n\n```rescript\nlet context = ref(0)\n\nlet asyncIterator = AsyncIterator.make(async () => {\n let currentValue = context.contents\n // Increment current value\n context := currentValue + 1\n\n {\n AsyncIterator.value: Some(currentValue),\n done: currentValue >= 3,\n }\n})\n\n// This will log 1, 2, 3\nlet main = async () =>\n await asyncIterator->AsyncIterator.forEach(value =>\n switch value {\n | Some(value) => Console.log(value)\n | None => ()\n }\n )\n\nmain()->ignore\n```" - ], - "signature": "let make: (unit => promise>) => t<'value>" - }, - { - "id": "Stdlib.AsyncIterator.value", - "kind": "value", - "name": "value", - "docstrings": [ - "`value(value)`\n\nShorthand for creating a value object with the provided value, and the `done` property set to false.\n\n## Examples\n\n```rescript\nlet context = ref(0)\n\nlet asyncIterator = AsyncIterator.make(async () => {\n let currentValue = context.contents\n // Increment current value\n context := currentValue + 1\n\n if currentValue >= 3 {\n AsyncIterator.done()\n } else {\n AsyncIterator.value(currentValue)\n }\n})\n```" - ], - "signature": "let value: 'value => value<'value>" - }, - { - "id": "Stdlib.AsyncIterator.done", - "kind": "value", - "name": "done", - "docstrings": [ - "`done(~finalValue=?)`\n\n Shorthand for creating a value object with the `done` property set to true, and the provided value as the final value, if any.\n\n ## Examples\n ```rescript\n let context = ref(0)\n \n let asyncIterator = AsyncIterator.make(async () => {\n let currentValue = context.contents\n // Increment current value\n context := currentValue + 1\n \n if currentValue >= 3 {\n AsyncIterator.done()\n } else {\n AsyncIterator.value(currentValue)\n }\n })\n ```" - ], - "signature": "let done: (~finalValue: 'value=?) => value<'value>" - }, - { - "id": "Stdlib.AsyncIterator.next", - "kind": "value", - "name": "next", - "docstrings": [ - "`next(asyncIterator)`\n\nReturns the next value of the iterator, if any.\n\nSee [async iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) on MDN.\n\n## Examples\n\n- A simple example, getting the next value:\n\n```rescript\nlet asyncIterator: AsyncIterator.t<(string, string)> = %raw(`\n (() => {\n var map1 = new Map();\n\n map1.set('first', '1');\n map1.set('second', '2');\n\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\n\nlet processMyAsyncIterator = async () => {\n // ReScript doesn't have `for ... of` loops, but it's easy to mimic using a while loop.\n let break = ref(false)\n\n while !break.contents {\n // Await the next iterator value\n let {value, done} = await asyncIterator->AsyncIterator.next\n\n // Exit the while loop if the iterator says it's done\n break := done\n\n if done {\n value->Option.isNone == true\n }\n }\n}\n\nprocessMyAsyncIterator()->ignore\n```" - ], - "signature": "let next: t<'a> => promise>" - }, - { - "id": "Stdlib.AsyncIterator.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(iterator, fn)` consumes all values in the async iterator and runs the callback `fn` for each value.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n\n```rescript\n// Let's pretend we get an async iterator returning ints from somewhere.\nlet asyncIterator: AsyncIterator.t<(string, string)> = %raw(`\n (() => {\n var map1 = new Map();\n\n map1.set('first', '1');\n map1.set('second', '2');\n\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\n\nlet main = async () =>\n await asyncIterator->AsyncIterator.forEach(v => {\n switch v {\n | Some((\"second\", value)) => value == \"2\"\n | _ => ()\n }\n })\n\nmain()->ignore\n```" - ], - "signature": "let forEach: (t<'a>, option<'a> => unit) => promise" - }, - { - "id": "Stdlib.AsyncIterator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(iterator)` ignores the provided async iterator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/iterator": { - "id": "Stdlib.Iterator", - "name": "Iterator", - "docstrings": [ - "Bindings to JavaScript iterators.\n\nSee [`Iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) on MDN." - ], - "items": [ - { - "id": "Stdlib.Iterator.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type representing an iterator." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.Iterator.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The current value of an iterator." - ], - "signature": "type value<'a> = {done: bool, value: option<'a>}" - }, - { - "id": "Stdlib.Iterator.next", - "kind": "value", - "name": "next", - "docstrings": [ - "Returns the next value of the iterator, if any.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n\n```rescript\nlet iterator: Iterator.t = %raw(`\n (() => {\n var array1 = ['a'];\n var iterator1 = array1[Symbol.iterator]();\n return iterator1\n })()\n`)\n(iterator->Iterator.next).done == false\n(iterator->Iterator.next).done == true\n```" - ], - "signature": "let next: t<'a> => value<'a>" - }, - { - "id": "Stdlib.Iterator.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Turns an iterator into an array of the remaining values.\nRemember that each invocation of `next` of an iterator consumes a value. `Iterator.toArray` will consume all remaining values of the iterator and return them in an array to you.\n\nSee [Iterator.prototype.toArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/toArray) on MDN.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\n// `Map.keys` returns all keys of the map as an iterator.\nlet mapKeysAsArray = map->Map.keys->Iterator.toArray\n\nmapKeysAsArray == [\"someKey\", \"someKey2\"]\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let toArray: t<'a> => array<'a>" - }, - { - "id": "Stdlib.Iterator.toArrayWithMapper", - "kind": "value", - "name": "toArrayWithMapper", - "docstrings": [ - "`toArray(iterator)` turns `iterator` into an array of its remaining values, applying the provided mapper function on each item.\nRemember that each invocation of `next` of an iterator consumes a value. `Iterator.toArrayWithMapper` will consume all remaining values of the iterator and return them in an array to you.\n\nSee [Iterator.prototype.toArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/toArray) on MDN.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\n// `Map.keys` returns all keys of the map as an iterator.\nlet mapKeysAsArray =\n map\n ->Map.keys\n ->Iterator.toArrayWithMapper(key => key->String.length)\n\nmapKeysAsArray == [7, 8]\n```" - ], - "signature": "let toArrayWithMapper: (t<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Stdlib.Iterator.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(iterator, fn)` consumes all values in the iterator and runs the callback `fn` for each value.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n```rescript\nlet iterator: Iterator.t = [\"a\", \"b\", \"c\"]->Array.values\nlet acc = ref(\"\")\niterator->Iterator.forEach(v => {\n acc := acc.contents ++ v\n})\n\nacc.contents == \"abc\"\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Iterator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(iterator)` ignores the provided iterator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - }, - { - "id": "Stdlib.Iterator.drop", - "kind": "value", - "name": "drop", - "docstrings": [ - "`drop(iterator, n)` returns a new iterator helper object that skips the given number of elements at the start of this iterator.\n\nSee [Iterator.prototype.drop](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/drop) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.drop(2)\nseq->Iterator.next == {done: false, value: Some(2)}\nseq->Iterator.next == {done: false, value: Some(3)}\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let drop: (t<'a>, int) => t<'a>" - }, - { - "id": "Stdlib.Iterator.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(iterator, fn)` tests whether all elements in the iterator pass the test implemented by the provided function.\n\nSee [Iterator.prototype.every](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/every) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet areAllEven = fibonacci->Iterator.every(n => n % 2 == 0)\nareAllEven == false\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Iterator.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(iterator, fn)` returns a new iterator helper object that contains the elements of the original iterator that pass the test implemented by the provided function.\n\nSee [Iterator.prototype.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/filter) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.filter(n => n % 2 == 0)\nseq->Iterator.next == {done: false, value: Some(2)}\nseq->Iterator.next == {done: false, value: Some(8)}\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Stdlib.Iterator.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(iterator, fn)` returns the value of the first element in the iterator that satisfies the provided testing function.\n\nSee [Iterator.prototype.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/find) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.find(n => n % 2 == 0)\nseq == Some(2)\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Iterator.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(iterator, fn)` returns a new iterator helper object that contains the elements of the original iterator that pass the test implemented by the provided function.\n\nSee [Iterator.prototype.flatMap](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/flatMap) on MDN.\n\n## Examples\n```rescript\nlet map1 = Map.fromArray([(\"a\", 1), (\"b\", 2), (\"c\", 3)])\nlet map2 = Map.fromArray([(\"d\", 4), (\"e\", 5), (\"f\", 6)])\n\nlet letters =\n [map1, map2]\n ->Array.values\n ->Iterator.flatMap(m => Map.keys(m))\n ->Array.fromIterator\nletters == [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Iterator.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(iterator, fn)` returns a new iterator helper object that yields elements of the iterator, each transformed by a mapping function.\n\nSee [Iterator.prototype.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/map) on MDN.\n\n## Examples\n```rescript\nlet map = Map.fromArray([(\"a\", 1), (\"b\", 2), (\"c\", 3)])\nlet letters = map->Map.keys->Iterator.map(v => v->String.toUpperCase)->Array.fromIterator\nletters == [\"A\", \"B\", \"C\"]\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Iterator.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(iterator, fn, initialValue)` applies a function against an accumulator and each element in the iterator (from left to right) to reduce it to a single value.\n\nSee [Iterator.prototype.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/reduce) on MDN.\n\n## Examples\n```rescript\nlet numbers: Iterator.t = [1, 2, 3]->Array.values\n\nlet sum = numbers->Iterator.reduce((acc, n) => acc + n, ~initialValue=0)\nsum == 6\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let reduce: (t<'a>, ('acc, 'a) => 'acc, ~initialValue: 'acc=?) => 'acc" - }, - { - "id": "Stdlib.Iterator.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(iterator, fn)` The some() method of Iterator instances is similar to Array.some:\nit tests whether at least one element produced by the iterator passes the test implemented by the provided function.\nIt returns a boolean value.\n\nSee [Iterator.prototype.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/some) on MDN.\n\n## Examples\n```rescript\nlet numbers: Iterator.t = [1, 2, 3]->Array.values\n\nlet hasEven = numbers->Iterator.some(n => n % 2 == 0)\nhasEven == true\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Iterator.take", - "kind": "value", - "name": "take", - "docstrings": [ - "`take((iterator, n))` returns a new iterator helper object that contains the first `n` elements of this iterator.\n\nSee [Iterator.prototype.take](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/take) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.take(2)\nseq->Iterator.next == {done: false, value: Some(1)}\nseq->Iterator.next == {done: false, value: Some(1)}\nseq->Iterator.next == {done: true, value: None}\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let take: (t<'a>, int) => t<'a>" - } - ] - }, - "stdlib/type": { - "id": "Stdlib.Type", - "name": "Type", - "docstrings": [ - "Utilities for classifying the type of JavaScript values at runtime." - ], - "items": [ - { - "id": "Stdlib.Type.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The possible types of JavaScript values." - ], - "signature": "type t = [\n | #bigint\n | #boolean\n | #function\n | #number\n | #object\n | #string\n | #symbol\n | #undefined\n]" - }, - { - "id": "Stdlib.Type.typeof", - "kind": "value", - "name": "typeof", - "docstrings": [ - "`typeof(someValue)`\n\nReturns the underlying JavaScript type of any runtime value.\n\nSee [`typeof`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof) on MDN.\n\n## Examples\n```rescript\nConsole.log(Type.typeof(\"Hello\")) // Logs \"string\" to the console.\n\nlet someVariable = true\n\nswitch someVariable->Type.typeof {\n| #boolean => Console.log(\"This is a bool, yay!\")\n| _ => Console.log(\"Oh, not a bool sadly...\")\n}\n```" - ], - "signature": "let typeof: 'a => t" - }, - { - "id": "Stdlib.Type.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(type)` ignores the provided type and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/symbol": { - "id": "Stdlib.Symbol", - "name": "Symbol", - "docstrings": [ - "A built-in object that serves as a namespace for globally-unique identifiers.\n\nCompiles to a regular JavaScript Symbol." - ], - "items": [ - { - "id": "Stdlib.Symbol.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a Symbol." - ], - "signature": "type t" - }, - { - "id": "Stdlib.Symbol.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(key)`\n\nMakes a new unique Symbol value.\n\n## Examples\n\n```rescript\nSymbol.make(\"sym1\")->Symbol.description == Some(\"sym1\")\n```" - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.Symbol.getFor", - "kind": "value", - "name": "getFor", - "docstrings": [ - "`getFor(key)`\n\nSearches for existing registered Symbols in the global Symbol registry with the given key and returns it if found.\nOtherwise a new Symbol gets created and registered with key.\n\n## Examples\n\n```rescript\nSymbol.getFor(\"sym1\") == Symbol.getFor(\"sym1\")\n```" - ], - "signature": "let getFor: string => option" - }, - { - "id": "Stdlib.Symbol.keyFor", - "kind": "value", - "name": "keyFor", - "docstrings": [ - "`keyFor(key)`\n\nRetrieves a shared Symbol key from the global Symbol registry for the given Symbol.\n\n## Examples\n\n```rescript\nlet globalSym = Symbol.getFor(\"sym1\") // Global symbol\n\nglobalSym->Option.flatMap(Symbol.description) == Some(\"sym1\")\n```" - ], - "signature": "let keyFor: t => option" - }, - { - "id": "Stdlib.Symbol.description", - "kind": "value", - "name": "description", - "docstrings": [ - "`description`\n\nReturns `Some(string)` containing the description of this symbol, or `None` if the symbol has no description.\n## Examples\n\n```rescript\nlet sym = Symbol.make(\"sym1\")\nSymbol.description(sym) == Some(\"sym1\")\n```" - ], - "signature": "let description: t => option" - }, - { - "id": "Stdlib.Symbol.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString`\n\n// Returns a string representing this symbol value.\n\n## Examples\n\n```rescript\nlet sym = Symbol.make(\"sym1\")\n\nSymbol.toString(sym) == \"Symbol(sym1)\"\n```" - ], - "signature": "let toString: t => string" - }, - { - "id": "Stdlib.Symbol.asyncIterator", - "kind": "value", - "name": "asyncIterator", - "docstrings": [ - "`asyncIterator` is the well-known symbol used by asynchronous iterables.\n\nSee [`Symbol.asyncIterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator) on MDN." - ], - "signature": "let asyncIterator: t" - }, - { - "id": "Stdlib.Symbol.hasInstance", - "kind": "value", - "name": "hasInstance", - "docstrings": [ - "`hasInstance` is used by custom `instanceof` checks.\n\nSee [`Symbol.hasInstance`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance) on MDN." - ], - "signature": "let hasInstance: t" - }, - { - "id": "Stdlib.Symbol.isConcatSpreadable", - "kind": "value", - "name": "isConcatSpreadable", - "docstrings": [ - "`isConcatSpreadable` controls whether objects are flattened when passed to `Array.concat`.\n\nSee [`Symbol.isConcatSpreadable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/isConcatSpreadable) on MDN." - ], - "signature": "let isConcatSpreadable: t" - }, - { - "id": "Stdlib.Symbol.iterator", - "kind": "value", - "name": "iterator", - "docstrings": [ - "`iterator` is returned by objects that can be iterated with `for..of`.\n\nSee [`Symbol.iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/iterator) on MDN." - ], - "signature": "let iterator: t" - }, - { - "id": "Stdlib.Symbol.match", - "kind": "value", - "name": "match", - "docstrings": [ - "`match` customises how values respond to `String.prototype.match`.\n\nSee [`Symbol.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/match) on MDN." - ], - "signature": "let match: t" - }, - { - "id": "Stdlib.Symbol.matchAll", - "kind": "value", - "name": "matchAll", - "docstrings": [ - "`matchAll` customises how values respond to `String.prototype.matchAll`.\n\nSee [`Symbol.matchAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/matchAll) on MDN." - ], - "signature": "let matchAll: t" - }, - { - "id": "Stdlib.Symbol.replace", - "kind": "value", - "name": "replace", - "docstrings": [ - "`replace` customises how values respond to `String.prototype.replace`.\n\nSee [`Symbol.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/replace) on MDN." - ], - "signature": "let replace: t" - }, - { - "id": "Stdlib.Symbol.search", - "kind": "value", - "name": "search", - "docstrings": [ - "`search` customises how values respond to `String.prototype.search`.\n\nSee [`Symbol.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) on MDN." - ], - "signature": "let search: t" - }, - { - "id": "Stdlib.Symbol.species", - "kind": "value", - "name": "species", - "docstrings": [ - "`species` lets constructors return a different derived constructor when methods create new instances.\n\nSee [`Symbol.species`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/species) on MDN." - ], - "signature": "let species: t" - }, - { - "id": "Stdlib.Symbol.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split` customises how values respond to `String.prototype.split`.\n\nSee [`Symbol.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/split) on MDN." - ], - "signature": "let split: t" - }, - { - "id": "Stdlib.Symbol.toPrimitive", - "kind": "value", - "name": "toPrimitive", - "docstrings": [ - "`toPrimitive` customises how objects convert to primitive values.\n\nSee [`Symbol.toPrimitive`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toPrimitive) on MDN." - ], - "signature": "let toPrimitive: t" - }, - { - "id": "Stdlib.Symbol.toStringTag", - "kind": "value", - "name": "toStringTag", - "docstrings": [ - "`toStringTag` customises the default tag shown by `Object.prototype.toString`.\n\nSee [`Symbol.toStringTag`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag) on MDN." - ], - "signature": "let toStringTag: t" - }, - { - "id": "Stdlib.Symbol.unscopables", - "kind": "value", - "name": "unscopables", - "docstrings": [ - "`unscopables` marks properties that should be skipped by `with`.\n\nSee [`Symbol.unscopables`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/unscopables) on MDN." - ], - "signature": "let unscopables: t" - }, - { - "id": "Stdlib.Symbol.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(symbol)` ignores the provided symbol and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/string": { - "id": "Stdlib.String", - "name": "String", - "docstrings": [ - "Functions for interacting with JavaScript strings.\nSee: [`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)." - ], - "items": [ - { - "id": "Stdlib.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a string." - ], - "signature": "type t = string" - }, - { - "id": "Stdlib.String.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nString.make(3.5) == \"3.5\"\nString.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => string" - }, - { - "id": "Stdlib.String.fromCharCode", - "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to\nthat number, `n` ranges from 0 to 65535. If out of range, the lower 16 bits of\nthe value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as\n`fromCharCode(0xF63A)`.\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nString.fromCharCode(65) == \"A\"\nString.fromCharCode(0x3c8) == `ψ`\nString.fromCharCode(0xd55c) == `한`\nString.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => string" - }, - { - "id": "Stdlib.String.fromCharCodeMany", - "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`.\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nString.fromCharCodeMany([189, 43, 190, 61]) == \"½+¾=\"\nString.fromCharCodeMany([65, 66, 67]) == \"ABC\"\n```" - ], - "signature": "let fromCharCodeMany: array => string" - }, - { - "id": "Stdlib.String.fromCodePoint", - "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point.\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint) on MDN.\n\n## Examples\n\n```rescript\nString.fromCodePoint(65) == \"A\"\nString.fromCodePoint(0x3c8) == `ψ`\nString.fromCodePoint(0xd55c) == `한`\nString.fromCodePoint(0x1f63a) == `😺`\n```\n\n## Exceptions\n\n- `RangeError`: If the number is not a valid code point, like `fromCharCode(-5)`." - ], - "signature": "let fromCodePoint: int => string" - }, - { - "id": "Stdlib.String.fromCodePointMany", - "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint) on MDN.\n\n## Examples\n\n```rescript\nString.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```\n\n## Exceptions\n\n- `RangeError`: If one of the number is not a valid code point, like\n `fromCharCode([1, -5])`." - ], - "signature": "let fromCodePointMany: array => string" - }, - { - "id": "Stdlib.String.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(str1, str2)` checks if two strings are equal.\n\n## Examples\n\n```rescript\nString.equal(\"hello\", \"hello\") == true\nString.equal(\"hello\", \"world\") == false\nString.equal(\"\", \"\") == true\n```" - ], - "signature": "let equal: (string, string) => bool" - }, - { - "id": "Stdlib.String.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(str1, str2)` compares two strings, returns an `Ordering.t` value.\n\n## Examples\n\n```rescript\nString.compare(\"hello\", \"hello\") == Ordering.equal\nString.compare(\"apple\", \"banana\") == Ordering.less\nString.compare(\"zebra\", \"apple\") == Ordering.greater\n```" - ], - "signature": "let compare: (string, string) => Ordering.t" - }, - { - "id": "Stdlib.String.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(str)` returns the length of the given `string`.\nSee [`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length) on MDN.\n\n## Examples\n\n```rescript\nString.length(\"abcd\") == 4\n```" - ], - "signature": "let length: string => int" - }, - { - "id": "Stdlib.String.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(str, index)` returns an `option` at the given `index` number. If\n`index` is out of range, this function returns `None`.\n\n## Examples\n\n```rescript\nString.get(\"ReScript\", 0) == Some(\"R\")\nString.get(\"Hello\", 4) == Some(\"o\")\nString.get(`JS`, 4) == None\n```" - ], - "signature": "let get: (string, int) => option" - }, - { - "id": "Stdlib.String.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(str, index)` returns an `string` at the given `index` number.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `string`.\n\nUse `String.getUnsafe` only when you are sure the `index` exists.\n## Examples\n\n```rescript\nString.getUnsafe(\"ReScript\", 0) == \"R\"\nString.getUnsafe(\"Hello\", 4) == \"o\"\n```" - ], - "signature": "let getUnsafe: (string, int) => string" - }, - { - "id": "Stdlib.String.charAt", - "kind": "value", - "name": "charAt", - "docstrings": [ - "`charAt(str, index)` gets the character at `index` within string `str`. If\n`index` is negative or greater than the length of `str`, it returns the empty\nstring. If the string contains characters outside the range \\\\u0000-\\\\uffff, it\nwill return the first 16-bit value at that position in the string.\nSee [`String.charAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt) on MDN.\n\n## Examples\n\n```rescript\nString.charAt(\"ReScript\", 0) == \"R\"\nString.charAt(\"Hello\", 12) == \"\"\nString.charAt(`JS`, 5) == \"\"\n```" - ], - "signature": "let charAt: (string, int) => string" - }, - { - "id": "Stdlib.String.charCodeAt", - "kind": "value", - "name": "charCodeAt", - "docstrings": [ - "`charCodeAt(str, index)` returns the character code at position `index` in\nstring `str` the result is in the range 0-65535, unlike `codePointAt`, so it\nwill not work correctly for characters with code points greater than or equal\nto 0x10000.\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt) on MDN.\n\n## Examples\n\n```rescript\nString.charCodeAt(`😺`, 0) == Some(0xd83d)\nString.charCodeAt(\"\", 0) == None\nString.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" - ], - "signature": "let charCodeAt: (string, int) => option" - }, - { - "id": "Stdlib.String.charCodeAtUnsafe", - "kind": "value", - "name": "charCodeAtUnsafe", - "docstrings": [ - "`charCodeAtUnsafe(str, index)` returns the character code at position `index` in\nstring `str` the result is in the range 0-65535, unlike `codePointAt`, so it\nwill not work correctly for characters with code points greater than or equal\nto 0x10000.\nBeware: If the index is out of range, it will return `NaN` which is not actually a valid int.\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt) on MDN.\n\n## Examples\n\n```rescript\nString.charCodeAtUnsafe(`😺`, 0) == 0xd83d\nString.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" - ], - "signature": "let charCodeAtUnsafe: (string, int) => int" - }, - { - "id": "Stdlib.String.codePointAt", - "kind": "value", - "name": "codePointAt", - "docstrings": [ - "`codePointAt(str, index)` returns the code point at position `index` within\nstring `str` as a `Some(value)`. The return value handles code points greater\nthan or equal to 0x10000. If there is no code point at the given position, the\nfunction returns `None`.\nSee [`String.codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) on MDN.\n\n## Examples\n\n```rescript\nString.codePointAt(`¿😺?`, 1) == Some(0x1f63a)\nString.codePointAt(\"abc\", 5) == None\n```" - ], - "signature": "let codePointAt: (string, int) => option" - }, - { - "id": "Stdlib.String.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(original, append)` returns a new `string` with `append` added after\n`original`.\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat) on MDN.\n\n## Examples\n\n```rescript\nString.concat(\"cow\", \"bell\") == \"cowbell\"\nString.concat(\"Re\", \"Script\") == \"ReScript\"\n```" - ], - "signature": "let concat: (string, string) => string" - }, - { - "id": "Stdlib.String.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(original, arr)` returns a new `string` consisting of each item of an\narray of strings added to the `original` string.\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat) on MDN.\n\n## Examples\n\n```rescript\nString.concatMany(\"1st\", [\"2nd\", \"3rd\", \"4th\"]) == \"1st2nd3rd4th\"\n```" - ], - "signature": "let concatMany: (string, array) => string" - }, - { - "id": "Stdlib.String.endsWith", - "kind": "value", - "name": "endsWith", - "docstrings": [ - "`endsWith(str, substr)` returns `true` if the `str` ends with `substr`, `false`\notherwise.\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith) on MDN.\n\n## Examples\n\n```rescript\nString.endsWith(\"BuckleScript\", \"Script\") == true\nString.endsWith(\"BuckleShoes\", \"Script\") == false\n```" - ], - "signature": "let endsWith: (string, string) => bool" - }, - { - "id": "Stdlib.String.endsWithFrom", - "kind": "value", - "name": "endsWithFrom", - "docstrings": [ - "`endsWithFrom(str, ending, len)` returns `true` if the first len characters of\n`str` end with `ending`, `false` otherwise. If `len` is greater than or equal\nto the length of `str`, then it works like `endsWith`.\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith) on MDN.\n\n## Examples\n\n```rescript\nString.endsWithFrom(\"abcd\", \"cd\", 4) == true\nString.endsWithFrom(\"abcde\", \"cd\", 3) == false\nString.endsWithFrom(\"abcde\", \"cde\", 99) == true\nString.endsWithFrom(\"example.dat\", \"ple\", 7) == true\n```" - ], - "signature": "let endsWithFrom: (string, string, int) => bool" - }, - { - "id": "Stdlib.String.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "`includes(str, searchValue)` returns `true` if `searchValue` is found anywhere\nwithin `str`, `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includes(\"programmer\", \"gram\") == true\nString.includes(\"programmer\", \"er\") == true\nString.includes(\"programmer\", \"pro\") == true\nString.includes(\"programmer.dat\", \"xyz\") == false\n```" - ], - "signature": "let includes: (string, string) => bool" - }, - { - "id": "Stdlib.String.includesFrom", - "kind": "value", - "name": "includesFrom", - "docstrings": [ - "`includesFrom(str, searchValue, start)` returns `true` if `searchValue` is found\nanywhere within `str` starting at character number `start` (where 0 is the\nfirst character), `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includesFrom(\"programmer\", \"gram\", 1) == true\nString.includesFrom(\"programmer\", \"gram\", 4) == false\nString.includesFrom(`대한민국`, `한`, 1) == true\n```" - ], - "signature": "let includesFrom: (string, string, int) => bool" - }, - { - "id": "Stdlib.String.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "`indexOf(str, searchValue)` returns the position at which `searchValue` was\nfirst found within `str`, or `-1` if `searchValue` is not in `str`.\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) on MDN.\n\n## Examples\n\n```rescript\nString.indexOf(\"bookseller\", \"ok\") == 2\nString.indexOf(\"bookseller\", \"sell\") == 4\nString.indexOf(\"beekeeper\", \"ee\") == 1\nString.indexOf(\"bookseller\", \"xyz\") == -1\n```" - ], - "signature": "let indexOf: (string, string) => int" - }, - { - "id": "Stdlib.String.indexOfOpt", - "kind": "value", - "name": "indexOfOpt", - "docstrings": [ - "`indexOfOpt(str, searchValue)`. Like `indexOf`, but return an `option`.\n\n## Examples\n\n```rescript\nString.indexOfOpt(\"bookseller\", \"ok\") == Some(2)\nString.indexOfOpt(\"bookseller\", \"xyz\") == None\n```" - ], - "signature": "let indexOfOpt: (string, string) => option" - }, - { - "id": "Stdlib.String.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "`indexOfFrom(str, searchValue, start)` returns the position at which\n`searchValue` was found within `str` starting at character position `start`, or\n`-1` if `searchValue` is not found in that portion of `str`. The return value is\nrelative to the beginning of the string, no matter where the search started\nfrom.\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) on MDN.\n\n## Examples\n\n```rescript\nString.indexOfFrom(\"bookseller\", \"ok\", 1) == 2\nString.indexOfFrom(\"bookseller\", \"sell\", 2) == 4\nString.indexOfFrom(\"bookseller\", \"sell\", 5) == -1\n```" - ], - "signature": "let indexOfFrom: (string, string, int) => int" - }, - { - "id": "Stdlib.String.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(str, searchValue)` returns the position of the last occurrence of\n`searchValue` within `str`, searching backwards from the end of the string.\nReturns `-1` if `searchValue` is not in `str`. The return value is always\nrelative to the beginning of the string.\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\nString.lastIndexOf(\"bookseller\", \"ok\") == 2\nString.lastIndexOf(\"beekeeper\", \"ee\") == 4\nString.lastIndexOf(\"abcdefg\", \"xyz\") == -1\n```" - ], - "signature": "let lastIndexOf: (string, string) => int" - }, - { - "id": "Stdlib.String.lastIndexOfOpt", - "kind": "value", - "name": "lastIndexOfOpt", - "docstrings": [ - "`lastIndexOfOpt(str, searchValue)`. Like `lastIndexOfOpt`, but return an\n`option`.\n\n## Examples\n\n```rescript\nString.lastIndexOfOpt(\"bookseller\", \"ok\") == Some(2)\nString.lastIndexOfOpt(\"beekeeper\", \"ee\") == Some(4)\nString.lastIndexOfOpt(\"abcdefg\", \"xyz\") == None\n```" - ], - "signature": "let lastIndexOfOpt: (string, string) => option" - }, - { - "id": "Stdlib.String.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "`lastIndexOfFrom(str, searchValue, start)` returns the position of the last\noccurrence of `searchValue` within `str`, searching backwards from the given\nstart position. Returns `-1` if `searchValue` is not in `str`. The return value\nis always relative to the beginning of the string.\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\nString.lastIndexOfFrom(\"bookseller\", \"ok\", 6) == 2\nString.lastIndexOfFrom(\"beekeeper\", \"ee\", 8) == 4\nString.lastIndexOfFrom(\"beekeeper\", \"ee\", 3) == 1\nString.lastIndexOfFrom(\"abcdefg\", \"xyz\", 4) == -1\n```" - ], - "signature": "let lastIndexOfFrom: (string, string, int) => int" - }, - { - "id": "Stdlib.String.match", - "kind": "value", - "name": "match", - "docstrings": [ - "`match(str, regexp)` matches a `string` against the given `regexp`. If there is\nno match, it returns `None`. For regular expressions without the g modifier, if\nthere is a match, the return value is `Some(array)` where the array contains:\n- The entire matched string\n- Any capture groups if the regexp had parentheses\n For regular expressions with the g modifier, a matched expression returns\n `Some(array)` with all the matched substrings and no capture groups.\n See [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match) on MDN.\n\n## Examples\n\n```rescript\nString.match(\"The better bats\", /b[aeiou]t/) == Some([Some(\"bet\")])\nString.match(\"The better bats\", /b[aeiou]t/g) == Some([Some(\"bet\"), Some(\"bat\")])\nString.match(\"Today is 2018-04-05.\", /(\\d+)-(\\d+)-(\\d+)/) ==\n Some([Some(\"2018-04-05\"), Some(\"2018\"), Some(\"04\"), Some(\"05\")])\nString.match(\"The optional example\", /(foo)?(example)/) ==\n Some([Some(\"example\"), None, Some(\"example\")])\nString.match(\"The large container.\", /b[aeiou]g/) == None\n```" - ], - "signature": "let match: (string, RegExp.t) => option<\\\"RegExp.Result\".t>" - }, - { - "id": "Stdlib.String.normalize", - "kind": "value", - "name": "normalize", - "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\\\u00e3 or the combination of a lower case letter A\n\\\\u0061 and a combining tilde \\\\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\nSee also [Unicode technical report \\#15](https://unicode.org/reports/tr15/) for details.\n\n## Examples\n\n```rescript\nlet string1 = \"\\u00F1\"\nlet string2 = \"\\u006E\\u0303\"\n\nassert(string1 != string2) // true\nString.normalize(string1) == String.normalize(string2)\n```" - ], - "signature": "let normalize: string => string" - }, - { - "id": "Stdlib.String.normalizeForm", - "kind": "type", - "name": "normalizeForm", - "docstrings": [ - "`normalizeByForm(str, form)` returns the normalized Unicode string using the\nspecified form of normalization, which may be one of:\n- \"NFC\" — Normalization Form Canonical Composition.\n- \"NFD\" — Normalization Form Canonical Decomposition.\n- \"NFKC\" — Normalization Form Compatibility Composition.\n- \"NFKD\" — Normalization Form Compatibility Decomposition.\n See [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\n See also [Unicode technical report \\#15](https://unicode.org/reports/tr15/) for\n details.\n\n## Examples\n\n```rescript\nlet string1 = \"\\uFB00\"\nlet string2 = \"\\u0066\\u0066\"\nConsole.log(string1 == string2) // false\n\nlet normalizeString1 = String.normalizeByForm(string1, #NFKD)\nlet normalizeString2 = String.normalizeByForm(string2, #NFKD)\nConsole.log(normalizeString1 == normalizeString2) // true\n```" - ], - "signature": "type normalizeForm = [#NFC | #NFD | #NFKC | #NFKD]" - }, - { - "id": "Stdlib.String.normalizeByForm", - "kind": "value", - "name": "normalizeByForm", - "docstrings": [], - "signature": "let normalizeByForm: (string, normalizeForm) => string" - }, - { - "id": "Stdlib.String.repeat", - "kind": "value", - "name": "repeat", - "docstrings": [ - "`repeat(str, n)` returns a `string` that consists of `n` repetitions of `str`.\nSee [`String.repeat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat) on MDN.\n\n## Examples\n\n```rescript\nString.repeat(\"ha\", 3) == \"hahaha\"\nString.repeat(\"empty\", 0) == \"\"\n```\n\n## Exceptions\n\n- `RangeError`: if `n` is negative." - ], - "signature": "let repeat: (string, int) => string" - }, - { - "id": "Stdlib.String.replace", - "kind": "value", - "name": "replace", - "docstrings": [ - "`replace(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with the first matching instance of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nString.replace(\"old string\", \"old\", \"new\") == \"new string\"\nString.replace(\"the cat and the dog\", \"the\", \"this\") == \"this cat and the dog\"\n```" - ], - "signature": "let replace: (string, string, string) => string" - }, - { - "id": "Stdlib.String.replaceRegExp", - "kind": "value", - "name": "replaceRegExp", - "docstrings": [ - "`replaceRegExp(str, regex, replacement)` returns a new `string` where\noccurrences matching regex have been replaced by `replacement`.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nString.replaceRegExp(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nString.replaceRegExp(\"Juan Fulano\", /(\\w+) (\\w+)/, \"$2, $1\") == \"Fulano, Juan\"\n```" - ], - "signature": "let replaceRegExp: (string, RegExp.t, string) => string" - }, - { - "id": "Stdlib.String.replaceAll", - "kind": "value", - "name": "replaceAll", - "docstrings": [ - "`replaceAll(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with all matching instances of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\nSee [`String.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) on MDN.\n\n## Examples\n\n```rescript\nString.replaceAll(\"old old string\", \"old\", \"new\") == \"new new string\"\nString.replaceAll(\"the cat and the dog\", \"the\", \"this\") == \"this cat and this dog\"\n```" - ], - "signature": "let replaceAll: (string, string, string) => string" - }, - { - "id": "Stdlib.String.replaceAllRegExp", - "kind": "value", - "name": "replaceAllRegExp", - "docstrings": [ - "`replaceAllRegExp(str, regex, replacement)` returns a new `string` where\nall occurrences matching regex have been replaced by `replacement`.\nThe pattern must include the global (`g`) flag or a runtime TypeError will be thrown.\nSee [`String.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) on MDN.\n\n## Examples\n\n```rescript\nString.replaceAllRegExp(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nString.replaceAllRegExp(\"aabbcc\", /b/g, \".\") == \"aa..cc\"\n```" - ], - "signature": "let replaceAllRegExp: (string, RegExp.t, string) => string" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy0", - "kind": "value", - "name": "unsafeReplaceRegExpBy0", - "docstrings": [ - "`unsafeReplaceRegExpBy0(str, regex, f)` returns a new `string` with some or all\nmatches of a pattern with no capturing parentheses replaced by the value\nreturned from the given function. The function receives as its parameters the\nmatched string, the offset at which the match begins, and the whole string being\nmatched.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (~match, ~offset as _, ~input as _) => String.toUpperCase(match)\nString.unsafeReplaceRegExpBy0(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy0: (\n string,\n RegExp.t,\n (~match: string, ~offset: int, ~input: string) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy1", - "kind": "value", - "name": "unsafeReplaceRegExpBy1", - "docstrings": [ - "`unsafeReplaceRegExpBy1(str, regexp, f)`. Like `unsafeReplaceRegExpBy0`, but `f`\nhas `group1` parameter.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (~match as _, ~group1, ~offset as _, ~input as _) => {\n group1 ++ \"41\"\n}\nString.unsafeReplaceRegExpBy1(str, re, matchFn) == \"Jony is 41\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy1: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy2", - "kind": "value", - "name": "unsafeReplaceRegExpBy2", - "docstrings": [ - "`unsafeReplaceRegExpBy2(str, regexp, f)`. Like `unsafeReplaceRegExpBy1`, but `f`\nhas two group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (~match as _, ~group1, ~group2, ~offset as _, ~input as _) => {\n switch (Int.fromString(group1), Int.fromString(group2)) {\n | (Some(x), Some(y)) => Int.toString(x * y)\n | _ => \"???\"\n }\n}\nString.unsafeReplaceRegExpBy2(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy2: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy3", - "kind": "value", - "name": "unsafeReplaceRegExpBy3", - "docstrings": [ - "`unsafeReplaceRegExpBy3(str, regexp, f)`. Like `unsafeReplaceRegExpBy2`, but `f`\nhas three group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN." - ], - "signature": "let unsafeReplaceRegExpBy3: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~group3: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.replaceRegExpBy0Unsafe", - "kind": "value", - "name": "replaceRegExpBy0Unsafe", - "docstrings": [ - "`replaceRegExpBy0Unsafe(str, regex, f)` returns a new `string` with some or all\nmatches of a pattern with no capturing parentheses replaced by the value\nreturned from the given function. The function receives as its parameters the\nmatched string, the offset at which the match begins, and the whole string being\nmatched.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (~match, ~offset as _, ~input as _) => String.toUpperCase(match)\nString.replaceRegExpBy0Unsafe(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" - ], - "signature": "let replaceRegExpBy0Unsafe: (\n string,\n RegExp.t,\n (~match: string, ~offset: int, ~input: string) => string,\n) => string" - }, - { - "id": "Stdlib.String.replaceRegExpBy1Unsafe", - "kind": "value", - "name": "replaceRegExpBy1Unsafe", - "docstrings": [ - "`replaceRegExpBy1Unsafe(str, regexp, f)`. Like `replaceRegExpBy0Unsafe`, but `f`\nhas `group1` parameter.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (~match as _, ~group1, ~offset as _, ~input as _) => {\n group1 ++ \"41\"\n}\nString.replaceRegExpBy1Unsafe(str, re, matchFn) == \"Jony is 41\"\n```" - ], - "signature": "let replaceRegExpBy1Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" - }, - { - "id": "Stdlib.String.replaceRegExpBy2Unsafe", - "kind": "value", - "name": "replaceRegExpBy2Unsafe", - "docstrings": [ - "`replaceRegExpBy2Unsafe(str, regexp, f)`. Like `replaceRegExpBy1Unsafe`, but `f`\nhas two group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (~match as _, ~group1, ~group2, ~offset as _, ~input as _) => {\n switch (Int.fromString(group1), Int.fromString(group2)) {\n | (Some(x), Some(y)) => Int.toString(x * y)\n | _ => \"???\"\n }\n}\nString.replaceRegExpBy2Unsafe(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let replaceRegExpBy2Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" - }, - { - "id": "Stdlib.String.replaceRegExpBy3Unsafe", - "kind": "value", - "name": "replaceRegExpBy3Unsafe", - "docstrings": [ - "`replaceRegExpBy3Unsafe(str, regexp, f)`. Like `replaceRegExpBy2Unsafe`, but `f`\nhas three group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN." - ], - "signature": "let replaceRegExpBy3Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~group3: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" - }, - { - "id": "Stdlib.String.search", - "kind": "value", - "name": "search", - "docstrings": [ - "`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search) on MDN.\n\n## Examples\n\n```rescript\nString.search(\"testing 1 2 3\", /\\d+/) == 8\nString.search(\"no numbers\", /\\d+/) == -1\n```" - ], - "signature": "let search: (string, RegExp.t) => int" - }, - { - "id": "Stdlib.String.searchOpt", - "kind": "value", - "name": "searchOpt", - "docstrings": [ - "`searchOpt(str, regexp)`. Like `search`, but return an `option`.\n\n## Examples\n\n```rescript\nString.searchOpt(\"testing 1 2 3\", /\\d+/) == Some(8)\nString.searchOpt(\"no numbers\", /\\d+/) == None\n```" - ], - "signature": "let searchOpt: (string, RegExp.t) => option" - }, - { - "id": "Stdlib.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(str)` returns `true` if the string is empty (has zero length), \n`false` otherwise.\n\n## Examples\n\n```rescript\nString.isEmpty(\"\") == true\nString.isEmpty(\"hello\") == false\nString.isEmpty(\" \") == false\n```" - ], - "signature": "let isEmpty: string => bool" - }, - { - "id": "Stdlib.String.capitalize", - "kind": "value", - "name": "capitalize", - "docstrings": [ - "`capitalize(str)` returns a new string with the first character converted to \nuppercase and the remaining characters unchanged. If the string is empty, \nreturns the empty string.\n\n## Examples\n\n```rescript\nString.capitalize(\"hello\") == \"Hello\"\nString.capitalize(\"HELLO\") == \"HELLO\"\nString.capitalize(\"hello world\") == \"Hello world\"\nString.capitalize(\"\") == \"\"\n```" - ], - "signature": "let capitalize: string => string" - }, - { - "id": "Stdlib.String.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```" - ], - "signature": "let slice: (string, ~start: int, ~end: int=?) => string" - }, - { - "id": "Stdlib.String.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```" - ], - "signature": "let sliceToEnd: (string, ~start: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nString.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nString.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nString.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```" - ], - "signature": "let split: (string, string) => array" - }, - { - "id": "Stdlib.String.splitAtMost", - "kind": "value", - "name": "splitAtMost", - "docstrings": [ - "`splitAtMost(str, delimiter, ~limit)` splits the given `str` at every\noccurrence of `delimiter` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings,\nthe array will contain all the substrings.\n\n## Examples\n\n```rescript\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=3) == [\"ant\", \"bee\", \"cat\"]\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=0) == []\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=9) == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```" - ], - "signature": "let splitAtMost: (string, string, ~limit: int) => array" - }, - { - "id": "Stdlib.String.splitByRegExp", - "kind": "value", - "name": "splitByRegExp", - "docstrings": [ - "`splitByRegExp(str, regexp)` splits the given `str` at every occurrence of\n`regexp` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExp(\"Jan,Feb,Mar\", /,/) == [Some(\"Jan\"), Some(\"Feb\"), Some(\"Mar\")]\n```" - ], - "signature": "let splitByRegExp: (string, RegExp.t) => array>" - }, - { - "id": "Stdlib.String.splitByRegExpAtMost", - "kind": "value", - "name": "splitByRegExpAtMost", - "docstrings": [ - "`splitByRegExpAtMost(str, regexp, ~limit)` splits the given `str` at every\noccurrence of `regexp` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings, the\narray will contain all the substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExpAtMost(\"Hello World. How are you doing?\", / /, ~limit=3) == [\n Some(\"Hello\"),\n Some(\"World.\"),\n Some(\"How\"),\n ]\n```" - ], - "signature": "let splitByRegExpAtMost: (string, RegExp.t, ~limit: int) => array>" - }, - { - "id": "Stdlib.String.startsWith", - "kind": "value", - "name": "startsWith", - "docstrings": [ - "`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```" - ], - "signature": "let startsWith: (string, string) => bool" - }, - { - "id": "Stdlib.String.startsWithFrom", - "kind": "value", - "name": "startsWithFrom", - "docstrings": [ - "`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```" - ], - "signature": "let startsWithFrom: (string, string, int) => bool" - }, - { - "id": "Stdlib.String.substring", - "kind": "value", - "name": "substring", - "docstrings": [ - "`substring(str, ~start, ~end)` returns characters `start` up to but not\nincluding end from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `end` is zero or negative, the empty string is returned.\n- If `start` is greater than `end`, the `start` and `end` points are swapped.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substring(\"playground\", ~start=3, ~end=6) == \"ygr\"\nString.substring(\"playground\", ~start=6, ~end=3) == \"ygr\"\nString.substring(\"playground\", ~start=4, ~end=12) == \"ground\"\nString.substring(\"playground\", ~start=4) == \"ground\"\nString.substring(\"Hello World\", ~start=6) == \"World\"\n```" - ], - "signature": "let substring: (string, ~start: int, ~end: int=?) => string" - }, - { - "id": "Stdlib.String.substringToEnd", - "kind": "value", - "name": "substringToEnd", - "docstrings": [ - "`substringToEnd(str, ~start)` returns the substring of `str` from position\n`start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string\n is returned.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substringToEnd(\"playground\", ~start=4) == \"ground\"\nString.substringToEnd(\"playground\", ~start=-3) == \"playground\"\nString.substringToEnd(\"playground\", ~start=12) == \"\"\n```" - ], - "signature": "let substringToEnd: (string, ~start: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.toLowerCase", - "kind": "value", - "name": "toLowerCase", - "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms, one when it is the last\ncharacter in a string and another when it is not.\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase) on MDN.\n\n## Examples\n\n```rescript\nString.toLowerCase(\"ABC\") == \"abc\"\nString.toLowerCase(`ΣΠ`) == `σπ`\nString.toLowerCase(`ΠΣ`) == `πς`\n```" - ], - "signature": "let toLowerCase: string => string" - }, - { - "id": "Stdlib.String.toLocaleLowerCase", - "kind": "value", - "name": "toLocaleLowerCase", - "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase) on MDN." - ], - "signature": "let toLocaleLowerCase: string => string" - }, - { - "id": "Stdlib.String.toUpperCase", - "kind": "value", - "name": "toUpperCase", - "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result, for example the German ß\ncapitalizes to two Ses in a row.\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) on MDN.\n\n## Examples\n\n```rescript\nString.toUpperCase(\"abc\") == \"ABC\"\nString.toUpperCase(`Straße`) == `STRASSE`\nString.toUpperCase(`πς`) == `ΠΣ`\n```" - ], - "signature": "let toUpperCase: string => string" - }, - { - "id": "Stdlib.String.toLocaleUpperCase", - "kind": "value", - "name": "toLocaleUpperCase", - "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\nSee [`String.toLocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase) on MDN." - ], - "signature": "let toLocaleUpperCase: string => string" - }, - { - "id": "Stdlib.String.trim", - "kind": "value", - "name": "trim", - "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim) on MDN.\n\n## Examples\n\n```rescript\nString.trim(\" abc def \") == \"abc def\"\nString.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" - ], - "signature": "let trim: string => string" - }, - { - "id": "Stdlib.String.trimStart", - "kind": "value", - "name": "trimStart", - "docstrings": [ - "`trimStart(str)` returns a string that is `str` with whitespace stripped from\nthe beginning of a string. Internal whitespace is not removed.\nSee [`String.trimStart`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimStart) on MDN.\n\n## Examples\n\n```rescript\nString.trimStart(\" Hello world! \") == \"Hello world! \"\nString.trimStart(\" Hello world! \") == \"Hello world! \"\n```" - ], - "signature": "let trimStart: string => string" - }, - { - "id": "Stdlib.String.trimEnd", - "kind": "value", - "name": "trimEnd", - "docstrings": [ - "`trimEnd(str)` returns a string that is `str` with whitespace stripped from the\nend of a string. Internal whitespace is not removed.\nSee [`String.trimEnd`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd) on MDN.\n\n## Examples\n\n```rescript\nString.trimEnd(\" Hello world! \") == \" Hello world!\"\nString.trimEnd(\" Hello world! \") == \" Hello world!\"\n```" - ], - "signature": "let trimEnd: string => string" - }, - { - "id": "Stdlib.String.padStart", - "kind": "value", - "name": "padStart", - "docstrings": [ - "`padStart(str, n, padStr)` returns a string that has been padded with `padStr`\n(multiple times, if needed) until the resulting string reaches the given `n`\nlength. The padding is applied from the start of the current string.\nSee [`String.padStart`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart) on MDN.\n\n## Examples\n\n```rescript\nString.padStart(\"abc\", 5, \" \") == \" abc\"\nString.padStart(\"abc\", 6, \"123465\") == \"123abc\"\n```" - ], - "signature": "let padStart: (string, int, string) => string" - }, - { - "id": "Stdlib.String.padEnd", - "kind": "value", - "name": "padEnd", - "docstrings": [ - "`padEnd(str, n, padStr)` returns a string that has been padded with `padStr`\n(multiple times, if needed) until the resulting string reaches the given `n`\nlength. The padding is applied from the end of the current string.\nSee [`String.padEnd`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd) on MDN.\n\n## Examples\n\n```rescript\nString.padEnd(\"Hello\", 10, \".\") == \"Hello.....\"\nString.padEnd(\"abc\", 1, \"\") == \"abc\"\n```" - ], - "signature": "let padEnd: (string, int, string) => string" - }, - { - "id": "Stdlib.String.localeCompare", - "kind": "value", - "name": "localeCompare", - "docstrings": [ - "`localeCompare(referenceStr, compareStr)` returns a float than indicatings\nwhether a reference string comes before or after, or is the same as the given\nstring in sort order. If `referenceStr` occurs before `compareStr` positive if\nthe `referenceStr` occurs after `compareStr`, `0` if they are equivalent.\nDo not rely on exact return values of `-1` or `1`\nSee [`String.localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare) on MDN.\n\n## Examples\n\n```rescript\nString.localeCompare(\"a\", \"c\") < 0.0 == true\nString.localeCompare(\"a\", \"a\") == 0.0\n```" - ], - "signature": "let localeCompare: (string, string) => float" - }, - { - "id": "Stdlib.String.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(string)` ignores the provided string and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: string => unit" - }, - { - "id": "Stdlib.String.getSymbolUnsafe", - "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [ - "`getSymbolUnsafe(str, symbol)` returns the value of the symbol property of a string.\n\n## Examples\n\n```rescript\nlet it: Iterator.t = (\"foo\"->String.getSymbolUnsafe(Symbol.iterator))()\nNullable.make(it)->Nullable.isNullable == false\n```" - ], - "signature": "let getSymbolUnsafe: (string, Symbol.t) => 'a" - } - ] - }, - "stdlib/result": { - "id": "Stdlib.Result", - "name": "Result", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Result.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Result types are really useful to describe the result of a certain operation\n without relying on exceptions or `option` types.\n\n This module gives you useful utilities to create and combine `Result` data." - ], - "signature": "type t<'res, 'err> = result<'res, 'err> =\n | Ok('res)\n | Error('err)" - }, - { - "id": "Stdlib.Result.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getExn(Result.Ok(42)) == 42\n \n switch Result.getExn(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getExn(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```" - ], - "signature": "let getExn: (result<'a, 'b>, ~message: string=?) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Result.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getOrThrow(Result.Ok(42)) == 42\n \n switch Result.getOrThrow(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getOrThrow(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```" - ], - "signature": "let getOrThrow: (result<'a, 'b>, ~message: string=?) => 'a" - }, - { - "id": "Stdlib.Result.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(res, default, f)`: When res is `Ok(n)`, returns `f(n)`, otherwise `default`.\n\n## Examples\n\n```rescript\nlet ok = Ok(42)\nResult.mapOr(ok, 0, x => x / 2) == 21\n\nlet error = Error(\"Invalid data\")\nResult.mapOr(error, 0, x => x / 2) == 0\n```" - ], - "signature": "let mapOr: (result<'a, 'c>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Result.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (result<'a, 'c>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Result.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(res, f)`: When res is `Ok(n)`, returns `Ok(f(n))`. Otherwise returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns an\nordinary value.\n\n## Examples\n\n```rescript\nlet f = x => sqrt(Int.toFloat(x))\n\nResult.map(Ok(64), f) == Ok(8.0)\n\nResult.map(Error(\"Invalid data\"), f) == Error(\"Invalid data\")\n```" - ], - "signature": "let map: (result<'a, 'c>, 'a => 'b) => result<'b, 'c>" - }, - { - "id": "Stdlib.Result.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(res, f)`: When res is `Ok(n)`, returns `f(n)`. Otherwise, returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns a\n`Result`.\n\n## Examples\n\n```rescript\nlet recip = x =>\n if x !== 0.0 {\n Ok(1.0 /. x)\n } else {\n Error(\"Divide by zero\")\n }\n\nResult.flatMap(Ok(2.0), recip) == Ok(0.5)\n\nResult.flatMap(Ok(0.0), recip) == Error(\"Divide by zero\")\n\nResult.flatMap(Error(\"Already bad\"), recip) == Error(\"Already bad\")\n```" - ], - "signature": "let flatMap: (result<'a, 'c>, 'a => result<'b, 'c>) => result<'b, 'c>" - }, - { - "id": "Stdlib.Result.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`, otherwise `default`\n\n## Examples\n\n```rescript\nResult.getOr(Ok(42), 0) == 42\n\nResult.getOr(Error(\"Invalid Data\"), 0) == 0\n```" - ], - "signature": "let getOr: (result<'a, 'b>, 'a) => 'a" - }, - { - "id": "Stdlib.Result.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (result<'a, 'b>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Result.isOk", - "kind": "value", - "name": "isOk", - "docstrings": [ - "`isOk(res)`: Returns `true` if `res` is of the form `Ok(n)`, `false` if it is the `Error(e)` variant." - ], - "signature": "let isOk: result<'a, 'b> => bool" - }, - { - "id": "Stdlib.Result.isError", - "kind": "value", - "name": "isError", - "docstrings": [ - "`isError(res)`: Returns `true` if `res` is of the form `Error(e)`, `false` if it is the `Ok(n)` variant." - ], - "signature": "let isError: result<'a, 'b> => bool" - }, - { - "id": "Stdlib.Result.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(res1, res2, eqOk, eqError)`: Determine if two `Result` variables are equal with\nrespect to equality functions. If `res1` and `res2` are of the form `Ok(n)`\nand `Ok(m)`, return the result of `eqOk(n, m)`. If one of `res1` and `res2` are of\nthe form `Error(e)`, return false If both `res1` and `res2` are of the form\n`Error(e)`, return the result of `eqError(e1, e2)`.\n\n## Examples\n\n```rescript\nlet good1 = Ok(42)\n\nlet good2 = Ok(32)\n\nlet bad1 = Error(\"invalid\")\n\nlet bad2 = Error(\"really invalid\")\n\nlet mod10equal = (a, b) => mod(a, 10) === mod(b, 10)\n\nResult.equal(good1, good2, mod10equal, String.equal) == true\n\nResult.equal(good1, bad1, mod10equal, String.equal) == false\n\nResult.equal(bad2, good2, mod10equal, String.equal) == false\n\nResult.equal(bad1, bad2, mod10equal, String.equal) == false\n```" - ], - "signature": "let equal: (\n result<'a, 'c>,\n result<'b, 'd>,\n ('a, 'b) => bool,\n ('c, 'd) => bool,\n) => bool" - }, - { - "id": "Stdlib.Result.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(res1, res2, cmpOk, cmpError)`: Compare two `Result` variables with respect to a\ncomparison function. The comparison function returns -1. if the first variable\nis \"less than\" the second, 0. if the two variables are equal, and 1. if the first\nis \"greater than\" the second.\n\nIf `res1` and `res2` are of the form `Ok(n)` and `Ok(m)`, return the result of\n`cmpOk(n, m)`. If `res1` is of the form `Error(e)` and `res2` of the form `Ok(n)`,\nreturn -1. (nothing is less than something) If `res1` is of the form `Ok(n)` and\n`res2` is of the form `Error(e)`, return 1. (something is greater than nothing) If\nboth `res1` and `res2` are of the form `Error(e)`, return cmpError(e1, e2).\n\n## Examples\n\n```rescript\nlet good1 = Ok(59)\n\nlet good2 = Ok(37)\n\nlet bad1 = Error(\"invalid\")\n\nlet bad2 = Error(\"really invalid\")\n\nlet mod10cmp = (a, b) => Int.compare(mod(a, 10), mod(b, 10))\n\nResult.compare(Ok(39), Ok(57), mod10cmp, String.compare) == 1.\n\nResult.compare(Ok(57), Ok(39), mod10cmp, String.compare) == -1.\n\nResult.compare(Ok(39), Error(\"y\"), mod10cmp, String.compare) == 1.\n\nResult.compare(Error(\"x\"), Ok(57), mod10cmp, String.compare) == -1.\n\nResult.compare(Error(\"x\"), Error(\"y\"), mod10cmp, String.compare) == -1.\n```" - ], - "signature": "let compare: (\n result<'a, 'c>,\n result<'b, 'd>,\n ('a, 'b) => Ordering.t,\n ('c, 'd) => Ordering.t,\n) => Ordering.t" - }, - { - "id": "Stdlib.Result.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(res, f)` runs the provided function `f` on the `Ok` value. If `res` is `Error`, nothing happens.\n\n## Examples\n\n```rescript\nResult.forEach(Ok(3), Console.log) // Logs \"3\", returns ()\nResult.forEach(Error(\"x\"), Console.log) // Does nothing, returns ()\n```" - ], - "signature": "let forEach: (result<'a, 'b>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Result.mapError", - "kind": "value", - "name": "mapError", - "docstrings": [ - "`mapError(r, f)` generates a new `result` by applying the function `f` to the `Error` value. If the source is `Ok`, return it as-is.\n\n## Examples\n\n```rescript\nlet format = n => `Error code: ${n->Int.toString}`\nResult.mapError(Error(14), format) == Error(\"Error code: 14\")\nResult.mapError(Ok(\"abc\"), format) == Ok(\"abc\")\n```" - ], - "signature": "let mapError: (result<'a, 'b>, 'b => 'c) => result<'a, 'c>" - }, - { - "id": "Stdlib.Result.all", - "kind": "value", - "name": "all", - "docstrings": [ - "`all(results)` returns a result of array if all options are Ok, otherwise returns Error.\n## Examples\n```rescript\nResult.all([Ok(1), Ok(2), Ok(3)]) == Ok([1, 2, 3])\nResult.all([Ok(1), Error(1)]) == Error(1)\n```" - ], - "signature": "let all: array> => result, 'b>" - }, - { - "id": "Stdlib.Result.all2", - "kind": "value", - "name": "all2", - "docstrings": [ - "`all2((r1, r2))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all2: (\n (result<'r1, 'e>, result<'r2, 'e>),\n) => result<('r1, 'r2), 'e>" - }, - { - "id": "Stdlib.Result.all3", - "kind": "value", - "name": "all3", - "docstrings": [ - "`all3((r1, r2, r3))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all3: (\n (result<'r1, 'e>, result<'r2, 'e>, result<'r3, 'e>),\n) => result<('r1, 'r2, 'r3), 'e>" - }, - { - "id": "Stdlib.Result.all4", - "kind": "value", - "name": "all4", - "docstrings": [ - "`all4((r1, r2, r3, r4))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all4: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4), 'e>" - }, - { - "id": "Stdlib.Result.all5", - "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((r1, r2, r3, r4, r5))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all5: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n result<'r5, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4, 'r5), 'e>" - }, - { - "id": "Stdlib.Result.all6", - "kind": "value", - "name": "all6", - "docstrings": [ - "`all6((r1, r2, r3, r4, r5, r6))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all6: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n result<'r5, 'e>,\n result<'r6, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4, 'r5, 'r6), 'e>" - }, - { - "id": "Stdlib.Result.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(result)` ignores the provided result and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: result<'res, 'err> => unit" - }, - { - "id": "Stdlib.Result.mapOkAsync", - "kind": "value", - "name": "mapOkAsync", - "docstrings": [ - "`mapOkAsync(res, f)`: Asynchronously maps over the Ok value of a Result. When `res` is `Ok(n)`, \napplies the async function `f` to `n` and wraps the result in `Ok`. \nWhen `res` is `Error`, returns the error unchanged.\n\n## Examples\n\n```rescript\n let square = x => x * x\n\n let result1 = await Result.mapOkAsync(Promise.resolve(Ok(4)), square)\n result1 == Ok(16)\n\n let result2 = await Result.mapOkAsync(\n Promise.resolve(Error(\"invalid\")),\n square,\n )\n result2 == Error(\"invalid\")\n```" - ], - "signature": "let mapOkAsync: (\n promise>,\n 'ok => 'mappedOk,\n) => promise>" - }, - { - "id": "Stdlib.Result.mapErrorAsync", - "kind": "value", - "name": "mapErrorAsync", - "docstrings": [ - "`mapErrorAsync(res, f)`: Asynchronously maps over the Error value of a Result. When `res` is `Error(e)`, \napplies the async function `f` to `e` and wraps the result in `Error`. \nWhen `res` is `Ok`, returns the ok value unchanged.\n\n## Examples\n\n```rescript\nlet formatError = e => `Error: ${e}`\n\nlet result1 = await Result.mapErrorAsync(Promise.resolve(Ok(42)), formatError)\nresult1 == Ok(42)\n\nlet result2 = await Result.mapErrorAsync(Promise.resolve(Error(\"invalid\")), formatError)\nresult2 == Error(\"Error: invalid\")\n```" - ], - "signature": "let mapErrorAsync: (\n promise>,\n 'error => 'mappedError,\n) => promise>" - }, - { - "id": "Stdlib.Result.flatMapOkAsync", - "kind": "value", - "name": "flatMapOkAsync", - "docstrings": [ - "`flatMapOkAsync(res, f)`: Asynchronously flat-maps over the Ok value of a Result. When `res` is `Ok(n)`, \napplies the async function `f` to `n` which returns a Promise of a Result. \nWhen `res` is `Error`, returns the error unchanged.\n\n## Examples\n\n```rescript\nlet asyncValidate = async x =>\n if x > 0 {\n Ok(x * 2)\n } else {\n Error(\"Must be positive\")\n }\n\nlet result1 = await Result.flatMapOkAsync(Promise.resolve(Ok(5)), asyncValidate)\nresult1 == Ok(10)\n\nlet result2 = await Result.flatMapOkAsync(\n Promise.resolve(Error(\"Already failed\")),\n asyncValidate,\n)\nresult2 == Error(\"Already failed\")\n```" - ], - "signature": "let flatMapOkAsync: (\n promise>,\n 'ok => promise>,\n) => promise>" - }, - { - "id": "Stdlib.Result.flatMapErrorAsync", - "kind": "value", - "name": "flatMapErrorAsync", - "docstrings": [ - "`flatMapErrorAsync(res, f)`: Asynchronously flat-maps over the Error value of a Result. When `res` is `Error(e)`, \napplies the async function `f` to `e` which returns a Promise of a Result. \nWhen `res` is `Ok`, returns the ok value unchanged.\n\n## Examples\n\n```rescript\nlet asyncRecover = async error =>\n if error === \"timeout\" {\n Ok(\"default\")\n } else {\n Error(error)\n }\n\nlet result1 = await Result.flatMapErrorAsync(\n Promise.resolve(Error(\"timeout\")),\n asyncRecover,\n)\nresult1 == Ok(\"default\")\n\nlet result2 = await Result.flatMapErrorAsync(\n Promise.resolve(Ok(\"default\")),\n asyncRecover,\n)\nresult2 == Ok(\"default\")\n```" - ], - "signature": "let flatMapErrorAsync: (\n promise>,\n 'error => promise>,\n) => promise>" - } - ] - }, - "stdlib/regexp": { - "id": "Stdlib.RegExp", - "name": "RegExp", - "docstrings": [ - "Functions for handling RegExp's in ReScript.\n\nSee [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) on MDN." - ], - "items": [ - { - "id": "Stdlib.RegExp.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an instantiated `RegExp`." - ], - "signature": "type t" - }, - { - "id": "Stdlib.RegExp.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(string)` creates a `RegExp.t` from the provided string. This can then be used to match on strings using `RegExp.exec`.\n\nSee [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n\n// Match 'foo' with case insensitive flag\nlet regexp = RegExp.fromString(\"foo\", ~flags=\"i\")\n\nswitch regexp->RegExp.exec(\"FOO\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"FOO\"\n}\n```" - ], - "signature": "let fromString: (string, ~flags: string=?) => t" - }, - { - "id": "Stdlib.RegExp.fromStringWithFlags", - "kind": "value", - "name": "fromStringWithFlags", - "docstrings": [ - "`fromStringWithFlags(string)` creates a `RegExp.t` from the provided string, using the provided `flags`. This can then be used to match on strings using `RegExp.exec`.\n\nSee [`RegExp parameters`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp#parameters) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```" - ], - "signature": "let fromStringWithFlags: (string, ~flags: string) => t", - "deprecated": "" - }, - { - "id": "Stdlib.RegExp.escape", - "kind": "value", - "name": "escape", - "docstrings": [ - "`escape(string)` escapes any potential regex syntax characters in a string.\n\nSee [`RegExp.escape`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/escape) on MDN.\n\n## Examples\n```rescript\nlet literal = \"foo[bar]\"\nlet regexp = literal->RegExp.escape->RegExp.fromString\nregexp->RegExp.test(\"foo[bar]\") == true\n```\n\n## Remark\n\nSince May 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let escape: string => string" - }, - { - "id": "Stdlib.RegExp.test", - "kind": "value", - "name": "test", - "docstrings": [ - "`test(regexp, string)` tests whether the provided `regexp` matches on the provided string.\n\nSee [`RegExp.test`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nif regexp->RegExp.test(\"ReScript is cool!\") {\n Console.log(\"Yay, there's a word in there.\")\n}\n```" - ], - "signature": "let test: (t, string) => bool" - }, - { - "id": "Stdlib.RegExp.exec", - "kind": "value", - "name": "exec", - "docstrings": [ - "`exec(regexp, string)` executes the provided regexp on the provided string, optionally returning a `RegExp.Result.t` if the regexp matches on the string.\n\nSee [`RegExp.exec`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```" - ], - "signature": "let exec: (t, string) => option" - }, - { - "id": "Stdlib.RegExp.lastIndex", - "kind": "value", - "name": "lastIndex", - "docstrings": [ - "`lastIndex(regexp)` returns the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `0` to the console\n\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `4` to the console\n```" - ], - "signature": "let lastIndex: t => int" - }, - { - "id": "Stdlib.RegExp.setLastIndex", - "kind": "value", - "name": "setLastIndex", - "docstrings": [ - "`setLastIndex(regexp, index)` set the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nregexp->RegExp.setLastIndex(4)\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `10` to the console\n```" - ], - "signature": "let setLastIndex: (t, int) => unit" - }, - { - "id": "Stdlib.RegExp.ignoreCase", - "kind": "value", - "name": "ignoreCase", - "docstrings": [ - "`ignoreCase(regexp)` returns whether the ignore case (`i`) flag is set on this `RegExp`.\n\nSee [`RegExp.ignoreCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/ignoreCase) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.ignoreCase) // Logs `false`, since `i` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.ignoreCase) // Logs `true`, since `i` is set\n```" - ], - "signature": "let ignoreCase: t => bool" - }, - { - "id": "Stdlib.RegExp.global", - "kind": "value", - "name": "global", - "docstrings": [ - "`global(regexp)` returns whether the global (`g`) flag is set on this `RegExp`.\n\nSee [`RegExp.global`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/global) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.global) // Logs `true`, since `g` is set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.global) // Logs `false`, since `g` is not set\n```" - ], - "signature": "let global: t => bool" - }, - { - "id": "Stdlib.RegExp.multiline", - "kind": "value", - "name": "multiline", - "docstrings": [ - "`multiline(regexp)` returns whether the multiline (`m`) flag is set on this `RegExp`.\n\nSee [`RegExp.multiline`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/multiline) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.multiline) // Logs `false`, since `m` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mi\")\nConsole.log(regexp2->RegExp.multiline) // Logs `true`, since `m` is set\n```" - ], - "signature": "let multiline: t => bool" - }, - { - "id": "Stdlib.RegExp.source", - "kind": "value", - "name": "source", - "docstrings": [ - "`source(regexp)` returns the source text for this `RegExp`, without the two forward slashes (if present), and without any set flags.\n\nSee [`RegExp.source`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/source) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp->RegExp.source) // Logs `\\w+`, the source text of the `RegExp`\n```" - ], - "signature": "let source: t => string" - }, - { - "id": "Stdlib.RegExp.sticky", - "kind": "value", - "name": "sticky", - "docstrings": [ - "`sticky(regexp)` returns whether the sticky (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.sticky`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `y` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"my\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `y` is set\n```" - ], - "signature": "let sticky: t => bool" - }, - { - "id": "Stdlib.RegExp.unicode", - "kind": "value", - "name": "unicode", - "docstrings": [ - "`unicode(regexp)` returns whether the unicode (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.unicode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `u` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mu\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `u` is set\n```" - ], - "signature": "let unicode: t => bool" - }, - { - "id": "Stdlib.RegExp.flags", - "kind": "value", - "name": "flags", - "docstrings": [ - "`flags(regexp)` returns a string consisting of all the flags set on this `RegExp`.\n\nSee [`RegExp.flags`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromString(\"\\\\w+\", ~flags=\"gi\")\nConsole.log(regexp->RegExp.flags) // Logs \"gi\", all the flags set on the RegExp\n```" - ], - "signature": "let flags: t => string" - }, - { - "id": "Stdlib.RegExp.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(regExp)` ignores the provided regExp and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/promise": { - "id": "Stdlib.Promise", - "name": "Promise", - "docstrings": [ - "Functions for interacting with JavaScript Promise.\nSee: [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)." - ], - "items": [ - { - "id": "Stdlib.Promise.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>" - }, - { - "id": "Stdlib.Promise.resolve", - "kind": "value", - "name": "resolve", - "docstrings": [ - "`resolve(value)` creates a resolved Promise with a given `value`.\nSee [`Promise.resolve`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve) on MDN.\n\n## Examples\n\n```rescript\nlet p = Promise.resolve(5) // promise\n```" - ], - "signature": "let resolve: 'a => t<'a>" - }, - { - "id": "Stdlib.Promise.reject", - "kind": "value", - "name": "reject", - "docstrings": [ - "`reject(exn)` reject a Promise.\nSee [`Promise.reject`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject) on MDN.\n\n## Examples\n\n```rescript\nexception TestError(string)\n\nTestError(\"some rejected value\")\n->Promise.reject\n->Promise.catch(v => {\n switch v {\n | TestError(msg) => msg == \"some rejected value\"\n | _ => assert(false)\n }\n Promise.resolve()\n})\n->ignore\n```" - ], - "signature": "let reject: exn => t<'a>" - }, - { - "id": "Stdlib.Promise.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(callback)` creates a new Promise based on a `callback` that receives two\nuncurried functions `resolve` and `reject` for defining the Promise's result.\n\n## Examples\n\n```rescript\nopen Promise\n\nlet n = 4\nPromise.make((resolve, reject) => {\n if n < 5 {\n resolve(\"success\")\n } else {\n reject(\"failed\")\n }\n})\n->then(str => {\n Console.log(str)->resolve\n})\n->catch(_ => {\n Console.log(\"Error occurred\")\n resolve()\n})\n->ignore\n```" - ], - "signature": "let make: (('a => unit, 'e => unit) => unit) => t<'a>" - }, - { - "id": "Stdlib.Promise.promiseAndResolvers", - "kind": "type", - "name": "promiseAndResolvers", - "docstrings": [], - "signature": "type promiseAndResolvers<'a> = {\n promise: t<'a>,\n resolve: 'a => unit,\n reject: exn => unit,\n}" - }, - { - "id": "Stdlib.Promise.withResolvers", - "kind": "value", - "name": "withResolvers", - "docstrings": [ - "`withResolvers()` returns a object containing a new promise with functions to resolve or reject it. See [`Promise.withResolvers`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\n\nlet {promise, resolve, _} = Promise.withResolvers()\n\nsetTimeout(() => {\n resolve(\"success\")\n}, 1000)->TimeoutId.ignore\n\npromise\n->thenResolve(str => {\n Console.log(str)\n})\n->ignore\n```" - ], - "signature": "let withResolvers: unit => promiseAndResolvers<'a>" - }, - { - "id": "Stdlib.Promise.catch", - "kind": "value", - "name": "catch", - "docstrings": [ - "`catch(promise, errorCallback)` registers an exception handler in a promise chain.\nThe `errorCallback` receives an `exn` value that can later be refined into a JS\nerror or ReScript error. The `errorCallback` needs to return a promise with the\nsame type as the consumed promise. See [`Promise.catch`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\n\nexception SomeError(string)\n\nreject(SomeError(\"this is an error\"))\n->then(_ => {\n Ok(\"This result will never be returned\")->resolve\n})\n->catch(e => {\n let msg = switch e {\n | SomeError(msg) => \"ReScript error occurred: \" ++ msg\n | JsExn(obj) =>\n switch JsExn.message(obj) {\n | Some(msg) => \"JS exception occurred: \" ++ msg\n | None => \"Some other JS value has been thrown\"\n }\n | _ => \"Unexpected error occurred\"\n }\n\n Error(msg)->resolve\n})\n->then(result => {\n switch result {\n | Ok(r) => Console.log2(\"Operation successful: \", r)\n | Error(msg) => Console.log2(\"Operation failed: \", msg)\n }->resolve\n})\n->ignore // Ignore needed for side-effects\n```\n\nIn case you want to return another promise in your `callback`, consider using\n`then` instead." - ], - "signature": "let catch: (t<'a>, exn => t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Promise.then", - "kind": "value", - "name": "then", - "docstrings": [ - "`then(promise, callback)` returns a new promise based on the result of `promise`'s\nvalue. The `callback` needs to explicitly return a new promise via `resolve`.\nIt is **not allowed** to resolve a nested promise (like `resolve(resolve(1))`).\nSee [`Promise.then`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) on MDN.\n## Examples\n\n```rescript\nopen Promise\nresolve(5)\n->then(num => {\n resolve(num + 5)\n})\n->then(num => {\n Console.log2(\"Your lucky number is: \", num)\n resolve()\n})\n->ignore\n```" - ], - "signature": "let then: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Promise.thenResolve", - "kind": "value", - "name": "thenResolve", - "docstrings": [ - "`thenResolve(promise, callback)` converts an encapsulated value of a promise\ninto another promise wrapped value. It is **not allowed** to return a promise\nwithin the provided callback (e.g. `thenResolve(value => resolve(value))`).\n\n## Examples\n\n```rescript\nopen Promise\nresolve(\"Anna\")\n->thenResolve(str => {\n \"Hello \" ++ str\n})\n->thenResolve(str => {\n Console.log(str)\n})\n->ignore // Ignore needed for side-effects\n```\n\nIn case you want to return another promise in your `callback`, consider using\n`then` instead." - ], - "signature": "let thenResolve: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Promise.finally", - "kind": "value", - "name": "finally", - "docstrings": [ - "`finally(promise, callback)` is used to execute a function that is called no\nmatter if a promise was resolved or rejected. It will return the same `promise`\nit originally received. See [`Promise.finally`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/finally) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nexception SomeError(string)\nlet isDone = ref(false)\n\nresolve(5)\n->then(_ => {\n reject(SomeError(\"test\"))\n})\n->then(v => {\n Console.log2(\"final result\", v)\n resolve()\n})\n->catch(_ => {\n Console.log(\"Error handled\")\n resolve()\n})\n->finally(() => {\n Console.log(\"finally\")\n isDone := true\n})\n->then(() => {\n Console.log2(\"isDone:\", isDone.contents)\n resolve()\n})\n->ignore\n```" - ], - "signature": "let finally: (t<'a>, unit => unit) => t<'a>" - }, - { - "id": "Stdlib.Promise.race", - "kind": "value", - "name": "race", - "docstrings": [ - "`race(arr)` runs all promises concurrently and returns promise settles with the eventual state of the first promise that settles. See [`Promise.race`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nlet racer = (ms, name) => {\n Promise.make((resolve, _) => {\n setTimeout(() => {\n resolve(name)\n }, ms)->TimeoutId.ignore\n })\n}\n\nlet promises = [racer(1000, \"Turtle\"), racer(500, \"Hare\"), racer(100, \"Eagle\")]\n\nrace(promises)->then(winner => {\n Console.log(\"The winner is \" ++ winner)\n resolve()\n})\n```" - ], - "signature": "let race: array> => t<'a>" - }, - { - "id": "Stdlib.Promise.any", - "kind": "value", - "name": "any", - "docstrings": [ - "`any(arr)` runs all promises concurrently and returns promise fulfills when any of the input's promises fulfills, with this first fulfillment value. See [`Promise.any`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/any) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nlet racer = (ms, name) => {\n Promise.make((resolve, _) => {\n setTimeout(() => {\n resolve(name)\n }, ms)->TimeoutId.ignore\n })\n}\n\nlet promises = [racer(1000, \"Turtle\"), racer(500, \"Hare\"), racer(100, \"Eagle\")]\n\nany(promises)->then(winner => {\n Console.log(\"The winner is \" ++ winner)\n resolve()\n})\n```" - ], - "signature": "let any: array> => t<'a>" - }, - { - "id": "Stdlib.Promise.all", - "kind": "value", - "name": "all", - "docstrings": [ - "`all(promises)` runs all promises concurrently and returns a promise fulfills when all of the input's promises fulfill, with an array of the fulfillment values. See [`Promise.all`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all) on MDN.\n\n```rescript\nopen Promise\nlet promises = [resolve(1), resolve(2), resolve(3)]\n\nall(promises)\n->then(results => {\n results->Array.forEach(num => {\n Console.log2(\"Number: \", num)\n })\n\n resolve()\n})\n->ignore\n```" - ], - "signature": "let all: array> => t>" - }, - { - "id": "Stdlib.Promise.all2", - "kind": "value", - "name": "all2", - "docstrings": [ - "`all2((p1, p2))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all2: ((t<'a>, t<'b>)) => t<('a, 'b)>" - }, - { - "id": "Stdlib.Promise.all3", - "kind": "value", - "name": "all3", - "docstrings": [ - "`all3((p1, p2, p3))`. Like `all()`, but with a fixed size tuple of 3" - ], - "signature": "let all3: ((t<'a>, t<'b>, t<'c>)) => t<('a, 'b, 'c)>" - }, - { - "id": "Stdlib.Promise.all4", - "kind": "value", - "name": "all4", - "docstrings": [ - "`all4((p1, p2, p3, p4))`. Like `all()`, but with a fixed size tuple of 4" - ], - "signature": "let all4: ((t<'a>, t<'b>, t<'c>, t<'d>)) => t<('a, 'b, 'c, 'd)>" - }, - { - "id": "Stdlib.Promise.all5", - "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((p1, p2, p3, p4, p5))`. Like `all()`, but with a fixed size tuple of 5" - ], - "signature": "let all5: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>),\n) => t<('a, 'b, 'c, 'd, 'e)>" - }, - { - "id": "Stdlib.Promise.all6", - "kind": "value", - "name": "all6", - "docstrings": [ - "`all6((p1, p2, p4, p5, p6))`. Like `all()`, but with a fixed size tuple of 6\n\")" - ], - "signature": "let all6: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>, t<'f>),\n) => t<('a, 'b, 'c, 'd, 'e, 'f)>" - }, - { - "id": "Stdlib.Promise.settledResult", - "kind": "type", - "name": "settledResult", - "docstrings": [], - "signature": "type settledResult<'a> =\n | Fulfilled({value: 'a})\n | Rejected({reason: exn})" - }, - { - "id": "Stdlib.Promise.allSettled", - "kind": "value", - "name": "allSettled", - "docstrings": [ - "`allSettled(promises)` runs all promises concurrently and returns promise fulfills when all of the input's promises settle with an array of objects that describe the outcome of each promise. See [`Promise.allSettled`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled) on MDN.\n\n```rescript\nopen Promise\n\nexception TestError(string)\n\nlet promises = [resolve(1), resolve(2), reject(TestError(\"some rejected promise\"))]\n\nallSettled(promises)\n->then(results => {\n results->Array.forEach(result => {\n switch result {\n | Fulfilled({value: num}) => Console.log2(\"Number: \", num)\n | Rejected({reason}) => Console.log(reason)\n }\n })\n\n resolve()\n})\n->ignore\n```" - ], - "signature": "let allSettled: array> => t>>" - }, - { - "id": "Stdlib.Promise.allSettled2", - "kind": "value", - "name": "allSettled2", - "docstrings": [ - "`allSettled2((p1, p2))`. Like `allSettled()`, but with a fixed size tuple of 2" - ], - "signature": "let allSettled2: (\n (t<'a>, t<'b>),\n) => t<(settledResult<'a>, settledResult<'b>)>" - }, - { - "id": "Stdlib.Promise.allSettled3", - "kind": "value", - "name": "allSettled3", - "docstrings": [ - "`allSettled3((p1, p2, p3))`. Like `allSettled()`, but with a fixed size tuple of 3" - ], - "signature": "let allSettled3: (\n (t<'a>, t<'b>, t<'c>),\n) => t<\n (settledResult<'a>, settledResult<'b>, settledResult<'c>),\n>" - }, - { - "id": "Stdlib.Promise.allSettled4", - "kind": "value", - "name": "allSettled4", - "docstrings": [ - "`allSettled4((p1, p2, p3, p4))`. Like `allSettled()`, but with a fixed size tuple of 4" - ], - "signature": "let allSettled4: (\n (t<'a>, t<'b>, t<'c>, t<'d>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n ),\n>" - }, - { - "id": "Stdlib.Promise.allSettled5", - "kind": "value", - "name": "allSettled5", - "docstrings": [ - "`allSettled5((p1, p2, p3, p4, p5))`. Like `allSettled()`, but with a fixed size tuple of 5" - ], - "signature": "let allSettled5: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n settledResult<'e>,\n ),\n>" - }, - { - "id": "Stdlib.Promise.allSettled6", - "kind": "value", - "name": "allSettled6", - "docstrings": [ - "`allSettled6((p1, p2, p4, p5, p6))`. Like `allSettled()`, but with a fixed size tuple of 6\n\")" - ], - "signature": "let allSettled6: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>, t<'f>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n settledResult<'e>,\n settledResult<'f>,\n ),\n>" - }, - { - "id": "Stdlib.Promise.done", - "kind": "value", - "name": "done", - "docstrings": [ - "`done(p)` is a safe way to ignore a promise. If a value is anything else than a\npromise, it will throw a type error." - ], - "signature": "let done: promise<'a> => unit", - "deprecated": "" - }, - { - "id": "Stdlib.Promise.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(promise)` ignores the provided promise and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: promise<'a> => unit" - } - ] - }, - "stdlib/pair": { - "id": "Stdlib.Pair", - "name": "Pair", - "docstrings": [ - "This module provides functions to work with pairs, which are 2-element tuples." - ], - "items": [ - { - "id": "Stdlib.Pair.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a, 'b> = ('a, 'b)" - }, - { - "id": "Stdlib.Pair.first", - "kind": "value", - "name": "first", - "docstrings": [ - "`first(pair)` returns the first element of a pair.\n\n## Examples\n\n```rescript\nPair.first((1, 2)) == 1\n```" - ], - "signature": "let first: (('a, 'b)) => 'a" - }, - { - "id": "Stdlib.Pair.second", - "kind": "value", - "name": "second", - "docstrings": [ - "`second(pair)` returns the second element of a pair.\n\n## Examples\n\n```rescript\nPair.second((1, 2)) == 2\n```" - ], - "signature": "let second: (('a, 'b)) => 'b" - }, - { - "id": "Stdlib.Pair.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(pair)` ignores the provided pair and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Pair.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(pair1, pair2, f1, f2)` check equality of `pair2` and `pair2` using `f1` for\nequality on the first element and `f2` for equality on the second element.\n\n## Examples\n\n```rescript\nPair.equal((1, \"test\"), (1, \"test\"), Int.equal, String.equal) == true\n\nPair.equal((1, \"test\"), (2, \"test\"), Int.equal, String.equal) == false\n```" - ], - "signature": "let equal: (\n ('a, 'b),\n ('c, 'd),\n ('a, 'c) => bool,\n ('b, 'd) => bool,\n) => bool" - }, - { - "id": "Stdlib.Pair.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(pair1, pair2, f1, f2)` compares two pairs, using `f1` to compare the first element\nand `f2` to compare the second element. Ordering is based on the first element,\nif they are equal, the second element is compared.\n\n## Examples\n\n```rescript\nPair.compare((1, \"a\"), (1, \"a\"), Int.compare, String.compare) == Ordering.equal\nPair.compare((1, \"a\"), (1, \"b\"), Int.compare, String.compare) == Ordering.less\nPair.compare((2, \"a\"), (1, \"b\"), Int.compare, String.compare) == Ordering.greater\n```" - ], - "signature": "let compare: (\n ('a, 'b),\n ('c, 'd),\n ('a, 'c) => float,\n ('b, 'd) => float,\n) => float" - } - ] - }, - "stdlib/ordering": { - "id": "Stdlib.Ordering", - "name": "Ordering", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Ordering.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Ordering values represent the result of a comparison: `less`, `equal`, or `greater`." - ], - "signature": "type t = float" - }, - { - "id": "Stdlib.Ordering.less", - "kind": "value", - "name": "less", - "docstrings": [], - "signature": "let less: float" - }, - { - "id": "Stdlib.Ordering.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: float" - }, - { - "id": "Stdlib.Ordering.greater", - "kind": "value", - "name": "greater", - "docstrings": [], - "signature": "let greater: float" - }, - { - "id": "Stdlib.Ordering.isLess", - "kind": "value", - "name": "isLess", - "docstrings": [ - "`isLess(ordering)` returns `true` when `ordering` equals `Ordering.less`.\n\n## Examples\n\n```rescript\nOrdering.isLess(Ordering.less) == true\nOrdering.isLess(Ordering.equal) == false\n```" - ], - "signature": "let isLess: float => bool" - }, - { - "id": "Stdlib.Ordering.isEqual", - "kind": "value", - "name": "isEqual", - "docstrings": [ - "`isEqual(ordering)` returns `true` when `ordering` equals `Ordering.equal`.\n\n## Examples\n\n```rescript\nOrdering.isEqual(Ordering.equal) == true\nOrdering.isEqual(Ordering.greater) == false\n```" - ], - "signature": "let isEqual: float => bool" - }, - { - "id": "Stdlib.Ordering.isGreater", - "kind": "value", - "name": "isGreater", - "docstrings": [ - "`isGreater(ordering)` returns `true` when `ordering` equals `Ordering.greater`.\n\n## Examples\n\n```rescript\nOrdering.isGreater(Ordering.greater) == true\nOrdering.isGreater(Ordering.less) == false\n```" - ], - "signature": "let isGreater: float => bool" - }, - { - "id": "Stdlib.Ordering.invert", - "kind": "value", - "name": "invert", - "docstrings": [ - "`invert(ordering)` flips the ordering result (less becomes greater and vice versa).\n\n## Examples\n\n```rescript\nOrdering.invert(Ordering.less) == Ordering.greater\nOrdering.invert(Ordering.equal) == Ordering.equal\n```" - ], - "signature": "let invert: float => float" - }, - { - "id": "Stdlib.Ordering.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "`fromInt(n)` converts an integer comparison result into an ordering.\n\n## Examples\n\n```rescript\nOrdering.fromInt(-5) == Ordering.less\nOrdering.fromInt(0) == Ordering.equal\nOrdering.fromInt(3) == Ordering.greater\n```" - ], - "signature": "let fromInt: int => float" - }, - { - "id": "Stdlib.Ordering.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(ordering)` ignores the provided ordering and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/option": { - "id": "Stdlib.Option", - "name": "Option", - "docstrings": [ - "We represent the existence and nonexistence of a value by wrapping it with\nthe `option` type. In order to make it a bit more convenient to work with\noption-types, we provide utility-functions for it.\n\nThe `option` type is a part of the ReScript standard library which is defined\nlike this:\n\n```rescript\ntype option<'a> = None | Some('a)\n```\n\n```rescript\nlet someString: option = Some(\"hello\")\n```" - ], - "items": [ - { - "id": "Stdlib.Option.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an option of type 'a." - ], - "signature": "type t<'a> = option<'a> = None | Some('a)" - }, - { - "id": "Stdlib.Option.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(opt, f)` applies `f` to `opt`, if `f` returns `true`, then it returns `Some(value)`, otherwise returns `None`.\n\n## Examples\n\n```rescript\nOption.filter(Some(10), x => x > 5) // Some(10)\nOption.filter(Some(4), x => x > 5) // None\nOption.filter(None, x => x > 5) // None\n```" - ], - "signature": "let filter: (option<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Option.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(opt, f)` call `f` on `opt`. if `opt` is `Some(value)`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nOption.forEach(Some(\"thing\"), x => Console.log(x)) // logs \"thing\"\nOption.forEach(None, x => Console.log(x)) // returns ()\n```" - ], - "signature": "let forEach: (option<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Option.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(opt, ~message=?)` returns `value` if `opt` is `Some(value)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n```rescript\nOption.getExn(Some(3)) == 3\n\nswitch Option.getExn(None) {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n\nswitch Option.getExn(None, ~message=\"was None!\") {\n| exception _ => assert(true) // Throws a JsError with the message \"was None!\"\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an error if `opt` is `None`" - ], - "signature": "let getExn: (option<'a>, ~message: string=?) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Option.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(opt, ~message=?)` returns `value` if `opt` is `Some(value)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n```rescript\nOption.getOrThrow(Some(3)) == 3\n\nswitch Option.getOrThrow(None) {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n\nswitch Option.getOrThrow(None, ~message=\"was None!\") {\n| exception _ => assert(true) // Throws a JsError with the message \"was None!\"\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an error if `opt` is `None`" - ], - "signature": "let getOrThrow: (option<'a>, ~message: string=?) => 'a" - }, - { - "id": "Stdlib.Option.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(opt)` returns `value` if `opt` is `Some(value)`, otherwise `undefined`.\n\n## Examples\n\n```rescript\nOption.getUnsafe(Some(3)) == 3\nOption.getUnsafe((None: option)) // Returns `undefined`, which is not a valid `int`\n```\n\n## Notes\n\n- This is an unsafe operation. It assumes `value` is not `None`, and may cause undefined behaviour if it is." - ], - "signature": "let getUnsafe: option<'a> => 'a" - }, - { - "id": "Stdlib.Option.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(opt, default, f)` returns `f(value)` if `opt` is `Some(value)`, otherwise `default`.\n\n## Examples\n\n```rescript\nlet someValue = Some(3)\nsomeValue->Option.mapOr(0, x => x + 5) // 8\n\nlet noneValue = None\nnoneValue->Option.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (option<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Option.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (option<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Option.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(opt, f)` returns `Some(f(value))` if `opt` is `Some(value)`, otherwise `None`.\n\n## Examples\n\n```rescript\nOption.map(Some(3), x => x * x) // Some(9)\nOption.map(None, x => x * x) // None\n```" - ], - "signature": "let map: (option<'a>, 'a => 'b) => option<'b>" - }, - { - "id": "Stdlib.Option.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(opt, f)` returns `f(value)` if `opt` is `Some(value)`, otherwise `None`.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Some(value + 1)\n } else {\n None\n }\n\nOption.flatMap(Some(2), addIfAboveOne) // Some(3)\nOption.flatMap(Some(-4), addIfAboveOne) // None\nOption.flatMap(None, addIfAboveOne) // None\n```" - ], - "signature": "let flatMap: (option<'a>, 'a => option<'b>) => option<'b>" - }, - { - "id": "Stdlib.Option.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(opt, default)` returns `value` if `opt` is `Some(value)`, otherwise `default`.\n\n## Examples\n\n```rescript\nOption.getOr(None, \"Banana\") // Banana\nOption.getOr(Some(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nSome(\"Jane\")->greet // \"Greetings Jane\"\nNone->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (option<'a>, 'a) => 'a" - }, - { - "id": "Stdlib.Option.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (option<'a>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Option.orElse", - "kind": "value", - "name": "orElse", - "docstrings": [ - "`orElse(opt1, opt2)` returns `opt2` if `opt1` is `None`, otherwise `opt1`.\n\n## Examples\n\n```rescript\nOption.orElse(Some(1812), Some(1066)) == Some(1812)\nOption.orElse(None, Some(1066)) == Some(1066)\nOption.orElse(None, None) == None\n```" - ], - "signature": "let orElse: (option<'a>, option<'a>) => option<'a>" - }, - { - "id": "Stdlib.Option.isSome", - "kind": "value", - "name": "isSome", - "docstrings": [ - "`isSome(opt)` returns `true` if `opt` is `Some(value)`, otherwise returns `false`.\n\n## Examples\n\n```rescript\nOption.isSome(None) // false\nOption.isSome(Some(1)) // true\n```" - ], - "signature": "let isSome: option<'a> => bool" - }, - { - "id": "Stdlib.Option.isNone", - "kind": "value", - "name": "isNone", - "docstrings": [ - "`isNone(opt)` returns `true` if `opt` is `None`, false otherwise.\n\n## Examples\n\n```rescript\nOption.isNone(None) // true\nOption.isNone(Some(1)) // false\n```" - ], - "signature": "let isNone: option<'a> => bool" - }, - { - "id": "Stdlib.Option.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(opt1, opt2, f)` evaluates two optional values for equality with respect to a predicate function `f`. If both `opt1` and `opt2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, the predicate function `f` must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Option\n\nequal(Some(3), Some(15), clockEqual) // true\nequal(Some(3), None, clockEqual) // false\nequal(None, Some(3), clockEqual) // false\nequal(None, None, clockEqual) // true\n```" - ], - "signature": "let equal: (option<'a>, option<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.Option.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(opt1, opt2, f)` compares two optional values with respect to given `f`.\n\nIf both `opt1` and `opt2` are `None`, it returns `0.`. If the first argument is `Some(value1)` and the second is `None`, returns `1.` (something is greater than nothing).\n\nIf the first argument is `None` and the second is `Some(value2)`, returns `-1.`\n(nothing is less than something).\n\nIf the arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, `f` takes two arguments and returns `-1.` if the first\nargument is less than the second, `0.` if the arguments are equal, and `1.` if\nthe first argument is greater than the second.\n\n## Examples\n\n```rescript\nlet clockCompare = (a, b) => Int.compare(mod(a, 12), mod(b, 12))\n\nOption.compare(Some(3), Some(15), clockCompare) // 0.\nOption.compare(Some(3), Some(14), clockCompare) // 1.\nOption.compare(Some(2), Some(15), clockCompare) // (-1.)\nOption.compare(None, Some(15), clockCompare) // (-1.)\nOption.compare(Some(14), None, clockCompare) // 1.\nOption.compare(None, None, clockCompare) // 0.\n```" - ], - "signature": "let compare: (\n option<'a>,\n option<'b>,\n ('a, 'b) => Ordering.t,\n) => Ordering.t" - }, - { - "id": "Stdlib.Option.all", - "kind": "value", - "name": "all", - "docstrings": [ - "`all(options)` returns an option of array if all options are Some, otherwise returns None.\n\n## Examples\n\n```rescript\nOption.all([Some(1), Some(2), Some(3)]) // Some([1, 2, 3])\nOption.all([Some(1), None]) // None\n```" - ], - "signature": "let all: array> => option>" - }, - { - "id": "Stdlib.Option.all2", - "kind": "value", - "name": "all2", - "docstrings": [ - "`all2((o1, o2))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all2: ((option<'a>, option<'b>)) => option<('a, 'b)>" - }, - { - "id": "Stdlib.Option.all3", - "kind": "value", - "name": "all3", - "docstrings": [ - "`all3((o1, o2, o3))`. Like `all()`, but with a fixed size tuple of 3" - ], - "signature": "let all3: (\n (option<'a>, option<'b>, option<'c>),\n) => option<('a, 'b, 'c)>" - }, - { - "id": "Stdlib.Option.all4", - "kind": "value", - "name": "all4", - "docstrings": [ - "`all4((o1, o2, o3, o4))`. Like `all()`, but with a fixed size tuple of 4" - ], - "signature": "let all4: (\n (option<'a>, option<'b>, option<'c>, option<'d>),\n) => option<('a, 'b, 'c, 'd)>" - }, - { - "id": "Stdlib.Option.all5", - "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((o1, o2, o3, o4, o5))`. Like `all()`, but with a fixed size tuple of 5" - ], - "signature": "let all5: (\n (\n option<'a>,\n option<'b>,\n option<'c>,\n option<'d>,\n option<'e>,\n ),\n) => option<('a, 'b, 'c, 'd, 'e)>" - }, - { - "id": "Stdlib.Option.all6", - "kind": "value", - "name": "all6", - "docstrings": [ - "`all6((o1, o2, o3, o4, o5, o6))`. Like `all()`, but with a fixed size tuple of 6" - ], - "signature": "let all6: (\n (\n option<'a>,\n option<'b>,\n option<'c>,\n option<'d>,\n option<'e>,\n option<'f>,\n ),\n) => option<('a, 'b, 'c, 'd, 'e, 'f)>" - }, - { - "id": "Stdlib.Option.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(option)` ignores the provided option and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: option<'a> => unit" - } - ] - }, - "stdlib/object": { - "id": "Stdlib.Object", - "name": "Object", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Object.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make` create a new object that inherits the properties and methods from the standard built-in Object, such as `toString`. See [Object on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)\n\n## Examples\n\n```rescript\nlet x = Object.make()\nx->Object.keysToArray->Array.length // 0\nx->Object.get(\"toString\")->Option.isSome // true\n```" - ], - "signature": "let make: unit => {..}" - }, - { - "id": "Stdlib.Object.is", - "kind": "value", - "name": "is", - "docstrings": [ - "`is` determines if two objects are identical in all contexts. Objects, arrays, records, and other non-primitives are only identical if they reference the **exact** same object in memory. Primitives like ints, floats, and strings are identical if they have the same value. `+0` and `-0` are distinct. NaN is equal to itself. See [Object.is on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)\n\nIn most scenarios use `==` or `===` or the custom `equals` function (if provided) for the type.\n\n## Examples\n\n```rescript\nObject.is(25, 13) // false\nObject.is(\"abc\", \"abc\") // true\nObject.is(undefined, undefined) // true\nObject.is(undefined, null) // false\nObject.is(-0.0, 0.0) // false\nObject.is(list{1, 2}, list{1, 2}) // false\n\nObject.is([1, 2, 3], [1, 2, 3]) // false\n[1, 2, 3] == [1, 2, 3] // true\n[1, 2, 3] === [1, 2, 3] // false\n\nlet fruit = {\"name\": \"Apple\"}\nObject.is(fruit, fruit) // true\nObject.is(fruit, {\"name\": \"Apple\"}) // false\nfruit == {\"name\": \"Apple\"} // true\nfruit === {\"name\": \"Apple\"} // false\n```" - ], - "signature": "let is: ('a, 'a) => bool" - }, - { - "id": "Stdlib.Object.create", - "kind": "value", - "name": "create", - "docstrings": [ - "`create` creates a new object, using an existing object as the prototype of the new object. See [Object.create on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\n\n**Note:** ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object) and [records](https://rescript-lang.org/docs/manual/latest/record). This is often safer and more convenient than using `create` and other functions in this module.\n\n## Examples\n\n```rescript\nlet x = {\"fruit\": \"banana\"}\nlet y = Object.create(x)\ny->Object.get(\"fruit\") // Some(\"banana\")\n```" - ], - "signature": "let create: {..} => {..}" - }, - { - "id": "Stdlib.Object.createWithProperties", - "kind": "value", - "name": "createWithProperties", - "docstrings": [ - "`createWithProperties(proto, descriptors)` creates a new object that delegates to `proto` and defines additional properties using descriptor objects.\n\nSee [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) on MDN.\n\n## Examples\n\n```rescript\nlet proto = {\"kind\": \"fruit\"}\nlet obj = Object.createWithProperties(proto, {\"name\": {\"value\": \"banana\"}})\nobj->Object.get(\"name\") == Some(\"banana\")\nobj->Object.get(\"kind\") == Some(\"fruit\")\n```" - ], - "signature": "let createWithProperties: ({..}, {..}) => {..}" - }, - { - "id": "Stdlib.Object.createWithNull", - "kind": "value", - "name": "createWithNull", - "docstrings": [ - "`createWithNull()` creates an object with a `null` prototype (no inherited properties).\n\nSee [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) on MDN.\n\n## Examples\n\n```rescript\nlet obj = Object.createWithNull()\nobj->Object.get(\"toString\") == None\n```" - ], - "signature": "let createWithNull: unit => {..}" - }, - { - "id": "Stdlib.Object.createWithNullAndProperties", - "kind": "value", - "name": "createWithNullAndProperties", - "docstrings": [ - "`createWithNullAndProperties(descriptors)` creates an object with a `null` prototype and defines properties using descriptor objects.\n\nSee [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) on MDN.\n\n## Examples\n\n```rescript\nlet obj = Object.createWithNullAndProperties({\"name\": {\"value\": \"banana\"}})\nobj->Object.get(\"name\") == Some(\"banana\")\nobj->Object.get(\"toString\") == None\n```" - ], - "signature": "let createWithNullAndProperties: {..} => {..}" - }, - { - "id": "Stdlib.Object.assign", - "kind": "value", - "name": "assign", - "docstrings": [ - "`assign(target, source)` copies enumerable own properties from the source to the target, overwriting properties with the same name. It returns the modified target object. A deep clone is not created; properties are copied by reference.\n\n**Warning:** ReScript provides compile-time support for type-safe access to JavaScript objects. This eliminates common errors such as accessing properties that do not exist, or using a property of type x as if it were a y. Using `assign` can bypass these safety checks and lead to run-time errors (if you are not careful). ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object) and [records](https://rescript-lang.org/docs/manual/latest/record). This is often safer and more convenient than using `assign` and other functions in this module.\n\nSee [Object.assign on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) or [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign).\n\n## Examples\n\n```rescript\nObject.assign({\"a\": 1}, {\"a\": 2}) // {\"a\": 2}\nObject.assign({\"a\": 1, \"b\": 2}, {\"a\": 0}) // {\"a\": 0, \"b\": 2}\nObject.assign({\"a\": 1}, {\"a\": null}) // {\"a\": null}\n```" - ], - "signature": "let assign: ({..}, {..}) => {..}" - }, - { - "id": "Stdlib.Object.assignMany", - "kind": "value", - "name": "assignMany", - "docstrings": [ - "`assignMany(target, sources)` copies enumerable own properties from each source to the target, overwriting properties with the same name. Later sources' properties overwrite earlier ones. It returns the modified target object. A deep clone is not created; properties are copied by reference.\n\n**Note:** ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object), including spreading one object into another. This is often more convenient than using `assign` or `assignMany`. \n\nSee [Object.assign on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) or [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign)." - ], - "signature": "let assignMany: ({..}, array<{..}>) => {..}" - }, - { - "id": "Stdlib.Object.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(object)` creates a shallow copy of `object`.\n\nSee [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) on MDN.\n\n## Examples\n\n```rescript\nlet original = {\"name\": \"banana\"}\nlet cloned = Object.copy(original)\ncloned->Object.get(\"name\") == Some(\"banana\")\nObject.is(original, cloned) == false\n```" - ], - "signature": "let copy: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get` gets the value of a property by name. Returns `None` if the property does not exist or has the value `undefined`. Otherwise returns `Some`, including if the value is `null`.\n\n## Examples\n\n```rescript\n{\"a\": 1}->Object.get(\"a\") // Some(1)\n{\"a\": 1}->Object.get(\"b\") // None\n{\"a\": undefined}->Object.get(\"a\") // None\n{\"a\": null}->Object.get(\"a\") // Some(null)\n{\"a\": 1}->Object.get(\"toString\")->Option.isSome // true\n```" - ], - "signature": "let get: ({..}, string) => option<'a>" - }, - { - "id": "Stdlib.Object.getSymbol", - "kind": "value", - "name": "getSymbol", - "docstrings": [ - "`getSymbol` gets the value of a property by symbol. Returns `None` if the property does not exist or has the value `undefined`. Otherwise returns `Some`, including if the value is `null`.\n\n## Examples\n\n```rescript\nlet fruit = Symbol.make(\"fruit\")\nlet x = Object.make()\nx->Object.setSymbol(fruit, \"banana\")\nx->Object.getSymbol(fruit) == Some(\"banana\")\n```" - ], - "signature": "let getSymbol: ({..}, Symbol.t) => option<'a>" - }, - { - "id": "Stdlib.Object.getSymbolUnsafe", - "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [ - "`getSymbolUnsafe(object, key)` reads the value stored under the symbol `key` without any optional check.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet obj = Object.make()\nobj->Object.setSymbol(key, \"hello\")\nObject.getSymbolUnsafe(obj, key) == \"hello\"\n```" - ], - "signature": "let getSymbolUnsafe: ({..}, Symbol.t) => 'a" - }, - { - "id": "Stdlib.Object.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(name, value)` assigns a value to the named object property, overwriting the previous value if any. See [Working with Objects on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#objects_and_properties)\n\n## Examples\n\n```rescript\n{\"a\": 1}->Object.set(\"a\", 2) // {\"a\": 2}\n{\"a\": 1}->Object.set(\"a\", None) // {\"a\": None}\n{\"a\": 1}->Object.set(\"b\", 2) // {\"a\": 1, \"b\": 2}\n```" - ], - "signature": "let set: ({..}, string, 'a) => unit" - }, - { - "id": "Stdlib.Object.setSymbol", - "kind": "value", - "name": "setSymbol", - "docstrings": [ - "`setSymbol(object, key, value)` stores `value` under the symbol `key` on `object`.\n\nBeware this will *mutate* the object.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"count\")\nlet obj = Object.make()\nobj->Object.setSymbol(key, 5)\nObject.getSymbol(obj, key) == Some(5)\n```" - ], - "signature": "let setSymbol: ({..}, Symbol.t, 'a) => unit" - }, - { - "id": "Stdlib.Object.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "`keysToArray` returns an array of an object's own enumerable string-keyed property names. See [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.keys)\nor [Object.keys on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys).\n\n## Examples\n\n```rescript\n{\"a\": 1, \"b\": 2}->Object.keysToArray // [\"a\", \"b\"]\n{\"a\": None}->Object.keysToArray // [\"a\"]\nObject.make()->Object.keysToArray // []\n```" - ], - "signature": "let keysToArray: {..} => array" - }, - { - "id": "Stdlib.Object.hasOwnProperty", - "kind": "value", - "name": "hasOwnProperty", - "docstrings": [ - "`hasOwnProperty` determines whether the object has the specified property as its **own** property, as opposed to inheriting it. See [hasOwnProperty on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 2}\n{\"a\": 1}->Object.hasOwnProperty(\"a\") // true\n{\"a\": 1}->Object.hasOwnProperty(\"b\") // false\n{\"a\": 1}->Object.hasOwnProperty(\"toString\") // false\n```" - ], - "signature": "let hasOwnProperty: ({..}, string) => bool" - }, - { - "id": "Stdlib.Object.seal", - "kind": "value", - "name": "seal", - "docstrings": [ - "`seal` seals an object. Sealing an object prevents extensions and makes existing properties non-configurable. A sealed object has a fixed set of properties. Unlike `freeze`, values of existing properties can still be changed as long as they are writable.\n\n**Note:** `seal` returns the same object that was passed in; it does not create a copy. Any attempt to delete or add properties to a sealed object will fail, either silently or by throwing an error.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.seal) and [Object.seal on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 2}\npoint->Object.set(\"x\", -7) // succeeds\npoint->Object.seal->ignore\n\ntry {\n point->Object.set(\"z\", 9) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n\npoint->Object.set(\"x\", 13) // succeeds\n```" - ], - "signature": "let seal: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.preventExtensions", - "kind": "value", - "name": "preventExtensions", - "docstrings": [ - "`preventExtensions` prevents new properties from being added to the object. It modifies the object (rather than creating a copy) and returns it.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.preventextensions) and [Object.preventExtensions on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/preventExtensions)\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.set(\"b\", 2) // succeeds\nobj->Object.preventExtensions->ignore\ntry {\n obj->Object.set(\"c\", 3) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let preventExtensions: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.freeze", - "kind": "value", - "name": "freeze", - "docstrings": [ - "`freeze` freezes an object. Freezing an object makes existing properties non-writable and prevents extensions. Once an object is frozen, new properties cannot be be added, existing properties cannot be removed, and their values cannot be changed.\n\n**Note:** `freeze` returns the same object that was passed in; it does not create a frozen copy. Any attempt to change a frozen object will fail, either silently or by throwing an exception.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isfrozen) and [Object.isFrozen on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen).\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.set(\"a\", 2) // succeeds\nobj->Object.freeze->ignore\n\ntry {\n obj->Object.set(\"a\", 3) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let freeze: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.isSealed", - "kind": "value", - "name": "isSealed", - "docstrings": [ - "`isSealed` determines if an object is sealed. A sealed object has a fixed set of properties.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.issealed) and [Object.isSealed on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 3}->Object.seal\nlet pointIsSealed = point->Object.isSealed // true\nlet fruit = {\"name\": \"Apple\"}\nlet fruitIsSealed = fruit->Object.isSealed // false\n```" - ], - "signature": "let isSealed: 'a => bool" - }, - { - "id": "Stdlib.Object.isFrozen", - "kind": "value", - "name": "isFrozen", - "docstrings": [ - "`isFrozen` determines if an object is frozen. An object is frozen if an only if it is not extensible, all its properties are non-configurable, and all its data properties are non-writable.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isfrozen) and [Object.isFrozen on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen).\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 3}->Object.freeze\nlet pointIsFrozen = point->Object.isFrozen // true\nlet fruit = {\"name\": \"Apple\"}\nlet fruitIsFrozen = fruit->Object.isFrozen // false\n```" - ], - "signature": "let isFrozen: 'a => bool" - }, - { - "id": "Stdlib.Object.isExtensible", - "kind": "value", - "name": "isExtensible", - "docstrings": [ - "`isExtensible` determines if an object is extensible (whether it can have new properties added to it).\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isextensible) and [Object.isExtensible on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible)\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.isExtensible // true\nobj->Object.preventExtensions->ignore\nobj->Object.isExtensible // false\n```" - ], - "signature": "let isExtensible: 'a => bool" - }, - { - "id": "Stdlib.Object.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(object)` ignores the provided object and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: {..} => unit" - } - ] - }, - "stdlib/nullable": { - "id": "Stdlib.Nullable", - "name": "Nullable", - "docstrings": [ - "Functions for handling nullable values.\n\nPrimarily useful when interoping with JavaScript when you don't know whether you'll get a value, `null` or `undefined`." - ], - "items": [ - { - "id": "Stdlib.Nullable.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a nullable value.\nA nullable value can be the value `'a`, `null` or `undefined`." - ], - "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined" - }, - { - "id": "Stdlib.Nullable.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The value `null`.\n\nSee [`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null) on MDN.\n\n## Examples\n```rescript\nConsole.log(Nullable.null) // Logs `null` to the console.\n```" - ], - "signature": "let null: t<'a>" - }, - { - "id": "Stdlib.Nullable.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The value `undefined`.\n\nSee [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/undefined) on MDN.\n\n## Examples\n```rescript\nConsole.log(undefined) // Logs `undefined` to the console.\n```" - ], - "signature": "let undefined: t<'a>" - }, - { - "id": "Stdlib.Nullable.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [ - "`isNullable(a)` returns `true` if `a` is null or undefined, `false` otherwise.\n\n## Examples\n\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Check if asNullable is not null or undefined\nswitch asNullable->Nullable.isNullable {\n| true => assert(false)\n| false => assert(true)\n}\n```" - ], - "signature": "let isNullable: t<'a> => bool" - }, - { - "id": "Stdlib.Nullable.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new nullable value from the provided value.\nThis means the compiler will enforce null checks for the new value.\n\n## Examples\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Need to do this\nswitch asNullable->Nullable.toOption {\n| Some(value) if value == myStr => Console.log(\"Yay, values matched!\")\n| _ => Console.log(\"Values did not match.\")\n}\n```" - ], - "signature": "let make: 'a => t<'a>" - }, - { - "id": "Stdlib.Nullable.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.Nullable.compare", - "kind": "value", - "name": "compare", - "docstrings": [], - "signature": "let compare: (t<'a>, t<'b>, ('a, 'b) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.Nullable.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Converts a nullable value into an option, so it can be pattern matched on.\nWill convert both `null` and `undefined` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullableString = Nullable.make(\"Hello\")\n\nswitch nullableString->Nullable.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```" - ], - "signature": "let toOption: t<'a> => option<'a>" - }, - { - "id": "Stdlib.Nullable.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Turns an `option` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet optString = Some(\"Hello\")\nlet asNullable = optString->Nullable.fromOption // Nullable.t\n```" - ], - "signature": "let fromOption: option<'a> => t<'a>" - }, - { - "id": "Stdlib.Nullable.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(value, default)` returns `value` if not `null` or `undefined`,\notherwise return `default`.\n\n## Examples\n\n```rescript\nNullable.getOr(Nullable.null, \"Banana\") // Banana\nNullable.getOr(Nullable.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNullable.make(\"Jane\")->Nullable.toOption->greet // \"Greetings Jane\"\nNullable.null->Nullable.toOption->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (t<'a>, 'a) => 'a" - }, - { - "id": "Stdlib.Nullable.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Nullable.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getExn(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getExn(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`" - ], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Nullable.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getOrThrow(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getOrThrow(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`" - ], - "signature": "let getOrThrow: t<'a> => 'a" - }, - { - "id": "Stdlib.Nullable.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNullable.getUnsafe(Nullable.make(3)) == 3\nNullable.getUnsafe(Nullable.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null` or `undefined`." - ], - "signature": "let getUnsafe: t<'a> => 'a" - }, - { - "id": "Stdlib.Nullable.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(value, f)` call `f` on `value`. if `value` is not `null` or `undefined`,\nthen if calls `f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNullable.forEach(Nullable.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNullable.forEach(Nullable.null, x => Console.log(x)) // returns ()\nNullable.forEach(undefined, x => Console.log(x)) // returns ()\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Nullable.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nNullable.map(Nullable.make(3), x => x * x) // Nullable.make(9)\nNullable.map(undefined, x => x * x) // undefined\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Nullable.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`\nor `undefined`, otherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Nullable.make(3)\nsomeValue->Nullable.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Nullable.null\nnoneValue->Nullable.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (t<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Nullable.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (t<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Nullable.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Nullable.make(value + 1)\n } else {\n Nullable.null\n }\n\nNullable.flatMap(Nullable.make(2), addIfAboveOne) // Nullable.make(3)\nNullable.flatMap(Nullable.make(-4), addIfAboveOne) // undefined\nNullable.flatMap(Nullable.null, addIfAboveOne) // undefined\n```" - ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Nullable.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(nullable)` ignores the provided nullable and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/null": { - "id": "Stdlib.Null", - "name": "Null", - "docstrings": [ - "Functions for handling values that could be `null`.\n\nIf you also need to cover `undefined`, check out `Nullable` instead." - ], - "items": [ - { - "id": "Stdlib.Null.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a value that can be either `'a` or `null`." - ], - "signature": "@unboxed\ntype t<'a> = null<'a> =\n | Value('a)\n | @as(null) Null" - }, - { - "id": "Stdlib.Null.asNullable", - "kind": "value", - "name": "asNullable", - "docstrings": [ - "Converts a `Null.t` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet nullValue = Null.make(\"Hello\")\nlet asNullable = nullValue->Null.asNullable // Nullable.t\n```" - ], - "signature": "let asNullable: t<'a> => Nullable.t<'a>" - }, - { - "id": "Stdlib.Null.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The value `null`.\n\nSee [`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null) on MDN.\n\n## Examples\n```rescript\nConsole.log(null) // Logs `null` to the console.\n```" - ], - "signature": "let null: t<'a>" - }, - { - "id": "Stdlib.Null.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Null.t` from the provided value.\nThis means the compiler will enforce null checks for the new value.\n\n## Examples\n```rescript\nlet myStr = \"Hello\"\nlet asNullValue = myStr->Null.make // The compiler now thinks this can be `string` or `null`.\n```" - ], - "signature": "let make: 'a => t<'a>" - }, - { - "id": "Stdlib.Null.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(a, b, eq)` checks if `a` and `b` are equal.\nIf both are `Null.Value`, it will use function `eq` to check if the values are equal.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\nNull.equal(a, b, Int.equal) == false\nNull.equal(a, c, Int.equal) == false\nNull.equal(Null.null, Null.null, Int.equal) == true\n```" - ], - "signature": "let equal: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.Null.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(a, b, cmp)` compares `a` and `b`.\nIf both are `Null.Value`, it will use function `cmp` to compare the values.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\n// A value is greater than null\nNull.compare(a, b, Int.compare) == Ordering.greater\n// A value is less than null\nNull.compare(b, a, Int.compare) == Ordering.less\n// A null is equal to null\nNull.compare(Null.null, Null.null, Int.compare) == Ordering.equal\n// The compare function is used if both are `Null.Value`\nNull.compare(a, c, Int.compare) == Ordering.less\n```" - ], - "signature": "let compare: (t<'a>, t<'b>, ('a, 'b) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.Null.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Converts a nullable value into an option, so it can be pattern matched on.\nWill convert `null` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullStr = Null.make(\"Hello\")\n\nswitch nullStr->Null.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```" - ], - "signature": "let toOption: t<'a> => option<'a>" - }, - { - "id": "Stdlib.Null.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Turns an `option` into a `Null.t`. `None` will be converted to `null`.\n\n## Examples\n```rescript\nlet optString: option = None\nlet asNull = optString->Null.fromOption // Null.t\nConsole.log(asNull == Null.null) // Logs `true` to the console.\n```" - ], - "signature": "let fromOption: option<'a> => t<'a>" - }, - { - "id": "Stdlib.Null.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(value, default)` returns `value` if not `null`, otherwise return\n`default`.\n\n## Examples\n\n```rescript\nNull.getOr(Null.null, \"Banana\") // Banana\nNull.getOr(Null.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNull.make(\"Jane\")->Null.toOption->greet // \"Greetings Jane\"\nNull.null->Null.toOption->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (t<'a>, 'a) => 'a" - }, - { - "id": "Stdlib.Null.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Null.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getExn(Null.make(3)) == 3\n\nswitch Null.getExn(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`" - ], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Null.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getOrThrow(Null.make(3)) == 3\n\nswitch Null.getOrThrow(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`" - ], - "signature": "let getOrThrow: t<'a> => 'a" - }, - { - "id": "Stdlib.Null.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNull.getUnsafe(Null.make(3)) == 3\nNull.getUnsafe(Null.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null`." - ], - "signature": "let getUnsafe: t<'a> => 'a" - }, - { - "id": "Stdlib.Null.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(value, f)` call `f` on `value`. if `value` is not `null`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNull.forEach(Null.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNull.forEach(Null.null, x => Console.log(x)) // logs nothing\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Null.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(value, f)` returns `f(value)` if `value` is not `null`, otherwise returns\n`value` unchanged.\n\n## Examples\n\n```rescript\nNull.map(Null.make(3), x => x * x) // Null.make(9)\nNull.map(Null.null, x => x * x) // null\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Null.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`,\notherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Null.make(3)\nsomeValue->Null.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Null.null\nnoneValue->Null.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (t<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Null.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (t<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Null.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(value, f)` returns `f(value)` if `value` is not `null`, otherwise\nreturns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Null.make(value + 1)\n } else {\n Null.null\n }\n\nNull.flatMap(Null.make(2), addIfAboveOne) // Null.make(3)\nNull.flatMap(Null.make(-4), addIfAboveOne) // null\nNull.flatMap(Null.null, addIfAboveOne) // null\n```" - ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Null.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(null)` ignores the provided null and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/math": { - "id": "Stdlib.Math", - "name": "Math", - "docstrings": [ - "Functions for interacting with JavaScript Math.\nSee: [`Math`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math)." - ], - "items": [ - { - "id": "Stdlib.Math.abs", - "kind": "value", - "name": "abs", - "docstrings": [ - "`abs(v)` returns absolute value of `v`.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n## Examples\n\n```rescript\nMath.abs(-2.0) == 2.0\nMath.abs(3.0) == 3.0\n```" - ], - "signature": "let abs: float => float" - }, - { - "id": "Stdlib.Math.acos", - "kind": "value", - "name": "acos", - "docstrings": [ - "`acos(v)` returns arccosine (in radians) of argument `v`, returns `NaN` if the\nargument is outside the range \\[-1.0, 1.0\\].\nSee [`Math.acos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acos) on MDN.\n\n## Examples\n\n```rescript\nMath.acos(-1.0) == 3.141592653589793\nMath.acos(-3.0)->Float.isNaN == true\n```" - ], - "signature": "let acos: float => float" - }, - { - "id": "Stdlib.Math.acosh", - "kind": "value", - "name": "acosh", - "docstrings": [ - "`acosh(v)` returns the inverse hyperbolic arccosine (in radians) of argument `v`,\nreturns `NaN` if the argument is less than `1.0`.\nSee [`Math.acosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acosh) on MDN.\n\n## Examples\n\n```rescript\nMath.acosh(1.0) == 0.0\nMath.acosh(0.5)->Float.isNaN == true\n```" - ], - "signature": "let acosh: float => float" - }, - { - "id": "Stdlib.Math.asin", - "kind": "value", - "name": "asin", - "docstrings": [ - "`asin(v)` returns the inverse sine (in radians) of argument `v`, returns `NaN`\nif the argument `v` is outside the range \\[-1.0, 1.0\\].\nSee [`Math.asin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asin) on MDN.\n\n## Examples\n\n```rescript\nMath.asin(-1.0) == -1.5707963267948966\nMath.asin(-2.0)->Float.isNaN == true\n```" - ], - "signature": "let asin: float => float" - }, - { - "id": "Stdlib.Math.asinh", - "kind": "value", - "name": "asinh", - "docstrings": [ - "`asinh(v)` returns the inverse hyperbolic sine of argument `v`.\nSee [`Math.asinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh) on MDN.\n\n## Examples\n\n```rescript\nMath.asinh(-1.0) == -0.881373587019543\nMath.asinh(-0.0) == -0.0\n```" - ], - "signature": "let asinh: float => float" - }, - { - "id": "Stdlib.Math.atan", - "kind": "value", - "name": "atan", - "docstrings": [ - "`atan(v)` returns the inverse tangent (in radians) of argument `v`.\nSee [`Math.atan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan) on MDN.\n\n## Examples\n\n```rescript\nMath.atan(-0.0) == -0.0\nMath.atan(0.0) == 0.0\nMath.atan(1.0) == 0.7853981633974483\n```" - ], - "signature": "let atan: float => float" - }, - { - "id": "Stdlib.Math.atanh", - "kind": "value", - "name": "atanh", - "docstrings": [ - "`atanh(v)` returns the invert hyperbolic tangent of argument `v`. Returns `NaN`\nif the argument `v` is is outside the range \\[-1.0, 1.0\\] and `Infinity` if `v`\nis `-1.0` or `1.0`.\nSee [`Math.atanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh) on MDN.\n\n## Examples\n\n```rescript\nMath.atanh(-2.0)->Float.isNaN == true\nMath.atanh(-1.0)->Float.isFinite == false\nMath.atanh(-0.0) == -0.0\nMath.atanh(0.0) == 0.0\nMath.atanh(0.5) == 0.5493061443340548\n```" - ], - "signature": "let atanh: float => float" - }, - { - "id": "Stdlib.Math.atan2", - "kind": "value", - "name": "atan2", - "docstrings": [ - "`atan2(~y, ~x)` returns the angle (in radians) of the quotient `y /. x`. It is\nalso the angle between the *x*\\-axis and point (*x*, *y*).\nSee [`Math.atan2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2) on MDN.\n\n## Examples\n\n```rescript\nMath.atan2(~y=0.0, ~x=10.0) == 0.0\nMath.atan2(~x=5.0, ~y=5.0) == Math.Constants.pi /. 4.0\nMath.atan2(~x=90.0, ~y=15.0) == 0.16514867741462683\nMath.atan2(~x=15.0, ~y=90.0) == 1.4056476493802699\n```" - ], - "signature": "let atan2: (~y: float, ~x: float) => float" - }, - { - "id": "Stdlib.Math.cbrt", - "kind": "value", - "name": "cbrt", - "docstrings": [ - "`cbrt(v)` returns the cube root of argument `v`.\nSee [`Math.cbrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt) on MDN.\n\n## Examples\n\n```rescript\nMath.cbrt(-1.0) == -1.0\nMath.cbrt(-0.0) == -0.0\nMath.cbrt(0.0) == 0.0\n```" - ], - "signature": "let cbrt: float => float" - }, - { - "id": "Stdlib.Math.ceil", - "kind": "value", - "name": "ceil", - "docstrings": [ - "`ceil(v)` returns the smallest integral value greater than or equal to the\nargument `v`. The result is a `float` and is not restricted to the `int` data\ntype range.\nSee [`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil) on MDN.\n\n## Examples\n\n```rescript\nMath.ceil(3.1) == 4.0\nMath.ceil(3.0) == 3.0\nMath.ceil(-3.1) == -3.0\nMath.ceil(2_150_000_000.3) == 2_150_000_001.0\n```" - ], - "signature": "let ceil: float => float" - }, - { - "id": "Stdlib.Math.cos", - "kind": "value", - "name": "cos", - "docstrings": [ - "`cos(v)` returns the cosine of argument `v`, which must be specified in radians.\nSee [`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos) on MDN.\n\n## Examples\n\n```rescript\nMath.cos(-0.0) == 1.0\nMath.cos(0.0) == 1.0\nMath.cos(1.0) == 0.5403023058681398\n```" - ], - "signature": "let cos: float => float" - }, - { - "id": "Stdlib.Math.cosh", - "kind": "value", - "name": "cosh", - "docstrings": [ - "`cosh(v)` returns the hyperbolic cosine of argument `v`, which must be specified\nin radians.\nSee [`Math.cosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh) on MDN.\n\n## Examples\n\n```rescript\nMath.cosh(-1.0) == 1.5430806348152437\nMath.cosh(-0.0) == 1.0\nMath.cosh(0.0) == 1.0\n```" - ], - "signature": "let cosh: float => float" - }, - { - "id": "Stdlib.Math.exp", - "kind": "value", - "name": "exp", - "docstrings": [ - "`exp(v)` returns natural exponentional, returns *e* (the base of natural logarithms)\nto the power of the given argument `v`.\nSee [`Math.exp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/exp) on MDN.\n\n## Examples\n\n```rescript\nMath.exp(-1.0) == 0.36787944117144233\nMath.exp(0.0) == 1.0\n```" - ], - "signature": "let exp: float => float" - }, - { - "id": "Stdlib.Math.expm1", - "kind": "value", - "name": "expm1", - "docstrings": [ - "`expm1(v)` returns *e* (the base of natural logarithms) to the power of the given\nargument `v` minus 1.\nSee [`Math.expm1`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1) on MDN.\n\n## Examples\n\n```rescript\nMath.expm1(-1.0) == -0.6321205588285577\nMath.expm1(-0.0) == -0.0\n```" - ], - "signature": "let expm1: float => float" - }, - { - "id": "Stdlib.Math.floor", - "kind": "value", - "name": "floor", - "docstrings": [ - "`floor(v)` returns the largest integral value less than or equal to the argument\n`v`. The result is a `float` and is not restricted to the `int` data type range.\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor) on MDN.\n\n## Examples\n\n```rescript\nMath.floor(-45.95) == -46.0\nMath.floor(-45.05) == -46.0\nMath.floor(-0.0) == -0.0\n```" - ], - "signature": "let floor: float => float" - }, - { - "id": "Stdlib.Math.fround", - "kind": "value", - "name": "fround", - "docstrings": [ - "`fround(v)` returns the nearest single precision float.\nSee [`Math.fround`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround) on MDN.\n\n## Examples\n\n```rescript\nMath.fround(5.5) == 5.5\nMath.fround(5.05) == 5.050000190734863\n```" - ], - "signature": "let fround: float => float" - }, - { - "id": "Stdlib.Math.hypot", - "kind": "value", - "name": "hypot", - "docstrings": [ - "`hypot(a, b)` returns the square root of the sum of squares of its two arguments\n(the Pythagorean formula).\nSee [`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot) on MDN.\n\n## Examples\n\n```rescript\nMath.hypot(3.0, 4.0) == 5.0\nMath.hypot(3.0, 5.0) == 5.8309518948453\n```" - ], - "signature": "let hypot: (float, float) => float" - }, - { - "id": "Stdlib.Math.hypotMany", - "kind": "value", - "name": "hypotMany", - "docstrings": [ - "`hypotMany(arr)` returns the square root of the sum of squares of the numbers in\nthe array argument (generalized Pythagorean equation). Using an array allows you\nto have more than two items. If `arr` is an empty array then returns `0.0`.\nSee [`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot) on MDN.\n\n## Examples\n\n```rescript\nMath.hypotMany([3.0, 4.0, 5.0]) == 7.0710678118654755\nMath.hypotMany([]) == 0.0\n```" - ], - "signature": "let hypotMany: array => float" - }, - { - "id": "Stdlib.Math.log", - "kind": "value", - "name": "log", - "docstrings": [ - "`log(v)` returns the natural logarithm of argument `v`, this is the number *x*\nsuch that `e^x` equals the argument. Returns `NaN` for negative arguments and\n`Infinity` for `0.0` or `-0.0`.\nSee [`Math.log`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log) on MDN.\n\n## Examples\n\n```rescript\nMath.log(-1.0)->Float.isNaN == true\nMath.log(-0.0)->Float.isFinite == false\nMath.log(0.0)->Float.isFinite == false\nMath.log(1.0) == 0.0\n```" - ], - "signature": "let log: float => float" - }, - { - "id": "Stdlib.Math.log1p", - "kind": "value", - "name": "log1p", - "docstrings": [ - "`log1p(v)` returns the natural logarithm of one plus the argument `v`.\nReturns `NaN` for arguments less than `-1` and `Infinity` if `v` is `-1.0`.\nSee [`Math.log1p`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log1p) on MDN.\n\n## Examples\n\n```rescript\nMath.log1p(-2.0)->Float.isNaN == true\nMath.log1p(-1.0)->Float.isFinite == false\nMath.log1p(-0.0) == -0.0\n```" - ], - "signature": "let log1p: float => float" - }, - { - "id": "Stdlib.Math.log10", - "kind": "value", - "name": "log10", - "docstrings": [ - "`log10(v)` returns the base 10 logarithm of argument `v`. Returns `NaN` for\nnegative `v`. If `v` is `-0.0` or `0.0` returns `Infinity`.\nSee [`Math.log10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log10) on MDN.\n\n## Examples\n\n```rescript\nMath.log10(-2.0)->Float.isNaN == true\nMath.log10(-0.0)->Float.isFinite == false\nMath.log10(0.0)->Float.isFinite == false\nMath.log10(1.0) == 0.0\n```" - ], - "signature": "let log10: float => float" - }, - { - "id": "Stdlib.Math.log2", - "kind": "value", - "name": "log2", - "docstrings": [ - "`log2(v)` returns the base 2 logarithm of argument `v`. Returns `NaN` for\nnegative `v` and `Infinity` if `v` is `-0.0` or `0.0`.\nSee [`Math.log2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2) on MDN.\n\n## Examples\n\n```rescript\nMath.log2(-2.0)->Float.isNaN == true\nMath.log2(-0.0)->Float.isFinite == false\nMath.log2(0.0)->Float.isFinite == false\nMath.log2(1.0) == 0.0\n```" - ], - "signature": "let log2: float => float" - }, - { - "id": "Stdlib.Math.min", - "kind": "value", - "name": "min", - "docstrings": [ - "`min(a, b)` returns the minimum of its two float arguments.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n## Examples\n\n```rescript\nMath.min(1.0, 2.0) == 1.0\nMath.min(-1.0, -2.0) == -2.0\n```" - ], - "signature": "let min: (float, float) => float" - }, - { - "id": "Stdlib.Math.minMany", - "kind": "value", - "name": "minMany", - "docstrings": [ - "`minMany(arr)` returns the minimum of the float in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n## Examples\n\n```rescript\nMath.minMany([1.0, 2.0]) == 1.0\nMath.minMany([-1.0, -2.0]) == -2.0\nMath.minMany([])->Float.isFinite == false\n```" - ], - "signature": "let minMany: array => float" - }, - { - "id": "Stdlib.Math.max", - "kind": "value", - "name": "max", - "docstrings": [ - "`max(a, b)` returns the maximum of its two float arguments.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n## Examples\n\n```rescript\nMath.max(1.0, 2.0) == 2.0\nMath.max(-1.0, -2.0) == -1.0\n```" - ], - "signature": "let max: (float, float) => float" - }, - { - "id": "Stdlib.Math.maxMany", - "kind": "value", - "name": "maxMany", - "docstrings": [ - "`maxMany(arr)` returns the maximum of the float in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n## Examples\n\n```rescript\nMath.maxMany([1.0, 2.0]) == 2.0\nMath.maxMany([-1.0, -2.0]) == -1.0\nMath.maxMany([])->Float.isFinite == false\n```" - ], - "signature": "let maxMany: array => float" - }, - { - "id": "Stdlib.Math.pow", - "kind": "value", - "name": "pow", - "docstrings": [ - "`pow(a, ~exp)` throws the given base `a` to the given exponent `exp`.\nSee [`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow) on MDN.\n\n## Examples\n\n```rescript\nMath.pow(2.0, ~exp=4.0) == 16.0\nMath.pow(3.0, ~exp=4.0) == 81.0\n```" - ], - "signature": "let pow: (float, ~exp: float) => float" - }, - { - "id": "Stdlib.Math.random", - "kind": "value", - "name": "random", - "docstrings": [ - "`random()` returns a random number in the half-closed interval \\[0,1\\].\nSee [`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random) on MDN.\n\n## Examples\n\n```rescript\nMath.random()\n```" - ], - "signature": "let random: unit => float" - }, - { - "id": "Stdlib.Math.round", - "kind": "value", - "name": "round", - "docstrings": [ - "`round(v)` returns then value of `v` rounded to nearest integral value\n(expressed as a float). If the fractional portion of the argument `v` is greater\nthan `0.5`, the argument `v` is rounded to the float with the next higher\nabsolute value.\nSee [`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round) on MDN.\n\n## Examples\n\n```rescript\nMath.round(-20.5) == -20.0\nMath.round(-0.1) == -0.0\nMath.round(0.0) == 0.0\nMath.round(-0.0) == -0.0\n```" - ], - "signature": "let round: float => float" - }, - { - "id": "Stdlib.Math.sign", - "kind": "value", - "name": "sign", - "docstrings": [ - "`sign(v)` returns the sign of its foat argument: `-1` if negative, `0` if\nzero, `1` if positive.\nSee [`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign) on MDN.\n\n## Examples\n\n```rescript\nMath.sign(3.0) == 1.0\nMath.sign(-3.0) == -1.0\nMath.sign(0.0) == 0.0\n```" - ], - "signature": "let sign: float => float" - }, - { - "id": "Stdlib.Math.sin", - "kind": "value", - "name": "sin", - "docstrings": [ - "`sin(v)` returns the sine of argument `v`, which must be specified in radians.\nSee [`Math.sin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin) on MDN.\n\n## Examples\n\n```rescript\nMath.sin(-0.0) == -0.0\nMath.sin(0.0) == 0.0\nMath.sin(1.0) == 0.8414709848078965\n```" - ], - "signature": "let sin: float => float" - }, - { - "id": "Stdlib.Math.sinh", - "kind": "value", - "name": "sinh", - "docstrings": [ - "`sinh(v)` returns then hyperbolic sine of argument `v`, which must be specified\nin radians.\nSee [`Math.sinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sinh) on MDN.\n\n## Examples\n\n```rescript\nMath.sinh(-0.0) == -0.0\nMath.sinh(0.0) == 0.0\nMath.sinh(1.0) == 1.1752011936438014\n```" - ], - "signature": "let sinh: float => float" - }, - { - "id": "Stdlib.Math.sqrt", - "kind": "value", - "name": "sqrt", - "docstrings": [ - "`sqrt(v)` returns the square root of `v`. If `v` is negative returns `NaN`.\nSee [`Math.sqrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt) on MDN.\n\n## Examples\n\n```rescript\nMath.sqrt(-1.0)->Float.isNaN == true\nMath.sqrt(-0.0) == -0.0\nMath.sqrt(0.0) == 0.0\nMath.sqrt(1.0) == 1.0\nMath.sqrt(9.0) == 3.0\n```" - ], - "signature": "let sqrt: float => float" - }, - { - "id": "Stdlib.Math.tan", - "kind": "value", - "name": "tan", - "docstrings": [ - "`tan(v)` returns the tangent of argument `v`, which must be specified in\nradians. Returns `NaN` if `v` is positive `Infinity` or negative `Infinity`.\nSee [`Math.tan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tan) on MDN.\n\n## Examples\n\n```rescript\nMath.tan(-0.0) == -0.0\nMath.tan(0.0) == 0.0\nMath.tan(1.0) == 1.5574077246549023\n```" - ], - "signature": "let tan: float => float" - }, - { - "id": "Stdlib.Math.tanh", - "kind": "value", - "name": "tanh", - "docstrings": [ - "`tanh(v)` returns the hyperbolic tangent of argument `v`, which must be\nspecified in radians.\nSee [`Math.tanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tanh) on MDN.\n\n## Examples\n\n```rescript\nMath.tanh(-0.0) == -0.0\nMath.tanh(0.0) == 0.0\nMath.tanh(1.0) == 0.7615941559557649\n```" - ], - "signature": "let tanh: float => float" - }, - { - "id": "Stdlib.Math.trunc", - "kind": "value", - "name": "trunc", - "docstrings": [ - "`trunc(v)` truncates the argument `v`, i.e., removes fractional digits.\nSee [`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc) on MDN.\n\n## Examples\n\n```rescript\nMath.trunc(0.123) == 0.0\nMath.trunc(1.999) == 1.0\nMath.trunc(13.37) == 13.0\nMath.trunc(42.84) == 42.0\n```" - ], - "signature": "let trunc: float => float" - } - ] - }, - "stdlib/list": { - "id": "Stdlib.List", - "name": "List", - "docstrings": [], - "items": [ - { - "id": "Stdlib.List.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Collection functions for manipulating the `list` data structures, a singly-linked list.\n\n**Prefer Array** if you need any of the following:\n\n- Random access of element\n- Better interop with JavaScript\n- Better memory usage & performance." - ], - "signature": "type t<'a> = list<'a>" - }, - { - "id": "Stdlib.List.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(list)` returns the length of `list`.\n\n## Examples\n\n```rescript\nList.length(list{1, 2, 3}) == 3\n```" - ], - "signature": "let length: list<'a> => int" - }, - { - "id": "Stdlib.List.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(list)`. See [`length`](#length)\n\n## Examples\n\n```rescript\nList.size(list{1, 2, 3}) == 3\n```" - ], - "signature": "let size: list<'a> => int" - }, - { - "id": "Stdlib.List.head", - "kind": "value", - "name": "head", - "docstrings": [ - "`head(list)` returns `Some(value)` where `value` is the first element in the\nlist, or `None` if `list` is an empty list.\n\n## Examples\n\n```rescript\nList.head(list{}) == None\nList.head(list{1, 2, 3}) == Some(1)\n```" - ], - "signature": "let head: list<'a> => option<'a>" - }, - { - "id": "Stdlib.List.headExn", - "kind": "value", - "name": "headExn", - "docstrings": [ - "`headExn(list)` same as [`head`](#head).\n\n## Examples\n\n```rescript\nList.headExn(list{1, 2, 3}) == 1\n\nswitch List.headExn(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let headExn: list<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.List.headOrThrow", - "kind": "value", - "name": "headOrThrow", - "docstrings": [ - "`headOrThrow(list)` same as [`head`](#head).\n\n## Examples\n\n```rescript\nList.headOrThrow(list{1, 2, 3}) == 1\n\nswitch List.headOrThrow(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let headOrThrow: list<'a> => 'a" - }, - { - "id": "Stdlib.List.tail", - "kind": "value", - "name": "tail", - "docstrings": [ - "`tail(list)` returns `None` if `list` is empty, otherwise it returns `Some(tail)`\nwhere `tail` is everything except the first element of `list`.\n\n## Examples\n\n```rescript\nList.tail(list{1, 2, 3}) == Some(list{2, 3})\n\nList.tail(list{}) == None\n```" - ], - "signature": "let tail: list<'a> => option>" - }, - { - "id": "Stdlib.List.tailExn", - "kind": "value", - "name": "tailExn", - "docstrings": [ - "`tailExn(list)` same as [`tail`](#tail).\n\n## Examples\n\n```rescript\nList.tailExn(list{1, 2, 3}) == list{2, 3}\n\nswitch List.tailExn(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let tailExn: list<'a> => list<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.List.tailOrThrow", - "kind": "value", - "name": "tailOrThrow", - "docstrings": [ - "`tailOrThrow(list)` same as [`tail`](#tail).\n\n## Examples\n\n```rescript\nList.tailOrThrow(list{1, 2, 3}) == list{2, 3}\n\nswitch List.tailOrThrow(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let tailOrThrow: list<'a> => list<'a>" - }, - { - "id": "Stdlib.List.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(list, value)` adds a `value` to the beginning of list `list`.\n\n## Examples\n\n```rescript\nList.add(list{2, 3}, 1) == list{1, 2, 3}\n\nList.add(list{\"World\", \"!\"}, \"Hello\") == list{\"Hello\", \"World\", \"!\"}\n```" - ], - "signature": "let add: (list<'a>, 'a) => list<'a>" - }, - { - "id": "Stdlib.List.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(list, index)` return the `index` element in `list`, or `None` if `index`\nis larger than the length of list `list`.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.get(1) == Some(\"B\")\n\nabc->List.get(4) == None\n```" - ], - "signature": "let get: (list<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.List.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(list, index)` same as [`get`](#get).\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.getExn(1) == \"B\"\n\nswitch abc->List.getExn(4) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if `index` is larger than the length of list." - ], - "signature": "let getExn: (list<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.List.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(list, index)` same as [`get`](#get).\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.getOrThrow(1) == \"B\"\n\nswitch abc->List.getOrThrow(4) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if `index` is larger than the length of list." - ], - "signature": "let getOrThrow: (list<'a>, int) => 'a" - }, - { - "id": "Stdlib.List.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(length, value)` returns a list of length `length` with each element filled\nwith `value`. Returns an empty list if `value` is negative.\n\n## Examples\n\n```rescript\nList.make(~length=3, 1) == list{1, 1, 1}\n```" - ], - "signature": "let make: (~length: int, 'a) => list<'a>" - }, - { - "id": "Stdlib.List.fromInitializer", - "kind": "value", - "name": "fromInitializer", - "docstrings": [ - "`fromInitializer(length, f)` return a list of length `length` with element initialized\nwith `f`. Returns an empty list if `length` is negative.\n\n## Examples\n\n```rescript\nList.fromInitializer(~length=5, i => i) == list{0, 1, 2, 3, 4}\n\nList.fromInitializer(~length=5, i => i * i) == list{0, 1, 4, 9, 16}\n```" - ], - "signature": "let fromInitializer: (~length: int, int => 'a) => list<'a>" - }, - { - "id": "Stdlib.List.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "`shuffle(list)` returns a new list in random order.\n\n## Examples\n\n```rescript\nList.shuffle(list{1, 2, 3}) // list{2, 1, 3}\n```" - ], - "signature": "let shuffle: list<'a> => list<'a>" - }, - { - "id": "Stdlib.List.toShuffled", - "kind": "value", - "name": "toShuffled", - "docstrings": [ - "`toShuffled(list)` returns a new list in random order.\n\n## Examples\n\n```rescript\nList.toShuffled(list{1, 2, 3}) // list{2, 1, 3}\n```" - ], - "signature": "let toShuffled: list<'a> => list<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.List.drop", - "kind": "value", - "name": "drop", - "docstrings": [ - "`drop(list, value)` return a new list, dropping the first `value` element.\nReturns `None` if `list` has fewer than `value` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.drop(2) == Some(list{3})\n\nlist{1, 2, 3}->List.drop(3) == Some(list{})\n\nlist{1, 2, 3}->List.drop(4) == None\n```" - ], - "signature": "let drop: (list<'a>, int) => option>" - }, - { - "id": "Stdlib.List.take", - "kind": "value", - "name": "take", - "docstrings": [ - "`take(list, value)` returns a list with the first `value` elements from `list`,\nor `None` if `list` has fewer than `value` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.take(1) == Some(list{1})\n\nlist{1, 2, 3}->List.take(2) == Some(list{1, 2})\n\nlist{1, 2, 3}->List.take(4) == None\n```" - ], - "signature": "let take: (list<'a>, int) => option>" - }, - { - "id": "Stdlib.List.splitAt", - "kind": "value", - "name": "splitAt", - "docstrings": [ - "`splitAt(list, n)` split the list `list` at `n`. Returns `None` when the length\nof `list` is less than `n`.\n\n## Examples\n\n```rescript\nlist{\"Hello\", \"World\"}->List.splitAt(1) == Some((list{\"Hello\"}, list{\"World\"}))\n\nlist{0, 1, 2, 3, 4}->List.splitAt(2) == Some((list{0, 1}, list{2, 3, 4}))\n```" - ], - "signature": "let splitAt: (list<'a>, int) => option<(list<'a>, list<'a>)>" - }, - { - "id": "Stdlib.List.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(list1, list2)` returns the list obtained by adding `list2` after `list1`.\n\n## Examples\n\n```rescript\nList.concat(list{1, 2, 3}, list{4, 5}) == list{1, 2, 3, 4, 5}\n```" - ], - "signature": "let concat: (list<'a>, list<'a>) => list<'a>" - }, - { - "id": "Stdlib.List.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(arr)` returns the list obtained by concatenating all the lists in\narray `arr`, in order.\n\n## Examples\n\n```rescript\nList.concatMany([list{1, 2, 3}, list{}, list{3}]) == list{1, 2, 3, 3}\n```" - ], - "signature": "let concatMany: array> => list<'a>" - }, - { - "id": "Stdlib.List.reverseConcat", - "kind": "value", - "name": "reverseConcat", - "docstrings": [ - "`reverseConcat(list1, list2)` is equivalent to writing: `concat(reverse(list1, list2)`\n\n## Examples\n\n```rescript\nList.reverseConcat(list{1, 2}, list{3, 4}) == list{2, 1, 3, 4}\n```" - ], - "signature": "let reverseConcat: (list<'a>, list<'a>) => list<'a>" - }, - { - "id": "Stdlib.List.flat", - "kind": "value", - "name": "flat", - "docstrings": [ - "`flat(list)` return the list obtained by concatenating all the lists in\n`list`, in order.\n\n## Examples\n\n```rescript\nList.flat(list{list{1, 2, 3}, list{}, list{3}}) == list{1, 2, 3, 3}\n```" - ], - "signature": "let flat: list> => list<'a>" - }, - { - "id": "Stdlib.List.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nlist{1, 2}->List.map(x => x + 1) == list{2, 3}\n```" - ], - "signature": "let map: (list<'a>, 'a => 'b) => list<'b>" - }, - { - "id": "Stdlib.List.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "`zip(list1, list2)` returns a list of pairs from the two lists with the length\nof the shorter list.\n\n## Examples\n\n```rescript\nList.zip(list{1, 2}, list{3, 4, 5}) == list{(1, 3), (2, 4)}\n```" - ], - "signature": "let zip: (list<'a>, list<'b>) => list<('a, 'b)>" - }, - { - "id": "Stdlib.List.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "`zipBy(list1, list2, f)`. See [`zip`](#zip)\n\n## Examples\n\n```rescript\nList.zipBy(list{1, 2, 3}, list{4, 5}, (a, b) => 2 * a + b) == list{6, 9}\n```" - ], - "signature": "let zipBy: (list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>" - }, - { - "id": "Stdlib.List.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(list, f)` applies `f` to each element of `list`. Function `f`\ntakes two arguments: the index starting from 0 and the element from `list`, in\nthat order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.mapWithIndex((x, index) => index + x) == list{1, 3, 5}\n```" - ], - "signature": "let mapWithIndex: (list<'a>, ('a, int) => 'b) => list<'b>" - }, - { - "id": "Stdlib.List.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(arr)` converts the given array `arr` to a list.\n\n## Examples\n\n```rescript\nList.fromArray([1, 2, 3]) == list{1, 2, 3}\n```" - ], - "signature": "let fromArray: array<'a> => list<'a>" - }, - { - "id": "Stdlib.List.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(list)` converts the given list `list` to an array.\n\n## Examples\n\n```rescript\nList.toArray(list{1, 2, 3}) == [1, 2, 3]\n```" - ], - "signature": "let toArray: list<'a> => array<'a>" - }, - { - "id": "Stdlib.List.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(list)` returns a new list whose elements are those of `list` in\nreversed order.\n\n## Examples\n\n```rescript\nList.reverse(list{1, 2, 3}) == list{3, 2, 1}\n```" - ], - "signature": "let reverse: list<'a> => list<'a>" - }, - { - "id": "Stdlib.List.mapReverse", - "kind": "value", - "name": "mapReverse", - "docstrings": [ - "`mapReverse(list, f)` is equivalent to `map` function.\n\n## Examples\n\n```rescript\nlet f = x => x * x\nlet l = list{3, 4, 5}\n\nlet withMap = List.map(l, f)->List.reverse\nlet withMapReverse = l->List.mapReverse(f)\n\nConsole.log(withMap == withMapReverse) // true\n```" - ], - "signature": "let mapReverse: (list<'a>, 'a => 'b) => list<'b>" - }, - { - "id": "Stdlib.List.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(list, f)` call `f` on each element of `list` from the beginning to end.\n`f` returns `unit`, so no new array is created. Use `forEach` when you are primarily\nconcerned with repetitively creating side effects.\n\n## Examples\n\n```rescript\nList.forEach(list{\"a\", \"b\", \"c\"}, x => Console.log(\"Item: \" ++ x))\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\n```" - ], - "signature": "let forEach: (list<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.List.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(list, f, index)` call `f` on each element of `list` from beginning\nto end. Function `f` takes two arguments: the `index` starting from 0 and the\nelement from `list`. `f` returns `unit`.\n\n## Examples\n\n```rescript\nList.forEachWithIndex(list{\"a\", \"b\", \"c\"}, (x, index) => {\n Console.log(\"Item \" ++ Int.toString(index) ++ \" is \" ++ x)\n})\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\n```" - ], - "signature": "let forEachWithIndex: (list<'a>, ('a, int) => unit) => unit" - }, - { - "id": "Stdlib.List.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(list, initialValue, f)` applies `f` to each element of `list` from\nbeginning to end. Function `f` has two parameters: the item from the list and\nan \"accumulator\", which starts with a value of `initialValue`. `reduce` returns\nthe final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduce(0, (a, b) => a + b) == 10\n\n// same as\n\nlist{1, 2, 3, 4}->List.reduce(0, (acc, item) => acc + item) == 10\n```" - ], - "signature": "let reduce: (list<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.List.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(list, initialValue, f)` applies `f` to each element of `list`\nfrom beginning to end. Function `f` has three parameters: the item from the list\nand an \"accumulator\", which starts with a value of `initialValue` and the index\nof each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduceWithIndex(0, (acc, item, index) => acc + item + index) == 16\n```" - ], - "signature": "let reduceWithIndex: (list<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Stdlib.List.reduceReverse", - "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "`reduceReverse(list, initialValue, f)` works like `reduce`, except that\nfunction `f` is applied to each item of `list` from the last back to the first.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduceReverse(0, (a, b) => a + b) == 10\n\nlist{1, 2, 3, 4}->List.reduceReverse(10, (a, b) => a - b) == 0\n\nlist{1, 2, 3, 4}->List.reduceReverse(list{}, List.add) == list{1, 2, 3, 4}\n```" - ], - "signature": "let reduceReverse: (list<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.List.mapReverse2", - "kind": "value", - "name": "mapReverse2", - "docstrings": [ - "`mapReverse2(list1, list2, f)` is equivalent to `List.zipBy(list1, list2, f)->List.reverse`.\n\n## Examples\n\n```rescript\nList.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) == list{4, 2}\n```" - ], - "signature": "let mapReverse2: (list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>" - }, - { - "id": "Stdlib.List.forEach2", - "kind": "value", - "name": "forEach2", - "docstrings": [ - "`forEach2(list1, list2, f)` is similar to `forEach`, but accepts two lists and\nstops at the length of the shorter list.\n\n## Examples\n\n```rescript\nList.forEach2(list{\"Z\", \"Y\"}, list{\"A\", \"B\", \"C\"}, (x, y) => Console.log2(x, y))\n\n/*\n prints:\n \"Z\" \"A\"\n \"Y\" \"B\"\n*/\n```" - ], - "signature": "let forEach2: (list<'a>, list<'b>, ('a, 'b) => 'c) => unit" - }, - { - "id": "Stdlib.List.reduce2", - "kind": "value", - "name": "reduce2", - "docstrings": [ - "`reduce2(list1, list2, initialValue, f)` applies `f` to each element of `list1`\nand `list2` from beginning to end. Stops with the shorter list. Function `f` has\nthree parameters: an accumulator which starts with a value of `initialValue`, an\nitem from `l1`, and an item from `l2`. `reduce2` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nList.reduce2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduce2: (list<'b>, list<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a" - }, - { - "id": "Stdlib.List.reduceReverse2", - "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "`reduceReverse2(list1, list2, initialValue, f)` applies `f` to each element of\n`list1` and `list2`from end to beginning. Stops with the shorter list. Function\n`f` has three parameters: an accumulator which starts with a value of\n`initialValue`, an item from `l1`, and an item from `l2`. `reduce2` returns the\nfinal value of the accumulator.\n\n## Examples\n\n```rescript\nList.reduceReverse2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduceReverse2: (list<'a>, list<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" - }, - { - "id": "Stdlib.List.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(list, f)` returns `true` if all elements in `list` satisfy `f`, where `f`\nis a predicate: a function taking an element and returning a bool.\n\n## Examples\n\n```rescript\nlet isBelow10 = value => value < 10\n\nlist{1, 9, 8, 2}->List.every(isBelow10) == true\n\nlist{1, 99, 8, 2}->List.every(isBelow10) == false\n```" - ], - "signature": "let every: (list<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.List.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(list, f)` returns `true` if at least _one_ of the elements in `list`\nsatisfies `f`, where `f` is a predicate: a function taking an element and\nreturning a bool.\n\n## Examples\n\n```rescript\nlet isAbove100 = value => value > 100\n\nlist{101, 1, 2, 3}->List.some(isAbove100) == true\n\nlist{1, 2, 3, 4}->List.some(isAbove100) == false\n```" - ], - "signature": "let some: (list<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.List.every2", - "kind": "value", - "name": "every2", - "docstrings": [ - "`every2(list1, list2, f)` returns `true` if predicate `f` is `true` for all\npairs of elements up to the shorter length (i.e. `min(length(list1), length(list2))`)\n\n## Examples\n\n```rescript\nList.every2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nList.every2(list{}, list{1}, (a, b) => a > b) == true\n\nList.every2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nList.every2(list{0, 1}, list{5, 0}, (a, b) => a > b) == false\n```" - ], - "signature": "let every2: (list<'a>, list<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.List.some2", - "kind": "value", - "name": "some2", - "docstrings": [ - "`some2(list1, list2, f)` returns `true` if predicate `f` is `true` for any pair\nof elements up to the shorter length (i.e. `min(length(list1), length(list2))`)\n\n## Examples\n\n```rescript\nList.some2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nList.some2(list{}, list{1}, (a, b) => a > b) == false\n\nList.some2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nList.some2(list{0, 1}, list{5, 0}, (a, b) => a > b) == true\n```" - ], - "signature": "let some2: (list<'a>, list<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.List.compareLength", - "kind": "value", - "name": "compareLength", - "docstrings": [ - "`compareLength(list1, list2)` compare two lists solely by length. Returns `-1.` if\n`length(list1)` is less than `length(list2)`, `0.` if `length(list1)` equals\n`length(list2)`, and `1.` if `length(list1)` is greater than `length(list2)`.\n\n## Examples\n\n```rescript\nList.compareLength(list{1, 2}, list{3, 4, 5, 6}) == -1.\n\nList.compareLength(list{1, 2, 3}, list{4, 5, 6}) == 0.\n\nList.compareLength(list{1, 2, 3, 4}, list{5, 6}) == 1.\n```" - ], - "signature": "let compareLength: (list<'a>, list<'a>) => Ordering.t" - }, - { - "id": "Stdlib.List.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(list1, list2, f)` compare elements one by one `f`. `f` returns a negative\nnumber if `list1` is \"less than\" `list2`, zero if `list1` is \"equal to\" `list2`,\na positive number if `list1` is \"greater than\" `list2`.\n\nThe comparison returns the first non-zero result of `f`, or zero if `f` returns\nzero for all `list1` and `list2`.\n\n- If all items have compared equal, but `list1` is exhausted first, return `-1.`. (`list1` is shorter).\n- If all items have compared equal, but `list2` is exhausted first, return `1.` (`list1` is longer).\n\n## Examples\n\n```rescript\nList.compare(list{3}, list{3, 7}, (a, b) => Int.compare(a, b)) == -1.\nList.compare(list{5, 3}, list{5}, (a, b) => Int.compare(a, b)) == 1.\nList.compare(list{1, 3, 5}, list{1, 4, 2}, (a, b) => Int.compare(a, b)) == -1.\nList.compare(list{1, 3, 5}, list{1, 2, 3}, (a, b) => Int.compare(a, b)) == 1.\nList.compare(list{1, 3, 5}, list{1, 3, 5}, (a, b) => Int.compare(a, b)) == 0.\n```\n\n**Please note:** The total ordering of List is different from Array,\nfor Array, we compare the length first and, only if the lengths are equal, elements one by one.\nFor lists, we just compare elements one by one." - ], - "signature": "let compare: (list<'a>, list<'a>, ('a, 'a) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.List.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(list1, list2, f)` check equality of `list2` and `list2` using `f` for\nequality on elements, where `f` is a function that returns `true` if items `x` and\n`y` meet some criterion for equality, `false` otherwise. equal `false` if length\nof `list1` and `list2` are not the same.\n\n## Examples\n\n```rescript\nList.equal(list{1, 2, 3}, list{1, 2}, (a, b) => a == b) == false\n\nList.equal(list{1, 2}, list{1, 2}, (a, b) => a == b) == true\n\nList.equal(list{1, 2, 3}, list{-1, -2, -3}, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let equal: (list<'a>, list<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Stdlib.List.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(list, element, f)` returns `true` if the list contains at least one\n`element` for which `f` returns \\`true'.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.has(2, (a, b) => a == b) == true\n\nlist{1, 2, 3}->List.has(4, (a, b) => a == b) == false\n\nlist{-1, -2, -3}->List.has(2, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let has: (list<'a>, 'b, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.List.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(list, f)` returns `Some(value)` for the first value in `list` that\nsatisfies the predicate function `f`. Returns `None` if no element satisfies\nthe function.\n\n## Examples\n\n```rescript\nList.find(list{1, 4, 3, 2}, x => x > 3) == Some(4)\n\nList.find(list{1, 4, 3, 2}, x => x > 4) == None\n```" - ], - "signature": "let find: (list<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.List.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(list, f)` returns a list of all elements in `list` which satisfy the\npredicate function `f`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nList.filter(list{1, 2, 3, 4}, isEven) == list{2, 4}\n\nList.filter(list{None, Some(2), Some(3), None}, Option.isSome) == list{Some(2), Some(3)}\n```" - ], - "signature": "let filter: (list<'a>, 'a => bool) => list<'a>" - }, - { - "id": "Stdlib.List.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(list, f)` returns a list of all elements in `list` which\nsatisfy the predicate function `f`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nList.filterWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) == list{1, 3}\n```" - ], - "signature": "let filterWithIndex: (list<'a>, ('a, int) => bool) => list<'a>" - }, - { - "id": "Stdlib.List.filterMap", - "kind": "value", - "name": "filterMap", - "docstrings": [ - "`filterMap(list, f)` applies `f` to each element of `list`. If `f` returns\n`Some(value)`, then `value` is _kept_ in the resulting list. If `f` returns\n`None`, the element is _not_ retained in the result.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nlist{1, 2, 3, 4}->List.filterMap(x =>\n if isEven(x) {\n Some(x)\n } else {\n None\n }\n) // list{2, 4}\n\nlist{Some(1), Some(2), None}->List.filterMap(x => x) == list{1, 2}\n```" - ], - "signature": "let filterMap: (list<'a>, 'a => option<'b>) => list<'b>" - }, - { - "id": "Stdlib.List.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(list, f)` creates a pair of lists; the first list consists of all\nelements of `list` that satisfy the predicate function `f`, the second list\nconsists of all elements of `list` that _do not_ satisfy `f`.\n\n## Examples\n\n```rescript\n// (elementsThatSatisfies, elementsThatDoesNotSatisfy)\n\nList.partition(list{1, 2, 3, 4}, x => x > 2) == (list{3, 4}, list{1, 2})\n```" - ], - "signature": "let partition: (list<'a>, 'a => bool) => (list<'a>, list<'a>)" - }, - { - "id": "Stdlib.List.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "`unzip(list)` takes a list of pairs and creates a pair of lists. The first list\ncontains all the first items of the pairs, the second list contains all the\nsecond items.\n\n## Examples\n\n```rescript\nList.unzip(list{(1, 2), (3, 4)}) // (list{1, 3}, list{2, 4})\n\nList.unzip(list{(\"H\", \"W\"), (\"e\", \"o\"), (\"l\", \"r\"), (\"l\", \"l\"), (\"o\", \"d\"), (\" \", \"!\")}) ==\n (list{\"H\", \"e\", \"l\", \"l\", \"o\", \" \"}, list{\"W\", \"o\", \"r\", \"l\", \"d\", \"!\"})\n```" - ], - "signature": "let unzip: list<('a, 'b)> => (list<'a>, list<'b>)" - }, - { - "id": "Stdlib.List.getAssoc", - "kind": "value", - "name": "getAssoc", - "docstrings": [ - "`getAssoc(list, k, f)` return the second element of a pair in `list` where\nthe first element equals `k` as per the predicate function `f`, or `None` if\nnot found.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.getAssoc(3, (a, b) => a == b) // Some(\"c\")\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->List.getAssoc(15, (k, item) =>\n k /* 15 */ == item\n) == Some(\"afternoon\")\n/* 9, 5, 22 */\n```" - ], - "signature": "let getAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.hasAssoc", - "kind": "value", - "name": "hasAssoc", - "docstrings": [ - "`hasAssoc(list, k, f)` returns `true` if there is a pair in `list` where the\nfirst element equals `k` as per the predicate function `f`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.hasAssoc(1, (a, b) => a == b) // true\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->List.hasAssoc(25, (k, item) =>\n k /* 25 */ == item\n) == false\n/* 9, 5, 22 */\n```" - ], - "signature": "let hasAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => bool", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.removeAssoc", - "kind": "value", - "name": "removeAssoc", - "docstrings": [ - "`removeAssoc(list, k, f)` return a list after removing the first pair whose\nfirst value is `k` per the equality predicate `f`, if not found, return a new\nlist identical to `list`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.removeAssoc(1, (a, b) => a == b) // list{(2, \"b\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->List.removeAssoc(9, (k, item) =>\n k /* 9 */ == item\n) == list{(15, \"afternoon\"), (22, \"night\")}\n/* 9, 5, 22 */\n```" - ], - "signature": "let removeAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => list<('a, 'c)>", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.setAssoc", - "kind": "value", - "name": "setAssoc", - "docstrings": [ - "`setAssoc(list, k, v, f)`. If `k` exists in `list` by satisfying the `f`\npredicate, return a new list with the key and value replaced by the new `k` and\n`v`, otherwise, return a new list with the pair `k`, `v` added to the head of\n`list`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.setAssoc(2, \"x\", (a, b) => a == b) ==\n list{(1, \"a\"), (2, \"x\"), (3, \"c\")}\n\nlist{(1, \"a\"), (3, \"c\")}->List.setAssoc(2, \"b\", (a, b) => a == b) ==\n list{(2, \"b\"), (1, \"a\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (3, \"morning?!\"), (22, \"night\")}->List.setAssoc(15, \"afternoon\", (a, b) =>\n mod(a, 12) == mod(b, 12)\n) == list{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n```\n\n**Please note**: In the last example, since: `15 mod 12` equals `3 mod 12`. Both\nthe key _and_ the value are replaced in the list." - ], - "signature": "let setAssoc: (list<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => list<('a, 'c)>", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(list, f)` returns a sorted list.\n\n## Examples\n\n```rescript\nList.sort(list{5, 4, 9, 3, 7}, Int.compare) == list{3, 4, 5, 7, 9}\n```" - ], - "signature": "let sort: (list<'a>, ('a, 'a) => Ordering.t) => list<'a>" - }, - { - "id": "Stdlib.List.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(list)` ignores the provided list and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: list<'a> => unit" - } - ] - }, - "stdlib/lazy": { - "id": "Stdlib.Lazy", - "name": "Lazy", - "docstrings": [ - "This module provides a type `Lazy.t` and functions to create and\n manipulate lazy values. A lazy value is a value that is not\n computed until it is needed. This is useful for deferring\n computations that may be expensive or unnecessary." - ], - "items": [ - { - "id": "Stdlib.Lazy.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of a lazy value. `Lazy.t<'a>` represents a lazy value\n that will eventually yield a value of type `'a` when accessed.\n The value is computed only once, and the result is cached for\n subsequent accesses. If the computation throws an exception,\n the same exception is thrown again on subsequent accesses." - ], - "signature": "type t<+'a>" - }, - { - "id": "Stdlib.Lazy.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`Lazy.make(f)` creates a lazy value from `f` which is the\n computation to be deferred of type `unit => 'a`. \n The function returns a lazy value of type `Lazy.t<'a>`. \n The computation is not executed until the lazy value is accessed.\n\n ## Examples \n ```rescript \n let lazyValue = Lazy.make(() => {\n // Some expensive computation\n Console.log(\"Computing...\")\n 42\n });\n lazyValue->Lazy.get->assertEqual(42)\n ```" - ], - "signature": "let make: (unit => 'a) => t<'a>" - }, - { - "id": "Stdlib.Lazy.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`Lazy.get(x)` forces the suspension `x` and returns its result.\n If `x` has already been forced, `Lazy.get(x)` returns the\n same value again without recomputing it. If it threw an\n exception, the same exception is thrown again.\n Throw `Undefined` if the forcing of `x` tries to force `x` itself\n recursively. This is a runtime error." - ], - "signature": "let get: t<'a> => 'a" - }, - { - "id": "Stdlib.Lazy.isEvaluated", - "kind": "value", - "name": "isEvaluated", - "docstrings": [ - "`Lazy.isEvaluated(x)` returns `true` if the suspension `x` has\n already been forced and did not throw an exception. Otherwise, \n it returns `false`. This is useful for checking if a lazy value\n has been computed before accessing it.\n\n ## Examples\n ```rescript \n let lazyValue = Lazy.make(() => {\n // Some expensive computation\n Console.log(\"Computing...\")\n 42\n })\n Lazy.isEvaluated(lazyValue)->assertEqual(false)\n lazyValue->Lazy.get->assertEqual(42)\n lazyValue->Lazy.isEvaluated->assertEqual(true)\n ```" - ], - "signature": "let isEvaluated: t<'a> => bool" - }, - { - "id": "Stdlib.Lazy.force", - "kind": "value", - "name": "force", - "docstrings": [ - "`force(x)` forces the suspension `x` and returns its result.\n If `x` has already been forced, `Lazy.force(x)` returns the\n same value again without recomputing it. If it threw an exception,\n the same exception is thrown again.\n Throw `Undefined` if the forcing of `x` tries to force `x` itself\n recursively." - ], - "signature": "let force: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.force_val", - "kind": "value", - "name": "force_val", - "docstrings": [ - "`force_val(x)` forces the suspension `x` and returns its\n result. If `x` has already been forced, `force_val(x)`\n returns the same value again without recomputing it.\n Throw `Undefined` if the forcing of `x` tries to force `x` itself\n recursively.\n If the computation of `x` throws an exception, it is unspecified\n whether `force_val(x)` throws the same exception or `Undefined`." - ], - "signature": "let force_val: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.from_fun", - "kind": "value", - "name": "from_fun", - "docstrings": [ - "`Lazy.from_fun(f)` creates a lazy value from `f` which is the\n computation to be deferred of type `unit => 'a`. \n The function returns a lazy value of type `Lazy.t<'a>`. \n The computation is not executed until the lazy value is accessed." - ], - "signature": "let from_fun: (unit => 'a) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.from_val", - "kind": "value", - "name": "from_val", - "docstrings": [ - "`from_val(v)` returns an already-forced suspension of `v`.\n This is for special purposes only." - ], - "signature": "let from_val: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.is_val", - "kind": "value", - "name": "is_val", - "docstrings": [ - "`is_val(x)` returns `true` if `x has already been forced and\n did not throw an exception." - ], - "signature": "let is_val: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(lazyValue)` ignores the provided lazy value and returns unit.\n\n This helper is useful when you want to discard a lazy value (for example, when only its side effects matter)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/json": { - "id": "Stdlib.JSON", - "name": "JSON", - "docstrings": [ - "Functions for interacting with JSON." - ], - "items": [ - { - "id": "Stdlib.JSON.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a JSON object." - ], - "signature": "@unboxed\ntype t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)" - }, - { - "id": "Stdlib.JSON.replacer", - "kind": "type", - "name": "replacer", - "docstrings": [], - "signature": "@unboxed\ntype replacer =\n | Keys(array)\n | Replacer((string, t) => t)" - }, - { - "id": "Stdlib.JSON.parseOrThrow", - "kind": "value", - "name": "parseOrThrow", - "docstrings": [ - "`parseOrThrow(string, ~reviver=?)`\n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\ntry {\n let _ = JSON.parseOrThrow(`{\"foo\":\"bar\",\"hello\":\"world\"}`)\n // { foo: 'bar', hello: 'world' }\n\n let _ = JSON.parseOrThrow(\"\")\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\ntry {\n JSON.parseOrThrow(jsonString, ~reviver)->Console.log\n // { hello: 'WORLD', someNumber: 42 }\n\n JSON.parseOrThrow(\"\", ~reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions\n\n- Throws a SyntaxError (Exn.t) if the string isn't valid JSON." - ], - "signature": "let parseOrThrow: (string, ~reviver: (string, t) => t=?) => t" - }, - { - "id": "Stdlib.JSON.parseExn", - "kind": "value", - "name": "parseExn", - "docstrings": [ - "`parseExn(string, ~reviver=?)`\n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\ntry {\n let _ = JSON.parseExn(`{\"foo\":\"bar\",\"hello\":\"world\"}`)\n // { foo: 'bar', hello: 'world' }\n\n let _ = JSON.parseExn(\"\")\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\ntry {\n JSON.parseExn(jsonString, ~reviver)->Console.log\n // { hello: 'WORLD', someNumber: 42 }\n\n JSON.parseExn(\"\", ~reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions\n\n- Throws a SyntaxError (Exn.t) if the string isn't valid JSON." - ], - "signature": "let parseExn: (string, ~reviver: (string, t) => t=?) => t", - "deprecated": "Use `parseOrThrow` instead" - }, - { - "id": "Stdlib.JSON.parseExnWithReviver", - "kind": "value", - "name": "parseExnWithReviver", - "docstrings": [ - "`parseExnWithReviver(string, reviver)`\n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\nJSON.parseExnWithReviver(jsonString, reviver)->Console.log\n// { hello: 'WORLD', someNumber: 42 }\n\ntry {\n JSON.parseExnWithReviver(\"\", reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions\n\n- Throws a SyntaxError if the string is not a valid JSON." - ], - "signature": "let parseExnWithReviver: (string, (string, t) => t) => t", - "deprecated": "Use `parseOrThrow` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringify", - "kind": "value", - "name": "stringify", - "docstrings": [ - "`stringify(json, ~replacer=?, ~space=?)`\n\nConverts a JSON object to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value,\nor an array of keys which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAny` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringify(json)\n// {\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}\n\nJSON.stringify(json, ~space=2)\n// {\n// \"foo\": \"bar\",\n// \"hello\": \"world\",\n// \"someNumber\": 42\n// }\n\nJSON.stringify(json, ~replacer=Keys([\"foo\", \"someNumber\"]))\n// {\"foo\":\"bar\",\"someNumber\":42}\n\nlet replacer = JSON.Replacer(\n (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n },\n)\n\nJSON.stringify(json, ~replacer)\n// {\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}\n```" - ], - "signature": "let stringify: (t, ~replacer: replacer=?, ~space: int=?) => string" - }, - { - "id": "Stdlib.JSON.stringifyWithIndent", - "kind": "value", - "name": "stringifyWithIndent", - "docstrings": [ - "`stringifyWithIndent(json, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nIf you want to stringify any type, use `JSON.stringifyAnyWithIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithIndent(json, 2)\n// {\n// \"foo\": \"bar\",\n// \"hello\": \"world\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithIndent: (t, int) => string", - "deprecated": "Use `stringify` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyWithReplacer", - "kind": "value", - "name": "stringifyWithReplacer", - "docstrings": [ - "`stringifyWithReplacer(json, replacer)`\n\nConverts a JSON object to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nIf you want to stringify any type, use `JSON.stringifyAnyWithReplacer` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\nJSON.stringifyWithReplacer(json, replacer)\n// {\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}\n```" - ], - "signature": "let stringifyWithReplacer: (t, (string, t) => t) => string", - "deprecated": "Use `stringify` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyWithReplacerAndIndent", - "kind": "value", - "name": "stringifyWithReplacerAndIndent", - "docstrings": [ - "`stringifyWithReplacerAndIndent(json, replacer, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nIf you want to stringify any type, use `JSON.stringifyAnyWithReplacerAndIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\nJSON.stringifyWithReplacerAndIndent(json, replacer, 2)\n// {\n// \"foo\": \"BAR\",\n// \"hello\": \"WORLD\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithReplacerAndIndent: (t, (string, t) => t, int) => string", - "deprecated": "Use `stringify` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.stringifyWithFilter", - "kind": "value", - "name": "stringifyWithFilter", - "docstrings": [ - "`stringifyWithFilter(json, filter)`\n\nConverts a JSON object to a JSON string.\nThe filter is an array of keys, which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAnyWithFilter` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithFilter(json, [\"foo\", \"someNumber\"])\n// {\"foo\":\"bar\",\"someNumber\":42}\n```" - ], - "signature": "let stringifyWithFilter: (t, array) => string", - "deprecated": "Use `stringify` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyWithFilterAndIndent", - "kind": "value", - "name": "stringifyWithFilterAndIndent", - "docstrings": [ - "`stringifyWithFilterAndIndent(json, filter, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nThe filter is an array of keys, which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAnyWithFilterAndIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithFilterAndIndent(json, [\"foo\", \"someNumber\"], 2)\n// {\n// \"foo\": \"bar\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithFilterAndIndent: (t, array, int) => string", - "deprecated": "Use `stringify` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.stringifyAny", - "kind": "value", - "name": "stringifyAny", - "docstrings": [ - "`stringifyAny(any, ~replacer=?, ~space=?)`\n\nConverts any type to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringify` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAny\n->Option.getUnsafe == `{\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}`\n\ndict\n->JSON.stringifyAny(~space=2)\n->Option.getUnsafe == `{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`\n\ndict\n->JSON.stringifyAny(~replacer=Keys([\"foo\", \"someNumber\"]))\n->Option.getUnsafe == `{\"foo\":\"bar\",\"someNumber\":42}`\n\nlet replacer = JSON.Replacer(\n (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n },\n)\n\ndict\n->JSON.stringifyAny(~replacer)\n->Option.getUnsafe == `{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\n// Throw a exception\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAny: ('a, ~replacer: replacer=?, ~space: int=?) => option" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithIndent", - "kind": "value", - "name": "stringifyAnyWithIndent", - "docstrings": [ - "`stringifyAnyWithIndent(any, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAnyWithIndent(2)\n->Option.getUnsafe == `{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithIndent: ('a, int) => option", - "deprecated": "Use `stringifyAny` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithReplacer", - "kind": "value", - "name": "stringifyAnyWithReplacer", - "docstrings": [ - "`stringifyAnyWithReplacer(json, replacer)`\n\nConverts any type to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithReplacer` instead.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\ndict\n->JSON.stringifyAnyWithReplacer(replacer)\n->Option.getUnsafe == `{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithReplacer: ('a, (string, t) => t) => option", - "deprecated": "Use `stringifyAny` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithReplacerAndIndent", - "kind": "value", - "name": "stringifyAnyWithReplacerAndIndent", - "docstrings": [ - "`stringifyAnyWithReplacerAndIndent(json, replacer, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithReplacerAndIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\ndict\n->JSON.stringifyAnyWithReplacer(replacer)\n->Option.getUnsafe == `{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithReplacerAndIndent: ('a, (string, t) => t, int) => option", - "deprecated": "Use `stringifyAny` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithFilter", - "kind": "value", - "name": "stringifyAnyWithFilter", - "docstrings": [ - "`stringifyAnyWithFilter(json, filter)`\n\nConverts any type to a JSON string.\nThe filter is an array of keys, which should be included in the output.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithFilter` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict->JSON.stringifyAnyWithFilter([\"foo\", \"someNumber\"]) == `{\"foo\":\"bar\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithFilter: ('a, array) => string", - "deprecated": "Use `stringifyAny` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithFilterAndIndent", - "kind": "value", - "name": "stringifyAnyWithFilterAndIndent", - "docstrings": [ - "`stringifyAnyWithFilterAndIndent(json, filter, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nThe filter is an array of keys, which should be included in the output.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithFilterAndIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAny\n->Option.getUnsafe == `{\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}`\n\ndict\n->JSON.stringifyAny(~space=2)\n->Option.getUnsafe == `{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`\n\ndict\n->JSON.stringifyAny(~replacer=Keys([\"foo\", \"someNumber\"]))\n->Option.getUnsafe == `{\"foo\":\"bar\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithFilterAndIndent: ('a, array, int) => string", - "deprecated": "Use `stringifyAny` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(json)` ignores the provided json and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/jsexn": { - "id": "Stdlib.JsExn", - "name": "JsExn", - "docstrings": [ - "Provide utilities for dealing with JS exceptions.\n\nJS exceptions can be of any type, even though they *should* be of type `Error` of one of its subclasses.\n\nSee [`throw`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/throw) on MDN." - ], - "items": [ - { - "id": "Stdlib.JsExn.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JS exception" - ], - "signature": "type t = unknown" - }, - { - "id": "Stdlib.JsExn.fromException", - "kind": "value", - "name": "fromException", - "docstrings": [], - "signature": "let fromException: exn => option" - }, - { - "id": "Stdlib.JsExn.anyToExnInternal", - "kind": "value", - "name": "anyToExnInternal", - "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a JsExn if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." - ], - "signature": "let anyToExnInternal: 'a => exn" - }, - { - "id": "Stdlib.JsExn.stack", - "kind": "value", - "name": "stack", - "docstrings": [ - "`stack(jsExn)` retrieves the `stack` property of the exception, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\ntry {JsError.make(\"error\")->JsError.throw} catch {\n| JsExn(e) => Console.log(JsExn.stack(e)) // Logs `stack`\n| _ => assert(false)\n}\n```" - ], - "signature": "let stack: t => option" - }, - { - "id": "Stdlib.JsExn.message", - "kind": "value", - "name": "message", - "docstrings": [ - "`message(error)` retrieves the `message` property of the error, if it exists.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\ntry {JsError.SyntaxError.throwWithMessage(\"Some message here\")} catch {\n| JsExn(e) => e->JsExn.message->Option.getExn == \"Some message here\"\n| _ => assert(false)\n}\n```" - ], - "signature": "let message: t => option" - }, - { - "id": "Stdlib.JsExn.name", - "kind": "value", - "name": "name", - "docstrings": [ - "`name(error)` retrieves the `name` property of the error, if it exists.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\ntry {JsError.SyntaxError.throwWithMessage(\"Some message here\")} catch {\n| JsExn(e) => e->JsExn.name->Option.getExn == \"SyntaxError\"\n| _ => assert(false)\n}\n```" - ], - "signature": "let name: t => option" - }, - { - "id": "Stdlib.JsExn.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [ - "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." - ], - "signature": "let fileName: t => option" - }, - { - "id": "Stdlib.JsExn.throw", - "kind": "value", - "name": "throw", - "docstrings": [ - "Throws the given value, terminating execution unless caught by a surrounding try/catch block.\n\nThis is meant to be used when a JS API is based on throwing values that are not of type `Error` or its subclasses." - ], - "signature": "let throw: 'a => 'b" - }, - { - "id": "Stdlib.JsExn.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(jsExn)` ignores the provided JS exception and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/jserror": { - "id": "Stdlib.JsError", - "name": "JsError", - "docstrings": [ - "Functions for working with JavaScript errors.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) on MDN." - ], - "items": [ - { - "id": "Stdlib.JsError.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JavaScript error." - ], - "signature": "type t" - }, - { - "id": "Stdlib.JsError.stack", - "kind": "value", - "name": "stack", - "docstrings": [ - "`stack(error)` retrieves the `stack` property of the error, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\nlet error = JsError.make(\"error\")\nConsole.log(error->JsError.stack) // Logs `stack` if it exists on `someError`\n```" - ], - "signature": "let stack: t => option" - }, - { - "id": "Stdlib.JsError.message", - "kind": "value", - "name": "message", - "docstrings": [ - "`message(error)` retrieves the `message` property of the error.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\nlet error = JsError.SyntaxError.make(\"Some message here\")\nerror->JsError.message == \"Some message here\"\n```" - ], - "signature": "let message: t => string" - }, - { - "id": "Stdlib.JsError.name", - "kind": "value", - "name": "name", - "docstrings": [ - "`name(error)` retrieves the `name` property of the error.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\nlet error = JsError.SyntaxError.make(\"Some message here\")\nerror->JsError.name == \"SyntaxError\"\n```" - ], - "signature": "let name: t => string" - }, - { - "id": "Stdlib.JsError.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [ - "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." - ], - "signature": "let fileName: t => option" - }, - { - "id": "Stdlib.JsError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(message)` creates a new error, setting its `message` to the provided value.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error) on MDN.\n\n## Example\n```rescript\nlet error = JsError.make(\"Some message here\")\nerror->JsError.message == \"Some message here\"\nerror->JsError.name == \"Error\"\n```" - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.throw", - "kind": "value", - "name": "throw", - "docstrings": [ - "Throws the given error, terminating execution unless caught by a surrounding try/catch block.\n\n## Examples\n\n```rescript\nlet error = JsError.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n JsError.throw(error)\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" - ], - "signature": "let throw: t => 'a" - }, - { - "id": "Stdlib.JsError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `Error` with the provided `message` and throws it.\n\n`JsError.throwWithMessage(\"message\")` is equivalent to `JsError.make(\"message\")->JsError.throw`." - ], - "signature": "let throwWithMessage: string => 'a" - }, - { - "id": "Stdlib.JsError.panic", - "kind": "value", - "name": "panic", - "docstrings": [ - "Throws a panic exception with the given message.\n\nA panic exception is a native JavaScript exception that is not intended to be caught and\nhandled. Compared to a ReScript exception this will give a better stack trace and\ndebugging experience.\n\n## Examples\n\n```rescript\ntry {\n JsError.panic(\"Uh oh. This was unexpected!\")\n} catch {\n| JsExn(obj) =>\n switch JsExn.message(obj) {\n | Some(m) => assert(m == \"Panic! Uh oh. This was unexpected!\")\n | None => assert(false)\n }\n| _ => assert(false)\n}\n```" - ], - "signature": "let panic: string => 'a" - }, - { - "id": "Stdlib.JsError.toJsExn", - "kind": "value", - "name": "toJsExn", - "docstrings": [ - "Casts a `JsError.t` to a `JsExn.t`. \n\nThis is useful when you want to compare a JS exception and a JS error." - ], - "signature": "let toJsExn: t => JsExn.t" - }, - { - "id": "Stdlib.JsError.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(error)` ignores the provided error and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl": { - "id": "Stdlib.Intl", - "name": "Intl", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.getCanonicalLocalesExn", - "kind": "value", - "name": "getCanonicalLocalesExn", - "docstrings": [ - "`getCanonicalLocalesExn(locale)` returns the canonical form of `locale`.\n\nThrows `RangeError` when the locale string is malformed.\n\nSee [`Intl.getCanonicalLocales`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales) on MDN.\n\n## Examples\n\n```rescript\nIntl.getCanonicalLocalesExn(\"EN-US\") == [\"en-US\"]\n```" - ], - "signature": "let getCanonicalLocalesExn: string => array" - }, - { - "id": "Stdlib.Intl.getCanonicalLocalesManyExn", - "kind": "value", - "name": "getCanonicalLocalesManyExn", - "docstrings": [ - "`getCanonicalLocalesManyExn(locales)` canonicalises every locale in `locales`.\n\nThrows `RangeError` when any locale string is malformed.\n\nSee [`Intl.getCanonicalLocales`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales) on MDN.\n\n## Examples\n\n```rescript\nIntl.getCanonicalLocalesManyExn([\"EN-US\", \"fr\"]) == [\"en-US\", \"fr\"]\n```" - ], - "signature": "let getCanonicalLocalesManyExn: array => array" - }, - { - "id": "Stdlib.Intl.supportedValuesOfExn", - "kind": "value", - "name": "supportedValuesOfExn", - "docstrings": [ - "`supportedValuesOfExn(key)` returns the list of values supported by the runtime for the feature identified by `key`.\n\nThrows `RangeError` when `key` is unsupported.\n\nSee [`Intl.supportedValuesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.supportedValuesOfExn(\"calendar\")->Array.includes(\"gregory\") == true\n```" - ], - "signature": "let supportedValuesOfExn: string => array" - } - ] - }, - "stdlib/int": { - "id": "Stdlib.Int", - "name": "Int", - "docstrings": [ - "Functions for interacting with JavaScript Number.\nSee: [`Number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)." - ], - "items": [ - { - "id": "Stdlib.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an int." - ], - "signature": "type t = int" - }, - { - "id": "Stdlib.Int.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (int, int) => bool" - }, - { - "id": "Stdlib.Int.compare", - "kind": "value", - "name": "compare", - "docstrings": [], - "signature": "let compare: (int, int) => Ordering.t" - }, - { - "id": "Stdlib.Int.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponential: (int, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Int.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponentialWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toFixed", - "kind": "value", - "name": "toFixed", - "docstrings": [ - "`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixed: (int, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Int.toFixedWithPrecision", - "kind": "value", - "name": "toFixedWithPrecision", - "docstrings": [ - "`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixedWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecision: (int, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Int.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecisionWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." - ], - "signature": "let toString: (int, ~radix: int=?) => string" - }, - { - "id": "Stdlib.Int.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." - ], - "signature": "let toStringWithRadix: (int, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```" - ], - "signature": "let toLocaleString: int => string" - }, - { - "id": "Stdlib.Int.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [ - "`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```" - ], - "signature": "let toFloat: int => float" - }, - { - "id": "Stdlib.Int.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "`fromFloat(n)` return an `int` representing the given value. The conversion is\ndone by truncating the decimal part.\n\n## Examples\n\n```rescript\nInt.fromFloat(2.0) == 2\nInt.fromFloat(1.999) == 1\nInt.fromFloat(1.5) == 1\nInt.fromFloat(0.9999) == 0\n```" - ], - "signature": "let fromFloat: float => int" - }, - { - "id": "Stdlib.Int.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(str, ~radix=?)` return an `option` representing the given value\n`str`. `~radix` specifies the radix base to use for the formatted number.\n\n## Examples\n\n```rescript\nInt.fromString(\"0\") == Some(0)\nInt.fromString(\"NaN\") == None\nInt.fromString(\"6\", ~radix=2) == None\n```" - ], - "signature": "let fromString: (string, ~radix: int=?) => option" - }, - { - "id": "Stdlib.Int.mod", - "kind": "value", - "name": "mod", - "docstrings": [ - "`mod(n1, n2)` calculates the modulo (remainder after division) of two integers.\n\n## Examples\n\n```rescript\nInt.mod(7, 4) == 3\n```" - ], - "signature": "let mod: (int, int) => int" - }, - { - "id": "Stdlib.Int.rangeOptions", - "kind": "type", - "name": "rangeOptions", - "docstrings": [ - "The options for `range`." - ], - "signature": "type rangeOptions = {step?: int, inclusive?: bool}" - }, - { - "id": "Stdlib.Int.range", - "kind": "value", - "name": "range", - "docstrings": [ - "`range(start, end, ~options=?)` returns an int array of the sequence of integers in the\nrange `[start, end)`. That is, including `start` but excluding `end`.\n\nIf `step` is not set and `start < end`, the sequence will be increasing in steps of 1.\n\nIf `step` is not set and `start > end`, the sequence will be decreasing in steps of -1.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nthrown as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.range(3, 6) == [3, 4, 5]\nInt.range(-3, -1) == [-3, -2]\nInt.range(3, 1) == [3, 2]\nInt.range(3, 7, ~options={step: 2}) == [3, 5]\nInt.range(3, 7, ~options={step: 2, inclusive: true}) == [3, 5, 7]\nInt.range(3, 6, ~options={step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`." - ], - "signature": "let range: (int, int, ~options: rangeOptions=?) => array" - }, - { - "id": "Stdlib.Int.rangeWithOptions", - "kind": "value", - "name": "rangeWithOptions", - "docstrings": [ - "`rangeWithOptions(start, end, options)` is like `range`, but with `step` and\n`inclusive` options configurable.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nraised as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.rangeWithOptions(3, 7, {step: 2}) == [3, 5]\nInt.rangeWithOptions(3, 7, {step: 2, inclusive: true}) == [3, 5, 7]\nInt.rangeWithOptions(3, 6, {step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`." - ], - "signature": "let rangeWithOptions: (int, int, rangeOptions) => array", - "deprecated": "" - }, - { - "id": "Stdlib.Int.clamp", - "kind": "value", - "name": "clamp", - "docstrings": [ - "`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nInt.clamp(42) == 42\nInt.clamp(42, ~min=50) == 50\nInt.clamp(42, ~max=40) == 40\nInt.clamp(42, ~min=50, ~max=40) == 50\n```" - ], - "signature": "let clamp: (~min: int=?, ~max: int=?, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseAnd", - "kind": "value", - "name": "bitwiseAnd", - "docstrings": [ - "`bitwiseAnd(n1, n2)` calculates the bitwise AND of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseAnd(7, 4) == 4\n```" - ], - "signature": "let bitwiseAnd: (int, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseOr", - "kind": "value", - "name": "bitwiseOr", - "docstrings": [ - "`bitwiseOr(n1, n2)` calculates the bitwise OR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseOr(7, 4) == 7\n```" - ], - "signature": "let bitwiseOr: (int, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseXor", - "kind": "value", - "name": "bitwiseXor", - "docstrings": [ - "`bigwiseXor(n1, n2)` calculates the bitwise XOR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseXor(7, 4) == 3\n```" - ], - "signature": "let bitwiseXor: (int, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseNot", - "kind": "value", - "name": "bitwiseNot", - "docstrings": [ - "`bitwiseNot(n)` calculates the bitwise NOT of an integer.\n\n## Examples\n\n```rescript\nInt.bitwiseNot(2) == -3\n```" - ], - "signature": "let bitwiseNot: int => int" - }, - { - "id": "Stdlib.Int.shiftLeft", - "kind": "value", - "name": "shiftLeft", - "docstrings": [ - "`shiftLeft(n, length)` calculates the shifted value of an integer `n` by `length` bits to the left.\n\n## Examples\n\n```rescript\nInt.shiftLeft(4, 1) == 8\n```" - ], - "signature": "let shiftLeft: (int, int) => int" - }, - { - "id": "Stdlib.Int.shiftRight", - "kind": "value", - "name": "shiftRight", - "docstrings": [ - "`shiftRight(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\n\nAlso known as \"arithmetic right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRight(8, 1) == 4\n```" - ], - "signature": "let shiftRight: (int, int) => int" - }, - { - "id": "Stdlib.Int.shiftRightUnsigned", - "kind": "value", - "name": "shiftRightUnsigned", - "docstrings": [ - "`shiftRightUnsigned(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\nExcess bits shifted off to the right are discarded, and zero bits are shifted in from the left.\n\nAlso known as \"zero-filling right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRightUnsigned(4, 1) == 2\n```" - ], - "signature": "let shiftRightUnsigned: (int, int) => int" - }, - { - "id": "Stdlib.Int.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(int)` ignores the provided int and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: int => unit" - } - ] - }, - "stdlib/float": { - "id": "Stdlib.Float", - "name": "Float", - "docstrings": [ - "Functions for interacting with float." - ], - "items": [ - { - "id": "Stdlib.Float.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a float." - ], - "signature": "type t = float" - }, - { - "id": "Stdlib.Float.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "Checks if two floating point numbers are equal.\n\n## Examples\n```rescript\nFloat.equal(1.0, 1.0) == true\nFloat.equal(1.0, 2.0) == false\n```" - ], - "signature": "let equal: (float, float) => bool" - }, - { - "id": "Stdlib.Float.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "Compares two floating point numbers, returns an `Ordering.t` value.\n\n## Examples\n```rescript\nFloat.compare(1.0, 1.0) == Ordering.equal\nFloat.compare(1.0, 2.0) == Ordering.less\nFloat.compare(2.0, 1.0) == Ordering.greater\n```" - ], - "signature": "let compare: (float, float) => Ordering.t" - }, - { - "id": "Stdlib.Float.isNaN", - "kind": "value", - "name": "isNaN", - "docstrings": [ - "`isNaN(v)` tests if the given `v` is `NaN`.\nSee [`isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) on MDN.\n\n## Examples\n\n```rescript\nFloat.isNaN(3.0) // false\nFloat.isNaN(Float.Constants.nan) // true\n```" - ], - "signature": "let isNaN: float => bool" - }, - { - "id": "Stdlib.Float.isFinite", - "kind": "value", - "name": "isFinite", - "docstrings": [ - "`isFinite(v)` tests if the given `v` is finite.\nSee [`isFinite`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite) on MDN.\n\n## Examples\n\n```rescript\nFloat.isFinite(1.0) == true\nFloat.isFinite(Float.Constants.nan) == false\nFloat.isFinite(Float.Constants.positiveInfinity) == false\n```" - ], - "signature": "let isFinite: float => bool" - }, - { - "id": "Stdlib.Float.parseFloat", - "kind": "value", - "name": "parseFloat", - "docstrings": [ - "`parseFloat(v)` parse the given `v` and returns a float. Leading whitespace in\n`v` is ignored. Returns `NaN` if `v` can't be parsed. Use \\[`fromString`\\] to\nensure it returns a valid float and not `NaN`.\nSee [`parseFloat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseFloat(\"1.0\") == 1.0\nFloat.parseFloat(\" 3.14 \") == 3.14\nFloat.parseFloat(\"3.0\") == 3.0\nFloat.parseFloat(\"3.14some non-digit characters\") == 3.14\nFloat.parseFloat(\"error\")->Float.isNaN == true\n```" - ], - "signature": "let parseFloat: string => float" - }, - { - "id": "Stdlib.Float.parseInt", - "kind": "value", - "name": "parseInt", - "docstrings": [ - "`parseInt(v, ~radix=?)` parse the given `v` and returns a float. Leading\nwhitespace in this argument `v`is ignored. `radix` specifies the radix base to\nuse for the formatted number. The value must be in the range \\[2, 36\\] (inclusive).\nReturns `NaN` if `v` can't be parsed and `radix` is smaller than 2 or bigger\nthan 36.\nSee [`parseInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseInt(\"1.0\") == 1.0\nFloat.parseInt(\" 3.14 \") == 3.0\nFloat.parseInt(3) == 3.0\nFloat.parseInt(\"3.14some non-digit characters\") == 3.0\nFloat.parseInt(\"error\")->Float.isNaN == true\nFloat.parseInt(\"10.0\", ~radix=2) == 2.0\nFloat.parseInt(\"15 * 3\", ~radix=10) == 15.0\nFloat.parseInt(\"12\", ~radix=13) == 15.0\nFloat.parseInt(\"17\", ~radix=40)->Float.isNaN == true\n```" - ], - "signature": "let parseInt: ('a, ~radix: int=?) => float" - }, - { - "id": "Stdlib.Float.parseIntWithRadix", - "kind": "value", - "name": "parseIntWithRadix", - "docstrings": [ - "`parseIntWithRadix(v, ~radix)` parse the given `v` and returns a float. Leading\nwhitespace in this argument `v`is ignored. `radix` specifies the radix base to\nuse for the formatted number. The value must be in the range \\[2, 36\\] (inclusive).\nReturns `NaN` if `v` can't be parsed and `radix` is smaller than 2 or bigger\nthan 36.\nSee [`parseInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseIntWithRadix(\"10.0\", ~radix=2) == 2.0\nFloat.parseIntWithRadix(\"15 * 3\", ~radix=10) == 15.0\nFloat.parseIntWithRadix(\"12\", ~radix=13) == 15.0\nFloat.parseIntWithRadix(\"17\", ~radix=40)->Float.isNaN == true\n```" - ], - "signature": "let parseIntWithRadix: ('a, ~radix: int) => float", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "`toExponential(v, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponential(1000.0) == \"1e+3\"\nFloat.toExponential(-1000.0) == \"-1e+3\"\nFloat.toExponential(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponential(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponential: (float, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Float.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "`toExponential(v, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponentialWithPrecision(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponentialWithPrecision(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponentialWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toFixed", - "kind": "value", - "name": "toFixed", - "docstrings": [ - "`toFixed(v, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixed(123456.0) == \"123456\"\nFloat.toFixed(10.0) == \"10\"\nFloat.toFixed(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixed(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixed: (float, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Float.toFixedWithPrecision", - "kind": "value", - "name": "toFixedWithPrecision", - "docstrings": [ - "`toFixedWithPrecision(v, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixedWithPrecision(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixedWithPrecision(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixedWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "`toPrecision(v, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecision(100.0) == \"100\"\nFloat.toPrecision(1.0) == \"1\"\nFloat.toPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecision: (float, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Float.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "`toPrecisionWithPrecision(v, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecisionWithPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecisionWithPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecisionWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(v)` return a `string` representing the given value.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toString(1000.0) == \"1000\"\nFloat.toString(-1000.0) == \"-1000\"\n```" - ], - "signature": "let toString: (float, ~radix: int=?) => string" - }, - { - "id": "Stdlib.Float.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "`toStringWithRadix(v, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toStringWithRadix(6.0, ~radix=2) == \"110\"\nFloat.toStringWithRadix(3735928559.0, ~radix=16) == \"deadbeef\"\nFloat.toStringWithRadix(123456.0, ~radix=36) == \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." - ], - "signature": "let toStringWithRadix: (float, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(v)` return a `string` with language-sensitive representing the\ngiven value.\nSee [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nFloat.toLocaleString(1000.0) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nFloat.toLocaleString(1000.0) // \"1.000\"\n```" - ], - "signature": "let toLocaleString: float => string" - }, - { - "id": "Stdlib.Float.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(str)` return an `option` representing the given value `str`.\n\n## Examples\n\n```rescript\nFloat.fromString(\"0\") == Some(0.0)\nFloat.fromString(\"NaN\") == None\nFloat.fromString(\"6\") == Some(6.0)\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.Float.toInt", - "kind": "value", - "name": "toInt", - "docstrings": [ - "`toInt(v)` returns an int to given float `v`.\n\n## Examples\n\n```rescript\nFloat.toInt(2.0) == 2\nFloat.toInt(1.0) == 1\nFloat.toInt(1.1) == 1\nFloat.toInt(1.6) == 1\n```" - ], - "signature": "let toInt: float => int" - }, - { - "id": "Stdlib.Float.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "`fromInt(v)` returns a float to given int `v`.\n\n## Examples\n\n```rescript\nFloat.fromInt(2) == 2.0\nFloat.fromInt(1) == 1.0\n```" - ], - "signature": "let fromInt: int => float" - }, - { - "id": "Stdlib.Float.mod", - "kind": "value", - "name": "mod", - "docstrings": [ - "`mod(n1, n2)` calculates the modulo (remainder after division) of two floats.\n\n## Examples\n\n```rescript\nFloat.mod(7.0, 4.0) == 3.0\n```" - ], - "signature": "let mod: (float, float) => float" - }, - { - "id": "Stdlib.Float.clamp", - "kind": "value", - "name": "clamp", - "docstrings": [ - "`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nFloat.clamp(4.2) == 4.2\nFloat.clamp(4.2, ~min=4.3) == 4.3\nFloat.clamp(4.2, ~max=4.1) == 4.1\nFloat.clamp(4.2, ~min=4.3, ~max=4.1) == 4.3\n```" - ], - "signature": "let clamp: (~min: float=?, ~max: float=?, float) => float" - }, - { - "id": "Stdlib.Float.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(float)` ignores the provided float and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: float => unit" - } - ] - }, - "stdlib/error": { - "id": "Stdlib.Error", - "name": "Error", - "docstrings": [ - "Functions for working with JavaScript exceptions.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) on MDN." - ], - "items": [ - { - "id": "Stdlib.Error.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JavaScript exception." - ], - "signature": "type t = Exn.t", - "deprecated": "" - }, - { - "id": "Stdlib.Error.fromException", - "kind": "value", - "name": "fromException", - "docstrings": [], - "signature": "let fromException: exn => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.toException", - "kind": "value", - "name": "toException", - "docstrings": [ - "Turns an `Error.t` into an `exn`.\n\n## Examples\n```rescript\nlet error = Error.make(\"Something went wrong.\")\n\nlet asExn = error->Error.toException // `asExn` is now type `exn`\n```" - ], - "signature": "let toException: t => exn", - "deprecated": "Use functions from `JsExn` instead" - }, - { - "id": "Stdlib.Error.stack", - "kind": "value", - "name": "stack", - "docstrings": [ - "`stack(error)` retrieves the `stack` property of the error, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\nlet error = Error.make(\"error\")\nConsole.log(error->Error.stack) // Logs `stack` if it exists on `someError`\n```" - ], - "signature": "let stack: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.message", - "kind": "value", - "name": "message", - "docstrings": [ - "`message(error)` retrieves the `message` property of the error, if it exists.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\nlet error = Error.SyntaxError.make(\"Some message here\")\nConsole.log(error->Error.message) // Logs \"Some message here\" to the console\n```" - ], - "signature": "let message: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.name", - "kind": "value", - "name": "name", - "docstrings": [ - "`name(error)` retrieves the `name` property of the error, if it exists.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\nlet error = Error.SyntaxError.make(\"Some message here\")\nConsole.log(error->Error.name) // Logs \"SyntaxError\" to the console\n```" - ], - "signature": "let name: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [ - "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." - ], - "signature": "let fileName: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(message)` creates a new error, setting its `message` to the provided value.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error) on MDN.\n\n## Example\n```rescript\nlet error = Error.make(\"Some message here\")\nConsole.log(error->Error.message) // Logs \"Some message here\" to the console\nConsole.log(error->Error.name) // Logs \"Error\" to the console, because this is a regular error\n```" - ], - "signature": "let make: string => t", - "deprecated": "" - }, - { - "id": "Stdlib.Error.raise", - "kind": "value", - "name": "raise", - "docstrings": [ - "Raises (throws in JavaScript language) the provided `Error.t`, which will stop execution.\n\n## Examples\n```rescript\nlet error = Error.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n error->Error.raise\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" - ], - "signature": "let raise: t => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Error.throw", - "kind": "value", - "name": "throw", - "docstrings": [ - "Throws the given exception, terminating execution unless caught by a surrounding try/catch block.\n\n## Examples\n\n```rescript\nlet error = Error.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n Error.throw(error)\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" - ], - "signature": "let throw: t => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Error.panic", - "kind": "value", - "name": "panic", - "docstrings": [ - "Throws a panic exception with the given message.\n\nA panic exception is a native JavaScript exception that is not intended to be caught and\nhandled. Compared to a ReScript exception this will give a better stack trace and\ndebugging experience.\n\n## Examples\n\n```rescript\ntry {\n Error.panic(\"Uh oh. This was unexpected!\")\n} catch {\n| Exn.Error(obj) =>\n switch Exn.message(obj) {\n | Some(m) => assert(m == \"Panic! Uh oh. This was unexpected!\")\n | None => assert(false)\n }\n| _ => assert(false)\n}\n```" - ], - "signature": "let panic: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Error.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(error)` ignores the provided error and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit", - "deprecated": "" - } - ] - }, - "stdlib/exn": { - "id": "Stdlib.Exn", - "name": "Exn", - "docstrings": [ - "Provide utilities for dealing with JS exceptions." - ], - "items": [ - { - "id": "Stdlib.Exn.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JS exception" - ], - "signature": "type t", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.asJsExn", - "kind": "value", - "name": "asJsExn", - "docstrings": [], - "signature": "let asJsExn: exn => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.stack", - "kind": "value", - "name": "stack", - "docstrings": [], - "signature": "let stack: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.message", - "kind": "value", - "name": "message", - "docstrings": [], - "signature": "let message: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.name", - "kind": "value", - "name": "name", - "docstrings": [], - "signature": "let name: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [], - "signature": "let fileName: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.anyToExnInternal", - "kind": "value", - "name": "anyToExnInternal", - "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a Exn.Error if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." - ], - "signature": "let anyToExnInternal: 'a => exn", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseError", - "kind": "value", - "name": "raiseError", - "docstrings": [ - "Raise Js exception Error object with stacktrace" - ], - "signature": "let raiseError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseEvalError", - "kind": "value", - "name": "raiseEvalError", - "docstrings": [], - "signature": "let raiseEvalError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseRangeError", - "kind": "value", - "name": "raiseRangeError", - "docstrings": [], - "signature": "let raiseRangeError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseReferenceError", - "kind": "value", - "name": "raiseReferenceError", - "docstrings": [], - "signature": "let raiseReferenceError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseSyntaxError", - "kind": "value", - "name": "raiseSyntaxError", - "docstrings": [], - "signature": "let raiseSyntaxError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseTypeError", - "kind": "value", - "name": "raiseTypeError", - "docstrings": [], - "signature": "let raiseTypeError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseUriError", - "kind": "value", - "name": "raiseUriError", - "docstrings": [], - "signature": "let raiseUriError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(exn)` ignores the provided exn and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit", - "deprecated": "" - } - ] - }, - "stdlib/dict": { - "id": "Stdlib.Dict", - "name": "Dict", - "docstrings": [ - "A mutable dictionary with string keys.\n\nCompiles to a regular JavaScript object." - ], - "items": [ - { - "id": "Stdlib.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a dictionary of value `'a`." - ], - "signature": "type t<'a> = dict<'a>" - }, - { - "id": "Stdlib.Dict.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(dict, key)` Returns the `value` at the provided `key`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `key` does not exist in `dict`.\n\nUse `Dict.getUnsafe` only when you are sure the key exists (i.e. when iterating `Dict.keys` result).\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\nlet value = dict->Dict.getUnsafe(\"key1\")\nConsole.log(value) // value1\n```" - ], - "signature": "let getUnsafe: (dict<'a>, string) => 'a" - }, - { - "id": "Stdlib.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the value at the provided key, if it exists. Returns an option.\n\n## Examples\n```rescript\nlet dict = dict{\"someKey\": \"someValue\"}\n\nswitch dict->Dict.get(\"someKey\") {\n| None => Console.log(\"Nope, didn't have the key.\")\n| Some(value) => Console.log(value)\n}\n```\n\n## Alternative: Pattern Matching with `dict{}`\n\nFor nested dictionary access, consider using the more concise `dict{}` pattern matching syntax:\n\n```rescript\n// More concise approach using pattern matching\nlet decodeImageUrl = (json: JSON.t) => {\n switch json {\n | JSON.Object(dict{\"data\": JSON.Object(dict{\"image_url\": JSON.String(url)})}) => Some(url)\n | _ => None\n }\n}\n\n// Alternative using Dict.get\nlet decodeImageUrl = (json: JSON.t) => {\n switch json {\n | JSON.Object(obj) =>\n switch Dict.get(obj, \"data\") {\n | Some(JSON.Object(data)) =>\n switch Dict.get(data, \"image_url\") {\n | Some(JSON.String(url)) => Some(url)\n | _ => None\n }\n | _ => None\n }\n | _ => None\n }\n}\n```" - ], - "signature": "let get: (dict<'a>, string) => option<'a>" - }, - { - "id": "Stdlib.Dict.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(dictionary, key, value)` sets the value at the provided key to the provided value.\n\n## Examples\n```rescript\nlet dict = Dict.make()\n\ndict->Dict.set(\"someKey\", \"someValue\")\n```" - ], - "signature": "let set: (dict<'a>, string, 'a) => unit" - }, - { - "id": "Stdlib.Dict.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "`delete(dictionary, key)` deletes the value at `key`, if it exists.\n\n## Examples\n```rescript\nlet dict = dict{\"someKey\": \"someValue\"}\n\ndict->Dict.delete(\"someKey\")\n```" - ], - "signature": "let delete: (dict<'a>, string) => unit" - }, - { - "id": "Stdlib.Dict.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make()` creates a new, empty dictionary.\n\n## Examples\n```rescript\nlet dict1: dict = Dict.make() // You can annotate the type of the values of your dict yourself if you want\n\nlet dict2 = Dict.make() // Or you can let ReScript infer it via usage.\ndict2->Dict.set(\"someKey\", 12)\n```" - ], - "signature": "let make: unit => dict<'a>" - }, - { - "id": "Stdlib.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(entries)` creates a new dictionary from the provided array of key/value pairs.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([(\"key1\", \"value1\"), (\"key2\", \"value2\")])\n```" - ], - "signature": "let fromArray: array<(string, 'a)> => dict<'a>" - }, - { - "id": "Stdlib.Dict.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "`fromIterator(entries)` creates a new dictionary from the provided iterator of key/value pairs.\n\n## Examples\n\n```rescript\nlet iterator: Iterator.t<(string, int)> = %raw(`\n (() => {\n var map1 = new Map();\n map1.set('first', 1);\n map1.set('second', 2);\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\niterator\n->Dict.fromIterator\n->Dict.valuesToArray == [1, 2]\n```" - ], - "signature": "let fromIterator: Iterator.t<(string, 'a)> => dict<'a>" - }, - { - "id": "Stdlib.Dict.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(dictionary)` returns an array of all the key/value pairs of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet asArray = dict->Dict.toArray\nConsole.log(asArray) // Logs `[[\"someKey\", 1], [\"someKey2\", 2]]` to the console\n```" - ], - "signature": "let toArray: dict<'a> => array<(string, 'a)>" - }, - { - "id": "Stdlib.Dict.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "`keysToArray(dictionary)` returns an array of all the keys of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet keys = dict->Dict.keysToArray\nConsole.log(keys) // Logs `[\"someKey\", \"someKey2\"]` to the console\n```" - ], - "signature": "let keysToArray: dict<'a> => array" - }, - { - "id": "Stdlib.Dict.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(dictionary)` returns the number of key/value pairs in the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.size->assertEqual(0)\n\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\ndict->Dict.size->assertEqual(2)\n\n// After deleting a key\ndict->Dict.delete(\"someKey\")\ndict->Dict.size->assertEqual(1)\n```" - ], - "signature": "let size: dict<'a> => int" - }, - { - "id": "Stdlib.Dict.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(dictionary)` returns `true` if the dictionary is empty (has no key/value pairs), `false` otherwise.\n\n## Examples\n```rescript\nlet emptyDict = Dict.make()\nemptyDict->Dict.isEmpty->assertEqual(true)\n\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.isEmpty->assertEqual(false)\n\n// After clearing all keys\ndict->Dict.delete(\"someKey\")\ndict->Dict.isEmpty->assertEqual(true)\n```" - ], - "signature": "let isEmpty: dict<'a> => bool" - }, - { - "id": "Stdlib.Dict.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [ - "`valuesToArray(dictionary)` returns an array of all the values of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet values = dict->Dict.valuesToArray\nConsole.log(values) // Logs `[1, 2]` to the console\n```" - ], - "signature": "let valuesToArray: dict<'a> => array<'a>" - }, - { - "id": "Stdlib.Dict.assign", - "kind": "value", - "name": "assign", - "docstrings": [ - "`assign(dictionary1, dictionary2)` [shallowly](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) merges dictionary2 into dictionary1, and returns dictionary1.\n\nBeware this will *mutate* dictionary1. If you're looking for a way to copy a dictionary, check out `Dict.copy`.\n\n## Examples\n```rescript\nlet dict1 = Dict.make()\ndict1->Dict.set(\"firstKey\", 1)\nConsole.log(dict1->Dict.keysToArray) // Logs `[\"firstKey\"]`\n\nlet dict2 = Dict.make()\ndict2->Dict.set(\"someKey\", 2)\ndict2->Dict.set(\"someKey2\", 3)\n\nlet dict1 = dict1->Dict.assign(dict2)\n\nConsole.log(dict1->Dict.keysToArray) // Logs `[\"firstKey\", \"someKey\", \"someKey2\"]`\n```" - ], - "signature": "let assign: (dict<'a>, dict<'a>) => dict<'a>" - }, - { - "id": "Stdlib.Dict.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(dictionary)` [shallowly copies](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) the provided dictionary to a new dictionary.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\nlet dict2 = dict->Dict.copy\n\n// Both log `[\"key1\", \"key2\"]` here.\nConsole.log2(dict->Dict.keysToArray, dict2->Dict.keysToArray)\n```" - ], - "signature": "let copy: dict<'a> => dict<'a>" - }, - { - "id": "Stdlib.Dict.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(dictionary, f)` iterates through all values of the dict.\n\n> Please note that this is *without the keys*, just the values. If you need the key as well, use `Dict.forEachWithKey`.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\n\ndict->Dict.forEach(value => {\n Console.log(value)\n})\n```" - ], - "signature": "let forEach: (dict<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Dict.forEachWithKey", - "kind": "value", - "name": "forEachWithKey", - "docstrings": [ - "`forEachWithKey(dictionary, f)` iterates through all values of the dict, including the key for each value.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\n\ndict->Dict.forEachWithKey((value, key) => {\n Console.log2(value, key)\n})\n```" - ], - "signature": "let forEachWithKey: (dict<'a>, ('a, string) => unit) => unit" - }, - { - "id": "Stdlib.Dict.mapValues", - "kind": "value", - "name": "mapValues", - "docstrings": [ - "`mapValues(dictionary, f)` returns a new dictionary with the same keys, and `f` applied to each value in the original dictionary.\n\n## Examples\n\n```rescript\nlet dict = dict{\"key1\": 1, \"key2\": 2}\n\ndict->Dict.mapValues(v => v + 10)->Dict.toArray // [(\"key1\", 11), (\"key2\", 12)]\ndict->Dict.mapValues(v => Int.toString(v))->Dict.toArray // [(\"key1\", \"1\"), (\"key2\", \"2\")]\n```" - ], - "signature": "let mapValues: (dict<'a>, 'a => 'b) => dict<'b>" - }, - { - "id": "Stdlib.Dict.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(dictionary, \"key\")` returns true if the \"key\" is present in the dictionary.\n\nBe aware that it uses the JavaScript `in` operator under the hood.\n\n## Examples\n\n```rescript\nlet dict = dict{\"key1\": Some(1), \"key2\": None}\n\ndict->Dict.has(\"key1\") == true\ndict->Dict.has(\"key2\") == true\ndict->Dict.has(\"key3\") == false\ndict->Dict.has(\"toString\") == true\n```" - ], - "signature": "let has: (dict<'a>, string) => bool" - }, - { - "id": "Stdlib.Dict.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(dict)` ignores the provided dict and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: dict<'a> => unit" - } - ] - }, - "stdlib/date": { - "id": "Stdlib.Date", - "name": "Date", - "docstrings": [ - "Functions for interacting with JavaScript Dates." - ], - "items": [ - { - "id": "Stdlib.Date.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a JavaScript date." - ], - "signature": "type t" - }, - { - "id": "Stdlib.Date.msSinceEpoch", - "kind": "type", - "name": "msSinceEpoch", - "docstrings": [ - "Time, in milliseconds, since / until the UNIX epoch (January 1, 1970 00:00:00 UTC).\nPositive numbers represent dates after, negative numbers dates before epoch." - ], - "signature": "type msSinceEpoch = float" - }, - { - "id": "Stdlib.Date.localeOptions", - "kind": "type", - "name": "localeOptions", - "docstrings": [ - "A type representing date time format options.\n\nNote: There are some properties missing:\n- fractionalSecondDigits\n- dayPeriod\n- calendar\n- numberingSystem\n- localeMatcher\n- timeZone\n- hour12\n- hourCycle\n- formatMatcher\n\nSee full spec at https://tc39.es/ecma402/#datetimeformat-objects" - ], - "signature": "type localeOptions = {\n dateStyle?: [#full | #long | #medium | #short],\n timeStyle?: [#full | #long | #medium | #short],\n weekday?: [#long | #narrow | #short],\n era?: [#long | #narrow | #short],\n year?: [#\"2-digit\" | #numeric],\n month?: [\n | #\"2-digit\"\n | #long\n | #narrow\n | #numeric\n | #short\n ],\n day?: [#\"2-digit\" | #numeric],\n hour?: [#\"2-digit\" | #numeric],\n minute?: [#\"2-digit\" | #numeric],\n second?: [#\"2-digit\" | #numeric],\n timeZoneName?: [#long | #short],\n}" - }, - { - "id": "Stdlib.Date.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make()`\n\nCreates a date object with the current date time as value.\n\n## Examples\n```rescript\nDate.make()\n```" - ], - "signature": "let make: unit => t" - }, - { - "id": "Stdlib.Date.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(dateTimeString)`\n\nCreates a date object from given date time string.\nThe string has to be in the ISO 8601 format YYYY-MM-DDTHH:mm:ss.sssZ (https://tc39.es/ecma262/\\#sec-date-time-string-format).\n\nInvalid date time strings will create invalid dates.\nYou can use the result like any valid date, but many functions like `toString` will return \"Invalid Date\" or functions like `Date.getTime` will return NaN.\n\n## Examples\n```rescript\nDate.fromString(\"2023\") // 2023-01-01T00:00:00.000Z\n\nDate.fromString(\"2023-02-20\") // 2023-02-20T00:00:00.000Z\n\nDate.fromString(\"2023-02-20T16:40:00.00Z\") // 2023-02-20T16:40:00.000Z\n\nDate.fromString(\"\") // Invalid Date\n\nDate.fromString(\"\")->Date.getTime // NaN\n```" - ], - "signature": "let fromString: string => t" - }, - { - "id": "Stdlib.Date.fromTime", - "kind": "value", - "name": "fromTime", - "docstrings": [ - "`fromTime(msSinceEpoch)`\n\nCreates a date object from the given time in milliseconds since / until UNIX epoch (January 1, 1970 00:00:00 UTC).\nPositive numbers create dates after epoch, negative numbers create dates before epoch.\n\n## Examples\n```rescript\nDate.fromTime(0.0)\n// 1970-01-01T00:00:00.000Z\n\nDate.fromTime(-86_400_000.0)\n// 1969-12-31T00:00:00.000Z\n\nDate.fromTime(86_400_000.0)\n// 1970-01-02T00:00:00.000Z\n```" - ], - "signature": "let fromTime: msSinceEpoch => t" - }, - { - "id": "Stdlib.Date.makeWithYM", - "kind": "value", - "name": "makeWithYM", - "docstrings": [ - "Creates a date object with the given year and month.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYM(~year=2023, ~month=0)\n// 2023-01-01T00:00:00.000Z\n\nDate.makeWithYM(~year=2023, ~month=11)\n// 2023-12-01T00:00:00.000Z\n\nDate.makeWithYM(~year=2023, ~month=12)\n// 2024-01-01T00:00:00.000Z\n\nDate.makeWithYM(~year=2023, ~month=-1)\n// 2022-12-01T00:00:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYM: (~year: int, ~month: int) => t" - }, - { - "id": "Stdlib.Date.makeWithYMD", - "kind": "value", - "name": "makeWithYMD", - "docstrings": [ - "Creates a date object with the given year, month and date (day of month).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMD(~year=2023, ~month=1, ~day=20)\n// 2023-02-20T00:00:00.000Z\n\nDate.makeWithYMD(~year=2023, ~month=1, ~day=-1)\n// 2022-11-29T00:00:00.000Z\n\nDate.makeWithYMD(~year=2023, ~month=1, ~day=29)\n// 2023-03-01T00:00:00.000Z\n```" - ], - "signature": "let makeWithYMD: (~year: int, ~month: int, ~day: int) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDH", - "kind": "value", - "name": "makeWithYMDH", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month) and hours.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=16)\n// 2023-02-20T16:00:00.000Z\n\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=24)\n// 2023-02-21T00:00:00.000Z\n\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=-1)\n// 2023-02-19T23:00:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDH: (~year: int, ~month: int, ~day: int, ~hours: int) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDHM", - "kind": "value", - "name": "makeWithYMDHM", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours and minutes.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=60)\n// 2023-02-20T17:00:00.000Z\n\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=-1)\n// 2023-02-20T15:59:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDHM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDHMS", - "kind": "value", - "name": "makeWithYMDHMS", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours, minutes and seconds.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=60)\n// 2023-02-20T16:41:00.000Z\n\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=-1)\n// 2023-02-20T16:39:59.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDHMS: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDHMSM", - "kind": "value", - "name": "makeWithYMDHMSM", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours, minutes, seconds and milliseconds.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=0,\n)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=1000,\n)\n// 2023-02-20T16:40:01.000Z\n\nDate.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=-1,\n)\n// 2023-02-20T16:39:59.999Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDHMSM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => t" - }, - { - "id": "Stdlib.Date.now", - "kind": "value", - "name": "now", - "docstrings": [ - "`now()`\n\nReturns the time, in milliseconds, between UNIX epoch (January 1, 1970 00:00:00 UTC) and the current date time." - ], - "signature": "let now: unit => msSinceEpoch" - }, - { - "id": "Stdlib.Date.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(date1, date2)` checks if two dates represent the same point in time.\n\n## Examples\n```rescript\nDate.equal(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-01\")) == true\nDate.equal(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-02\")) == false\n```" - ], - "signature": "let equal: (t, t) => bool" - }, - { - "id": "Stdlib.Date.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(date1, date2)` compares two dates chronologically, returns an `Ordering.t` value.\n\n## Examples\n```rescript\nDate.compare(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-01\")) == Ordering.equal\nDate.compare(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-02\")) == Ordering.less\nDate.compare(Date.fromString(\"2023-01-02\"), Date.fromString(\"2023-01-01\")) == Ordering.greater\n```" - ], - "signature": "let compare: (t, t) => Ordering.t" - }, - { - "id": "Stdlib.Date.getTime", - "kind": "value", - "name": "getTime", - "docstrings": [ - "`getTime(date)`\n\nReturns the time, in milliseconds, between UNIX epoch (January 1, 1970 00:00:00 UTC) and the current date time.\nInvalid dates will return NaN.\nDates before epoch will return negative numbers.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20\")->Date.getTime\n// 1676851200000\n```" - ], - "signature": "let getTime: t => msSinceEpoch" - }, - { - "id": "Stdlib.Date.getTimezoneOffset", - "kind": "value", - "name": "getTimezoneOffset", - "docstrings": [ - "`getTimezoneOffset(date)`\n\nReturns the time in minutes between the UTC time and the locale time.\nThe timezone of the given date doesn't matter.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01\")->Date.getTimezoneOffset\n// -60 with local time zone = Europe/Berlin\n\nDate.fromString(\"2023-06-01\")->Date.getTimezoneOffset\n// -120 with local time zone = Europe/Berlin\n```" - ], - "signature": "let getTimezoneOffset: t => int" - }, - { - "id": "Stdlib.Date.getFullYear", - "kind": "value", - "name": "getFullYear", - "docstrings": [ - "`getFullYear(date)`\n\nReturns the year of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20\")->Date.getFullYear\n// 2023\n```" - ], - "signature": "let getFullYear: t => int" - }, - { - "id": "Stdlib.Date.getMonth", - "kind": "value", - "name": "getMonth", - "docstrings": [ - "`getMonth(date)`\n\nReturns the month (0-indexed) of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01\")->Date.getMonth\n// 0\n```" - ], - "signature": "let getMonth: t => int" - }, - { - "id": "Stdlib.Date.getDate", - "kind": "value", - "name": "getDate", - "docstrings": [ - "`getDate(date)`\n\nReturns the date (day of month) of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getDate\n// 20\n```" - ], - "signature": "let getDate: t => int" - }, - { - "id": "Stdlib.Date.getHours", - "kind": "value", - "name": "getHours", - "docstrings": [ - "`getHours(date)`\n\nReturns the hours of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getHours\n// 16\n```" - ], - "signature": "let getHours: t => int" - }, - { - "id": "Stdlib.Date.getMinutes", - "kind": "value", - "name": "getMinutes", - "docstrings": [ - "`getMinutes(date)`\n\nReturns the minutes of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getMinutes\n// 40\n```" - ], - "signature": "let getMinutes: t => int" - }, - { - "id": "Stdlib.Date.getSeconds", - "kind": "value", - "name": "getSeconds", - "docstrings": [ - "`getSeconds(date)`\n\nReturns the seconds of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getSeconds\n// 0\n```" - ], - "signature": "let getSeconds: t => int" - }, - { - "id": "Stdlib.Date.getMilliseconds", - "kind": "value", - "name": "getMilliseconds", - "docstrings": [ - "`getMilliseconds(date)`\n\nReturns the milliseconds of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getMilliseconds\n// 0\n```" - ], - "signature": "let getMilliseconds: t => int" - }, - { - "id": "Stdlib.Date.getDay", - "kind": "value", - "name": "getDay", - "docstrings": [ - "`getDay(date)`\n\nReturns the day of week of a given date (according to local time).\n0 = Sunday, 1 = Monday, ... 6 = Saturday\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getDay\n// 1\n```" - ], - "signature": "let getDay: t => int" - }, - { - "id": "Stdlib.Date.setFullYear", - "kind": "value", - "name": "setFullYear", - "docstrings": [ - "`setFullYear(date, year)`\n\nSets the year of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYear(2024)\n```" - ], - "signature": "let setFullYear: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setFullYearM", - "kind": "value", - "name": "setFullYearM", - "docstrings": [ - "`setFullYearM(date, ~year, ~month)`\n\nSets the year and month of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYearM(~year=2024, ~month=0)\n```" - ], - "signature": "let setFullYearM: (t, ~year: int, ~month: int) => unit" - }, - { - "id": "Stdlib.Date.setFullYearMD", - "kind": "value", - "name": "setFullYearMD", - "docstrings": [ - "`setFullYearMD(date, ~year, ~month, ~day)`\n\nSets the year, month and date (day of month) of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYearMD(~year=2024, ~month=0, ~day=1)\n```" - ], - "signature": "let setFullYearMD: (t, ~year: int, ~month: int, ~day: int) => unit" - }, - { - "id": "Stdlib.Date.setMonth", - "kind": "value", - "name": "setMonth", - "docstrings": [ - "`setMonth(date, month)`\n\nSets the month of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMonth(0)\n```" - ], - "signature": "let setMonth: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setDate", - "kind": "value", - "name": "setDate", - "docstrings": [ - "`setDate(date, day)`\n\nSets the date (day of month) of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setDate(1)\n```" - ], - "signature": "let setDate: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setHours", - "kind": "value", - "name": "setHours", - "docstrings": [ - "`setHours(date, hours)`\n\nSets the hours of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHours(0)\n```" - ], - "signature": "let setHours: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setHoursM", - "kind": "value", - "name": "setHoursM", - "docstrings": [ - "`setHoursM(date, ~hours, ~minutes)`\n\nSets the hours and minutes of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHoursM(~hours=0, ~minutes=0)\n```" - ], - "signature": "let setHoursM: (t, ~hours: int, ~minutes: int) => unit" - }, - { - "id": "Stdlib.Date.setHoursMS", - "kind": "value", - "name": "setHoursMS", - "docstrings": [ - "`setHoursMS(date, ~hours, ~minutes, ~seconds)`\n\nSets the hours, minutes and seconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHoursMS(~hours=0, ~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setHoursMS: (t, ~hours: int, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setHoursMSMs", - "kind": "value", - "name": "setHoursMSMs", - "docstrings": [ - "`setHoursMSMs(date, ~hours, ~minutes, ~seconds, ~milliseconds)`\n\nSets the hours, minutes, seconds and milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHoursMSMs(\n ~hours=0,\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setHoursMSMs: (\n t,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setMinutes", - "kind": "value", - "name": "setMinutes", - "docstrings": [ - "`setMinutes(date, minutes)`\n\nSets the minutes of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMinutes(0)\n```" - ], - "signature": "let setMinutes: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setMinutesS", - "kind": "value", - "name": "setMinutesS", - "docstrings": [ - "`setMinutesS(date, ~minutes, ~seconds)`\n\nSets the minutes and seconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMinutesS(~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setMinutesS: (t, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setMinutesSMs", - "kind": "value", - "name": "setMinutesSMs", - "docstrings": [ - "`setMinutesSMs(date, ~minutes, ~seconds, ~milliseconds)`\n\nSets the minutes, seconds and milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMinutesSMs(\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setMinutesSMs: (\n t,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setSeconds", - "kind": "value", - "name": "setSeconds", - "docstrings": [ - "`setSeconds(date, seconds)`\n\nSets the seconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setSeconds(0)\n```" - ], - "signature": "let setSeconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setSecondsMs", - "kind": "value", - "name": "setSecondsMs", - "docstrings": [ - "`setSecondsMs(date, ~seconds, ~milliseconds)`\n\nSets the seconds and milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setSecondsMs(~seconds=0, ~milliseconds=0)\n```" - ], - "signature": "let setSecondsMs: (t, ~seconds: int, ~milliseconds: int) => unit" - }, - { - "id": "Stdlib.Date.setMilliseconds", - "kind": "value", - "name": "setMilliseconds", - "docstrings": [ - "`setMilliseconds(date, milliseconds)`\n\nSets the milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMilliseconds(0)\n```" - ], - "signature": "let setMilliseconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.getUTCFullYear", - "kind": "value", - "name": "getUTCFullYear", - "docstrings": [ - "`getUTCFullYear(date)`\n\nReturns the year of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCFullYear // 2022\n```" - ], - "signature": "let getUTCFullYear: t => int" - }, - { - "id": "Stdlib.Date.getUTCMonth", - "kind": "value", - "name": "getUTCMonth", - "docstrings": [ - "`getUTCMonth(date)`\n\nReturns the month of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCMonth // 11\n```" - ], - "signature": "let getUTCMonth: t => int" - }, - { - "id": "Stdlib.Date.getUTCDate", - "kind": "value", - "name": "getUTCDate", - "docstrings": [ - "`getUTCDate(date)`\n\nReturns the date (day of month) of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCDate // 31\n```" - ], - "signature": "let getUTCDate: t => int" - }, - { - "id": "Stdlib.Date.getUTCHours", - "kind": "value", - "name": "getUTCHours", - "docstrings": [ - "`getUTCHours(date)`\n\nReturns the hours of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCHours // 23\n```" - ], - "signature": "let getUTCHours: t => int" - }, - { - "id": "Stdlib.Date.getUTCMinutes", - "kind": "value", - "name": "getUTCMinutes", - "docstrings": [ - "`getUTCMinutes(date)`\n\nReturns the minutes of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCMinutes // 0\n```" - ], - "signature": "let getUTCMinutes: t => int" - }, - { - "id": "Stdlib.Date.getUTCSeconds", - "kind": "value", - "name": "getUTCSeconds", - "docstrings": [ - "`getUTCSeconds(date)`\n\nReturns the seconds of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCSeconds // 0\n```" - ], - "signature": "let getUTCSeconds: t => int" - }, - { - "id": "Stdlib.Date.getUTCMilliseconds", - "kind": "value", - "name": "getUTCMilliseconds", - "docstrings": [ - "`getUTCMilliseconds(date)`\n\nReturns the milliseconds of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCMilliseconds // 0\n```" - ], - "signature": "let getUTCMilliseconds: t => int" - }, - { - "id": "Stdlib.Date.getUTCDay", - "kind": "value", - "name": "getUTCDay", - "docstrings": [ - "`getUTCDay(date)`\n\nReturns the day (day of week) of a given date (according to UTC time).\n0 = Sunday, 1 = Monday, ... 6 = Saturday\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCDay // 6\n```" - ], - "signature": "let getUTCDay: t => int" - }, - { - "id": "Stdlib.Date.setUTCFullYear", - "kind": "value", - "name": "setUTCFullYear", - "docstrings": [ - "`setUTCFullYear(date, year)`\n\nSets the year of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYear(2024)\n```" - ], - "signature": "let setUTCFullYear: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCFullYearM", - "kind": "value", - "name": "setUTCFullYearM", - "docstrings": [ - "`setUTCFullYearM(date, ~year, ~month)`\n\nSets the year and month of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYearM(~year=2024, ~month=0)\n```" - ], - "signature": "let setUTCFullYearM: (t, ~year: int, ~month: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCFullYearMD", - "kind": "value", - "name": "setUTCFullYearMD", - "docstrings": [ - "`setUTCFullYearMD(date, ~year, ~month, ~day)`\n\nSets the year, month and date (day of month) of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYearMD(~year=2024, ~month=0, ~day=1)\n```" - ], - "signature": "let setUTCFullYearMD: (t, ~year: int, ~month: int, ~day: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMonth", - "kind": "value", - "name": "setUTCMonth", - "docstrings": [ - "`setUTCMonth(date, month)`\n\nSets the month of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMonth(0)\n```" - ], - "signature": "let setUTCMonth: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCDate", - "kind": "value", - "name": "setUTCDate", - "docstrings": [ - "`setDate(date, day)`\n\nSets the date (day of month) of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCDate(1)\n```" - ], - "signature": "let setUTCDate: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHours", - "kind": "value", - "name": "setUTCHours", - "docstrings": [ - "`setUTCHours(date, hours)`\n\nSets the hours of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHours(0)\n```" - ], - "signature": "let setUTCHours: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHoursM", - "kind": "value", - "name": "setUTCHoursM", - "docstrings": [ - "`setHoursM(date, ~hours, ~minutes)`\n\nSets the hours and minutes of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHoursM(~hours=0, ~minutes=0)\n```" - ], - "signature": "let setUTCHoursM: (t, ~hours: int, ~minutes: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHoursMS", - "kind": "value", - "name": "setUTCHoursMS", - "docstrings": [ - "`setUTCHoursMS(date, ~hours, ~minutes, ~seconds)`\n\nSets the hours, minutes and seconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHoursMS(~hours=0, ~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setUTCHoursMS: (t, ~hours: int, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHoursMSMs", - "kind": "value", - "name": "setUTCHoursMSMs", - "docstrings": [ - "`setUTCHoursMSMs(date, ~hours, ~minutes, ~seconds, ~milliseconds)`\n\nSets the hours, minutes, seconds and milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHoursMSMs(\n ~hours=0,\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setUTCHoursMSMs: (\n t,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setUTCMinutes", - "kind": "value", - "name": "setUTCMinutes", - "docstrings": [ - "`setUTCMinutes(date, minutes)`\n\nSets the minutes of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMinutes(0)\n```" - ], - "signature": "let setUTCMinutes: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMinutesS", - "kind": "value", - "name": "setUTCMinutesS", - "docstrings": [ - "`setUTCMinutesS(date, ~minutes, ~seconds)`\n\nSets the minutes and seconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMinutesS(~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setUTCMinutesS: (t, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMinutesSMs", - "kind": "value", - "name": "setUTCMinutesSMs", - "docstrings": [ - "`setUTCMinutesSMs(date, ~minutes, ~seconds, ~milliseconds)`\n\nSets the minutes, seconds and milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMinutesSMs(\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setUTCMinutesSMs: (\n t,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setUTCSeconds", - "kind": "value", - "name": "setUTCSeconds", - "docstrings": [ - "`setUTCSeconds(date, seconds)`\n\nSets the seconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCSeconds(0)\n```" - ], - "signature": "let setUTCSeconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCSecondsMs", - "kind": "value", - "name": "setUTCSecondsMs", - "docstrings": [ - "`setUTCSecondsMs(date, ~seconds, ~milliseconds)`\n\nSets the seconds and milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCSecondsMs(~seconds=0, ~milliseconds=0)\n```" - ], - "signature": "let setUTCSecondsMs: (t, ~seconds: int, ~milliseconds: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMilliseconds", - "kind": "value", - "name": "setUTCMilliseconds", - "docstrings": [ - "`setUTCMilliseconds(date, milliseconds)`\n\nSets the milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMilliseconds(0)\n```" - ], - "signature": "let setUTCMilliseconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.toDateString", - "kind": "value", - "name": "toDateString", - "docstrings": [ - "`toDateString(date)`\n\nConverts a JavaScript date to a standard date string. The date will be mapped to the current time zone.\nIf you want to convert it to a localized string, use `Date.toLocaleDateString` instead.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.toDateString->Console.log\n// Sun Jan 01 2023\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toDateString->Console.log\n// Sat Dec 31 2022\n```" - ], - "signature": "let toDateString: t => string" - }, - { - "id": "Stdlib.Date.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(date)`\n\nConverts a JavaScript date to a standard date time string. The date will be mapped to the current time zone.\nIf you want to convert it to a localized string, use `Date.toLocaleString` instead.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.toString->Console.log\n// Sun Jan 01 2023 00:00:00 GMT+0100 (Central European Standard Time)\n\nDate.fromString(\"2023-06-01T00:00:00.00+01:00\")->Date.toString->Console.log\n// Thu Jun 01 2023 01:00:00 GMT+0200 (Central European Summer Time)\n```" - ], - "signature": "let toString: t => string" - }, - { - "id": "Stdlib.Date.toTimeString", - "kind": "value", - "name": "toTimeString", - "docstrings": [ - "`toTimeString(date)`\n\nConverts a JavaScript date to a standard time string. The date will be mapped to the current time zone.\nIf you want to convert it to a localized string, use `Date.toLocaleStimeString` instead.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.toTimeString->Console.log\n// 00:00:00 GMT+0100 (Central European Standard Time)\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toTimeString->Console.log\n// 17:00:00 GMT+0100 (Central European Standard Time)\n```" - ], - "signature": "let toTimeString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleDateString", - "kind": "value", - "name": "toLocaleDateString", - "docstrings": [ - "`toLocaleDateString(date)`\n\nConverts a JavaScript date to a localized date string. It will use the current locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleDateString->Console.log\n// 2/19/2023\n```" - ], - "signature": "let toLocaleDateString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleDateStringWithLocale", - "kind": "value", - "name": "toLocaleDateStringWithLocale", - "docstrings": [ - "`toLocaleDateStringWithLocale(date, locale)`\n\nConverts a JavaScript date to a localized date string. It will use the specified locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleDateStringWithLocale(\"en-US\")->Console.log\n// 2/19/2023\n```" - ], - "signature": "let toLocaleDateStringWithLocale: (t, string) => string" - }, - { - "id": "Stdlib.Date.toLocaleDateStringWithLocaleAndOptions", - "kind": "value", - "name": "toLocaleDateStringWithLocaleAndOptions", - "docstrings": [ - "`toLocaleDateStringWithLocaleAndOptions(date, locale, options)`\n\nConverts a JavaScript date to a localized date string. It will use the specified locale and formatting options.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleDateStringWithLocaleAndOptions(\"en-US\", {dateStyle: #long})->Console.log\n// February 19, 2023\n\nDate.make()\n->Date.toLocaleDateStringWithLocaleAndOptions(\"de\", {hour: #\"2-digit\", minute: #\"2-digit\"})\n->Console.log\n// 19.2.2023, 15:40\n\nDate.make()->Date.toLocaleDateStringWithLocaleAndOptions(\"de\", {year: #numeric})->Console.log\n// 2023\n```" - ], - "signature": "let toLocaleDateStringWithLocaleAndOptions: (t, string, localeOptions) => string" - }, - { - "id": "Stdlib.Date.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(date)`\n\nConverts a JavaScript date to a localized date-time string. It will use the current locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleString->Console.log\n// 2/19/2023, 3:40:00 PM\n```" - ], - "signature": "let toLocaleString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleStringWithLocale", - "kind": "value", - "name": "toLocaleStringWithLocale", - "docstrings": [ - "`toLocaleStringWithLocale(date, locale)`\n\nConverts a JavaScript date to a localized date-time string. It will use the specified locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleStringWithLocale(\"en-US\")->Console.log\n// 2/19/2023, 3:40:00 PM\n```" - ], - "signature": "let toLocaleStringWithLocale: (t, string) => string" - }, - { - "id": "Stdlib.Date.toLocaleStringWithLocaleAndOptions", - "kind": "value", - "name": "toLocaleStringWithLocaleAndOptions", - "docstrings": [ - "`toLocaleStringWithLocaleAndOptions(date, locale, options)`\n\nConverts a JavaScript date to a localized date-time string. It will use the specified locale and formatting options.\n\n## Examples\n```rescript\nDate.make()\n->Date.toLocaleStringWithLocaleAndOptions(\"en\", {dateStyle: #short, timeStyle: #short})\n->Console.log\n// 2/19/23, 3:40 PM\n\nDate.make()\n->Date.toLocaleStringWithLocaleAndOptions(\n \"en\",\n {\n era: #long,\n year: #numeric,\n month: #\"2-digit\",\n day: #\"2-digit\",\n hour: #numeric,\n timeZoneName: #short,\n },\n)\n->Console.log\n// 02/19/2023 Anno Domini, 3 PM GMT+1\n```" - ], - "signature": "let toLocaleStringWithLocaleAndOptions: (t, string, localeOptions) => string" - }, - { - "id": "Stdlib.Date.toLocaleTimeString", - "kind": "value", - "name": "toLocaleTimeString", - "docstrings": [ - "`toLocaleTimeString(date)`\n\nConverts a JavaScript date to a localized time string. It will use the current locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleTimeString->Console.log\n// 3:40:00 PM\n```" - ], - "signature": "let toLocaleTimeString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleTimeStringWithLocale", - "kind": "value", - "name": "toLocaleTimeStringWithLocale", - "docstrings": [ - "`toLocaleTimeStringWithLocale(date, locale)`\n\nConverts a JavaScript date to a localized time string. It will use the specified locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleTimeStringWithLocale(\"en-US\")->Console.log\n// 3:40:00 PM\n```" - ], - "signature": "let toLocaleTimeStringWithLocale: (t, string) => string" - }, - { - "id": "Stdlib.Date.toLocaleTimeStringWithLocaleAndOptions", - "kind": "value", - "name": "toLocaleTimeStringWithLocaleAndOptions", - "docstrings": [ - "`toLocaleTimeStringWithLocaleAndOptions(date, locale, options)`\n\nConverts a JavaScript date to a localized time string. It will use the specified locale and formatting options.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleTimeStringWithLocaleAndOptions(\"en-US\", {timeStyle: #long})->Console.log\n// 3:40:00 PM GMT+1\n\nDate.make()\n->Date.toLocaleTimeStringWithLocaleAndOptions(\"de\", {hour: #\"2-digit\", minute: #\"2-digit\"})\n->Console.log\n// 15:40\n```" - ], - "signature": "let toLocaleTimeStringWithLocaleAndOptions: (t, string, localeOptions) => string" - }, - { - "id": "Stdlib.Date.toISOString", - "kind": "value", - "name": "toISOString", - "docstrings": [ - "`toISOString(date)`\n\nConverts a JavaScript date to a ISO 8601 string (YYYY-MM-DDTHH:mm:ss.sssZ). The date will be mapped to the UTC time.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toISOString->Console.log\n// 2023-01-01T00:00:00.000Z\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toISOString->Console.log\n// 2022-12-31T16:00:00.000Z\n```" - ], - "signature": "let toISOString: t => string" - }, - { - "id": "Stdlib.Date.toUTCString", - "kind": "value", - "name": "toUTCString", - "docstrings": [ - "`toUTCString(date)`\n\nConverts a JavaScript date to date time string. The date will be mapped to the UTC time.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toUTCString->Console.log\n// Sun, 01 Jan 2023 00:00:00 GMT\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toUTCString->Console.log\n// Sat, 31 Dec 2022 16:00:00 GMT\n```" - ], - "signature": "let toUTCString: t => string" - }, - { - "id": "Stdlib.Date.toJSON", - "kind": "value", - "name": "toJSON", - "docstrings": [ - "`toJSON(date)`\n\nConverts a JavaScript date to a string.\nIf the date is valid, the function will return the same result as `Date.toISOString`.\nInvalid dates will return `None`.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toJSON\n// Some(\"2023-01-01T00:00:00.000Z\")\n\nDate.fromString(\"\")->Date.toJSON\n// None\n```" - ], - "signature": "let toJSON: t => option" - }, - { - "id": "Stdlib.Date.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(date)` ignores the provided date and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/dataview": { - "id": "Stdlib.DataView", - "name": "DataView", - "docstrings": [ - "Functions for interacting with DataView.\n\nSee [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN." - ], - "items": [ - { - "id": "Stdlib.DataView.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a DataView." - ], - "signature": "type t" - }, - { - "id": "Stdlib.DataView.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer(buffer)` creates a DataView for the entire ArrayBuffer.\n\nSee [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN.\n\n## Examples\n\n```rescript\nDataView.fromBuffer(ArrayBuffer.make(16))\nDataView.fromBuffer(ArrayBuffer.make(16), ~byteOffset=4)\nDataView.fromBuffer(ArrayBuffer.make(16), ~byteOffset=4, ~length=8)\n```" - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.DataView.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd(buffer, ~byteOffset)` creates a DataView starting at a given byte offset. See [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN.\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.\n\n## Examples\n\n```rescript\nDataView.fromBufferToEnd(buffer, ~byteOffset=4)\n```" - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.DataView.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange(buffer, ~byteOffset, ~length)` creates a DataView for a specific byte range.\n\nSee [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN.\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.\n\n## Examples\n\n```rescript\nDataView.fromBufferWithRange(ArrayBuffer.make(16), ~byteOffset=2, ~length=8)\n```" - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.DataView.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [ - "`buffer(dataView)` returns the underlying ArrayBuffer referenced by this DataView.\n\nSee [`DataView.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/buffer) on MDN.\n\n## Examples\n\n```rescript\nlet array_buffer = ArrayBuffer.make(16)\nlet dv = DataView.fromBuffer(array_buffer)\nDataView.buffer(dv) == array_buffer\n```" - ], - "signature": "let buffer: t => ArrayBuffer.t" - }, - { - "id": "Stdlib.DataView.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [ - "`byteLength(dataView)` returns the length (in bytes) of this DataView.\n\nSee [`DataView.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet array_buffer = ArrayBuffer.make(16)\nlet dv = DataView.fromBuffer(array_buffer)\nDataView.byteLength(dv) == 16\n```" - ], - "signature": "let byteLength: t => int" - }, - { - "id": "Stdlib.DataView.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [ - "`byteOffset(dataView)` returns the byte offset of this DataView from the start of its ArrayBuffer.\n\nSee [`DataView.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/byteOffset) on MDN.\n\n## Examples\n\n```rescript\nlet array_buffer = ArrayBuffer.make(16)\nlet dv = DataView.fromBuffer(array_buffer, ~byteOffset=4)\nDataView.byteOffset(dv) == 4\n```" - ], - "signature": "let byteOffset: t => int" - }, - { - "id": "Stdlib.DataView.getInt8", - "kind": "value", - "name": "getInt8", - "docstrings": [ - "`getInt8(dataView, offset)` reads an 8-bit signed integer at the specified byte offset.\n\nSee [`DataView.getInt8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setInt8(0, -12)\nDataView.getInt8(dv, 0) == -12\n```" - ], - "signature": "let getInt8: (t, int) => int" - }, - { - "id": "Stdlib.DataView.getUint8", - "kind": "value", - "name": "getUint8", - "docstrings": [ - "`getUint8(dataView, offset)` reads an 8-bit unsigned integer at the specified byte offset.\n\nSee [`DataView.getUint8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setUint8(1, 255)\nDataView.getUint8(dv, 1) == 255\n```" - ], - "signature": "let getUint8: (t, int) => int" - }, - { - "id": "Stdlib.DataView.getInt16", - "kind": "value", - "name": "getInt16", - "docstrings": [ - "`getInt16(dataView, offset, ~littleEndian=?)` reads a 16-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getInt16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setInt16(0, -1234)\ndv->DataView.setInt16(2, -1234, ~littleEndian=true)\nDataView.getInt16(dv, 0) == -1234\nDataView.getInt16(dv, 2, ~littleEndian=true) == -1234\n```" - ], - "signature": "let getInt16: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getUint16", - "kind": "value", - "name": "getUint16", - "docstrings": [ - "`getUint16(dataView, offset, ~littleEndian=?)` reads a 16-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getUint16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setUint16(0, 1234)\ndv->DataView.setUint16(2, 1234, ~littleEndian=true)\nDataView.getUint16(dv, 0) == 1234\nDataView.getUint16(dv, 2, ~littleEndian=true) == 1234\n```" - ], - "signature": "let getUint16: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getInt32", - "kind": "value", - "name": "getInt32", - "docstrings": [ - "`getInt32(dataView, offset, ~littleEndian=?)` reads a 32-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getInt32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setInt32(0, -123456)\ndv->DataView.setInt32(4, -123456, ~littleEndian=true)\nDataView.getInt32(dv, 0) == -123456\nDataView.getInt32(dv, 4, ~littleEndian=true) == -123456\n```" - ], - "signature": "let getInt32: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getUint32", - "kind": "value", - "name": "getUint32", - "docstrings": [ - "`getUint32(dataView, offset, ~littleEndian=?)` reads a 32-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getUint32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setUint32(0, 123456)\ndv->DataView.setUint32(4, 123456, ~littleEndian=true)\nDataView.getUint32(dv, 0) == 123456\nDataView.getUint32(dv, 4, ~littleEndian=true) == 123456\n```" - ], - "signature": "let getUint32: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getFloat16", - "kind": "value", - "name": "getFloat16", - "docstrings": [ - "`getFloat16(dataView, offset, ~littleEndian=?)` reads a 16-bit floating point number (if supported) at the specified byte offset, with optional endianness.\n\nSee [`DataView.getFloat16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat16) on MDN.\n\n## Examples\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setFloat16(0, 1.5)\ndv->DataView.setFloat16(2, 1.5, ~littleEndian=true)\nDataView.getFloat16(dv, 0) == 1.5\nDataView.getFloat16(dv, 2, ~littleEndian=true) == 1.5\n```" - ], - "signature": "let getFloat16: (t, int, ~littleEndian: bool=?) => float" - }, - { - "id": "Stdlib.DataView.getFloat32", - "kind": "value", - "name": "getFloat32", - "docstrings": [ - "`getFloat32(dataView, offset, ~littleEndian=?)` reads a 32-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.getFloat32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setFloat32(0, 3.14)\ndv->DataView.setFloat32(4, 3.14, ~littleEndian=true)\n// DataView.getFloat32(dv, 0) == 3.14\n// DataView.getFloat32(dv, 4, ~littleEndian=true) == 3.14\n```" - ], - "signature": "let getFloat32: (t, int, ~littleEndian: bool=?) => float" - }, - { - "id": "Stdlib.DataView.getFloat64", - "kind": "value", - "name": "getFloat64", - "docstrings": [ - "`getFloat64(dataView, offset, ~littleEndian=?)` reads a 64-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.getFloat64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setFloat64(0, 6.28)\ndv->DataView.setFloat64(8, 6.28, ~littleEndian=true)\nDataView.getFloat64(dv, 0) == 6.28\nDataView.getFloat64(dv, 8, ~littleEndian=true) == 6.28\n```" - ], - "signature": "let getFloat64: (t, int, ~littleEndian: bool=?) => float" - }, - { - "id": "Stdlib.DataView.getBigInt64", - "kind": "value", - "name": "getBigInt64", - "docstrings": [ - "`getBigInt64(dataView, offset, ~littleEndian=?)` reads a 64-bit signed integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.getBigInt64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getBigInt64) on MDN.\n\n## Examples\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setBigInt64(0, -123456789n)\ndv->DataView.setBigInt64(8, -123456789n, ~littleEndian=true)\nDataView.getBigInt64(dv, 0) == -123456789n\nDataView.getBigInt64(dv, 8, ~littleEndian=true) == -123456789n\n```" - ], - "signature": "let getBigInt64: (t, int, ~littleEndian: bool=?) => bigint" - }, - { - "id": "Stdlib.DataView.getBigUint64", - "kind": "value", - "name": "getBigUint64", - "docstrings": [ - "`getBigUint64(dataView, offset, ~littleEndian=?)` reads a 64-bit unsigned integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.getBigUint64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getBigUint64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setBigUint64(0, 123456789n)\ndv->DataView.setBigUint64(8, 123456789n, ~littleEndian=true)\nDataView.getBigUint64(dv, 0) == 123456789n\nDataView.getBigUint64(dv, 8, ~littleEndian=true) == 123456789n\n```" - ], - "signature": "let getBigUint64: (t, int, ~littleEndian: bool=?) => bigint" - }, - { - "id": "Stdlib.DataView.setInt8", - "kind": "value", - "name": "setInt8", - "docstrings": [ - "`setInt8(dataView, offset, value)` writes an 8-bit signed integer at the specified byte offset.\n\nSee [`DataView.setInt8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setInt8(dv, 0, -12)\ndv->DataView.getInt8(0) == -12\n```" - ], - "signature": "let setInt8: (t, int, int) => unit" - }, - { - "id": "Stdlib.DataView.setUint8", - "kind": "value", - "name": "setUint8", - "docstrings": [ - "`setUint8(dataView, offset, value)` writes an 8-bit unsigned integer at the specified byte offset.\n\nSee [`DataView.setUint8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setUint8(dv, 0, 255)\ndv->DataView.getUint8(0) == 255\n```" - ], - "signature": "let setUint8: (t, int, int) => unit" - }, - { - "id": "Stdlib.DataView.setInt16", - "kind": "value", - "name": "setInt16", - "docstrings": [ - "`setInt16(dataView, offset, value, ~littleEndian=?)` writes a 16-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setInt16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setInt16(dv, 0, -1234)\nDataView.setInt16(dv, 2, -1234, ~littleEndian=true)\ndv->DataView.getInt16(0) == -1234\ndv->DataView.getInt16(2, ~littleEndian=true) == -1234\n```" - ], - "signature": "let setInt16: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setUint16", - "kind": "value", - "name": "setUint16", - "docstrings": [ - "`setUint16(dataView, offset, value, ~littleEndian=?)` writes a 16-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setUint16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setUint16(dv, 0, 1234)\nDataView.setUint16(dv, 2, 1234, ~littleEndian=true)\ndv->DataView.getUint16(0) == 1234\ndv->DataView.getUint16(2, ~littleEndian=true) == 1234\n```" - ], - "signature": "let setUint16: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setInt32", - "kind": "value", - "name": "setInt32", - "docstrings": [ - "`setInt32(dataView, offset, value, ~littleEndian=?)` writes a 32-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setInt32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setInt32(dv, 0, -123456)\nDataView.setInt32(dv, 4, -123456, ~littleEndian=true)\ndv->DataView.getInt32(0) == -123456\ndv->DataView.getInt32(4, ~littleEndian=true) == -123456\n```" - ], - "signature": "let setInt32: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setUint32", - "kind": "value", - "name": "setUint32", - "docstrings": [ - "`setUint32(dataView, offset, value, ~littleEndian=?)` writes a 32-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setUint32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setUint32(dv, 0, 123456)\nDataView.setUint32(dv, 4, 123456, ~littleEndian=true)\ndv->DataView.getUint32(0) == 123456\ndv->DataView.getUint32(4, ~littleEndian=true) == 123456\n```" - ], - "signature": "let setUint32: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setFloat16", - "kind": "value", - "name": "setFloat16", - "docstrings": [ - "`setFloat16(dataView, offset, value, ~littleEndian=?)` writes a 16-bit floating point number (if supported) at the specified byte offset, with optional endianness.\n\nSee [`DataView.setFloat16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setFloat16(dv, 0, 1.5)\nDataView.setFloat16(dv, 2, 1.5, ~littleEndian=true)\ndv->DataView.getFloat16(0) == 1.5\ndv->DataView.getFloat16(2, ~littleEndian=true) == 1.5\n```" - ], - "signature": "let setFloat16: (t, int, float, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setFloat32", - "kind": "value", - "name": "setFloat32", - "docstrings": [ - "`setFloat32(dataView, offset, value, ~littleEndian=?)` writes a 32-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.setFloat32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setFloat32(dv, 0, 3.14)\nDataView.setFloat32(dv, 4, 3.14, ~littleEndian=true)\n// dv->DataView.getFloat32(0) == 3.14\n// dv->DataView.getFloat32(4, ~littleEndian=true) == 3.14\n```" - ], - "signature": "let setFloat32: (t, int, float, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setFloat64", - "kind": "value", - "name": "setFloat64", - "docstrings": [ - "`setFloat64(dataView, offset, value, ~littleEndian=?)` writes a 64-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.setFloat64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setFloat64(dv, 0, 6.28)\nDataView.setFloat64(dv, 8, 6.28, ~littleEndian=true)\ndv->DataView.getFloat64(0) == 6.28\ndv->DataView.getFloat64(8, ~littleEndian=true) == 6.28\n```" - ], - "signature": "let setFloat64: (t, int, float, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setBigInt64", - "kind": "value", - "name": "setBigInt64", - "docstrings": [ - "`setBigInt64(dataView, offset, value, ~littleEndian=?)` writes a 64-bit signed integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.setBigInt64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setBigInt64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setBigInt64(dv, 0, -123456789n)\nDataView.setBigInt64(dv, 8, -123456789n, ~littleEndian=true)\ndv->DataView.getBigInt64(0) == -123456789n\ndv->DataView.getBigInt64(8, ~littleEndian=true) == -123456789n\n```" - ], - "signature": "let setBigInt64: (t, int, bigint, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setBigUint64", - "kind": "value", - "name": "setBigUint64", - "docstrings": [ - "`setBigUint64(dataView, offset, value, ~littleEndian=?)` writes a 64-bit unsigned integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.setBigUint64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setBigUint64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setBigUint64(dv, 0, 123456789n)\nDataView.setBigUint64(dv, 8, 123456789n, ~littleEndian=true)\ndv->DataView.getBigUint64(0) == 123456789n\ndv->DataView.getBigUint64(8, ~littleEndian=true) == 123456789n\n```" - ], - "signature": "let setBigUint64: (t, int, bigint, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(dataView)` ignores the provided DataView and returns unit.\n\nThis helper is useful when you want to discard a value (for example, the result of an operation with side effects) without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/console": { - "id": "Stdlib.Console", - "name": "Console", - "docstrings": [ - "Functions for interacting with JavaScript console.\n\nSee: [`console`](https://developer.mozilla.org/en-US/docs/Web/API/Console)." - ], - "items": [ - { - "id": "Stdlib.Console.assert_", - "kind": "value", - "name": "assert_", - "docstrings": [ - "`assert_(assertion, value)` print a message to console if `assertion` evaluates `false`. Does nothing if it's `true`.\n\nSee [`console.assert`](https://developer.mozilla.org/en-US/docs/Web/API/console/assert)\non MDN.\n\n## Examples\n\n```rescript\nConsole.assert_(false, \"Hello World!\")\nConsole.assert_(42 === 42, \"The answer\")\n```" - ], - "signature": "let assert_: (bool, 'a) => unit" - }, - { - "id": "Stdlib.Console.assert2", - "kind": "value", - "name": "assert2", - "docstrings": [ - "`assert2(v1, v2)`. Like `assert_`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.assert2(false, \"Hello\", \"World\")\nConsole.assert2(42 === 42, [1, 2, 3], '4')\n```" - ], - "signature": "let assert2: (bool, 'a, 'b) => unit" - }, - { - "id": "Stdlib.Console.assert3", - "kind": "value", - "name": "assert3", - "docstrings": [ - "`assert3(v1, v2, v3)`. Like `assert_`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.assert3(false, \"Hello\", \"World\", \"ReScript\")\nConsole.assert3(42 === 42, \"One\", 2, #3)\n```" - ], - "signature": "let assert3: (bool, 'a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.assert4", - "kind": "value", - "name": "assert4", - "docstrings": [ - "`assert4(v1, v2, v3, v4)`. Like `assert_`, but with four arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert4(false, \"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.assert4(value === 42, [1, 2], (3, 4), [#5, #6], #polyvar)\n```" - ], - "signature": "let assert4: (bool, 'a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.assert5", - "kind": "value", - "name": "assert5", - "docstrings": [ - "`assert5(v1, v2, v3, v4, v5)`. Like `assert_`, but with five arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert5(false, \"Hello\", \"World\", \"JS\", '!', '!')\nConsole.assert5(value === 42, [1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let assert5: (bool, 'a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.assert6", - "kind": "value", - "name": "assert6", - "docstrings": [ - "`assert6(v1, v2)`. Like `assert_`, but with six arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert6(false, \"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.assert6(value === 42, [1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let assert6: (bool, 'a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.assertMany", - "kind": "value", - "name": "assertMany", - "docstrings": [ - "`assertMany(assertion, arr)`. Like `assert_`, but variadic.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assertMany(false, [\"Hello\", \"World\"])\nConsole.assertMany(value === 42, [1, 2, 3])\n```" - ], - "signature": "let assertMany: (bool, array<'a>) => unit" - }, - { - "id": "Stdlib.Console.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "`clear()` clears the console, if allowed.\n\nSee [`console.clear`](https://developer.mozilla.org/en-US/docs/Web/API/console/clear)\non MDN.\n\n## Examples\n\n```rescript\nConsole.clear()\n```" - ], - "signature": "let clear: unit => unit" - }, - { - "id": "Stdlib.Console.count", - "kind": "value", - "name": "count", - "docstrings": [ - "`count(label)` prints to the console the number of times it's been called with the given label.\n\nSee [`console.count`](https://developer.mozilla.org/en-US/docs/Web/API/console/count)\non MDN.\n\n## Examples\n\n```rescript\nConsole.count(\"rescript\")\n```" - ], - "signature": "let count: string => unit" - }, - { - "id": "Stdlib.Console.countReset", - "kind": "value", - "name": "countReset", - "docstrings": [ - "`countReset(label)` resets the count for the given label to 0.\n\nSee [`console.countReset`](https://developer.mozilla.org/en-US/docs/Web/API/console/countReset)\non MDN.\n\n## Examples\n\n```rescript\nConsole.countReset(\"rescript\")\n```" - ], - "signature": "let countReset: string => unit" - }, - { - "id": "Stdlib.Console.debug", - "kind": "value", - "name": "debug", - "docstrings": [ - "`debug(value)` print a debug message to console.\n\nSee [`console.debug`](https://developer.mozilla.org/en-US/docs/Web/API/console/debug)\non MDN.\n\n## Examples\n\n```rescript\nConsole.debug(\"Hello\")\nlet obj = {\"name\": \"ReScript\", \"version\": 10}\nConsole.debug(obj)\n```" - ], - "signature": "let debug: 'a => unit" - }, - { - "id": "Stdlib.Console.debug2", - "kind": "value", - "name": "debug2", - "docstrings": [ - "`debug2(v1, v2)`. Like `debug`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.debug2(\"Hello\", \"World\")\nConsole.debug2([1, 2, 3], '4')\n```" - ], - "signature": "let debug2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.debug3", - "kind": "value", - "name": "debug3", - "docstrings": [ - "`debug3(v1, v2, v3)`. Like `debug`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.debug3(\"Hello\", \"World\", \"ReScript\")\nConsole.debug3(\"One\", 2, #3)\n```" - ], - "signature": "let debug3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.debug4", - "kind": "value", - "name": "debug4", - "docstrings": [ - "`debug4(v1, v2, v3, v4)`. Like `debug`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.debug4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.debug4([1, 2], (3, 4), [#5, #6], #polyvar)\n```" - ], - "signature": "let debug4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.debug5", - "kind": "value", - "name": "debug5", - "docstrings": [ - "`debug5(v1, v2, v3, v4, v5)`. Like `debug`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.debug5(\"Hello\", \"World\", \"JS\", '!', '!')\nConsole.debug5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let debug5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.debug6", - "kind": "value", - "name": "debug6", - "docstrings": [ - "`debug6(v1, v2, v3, v4, v5, v6)`. Like `debug`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.debug6(\"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.debug6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let debug6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.debugMany", - "kind": "value", - "name": "debugMany", - "docstrings": [ - "`debugMany(arr)`. Like `debug`, but variadic.\n\n## Examples\n\n```rescript\nConsole.debugMany([\"Hello\", \"World\"])\nConsole.debugMany([1, 2, 3])\n```" - ], - "signature": "let debugMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.dirOptions", - "kind": "type", - "name": "dirOptions", - "docstrings": [], - "signature": "type dirOptions = {\n colors?: bool,\n depth?: Nullable.t,\n showHidden?: bool,\n}" - }, - { - "id": "Stdlib.Console.dir", - "kind": "value", - "name": "dir", - "docstrings": [ - "`dir(object, options)` displays an interactive view of the object in the console.\n\nSee [`console.dir`](https://developer.mozilla.org/en-US/docs/Web/API/console/dir)\non MDN.\n\n## Examples\n\n```rescript\nConsole.dir({\"language\": \"rescript\", \"version\": \"10.1.2\"})\nConsole.dir(\n {\"language\": \"rescript\", \"version\": {\"major\": \"10\", \"minor\": \"1\", \"patch\": \"2\"}},\n ~options={depth: null},\n)\n```" - ], - "signature": "let dir: ('a, ~options: dirOptions=?) => unit" - }, - { - "id": "Stdlib.Console.dirxml", - "kind": "value", - "name": "dirxml", - "docstrings": [ - "`dirxml(object)` displays an interactive tree view of an XML/HTML element in the console.\n\nSee [`console.dirxml`](https://developer.mozilla.org/en-US/docs/Web/API/console/dirxml)\non MDN." - ], - "signature": "let dirxml: 'a => unit" - }, - { - "id": "Stdlib.Console.error", - "kind": "value", - "name": "error", - "docstrings": [ - "`error(value)` prints an error message to console.\n\nSee [`console.error`](https://developer.mozilla.org/en-US/docs/Web/API/console/error)\non MDN.\n\n## Examples\n\n```rescript\nConsole.error(\"error message\")\nConsole.error((\"error\", \"invalid value\"))\n```" - ], - "signature": "let error: 'a => unit" - }, - { - "id": "Stdlib.Console.error2", - "kind": "value", - "name": "error2", - "docstrings": [ - "`error(v1, v2)`. Like `error`, but two arguments.\n\n## Examples\n\n```rescript\nConsole.error2(\"Error\", \"here\")\nConsole.error2((\"log\", \"error\"), \"message\")\n```" - ], - "signature": "let error2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.error3", - "kind": "value", - "name": "error3", - "docstrings": [ - "`error3(v1, v2, v3)`. Like `error`, but three arguments.\n\n## Examples\n\n```rescript\nConsole.error3(\"Hello\", \"World\", \"!!!\")\nConsole.error3(#first, #second, #third)\n```" - ], - "signature": "let error3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.error4", - "kind": "value", - "name": "error4", - "docstrings": [ - "`error4(v1, v2, v3, v4)`. Like `error`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.error4(\"Hello\", \"World\", \"ReScript\", '!')\nConsole.error4(#first, #second, #third, \"fourth\")\n```" - ], - "signature": "let error4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.error5", - "kind": "value", - "name": "error5", - "docstrings": [ - "`error5(v1, v2, v3, v4, v5)`. Like `error`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.error5('e', 'r', 'r', 'o', 'r')\nConsole.error5(1, #second, #third, \"fourth\", 'c')\n```" - ], - "signature": "let error5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.error6", - "kind": "value", - "name": "error6", - "docstrings": [ - "`error6(v1, v2, v3, v4, v5, v6)`. Like `error`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.error6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.error6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let error6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.group", - "kind": "value", - "name": "group", - "docstrings": [ - "`group(label)` creates a new \"group\" level with the given label.\n\nSee [`console.group`](https://developer.mozilla.org/en-US/docs/Web/API/console/group)\non MDN.\n\n## Example\n\n```rescript\nConsole.group(\"first group\")\nConsole.group(\"second group\")\nConsole.log(\"a message on the second level\")\nConsole.groupEnd()\nConsole.log(\"a message message on the first level\")\nConsole.groupEnd()\n```" - ], - "signature": "let group: string => unit" - }, - { - "id": "Stdlib.Console.groupCollapsed", - "kind": "value", - "name": "groupCollapsed", - "docstrings": [ - "`groupCollapsed(label)`. Like `group` but collapses the group initially.\n\nSee [`console.groupCollapsed`](https://developer.mozilla.org/en-US/docs/Web/API/console/groupCollapsed)\non MDN." - ], - "signature": "let groupCollapsed: string => unit" - }, - { - "id": "Stdlib.Console.groupEnd", - "kind": "value", - "name": "groupEnd", - "docstrings": [ - "`groupEnd()` ends the current group.\n\nSee [`console.groupEnd`](https://developer.mozilla.org/en-US/docs/Web/API/console/groupEnd)\non MDN." - ], - "signature": "let groupEnd: unit => unit" - }, - { - "id": "Stdlib.Console.errorMany", - "kind": "value", - "name": "errorMany", - "docstrings": [ - "`errorMany(arr)`. Like `error`, but variadic.\n\n## Examples\n\n```rescript\nConsole.errorMany([\"Hello\", \"World\"])\nConsole.errorMany([1, 2, 3])\n```" - ], - "signature": "let errorMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.info", - "kind": "value", - "name": "info", - "docstrings": [ - "`info(value)` print an informational message to console.\n\nSee [`console.info`](https://developer.mozilla.org/en-US/docs/Web/API/console/info)\non MDN.\n\n## Examples\n\n```rescript\nConsole.info(\"Information\")\nConsole.info((\"Hello\", \"JS\"))\n```" - ], - "signature": "let info: 'a => unit" - }, - { - "id": "Stdlib.Console.info2", - "kind": "value", - "name": "info2", - "docstrings": [ - "`info2(v1, v2)`. Like `info`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.info2(\"Info\", \"failed to download\")\nConsole.info2(#info, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let info2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.info3", - "kind": "value", - "name": "info3", - "docstrings": [ - "`info3(v1, v2, v3)`. Like `info`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.info3(\"Hello\", \"World\", \"ReScript\")\nConsole.info3([1, 2, 3], #4, #5)\n```" - ], - "signature": "let info3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.info4", - "kind": "value", - "name": "info4", - "docstrings": [ - "`info4(v1, v2, v3, v4)`. Like `info`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.info4(\"Hello\", \"World\", \"ReScript\", '!')\nConsole.info4([1, 2, 3], #4, #5, #lastinfo)\n```" - ], - "signature": "let info4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.info5", - "kind": "value", - "name": "info5", - "docstrings": [ - "`info5(v1, v2, v3, v4, v5)`. Like `info`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.info5(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\")\nConsole.info5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let info5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.info6", - "kind": "value", - "name": "info6", - "docstrings": [ - "`info6(v1, v2, v3, v4, v5, v6)`. Like `info`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.info6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.info6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let info6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.infoMany", - "kind": "value", - "name": "infoMany", - "docstrings": [ - "`infoMany(arr)`. Like `info`, but variadic.\n\n## Examples\n\n```rescript\nConsole.infoMany([\"Hello\", \"World\"])\nConsole.infoMany([1, 2, 3])\n```" - ], - "signature": "let infoMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.log", - "kind": "value", - "name": "log", - "docstrings": [ - "`log(value)` print a message to console.\n\nSee [`console.log`](https://developer.mozilla.org/en-US/docs/Web/API/console/log)\non MDN.\n\n## Examples\n\n```rescript\nConsole.log(\"Hello\")\nlet obj = {\"name\": \"ReScript\", \"version\": 10}\nConsole.log(obj)\n```" - ], - "signature": "let log: 'a => unit" - }, - { - "id": "Stdlib.Console.log2", - "kind": "value", - "name": "log2", - "docstrings": [ - "`log2(v1, v2)`. Like `log`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.log2(\"Hello\", \"World\")\nConsole.log2([1, 2, 3], '4')\n```" - ], - "signature": "let log2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.log3", - "kind": "value", - "name": "log3", - "docstrings": [ - "`log3(v1, v2, v3)`. Like `log`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.log3(\"Hello\", \"World\", \"ReScript\")\nConsole.log3(\"One\", 2, #3)\n```" - ], - "signature": "let log3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.log4", - "kind": "value", - "name": "log4", - "docstrings": [ - "`log4(v1, v2, v3, v4)`. Like `log`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.log4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.log4([1, 2], (3, 4), [#5, #6], #polyvar)\n```" - ], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.log5", - "kind": "value", - "name": "log5", - "docstrings": [ - "`log5(v1, v2, v3, v4, v5)`. Like `log`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.log5(\"Hello\", \"World\", \"JS\", '!', '!')\nConsole.log5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let log5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.log6", - "kind": "value", - "name": "log6", - "docstrings": [ - "`log6(v1, v2, v3, v4, v5, v6)`. Like `log`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.log6(\"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.log6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let log6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.logMany", - "kind": "value", - "name": "logMany", - "docstrings": [ - "`logMany(arr)`. Like `log`, but variadic.\n\n## Examples\n\n```rescript\nConsole.logMany([\"Hello\", \"World\"])\nConsole.logMany([1, 2, 3])\n```" - ], - "signature": "let logMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.table", - "kind": "value", - "name": "table", - "docstrings": [ - "`table(object)` displays an tabular view of the object in the console.\n\nSee [`console.table`](https://developer.mozilla.org/en-US/docs/Web/API/console/table)\non MDN.\n\n## Examples\n\n```rescript\nConsole.table({\"language\": \"rescript\", \"version\": \"10.1.2\"})\n```" - ], - "signature": "let table: 'a => unit" - }, - { - "id": "Stdlib.Console.time", - "kind": "value", - "name": "time", - "docstrings": [ - "`time(label)` creates a timer to measure how long an operation takes. `label`\nmust be a unique name. Call `console.timeEnd` with the same `label` to print\noutput time.\n\nSee [`console.time`](https://developer.mozilla.org/en-US/docs/Web/API/console/time)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let time: string => unit" - }, - { - "id": "Stdlib.Console.timeEnd", - "kind": "value", - "name": "timeEnd", - "docstrings": [ - "`timeEnd(label)` stops a timer created by `time`.\n\nSee [`console.timeEnd`](https://developer.mozilla.org/en-US/docs/Web/API/console/timeEnd)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let timeEnd: string => unit" - }, - { - "id": "Stdlib.Console.timeLog", - "kind": "value", - "name": "timeLog", - "docstrings": [ - "`timeLog(label)` prints the current elapsed time of the given timer to the console.\n\nSee [`console.timeLog`](https://developer.mozilla.org/en-US/docs/Web/API/console/timeLog)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let timeLog: string => unit" - }, - { - "id": "Stdlib.Console.trace", - "kind": "value", - "name": "trace", - "docstrings": [ - "`trace()` print a stack trace to console.\n\nSee [`console.trace`](https://developer.mozilla.org/en-US/docs/Web/API/console/trace)\non MDN.\n\n## Examples\n\n```rescript\nlet main = () => {\n Console.trace()\n}\nmain()\n// In the console, the following trace will be displayed:\n// main\n// \n```" - ], - "signature": "let trace: unit => unit" - }, - { - "id": "Stdlib.Console.warn", - "kind": "value", - "name": "warn", - "docstrings": [ - "`warn(value)` print a warning message to console.\n\nSee [`console.warn`](https://developer.mozilla.org/en-US/docs/Web/API/console/warn)\non MDN.\n\n## Examples\n\n```rescript\nConsole.warn(\"Warning\")\nConsole.warn((\"Warning\", \"invalid number\"))\n```" - ], - "signature": "let warn: 'a => unit" - }, - { - "id": "Stdlib.Console.warn2", - "kind": "value", - "name": "warn2", - "docstrings": [ - "`warn2(v1, v2)`. Like `warn`, but two arguments.\n\n## Examples\n\n```rescript\nConsole.warn2(\"Hello\", \"World\")\nConsole.warn2([1, 2, 3], 4)\n```" - ], - "signature": "let warn2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.warn3", - "kind": "value", - "name": "warn3", - "docstrings": [ - "`warn3(v1, v2, v3)`. Like `warn`, but three arguments.\n\n## Examples\n\n```rescript\nConsole.warn3(\"Hello\", \"World\", \"ReScript\")\nConsole.warn3([1, 2, 3], #4, #5)\n```" - ], - "signature": "let warn3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.warn4", - "kind": "value", - "name": "warn4", - "docstrings": [ - "`warn4(v1, v2, v3, v4)`. Like `warn`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.warn4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.warn4(#first, #second, #third, \"fourth\")\n```" - ], - "signature": "let warn4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.warn5", - "kind": "value", - "name": "warn5", - "docstrings": [ - "`warn5(v1, v2, v3, v4, v5)`. Like `warn`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.warn5(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\")\nConsole.warn5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let warn5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.warn6", - "kind": "value", - "name": "warn6", - "docstrings": [ - "`warn6(v1, v2, v3, v4, v5, v6)`. Like `warn`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.warn6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.warn6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let warn6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.warnMany", - "kind": "value", - "name": "warnMany", - "docstrings": [ - "`warnMany(arr)`. Like `warn`, but variadic.\n\n## Examples\n\n```rescript\nConsole.warnMany([\"Hello\", \"World\"])\nConsole.warnMany([1, 2, 3])\n```" - ], - "signature": "let warnMany: array<'a> => unit" - } - ] - }, - "stdlib/bool": { - "id": "Stdlib.Bool", - "name": "Bool", - "docstrings": [ - "Functions for interacting with JavaScript booleans.\nSee: [`Boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)" - ], - "items": [ - { - "id": "Stdlib.Bool.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a boolean." - ], - "signature": "type t = bool" - }, - { - "id": "Stdlib.Bool.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts a boolean to a string.\n\n## Examples\n```rescript\nBool.toString(true) == \"true\"\nBool.toString(false) == \"false\"\n```" - ], - "signature": "let toString: bool => string" - }, - { - "id": "Stdlib.Bool.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Converts a string to a boolean.\n\n## Examples\n```rescript\nBool.fromString(\"true\") == Some(true)\nBool.fromString(\"false\") == Some(false)\nBool.fromString(\"notAValidBoolean\") == None\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.Bool.fromStringOrThrow", - "kind": "value", - "name": "fromStringOrThrow", - "docstrings": [ - "Converts a string to a boolean.\nThrows an `Invalid_argument` exception if the string is not a valid boolean.\n\n## Examples\n```rescript\nBool.fromStringOrThrow(\"true\") == true\nBool.fromStringOrThrow(\"false\") == false\nswitch Bool.fromStringOrThrow(\"notAValidBoolean\") {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let fromStringOrThrow: string => bool" - }, - { - "id": "Stdlib.Bool.fromStringExn", - "kind": "value", - "name": "fromStringExn", - "docstrings": [ - "Converts a string to a boolean.\nBeware, this function will throw an `Invalid_argument` exception\nif the string is not a valid boolean.\n\n## Examples\n```rescript\nBool.fromStringExn(\"true\") == true\nBool.fromStringExn(\"false\") == false\nswitch Bool.fromStringExn(\"notAValidBoolean\") {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let fromStringExn: string => bool", - "deprecated": "" - }, - { - "id": "Stdlib.Bool.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "Compares two booleans, returns an `Ordering.t` value.\n\n## Examples\n```rescript\nBool.compare(true, true) == Ordering.equal\nBool.compare(false, false) == Ordering.equal\nBool.compare(true, false) == Ordering.greater\nBool.compare(false, true) == Ordering.less\n```" - ], - "signature": "let compare: (bool, bool) => Ordering.t" - }, - { - "id": "Stdlib.Bool.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "Checks if two booleans are equal and have the same value.\n\n## Examples\n```rescript\nBool.equal(true, true) == true\nBool.equal(false, false) == true\nBool.equal(true, false) == false\nBool.equal(false, true) == false\n```" - ], - "signature": "let equal: (bool, bool) => bool" - }, - { - "id": "Stdlib.Bool.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bool)` ignores the provided boolean and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: bool => unit" - } - ] - }, - "stdlib/bigint": { - "id": "Stdlib.BigInt", - "name": "BigInt", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigInt.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a bigint." - ], - "signature": "type t = bigint" - }, - { - "id": "Stdlib.BigInt.asIntN", - "kind": "value", - "name": "asIntN", - "docstrings": [ - "`asIntN(~width, bigint)` returns a bigint value truncated to the given number of bits as a signed integer.\n\nSee [`BigInt.asIntN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/asIntN) on MDN.\n\n## Examples\n\n```rescript\nBigInt.asIntN(~width=4, 25n) == -7n\nBigInt.asIntN(~width=4, 3n) == 3n\n```" - ], - "signature": "let asIntN: (~width: int, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.asUintN", - "kind": "value", - "name": "asUintN", - "docstrings": [ - "`asUintN(~width, bigint)` returns a bigint value truncated to the given number of bits as an unsigned integer.\n\nSee [`BigInt.asUintN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/asUintN) on MDN.\n\n## Examples\n\n```rescript\nBigInt.asUintN(~width=4, 25n) == 9n\nBigInt.asUintN(~width=4, 3n) == 3n\n```" - ], - "signature": "let asUintN: (~width: int, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.fromStringOrThrow", - "kind": "value", - "name": "fromStringOrThrow", - "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Return the\nnumber as a `bigint` if successfully parsed. Throws a syntax exception otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromStringOrThrow(\"123\") == 123n\n\nBigInt.fromStringOrThrow(\"\") == 0n\n\nBigInt.fromStringOrThrow(\"0x11\") == 17n\n\nBigInt.fromStringOrThrow(\"0b11\") == 3n\n\nBigInt.fromStringOrThrow(\"0o11\") == 9n\n\n/* catch exception */\nswitch BigInt.fromStringOrThrow(\"a\") {\n| exception JsExn(_error) => assert(true)\n| _bigInt => assert(false)\n}\n```" - ], - "signature": "let fromStringOrThrow: string => bigint" - }, - { - "id": "Stdlib.BigInt.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Returns\n`Some(bigint)` if the string can be parsed, `None` otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromString(\"123\") == Some(123n)\n\nBigInt.fromString(\"\") == Some(0n)\n\nBigInt.fromString(\"0x11\") == Some(17n)\n\nBigInt.fromString(\"0b11\") == Some(3n)\n\nBigInt.fromString(\"0o11\") == Some(9n)\n\nBigInt.fromString(\"invalid\") == None\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.BigInt.fromStringExn", - "kind": "value", - "name": "fromStringExn", - "docstrings": [], - "signature": "let fromStringExn: string => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "`fromInt(int)` converts an `int` to a `bigint`.\n\n## Examples\n\n```rescript\nBigInt.fromInt(123) == 123n\nBigInt.fromInt(0) == 0n\nBigInt.fromInt(-456) == -456n\n```" - ], - "signature": "let fromInt: int => bigint" - }, - { - "id": "Stdlib.BigInt.fromFloatOrThrow", - "kind": "value", - "name": "fromFloatOrThrow", - "docstrings": [ - "Converts a `float` to a `bigint` using JavaScript semantics.\nThrows an exception if the float is not an integer or is infinite/NaN.\n\n## Examples\n\n```rescript\nBigInt.fromFloatOrThrow(123.0) == 123n\n\nBigInt.fromFloatOrThrow(0.0) == 0n\n\nBigInt.fromFloatOrThrow(-456.0) == -456n\n\n/* This will throw an exception */\nswitch BigInt.fromFloatOrThrow(123.5) {\n| exception JsExn(_error) => assert(true)\n| _bigInt => assert(false)\n}\n```" - ], - "signature": "let fromFloatOrThrow: float => bigint" - }, - { - "id": "Stdlib.BigInt.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "`fromFloat(float)` converts a `float` to a `bigint` using JavaScript semantics.\nReturns `Some(bigint)` if the float is a valid `bigint`, `None` otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromFloat(123.0) == Some(123n)\nBigInt.fromFloat(0.0) == Some(0n)\nBigInt.fromFloat(-456.0) == Some(-456n)\nBigInt.fromFloat(123.5) == None\n```" - ], - "signature": "let fromFloat: float => option" - }, - { - "id": "Stdlib.BigInt.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats a `bigint` as a string. Return a `string` representing the given value.\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nBigInt.toString(123n) == \"123\"\n```" - ], - "signature": "let toString: (bigint, ~radix: int=?) => string" - }, - { - "id": "Stdlib.BigInt.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [], - "signature": "let toStringWithRadix: (bigint, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Returns a string with a language-sensitive representation of this BigInt value.\n\n## Examples\n\n```rescript\nBigInt.toString(123n) == \"123\"\n```" - ], - "signature": "let toLocaleString: bigint => string" - }, - { - "id": "Stdlib.BigInt.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [ - "`toFloat(bigint)` converts a `bigint` to a `float`.\n\n## Examples\n\n```rescript\nBigInt.toFloat(123n) == 123.0\nBigInt.toFloat(0n) == 0.0\nBigInt.toFloat(-456n) == -456.0\n```" - ], - "signature": "let toFloat: bigint => float" - }, - { - "id": "Stdlib.BigInt.toInt", - "kind": "value", - "name": "toInt", - "docstrings": [ - "`toInt(bigint)` converts a `bigint` to an `int`.\n\n## Examples\n\n```rescript\nBigInt.toInt(123n) == 123\nBigInt.toInt(0n) == 0\nBigInt.toInt(-456n) == -456\n```" - ], - "signature": "let toInt: bigint => int" - }, - { - "id": "Stdlib.BigInt.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(a, b)` calculates the sum of two bigints.\n\n## Examples\n\n```rescript\nBigInt.add(5n, 3n) == 8n\nBigInt.add(-2n, 7n) == 5n\n```" - ], - "signature": "let add: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.sub", - "kind": "value", - "name": "sub", - "docstrings": [ - "`sub(a, b)` calculates the difference of two bigints.\n\n## Examples\n\n```rescript\nBigInt.sub(8n, 3n) == 5n\nBigInt.sub(2n, 7n) == -5n\n```" - ], - "signature": "let sub: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.mul", - "kind": "value", - "name": "mul", - "docstrings": [ - "`mul(a, b)` calculates the product of two bigints.\n\n## Examples\n\n```rescript\nBigInt.mul(5n, 3n) == 15n\nBigInt.mul(-2n, 7n) == -14n\n```" - ], - "signature": "let mul: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.div", - "kind": "value", - "name": "div", - "docstrings": [ - "`div(a, b)` calculates the quotient of two bigints.\n\n## Examples\n\n```rescript\nBigInt.div(15n, 3n) == 5n\nBigInt.div(14n, 3n) == 4n\n```" - ], - "signature": "let div: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.mod", - "kind": "value", - "name": "mod", - "docstrings": [ - "`mod(a, b)` calculates the remainder of dividing two bigints.\n\n## Examples\n\n```rescript\nBigInt.mod(15n, 4n) == 3n\nBigInt.mod(14n, 3n) == 2n\n```" - ], - "signature": "let mod: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseAnd", - "kind": "value", - "name": "bitwiseAnd", - "docstrings": [ - "`bitwiseAnd(a, b)` calculates the bitwise AND of two bigints.\n\n## Examples\n\n```rescript\nBigInt.bitwiseAnd(7n, 4n) == 4n\nBigInt.bitwiseAnd(15n, 8n) == 8n\n```" - ], - "signature": "let bitwiseAnd: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseOr", - "kind": "value", - "name": "bitwiseOr", - "docstrings": [ - "`bitwiseOr(a, b)` calculates the bitwise OR of two bigints.\n\n## Examples\n\n```rescript\nBigInt.bitwiseOr(7n, 4n) == 7n\nBigInt.bitwiseOr(8n, 4n) == 12n\n```" - ], - "signature": "let bitwiseOr: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseXor", - "kind": "value", - "name": "bitwiseXor", - "docstrings": [ - "`bitwiseXor(a, b)` calculates the bitwise XOR of two bigints.\n\n## Examples\n\n```rescript\nBigInt.bitwiseXor(7n, 4n) == 3n\nBigInt.bitwiseXor(15n, 8n) == 7n\n```" - ], - "signature": "let bitwiseXor: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseNot", - "kind": "value", - "name": "bitwiseNot", - "docstrings": [ - "`bitwiseNot(bigint)` calculates the bitwise NOT of a bigint.\n\n## Examples\n\n```rescript\nBigInt.bitwiseNot(2n) == -3n\nBigInt.bitwiseNot(-1n) == 0n\n```" - ], - "signature": "let bitwiseNot: bigint => bigint" - }, - { - "id": "Stdlib.BigInt.shiftLeft", - "kind": "value", - "name": "shiftLeft", - "docstrings": [ - "`shiftLeft(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the left.\n\n## Examples\n\n```rescript\nBigInt.shiftLeft(4n, 1n) == 8n\nBigInt.shiftLeft(1n, 3n) == 8n\n```" - ], - "signature": "let shiftLeft: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.shiftRight", - "kind": "value", - "name": "shiftRight", - "docstrings": [ - "`shiftRight(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the right.\n\n## Examples\n\n```rescript\nBigInt.shiftRight(8n, 1n) == 4n\nBigInt.shiftRight(16n, 2n) == 4n\n```" - ], - "signature": "let shiftRight: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bigint)` ignores the provided bigint and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: bigint => unit" - }, - { - "id": "Stdlib.BigInt.land", - "kind": "value", - "name": "land", - "docstrings": [ - "`land(a, b)` calculates the bitwise AND of two bigints.\n\n**Deprecated:** Use `&&&` operator or `bitwiseAnd` instead.\n\n## Examples\n\n```rescript\nBigInt.land(7n, 4n) == 4n\n```" - ], - "signature": "let land: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lor", - "kind": "value", - "name": "lor", - "docstrings": [ - "`lor(a, b)` calculates the bitwise OR of two bigints.\n\n**Deprecated:** Use `|||` operator or `bitwiseOr` instead.\n\n## Examples\n\n```rescript\nBigInt.lor(7n, 4n) == 7n\n```" - ], - "signature": "let lor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lxor", - "kind": "value", - "name": "lxor", - "docstrings": [ - "`lxor(a, b)` calculates the bitwise XOR of two bigints.\n\n**Deprecated:** Use `^^^` operator or `bitwiseXor` instead.\n\n## Examples\n\n```rescript\nBigInt.lxor(7n, 4n) == 3n\n```" - ], - "signature": "let lxor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lnot", - "kind": "value", - "name": "lnot", - "docstrings": [ - "`lnot(bigint)` calculates the bitwise NOT of a bigint.\n\n**Deprecated:** Use `~~~` operator or `bitwiseNot` instead.\n\n## Examples\n\n```rescript\nBigInt.lnot(2n) == -3n\n```" - ], - "signature": "let lnot: bigint => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lsl", - "kind": "value", - "name": "lsl", - "docstrings": [ - "`lsl(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the left.\n\n**Deprecated:** Use `<<` operator or `shiftLeft` instead.\n\n## Examples\n\n```rescript\nBigInt.lsl(4n, 1n) == 8n\n```" - ], - "signature": "let lsl: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.asr", - "kind": "value", - "name": "asr", - "docstrings": [ - "`asr(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the right.\n\n**Deprecated:** Use `>>` operator or `shiftRight` instead.\n\n## Examples\n\n```rescript\nBigInt.asr(8n, 1n) == 4n\n```" - ], - "signature": "let asr: (bigint, bigint) => bigint", - "deprecated": "" - } - ] - }, - "stdlib/array": { - "id": "Stdlib.Array", - "name": "Array", - "docstrings": [ - "A mutable array.\n\nCompiles to a regular JavaScript array." - ], - "items": [ - { - "id": "Stdlib.Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an array of value `'a`." - ], - "signature": "type t<'a> = array<'a>" - }, - { - "id": "Stdlib.Array.arrayLike", - "kind": "type", - "name": "arrayLike", - "docstrings": [], - "signature": "type arrayLike<'a>" - }, - { - "id": "Stdlib.Array.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "`fromIterator(iterator)` creates an array from the provided `iterator`\n\n## Examples\n\n```rescript\nMap.fromArray([(\"foo\", 1), (\"bar\", 2)])\n->Map.values\n->Array.fromIterator == [1, 2]\n```" - ], - "signature": "let fromIterator: Iterator.t<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.fromArrayLike", - "kind": "value", - "name": "fromArrayLike", - "docstrings": [ - "`fromArrayLike(source)` converts an array-like value (anything with indexed items and a `length`) into a regular array.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 10, 1: 20, length: 2}`)\nArray.fromArrayLike(source) == [10, 20]\n```" - ], - "signature": "let fromArrayLike: arrayLike<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.fromArrayLikeWithMap", - "kind": "value", - "name": "fromArrayLikeWithMap", - "docstrings": [ - "`fromArrayLikeWithMap(source, map)` converts an array-like value into an array and applies `map` to every element.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 1, 1: 2, length: 2}`)\nArray.fromArrayLikeWithMap(source, x => x * 10) == [10, 20]\n```" - ], - "signature": "let fromArrayLikeWithMap: (arrayLike<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Stdlib.Array.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(str)` creates an array of each character as a separate string from the provided `str`.\n\n## Examples\n\n```rescript\nArray.fromString(\"abcde\") == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let fromString: string => array" - }, - { - "id": "Stdlib.Array.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(~length, init)` creates an array of length `length` initialized with the value of `init`.\n\n## Examples\n\n```rescript\nArray.make(~length=3, #apple) == [#apple, #apple, #apple]\nArray.make(~length=6, 7) == [7, 7, 7, 7, 7, 7]\n```" - ], - "signature": "let make: (~length: int, 'a) => array<'a>" - }, - { - "id": "Stdlib.Array.fromInitializer", - "kind": "value", - "name": "fromInitializer", - "docstrings": [ - "`fromInitializer(~length, f)`\n\nCreates an array of length `length` initialized with the value returned from `f ` for each index.\n\n## Examples\n\n```rescript\nArray.fromInitializer(~length=3, i => i + 3) == [3, 4, 5]\n\nArray.fromInitializer(~length=7, i => i + 3) == [3, 4, 5, 6, 7, 8, 9]\n```" - ], - "signature": "let fromInitializer: (~length: int, int => 'a) => array<'a>" - }, - { - "id": "Stdlib.Array.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(left, right, predicate)` checks if the two arrays contain the same elements according to the equality `predicate`.\n\n## Examples\n\n```rescript\nArray.equal([1, 2, 3], [1, 2, 3], Int.equal) == true\nArray.equal([1, 2, 3], [1, 3, 2], Int.equal) == false\n```" - ], - "signature": "let equal: (array<'a>, array<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Stdlib.Array.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(left, right, comparator)` compares two arrays element by element using `comparator` and returns an `Ordering`.\n\n## Examples\n\n```rescript\nArray.compare([1, 3], [1, 2], Int.compare) == Ordering.greater\nArray.compare([1, 2], [1, 2], Int.compare) == Ordering.equal\n```" - ], - "signature": "let compare: (array<'a>, array<'a>, ('a, 'a) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.Array.isArray", - "kind": "value", - "name": "isArray", - "docstrings": [ - "`isArray(value)` returns `true` when `value` is a JavaScript array and `false` otherwise.\n\nSee [`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) on MDN.\n\n## Examples\n\n```rescript\nArray.isArray([1, 2, 3]) == true\nArray.isArray(\"not an array\") == false\n```" - ], - "signature": "let isArray: 'a => bool" - }, - { - "id": "Stdlib.Array.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(array)` returns the length of (i.e. number of items in) the array.\n\nSee [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.length == 2\n```" - ], - "signature": "let length: array<'a> => int" - }, - { - "id": "Stdlib.Array.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\n[]->Array.isEmpty->assertEqual(true)\n[1, 2, 3]->Array.isEmpty->assertEqual(false)\n\nlet emptyArray = []\nemptyArray->Array.isEmpty->assertEqual(true)\n\nlet nonEmptyArray = [\"hello\"]\nnonEmptyArray->Array.isEmpty->assertEqual(false)\n```" - ], - "signature": "let isEmpty: array<'a> => bool" - }, - { - "id": "Stdlib.Array.copyAllWithin", - "kind": "value", - "name": "copyAllWithin", - "docstrings": [ - "`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyAllWithin(~target=2) == [100, 101, 100, 101, 102]\narr == [100, 101, 100, 101, 102]\n```" - ], - "signature": "let copyAllWithin: (array<'a>, ~target: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Array.copyWithinToEnd", - "kind": "value", - "name": "copyWithinToEnd", - "docstrings": [ - "`copyWithinToEnd(array, ~target, ~start)` copies starting at element `start` in the given array to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyWithinToEnd(~target=0, ~start=2) == [102, 103, 104, 103, 104]\narr == [102, 103, 104, 103, 104]\n```" - ], - "signature": "let copyWithinToEnd: (array<'a>, ~target: int, ~start: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [ - "`copyWithin(array, ~target, ~start, ~end)` copies starting at element `start` in the given array up to but not including `end` to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105]\narr->Array.copyWithin(~target=1, ~start=2, ~end=5) == [100, 102, 103, 104, 104, 105]\narr == [100, 102, 103, 104, 104, 105]\n```" - ], - "signature": "let copyWithin: (\n array<'a>,\n ~target: int,\n ~start: int,\n ~end: int=?,\n) => array<'a>" - }, - { - "id": "Stdlib.Array.fillAll", - "kind": "value", - "name": "fillAll", - "docstrings": [ - "`fillAll(array, value)` fills the entire `array` with `value`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillAll(9)\nmyArray == [9, 9, 9, 9]\n```" - ], - "signature": "let fillAll: (array<'a>, 'a) => unit", - "deprecated": "" - }, - { - "id": "Stdlib.Array.fillToEnd", - "kind": "value", - "name": "fillToEnd", - "docstrings": [ - "`fillToEnd(array, value, ~start)` fills `array` with `value` from the `start` index.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillToEnd(9, ~start=1)\nmyArray == [1, 9, 9, 9]\n```" - ], - "signature": "let fillToEnd: (array<'a>, 'a, ~start: int) => unit", - "deprecated": "" - }, - { - "id": "Stdlib.Array.fill", - "kind": "value", - "name": "fill", - "docstrings": [ - "`fill(array, value, ~start, ~end)` fills `array` with `value` from `start` to `end`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\n\nmyArray->Array.fill(9)\nmyArray == [9, 9, 9, 9]\n\nmyArray->Array.fill(0, ~start=1)\nmyArray == [9, 0, 0, 0]\n\nmyArray->Array.fill(5, ~start=1, ~end=3)\nmyArray == [9, 5, 5, 0]\n```" - ], - "signature": "let fill: (array<'a>, 'a, ~start: int=?, ~end: int=?) => unit" - }, - { - "id": "Stdlib.Array.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "`pop(array)` removes the last item from `array` and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pop == Some(\"hello\")\n\nsomeArray == [\"hi\"] // Notice last item is gone.\n```" - ], - "signature": "let pop: array<'a> => option<'a>" - }, - { - "id": "Stdlib.Array.push", - "kind": "value", - "name": "push", - "docstrings": [ - "`push(array, item)` appends `item` to the end of `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.push(\"yay\")\n\nsomeArray == [\"hi\", \"hello\", \"yay\"]\n```" - ], - "signature": "let push: (array<'a>, 'a) => unit" - }, - { - "id": "Stdlib.Array.pushMany", - "kind": "value", - "name": "pushMany", - "docstrings": [ - "`pushMany(array, itemsArray)` appends many new items to the end of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pushMany([\"yay\", \"wehoo\"])\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let pushMany: (array<'a>, array<'a>) => unit" - }, - { - "id": "Stdlib.Array.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(array)` reverses the order of the items in `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.reverse\n\nsomeArray == [\"hello\", \"hi\"]\n```" - ], - "signature": "let reverse: array<'a> => unit" - }, - { - "id": "Stdlib.Array.shift", - "kind": "value", - "name": "shift", - "docstrings": [ - "`shift(array)` removes the first item in the array, and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.shift == Some(\"hi\")\n\nsomeArray == [\"hello\"] // Notice first item is gone.\n```" - ], - "signature": "let shift: array<'a> => option<'a>" - }, - { - "id": "Stdlib.Array.toSorted", - "kind": "value", - "name": "toSorted", - "docstrings": [ - "`toSorted(array, comparator)` returns a new, sorted array from `array`, using the `comparator` function.\n\nSee [`Array.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [3, 2, 1]\n\nsomeArray->Array.toSorted(Int.compare) == [1, 2, 3]\n\nsomeArray == [3, 2, 1] // Original unchanged\n```" - ], - "signature": "let toSorted: (array<'a>, ('a, 'a) => Ordering.t) => array<'a>" - }, - { - "id": "Stdlib.Array.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(array, comparator)` sorts `array` in-place using the `comparator` function.\n\nBeware this will *mutate* the array.\n\nSee [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet array = [3, 2, 1]\narray->Array.sort((a, b) => float(a - b))\narray == [1, 2, 3]\n```" - ], - "signature": "let sort: (array<'a>, ('a, 'a) => Ordering.t) => unit" - }, - { - "id": "Stdlib.Array.splice", - "kind": "value", - "name": "splice", - "docstrings": [ - "`splice(array, ~start, ~remove, ~insert)` removes `remove` items starting at `start` and inserts the values from `insert`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) on MDN.\n\n## Examples\n\n```rescript\nlet items = [\"a\", \"b\", \"c\"]\nitems->Array.splice(~start=1, ~remove=1, ~insert=[\"x\"])\nitems == [\"a\", \"x\", \"c\"]\n```" - ], - "signature": "let splice: (\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => unit" - }, - { - "id": "Stdlib.Array.toSpliced", - "kind": "value", - "name": "toSpliced", - "docstrings": [ - "`toSpliced(array, ~start, ~remove, ~insert)` returns a new array with the same edits that `splice` would perform, leaving the original unchanged.\n\nSee [`Array.toSpliced`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced) on MDN.\n\n## Examples\n\n```rescript\nlet original = [1, 2, 3]\nlet updated = original->Array.toSpliced(~start=1, ~remove=1, ~insert=[10])\nupdated == [1, 10, 3]\noriginal == [1, 2, 3]\n```" - ], - "signature": "let toSpliced: (\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => array<'a>" - }, - { - "id": "Stdlib.Array.removeInPlace", - "kind": "value", - "name": "removeInPlace", - "docstrings": [ - "`removeInPlace(array, index)` removes the item at the specified `index` from `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = []\narray->Array.removeInPlace(0)\narray == [] // Removing from an empty array does nothing\n\nlet array2 = [\"Hello\", \"Hi\", \"Good bye\"]\narray2->Array.removeInPlace(1)\narray2 == [\"Hello\", \"Good bye\"] // Removes the item at index 1\n```" - ], - "signature": "let removeInPlace: (array<'a>, int) => unit" - }, - { - "id": "Stdlib.Array.with", - "kind": "value", - "name": "with", - "docstrings": [ - "`with(array, index, value)` returns a copy of `array` where the element at `index` is replaced with `value`.\n\nSee [`Array.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/with) on MDN.\n\n## Examples\n\n```rescript\nlet original = [\"a\", \"b\", \"c\"]\nlet replaced = original->Array.with(1, \"x\")\nreplaced == [\"a\", \"x\", \"c\"]\noriginal == [\"a\", \"b\", \"c\"]\n```" - ], - "signature": "let with: (array<'a>, int, 'a) => array<'a>" - }, - { - "id": "Stdlib.Array.unshift", - "kind": "value", - "name": "unshift", - "docstrings": [ - "`unshift(array, item)` inserts a new item at the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshift(\"yay\")\nsomeArray == [\"yay\", \"hi\", \"hello\"]\n```" - ], - "signature": "let unshift: (array<'a>, 'a) => unit" - }, - { - "id": "Stdlib.Array.unshiftMany", - "kind": "value", - "name": "unshiftMany", - "docstrings": [ - "`unshiftMany(array, itemsArray)` inserts many new items to the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshiftMany([\"yay\", \"wehoo\"])\nsomeArray == [\"yay\", \"wehoo\", \"hi\", \"hello\"]\n```" - ], - "signature": "let unshiftMany: (array<'a>, array<'a>) => unit" - }, - { - "id": "Stdlib.Array.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(array1, array2)` concatenates the two arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\", \"wehoo\"]\n\nlet someArray = array1->Array.concat(array2)\n\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let concat: (array<'a>, array<'a>) => array<'a>" - }, - { - "id": "Stdlib.Array.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(array1, arrays)` concatenates array1 with several other arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\"]\nlet array3 = [\"wehoo\"]\n\nlet someArray = array1->Array.concatMany([array2, array3])\n\nConsole.log(someArray) // [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let concatMany: (array<'a>, array>) => array<'a>" - }, - { - "id": "Stdlib.Array.flat", - "kind": "value", - "name": "flat", - "docstrings": [ - "`flat(arrays)` concatenates an array of arrays into a single array.\n\nSee [`Array.flat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) on MDN.\n\n## Examples\n\n```rescript\n[[1], [2], [3, 4]]->Array.flat == [1, 2, 3, 4]\n```" - ], - "signature": "let flat: array> => array<'a>" - }, - { - "id": "Stdlib.Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "`includes(array, item)` checks whether `array` includes `item`, by doing a [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality).\n\nSee [`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.includes(1) == true\n[1, 2]->Array.includes(3) == false\n\n[{\"language\": \"ReScript\"}]->Array.includes({\"language\": \"ReScript\"}) == false // false, because of strict equality\n```" - ], - "signature": "let includes: (array<'a>, 'a) => bool" - }, - { - "id": "Stdlib.Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "`indexOf(array, item, ~from)` returns the index of the provided `item` in `array`, starting the search at `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.indexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOf(2) == 1\n[1, 2]->Array.indexOf(3) == -1\n[1, 2, 1, 2]->Array.indexOf(2, ~from=2) == 3\n\n[{\"language\": \"ReScript\"}]->Array.indexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```" - ], - "signature": "let indexOf: (array<'a>, 'a, ~from: int=?) => int" - }, - { - "id": "Stdlib.Array.indexOfOpt", - "kind": "value", - "name": "indexOfOpt", - "docstrings": [ - "`indexOfOpt(array, item)` returns an option of the index of the provided `item` in `array`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOfOpt(2) == Some(1)\n[1, 2]->Array.indexOfOpt(3) == None\n[{\"language\": \"ReScript\"}]->Array.indexOfOpt({\"language\": \"ReScript\"}) == None // None, because of strict equality\n```" - ], - "signature": "let indexOfOpt: (array<'a>, 'a) => option" - }, - { - "id": "Stdlib.Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (array<'a>, 'a, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Array.join", - "kind": "value", - "name": "join", - "docstrings": [ - "`join(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.join(\" -- \") == \"One -- Two -- Three\"\n```" - ], - "signature": "let join: (array, string) => string" - }, - { - "id": "Stdlib.Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "`joinWith(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinWithUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.joinWith(\" -- \") == \"One -- Two -- Three\"\n```" - ], - "signature": "let joinWith: (array, string) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Array.joinUnsafe", - "kind": "value", - "name": "joinUnsafe", - "docstrings": [ - "`joinUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```" - ], - "signature": "let joinUnsafe: (array<'a>, string) => string" - }, - { - "id": "Stdlib.Array.joinWithUnsafe", - "kind": "value", - "name": "joinWithUnsafe", - "docstrings": [ - "`joinWithUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinWithUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```" - ], - "signature": "let joinWithUnsafe: (array<'a>, string) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(array, item, ~from)` returns the last index of the provided `item` in `array`, searching backwards from `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.lastIndexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 1, 2]->Array.lastIndexOf(2) == 3\n[1, 2]->Array.lastIndexOf(3) == -1\n[1, 2, 1, 2]->Array.lastIndexOf(2, ~from=2) == 1\n\n[{\"language\": \"ReScript\"}]->Array.lastIndexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```" - ], - "signature": "let lastIndexOf: (array<'a>, 'a, ~from: int=?) => int" - }, - { - "id": "Stdlib.Array.lastIndexOfOpt", - "kind": "value", - "name": "lastIndexOfOpt", - "docstrings": [], - "signature": "let lastIndexOfOpt: (array<'a>, 'a) => option" - }, - { - "id": "Stdlib.Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (array<'a>, 'a, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(array, ~start, ~end)` creates a new array of items copied from `array` from `start` until (but not including) `end`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.slice(~start=1, ~end=3) == [2, 3]\n[1, 2, 3, 4]->Array.slice(~start=1) == [2, 3, 4]\n[1, 2, 3, 4]->Array.slice == [1, 2, 3, 4]\n```" - ], - "signature": "let slice: (array<'a>, ~start: int=?, ~end: int=?) => array<'a>" - }, - { - "id": "Stdlib.Array.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(array, start)` creates a new array from `array`, with all items from `array` starting from `start`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.sliceToEnd(~start=1) == [2, 3, 4]\n```" - ], - "signature": "let sliceToEnd: (array<'a>, ~start: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(array)` makes a copy of the array with the items in it, but does not make copies of the items themselves.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3]\nlet copyOfMyArray = myArray->Array.copy\n\ncopyOfMyArray == [1, 2, 3]\n(myArray === copyOfMyArray) == false\n```" - ], - "signature": "let copy: array<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(array)` stringifies `array` by running `toString` on all of the array elements and joining them with \",\".\n\nSee [`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.toString == \"1,2,3,4\"\n```" - ], - "signature": "let toString: array<'a> => string" - }, - { - "id": "Stdlib.Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(array)` converts each element to a locale-aware string and joins them with commas.\n\nSee [`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n[\"apple\", \"banana\"]->Array.toLocaleString == \"apple,banana\"\n```" - ], - "signature": "let toLocaleString: array<'a> => string" - }, - { - "id": "Stdlib.Array.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(array, predicate)` returns true if `predicate` returns true for all items in `array`.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.every(num => num <= 4) == true\n\narray->Array.every(num => num === 1) == false\n```" - ], - "signature": "let every: (array<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Array.everyWithIndex", - "kind": "value", - "name": "everyWithIndex", - "docstrings": [ - "`everyWithIndex(array, checker)` returns true if all items in `array` returns true when running the provided `checker` function.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.everyWithIndex((num, index) => index < 5 && num <= 4) == true\n\narray->Array.everyWithIndex((num, index) => index < 2 && num >= 2) == false\n```" - ], - "signature": "let everyWithIndex: (array<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filter(num => num > 2) == [3, 4]\n```" - ], - "signature": "let filter: (array<'a>, 'a => bool) => array<'a>" - }, - { - "id": "Stdlib.Array.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filterWithIndex((num, index) => index === 0 || num === 2) == [1, 2]\n```" - ], - "signature": "let filterWithIndex: (array<'a>, ('a, int) => bool) => array<'a>" - }, - { - "id": "Stdlib.Array.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.find(item => item == ReScript) == Some(ReScript)\n```" - ], - "signature": "let find: (array<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findWithIndex", - "kind": "value", - "name": "findWithIndex", - "docstrings": [ - "`findWithIndex(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [TypeScript, JavaScript, ReScript]\n\narray->Array.findWithIndex((item, index) => index > 1 && item == ReScript) == Some(ReScript)\n```" - ], - "signature": "let findWithIndex: (array<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findLast", - "kind": "value", - "name": "findLast", - "docstrings": [ - "`findLast(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLast(item => item > 0) == Some(3)\n```" - ], - "signature": "let findLast: (array<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findLastWithIndex", - "kind": "value", - "name": "findLastWithIndex", - "docstrings": [ - "`findLastWithIndex(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLastWithIndex((item, index) => index < 2 && item > 0) == Some(2)\n```" - ], - "signature": "let findLastWithIndex: (array<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [ - "`findIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\narray->Array.findIndex(item => item == ReScript) == 0\n\narray->Array.findIndex(item => item == TypeScript) == -1\n```" - ], - "signature": "let findIndex: (array<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.Array.findIndexWithIndex", - "kind": "value", - "name": "findIndexWithIndex", - "docstrings": [ - "`findIndexWithIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\nlet isReScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == ReScript)\nlet isTypeScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == TypeScript)\n\nisReScriptFirst == 0\nisTypeScriptFirst == -1\n```" - ], - "signature": "let findIndexWithIndex: (array<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.Array.findLastIndex", - "kind": "value", - "name": "findLastIndex", - "docstrings": [ - "`findLastIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, ReScript]\n\narray->Array.findLastIndex(item => item == ReScript) == 2\n\narray->Array.findLastIndex(item => item == TypeScript) == -1\n```" - ], - "signature": "let findLastIndex: (array<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.Array.findLastIndexWithIndex", - "kind": "value", - "name": "findLastIndexWithIndex", - "docstrings": [ - "`findLastIndexWithIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, JavaScript, ReScript]\n\nlet isReScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == ReScript)\nlet isTypeScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == TypeScript)\n\nisReScriptLast == 3\nisTypeScriptLast == -1\n```" - ], - "signature": "let findLastIndexWithIndex: (array<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEach(item => {\n Console.log(item)\n})\n```" - ], - "signature": "let forEach: (array<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Array.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEachWithIndex((item, index) => {\n Console.log(\"At item \" ++ Int.toString(index) ++ \": \" ++ item)\n})\n```" - ], - "signature": "let forEachWithIndex: (array<'a>, ('a, int) => unit) => unit" - }, - { - "id": "Stdlib.Array.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```" - ], - "signature": "let map: (array<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Stdlib.Array.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```" - ], - "signature": "let mapWithIndex: (array<'a>, ('a, int) => 'b) => array<'b>" - }, - { - "id": "Stdlib.Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(xs, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has two parameters: the item from the list and an \"accumulator\"; which starts with a value of `init`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\nArray.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n\n[1, 2, 3]->Array.reduce(list{}, List.add) == list{3, 2, 1}\n\nArray.reduce([], list{}, List.add) == list{}\n```" - ], - "signature": "let reduce: (array<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(x, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has three parameters: the item from the array and an \"accumulator\", which starts with a value of `init` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceWithIndex([1, 2, 3], list{}, (acc, v, i) => list{v + i, ...acc}) == list{5, 3, 1}\n\nArray.reduceWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```" - ], - "signature": "let reduceWithIndex: (array<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [ - "`reduceRight(xs, init, fn)`\n\nWorks like `Array.reduce`; except that function `fn` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nArray.reduceRight([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n\nArray.reduceRight([1, 2, 3], list{}, List.add) == list{1, 2, 3}\n\nArray.reduceRight([], list{}, List.add) == list{}\n```" - ], - "signature": "let reduceRight: (array<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.reduceRightWithIndex", - "kind": "value", - "name": "reduceRightWithIndex", - "docstrings": [ - "`reduceRightWithIndex(xs, init, fn)`\n\nLike `reduceRight`, but with an additional index argument on the callback function.\n\n## Examples\n\n```rescript\nArray.reduceRightWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceRightWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```" - ], - "signature": "let reduceRightWithIndex: (array<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(array, predicate)` returns true if `predicate` returns true for any element in `array`.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.some(greeting => greeting === \"Hello\") == true\n```" - ], - "signature": "let some: (array<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Array.someWithIndex", - "kind": "value", - "name": "someWithIndex", - "docstrings": [ - "`someWithIndex(array, checker)` returns true if running the provided `checker` function on any element in `array` returns true.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.someWithIndex((greeting, index) => greeting === \"Hello\" && index === 0) == true\n```" - ], - "signature": "let someWithIndex: (array<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.Array.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(array, index)` returns the element at `index` of `array`.\n\nReturns `None` if the index does not exist in the array. Equivalent to doing `array[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.get(0) == Some(\"Hello\")\n\narray->Array.get(3) == None\n```" - ], - "signature": "let get: (array<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.Array.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.set(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```" - ], - "signature": "let set: (array<'a>, int, 'a) => unit" - }, - { - "id": "Stdlib.Array.getSymbol", - "kind": "value", - "name": "getSymbol", - "docstrings": [ - "`getSymbol(array, key)` retrieves the value stored under the symbol `key`, if present.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN for more details about symbol keys.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbol(items, key) == Some(\"hello\")\n```" - ], - "signature": "let getSymbol: (array<'a>, Symbol.t) => option<'b>" - }, - { - "id": "Stdlib.Array.getSymbolUnsafe", - "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [ - "`getSymbolUnsafe(array, key)` retrieves the value stored under the symbol `key` without any safety checks.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbolUnsafe(items, key) == \"hello\"\n```" - ], - "signature": "let getSymbolUnsafe: (array<'a>, Symbol.t) => 'b" - }, - { - "id": "Stdlib.Array.setSymbol", - "kind": "value", - "name": "setSymbol", - "docstrings": [ - "`setSymbol(array, key, value)` stores `value` under the symbol `key` on `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"count\")\nlet items = []\nitems->Array.setSymbol(key, 5)\nArray.getSymbol(items, key) == Some(5)\n```" - ], - "signature": "let setSymbol: (array<'a>, Symbol.t, 'b) => unit" - }, - { - "id": "Stdlib.Array.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.getUnsafe` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.getUnsafe(index)\n Console.log(value)\n}\n```" - ], - "signature": "let getUnsafe: (array<'a>, int) => 'a" - }, - { - "id": "Stdlib.Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [ - "`unsafe_get(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.unsafe_get` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.unsafe_get(index)\n Console.log(value)\n}\n```" - ], - "signature": "let unsafe_get: (array<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Array.setUnsafe", - "kind": "value", - "name": "setUnsafe", - "docstrings": [ - "`setUnsafe(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array, and is *unsafe*.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.setUnsafe(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```" - ], - "signature": "let setUnsafe: (array<'a>, int, 'a) => unit" - }, - { - "id": "Stdlib.Array.findIndexOpt", - "kind": "value", - "name": "findIndexOpt", - "docstrings": [ - "`findIndexOpt(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.findIndexOpt(item => item == ReScript) == Some(0)\n```" - ], - "signature": "let findIndexOpt: (array<'a>, 'a => bool) => option" - }, - { - "id": "Stdlib.Array.findLastIndexOpt", - "kind": "value", - "name": "findLastIndexOpt", - "docstrings": [ - "`findIndexOpt(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"hello\", \"world\", \"!\"]\n\narray->Array.findLastIndexOpt(item => item->String.includes(\"o\")) == Some(1)\n```" - ], - "signature": "let findLastIndexOpt: (array<'a>, 'a => bool) => option" - }, - { - "id": "Stdlib.Array.toReversed", - "kind": "value", - "name": "toReversed", - "docstrings": [ - "`toReversed(array)` creates a new array with all items from `array` in reversed order.\n\nSee [`Array.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nlet reversed = someArray->Array.toReversed\n\nreversed == [\"hello\", \"hi\"]\nsomeArray == [\"hi\", \"hello\"] // Original unchanged\n```" - ], - "signature": "let toReversed: array<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.filterMap", - "kind": "value", - "name": "filterMap", - "docstrings": [ - "`filterMap(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMap(item =>\n switch item {\n | \"Hello\" => Some(item->String.length)\n | _ => None\n }\n) == [5]\n\n[1, 2, 3, 4, 5, 6]->Array.filterMap(n => mod(n, 2) == 0 ? Some(n * n) : None) == [4, 16, 36]\n\nArray.filterMap([1, 2, 3, 4, 5, 6], _ => None) == []\n\nArray.filterMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == []\n```" - ], - "signature": "let filterMap: (array<'a>, 'a => option<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.filterMapWithIndex", - "kind": "value", - "name": "filterMapWithIndex", - "docstrings": [ - "`filterMapWithIndex(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMapWithIndex((item, index) =>\n switch item {\n | \"Hello\" => Some(index)\n | _ => None\n }\n) == [0]\n```" - ], - "signature": "let filterMapWithIndex: (array<'a>, ('a, int) => option<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.keepSome", - "kind": "value", - "name": "keepSome", - "docstrings": [ - "`keepSome(arr)`\n\nReturns a new array containing `value` for all elements that are `Some(value)`\nand ignoring every value that is `None`\n\n## Examples\n\n```rescript\nArray.keepSome([Some(1), None, Some(3)]) == [1, 3]\n\nArray.keepSome([Some(1), Some(2), Some(3)]) == [1, 2, 3]\n\nArray.keepSome([None, None, None]) == []\n\nArray.keepSome([]) == []\n```" - ], - "signature": "let keepSome: array> => array<'a>" - }, - { - "id": "Stdlib.Array.toShuffled", - "kind": "value", - "name": "toShuffled", - "docstrings": [ - "`toShuffled(array)` returns a new array with all items in `array` in a random order.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet shuffledArray = array->Array.toShuffled\nConsole.log(shuffledArray)\n\nArray.toShuffled([1, 2, 3])->Array.length == 3\n```" - ], - "signature": "let toShuffled: array<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "`shuffle(array)` randomizes the position of all items in `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.shuffle\nConsole.log(array)\n\nlet array2 = [1, 2, 3]\narray2->Array.shuffle\n\narray2->Array.length == 3\n```" - ], - "signature": "let shuffle: array<'a> => unit" - }, - { - "id": "Stdlib.Array.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMap(item =>\n switch item {\n | ReScript => [1, 2, 3]\n | TypeScript => [4, 5, 6]\n | JavaScript => [7, 8, 9]\n }\n) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\n```" - ], - "signature": "let flatMap: (array<'a>, 'a => array<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.flatMapWithIndex", - "kind": "value", - "name": "flatMapWithIndex", - "docstrings": [ - "`flatMapWithIndex(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMapWithIndex((item, index) =>\n switch item {\n | ReScript => [index]\n | TypeScript => [index, index + 1]\n | JavaScript => [index, index + 1, index + 2]\n }\n) == [0, 1, 2, 2, 3, 4]\n```" - ], - "signature": "let flatMapWithIndex: (array<'a>, ('a, int) => array<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.findMap", - "kind": "value", - "name": "findMap", - "docstrings": [ - "`findMap(arr, fn)`\n\nCalls `fn` for each element and returns the first value from `fn` that is `Some(_)`.\nOtherwise returns `None`\n\n## Examples\n\n```rescript\nArray.findMap([1, 2, 3], n => mod(n, 2) == 0 ? Some(n - 2) : None) == Some(0)\n\nArray.findMap([1, 2, 3, 4, 5, 6], n => mod(n, 2) == 0 ? Some(n - 8) : None) == Some(-6)\n\nArray.findMap([1, 2, 3, 4, 5, 6], _ => None) == None\n\nArray.findMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == None\n```" - ], - "signature": "let findMap: (array<'a>, 'a => option<'b>) => option<'b>" - }, - { - "id": "Stdlib.Array.at", - "kind": "value", - "name": "at", - "docstrings": [ - "`at(array, index)`\n\nGet an element by its index. Negative indices count backwards from the last item.\n\n## Examples\n\n```rescript\n[\"a\", \"b\", \"c\"]->Array.at(0) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(2) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(3) == None\n[\"a\", \"b\", \"c\"]->Array.at(-1) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(-3) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(-4) == None\n```" - ], - "signature": "let at: (array<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.Array.last", - "kind": "value", - "name": "last", - "docstrings": [ - "`last(array)` returns the last element of `array`.\n\nReturns `None` if the array is empty.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.last == Some(\"Good bye\")\n\n[]->Array.last == None\n```" - ], - "signature": "let last: array<'a> => option<'a>" - }, - { - "id": "Stdlib.Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(array)` ignores the provided array and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: array<'a> => unit" - }, - { - "id": "Stdlib.Array.entries", - "kind": "value", - "name": "entries", - "docstrings": [ - "`entries(array)` returns a new array iterator object that contains the key/value pairs for each index in the array.\n\nSee [Array.prototype.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: Iterator.t<(int, int)> = array->Array.entries\niterator->Iterator.next == {done: false, value: Some((0, 5))}\niterator->Iterator.next == {done: false, value: Some((1, 6))}\n```" - ], - "signature": "let entries: array<'a> => Iterator.t<(int, 'a)>" - }, - { - "id": "Stdlib.Array.values", - "kind": "value", - "name": "values", - "docstrings": [ - "`values(array)` returns a new array iterator object that contains the values for each index in the array.\n\nSee [Array.prototype.values](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: Iterator.t = array->Array.values\niterator->Iterator.next == {done: false, value: Some(5)}\niterator->Iterator.next == {done: false, value: Some(6)}\n```" - ], - "signature": "let values: array<'a> => Iterator.t<'a>" - } - ] - }, - "stdlib/intervalid": { - "id": "Stdlib.IntervalId", - "name": "IntervalId", - "docstrings": [], - "items": [] - }, - "stdlib/timeoutid": { - "id": "Stdlib.TimeoutId", - "name": "TimeoutId", - "docstrings": [], - "items": [] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v12.1.0/toc_tree.json b/apps/docs/data/api/v12.1.0/toc_tree.json deleted file mode 100644 index 7304b0e63..000000000 --- a/apps/docs/data/api/v12.1.0/toc_tree.json +++ /dev/null @@ -1 +0,0 @@ -{"belt":{"name":"Belt","path":["belt"],"children":[{"name":"Float","path":["belt","float"],"children":[]},{"name":"Int","path":["belt","int"],"children":[]},{"name":"Result","path":["belt","result"],"children":[]},{"name":"Option","path":["belt","option"],"children":[]},{"name":"HashMap","path":["belt","hashmap"],"children":[{"name":"String","path":["belt","hashmap","string"],"children":[]},{"name":"Int","path":["belt","hashmap","int"],"children":[]}]},{"name":"HashSet","path":["belt","hashset"],"children":[{"name":"String","path":["belt","hashset","string"],"children":[]},{"name":"Int","path":["belt","hashset","int"],"children":[]}]},{"name":"MutableMap","path":["belt","mutablemap"],"children":[{"name":"String","path":["belt","mutablemap","string"],"children":[]},{"name":"Int","path":["belt","mutablemap","int"],"children":[]}]},{"name":"MutableSet","path":["belt","mutableset"],"children":[{"name":"String","path":["belt","mutableset","string"],"children":[]},{"name":"Int","path":["belt","mutableset","int"],"children":[]}]},{"name":"Map","path":["belt","map"],"children":[{"name":"Dict","path":["belt","map","dict"],"children":[]},{"name":"String","path":["belt","map","string"],"children":[]},{"name":"Int","path":["belt","map","int"],"children":[]}]},{"name":"Set","path":["belt","set"],"children":[{"name":"Dict","path":["belt","set","dict"],"children":[]},{"name":"String","path":["belt","set","string"],"children":[]},{"name":"Int","path":["belt","set","int"],"children":[]}]},{"name":"Range","path":["belt","range"],"children":[]},{"name":"List","path":["belt","list"],"children":[]},{"name":"MutableStack","path":["belt","mutablestack"],"children":[]},{"name":"MutableQueue","path":["belt","mutablequeue"],"children":[]},{"name":"SortArray","path":["belt","sortarray"],"children":[{"name":"String","path":["belt","sortarray","string"],"children":[]},{"name":"Int","path":["belt","sortarray","int"],"children":[]}]},{"name":"Array","path":["belt","array"],"children":[]},{"name":"Id","path":["belt","id"],"children":[{"name":"MakeHashable","path":["belt","id","makehashable"],"children":[]},{"name":"MakeHashableU","path":["belt","id","makehashableu"],"children":[]},{"name":"MakeComparable","path":["belt","id","makecomparable"],"children":[]},{"name":"MakeComparableU","path":["belt","id","makecomparableu"],"children":[]}]}]},"dom":{"name":"Dom","path":["dom"],"children":[{"name":"Storage2","path":["dom","storage2"],"children":[]},{"name":"Storage","path":["dom","storage"],"children":[]}]},"js":{"name":"Js","path":["js"],"children":[{"name":"WeakMap","path":["js","weakmap"],"children":[]},{"name":"Map","path":["js","map"],"children":[]},{"name":"WeakSet","path":["js","weakset"],"children":[]},{"name":"Set","path":["js","set"],"children":[]},{"name":"Console","path":["js","console"],"children":[]},{"name":"Result","path":["js","result"],"children":[]},{"name":"Option","path":["js","option"],"children":[]},{"name":"Blob","path":["js","blob"],"children":[]},{"name":"File","path":["js","file"],"children":[]},{"name":"BigInt","path":["js","bigint"],"children":[]},{"name":"Int","path":["js","int"],"children":[]},{"name":"Float","path":["js","float"],"children":[]},{"name":"Types","path":["js","types"],"children":[]},{"name":"TypedArray2","path":["js","typedarray2"],"children":[{"name":"DataView","path":["js","typedarray2","dataview"],"children":[]},{"name":"Float64Array","path":["js","typedarray2","float64array"],"children":[]},{"name":"Float32Array","path":["js","typedarray2","float32array"],"children":[]},{"name":"Uint32Array","path":["js","typedarray2","uint32array"],"children":[]},{"name":"Int32Array","path":["js","typedarray2","int32array"],"children":[]},{"name":"Uint16Array","path":["js","typedarray2","uint16array"],"children":[]},{"name":"Int16Array","path":["js","typedarray2","int16array"],"children":[]},{"name":"Uint8ClampedArray","path":["js","typedarray2","uint8clampedarray"],"children":[]},{"name":"Uint8Array","path":["js","typedarray2","uint8array"],"children":[]},{"name":"Int8Array","path":["js","typedarray2","int8array"],"children":[]},{"name":"ArrayBuffer","path":["js","typedarray2","arraybuffer"],"children":[]}]},{"name":"Typed_array","path":["js","typed_array"],"children":[{"name":"DataView","path":["js","typed_array","dataview"],"children":[]},{"name":"Float64_array","path":["js","typed_array","float64_array"],"children":[]},{"name":"Float64Array","path":["js","typed_array","float64array"],"children":[]},{"name":"Float32_array","path":["js","typed_array","float32_array"],"children":[]},{"name":"Float32Array","path":["js","typed_array","float32array"],"children":[]},{"name":"Uint32Array","path":["js","typed_array","uint32array"],"children":[]},{"name":"Int32_array","path":["js","typed_array","int32_array"],"children":[]},{"name":"Int32Array","path":["js","typed_array","int32array"],"children":[]},{"name":"Uint16Array","path":["js","typed_array","uint16array"],"children":[]},{"name":"Int16Array","path":["js","typed_array","int16array"],"children":[]},{"name":"Uint8ClampedArray","path":["js","typed_array","uint8clampedarray"],"children":[]},{"name":"Uint8Array","path":["js","typed_array","uint8array"],"children":[]},{"name":"Int8Array","path":["js","typed_array","int8array"],"children":[]},{"name":"S","path":["js","typed_array","s"],"children":[]},{"name":"ArrayBuffer","path":["js","typed_array","arraybuffer"],"children":[]},{"name":"Type","path":["js","typed_array","type"],"children":[]}]},{"name":"Obj","path":["js","obj"],"children":[]},{"name":"Math","path":["js","math"],"children":[]},{"name":"Json","path":["js","json"],"children":[{"name":"Kind","path":["js","json","kind"],"children":[]}]},{"name":"Global","path":["js","global"],"children":[]},{"name":"Dict","path":["js","dict"],"children":[]},{"name":"Date","path":["js","date"],"children":[]},{"name":"Promise2","path":["js","promise2"],"children":[]},{"name":"Promise","path":["js","promise"],"children":[]},{"name":"Re","path":["js","re"],"children":[]},{"name":"String2","path":["js","string2"],"children":[]},{"name":"String","path":["js","string"],"children":[]},{"name":"Array2","path":["js","array2"],"children":[]},{"name":"Array","path":["js","array"],"children":[]},{"name":"Exn","path":["js","exn"],"children":[]},{"name":"Null_undefined","path":["js","null_undefined"],"children":[]},{"name":"Nullable","path":["js","nullable"],"children":[]},{"name":"Undefined","path":["js","undefined"],"children":[]},{"name":"Null","path":["js","null"],"children":[]}]},"stdlib":{"name":"Stdlib","path":["stdlib"],"children":[{"name":"BigUint64Array","path":["stdlib","biguint64array"],"children":[{"name":"Constants","path":["stdlib","biguint64array","constants"],"children":[]}]},{"name":"BigInt64Array","path":["stdlib","bigint64array"],"children":[{"name":"Constants","path":["stdlib","bigint64array","constants"],"children":[]}]},{"name":"Uint8ClampedArray","path":["stdlib","uint8clampedarray"],"children":[{"name":"Constants","path":["stdlib","uint8clampedarray","constants"],"children":[]}]},{"name":"Uint32Array","path":["stdlib","uint32array"],"children":[{"name":"Constants","path":["stdlib","uint32array","constants"],"children":[]}]},{"name":"Uint16Array","path":["stdlib","uint16array"],"children":[{"name":"Constants","path":["stdlib","uint16array","constants"],"children":[]}]},{"name":"Uint8Array","path":["stdlib","uint8array"],"children":[{"name":"Constants","path":["stdlib","uint8array","constants"],"children":[]}]},{"name":"Int32Array","path":["stdlib","int32array"],"children":[{"name":"Constants","path":["stdlib","int32array","constants"],"children":[]}]},{"name":"Int16Array","path":["stdlib","int16array"],"children":[{"name":"Constants","path":["stdlib","int16array","constants"],"children":[]}]},{"name":"Int8Array","path":["stdlib","int8array"],"children":[{"name":"Constants","path":["stdlib","int8array","constants"],"children":[]}]},{"name":"Float64Array","path":["stdlib","float64array"],"children":[{"name":"Constants","path":["stdlib","float64array","constants"],"children":[]}]},{"name":"Float32Array","path":["stdlib","float32array"],"children":[{"name":"Constants","path":["stdlib","float32array","constants"],"children":[]}]},{"name":"TypedArray","path":["stdlib","typedarray"],"children":[]},{"name":"ArrayBuffer","path":["stdlib","arraybuffer"],"children":[]},{"name":"WeakSet","path":["stdlib","weakset"],"children":[]},{"name":"Set","path":["stdlib","set"],"children":[]},{"name":"WeakMap","path":["stdlib","weakmap"],"children":[]},{"name":"Map","path":["stdlib","map"],"children":[]},{"name":"AsyncIterator","path":["stdlib","asynciterator"],"children":[]},{"name":"Iterator","path":["stdlib","iterator"],"children":[]},{"name":"Type","path":["stdlib","type"],"children":[{"name":"Classify","path":["stdlib","type","classify"],"children":[]}]},{"name":"Symbol","path":["stdlib","symbol"],"children":[]},{"name":"String","path":["stdlib","string"],"children":[]},{"name":"Result","path":["stdlib","result"],"children":[]},{"name":"RegExp","path":["stdlib","regexp"],"children":[{"name":"Result","path":["stdlib","regexp","result"],"children":[]}]},{"name":"Promise","path":["stdlib","promise"],"children":[]},{"name":"Pair","path":["stdlib","pair"],"children":[]},{"name":"Ordering","path":["stdlib","ordering"],"children":[]},{"name":"Option","path":["stdlib","option"],"children":[]},{"name":"Object","path":["stdlib","object"],"children":[]},{"name":"Nullable","path":["stdlib","nullable"],"children":[]},{"name":"Null","path":["stdlib","null"],"children":[]},{"name":"Math","path":["stdlib","math"],"children":[{"name":"Int","path":["stdlib","math","int"],"children":[]},{"name":"Constants","path":["stdlib","math","constants"],"children":[]}]},{"name":"List","path":["stdlib","list"],"children":[]},{"name":"Lazy","path":["stdlib","lazy"],"children":[]},{"name":"JSON","path":["stdlib","json"],"children":[{"name":"Decode","path":["stdlib","json","decode"],"children":[]},{"name":"Encode","path":["stdlib","json","encode"],"children":[]},{"name":"Classify","path":["stdlib","json","classify"],"children":[]}]},{"name":"JsExn","path":["stdlib","jsexn"],"children":[]},{"name":"JsError","path":["stdlib","jserror"],"children":[{"name":"URIError","path":["stdlib","jserror","urierror"],"children":[]},{"name":"TypeError","path":["stdlib","jserror","typeerror"],"children":[]},{"name":"SyntaxError","path":["stdlib","jserror","syntaxerror"],"children":[]},{"name":"ReferenceError","path":["stdlib","jserror","referenceerror"],"children":[]},{"name":"RangeError","path":["stdlib","jserror","rangeerror"],"children":[]},{"name":"EvalError","path":["stdlib","jserror","evalerror"],"children":[]}]},{"name":"Intl","path":["stdlib","intl"],"children":[{"name":"Segments","path":["stdlib","intl","segments"],"children":[]},{"name":"Segmenter","path":["stdlib","intl","segmenter"],"children":[]},{"name":"RelativeTimeFormat","path":["stdlib","intl","relativetimeformat"],"children":[]},{"name":"PluralRules","path":["stdlib","intl","pluralrules"],"children":[]},{"name":"NumberFormat","path":["stdlib","intl","numberformat"],"children":[{"name":"Grouping","path":["stdlib","intl","numberformat","grouping"],"children":[]}]},{"name":"Locale","path":["stdlib","intl","locale"],"children":[]},{"name":"ListFormat","path":["stdlib","intl","listformat"],"children":[]},{"name":"DateTimeFormat","path":["stdlib","intl","datetimeformat"],"children":[]},{"name":"Collator","path":["stdlib","intl","collator"],"children":[]},{"name":"Common","path":["stdlib","intl","common"],"children":[]}]},{"name":"Int","path":["stdlib","int"],"children":[{"name":"Ref","path":["stdlib","int","ref"],"children":[]},{"name":"Bitwise","path":["stdlib","int","bitwise"],"children":[]},{"name":"Constants","path":["stdlib","int","constants"],"children":[]}]},{"name":"Float","path":["stdlib","float"],"children":[{"name":"Constants","path":["stdlib","float","constants"],"children":[]}]},{"name":"Error","path":["stdlib","error"],"children":[{"name":"URIError","path":["stdlib","error","urierror"],"children":[]},{"name":"TypeError","path":["stdlib","error","typeerror"],"children":[]},{"name":"SyntaxError","path":["stdlib","error","syntaxerror"],"children":[]},{"name":"ReferenceError","path":["stdlib","error","referenceerror"],"children":[]},{"name":"RangeError","path":["stdlib","error","rangeerror"],"children":[]},{"name":"EvalError","path":["stdlib","error","evalerror"],"children":[]}]},{"name":"Exn","path":["stdlib","exn"],"children":[]},{"name":"Dict","path":["stdlib","dict"],"children":[]},{"name":"Date","path":["stdlib","date"],"children":[{"name":"UTC","path":["stdlib","date","utc"],"children":[]}]},{"name":"DataView","path":["stdlib","dataview"],"children":[]},{"name":"Console","path":["stdlib","console"],"children":[]},{"name":"Bool","path":["stdlib","bool"],"children":[]},{"name":"BigInt","path":["stdlib","bigint"],"children":[]},{"name":"Array","path":["stdlib","array"],"children":[]},{"name":"IntervalId","path":["stdlib","intervalid"],"children":[]},{"name":"TimeoutId","path":["stdlib","timeoutid"],"children":[]}]}} \ No newline at end of file diff --git a/apps/docs/data/api/v12.2.0/belt.json b/apps/docs/data/api/v12.2.0/belt.json deleted file mode 100644 index 74e7ee076..000000000 --- a/apps/docs/data/api/v12.2.0/belt.json +++ /dev/null @@ -1,9728 +0,0 @@ -{ - "belt": { - "id": "Belt", - "name": "Belt", - "docstrings": [ - "The ReScript standard library.\n\nBelt is currently mostly covering collection types. It has no string or date functions yet, although Belt.String is in the works. In the meantime, use [Js.String](js/string) for string functions and [Js.Date](js/date) for date functions.\n\n## Motivation\n\nBelt provides:\n\n- The **highest quality** immutable data structures in JavaScript.\n- Safety by default: A Belt function will never throw exceptions, unless it is\n indicated explicitly in the function name (suffix \"Exn\").\n- Better performance and smaller code size running on the JS platform.\n- Ready for [Tree Shaking](https://webpack.js.org/guides/tree-shaking/).\n\n## Usage\n\nTo use modules from Belt, either refer to them by their fully qualified name (`Belt.List`, `Belt.Array` etc.) or open the `Belt` module by putting\n\n## Examples\n\n```rescript\nopen Belt\n```\n\nat the top of your source files. After opening Belt this way, `Array` will refer to `Belt.Array`, `List` will refer to `Belt.List` etc. in the subsequent code.\n\nIf you want to open Belt globally for all files in your project instead, you can put\n\n```json\n{\n \"compiler-flags\": [\"-open Belt\"]\n}\n```\n\ninto your `rescript.json`.\n\n**Note**: this is the **only** `open` we encourage.\n\nExample usage:\n\n## Examples\n\n```rescript\nlet someNumbers = [1, 1, 4, 2, 3, 6, 3, 4, 2]\n\nlet greaterThan2UniqueAndSorted =\n someNumbers\n ->Belt.Array.keep(x => x > 2)\n // convert to and from set to make values unique\n ->Belt.Set.Int.fromArray\n ->Belt.Set.Int.toArray // output is already sorted\n\nJs.log2(\"result\", greaterThan2UniqueAndSorted)\n```\n\n## Specialized Collections\n\nFor collections types like set or map, Belt provides both a generic module as well as specialized, more efficient implementations for string and int keys.\n\nFor example, Belt has the following set modules:\n\n- [Belt.Set](belt/set)\n- [Belt.Set.Int](belt/set/int)\n- [Belt.Set.String](belt/set/string)\n\n## Implementation Details\n\n### Array access runtime safety\n\nOne common confusion comes from the way Belt handles array access. It differs from than the default standard library's.\n\n## Examples\n\n```rescript\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0] // a == \"a\"\nlet capitalA = Js.String.toUpperCase(a)\nlet k = letters[10] // Throws an exception! The 10th index doesn't exist.\n```\n\nBecause Belt avoids exceptions and returns `options` instead, this code behaves differently:\n\n## Examples\n\n```rescript\nopen Belt\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0] // a == Some(\"a\")\nlet captialA = Js.String.toUpperCase(a) // Type error! This code will not compile.\nlet k = letters[10] // k == None\n```\n\nAlthough we've fixed the problem where `k` throws an exception, we now have a type error when trying to capitalize `a`. There are a few things going on here:\n\n- Reason transforms array index access to the function `Array.get`. So `letters[0]` is the same as `Array.get(letters, 0)`.\n- The compiler uses whichever `Array` module is in scope. If you `open Belt`, then it uses `Belt.Array`.\n- `Belt.Array.get` returns values wrapped in options, so `letters[0] == Some(\"a\")`.\n\nFortunately, this is easy to fix:\n\n## Examples\n\n```rescript\nopen Belt\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0]\n\n// Use a switch statement:\nlet capitalA = switch a {\n| Some(a) => Some(Js.String.toUpperCase(a))\n| None => None\n}\n\nlet k = letters[10] // k == None\n```\n\nWith that little bit of tweaking, our code now compiles successfully and is 100% free of runtime errors\\!\n\n### A Special Encoding for Collection Safety\n\nWhen we create a collection library for a custom data type we need a way to provide a comparator function. Take Set for example, suppose its element type is a pair of ints, it needs a custom compare function that takes two tuples and returns their order. The Set could not just be typed as Set.t (int \\* int) , its customized compare function needs to manifest itself in the signature, otherwise, if the user creates another customized compare function, the two collection could mix which would result in runtime error.\n\nWe use a phantom type to solve the problem:\n\n## Examples\n\n```rescript\nmodule Comparable1 = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet1 = Belt.Set.make(~id=module(Comparable1))\n\nmodule Comparable2 = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet2 = Belt.Set.make(~id=module(Comparable2))\n```\n\nHere, the compiler would infer `mySet1` and `mySet2` having different type, so e.g. a `merge` operation that tries to merge these two sets will correctly fail.\n\n## Examples\n\n```rescript\nlet mySet1: t<(int, int), Comparable1.identity> = %todo\nlet mySet2: t<(int, int), Comparable2.identity> = %todo\n```\n\n`Comparable1.identity` and `Comparable2.identity` are not the same using our encoding scheme." - ], - "items": [] - }, - "belt/hashmap/string": { - "id": "Belt.HashMap.String", - "name": "String", - "docstrings": [ - "Specalized when key type is `string`, more efficient than the generic type" - ], - "items": [ - { - "id": "Belt.HashMap.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.HashMap.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'b>" - }, - { - "id": "Belt.HashMap.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t<'b>" - }, - { - "id": "Belt.HashMap.String.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'b> => unit" - }, - { - "id": "Belt.HashMap.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.HashMap.String.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`setDone(tbl, k, v)` if `k` does not exist, add the binding `k,v`, otherwise,\nupdate the old value with the new `v`" - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.HashMap.String.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.HashMap.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.HashMap.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'b>, key) => bool" - }, - { - "id": "Belt.HashMap.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.HashMap.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'b>, (key, 'b) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashMap.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'b>, (key, 'b) => unit) => unit" - }, - { - "id": "Belt.HashMap.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashMap.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c" - }, - { - "id": "Belt.HashMap.String.keepMapInPlaceU", - "kind": "value", - "name": "keepMapInPlaceU", - "docstrings": [], - "signature": "let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit", - "deprecated": "Use `keepMapInPlace` instead" - }, - { - "id": "Belt.HashMap.String.keepMapInPlace", - "kind": "value", - "name": "keepMapInPlace", - "docstrings": [], - "signature": "let keepMapInPlace: (t<'a>, (key, 'a) => option<'a>) => unit" - }, - { - "id": "Belt.HashMap.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.HashMap.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.HashMap.String.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.HashMap.String.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.HashMap.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.HashMap.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'a>, array<(key, 'a)>) => unit" - }, - { - "id": "Belt.HashMap.String.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t<'a> => array" - }, - { - "id": "Belt.HashMap.String.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t<'a> => unit" - } - ] - }, - "belt/hashmap/int": { - "id": "Belt.HashMap.Int", - "name": "Int", - "docstrings": [ - "Specalized when key type is `int`, more efficient than the generic type" - ], - "items": [ - { - "id": "Belt.HashMap.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.HashMap.Int.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'b>" - }, - { - "id": "Belt.HashMap.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t<'b>" - }, - { - "id": "Belt.HashMap.Int.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'b> => unit" - }, - { - "id": "Belt.HashMap.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.HashMap.Int.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`setDone(tbl, k, v)` if `k` does not exist, add the binding `k,v`, otherwise,\nupdate the old value with the new `v`" - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.HashMap.Int.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.HashMap.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.HashMap.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'b>, key) => bool" - }, - { - "id": "Belt.HashMap.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.HashMap.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'b>, (key, 'b) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashMap.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'b>, (key, 'b) => unit) => unit" - }, - { - "id": "Belt.HashMap.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashMap.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c" - }, - { - "id": "Belt.HashMap.Int.keepMapInPlaceU", - "kind": "value", - "name": "keepMapInPlaceU", - "docstrings": [], - "signature": "let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit", - "deprecated": "Use `keepMapInPlace` instead" - }, - { - "id": "Belt.HashMap.Int.keepMapInPlace", - "kind": "value", - "name": "keepMapInPlace", - "docstrings": [], - "signature": "let keepMapInPlace: (t<'a>, (key, 'a) => option<'a>) => unit" - }, - { - "id": "Belt.HashMap.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.HashMap.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.HashMap.Int.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.HashMap.Int.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.HashMap.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.HashMap.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'a>, array<(key, 'a)>) => unit" - }, - { - "id": "Belt.HashMap.Int.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t<'a> => array" - }, - { - "id": "Belt.HashMap.Int.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t<'a> => unit" - } - ] - }, - "belt/hashset/string": { - "id": "Belt.HashSet.String", - "name": "String", - "docstrings": [ - "Specalized when key type is `string`, more efficient than the generic type", - "This module is [`Belt.HashSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.HashSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.HashSet`]()" - ], - "items": [ - { - "id": "Belt.HashSet.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.HashSet.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Belt.HashSet.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t" - }, - { - "id": "Belt.HashSet.String.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Belt.HashSet.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.HashSet.String.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, key) => unit" - }, - { - "id": "Belt.HashSet.String.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.HashSet.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, key) => bool" - }, - { - "id": "Belt.HashSet.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, key) => unit" - }, - { - "id": "Belt.HashSet.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, key => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashSet.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, key => unit) => unit" - }, - { - "id": "Belt.HashSet.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'c, ('c, key) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashSet.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, 'c, ('c, key) => 'c) => 'c" - }, - { - "id": "Belt.HashSet.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.HashSet.String.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t => unit" - }, - { - "id": "Belt.HashSet.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.HashSet.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.HashSet.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.HashSet.String.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t => array" - } - ] - }, - "belt/hashset/int": { - "id": "Belt.HashSet.Int", - "name": "Int", - "docstrings": [ - "Specalized when key type is `int`, more efficient than the generic type", - "This module is [`Belt.HashSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.HashSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.HashSet`]()" - ], - "items": [ - { - "id": "Belt.HashSet.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.HashSet.Int.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Belt.HashSet.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t" - }, - { - "id": "Belt.HashSet.Int.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Belt.HashSet.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.HashSet.Int.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, key) => unit" - }, - { - "id": "Belt.HashSet.Int.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.HashSet.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, key) => bool" - }, - { - "id": "Belt.HashSet.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, key) => unit" - }, - { - "id": "Belt.HashSet.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, key => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashSet.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, key => unit) => unit" - }, - { - "id": "Belt.HashSet.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'c, ('c, key) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashSet.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, 'c, ('c, key) => 'c) => 'c" - }, - { - "id": "Belt.HashSet.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.HashSet.Int.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t => unit" - }, - { - "id": "Belt.HashSet.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.HashSet.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.HashSet.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.HashSet.Int.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t => array" - } - ] - }, - "belt/mutablemap/string": { - "id": "Belt.MutableMap.String", - "name": "String", - "docstrings": [], - "items": [ - { - "id": "Belt.MutableMap.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.MutableMap.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableMap.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableMap.String.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableMap.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a>, key) => bool" - }, - { - "id": "Belt.MutableMap.String.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.MutableMap.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m1, m2, cmp)`. First compare by size, if size is the same, compare by key,\nvalue pair" - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.MutableMap.String.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.MutableMap.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, cmp)`" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, (key, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableMap.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the key as\nfirst argument, and the associated value as second argument. The application \norder of `f` is in increasing order." - ], - "signature": "let forEach: (t<'a>, (key, 'a) => unit) => unit" - }, - { - "id": "Belt.MutableMap.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableMap.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`, where `k1 ... kN` are\nthe keys of all bindings in `m` (in increasing order), and `d1 ... dN` are the\nassociated data." - ], - "signature": "let reduce: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableMap.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableMap.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let every: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableMap.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let some: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableMap.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t<'a> => list<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order" - ], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.MutableMap.String.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.MutableMap.String.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.MutableMap.String.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.String.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.String.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.String.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.MutableMap.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'a>, key) => Js.undefined<'a>" - }, - { - "id": "Belt.MutableMap.String.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, key, 'a) => 'a" - }, - { - "id": "Belt.MutableMap.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` do the in-place modification" - ], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.MutableMap.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'a>, array) => unit" - }, - { - "id": "Belt.MutableMap.String.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` do the in-place modification, return `m` for chaining. If `x` was\nalready bound in `m`, its previous binding disappears." - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.MutableMap.String.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'a>, key, option<'a> => option<'a>) => unit", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.MutableMap.String.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'a>, key, option<'a> => option<'a>) => unit" - }, - { - "id": "Belt.MutableMap.String.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableMap.String.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.MutableMap.String.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'a>, (key, 'a) => 'b) => t<'b>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.MutableMap.String.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'a>, (key, 'a) => 'b) => t<'b>" - } - ] - }, - "belt/mutablemap/int": { - "id": "Belt.MutableMap.Int", - "name": "Int", - "docstrings": [], - "items": [ - { - "id": "Belt.MutableMap.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.MutableMap.Int.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableMap.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableMap.Int.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableMap.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a>, key) => bool" - }, - { - "id": "Belt.MutableMap.Int.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.MutableMap.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m1, m2, cmp)`. First compare by size, if size is the same, compare by key,\nvalue pair" - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.MutableMap.Int.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.MutableMap.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, cmp)`" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, (key, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableMap.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the key as\nfirst argument, and the associated value as second argument. The application \norder of `f` is in increasing order." - ], - "signature": "let forEach: (t<'a>, (key, 'a) => unit) => unit" - }, - { - "id": "Belt.MutableMap.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableMap.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`, where `k1 ... kN` are\nthe keys of all bindings in `m` (in increasing order), and `d1 ... dN` are the\nassociated data." - ], - "signature": "let reduce: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableMap.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableMap.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let every: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableMap.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let some: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableMap.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t<'a> => list<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order" - ], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.MutableMap.Int.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.MutableMap.Int.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.MutableMap.Int.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.Int.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.Int.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.Int.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.MutableMap.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'a>, key) => Js.undefined<'a>" - }, - { - "id": "Belt.MutableMap.Int.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, key, 'a) => 'a" - }, - { - "id": "Belt.MutableMap.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**Throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` do the in-place modification" - ], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.MutableMap.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'a>, array) => unit" - }, - { - "id": "Belt.MutableMap.Int.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` do the in-place modification, return `m` for chaining. If `x` was\nalready bound in `m`, its previous binding disappears." - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.MutableMap.Int.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'a>, key, option<'a> => option<'a>) => unit", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.MutableMap.Int.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'a>, key, option<'a> => option<'a>) => unit" - }, - { - "id": "Belt.MutableMap.Int.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableMap.Int.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.MutableMap.Int.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'a>, (key, 'a) => 'b) => t<'b>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.MutableMap.Int.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'a>, (key, 'a) => 'b) => t<'b>" - } - ] - }, - "belt/mutableset/string": { - "id": "Belt.MutableSet.String", - "name": "String", - "docstrings": [ - "Specialized when key type is `string`, more efficient than the generic type", - "This module is [`Belt.MutableSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.MutableSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.MutableSet`]()" - ], - "items": [ - { - "id": "Belt.MutableSet.String.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = string" - }, - { - "id": "Belt.MutableSet.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.MutableSet.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t" - }, - { - "id": "Belt.MutableSet.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.MutableSet.String.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.MutableSet.String.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.MutableSet.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.MutableSet.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.String.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.String.addCheck", - "kind": "value", - "name": "addCheck", - "docstrings": [], - "signature": "let addCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.String.removeCheck", - "kind": "value", - "name": "removeCheck", - "docstrings": [], - "signature": "let removeCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.String.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.MutableSet.String.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.MutableSet.String.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.MutableSet.String.subset", - "kind": "value", - "name": "subset", - "docstrings": [], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.MutableSet.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableSet.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.MutableSet.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableSet.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.MutableSet.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableSet.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`.\nOrder unspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableSet.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.String.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.MutableSet.String.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(s, p)` returns a fresh copy of the set of all elements in `s` that satisfy\npredicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.MutableSet.String.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.MutableSet.String.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(s, p)` returns a fresh copy pair of sets `(s1, s2)`, where `s1` is\nthe set of all the elements of `s` that satisfy the predicate `p`, and `s2` is\nthe set of all the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.MutableSet.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.MutableSet.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.MutableSet.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.MutableSet.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.MutableSet.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.MutableSet.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.MutableSet.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.MutableSet.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.MutableSet.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.MutableSet.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(s, key)` return a fresh copy of each" - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.MutableSet.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/mutableset/int": { - "id": "Belt.MutableSet.Int", - "name": "Int", - "docstrings": [ - "Specialized when key type is `int`, more efficient than the generic type", - "This module is [`Belt.MutableSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.MutableSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.MutableSet`]()" - ], - "items": [ - { - "id": "Belt.MutableSet.Int.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = int" - }, - { - "id": "Belt.MutableSet.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.MutableSet.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t" - }, - { - "id": "Belt.MutableSet.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.MutableSet.Int.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.MutableSet.Int.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.MutableSet.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.MutableSet.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.Int.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.Int.addCheck", - "kind": "value", - "name": "addCheck", - "docstrings": [], - "signature": "let addCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.Int.removeCheck", - "kind": "value", - "name": "removeCheck", - "docstrings": [], - "signature": "let removeCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.Int.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.MutableSet.Int.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.MutableSet.Int.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.MutableSet.Int.subset", - "kind": "value", - "name": "subset", - "docstrings": [], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.MutableSet.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableSet.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.MutableSet.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableSet.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.MutableSet.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableSet.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`.\nOrder unspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableSet.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.Int.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.MutableSet.Int.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(s, p)` returns a fresh copy of the set of all elements in `s` that satisfy\npredicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.MutableSet.Int.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.MutableSet.Int.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(s, p)` returns a fresh copy pair of sets `(s1, s2)`, where `s1` is\nthe set of all the elements of `s` that satisfy the predicate `p`, and `s2` is\nthe set of all the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.MutableSet.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.MutableSet.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.MutableSet.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.MutableSet.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.MutableSet.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.MutableSet.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.MutableSet.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.MutableSet.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.MutableSet.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.MutableSet.Int.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(s, key)` return a fresh copy of each" - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.MutableSet.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/map/dict": { - "id": "Belt.Map.Dict", - "name": "Dict", - "docstrings": [ - "This module separates identity from data, it is a bit more verbose but\nslightly more efficient due to the fact that there is no need to pack\nidentity and data back after each operation.\n\n**_Advanced usage only_**" - ], - "items": [ - { - "id": "Belt.Map.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'key, 'value, 'id>" - }, - { - "id": "Belt.Map.Dict.cmp", - "kind": "type", - "name": "cmp", - "docstrings": [], - "signature": "type cmp<'key, 'id> = Belt_Id.cmp<'key, 'id>" - }, - { - "id": "Belt.Map.Dict.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.Dict.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'k, 'v, 'id> => bool" - }, - { - "id": "Belt.Map.Dict.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => bool" - }, - { - "id": "Belt.Map.Dict.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (\n t<'k, 'v, 'id>,\n t<'k, 'v, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~vcmp: ('v, 'v) => int,\n) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.Dict.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (\n t<'k, 'v, 'id>,\n t<'k, 'v, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~vcmp: ('v, 'v) => int,\n) => int" - }, - { - "id": "Belt.Map.Dict.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (\n t<'k, 'a, 'id>,\n t<'k, 'a, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~veq: ('a, 'a) => bool,\n) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.Dict.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, cmp)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `cmp` is the\nequality predicate used to compare the data associated with the keys." - ], - "signature": "let eq: (\n t<'k, 'a, 'id>,\n t<'k, 'a, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~veq: ('a, 'a) => bool,\n) => bool" - }, - { - "id": "Belt.Map.Dict.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.Dict.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`findFirstBy(m, p)` uses function `f` to find the first key value pair to\nmatch predicate `p`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Map.Dict.fromArray([(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")], ~cmp=IntCmp.cmp)\n\nBelt.Map.Dict.findFirstBy(s0, (k, _) => k == 4) == Some((4, \"4\"))\n```" - ], - "signature": "let findFirstBy: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>" - }, - { - "id": "Belt.Map.Dict.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.Dict.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the\nkey as first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys." - ], - "signature": "let forEach: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit" - }, - { - "id": "Belt.Map.Dict.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.Dict.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `f(kN, dN ... f(k1, d1, a)...)`, where `k1 ... kN` \nare the keys of all bindings in `m` (in increasing order), and `d1 ... dN` \nare the associated data." - ], - "signature": "let reduce: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b" - }, - { - "id": "Belt.Map.Dict.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.Dict.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let every: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.Map.Dict.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.Dict.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the\npredicate `p`. Order unspecified" - ], - "signature": "let some: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.Map.Dict.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'k, 'a, 'id> => int" - }, - { - "id": "Belt.Map.Dict.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'k, 'a, 'id> => list<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'k, 'a, 'id> => array<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: (array<('k, 'a)>, ~cmp: cmp<'k, 'id>) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.Map.Dict.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'k, 'a, 'id> => array<'k>" - }, - { - "id": "Belt.Map.Dict.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'k, 'a, 'id> => array<'a>" - }, - { - "id": "Belt.Map.Dict.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.Dict.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.Dict.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.Dict.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.Dict.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => option<'a>" - }, - { - "id": "Belt.Map.Dict.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => Js.undefined<'a>" - }, - { - "id": "Belt.Map.Dict.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'k, 'a, 'id>, 'k, 'a, ~cmp: cmp<'k, 'id>) => 'a" - }, - { - "id": "Belt.Map.Dict.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => 'a" - }, - { - "id": "Belt.Map.Dict.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => 'a" - }, - { - "id": "Belt.Map.Dict.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [], - "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit" - }, - { - "id": "Belt.Map.Dict.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` returns a map containing the same bindings as `m`, except\nfor `x` which is unbound in the returned map." - ], - "signature": "let remove: (t<'a, 'b, 'id>, 'a, ~cmp: cmp<'a, 'id>) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (\n t<'a, 'b, 'id>,\n array<'a>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as `m`, plus a\nbinding of `x` to `y`. If `x` was already bound in `m`, its previous\nbinding disappears." - ], - "signature": "let set: (\n t<'a, 'b, 'id>,\n 'a,\n 'b,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (\n t<'a, 'b, 'id>,\n 'a,\n option<'b> => option<'b>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.Dict.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (\n t<'a, 'b, 'id>,\n 'a,\n option<'b> => option<'b>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'a, 'b, 'id>,\n t<'a, 'c, 'id>,\n ('a, option<'b>, option<'c>) => option<'d>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'd, 'id>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.Dict.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'a, 'b, 'id>,\n t<'a, 'c, 'id>,\n ('a, option<'b>, option<'c>) => option<'d>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'd, 'id>" - }, - { - "id": "Belt.Map.Dict.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (\n t<'a, 'b, 'id>,\n array<('a, 'b)>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => t<'k, 'a, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.Dict.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in `m` that satisfy\npredicate `p`." - ], - "signature": "let keep: (t<'k, 'a, 'id>, ('k, 'a) => bool) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.Map.Dict.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'k, 'a, 'id>,\n ('k, 'a) => bool,\n) => (t<'k, 'a, 'id>, t<'k, 'a, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.Dict.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains\nall the bindings of `s` that satisfy the predicate `p`, and `m2` is the map\nwith all the bindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (\n t<'k, 'a, 'id>,\n ('k, 'a) => bool,\n) => (t<'k, 'a, 'id>, t<'k, 'a, 'id>)" - }, - { - "id": "Belt.Map.Dict.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with\nall the bindings of `m` whose key is strictly less than `x`; `r` is the map\nwith all the bindings of `m` whose key is strictly greater than `x`; `data`\nis `None` if `m` contains no binding for `x`, or `Some(v)` if `m` binds `v`\nto `x`." - ], - "signature": "let split: (\n t<'a, 'b, 'id>,\n 'a,\n ~cmp: cmp<'a, 'id>,\n) => ((t<'a, 'b, 'id>, t<'a, 'b, 'id>), option<'b>)" - }, - { - "id": "Belt.Map.Dict.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.Dict.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated\nvalue `a` of all bindings of `m` has been replaced by the result of the\napplication of `f` to `a`. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let map: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.Dict.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>" - } - ] - }, - "belt/map/string": { - "id": "Belt.Map.String", - "name": "String", - "docstrings": [], - "items": [ - { - "id": "Belt.Map.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.Map.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of maps from type `key` to type `'value`." - ], - "signature": "type t<'value>" - }, - { - "id": "Belt.Map.String.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t<'v>" - }, - { - "id": "Belt.Map.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'v> => bool" - }, - { - "id": "Belt.Map.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'v>, key) => bool" - }, - { - "id": "Belt.Map.String.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'v>, t<'v>, ('v, 'v) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t<'v>, t<'v>, ('v, 'v) => int) => int" - }, - { - "id": "Belt.Map.String.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'v>, t<'v>, ('v, 'v) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2)` tests whether the maps `m1` and `m2` are\nequal, that is, contain equal keys and associate them with\nequal data." - ], - "signature": "let eq: (t<'v>, t<'v>, ('v, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.String.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.String.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`findFirstBy(m, p)` uses funcion `f` to find the first key value pair\nto match predicate `p`.\n\n## Examples\n\n```rescript\nlet mapString = Belt.Map.String.fromArray([(\"1\", \"one\"), (\"2\", \"two\"), (\"3\", \"three\")])\n\nmapString->Belt.Map.String.findFirstBy((k, v) => k == \"1\" && v == \"one\") == Some(\"1\", \"one\")\n```" - ], - "signature": "let findFirstBy: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>" - }, - { - "id": "Belt.Map.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'v>, (key, 'v) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`.\n`f` receives the key as first argument, and the associated value\nas second argument. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let forEach: (t<'v>, (key, 'v) => unit) => unit" - }, - { - "id": "Belt.Map.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`,\nwhere `k1 ... kN` are the keys of all bindings in `m`\n(in increasing order), and `d1 ... dN` are the associated data." - ], - "signature": "let reduce: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2" - }, - { - "id": "Belt.Map.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nOrder unspecified" - ], - "signature": "let every: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let some: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'v> => int" - }, - { - "id": "Belt.Map.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'v> => list<(key, 'v)>" - }, - { - "id": "Belt.Map.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'v> => array<(key, 'v)>" - }, - { - "id": "Belt.Map.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'v)> => t<'v>" - }, - { - "id": "Belt.Map.String.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'v> => array" - }, - { - "id": "Belt.Map.String.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'v> => array<'v>" - }, - { - "id": "Belt.Map.String.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.Map.String.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.String.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.Map.String.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'v>, key) => option<'v>" - }, - { - "id": "Belt.Map.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'v>, key) => Js.undefined<'v>" - }, - { - "id": "Belt.Map.String.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'v>, key, 'v) => 'v" - }, - { - "id": "Belt.Map.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.Map.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove m x` returns a map containing the same bindings as\n `m`, except for `x` which is unbound in the returned map." - ], - "signature": "let remove: (t<'v>, key) => t<'v>" - }, - { - "id": "Belt.Map.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'v>, array) => t<'v>" - }, - { - "id": "Belt.Map.String.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as\n`m`, plus a binding of `x` to `y`. If `x` was already bound\nin `m`, its previous binding disappears." - ], - "signature": "let set: (t<'v>, key, 'v) => t<'v>" - }, - { - "id": "Belt.Map.String.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'v>, key, option<'v> => option<'v>) => t<'v>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.String.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'v>, key, option<'v> => option<'v>) => t<'v>" - }, - { - "id": "Belt.Map.String.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.String.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>" - }, - { - "id": "Belt.Map.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'v>, array<(key, 'v)>) => t<'v>" - }, - { - "id": "Belt.Map.String.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'v>, (key, 'v) => bool) => t<'v>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.String.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in `m` that satisfy predicate\n`p`." - ], - "signature": "let keep: (t<'v>, (key, 'v) => bool) => t<'v>" - }, - { - "id": "Belt.Map.String.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.String.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains all the\nbindings of `s` that satisfy the predicate `p`, and `m2` is the map with all the\nbindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)" - }, - { - "id": "Belt.Map.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with all the\nbindings of `m` whose key is strictly less than `x`; `r` is the map with all the\nbindings of `m` whose key is strictly greater than `x`; `data` is `None` if `m`\ncontains no binding for `x`, or `Some(v)` if `m` binds `v` to `x`." - ], - "signature": "let split: (key, t<'v>) => (t<'v>, option<'v>, t<'v>)" - }, - { - "id": "Belt.Map.String.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'v>, 'v => 'v2) => t<'v2>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.String.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'v>, 'v => 'v2) => t<'v2>" - }, - { - "id": "Belt.Map.String.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'v>, (key, 'v) => 'v2) => t<'v2>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.String.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'v>, (key, 'v) => 'v2) => t<'v2>" - } - ] - }, - "belt/map/int": { - "id": "Belt.Map.Int", - "name": "Int", - "docstrings": [ - "## Examples\n\n```rescript\ntype t<'key, 'value, 'identity>\ntype id<'key, 'id> = Belt_Id.comparable<'key, 'id>\n```" - ], - "items": [ - { - "id": "Belt.Map.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.Map.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of maps from type `key` to type `'value`." - ], - "signature": "type t<'value>" - }, - { - "id": "Belt.Map.Int.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t<'v>" - }, - { - "id": "Belt.Map.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'v> => bool" - }, - { - "id": "Belt.Map.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'v>, key) => bool" - }, - { - "id": "Belt.Map.Int.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'v>, t<'v>, ('v, 'v) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t<'v>, t<'v>, ('v, 'v) => int) => int" - }, - { - "id": "Belt.Map.Int.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'v>, t<'v>, ('v, 'v) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2)` tests whether the maps `m1` and `m2` are\nequal, that is, contain equal keys and associate them with\nequal data." - ], - "signature": "let eq: (t<'v>, t<'v>, ('v, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.Int.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.Int.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`findFirstBy(m, p)` uses funcion `f` to find the first key value pair\nto match predicate `p`.\n\n## Examples\n\n```rescript\nlet mapInt = Belt.Map.Int.fromArray([(1, \"one\"), (2, \"two\"), (3, \"three\")])\n\nmapInt->Belt.Map.Int.findFirstBy((k, v) => k == 1 && v == \"one\") == Some(1, \"one\")\n```" - ], - "signature": "let findFirstBy: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'v>, (key, 'v) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`.\n`f` receives the key as first argument, and the associated value\nas second argument. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let forEach: (t<'v>, (key, 'v) => unit) => unit" - }, - { - "id": "Belt.Map.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`,\nwhere `k1 ... kN` are the keys of all bindings in `m`\n(in increasing order), and `d1 ... dN` are the associated data." - ], - "signature": "let reduce: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2" - }, - { - "id": "Belt.Map.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nOrder unspecified" - ], - "signature": "let every: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let some: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'v> => int" - }, - { - "id": "Belt.Map.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'v> => list<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'v> => array<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'v)> => t<'v>" - }, - { - "id": "Belt.Map.Int.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'v> => array" - }, - { - "id": "Belt.Map.Int.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'v> => array<'v>" - }, - { - "id": "Belt.Map.Int.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.Map.Int.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.Int.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.Map.Int.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'v>, key) => option<'v>" - }, - { - "id": "Belt.Map.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'v>, key) => Js.undefined<'v>" - }, - { - "id": "Belt.Map.Int.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'v>, key, 'v) => 'v" - }, - { - "id": "Belt.Map.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.Map.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove m x` returns a map containing the same bindings as\n `m`, except for `x` which is unbound in the returned map." - ], - "signature": "let remove: (t<'v>, key) => t<'v>" - }, - { - "id": "Belt.Map.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'v>, array) => t<'v>" - }, - { - "id": "Belt.Map.Int.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as\n`m`, plus a binding of `x` to `y`. If `x` was already bound\nin `m`, its previous binding disappears." - ], - "signature": "let set: (t<'v>, key, 'v) => t<'v>" - }, - { - "id": "Belt.Map.Int.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'v>, key, option<'v> => option<'v>) => t<'v>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.Int.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'v>, key, option<'v> => option<'v>) => t<'v>" - }, - { - "id": "Belt.Map.Int.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.Int.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>" - }, - { - "id": "Belt.Map.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'v>, array<(key, 'v)>) => t<'v>" - }, - { - "id": "Belt.Map.Int.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'v>, (key, 'v) => bool) => t<'v>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.Int.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in `m` that satisfy predicate\n`p`." - ], - "signature": "let keep: (t<'v>, (key, 'v) => bool) => t<'v>" - }, - { - "id": "Belt.Map.Int.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.Int.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains all the\nbindings of `s` that satisfy the predicate `p`, and `m2` is the map with all the\nbindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)" - }, - { - "id": "Belt.Map.Int.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with all the\nbindings of `m` whose key is strictly less than `x`; `r` is the map with all the\nbindings of `m` whose key is strictly greater than `x`; `data` is `None` if `m`\ncontains no binding for `x`, or `Some(v)` if `m` binds `v` to `x`." - ], - "signature": "let split: (key, t<'v>) => (t<'v>, option<'v>, t<'v>)" - }, - { - "id": "Belt.Map.Int.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'v>, 'v => 'v2) => t<'v2>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.Int.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'v>, 'v => 'v2) => t<'v2>" - }, - { - "id": "Belt.Map.Int.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'v>, (key, 'v) => 'v2) => t<'v2>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.Int.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'v>, (key, 'v) => 'v2) => t<'v2>" - } - ] - }, - "belt/set/dict": { - "id": "Belt.Set.Dict", - "name": "Dict", - "docstrings": [ - "This module separates identity from data, it is a bit more verbose but slightly\nmore efficient due to the fact that there is no need to pack identity and data back\nafter each operation", - "This module separates identity from data. It is a bit more verbose but slightly\nmore efficient due to the fact that there is no need to pack identity and data\nback after each operation." - ], - "items": [ - { - "id": "Belt.Set.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'value, 'identity>" - }, - { - "id": "Belt.Set.Dict.cmp", - "kind": "type", - "name": "cmp", - "docstrings": [ - "Type of compare function." - ], - "signature": "type cmp<'value, 'id> = Belt_Id.cmp<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "## Examples\n\n```rescript\nlet s0 = Belt.Set.Dict.empty\n```" - ], - "signature": "let empty: t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 3, 2, 4], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let fromArray: (array<'value>, ~cmp: cmp<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [ - "The same as [fromArray][#fromarray] except it is after assuming the input array\nis already sorted." - ], - "signature": "let fromSortedArrayUnsafe: array<'value> => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.Set.Dict.fromArray([], ~cmp=IntCmp.cmp)\nlet notEmpty = Belt.Set.Dict.fromArray([1], ~cmp=IntCmp.cmp)\n\nBelt.Set.Dict.isEmpty(empty) == true\nBelt.Set.Dict.isEmpty(notEmpty) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.Set.Dict.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if an element exists in the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.fromArray([1, 4, 2, 5], ~cmp=IntCmp.cmp)\n\nset->Belt.Set.Dict.has(3, ~cmp=IntCmp.cmp) == false\nset->Belt.Set.Dict.has(1, ~cmp=IntCmp.cmp) == true\n```" - ], - "signature": "let has: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => bool" - }, - { - "id": "Belt.Set.Dict.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = s0->Belt.Set.Dict.add(1, ~cmp=IntCmp.cmp)\nlet s2 = s1->Belt.Set.Dict.add(2, ~cmp=IntCmp.cmp)\nlet s3 = s2->Belt.Set.Dict.add(2, ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.toArray == []\ns1->Belt.Set.Dict.toArray == [1]\ns2->Belt.Set.Dict.toArray == [1, 2]\ns3->Belt.Set.Dict.toArray == [1, 2]\ns2 == s3\n```" - ], - "signature": "let add: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "Adds each element of array to set. Unlike [add](#add), the reference of return value might be changed even if all values in array already exist in set\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.empty\n\nlet newSet = set->Belt.Set.Dict.mergeMany([5, 4, 3, 2, 1], ~cmp=IntCmp.cmp)\nnewSet->Belt.Set.Dict.toArray == [1, 2, 3, 4, 5]\n```" - ], - "signature": "let mergeMany: (\n t<'value, 'id>,\n array<'value>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([2, 3, 1, 4, 5], ~cmp=IntCmp.cmp)\nlet s1 = s0->Belt.Set.Dict.remove(1, ~cmp=IntCmp.cmp)\nlet s2 = s1->Belt.Set.Dict.remove(3, ~cmp=IntCmp.cmp)\nlet s3 = s2->Belt.Set.Dict.remove(3, ~cmp=IntCmp.cmp)\n\ns1->Belt.Set.Dict.toArray == [2, 3, 4, 5]\ns2->Belt.Set.Dict.toArray == [2, 4, 5]\ns2 == s3\n```" - ], - "signature": "let remove: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "Removes each element of array from set. Unlike [remove](#remove), the reference of return value might be changed even if any values in array not existed in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.fromArray([1, 2, 3, 4], ~cmp=IntCmp.cmp)\n\nlet newSet = set->Belt.Set.Dict.removeMany([5, 4, 3, 2, 1], ~cmp=IntCmp.cmp)\nnewSet->Belt.Set.Dict.toArray == []\n```" - ], - "signature": "let removeMany: (\n t<'value, 'id>,\n array<'value>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet union = Belt.Set.Dict.union(s0, s1, ~cmp=IntCmp.cmp)\nunion->Belt.Set.Dict.toArray == [1, 2, 3, 4, 5, 6]\n```" - ], - "signature": "let union: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet intersect = Belt.Set.Dict.intersect(s0, s1, ~cmp=IntCmp.cmp)\nintersect->Belt.Set.Dict.toArray == [2, 3, 5]\n```" - ], - "signature": "let intersect: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.diff", - "kind": "value", - "name": "diff", - "docstrings": [ - "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\n\nlet diff1 = Belt.Set.Dict.diff(s0, s1, ~cmp=IntCmp.cmp)\nlet diff2 = Belt.Set.Dict.diff(s1, s0, ~cmp=IntCmp.cmp)\n\ndiff1->Belt.Set.Dict.toArray == [6]\ndiff2->Belt.Set.Dict.toArray == [1, 4]\n```" - ], - "signature": "let diff: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet s2 = Belt.Set.Dict.intersect(s0, s1, ~cmp=IntCmp.cmp)\nBelt.Set.Dict.subset(s2, s0, ~cmp=IntCmp.cmp) == true\nBelt.Set.Dict.subset(s2, s1, ~cmp=IntCmp.cmp) == true\nBelt.Set.Dict.subset(s1, s0, ~cmp=IntCmp.cmp) == false\n```" - ], - "signature": "let subset: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => bool" - }, - { - "id": "Belt.Set.Dict.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets. It compares size first and then iterates over each element following the\norder of elements." - ], - "signature": "let cmp: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => int" - }, - { - "id": "Belt.Set.Dict.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 5], ~cmp=IntCmp.cmp)\n\nBelt.Set.Dict.eq(s0, s1, ~cmp=IntCmp.cmp) == true\n```" - ], - "signature": "let eq: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => bool" - }, - { - "id": "Belt.Set.Dict.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as [forEach](##forEach) but takes uncurried functon." - ], - "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.Dict.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet acc = ref(list{})\ns0->Belt.Set.Dict.forEach(x => acc := Belt.List.add(acc.contents, x))\nacc.contents == list{6, 5, 3, 2}\n```" - ], - "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit" - }, - { - "id": "Belt.Set.Dict.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.Dict.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) == list{6, 5, 3, 2}\n```" - ], - "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a" - }, - { - "id": "Belt.Set.Dict.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.Dict.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.Dict.fromArray([2, 4, 6, 8], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.every(isEven) == true\n```" - ], - "signature": "let every: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.Dict.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.Dict.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 4, 6, 8], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.some(isOdd) == true\n```" - ], - "signature": "let some: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.Dict.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.Dict.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\nlet s1 = s0->Belt.Set.Dict.keep(isEven)\n\ns1->Belt.Set.Dict.toArray == [2, 4]\n```" - ], - "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.Dict.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "Returns a pair of sets, where first is the set of all the elements of set that satisfy the predicate, and second is the set of all the elements of set that do not satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\nlet (s1, s2) = s0->Belt.Set.Dict.partition(isOdd)\n\ns1->Belt.Set.Dict.toArray == [1, 3, 5]\ns2->Belt.Set.Dict.toArray == [2, 4]\n```" - ], - "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)" - }, - { - "id": "Belt.Set.Dict.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.size == 4\n```" - ], - "signature": "let size: t<'value, 'id> => int" - }, - { - "id": "Belt.Set.Dict.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toList == list{1, 2, 3, 5}\n```" - ], - "signature": "let toList: t<'value, 'id> => list<'value>" - }, - { - "id": "Belt.Set.Dict.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toArray == [1, 2, 3, 5]\n```" - ], - "signature": "let toArray: t<'value, 'id> => array<'value>" - }, - { - "id": "Belt.Set.Dict.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.minimum == None\ns1->Belt.Set.Dict.minimum == Some(1)\n```" - ], - "signature": "let minimum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.Dict.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "Returns minimum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.minUndefined == Js.undefined\ns1->Belt.Set.Dict.minUndefined == Js.Undefined.return(1)\n```" - ], - "signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.Dict.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.maximum == None\ns1->Belt.Set.Dict.maximum == Some(5)\n```" - ], - "signature": "let maximum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.Dict.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "Returns maximum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.maxUndefined == Js.undefined\ns1->Belt.Set.Dict.maxUndefined == Js.Undefined.return(5)\n```" - ], - "signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the reference of the value which is equivalent to value using the comparator\nspecifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.get(3, ~cmp=IntCmp.cmp) == Some(3)\ns0->Belt.Set.Dict.get(20, ~cmp=IntCmp.cmp) == None\n```" - ], - "signature": "let get: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => option<'value>" - }, - { - "id": "Belt.Set.Dict.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "Same as [get](#get) but returns `undefined` when element does not exist." - ], - "signature": "let getUndefined: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => Js.undefined<'value>" - }, - { - "id": "Belt.Set.Dict.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getExn: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => 'value" - }, - { - "id": "Belt.Set.Dict.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getOrThrow: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => 'value" - }, - { - "id": "Belt.Set.Dict.split", - "kind": "value", - "name": "split", - "docstrings": [ - "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\n\nlet ((smaller, larger), present) = s0->Belt.Set.Dict.split(3, ~cmp=IntCmp.cmp)\n\npresent == true\nsmaller->Belt.Set.Dict.toArray == [1, 2]\nlarger->Belt.Set.Dict.toArray == [4, 5]\n```" - ], - "signature": "let split: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)" - }, - { - "id": "Belt.Set.Dict.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b> => unit" - } - ] - }, - "belt/set/string": { - "id": "Belt.Set.String", - "name": "String", - "docstrings": [ - "Specialized when value type is `string`, more efficient than the generic type,\nits compare behavior is fixed using the built-in comparison", - "This module is [`Belt.Set`]() specialized with value type to be a primitive type.\nIt is more efficient in general, the API is the same with [`Belt_Set`]() except its value type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.Set`]()" - ], - "items": [ - { - "id": "Belt.Set.String.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = string" - }, - { - "id": "Belt.Set.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.Set.String.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t" - }, - { - "id": "Belt.Set.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.Set.String.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.Set.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.Set.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.Set.String.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(s, x)` If `x` was already in `s`, `s` is returned unchanged." - ], - "signature": "let add: (t, value) => t" - }, - { - "id": "Belt.Set.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => t" - }, - { - "id": "Belt.Set.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` If `x` was not in `m`, `m` is returned reference unchanged." - ], - "signature": "let remove: (t, value) => t" - }, - { - "id": "Belt.Set.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => t" - }, - { - "id": "Belt.Set.String.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.Set.String.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.Set.String.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.Set.String.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "`subset(s1, s2)` tests whether the set `s1` is a subset of the set `s2`." - ], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.Set.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets." - ], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.Set.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(s1, s2)` tests whether the sets `s1` and `s2` are equal, that is, contain\nequal elements." - ], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.Set.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(s, f)` applies `f` in turn to all elements of `s`. In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.Set.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.Set.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`. Order\nunspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.String.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.String.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(p, s)` returns the set of all elements in `s` that satisfy predicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.Set.String.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.String.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(p, s)` returns a pair of sets `(s1, s2)`, where `s1` is the set of\nall the elements of `s` that satisfy the predicate `p`, and `s2` is the set of\nall the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.Set.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.Set.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.Set.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.Set.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.Set.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.Set.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.Set.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.Set.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.Set.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.Set.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, s)` returns a triple `(l, present, r)`, where `l` is the set of\nelements of `s` that are strictly less than `x`;`r` is the set of elements of\n`s` that are strictly greater than `x`; `present` is `false` if `s` contains no\nelement equal to `x`, or `true` if `s` contains an element equal to `x`." - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.Set.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/set/int": { - "id": "Belt.Set.Int", - "name": "Int", - "docstrings": [ - "Specialized when value type is `int`, more efficient than the generic type, its\ncompare behavior is fixed using the built-in comparison", - "This module is [`Belt.Set`]() specialized with value type to be a primitive type.\nIt is more efficient in general, the API is the same with [`Belt_Set`]() except its value type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.Set`]()" - ], - "items": [ - { - "id": "Belt.Set.Int.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = int" - }, - { - "id": "Belt.Set.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.Set.Int.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t" - }, - { - "id": "Belt.Set.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.Set.Int.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.Set.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.Set.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.Set.Int.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(s, x)` If `x` was already in `s`, `s` is returned unchanged." - ], - "signature": "let add: (t, value) => t" - }, - { - "id": "Belt.Set.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => t" - }, - { - "id": "Belt.Set.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` If `x` was not in `m`, `m` is returned reference unchanged." - ], - "signature": "let remove: (t, value) => t" - }, - { - "id": "Belt.Set.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => t" - }, - { - "id": "Belt.Set.Int.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.Set.Int.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.Set.Int.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.Set.Int.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "`subset(s1, s2)` tests whether the set `s1` is a subset of the set `s2`." - ], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.Set.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets." - ], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.Set.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(s1, s2)` tests whether the sets `s1` and `s2` are equal, that is, contain\nequal elements." - ], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.Set.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(s, f)` applies `f` in turn to all elements of `s`. In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.Set.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.Set.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`. Order\nunspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.Int.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.Int.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(p, s)` returns the set of all elements in `s` that satisfy predicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.Set.Int.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.Int.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(p, s)` returns a pair of sets `(s1, s2)`, where `s1` is the set of\nall the elements of `s` that satisfy the predicate `p`, and `s2` is the set of\nall the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.Set.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.Set.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.Set.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.Set.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.Set.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.Set.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.Set.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.Set.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.Set.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.Set.Int.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, s)` returns a triple `(l, present, r)`, where `l` is the set of\nelements of `s` that are strictly less than `x`;`r` is the set of elements of\n`s` that are strictly greater than `x`; `present` is `false` if `s` contains no\nelement equal to `x`, or `true` if `s` contains an element equal to `x`." - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.Set.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/sortarray/string": { - "id": "Belt.SortArray.String", - "name": "String", - "docstrings": [ - "Specalized when key type is `string`, more efficient than the generic type", - "This is a specialized module for [`Belt_SortArray`](), the docs in that module also\napplies here, except the comparator is fixed and inlined" - ], - "items": [ - { - "id": "Belt.SortArray.String.element", - "kind": "type", - "name": "element", - "docstrings": [], - "signature": "type element = string" - }, - { - "id": "Belt.SortArray.String.strictlySortedLength", - "kind": "value", - "name": "strictlySortedLength", - "docstrings": [ - "The same as [`Belt_SortArray.strictlySortedLength`]() except the comparator is fixed\n\n**return** `+n` means increasing order `-n` means negative order" - ], - "signature": "let strictlySortedLength: array => int" - }, - { - "id": "Belt.SortArray.String.isSorted", - "kind": "value", - "name": "isSorted", - "docstrings": [ - "`sorted(xs)` return true if `xs` is in non strict increasing order" - ], - "signature": "let isSorted: array => bool" - }, - { - "id": "Belt.SortArray.String.stableSortInPlace", - "kind": "value", - "name": "stableSortInPlace", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortInPlaceBy`]() except the comparator is fixed" - ], - "signature": "let stableSortInPlace: array => unit" - }, - { - "id": "Belt.SortArray.String.stableSort", - "kind": "value", - "name": "stableSort", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortBy`]() except the comparator is fixed" - ], - "signature": "let stableSort: array => array" - }, - { - "id": "Belt.SortArray.String.binarySearch", - "kind": "value", - "name": "binarySearch", - "docstrings": [ - "If value is not found and value is less than one or more elements in array,\nthe negative number returned is the bitwise complement of the index of the first element\nthat is larger than value.\n\nIf value is not found and value is greater than all elements in array,\nthe negative number returned is the bitwise complement of\n(the index of the last element plus 1)\n\nfor example, if `key` is smaller than all elements return `-1` since `lnot (-1) = 0`\nif `key` is larger than all elements return `- (len + 1)` since `lnot (-(len+1)) = len`" - ], - "signature": "let binarySearch: (array, element) => int" - }, - { - "id": "Belt.SortArray.String.union", - "kind": "value", - "name": "union", - "docstrings": [ - "`union(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp)` assume\n`src` and `src2` is strictly sorted. for equivalent elements, it is picked from\n`src` also assume that `dst` is large enough to store all elements" - ], - "signature": "let union: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.String.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.String.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - } - ] - }, - "belt/sortarray/int": { - "id": "Belt.SortArray.Int", - "name": "Int", - "docstrings": [ - "Specalized when key type is `int`, more efficient than the generic type", - "This is a specialized module for [`Belt_SortArray`](), the docs in that module also\napplies here, except the comparator is fixed and inlined" - ], - "items": [ - { - "id": "Belt.SortArray.Int.element", - "kind": "type", - "name": "element", - "docstrings": [], - "signature": "type element = int" - }, - { - "id": "Belt.SortArray.Int.strictlySortedLength", - "kind": "value", - "name": "strictlySortedLength", - "docstrings": [ - "The same as [`Belt_SortArray.strictlySortedLength`]() except the comparator is fixed\n\n**return** `+n` means increasing order `-n` means negative order" - ], - "signature": "let strictlySortedLength: array => int" - }, - { - "id": "Belt.SortArray.Int.isSorted", - "kind": "value", - "name": "isSorted", - "docstrings": [ - "`sorted(xs)` return true if `xs` is in non strict increasing order" - ], - "signature": "let isSorted: array => bool" - }, - { - "id": "Belt.SortArray.Int.stableSortInPlace", - "kind": "value", - "name": "stableSortInPlace", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortInPlaceBy`]() except the comparator is fixed" - ], - "signature": "let stableSortInPlace: array => unit" - }, - { - "id": "Belt.SortArray.Int.stableSort", - "kind": "value", - "name": "stableSort", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortBy`]() except the comparator is fixed" - ], - "signature": "let stableSort: array => array" - }, - { - "id": "Belt.SortArray.Int.binarySearch", - "kind": "value", - "name": "binarySearch", - "docstrings": [ - "If value is not found and value is less than one or more elements in array,\nthe negative number returned is the bitwise complement of the index of the first element\nthat is larger than value.\n\nIf value is not found and value is greater than all elements in array,\nthe negative number returned is the bitwise complement of\n(the index of the last element plus 1)\n\nfor example, if `key` is smaller than all elements return `-1` since `lnot (-1) = 0`\nif `key` is larger than all elements return `- (len + 1)` since `lnot (-(len+1)) = len`" - ], - "signature": "let binarySearch: (array, element) => int" - }, - { - "id": "Belt.SortArray.Int.union", - "kind": "value", - "name": "union", - "docstrings": [ - "`union(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp)` assume\n`src` and `src2` is strictly sorted. for equivalent elements, it is picked from\n`src` also assume that `dst` is large enough to store all elements" - ], - "signature": "let union: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.Int.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.Int.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - } - ] - }, - "belt/id/makehashable": { - "id": "Belt.Id.MakeHashable", - "name": "MakeHashable", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeHashable.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeHashable.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeHashable.hash", - "kind": "value", - "name": "hash", - "docstrings": [], - "signature": "let hash: hash" - }, - { - "id": "Belt.Id.MakeHashable.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: eq" - } - ] - }, - "belt/id/makehashableu": { - "id": "Belt.Id.MakeHashableU", - "name": "MakeHashableU", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeHashableU.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeHashableU.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeHashableU.hash", - "kind": "value", - "name": "hash", - "docstrings": [], - "signature": "let hash: hash" - }, - { - "id": "Belt.Id.MakeHashableU.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: eq" - } - ] - }, - "belt/id/makecomparable": { - "id": "Belt.Id.MakeComparable", - "name": "MakeComparable", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeComparable.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeComparable.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeComparable.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: cmp" - } - ] - }, - "belt/id/makecomparableu": { - "id": "Belt.Id.MakeComparableU", - "name": "MakeComparableU", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeComparableU.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeComparableU.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeComparableU.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: cmp" - } - ] - }, - "belt/float": { - "id": "Belt.Float", - "name": "Float", - "docstrings": [ - "[`Belt.Float`]()\n\n Utilities for Float.", - "This module includes convenience methods for handling `float` types." - ], - "items": [ - { - "id": "Belt.Float.toInt", - "kind": "value", - "name": "toInt", - "docstrings": [ - "Converts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nBelt.Float.toInt(1.0) == 1\n```" - ], - "signature": "let toInt: float => int" - }, - { - "id": "Belt.Float.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "Converts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nBelt.Float.fromInt(1) == 1.0\n```" - ], - "signature": "let fromInt: int => float" - }, - { - "id": "Belt.Float.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Converts a given `string` to a `float`. Returns `Some(float)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nBelt.Float.fromString(\"1.0\") == Some(1.0)\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Belt.Float.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts a given `float` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nBelt.Float.toString(1.0) == \"1\"\n```" - ], - "signature": "let toString: float => string" - }, - { - "id": "Belt.Float.+", - "kind": "value", - "name": "+", - "docstrings": [ - "Addition of two `float` values.\nCan be opened in a module to avoid dot-notation (`+.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n2.0 + 2.0 == 4.0\n```" - ], - "signature": "let +: (float, float) => float" - }, - { - "id": "Belt.Float.-", - "kind": "value", - "name": "-", - "docstrings": [ - "Subtraction of two `float` values.\nCan be opened in a module to avoid dot-notation (`-.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n2.0 - 1.0 == 1.0\n```" - ], - "signature": "let -: (float, float) => float" - }, - { - "id": "Belt.Float.*", - "kind": "value", - "name": "*", - "docstrings": [ - "Multiplication of two `float` values.\nCan be opened in a module to avoid dot-notation (`*.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n2.0 * 2.0 == 4.0\n```" - ], - "signature": "let *: (float, float) => float" - }, - { - "id": "Belt.Float./", - "kind": "value", - "name": "/", - "docstrings": [ - "Division of two `float` values.\nCan be opened in a module to avoid dot-notation (`/.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n4.0 / 2.0 == 2.0\n```" - ], - "signature": "let /: (float, float) => float" - } - ] - }, - "belt/int": { - "id": "Belt.Int", - "name": "Int", - "docstrings": [ - "[`Belt.Int`]()\n\n Utilities for Int.", - "This module includes convenience methods for handling `int` types." - ], - "items": [ - { - "id": "Belt.Int.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [ - "Converts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nBelt.Int.toFloat(1) == 1.0\n```" - ], - "signature": "let toFloat: int => float" - }, - { - "id": "Belt.Int.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "Converts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nBelt.Int.fromFloat(1.0) == 1\n```" - ], - "signature": "let fromFloat: float => int" - }, - { - "id": "Belt.Int.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Converts a given `string` to an `int`. Returns `Some(int)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nBelt.Int.fromString(\"1\") == Some(1)\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Belt.Int.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nBelt.Int.toString(1) == \"1\"\n```" - ], - "signature": "let toString: int => string" - }, - { - "id": "Belt.Int.+", - "kind": "value", - "name": "+", - "docstrings": [ - "Addition of two `int` values. Same as the addition from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n2 + 2 == 4\n```" - ], - "signature": "let +: (int, int) => int" - }, - { - "id": "Belt.Int.-", - "kind": "value", - "name": "-", - "docstrings": [ - "Subtraction of two `int` values. Same as the subtraction from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n2 - 1 == 1\n```" - ], - "signature": "let -: (int, int) => int" - }, - { - "id": "Belt.Int.*", - "kind": "value", - "name": "*", - "docstrings": [ - "Multiplication of two `int` values. Same as the multiplication from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n2 * 2 == 4\n```" - ], - "signature": "let *: (int, int) => int" - }, - { - "id": "Belt.Int./", - "kind": "value", - "name": "/", - "docstrings": [ - "Division of two `int` values. Same as the division from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n4 / 2 == 2\n```" - ], - "signature": "let /: (int, int) => int" - } - ] - }, - "belt/result": { - "id": "Belt.Result", - "name": "Result", - "docstrings": [ - "[`Belt.Result`]()\n\n Utilities for result data type.", - "Result types are really useful to describe the result of a certain operation\nwithout relying on exceptions or `option` types.\n\nThis module gives you useful utilities to create and combine `Result` data." - ], - "items": [ - { - "id": "Belt.Result.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a, 'b> = result<'a, 'b> = Ok('a) | Error('b)" - }, - { - "id": "Belt.Result.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(res)`: when `res` is `Ok(n)`, returns `n` when `res` is `Error(m)`, throw an exception\n\n## Examples\n\n```rescript\nBelt.Result.Ok(42)->Belt.Result.getExn == 42\n\nswitch Belt.Result.getExn(Belt.Result.Error(\"Invalid data\")) {\n// throw a exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getExn: t<'a, 'b> => 'a" - }, - { - "id": "Belt.Result.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(res)`: when `res` is `Ok(n)`, returns `n` when `res` is `Error(m)`, throw an exception\n\n## Examples\n\n```rescript\nBelt.Result.Ok(42)->Belt.Result.getOrThrow == 42\n\nswitch Belt.Result.getOrThrow(Belt.Result.Error(\"Invalid data\")) {\n// throw a exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getOrThrow: t<'a, 'b> => 'a" - }, - { - "id": "Belt.Result.mapWithDefaultU", - "kind": "value", - "name": "mapWithDefaultU", - "docstrings": [], - "signature": "let mapWithDefaultU: (t<'a, 'c>, 'b, 'a => 'b) => 'b", - "deprecated": "Use `mapWithDefault` instead" - }, - { - "id": "Belt.Result.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [ - "`mapWithDefault(res, default, f)`: When res is `Ok(n)`, returns `f(n)`,\notherwise `default`.\n\n## Examples\n\n```rescript\nlet ok = Belt.Result.Ok(42)\nBelt.Result.mapWithDefault(ok, 0, x => x / 2) == 21\n\nlet error = Belt.Result.Error(\"Invalid data\")\nBelt.Result.mapWithDefault(error, 0, x => x / 2) == 0\n```" - ], - "signature": "let mapWithDefault: (t<'a, 'c>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Belt.Result.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a, 'c>, 'a => 'b) => t<'b, 'c>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Result.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(res, f)`: When res is `Ok(n)`, returns `Ok(f(n))`. Otherwise returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns an\nordinary value.\n\n## Examples\n\n```rescript\nlet f = x => sqrt(Belt.Int.toFloat(x))\n\nBelt.Result.map(Ok(64), f) == Ok(8.0)\n\nBelt.Result.map(Error(\"Invalid data\"), f) == Error(\"Invalid data\")\n```" - ], - "signature": "let map: (t<'a, 'c>, 'a => 'b) => t<'b, 'c>" - }, - { - "id": "Belt.Result.flatMapU", - "kind": "value", - "name": "flatMapU", - "docstrings": [], - "signature": "let flatMapU: (t<'a, 'c>, 'a => t<'b, 'c>) => t<'b, 'c>", - "deprecated": "Use `flatMap` instead" - }, - { - "id": "Belt.Result.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(res, f)`: When res is `Ok(n)`, returns `f(n)`. Otherwise, returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns a\n`Belt.Result`.\n\n## Examples\n\n```rescript\nlet recip = x =>\n if x !== 0.0 {\n Belt.Result.Ok(1.0 /. x)\n } else {\n Belt.Result.Error(\"Divide by zero\")\n }\n\nBelt.Result.flatMap(Ok(2.0), recip) == Ok(0.5)\n\nBelt.Result.flatMap(Ok(0.0), recip) == Error(\"Divide by zero\")\n\nBelt.Result.flatMap(Error(\"Already bad\"), recip) == Error(\"Already bad\")\n```" - ], - "signature": "let flatMap: (t<'a, 'c>, 'a => t<'b, 'c>) => t<'b, 'c>" - }, - { - "id": "Belt.Result.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [ - "`getWithDefault(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`,\notherwise `default`\n\n## Examples\n\n```rescript\nBelt.Result.getWithDefault(Ok(42), 0) == 42\n\nBelt.Result.getWithDefault(Error(\"Invalid Data\"), 0) == 0\n```" - ], - "signature": "let getWithDefault: (t<'a, 'b>, 'a) => 'a" - }, - { - "id": "Belt.Result.isOk", - "kind": "value", - "name": "isOk", - "docstrings": [ - "`isOk(res)`: Returns `true` if `res` is of the form `Ok(n)`, `false` if it is\nthe `Error(e)` variant." - ], - "signature": "let isOk: t<'a, 'b> => bool" - }, - { - "id": "Belt.Result.isError", - "kind": "value", - "name": "isError", - "docstrings": [ - "`isError(res)`: Returns `true` if `res` is of the form `Error(e)`, `false` if\nit is the `Ok(n)` variant." - ], - "signature": "let isError: t<'a, 'b> => bool" - }, - { - "id": "Belt.Result.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Result.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(res1, res2, f)`: Determine if two `Belt.Result` variables are equal with\nrespect to an equality function. If `res1` and `res2` are of the form `Ok(n)`\nand `Ok(m)`, return the result of `f(n, m)`. If one of `res1` and `res2` are of\nthe form `Error(e)`, return false If both `res1` and `res2` are of the form\n`Error(e)`, return true\n\n## Examples\n\n```rescript\nlet good1 = Belt.Result.Ok(42)\n\nlet good2 = Belt.Result.Ok(32)\n\nlet bad1 = Belt.Result.Error(\"invalid\")\n\nlet bad2 = Belt.Result.Error(\"really invalid\")\n\nlet mod10equal = (a, b) => mod(a, 10) === mod(b, 10)\n\nBelt.Result.eq(good1, good2, mod10equal) == true\n\nBelt.Result.eq(good1, bad1, mod10equal) == false\n\nBelt.Result.eq(bad2, good2, mod10equal) == false\n\nBelt.Result.eq(bad1, bad2, mod10equal) == true\n```" - ], - "signature": "let eq: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Result.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Result.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(res1, res2, f)`: Compare two `Belt.Result` variables with respect to a\ncomparison function. The comparison function returns -1 if the first variable\nis \"less than\" the second, 0 if the two variables are equal, and 1 if the first\nis \"greater than\" the second.\n\nIf `res1` and `res2` are of the form `Ok(n)` and `Ok(m)`, return the result of\n`f(n, m)`. If `res1` is of the form `Error(e)` and `res2` of the form `Ok(n)`,\nreturn -1 (nothing is less than something) If `res1` is of the form `Ok(n)` and\n`res2` of the form `Error(e)`, return 1 (something is greater than nothing) If\nboth `res1` and `res2` are of the form `Error(e)`, return 0 (equal)\n\n## Examples\n\n```rescript\nlet good1 = Belt.Result.Ok(59)\n\nlet good2 = Belt.Result.Ok(37)\n\nlet bad1 = Belt.Result.Error(\"invalid\")\n\nlet bad2 = Belt.Result.Error(\"really invalid\")\n\nlet mod10cmp = (a, b) => Pervasives.compare(mod(a, 10), mod(b, 10))\n\nBelt.Result.cmp(Ok(39), Ok(57), mod10cmp) == 1\n\nBelt.Result.cmp(Ok(57), Ok(39), mod10cmp) == -1\n\nBelt.Result.cmp(Ok(39), Error(\"y\"), mod10cmp) == 1\n\nBelt.Result.cmp(Error(\"x\"), Ok(57), mod10cmp) == -1\n\nBelt.Result.cmp(Error(\"x\"), Error(\"y\"), mod10cmp) == 0\n```" - ], - "signature": "let cmp: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => int) => int" - } - ] - }, - "belt/option": { - "id": "Belt.Option", - "name": "Option", - "docstrings": [ - "[`Belt.Option`]()\n\n Utilities for option data type.", - "In Belt we represent the existence and nonexistence of a value by wrapping it\nwith the `option` type. In order to make it a bit more convenient to work with\noption-types, Belt provides utility-functions for it.\n\nThe `option` type is a part of the ReScript standard library which is defined like this:\n\n## Examples\n\n```rescript\ntype option<'a> = None | Some('a)\n```\n\n```rescript\nlet someString: option = Some(\"hello\")\n```" - ], - "items": [ - { - "id": "Belt.Option.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [ - "Uncurried version of `keep`" - ], - "signature": "let keepU: (option<'a>, 'a => bool) => option<'a>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Option.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "If `optionValue` is `Some(value)` and `p(value) = true`, it returns `Some(value)`; otherwise returns `None`\n\n## Examples\n\n```rescript\nBelt.Option.keep(Some(10), x => x > 5) == Some(10)\nBelt.Option.keep(Some(4), x => x > 5) == None\nBelt.Option.keep(None, x => x > 5) == None\n```" - ], - "signature": "let keep: (option<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Belt.Option.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Uncurried version of `forEach`" - ], - "signature": "let forEachU: (option<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Option.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "If `optionValue` is `Some(value`), it calls `f(value)`; otherwise returns `()`\n\n## Examples\n\n```rescript\nBelt.Option.forEach(Some(\"thing\"), x => Js.log(x)) /* logs \"thing\" */\nBelt.Option.forEach(None, x => Js.log(x)) /* returns () */\n```" - ], - "signature": "let forEach: (option<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.Option.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Throws an Error in case `None` is provided. Use with care.\n\n## Examples\n\n```rescript\nSome(3)->Belt.Option.getExn == 3\n\nswitch Belt.Option.getExn(None) {\n// Throws an exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getExn: option<'a> => 'a" - }, - { - "id": "Belt.Option.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Throws an Error in case `None` is provided. Use with care.\n\n## Examples\n\n```rescript\nSome(3)->Belt.Option.getOrThrow == 3\n\nswitch Belt.Option.getOrThrow(None) {\n// Throws an exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getOrThrow: option<'a> => 'a" - }, - { - "id": "Belt.Option.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(x)` returns `x`\n\nThis is an unsafe operation, it assumes `x` is neither `None`\nnor `Some(None(...)))`" - ], - "signature": "let getUnsafe: option<'a> => 'a" - }, - { - "id": "Belt.Option.mapWithDefaultU", - "kind": "value", - "name": "mapWithDefaultU", - "docstrings": [ - "Uncurried version of `mapWithDefault`" - ], - "signature": "let mapWithDefaultU: (option<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "Use `mapWithDefault` instead" - }, - { - "id": "Belt.Option.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [ - "If `optionValue` is of `Some(value)`,\nthis function returns that value applied with `f`, in other words `f(value)`.\n\nIf `optionValue` is `None`, the default is returned.\n\n## Examples\n\n```rescript\nlet someValue = Some(3)\nsomeValue->Belt.Option.mapWithDefault(0, x => x + 5) == 8\n\nlet noneValue = None\nnoneValue->Belt.Option.mapWithDefault(0, x => x + 5) == 0\n```" - ], - "signature": "let mapWithDefault: (option<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Belt.Option.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [ - "Uncurried version of `map`" - ], - "signature": "let mapU: (option<'a>, 'a => 'b) => option<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Option.map", - "kind": "value", - "name": "map", - "docstrings": [ - "If `optionValue` is `Some(value)` this returns `f(value)`, otherwise it returns `None`.\n\n## Examples\n\n```rescript\nBelt.Option.map(Some(3), x => x * x) == Some(9)\n\nBelt.Option.map(None, x => x * x) == None\n```" - ], - "signature": "let map: (option<'a>, 'a => 'b) => option<'b>" - }, - { - "id": "Belt.Option.flatMapU", - "kind": "value", - "name": "flatMapU", - "docstrings": [ - "Uncurried version of `flatMap`" - ], - "signature": "let flatMapU: (option<'a>, 'a => option<'b>) => option<'b>", - "deprecated": "Use `flatMap` instead" - }, - { - "id": "Belt.Option.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "If `optionValue` is `Some(value)`, returns `f(value)`, otherwise returns\n`None`.
\nThe function `f` must have a return type of `option<'b>`.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Some(value + 1)\n } else {\n None\n }\n\nBelt.Option.flatMap(Some(2), addIfAboveOne) == Some(3)\n\nBelt.Option.flatMap(Some(-4), addIfAboveOne) == None\n\nBelt.Option.flatMap(None, addIfAboveOne) == None\n```" - ], - "signature": "let flatMap: (option<'a>, 'a => option<'b>) => option<'b>" - }, - { - "id": "Belt.Option.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [ - "If `optionalValue` is `Some(value)`, returns `value`, otherwise default.\n\n## Examples\n\n```rescript\nBelt.Option.getWithDefault(None, \"Banana\") == \"Banana\"\n\nBelt.Option.getWithDefault(Some(\"Apple\"), \"Banana\") == \"Apple\"\n```\n\n```rescript\nlet greet = (firstName: option) =>\n \"Greetings \" ++ firstName->Belt.Option.getWithDefault(\"Anonymous\")\n\nSome(\"Jane\")->greet == \"Greetings Jane\"\n\nNone->greet == \"Greetings Anonymous\"\n```" - ], - "signature": "let getWithDefault: (option<'a>, 'a) => 'a" - }, - { - "id": "Belt.Option.orElse", - "kind": "value", - "name": "orElse", - "docstrings": [ - "`orElse(optionalValue, otherOptional)` if `optionalValue` is `Some(value)`,\nreturns `Some(value)`, otherwise `otherOptional`\n\n## Examples\n\n```rescript\nBelt.Option.orElse(Some(1812), Some(1066)) == Some(1812)\nBelt.Option.orElse(None, Some(1066)) == Some(1066)\nBelt.Option.orElse(None, None) == None\n```" - ], - "signature": "let orElse: (option<'a>, option<'a>) => option<'a>" - }, - { - "id": "Belt.Option.isSome", - "kind": "value", - "name": "isSome", - "docstrings": [ - "Returns `true` if the argument is `Some(value)`, `false` otherwise.\n\n## Examples\n\n```rescript\nBelt.Option.isSome(None) == false\n\nBelt.Option.isSome(Some(1)) == true\n```" - ], - "signature": "let isSome: option<'a> => bool" - }, - { - "id": "Belt.Option.isNone", - "kind": "value", - "name": "isNone", - "docstrings": [ - "Returns `true` if the argument is `None`, `false` otherwise.\n\n## Examples\n\n```rescript\nBelt.Option.isNone(None) == true\n\nBelt.Option.isNone(Some(1)) == false\n```" - ], - "signature": "let isNone: option<'a> => bool" - }, - { - "id": "Belt.Option.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [ - "Uncurried version of `eq`" - ], - "signature": "let eqU: (option<'a>, option<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Option.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Evaluates two optional values for equality with respect to a predicate\nfunction. If both `optValue1` and `optValue2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\n\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`predicate(value1, value2)`; the predicate function must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Belt.Option\n\neq(Some(3), Some(15), clockEqual) == true\n\neq(Some(3), None, clockEqual) == false\n\neq(None, Some(3), clockEqual) == false\n\neq(None, None, clockEqual) == true\n```" - ], - "signature": "let eq: (option<'a>, option<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Option.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [ - "Uncurried version of `cmp`" - ], - "signature": "let cmpU: (option<'a>, option<'b>, ('a, 'b) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Option.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(optValue1, optValue2, comparisonFunction)` compares two optional values\nwith respect to given `comparisonFunction`.\n\nIf both `optValue1` and `optValue2` are `None`, it returns `0`.\n\nIf the first argument is `Some(value1)` and the second is `None`, returns `1`\n(something is greater than nothing).\n\nIf the first argument is `None` and the second is `Some(value2)`, returns `-1`\n(nothing is less than something).\n\nIf the arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`comparisonFunction(value1, value2)`; comparisonFunction takes two arguments\nand returns `-1` if the first argument is less than the second, `0` if the\narguments are equal, and `1` if the first argument is greater than the second.\n\n## Examples\n\n```rescript\nlet clockCompare = (a, b) => compare(mod(a, 12), mod(b, 12))\n\nopen Belt.Option\n\ncmp(Some(3), Some(15), clockCompare) == 0\n\ncmp(Some(3), Some(14), clockCompare) == 1\n\ncmp(Some(2), Some(15), clockCompare) == -1\n\ncmp(None, Some(15), clockCompare) == -1\n\ncmp(Some(14), None, clockCompare) == 1\n\ncmp(None, None, clockCompare) == 0\n```" - ], - "signature": "let cmp: (option<'a>, option<'b>, ('a, 'b) => int) => int" - } - ] - }, - "belt/hashmap": { - "id": "Belt.HashMap", - "name": "HashMap", - "docstrings": [ - "[`Belt.HashMap`]()\n\n The top level provides generic **mutable** hash map operations.\n\n It also has two specialized inner modules\n [`Belt.HashMap.Int`]() and [`Belt.HashMap.String`]()", - "A **mutable** Hash map which allows customized [`hash`]() behavior.\n\nAll data are parameterized by not its only type but also a unique identity in\nthe time of initialization, so that two _HashMaps of ints_ initialized with different\n_hash_ functions will have different type.\n\n## Examples\n\n```rescript\ntype t = int\nmodule I0 = unpack(Belt.Id.hashable(~hash=(_: t) => 0xff_ff, ~eq=(a, b) => a == b))\nlet s0: Belt.HashMap.t = Belt.HashMap.make(~hintSize=40, ~id=module(I0))\n\nmodule I1 = unpack(Belt.Id.hashable(~hash=(_: t) => 0xff, ~eq=(a, b) => a == b))\nlet s1: Belt.HashMap.t = Belt.HashMap.make(~hintSize=40, ~id=module(I1))\n```\n\nThe invariant must be held: for two elements who are _equal_,\ntheir hashed value should be the same\n\nHere the compiler would infer `s0` and `s1` having different type so that\nit would not mix.\n\n## Examples\n\n```\nlet s0: t\nlet s1: t\n```\n\nWe can add elements to the collection:\n\n## Examples\n\n```rescript\nlet () = {\n Belt.HashMap.set(s0, 0, 3)\n Belt.HashMap.set(s1, 1, \"3\")\n}\n```\n\nSince this is an mutable data strucure, `s1` will contain two pairs." - ], - "items": [ - { - "id": "Belt.HashMap.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of hash tables from type `'key` to type `'value`." - ], - "signature": "type t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making an empty hash map." - ], - "signature": "type id<'a, 'id> = Belt_Id.hashable<'a, 'id>" - }, - { - "id": "Belt.HashMap.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(~hintSize=10, ~id)` creates a new map by taking in the comparator and `hintSize`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\n\nBelt.HashMap.set(hMap, 0, \"a\")\n```" - ], - "signature": "let make: (~hintSize: int, ~id: id<'key, 'id>) => t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Clears a hash table.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.fromArray([(1, \"1\")], ~id=module(IntHash))\nBelt.HashMap.clear(hMap)\nBelt.HashMap.isEmpty(hMap) == true\n```" - ], - "signature": "let clear: t<'key, 'value, 'id> => unit" - }, - { - "id": "Belt.HashMap.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(m)` checks whether a hash map is empty.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nBelt.HashMap.isEmpty(Belt.HashMap.fromArray([(1, \"1\")], ~id=module(IntHash))) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b, 'c> => bool" - }, - { - "id": "Belt.HashMap.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(hMap, k, v)` if `k` does not exist, add the binding `k,v`, otherwise, update the old value with the new `v`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntHash))\n\nBelt.HashMap.set(s0, 2, \"3\")\n\nBelt.HashMap.valuesToArray(s0) == [\"1\", \"3\", \"3\"]\n```" - ], - "signature": "let set: (t<'key, 'value, 'id>, 'key, 'value) => unit" - }, - { - "id": "Belt.HashMap.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Creates copy of a hash map.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntHash))\nlet s1 = Belt.HashMap.copy(s0)\n\nBelt.HashMap.set(s0, 2, \"3\")\n\n(Belt.HashMap.get(s0, 2) != Belt.HashMap.get(s1, 2)) == true\n```" - ], - "signature": "let copy: t<'key, 'value, 'id> => t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns value bound under specific key. If values not exist returns `None`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\n\nBelt.HashMap.get(s0, 1) == Some(\"value1\")\nBelt.HashMap.get(s0, 2) == None\n```" - ], - "signature": "let get: (t<'key, 'value, 'id>, 'key) => option<'value>" - }, - { - "id": "Belt.HashMap.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if `x` is bound in `tbl`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\n\nBelt.HashMap.has(s0, 1) == true\nBelt.HashMap.has(s0, 2) == false\n```" - ], - "signature": "let has: (t<'key, 'value, 'id>, 'key) => bool" - }, - { - "id": "Belt.HashMap.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "If bound exists, removes it from the hash map.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.remove(s0, 1)\nBelt.HashMap.has(s0, 1) == false\n```" - ], - "signature": "let remove: (t<'key, 'value, 'id>, 'key) => unit" - }, - { - "id": "Belt.HashMap.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as [forEach](#forEach) but takes uncurried function." - ], - "signature": "let forEachU: (t<'key, 'value, 'id>, ('key, 'value) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashMap.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(tbl, f)` applies `f` to all bindings in table `tbl`. `f` receives the key as first argument, and the associated value as second argument. Each binding is presented exactly once to `f`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.forEach(s0, (key, value) => Js.log2(key, value))\n// prints (1, \"value1\")\n```" - ], - "signature": "let forEach: (t<'key, 'value, 'id>, ('key, 'value) => unit) => unit" - }, - { - "id": "Belt.HashMap.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashMap.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(tbl, init, f)` computes `(f(kN, dN) ... (f(k1, d1, init))...)`, where `k1 ... kN` are the keys of all bindings in `tbl`, and `d1 ... dN` are the associated values. Each binding is presented exactly once to `f`.\n\nThe order in which the bindings are passed to `f` is unspecified. However, if the table contains several bindings for the same key, they are passed to `f` in reverse order of introduction, that is, the most recent binding is passed first.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\n\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\ns0->Belt.HashMap.reduce(\"\", (acc, _, value) => acc ++ (\", \" ++ value)) == \", value1, value2\"\n```\n\n## More Examples\n\n```rescript\nConsole.log(\"lol\")\n```" - ], - "signature": "let reduce: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c" - }, - { - "id": "Belt.HashMap.keepMapInPlaceU", - "kind": "value", - "name": "keepMapInPlaceU", - "docstrings": [ - "Same as [keepMapInPlace](#keepMapInPlace) but takes uncurried function." - ], - "signature": "let keepMapInPlaceU: (\n t<'key, 'value, 'id>,\n ('key, 'value) => option<'value>,\n) => unit", - "deprecated": "Use `keepMapInPlace` instead" - }, - { - "id": "Belt.HashMap.keepMapInPlace", - "kind": "value", - "name": "keepMapInPlace", - "docstrings": [ - "Filters out values for which function `f` returned `None`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.keepMapInPlace(s0, (key, value) => key == 1 ? None : Some(value))\n```" - ], - "signature": "let keepMapInPlace: (\n t<'key, 'value, 'id>,\n ('key, 'value) => option<'value>,\n) => unit" - }, - { - "id": "Belt.HashMap.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(tbl)` returns the number of bindings in `tbl`. It takes constant time.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.size(s0) == 2\n```" - ], - "signature": "let size: t<'a, 'b, 'c> => int" - }, - { - "id": "Belt.HashMap.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of key value pairs.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.toArray(s0) == [(1, \"value1\"), (2, \"value2\")]\n```" - ], - "signature": "let toArray: t<'key, 'value, 'id> => array<('key, 'value)>" - }, - { - "id": "Belt.HashMap.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "Returns array of keys.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.keysToArray(s0) == [1, 2]\n```" - ], - "signature": "let keysToArray: t<'key, 'a, 'b> => array<'key>" - }, - { - "id": "Belt.HashMap.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [ - "Returns array of values.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.valuesToArray(s0) == [\"value1\", \"value2\"]\n```" - ], - "signature": "let valuesToArray: t<'a, 'value, 'b> => array<'value>" - }, - { - "id": "Belt.HashMap.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new hash map from array of pairs.\n\nReturns array of values.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(1, \"value1\"), (2, \"value2\")], ~id=module(IntHash))\nBelt.HashMap.toArray(s0) == [(1, \"value1\"), (2, \"value2\")]\n```" - ], - "signature": "let fromArray: (\n array<('key, 'value)>,\n ~id: id<'key, 'id>,\n) => t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.mergeMany(hMap, [(1, \"1\"), (2, \"2\")])\n```" - ], - "signature": "let mergeMany: (t<'key, 'value, 'id>, array<('key, 'value)>) => unit" - }, - { - "id": "Belt.HashMap.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(hMap, 1, \"1\")\n\nBelt.HashMap.getBucketHistogram(hMap)\n```" - ], - "signature": "let getBucketHistogram: t<'a, 'b, 'c> => array" - }, - { - "id": "Belt.HashMap.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(hMap, 1, \"1\")\n\nBelt.HashMap.logStats(hMap)\n```" - ], - "signature": "let logStats: t<'a, 'b, 'c> => unit" - } - ] - }, - "belt/hashset": { - "id": "Belt.HashSet", - "name": "HashSet", - "docstrings": [ - "[`Belt.HashSet`]()\n\n The top level provides generic **mutable** hash set operations.\n\n It also has two specialized inner modules\n [`Belt.HashSet.Int`]() and [`Belt.HashSet.String`]()", - "A **mutable** Hash set which allows customized `hash` behavior.\n\nAll data are parameterized by not its only type but also a unique identity in\nthe time of initialization, so that two _HashSets of ints_ initialized with\ndifferent _hash_ functions will have different type.\n\n## Examples\n\n```rescript\nmodule I0 = unpack(Belt.Id.hashable(~hash=(a: int) => land(a, 65535), ~eq=(a, b) => a == b))\n\nlet s0 = Belt.HashSet.make(~id=module(I0), ~hintSize=40)\n\nmodule I1 = unpack(Belt.Id.hashable(~hash=(a: int) => land(a, 255), ~eq=(a, b) => a == b))\n\nlet s1 = Belt.HashSet.make(~id=module(I1), ~hintSize=40)\n\nBelt.HashSet.add(s1, 0)\nBelt.HashSet.add(s1, 1)\n```\n\nThe invariant must be held: for two elements who are equal, their hashed\nvalue should be the same.\n\nHere the compiler would infer `s0` and `s1` having different type so that it\nwould not mix.\n\nSignatures:\n\n```\nlet s0: Belt.HashSet.t\nlet s1: Belt.HashSet.t\n```\n\nWe can add elements to the collection (see last two lines in the example\nabove). Since this is an mutable data structure, `s1` will contain two pairs." - ], - "items": [ - { - "id": "Belt.HashSet.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a, 'id>" - }, - { - "id": "Belt.HashSet.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The type of hash tables from type `'a` to type `'b`." - ], - "signature": "type id<'a, 'id> = Belt_Id.hashable<'a, 'id>" - }, - { - "id": "Belt.HashSet.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int, ~id: id<'a, 'id>) => t<'a, 'id>" - }, - { - "id": "Belt.HashSet.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a, 'id> => unit" - }, - { - "id": "Belt.HashSet.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.HashSet.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t<'a, 'id>, 'a) => unit" - }, - { - "id": "Belt.HashSet.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a, 'id> => t<'a, 'id>" - }, - { - "id": "Belt.HashSet.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a, 'id>, 'a) => bool" - }, - { - "id": "Belt.HashSet.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t<'a, 'id>, 'a) => unit" - }, - { - "id": "Belt.HashSet.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a, 'id>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashSet.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Order unspecified." - ], - "signature": "let forEach: (t<'a, 'id>, 'a => unit) => unit" - }, - { - "id": "Belt.HashSet.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a, 'id>, 'c, ('c, 'a) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashSet.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Order unspecified." - ], - "signature": "let reduce: (t<'a, 'id>, 'c, ('c, 'a) => 'c) => 'c" - }, - { - "id": "Belt.HashSet.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a, 'id> => int" - }, - { - "id": "Belt.HashSet.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t<'a, 'b> => unit" - }, - { - "id": "Belt.HashSet.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'a, 'id> => array<'a>" - }, - { - "id": "Belt.HashSet.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: (array<'a>, ~id: id<'a, 'id>) => t<'a, 'id>" - }, - { - "id": "Belt.HashSet.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'a, 'id>, array<'a>) => unit" - }, - { - "id": "Belt.HashSet.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t<'a, 'b> => array" - } - ] - }, - "belt/mutablemap": { - "id": "Belt.MutableMap", - "name": "MutableMap", - "docstrings": [ - "[`Belt.MutableMap`]()\n\n The top level provides generic **mutable** map operations.\n\n It also has two specialized inner modules\n [`Belt.MutableMap.Int`]() and [`Belt.MutableMap.String`]()" - ], - "items": [ - { - "id": "Belt.MutableMap.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v, 'id>" - }, - { - "id": "Belt.MutableMap.id", - "kind": "type", - "name": "id", - "docstrings": [], - "signature": "type id<'key, 'id> = Belt_Id.comparable<'key, 'id>" - }, - { - "id": "Belt.MutableMap.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~id: id<'k, 'id>) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.MutableMap.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a, 'b, 'c> => unit" - }, - { - "id": "Belt.MutableMap.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a, 'b, 'c> => bool" - }, - { - "id": "Belt.MutableMap.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'k, 'a, 'b>, 'k) => bool" - }, - { - "id": "Belt.MutableMap.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.MutableMap.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m1, m2, cmp)` First compare by size, if size is the same, compare by\nkey, value pair." - ], - "signature": "let cmp: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.MutableMap.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.MutableMap.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, eqf)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `eqf` is the\nequality predicate used to compare the data associated with the keys." - ], - "signature": "let eq: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableMap.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies f to all bindings in map `m`. `f` receives the `'k`\nas first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys." - ], - "signature": "let forEach: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit" - }, - { - "id": "Belt.MutableMap.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableMap.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f), computes`(f(kN, dN) ... (f(k1, d1, a))...)`, where`k1 ...\nkN`are the keys of all bindings in`m`(in increasing order), and`d1 ... dN`\nare the associated data." - ], - "signature": "let reduce: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableMap.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableMap.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`." - ], - "signature": "let every: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableMap.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`." - ], - "signature": "let some: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'k, 'a, 'id> => int" - }, - { - "id": "Belt.MutableMap.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'k, 'a, 'id> => list<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'k, 'a, 'id> => array<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: (array<('k, 'a)>, ~id: id<'k, 'id>) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.MutableMap.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'k, 'a, 'b> => array<'k>" - }, - { - "id": "Belt.MutableMap.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'b, 'a, 'c> => array<'a>" - }, - { - "id": "Belt.MutableMap.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.MutableMap.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.MutableMap.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.MutableMap.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.MutableMap.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'k, 'a, 'id>, 'k) => option<'a>" - }, - { - "id": "Belt.MutableMap.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'k, 'a, 'id>, 'k) => Js.undefined<'a>" - }, - { - "id": "Belt.MutableMap.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'k, 'a, 'id>, 'k, 'a) => 'a" - }, - { - "id": "Belt.MutableMap.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'k, 'a, 'id>, 'k) => 'a" - }, - { - "id": "Belt.MutableMap.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'k, 'a, 'id>, 'k) => 'a" - }, - { - "id": "Belt.MutableMap.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "Throw when invariant is not held." - ], - "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit" - }, - { - "id": "Belt.MutableMap.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` do the in-place modification." - ], - "signature": "let remove: (t<'k, 'a, 'id>, 'k) => unit" - }, - { - "id": "Belt.MutableMap.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'k, 'a, 'id>, array<'k>) => unit" - }, - { - "id": "Belt.MutableMap.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` do the in-place modification" - ], - "signature": "let set: (t<'k, 'a, 'id>, 'k, 'a) => unit" - }, - { - "id": "Belt.MutableMap.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'k, 'a, 'id>, 'k, option<'a> => option<'a>) => unit", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.MutableMap.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'k, 'a, 'id>, 'k, option<'a> => option<'a>) => unit" - }, - { - "id": "Belt.MutableMap.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'k, 'a, 'id>, array<('k, 'a)>) => unit" - }, - { - "id": "Belt.MutableMap.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableMap.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated\nvalue a of all bindings of `m` has been replaced by the result of the\napplication of `f` to `a`. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let map: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>" - }, - { - "id": "Belt.MutableMap.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.MutableMap.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>" - } - ] - }, - "belt/mutableset": { - "id": "Belt.MutableSet", - "name": "MutableSet", - "docstrings": [ - "[`Belt.MutableSet`]()\n\n The top level provides generic **mutable** set operations.\n\n It also has two specialized inner modules\n [`Belt.MutableSet.Int`]() and [`Belt.MutableSet.String`]()", - "A **mutable** sorted set module which allows customized compare behavior.\nThe implementation uses balanced binary trees, and therefore searching and insertion take time logarithmic in the size of the map.\n\nIt also has two specialized inner modules [Belt.MutableSet.Int](mutable-set-int) and [Belt.MutableSet.String](mutable-set-string) - This module separates data from function which is more verbose but slightly more efficient\n\n## Examples\n\n```rescript\nmodule PairComparator = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet = Belt.MutableSet.make(~id=module(PairComparator))\nmySet->Belt.MutableSet.add((1, 2))\n```" - ], - "items": [ - { - "id": "Belt.MutableSet.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'value, 'identity>" - }, - { - "id": "Belt.MutableSet.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making a set from scratch" - ], - "signature": "type id<'value, 'id> = Belt_Id.comparable<'value, 'id>" - }, - { - "id": "Belt.MutableSet.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new set by taking in the comparator" - ], - "signature": "let make: (~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let fromArray: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [ - "The same as [fromArray][#fromarray] except it is after assuming the input array is already sorted." - ], - "signature": "let fromSortedArrayUnsafe: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Returns copy of a set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\nlet copied = s0->Belt.MutableSet.copy\ncopied->Belt.MutableSet.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let copy: t<'value, 'id> => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.MutableSet.fromArray([], ~id=module(IntCmp))\nlet notEmpty = Belt.MutableSet.fromArray([1], ~id=module(IntCmp))\n\nBelt.MutableSet.isEmpty(empty) == true\nBelt.MutableSet.isEmpty(notEmpty) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.MutableSet.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if element exists in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.fromArray([1, 4, 2, 5], ~id=module(IntCmp))\n\nset->Belt.MutableSet.has(3) == false\nset->Belt.MutableSet.has(1) == true\n```" - ], - "signature": "let has: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.MutableSet.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\ns0->Belt.MutableSet.add(1)\ns0->Belt.MutableSet.add(2)\ns0->Belt.MutableSet.add(2)\n\ns0->Belt.MutableSet.toArray == [1, 2]\n```" - ], - "signature": "let add: (t<'value, 'id>, 'value) => unit" - }, - { - "id": "Belt.MutableSet.addCheck", - "kind": "value", - "name": "addCheck", - "docstrings": [], - "signature": "let addCheck: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.MutableSet.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "Adds each element of array to set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.make(~id=module(IntCmp))\n\nset->Belt.MutableSet.mergeMany([5, 4, 3, 2, 1])\nset->Belt.MutableSet.toArray == [1, 2, 3, 4, 5]\n```" - ], - "signature": "let mergeMany: (t<'value, 'id>, array<'value>) => unit" - }, - { - "id": "Belt.MutableSet.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([2, 3, 1, 4, 5], ~id=module(IntCmp))\ns0->Belt.MutableSet.remove(1)\ns0->Belt.MutableSet.remove(3)\ns0->Belt.MutableSet.remove(3)\n\ns0->Belt.MutableSet.toArray == [2, 4, 5]\n```" - ], - "signature": "let remove: (t<'value, 'id>, 'value) => unit" - }, - { - "id": "Belt.MutableSet.removeCheck", - "kind": "value", - "name": "removeCheck", - "docstrings": [], - "signature": "let removeCheck: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.MutableSet.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "Removes each element of array from set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\nset->Belt.MutableSet.removeMany([5, 4, 3, 2, 1])\nset->Belt.MutableSet.toArray == []\n```" - ], - "signature": "let removeMany: (t<'value, 'id>, array<'value>) => unit" - }, - { - "id": "Belt.MutableSet.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet union = Belt.MutableSet.union(s0, s1)\nunion->Belt.MutableSet.toArray == [1, 2, 3, 4, 5, 6]\n```" - ], - "signature": "let union: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet intersect = Belt.MutableSet.intersect(s0, s1)\nintersect->Belt.MutableSet.toArray == [2, 3, 5]\n```" - ], - "signature": "let intersect: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.diff", - "kind": "value", - "name": "diff", - "docstrings": [ - "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nBelt.MutableSet.toArray(Belt.MutableSet.diff(s0, s1)) == [6]\nBelt.MutableSet.toArray(Belt.MutableSet.diff(s1, s0)) == [1, 4]\n```" - ], - "signature": "let diff: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet s2 = Belt.MutableSet.intersect(s0, s1)\nBelt.MutableSet.subset(s2, s0) == true\nBelt.MutableSet.subset(s2, s1) == true\nBelt.MutableSet.subset(s1, s0) == false\n```" - ], - "signature": "let subset: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.MutableSet.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets of sets.\nIt compares size first and then iterates over each element following the order of elements." - ], - "signature": "let cmp: (t<'value, 'id>, t<'value, 'id>) => int" - }, - { - "id": "Belt.MutableSet.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 5], ~id=module(IntCmp))\n\nBelt.MutableSet.eq(s0, s1) == true\n```" - ], - "signature": "let eq: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.MutableSet.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as `Belt.MutableSet.forEach` but takes uncurried functon." - ], - "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableSet.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet acc = ref(list{})\ns0->Belt.MutableSet.forEach(x => acc := Belt.List.add(acc.contents, x))\nacc.contents == list{6, 5, 3, 2}\n```" - ], - "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit" - }, - { - "id": "Belt.MutableSet.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableSet.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\ns0->Belt.MutableSet.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) ==\n list{6, 5, 3, 2}\n```" - ], - "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a" - }, - { - "id": "Belt.MutableSet.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableSet.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.MutableSet.fromArray([2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.MutableSet.every(isEven) == true\n```" - ], - "signature": "let every: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.MutableSet.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableSet.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.MutableSet.some(isOdd) == true\n```" - ], - "signature": "let some: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.MutableSet.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.MutableSet.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.MutableSet.keep(isEven)\n\ns1->Belt.MutableSet.toArray == [2, 4]\n```" - ], - "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.MutableSet.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet (s1, s2) = s0->Belt.MutableSet.partition(isOdd)\n\ns1->Belt.MutableSet.toArray == [1, 3, 5]\ns2->Belt.MutableSet.toArray == [2, 4]\n```" - ], - "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)" - }, - { - "id": "Belt.MutableSet.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.size == 4\n```" - ], - "signature": "let size: t<'value, 'id> => int" - }, - { - "id": "Belt.MutableSet.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toList == list{1, 2, 3, 5}\n```" - ], - "signature": "let toList: t<'value, 'id> => list<'value>" - }, - { - "id": "Belt.MutableSet.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toArray == [1, 2, 3, 5]\n```" - ], - "signature": "let toArray: t<'value, 'id> => array<'value>" - }, - { - "id": "Belt.MutableSet.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.minimum == None\ns1->Belt.MutableSet.minimum == Some(1)\n```" - ], - "signature": "let minimum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.MutableSet.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "Returns minimum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.minUndefined == Js.undefined\ns1->Belt.MutableSet.minUndefined == Js.Undefined.return(1)\n```" - ], - "signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.MutableSet.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.maximum == None\ns1->Belt.MutableSet.maximum == Some(5)\n```" - ], - "signature": "let maximum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.MutableSet.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "Returns maximum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.maxUndefined == Js.undefined\ns1->Belt.MutableSet.maxUndefined == Js.Undefined.return(5)\n```" - ], - "signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.MutableSet.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the reference of the value which is equivalent to value using the comparator specifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.get(3) == Some(3)\ns0->Belt.MutableSet.get(20) == None\n```" - ], - "signature": "let get: (t<'value, 'id>, 'value) => option<'value>" - }, - { - "id": "Belt.MutableSet.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "Same as `Belt.MutableSet.get` but returns `undefined` when element does not exist." - ], - "signature": "let getUndefined: (t<'value, 'id>, 'value) => Js.undefined<'value>" - }, - { - "id": "Belt.MutableSet.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as `Belt.MutableSet.get` but throw when element does not exist." - ], - "signature": "let getExn: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.MutableSet.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as `Belt.MutableSet.get` but throw when element does not exist." - ], - "signature": "let getOrThrow: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.MutableSet.split", - "kind": "value", - "name": "split", - "docstrings": [ - "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\nlet ((smaller, larger), present) = s0->Belt.MutableSet.split(3)\n\npresent == true\nsmaller->Belt.MutableSet.toArray == [1, 2]\nlarger->Belt.MutableSet.toArray == [4, 5]\n```" - ], - "signature": "let split: (\n t<'value, 'id>,\n 'value,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)" - }, - { - "id": "Belt.MutableSet.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b> => unit" - } - ] - }, - "belt/map": { - "id": "Belt.Map", - "name": "Map", - "docstrings": [ - "[`Belt.Map`](),\n\n The top level provides generic **immutable** map operations.\n\n It also has three specialized inner modules\n [`Belt.Map.Int`](), [`Belt.Map.String`]() and\n\n [`Belt.Map.Dict`](): This module separates data from function\n which is more verbose but slightly more efficient", - "The top level provides generic immutable map operations.\n\nIt also has three specialized inner modules `Belt.Map.Int`, `Belt.Map.String`\nand `Belt.Map.Dict`." - ], - "items": [ - { - "id": "Belt.Map.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'key` is the field type\n\n`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'key, 'value, 'identity>" - }, - { - "id": "Belt.Map.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making an empty map." - ], - "signature": "type id<'key, 'id> = Belt_Id.comparable<'key, 'id>" - }, - { - "id": "Belt.Map.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(~id)` creates a new map by taking in the comparator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet m = Belt.Map.make(~id=module(IntCmp))\n\nBelt.Map.set(m, 0, \"a\")\n```" - ], - "signature": "let make: (~id: id<'k, 'id>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(m)` checks whether a map m is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.isEmpty(Belt.Map.fromArray([(1, \"1\")], ~id=module(IntCmp))) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b, 'c> => bool" - }, - { - "id": "Belt.Map.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(m, k)` checks whether `m` has the key `k`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.has(Belt.Map.fromArray([(1, \"1\")], ~id=module(IntCmp)), 1) == true\n```" - ], - "signature": "let has: (t<'k, 'v, 'id>, 'k) => bool" - }, - { - "id": "Belt.Map.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m0, m1, vcmp);`\n\nTotal ordering of map given total ordering of value function.\n\nIt will compare size first and each element following the order one by one." - ], - "signature": "let cmp: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => int) => int" - }, - { - "id": "Belt.Map.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "eq(m1, m2, veq)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `veq` is the\nequality predicate used to compare the data associated with the keys." - ], - "signature": "let eq: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`\nfindFirstBy(m, p)` uses function `f` to find the first key value pair to match predicate `p`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"\")])\n\ns0->Belt.Map.findFirstBy((k, _) => k == 4) == Some(4, \"4\")\n```" - ], - "signature": "let findFirstBy: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>" - }, - { - "id": "Belt.Map.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'k, 'v, 'id>, ('k, 'v) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the\n`'k` as first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")])\n\nlet acc = ref(list{})\n\nBelt.Map.forEach(s0, (k, v) => acc := list{(k, v), ...acc.contents})\n\nacc.contents == list{(4, \"4\"), (3, \"3\"), (2, \"2\"), (1, \"1\")}\n```" - ], - "signature": "let forEach: (t<'k, 'v, 'id>, ('k, 'v) => unit) => unit" - }, - { - "id": "Belt.Map.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'k, 'v, 'id>, 'acc, ('acc, 'k, 'v) => 'acc) => 'acc", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f(kN, dN) ... (f(k1, d1, a))...)`, where `k1\n... kN` are the keys of all bindings in m (in increasing order), and `d1\n... dN` are the associated data.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")])\n\nBelt.Map.reduce(s0, list{}, (acc, k, v) => list{(k, v), ...acc}) ==\n list{(4, \"4\"), (3, \"3\"), (2, \"2\"), (1, \"1\")}\n```" - ], - "signature": "let reduce: (t<'k, 'v, 'id>, 'acc, ('acc, 'k, 'v) => 'acc) => 'acc" - }, - { - "id": "Belt.Map.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let every: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate \n`p`. Order unspecified" - ], - "signature": "let some: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(s)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.size(Belt.Map.fromArray([(2, \"2\"), (2, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == 2\n```" - ], - "signature": "let size: t<'k, 'v, 'id> => int" - }, - { - "id": "Belt.Map.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(s)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.toArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n (1, \"1\"),\n (2, \"2\"),\n (3, \"3\"),\n ]\n```" - ], - "signature": "let toArray: t<'k, 'v, 'id> => array<('k, 'v)>" - }, - { - "id": "Belt.Map.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order. See `Belt.Map.toArray`" - ], - "signature": "let toList: t<'k, 'v, 'id> => list<('k, 'v)>" - }, - { - "id": "Belt.Map.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(kvs, ~id);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.toArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n (1, \"1\"),\n (2, \"2\"),\n (3, \"3\"),\n ]\n```" - ], - "signature": "let fromArray: (array<('k, 'v)>, ~id: id<'k, 'id>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "`keysToArray(s);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.keysToArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n 1,\n 2,\n 3,\n ]\n```" - ], - "signature": "let keysToArray: t<'k, 'v, 'id> => array<'k>" - }, - { - "id": "Belt.Map.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [ - "`valuesToArray(s);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.valuesToArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n \"1\",\n \"2\",\n \"3\",\n ]\n```" - ], - "signature": "let valuesToArray: t<'k, 'v, 'id> => array<'v>" - }, - { - "id": "Belt.Map.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [ - "`minKey(s)` returns the minimum key, None if not exist." - ], - "signature": "let minKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [ - "See `Belt.Map.minKey`" - ], - "signature": "let minKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [ - "`maxKey(s)` returns the maximum key, None if not exist." - ], - "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [ - "See `Belt.Map.maxKey`" - ], - "signature": "let maxKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "`minimum(s)` returns the minimum key value pair, None if not exist." - ], - "signature": "let minimum: t<'k, 'v, 'a> => option<('k, 'v)>" - }, - { - "id": "Belt.Map.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "See `Belt.Map.minimum`" - ], - "signature": "let minUndefined: t<'k, 'v, 'a> => Js.undefined<('k, 'v)>" - }, - { - "id": "Belt.Map.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "`maximum(s)` returns the maximum key value pair, None if not exist." - ], - "signature": "let maximum: t<'k, 'v, 'a> => option<('k, 'v)>" - }, - { - "id": "Belt.Map.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "See `Belt.Map.maximum`" - ], - "signature": "let maxUndefined: t<'k, 'v, 'a> => Js.undefined<('k, 'v)>" - }, - { - "id": "Belt.Map.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(s, k)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.get(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp)), 2) == Some(\"2\")\n\nBelt.Map.get(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp)), 4) == None\n```" - ], - "signature": "let get: (t<'k, 'v, 'id>, 'k) => option<'v>" - }, - { - "id": "Belt.Map.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "See `Belt.Map.get`. Returns `undefined` when not found" - ], - "signature": "let getUndefined: (t<'k, 'v, 'id>, 'k) => Js.undefined<'v>" - }, - { - "id": "Belt.Map.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [ - "`getWithDefault(s, k, default)`\n\nSee `Belt.Map.get`\n\nReturns default when `k` is not found." - ], - "signature": "let getWithDefault: (t<'k, 'v, 'id>, 'k, 'v) => 'v" - }, - { - "id": "Belt.Map.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(s, k)`\n\nSee `Belt.Map.get`\n\nthrow when `k` not exist" - ], - "signature": "let getExn: (t<'k, 'v, 'id>, 'k) => 'v" - }, - { - "id": "Belt.Map.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(s, k)`\n\nSee `Belt.Map.get`\n\nthrow when `k` not exist" - ], - "signature": "let getOrThrow: (t<'k, 'v, 'id>, 'k) => 'v" - }, - { - "id": "Belt.Map.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` when `x` is not in `m`, `m` is returned reference unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))\n\nlet s1 = Belt.Map.remove(s0, 1)\n\nlet s2 = Belt.Map.remove(s1, 1)\n\ns1 == s2\n\nBelt.Map.keysToArray(s1) == [2, 3]\n```" - ], - "signature": "let remove: (t<'k, 'v, 'id>, 'k) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "`removeMany(s, xs)`\n\nRemoving each of `xs` to `s`, note unlike `Belt.Map.remove`, the reference\nof return value might be changed even if none in `xs` exists `s`." - ], - "signature": "let removeMany: (t<'k, 'v, 'id>, array<'k>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as `m`, with a\nnew binding of `x` to `y`. If `x` was already bound in `m`, its previous\nbinding disappears.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))\n\nlet s1 = Belt.Map.set(s0, 2, \"3\")\n\nBelt.Map.valuesToArray(s1) == [\"1\", \"3\", \"3\"]\n```" - ], - "signature": "let set: (t<'k, 'v, 'id>, 'k, 'v) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (\n t<'k, 'v, 'id>,\n 'k,\n option<'v> => option<'v>,\n) => t<'k, 'v, 'id>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.update", - "kind": "value", - "name": "update", - "docstrings": [ - "`update(m, x, f)` returns a map containing the same bindings as `m`, except\nfor the binding of `x`. Depending on the value of `y` where `y` is\n`f(get(m, x))`, the binding of `x` is added, removed or updated. If `y` is\n`None`, the binding is removed if it exists; otherwise, if `y` is `Some(z)`\nthen `x` is associated to `z` in the resulting map." - ], - "signature": "let update: (\n t<'k, 'v, 'id>,\n 'k,\n option<'v> => option<'v>,\n) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "`mergeMany(s, xs)`\n\nAdding each of `xs` to `s`, note unlike `add`, the reference of return\nvalue might be changed even if all values in `xs` exist `s`." - ], - "signature": "let mergeMany: (t<'k, 'v, 'id>, array<('k, 'v)>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'k, 'v, 'id>,\n t<'k, 'v2, 'id>,\n ('k, option<'v>, option<'v2>) => option<'v3>,\n) => t<'k, 'v3, 'id>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'k, 'v, 'id>,\n t<'k, 'v2, 'id>,\n ('k, option<'v>, option<'v2>) => option<'v3>,\n) => t<'k, 'v3, 'id>" - }, - { - "id": "Belt.Map.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => t<'k, 'v, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in m that satisfy\npredicate `p`." - ], - "signature": "let keep: (t<'k, 'v, 'id>, ('k, 'v) => bool) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'k, 'v, 'id>,\n ('k, 'v) => bool,\n) => (t<'k, 'v, 'id>, t<'k, 'v, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains\nall the bindings of `s` that satisfy the predicate `p`, and `m2` is the map\nwith all the bindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (\n t<'k, 'v, 'id>,\n ('k, 'v) => bool,\n) => (t<'k, 'v, 'id>, t<'k, 'v, 'id>)" - }, - { - "id": "Belt.Map.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a tuple `(l, r)`, data, where `l` is the map with all\nthe bindings of `m` whose 'k is strictly less than `x`; `r` is the map with\nall the bindings of m whose 'k is strictly greater than `x`; `data` is\n`None` if `m` contains no binding for `x`, or `Some(v)` if `m` binds `v` to\n`x`." - ], - "signature": "let split: (\n t<'k, 'v, 'id>,\n 'k,\n) => ((t<'k, 'v, 'id>, t<'k, 'v, 'id>), option<'v>)" - }, - { - "id": "Belt.Map.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'k, 'v, 'id>, 'v => 'v2) => t<'k, 'v2, 'id>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'k, 'v, 'id>, 'v => 'v2) => t<'k, 'v2, 'id>" - }, - { - "id": "Belt.Map.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'k, 'v, 'id>, ('k, 'v) => 'v2) => t<'k, 'v2, 'id>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [ - "`mapWithKey(m, f)`\n\nThe same as `Belt.Map.map` except that `f` is supplied with one more\nargument: the key." - ], - "signature": "let mapWithKey: (t<'k, 'v, 'id>, ('k, 'v) => 'v2) => t<'k, 'v2, 'id>" - }, - { - "id": "Belt.Map.getData", - "kind": "value", - "name": "getData", - "docstrings": [ - "`getData(s0)`\n\nAdvanced usage only\n\nReturns the raw data (detached from comparator), but its type is still\nmanifested, so that user can pass identity directly without boxing." - ], - "signature": "let getData: t<'k, 'v, 'id> => Belt_MapDict.t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.getId", - "kind": "value", - "name": "getId", - "docstrings": [ - "Advanced usage only. Returns the identity of s0." - ], - "signature": "let getId: t<'k, 'v, 'id> => id<'k, 'id>" - }, - { - "id": "Belt.Map.packIdData", - "kind": "value", - "name": "packIdData", - "docstrings": [ - "`packIdData(~id, ~data)`\n\nAdvanced usage only\n\nReturns the packed collection." - ], - "signature": "let packIdData: (\n ~id: id<'k, 'id>,\n ~data: Belt_MapDict.t<'k, 'v, 'id>,\n) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit" - } - ] - }, - "belt/set": { - "id": "Belt.Set", - "name": "Set", - "docstrings": [ - "[`Belt.Set`]()\n\n The top level provides generic **immutable** set operations.\n\n It also has three specialized inner modules\n [`Belt.Set.Int`](), [`Belt.Set.String`]() and\n\n [`Belt.Set.Dict`](): This module separates data from function\n which is more verbose but slightly more efficient", - "An _immutable_ sorted set module which allows customized _compare_ behavior.\n\nThe implementation uses balanced binary trees, and therefore searching\nand insertion take time logarithmic in the size of the map.\n\nFor more info on this module's usage of identity, `make` and others, please see\nthe top level documentation of Belt, **A special encoding for collection safety**.\n\n## Examples\n\n```rescript\nmodule PairComparator = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet = Belt.Set.make(~id=module(PairComparator))\nlet mySet2 = Belt.Set.add(mySet, (1, 2))\n```\n\n**Note:** This module's examples will assume a predeclared module for integers\ncalled `IntCmp`. It is declared like this:\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n```" - ], - "items": [ - { - "id": "Belt.Set.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'value, 'identity>" - }, - { - "id": "Belt.Set.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making a set from scratch" - ], - "signature": "type id<'value, 'id> = Belt_Id.comparable<'value, 'id>" - }, - { - "id": "Belt.Set.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new set by taking in the comparator\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.make(~id=module(IntCmp))\n\nBelt.Set.isEmpty(set) == true\n```" - ], - "signature": "let make: (~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\ns0->Belt.Set.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let fromArray: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [ - "The same as [fromArray][#fromarray] except it is after assuming the input array\nis already sorted." - ], - "signature": "let fromSortedArrayUnsafe: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.Set.fromArray([], ~id=module(IntCmp))\nlet notEmpty = Belt.Set.fromArray([1], ~id=module(IntCmp))\n\nBelt.Set.isEmpty(empty) == true\nBelt.Set.isEmpty(notEmpty) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.Set.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if element exists in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.fromArray([1, 4, 2, 5], ~id=module(IntCmp))\n\nset->Belt.Set.has(3) == false\nset->Belt.Set.has(1) == true\n```" - ], - "signature": "let has: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.Set.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\n\nlet s1 = s0->Belt.Set.add(1)\nlet s2 = s1->Belt.Set.add(2)\nlet s3 = s2->Belt.Set.add(2)\n\ns0->Belt.Set.toArray == []\ns1->Belt.Set.toArray == [1]\ns2->Belt.Set.toArray == [1, 2]\ns3->Belt.Set.toArray == [1, 2]\ns2 == s3\n```" - ], - "signature": "let add: (t<'value, 'id>, 'value) => t<'value, 'id>" - }, - { - "id": "Belt.Set.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "Adds each element of array to set. Unlike `Belt.Set.add`\\](\\#add), the reference of return value might be changed even if all values in array already exist in set\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.make(~id=module(IntCmp))\n\nlet newSet = set->Belt.Set.mergeMany([5, 4, 3, 2, 1])\n\nnewSet->Belt.Set.toArray == [1, 2, 3, 4, 5]\n```" - ], - "signature": "let mergeMany: (t<'value, 'id>, array<'value>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([2, 3, 1, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.Set.remove(1)\nlet s2 = s1->Belt.Set.remove(3)\nlet s3 = s2->Belt.Set.remove(3)\n\ns1->Belt.Set.toArray == [2, 3, 4, 5]\ns2->Belt.Set.toArray == [2, 4, 5]\ns2 == s3\n```" - ], - "signature": "let remove: (t<'value, 'id>, 'value) => t<'value, 'id>" - }, - { - "id": "Belt.Set.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "Removes each element of array from set. Unlike [remove](#remove), the reference of return value might be changed even if none of values in array existed in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\nlet newSet = set->Belt.Set.removeMany([5, 4, 3, 2, 1])\n\nnewSet->Belt.Set.toArray == []\n```" - ], - "signature": "let removeMany: (t<'value, 'id>, array<'value>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet union = Belt.Set.union(s0, s1)\n\nunion->Belt.Set.toArray == [1, 2, 3, 4, 5, 6]\n```" - ], - "signature": "let union: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\n\nlet intersect = Belt.Set.intersect(s0, s1)\n\nintersect->Belt.Set.toArray == [2, 3, 5]\n```" - ], - "signature": "let intersect: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.diff", - "kind": "value", - "name": "diff", - "docstrings": [ - "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\n\nBelt.Set.diff(s0, s1)->Belt.Set.toArray == [6]\n\nBelt.Set.diff(s1, s0)->Belt.Set.toArray == [1, 4]\n```" - ], - "signature": "let diff: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet s2 = Belt.Set.intersect(s0, s1)\n\nBelt.Set.subset(s2, s0) == true\nBelt.Set.subset(s2, s1) == true\nBelt.Set.subset(s1, s0) == false\n```" - ], - "signature": "let subset: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.Set.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets. It compares size first and then iterates over each element following\nthe order of elements." - ], - "signature": "let cmp: (t<'value, 'id>, t<'value, 'id>) => int" - }, - { - "id": "Belt.Set.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 5], ~id=module(IntCmp))\n\nBelt.Set.eq(s0, s1) == true\n```" - ], - "signature": "let eq: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.Set.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as [forEach](#forEach) but takes uncurried functon." - ], - "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\n\nlet acc = ref(list{})\n\ns0->Belt.Set.forEach(x => {\n acc := Belt.List.add(acc.contents, x)\n})\n\nacc.contents == list{6, 5, 3, 2}\n```" - ], - "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit" - }, - { - "id": "Belt.Set.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\ns0->Belt.Set.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) == list{6, 5, 3, 2}\n```" - ], - "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a" - }, - { - "id": "Belt.Set.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.fromArray([2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.Set.every(isEven) == true\n```" - ], - "signature": "let every: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.fromArray([1, 2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.Set.some(isOdd) == true\n```" - ], - "signature": "let some: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.Set.keep(isEven)\n\ns1->Belt.Set.toArray == [2, 4]\n```" - ], - "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>" - }, - { - "id": "Belt.Set.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "Returns a pair of sets, where first is the set of all the elements of set that satisfy the predicate, and second is the set of all the elements of set that do not satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet (s1, s2) = s0->Belt.Set.partition(isOdd)\n\ns1->Belt.Set.toArray == [1, 3, 5]\ns2->Belt.Set.toArray == [2, 4]\n```" - ], - "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)" - }, - { - "id": "Belt.Set.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\ns0->Belt.Set.size == 4\n```" - ], - "signature": "let size: t<'value, 'id> => int" - }, - { - "id": "Belt.Set.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.toArray == [1, 2, 3, 5]\n```" - ], - "signature": "let toArray: t<'value, 'id> => array<'value>" - }, - { - "id": "Belt.Set.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.toList == list{1, 2, 3, 5}\n```" - ], - "signature": "let toList: t<'value, 'id> => list<'value>" - }, - { - "id": "Belt.Set.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.minimum == None\ns1->Belt.Set.minimum == Some(1)\n```" - ], - "signature": "let minimum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "Returns minimum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.minUndefined->Js.Undefined.toOption == None\ns1->Belt.Set.minUndefined->Js.Undefined.toOption == Some(1)\n```" - ], - "signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.maximum == None\ns1->Belt.Set.maximum == Some(5)\n```" - ], - "signature": "let maximum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "Returns maximum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0\n->Belt.Set.maxUndefined\n->Js.Undefined.toOption == None\n\ns1\n->Belt.Set.maxUndefined\n->Js.Undefined.toOption == Some(5)\n```" - ], - "signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the reference of the value which is equivalent to value using the comparator specifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.get(3) == Some(3)\ns0->Belt.Set.get(20) == None\n```" - ], - "signature": "let get: (t<'value, 'id>, 'value) => option<'value>" - }, - { - "id": "Belt.Set.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "Same as [get](#get) but returns `undefined` when element does not exist." - ], - "signature": "let getUndefined: (t<'value, 'id>, 'value) => Js.undefined<'value>" - }, - { - "id": "Belt.Set.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getExn: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.Set.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getOrThrow: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.Set.split", - "kind": "value", - "name": "split", - "docstrings": [ - "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\nlet ((smaller, larger), present) = s0->Belt.Set.split(3)\n\npresent == true\nsmaller->Belt.Set.toArray == [1, 2]\nlarger->Belt.Set.toArray == [4, 5]\n```" - ], - "signature": "let split: (\n t<'value, 'id>,\n 'value,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)" - }, - { - "id": "Belt.Set.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b> => unit" - }, - { - "id": "Belt.Set.getData", - "kind": "value", - "name": "getData", - "docstrings": [ - "**Advanced usage only**\n\nReturns the raw data (detached from comparator), but its type is still manifested,\nso that user can pass identity directly without boxing." - ], - "signature": "let getData: t<'value, 'id> => Belt_SetDict.t<'value, 'id>" - }, - { - "id": "Belt.Set.getId", - "kind": "value", - "name": "getId", - "docstrings": [ - "**Advanced usage only**\n\nReturns the identity of set." - ], - "signature": "let getId: t<'value, 'id> => id<'value, 'id>" - }, - { - "id": "Belt.Set.packIdData", - "kind": "value", - "name": "packIdData", - "docstrings": [ - "**Advanced usage only**\n\nReturns the packed collection." - ], - "signature": "let packIdData: (\n ~id: id<'value, 'id>,\n ~data: Belt_SetDict.t<'value, 'id>,\n) => t<'value, 'id>" - } - ] - }, - "belt/range": { - "id": "Belt.Range", - "name": "Range", - "docstrings": [ - "[`Belt.Range`]()\n\n Utilities for a closed range `(from, start)`", - "A small utility module to provide inclusive range operations for `[start, finish]`.\nInternally it is relying on loops instead of creating new arrays, which makes it\npretty performant and memory friendly." - ], - "items": [ - { - "id": "Belt.Range.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (int, int, int => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Range.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(start, finish, action)` equivalent to `Belt.Array.forEach(Belt.Array.range(start, finish), action))`\n\n## Examples\n\n```rescript\nBelt.Range.forEach(0, 4, i => Js.log(i))\n\n// Prints:\n// 0\n// 1\n// 2\n// 3\n// 4\n```" - ], - "signature": "let forEach: (int, int, int => unit) => unit" - }, - { - "id": "Belt.Range.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (int, int, int => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Range.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(start, finish, p)` equivalent to `Belt.Array.every(Belt.Array.range(start, finish), p)`\n## Examples\n\n```rescript\nBelt.Range.every(0, 4, i => i < 5) == true\n\nBelt.Range.every(0, 4, i => i < 4) == false\n```" - ], - "signature": "let every: (int, int, int => bool) => bool" - }, - { - "id": "Belt.Range.everyByU", - "kind": "value", - "name": "everyByU", - "docstrings": [], - "signature": "let everyByU: (int, int, ~step: int, int => bool) => bool", - "deprecated": "Use `everyBy` instead" - }, - { - "id": "Belt.Range.everyBy", - "kind": "value", - "name": "everyBy", - "docstrings": [ - "`everyBy(start, finish, ~step, p)`. See `Belt.Array.rangeBy`, equivalent to\n`Belt.Array.every(Belt.Array.rangeBy(start, finish, ~step), p)`\n\n## Examples\n\n```rescript\nBelt.Range.everyBy(0, 4, ~step=1, i => mod(i, 2) === 0) == false\n\nBelt.Range.everyBy(0, 4, ~step=2, i => mod(i, 2) === 0) == true\n```" - ], - "signature": "let everyBy: (int, int, ~step: int, int => bool) => bool" - }, - { - "id": "Belt.Range.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (int, int, int => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Range.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(start, finish, p)` equivalent to `Belt.Array.some(Belt.Array.range(start, finish), p)`\n\n## Examples\n\n```rescript\nBelt.Range.some(0, 4, i => i > 5) == false\n\nBelt.Range.some(0, 4, i => i > 2) == true\n```" - ], - "signature": "let some: (int, int, int => bool) => bool" - }, - { - "id": "Belt.Range.someByU", - "kind": "value", - "name": "someByU", - "docstrings": [], - "signature": "let someByU: (int, int, ~step: int, int => bool) => bool", - "deprecated": "Use `someBy` instead" - }, - { - "id": "Belt.Range.someBy", - "kind": "value", - "name": "someBy", - "docstrings": [ - "`someBy(start, finish, ~step, p)` See `Belt.Array.rangeBy`, equivalent to\n`Belt.Array.some(Belt.Array.rangeBy(start, finish, ~step), p)`\n\n## Examples\n\n```rescript\nBelt.Range.someBy(1, 5, ~step=2, i => mod(i, 2) === 0) == false\nBelt.Range.someBy(0, 4, ~step=2, i => mod(i, 2) === 0) == true\n```" - ], - "signature": "let someBy: (int, int, ~step: int, int => bool) => bool" - } - ] - }, - "belt/list": { - "id": "Belt.List", - "name": "List", - "docstrings": [ - "[`Belt.List`]()\n\n Utilities for List data type", - "Collection functions for manipulating the `list` data structures, a singly-linked list.\n\n**Prefer Array** if you need any of the following:\n\n- Random access of element\n- Better interop with JavaScript\n- Better memory usage & performance." - ], - "items": [ - { - "id": "Belt.List.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'a t` is compatible with built-in `list` type" - ], - "signature": "type t<'a> = list<'a>" - }, - { - "id": "Belt.List.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Returns the length of a list.\n\n## Examples\n\n```rescript\nBelt.List.length(list{1, 2, 3}) == 3\n```" - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Belt.List.size", - "kind": "value", - "name": "size", - "docstrings": [ - "See `Belt.List.length`" - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.List.head", - "kind": "value", - "name": "head", - "docstrings": [ - "Returns `Some(value)` where `value` is the first element in the list, or\n`None` if `someList` is an empty list.\n\n## Examples\n\n```rescript\nBelt.List.head(list{}) == None\nBelt.List.head(list{1, 2, 3}) == Some(1)\n```" - ], - "signature": "let head: t<'a> => option<'a>" - }, - { - "id": "Belt.List.headExn", - "kind": "value", - "name": "headExn", - "docstrings": [ - "Same as `Belt.List.head` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.headExn(list{1, 2, 3}) == 1\n\nswitch Belt.List.headExn(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let headExn: t<'a> => 'a" - }, - { - "id": "Belt.List.headOrThrow", - "kind": "value", - "name": "headOrThrow", - "docstrings": [ - "Same as `Belt.List.head` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.headOrThrow(list{1, 2, 3}) == 1\n\nswitch Belt.List.headOrThrow(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let headOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.List.tail", - "kind": "value", - "name": "tail", - "docstrings": [ - "Returns `None` if `someList` is empty, otherwise it returns `Some(tail)`\nwhere `tail` is everything except the first element of `someList`.\n\n## Examples\n\n```rescript\nBelt.List.tail(list{1, 2, 3}) == Some(list{2, 3})\n\nBelt.List.tail(list{}) == None\n```" - ], - "signature": "let tail: t<'a> => option>" - }, - { - "id": "Belt.List.tailExn", - "kind": "value", - "name": "tailExn", - "docstrings": [ - "Same as `Belt.List.tail` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.tailExn(list{1, 2, 3}) == list{2, 3}\n\nswitch Belt.List.tailExn(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let tailExn: t<'a> => t<'a>" - }, - { - "id": "Belt.List.tailOrThrow", - "kind": "value", - "name": "tailOrThrow", - "docstrings": [ - "Same as `Belt.List.tail` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.tailOrThrow(list{1, 2, 3}) == list{2, 3}\n\nswitch Belt.List.tailOrThrow(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let tailOrThrow: t<'a> => t<'a>" - }, - { - "id": "Belt.List.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds `value` to the beginning of `someList`.\n\n## Examples\n\n```rescript\nBelt.List.add(list{2, 3}, 1) // list{1, 2, 3}\n\nBelt.List.add(list{\"World\", \"!\"}, \"Hello\") == list{\"Hello\", \"World\", \"!\"}\n```" - ], - "signature": "let add: (t<'a>, 'a) => t<'a>" - }, - { - "id": "Belt.List.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Return the nth element in `someList`, or `None` if `index` is larger than the\nlength.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.get(1) == Some(\"B\")\n\nabc->Belt.List.get(4) == None\n```" - ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, - { - "id": "Belt.List.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as `Belt.List.get` but throws an exception if `index` is larger than the\nlength. Use with care.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.getExn(1) == \"B\"\n\nswitch abc->Belt.List.getExn(4) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getExn: (t<'a>, int) => 'a" - }, - { - "id": "Belt.List.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as `Belt.List.get` but throws an exception if `index` is larger than the\nlength. Use with care.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.getOrThrow(1) == \"B\"\n\nswitch abc->Belt.List.getOrThrow(4) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getOrThrow: (t<'a>, int) => 'a" - }, - { - "id": "Belt.List.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a list of length `numItems` with each element filled with value `v`. Returns an empty list if `numItems` is negative.\n\n## Examples\n\n```rescript\nBelt.List.make(3, 1) == list{1, 1, 1}\n```" - ], - "signature": "let make: (int, 'a) => t<'a>" - }, - { - "id": "Belt.List.makeByU", - "kind": "value", - "name": "makeByU", - "docstrings": [ - "Uncurried version of [makeBy](#makeBy)" - ], - "signature": "let makeByU: (int, int => 'a) => t<'a>", - "deprecated": "Use `makeBy` instead" - }, - { - "id": "Belt.List.makeBy", - "kind": "value", - "name": "makeBy", - "docstrings": [ - "Return a list of length `numItems` with element `i` initialized with `f(i)`.\nReturns an empty list if `numItems` is negative.\n\n## Examples\n\n```rescript\nBelt.List.makeBy(5, i => i) == list{0, 1, 2, 3, 4}\n\nBelt.List.makeBy(5, i => i * i) == list{0, 1, 4, 9, 16}\n```" - ], - "signature": "let makeBy: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.List.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "Returns a new list in random order.\n\n## Examples\n\n```rescript\nBelt.List.shuffle(list{1, 2, 3}) // list{2, 1, 3}\n```" - ], - "signature": "let shuffle: t<'a> => t<'a>" - }, - { - "id": "Belt.List.drop", - "kind": "value", - "name": "drop", - "docstrings": [ - "Return a new list, dropping the first `n` elements. Returns `None` if `someList` has fewer than `n` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.drop(2) == Some(list{3})\n\nlist{1, 2, 3}->Belt.List.drop(3) == Some(list{})\n\nlist{1, 2, 3}->Belt.List.drop(4) == None\n```" - ], - "signature": "let drop: (t<'a>, int) => option>" - }, - { - "id": "Belt.List.take", - "kind": "value", - "name": "take", - "docstrings": [ - "Returns a list with the first `n` elements from `someList`, or `None` if `someList` has fewer than `n` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.take(1) == Some(list{1})\n\nlist{1, 2, 3}->Belt.List.take(2) == Some(list{1, 2})\n\nlist{1, 2, 3}->Belt.List.take(4) == None\n```" - ], - "signature": "let take: (t<'a>, int) => option>" - }, - { - "id": "Belt.List.splitAt", - "kind": "value", - "name": "splitAt", - "docstrings": [ - "Split the list `someList` at `index`. Returns `None` when the length of `someList` is less than `index`.\n\n## Examples\n\n```rescript\nlist{\"Hello\", \"World\"}->Belt.List.splitAt(1) == Some((list{\"Hello\"}, list{\"World\"}))\n\nlist{0, 1, 2, 3, 4}->Belt.List.splitAt(2) == Some((list{0, 1}, list{2, 3, 4}))\n```" - ], - "signature": "let splitAt: (t<'a>, int) => option<(list<'a>, list<'a>)>" - }, - { - "id": "Belt.List.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "Returns the list obtained by adding `secondList` after `firstList`.\n\n## Examples\n\n```rescript\nBelt.List.concat(list{1, 2, 3}, list{4, 5}) == list{1, 2, 3, 4, 5}\n```" - ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Belt.List.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "Returns the list obtained by concatenating all the lists in array `a`, in\norder.\n\n## Examples\n\n```rescript\nBelt.List.concatMany([list{1, 2, 3}, list{}, list{3}]) == list{1, 2, 3, 3}\n```" - ], - "signature": "let concatMany: array> => t<'a>" - }, - { - "id": "Belt.List.reverseConcat", - "kind": "value", - "name": "reverseConcat", - "docstrings": [ - "Equivalent to writing: `concat(reverse(firstList, secondList)`\n\n## Examples\n\n```rescript\nBelt.List.reverseConcat(list{1, 2}, list{3, 4}) == list{2, 1, 3, 4}\n```" - ], - "signature": "let reverseConcat: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Belt.List.flatten", - "kind": "value", - "name": "flatten", - "docstrings": [ - "Return the list obtained by concatenating all the lists in list `ls`, in order.\n\n## Examples\n\n```rescript\nBelt.List.flatten(list{list{1, 2, 3}, list{}, list{3}}) == list{1, 2, 3, 3}\n```" - ], - "signature": "let flatten: t> => t<'a>" - }, - { - "id": "Belt.List.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [ - "Uncurried version of [map](#map)." - ], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.List.map", - "kind": "value", - "name": "map", - "docstrings": [ - "Returns a new list with `f` applied to each element of `someList`.\n\n## Examples\n\n```rescript\nlist{1, 2}->Belt.List.map(x => x + 1) == list{2, 3}\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.List.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "Returns a list of pairs from the two lists with the length of the shorter list.\n\n## Examples\n\n```rescript\nBelt.List.zip(list{1, 2}, list{3, 4, 5}) == list{(1, 3), (2, 4)}\n```" - ], - "signature": "let zip: (t<'a>, t<'b>) => t<('a, 'b)>" - }, - { - "id": "Belt.List.zipByU", - "kind": "value", - "name": "zipByU", - "docstrings": [ - "Uncurried version of [zipBy](#zipBy)." - ], - "signature": "let zipByU: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>", - "deprecated": "Use `zipBy` instead" - }, - { - "id": "Belt.List.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "See [Belt.List.zip](#zip)\n\n## Examples\n\n```rescript\nBelt.List.zipBy(list{1, 2, 3}, list{4, 5}, (a, b) => 2 * a + b) == list{6, 9}\n```" - ], - "signature": "let zipBy: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>" - }, - { - "id": "Belt.List.mapWithIndexU", - "kind": "value", - "name": "mapWithIndexU", - "docstrings": [ - "Uncurried version of [mapWithIndex](#mapWithIndex)." - ], - "signature": "let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => t<'b>", - "deprecated": "Use `mapWithIndex` instead" - }, - { - "id": "Belt.List.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "Applies `f` to each element of `someList`.\nFunction `f` takes two arguments: the index starting from 0 and the element from `someList`, in that order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.mapWithIndex((index, x) => index + x) == list{1, 3, 5}\n```" - ], - "signature": "let mapWithIndex: (t<'a>, (int, 'a) => 'b) => t<'b>" - }, - { - "id": "Belt.List.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Converts the given array to a list.\n\n## Examples\n\n```rescript\nBelt.List.fromArray([1, 2, 3]) == list{1, 2, 3}\n```" - ], - "signature": "let fromArray: array<'a> => t<'a>" - }, - { - "id": "Belt.List.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Converts the given list to an array.\n\n## Examples\n\n```rescript\nBelt.List.toArray(list{1, 2, 3}) == [1, 2, 3]\n```" - ], - "signature": "let toArray: t<'a> => array<'a>" - }, - { - "id": "Belt.List.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "Returns a new list whose elements are those of `someList` in reversed order.\n\n## Examples\n\n```rescript\nBelt.List.reverse(list{1, 2, 3}) == list{3, 2, 1}\n```" - ], - "signature": "let reverse: t<'a> => t<'a>" - }, - { - "id": "Belt.List.mapReverseU", - "kind": "value", - "name": "mapReverseU", - "docstrings": [ - "Uncurried version of [mapReverse](#mapReverse)." - ], - "signature": "let mapReverseU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `mapReverse` instead" - }, - { - "id": "Belt.List.mapReverse", - "kind": "value", - "name": "mapReverse", - "docstrings": [ - "Equivalent to `Belt.List.map(someList, f)->Belt.List.reverse`\n\n## Examples\n\n```rescript\nlist{3, 4, 5}->Belt.List.mapReverse(x => x * x) == list{25, 16, 9}\n```" - ], - "signature": "let mapReverse: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.List.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Uncurried version of [forEach](#forEach)." - ], - "signature": "let forEachU: (t<'a>, 'a => 'b) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.List.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Call `f` on each element of `someList` from the beginning to end.\n`f` returns `unit`, so no new array is created. Use `forEach` when you are primarily concerned with repetitively creating side effects.\n\n## Examples\n\n```rescript\nBelt.List.forEach(list{\"a\", \"b\", \"c\"}, x => Js.log(\"Item: \" ++ x))\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\n```" - ], - "signature": "let forEach: (t<'a>, 'a => 'b) => unit" - }, - { - "id": "Belt.List.forEachWithIndexU", - "kind": "value", - "name": "forEachWithIndexU", - "docstrings": [ - "Uncurried version of [forEachWithIndex](#forEachWithIndex)." - ], - "signature": "let forEachWithIndexU: (t<'a>, (int, 'a) => 'b) => unit", - "deprecated": "Use `forEachWithIndex` instead" - }, - { - "id": "Belt.List.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "Call `f` on each element of `someList` from beginning to end.\nFunction `f` takes two arguments: the index starting from 0 and the element from `someList`. `f` returns `unit`.\n\n## Examples\n\n```rescript\nBelt.List.forEachWithIndex(list{\"a\", \"b\", \"c\"}, (index, x) => {\n Js.log(\"Item \" ++ Belt.Int.toString(index) ++ \" is \" ++ x)\n})\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\n```" - ], - "signature": "let forEachWithIndex: (t<'a>, (int, 'a) => 'b) => unit" - }, - { - "id": "Belt.List.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [ - "Uncurried version of [reduce](#reduce)." - ], - "signature": "let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.List.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies `f` to each element of `someList` from beginning to end. Function `f` has two parameters: the item from the list and an “accumulator”, which starts with a value of `initialValue`. reduce returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduce(0, (a, b) => a + b) == 10\n\n/* same as */\n\nlist{1, 2, 3, 4}->Belt.List.reduce(0, (acc, item) => acc + item) == 10\n```" - ], - "signature": "let reduce: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Belt.List.reduceWithIndexU", - "kind": "value", - "name": "reduceWithIndexU", - "docstrings": [ - "Uncurried version of [reduceWithIndex](#reduceWithIndex)." - ], - "signature": "let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b", - "deprecated": "Use `reduceWithIndex` instead" - }, - { - "id": "Belt.List.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "Applies `f` to each element of `someList` from beginning to end. Function `f` has three parameters: the item from the list and an “accumulator”, which starts with a value of `initialValue` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduceWithIndex(0, (acc, item, index) => acc + item + index) == 16\n```" - ], - "signature": "let reduceWithIndex: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Belt.List.reduceReverseU", - "kind": "value", - "name": "reduceReverseU", - "docstrings": [ - "Uncurried version of [reduceReverse](#reduceReverse)." - ], - "signature": "let reduceReverseU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b", - "deprecated": "Use `reduceReverse` instead" - }, - { - "id": "Belt.List.reduceReverse", - "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "Works like [reduce](#reduce), except that function `f` is applied to each\nitem of `someList` from the last back to the first.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(0, (a, b) => a + b) == 10\n\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(10, (a, b) => a - b) == 0\n\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(list{}, Belt.List.add) == list{1, 2, 3, 4}\n```" - ], - "signature": "let reduceReverse: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Belt.List.mapReverse2U", - "kind": "value", - "name": "mapReverse2U", - "docstrings": [ - "Uncurried version of [mapReverse2](#mapReverse2)." - ], - "signature": "let mapReverse2U: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>", - "deprecated": "Use `mapReverse2` instead" - }, - { - "id": "Belt.List.mapReverse2", - "kind": "value", - "name": "mapReverse2", - "docstrings": [ - "Equivalent to: `zipBy(xs, ys, f)->reverse`\n\n## Examples\n\n```rescript\nBelt.List.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) == list{4, 2}\n```" - ], - "signature": "let mapReverse2: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>" - }, - { - "id": "Belt.List.forEach2U", - "kind": "value", - "name": "forEach2U", - "docstrings": [ - "Uncurried version of [forEach2](#forEach2)." - ], - "signature": "let forEach2U: (t<'a>, t<'b>, ('a, 'b) => 'c) => unit", - "deprecated": "Use `forEach2` instead" - }, - { - "id": "Belt.List.forEach2", - "kind": "value", - "name": "forEach2", - "docstrings": [ - "Stops at the length of the shorter list.\n\n## Examples\n\n```rescript\nBelt.List.forEach2(list{\"Z\", \"Y\"}, list{\"A\", \"B\", \"C\"}, (x, y) => Js.log2(x, y))\n\n/*\n prints:\n \"Z\" \"A\"\n \"Y\" \"B\"\n*/\n```" - ], - "signature": "let forEach2: (t<'a>, t<'b>, ('a, 'b) => 'c) => unit" - }, - { - "id": "Belt.List.reduce2U", - "kind": "value", - "name": "reduce2U", - "docstrings": [ - "Uncurried version of [reduce2](#reduce2)." - ], - "signature": "let reduce2U: (t<'b>, t<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a", - "deprecated": "Use `reduce2` instead" - }, - { - "id": "Belt.List.reduce2", - "kind": "value", - "name": "reduce2", - "docstrings": [ - "Applies `f` to each element of `firstList` and `secondList` from beginning to end. Stops with the shorter list. Function `f` has three parameters: an “accumulator” which starts with a value of `initialValue`, an item from `firstList`, and an item from `secondList`. `reduce2` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nBelt.List.reduce2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduce2: (t<'b>, t<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a" - }, - { - "id": "Belt.List.reduceReverse2U", - "kind": "value", - "name": "reduceReverse2U", - "docstrings": [ - "Uncurried version of [reduceReverse2](#reduceReverse2)." - ], - "signature": "let reduceReverse2U: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c", - "deprecated": "Use `reduceReverse2` instead" - }, - { - "id": "Belt.List.reduceReverse2", - "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "Applies `f` to each element of `firstList` and `secondList` from end to\nbeginning. Stops with the shorter list. Function `f` has three parameters: an\n“accumulator” which starts with a value of init, an item from `firstList`,\nand an item from `secondList`. `reduce2` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nBelt.List.reduceReverse2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduceReverse2: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" - }, - { - "id": "Belt.List.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [ - "Uncurried version of [every](#every)." - ], - "signature": "let everyU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.List.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Returns `true` if all elements satisfy `pred`, where `pred` is a predicate: a function taking an element and returning a bool.\n\n## Examples\n\n```rescript\nlet isBelow10 = value => value < 10\n\nlist{1, 9, 8, 2}->Belt.List.every(isBelow10) == true\n\nlist{1, 99, 8, 2}->Belt.List.every(isBelow10) == false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.List.someU", - "kind": "value", - "name": "someU", - "docstrings": [ - "Uncurried version of [some](#some)." - ], - "signature": "let someU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.List.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Returns `true` if at least _one_ of the elements in `someList` satisfies\n`pred`, where `pred` is a predicate: a function taking an element and\nreturning a bool.\n\n## Examples\n\n```rescript\nlet isAbove100 = value => value > 100\n\nlist{101, 1, 2, 3}->Belt.List.some(isAbove100) == true\n\nlist{1, 2, 3, 4}->Belt.List.some(isAbove100) == false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.List.every2U", - "kind": "value", - "name": "every2U", - "docstrings": [ - "Uncurried version of [every2](#every2)." - ], - "signature": "let every2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `every2` instead" - }, - { - "id": "Belt.List.every2", - "kind": "value", - "name": "every2", - "docstrings": [ - "Returns `true` if predicate `pred(a, b)` is `true` for all pairs of elements\nup to the shorter length (i.e. `min(length(firstList), length(secondList))`)\n\n## Examples\n\n```rescript\nBelt.List.every2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nBelt.List.every2(list{}, list{1}, (a, b) => a > b) == true\n\nBelt.List.every2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nBelt.List.every2(list{0, 1}, list{5, 0}, (a, b) => a > b) == false\n```" - ], - "signature": "let every2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.some2U", - "kind": "value", - "name": "some2U", - "docstrings": [ - "Uncurried version of [some2](#some2)." - ], - "signature": "let some2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `some2` instead" - }, - { - "id": "Belt.List.some2", - "kind": "value", - "name": "some2", - "docstrings": [ - "Returns `true` if predicate `pred(a, b)` is true for any pair of elements up\nto the shorter length (i.e. `min(length(firstList), length(secondList))`)\n\n## Examples\n\n```rescript\nBelt.List.some2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nBelt.List.some2(list{}, list{1}, (a, b) => a > b) == false\n\nBelt.List.some2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nBelt.List.some2(list{0, 1}, list{5, 0}, (a, b) => a > b) == true\n```" - ], - "signature": "let some2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.cmpByLength", - "kind": "value", - "name": "cmpByLength", - "docstrings": [ - "Compare two lists solely by length. Returns `-1` if `length(firstList)` is\nless than `length(secondList)`, `0` if `length(firstList)` equals\n`length(secondList)`, and `1` if `length(firstList)` is greater than\n`length(secondList)`.\n\n## Examples\n\n```rescript\nBelt.List.cmpByLength(list{1, 2}, list{3, 4, 5, 6}) == -1\n\nBelt.List.cmpByLength(list{1, 2, 3}, list{4, 5, 6}) == 0\n\nBelt.List.cmpByLength(list{1, 2, 3, 4}, list{5, 6}) == 1\n```" - ], - "signature": "let cmpByLength: (t<'a>, t<'a>) => int" - }, - { - "id": "Belt.List.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [ - "Uncurried version of [cmp](#cmp)." - ], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.List.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Compare elements one by one `compareFn(a, b)`. `compareFn` returns a negative number if `a` is \"less than\" `b`, zero if `a` is \"equal to\" `b`, a positive number if `a` is \"greater than\" `b`.\n\nThe comparison returns the first non-zero result of `compareFn`, or zero if `compareFn` returns zero for all `a` and `b`.\n\nIf all items have compared equal, but `firstList` is exhausted first, return `-1`. (`firstList` is shorter).\nIf all items have compared equal, but `secondList` is exhausted first, return `1` (`firstList` is longer).\n\n## Examples\n\n```rescript\nBelt.List.cmp(list{3}, list{3, 7}, (a, b) => compare(a, b)) == -1\n\nBelt.List.cmp(list{5, 3}, list{5}, (a, b) => compare(a, b)) == 1\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 4, 2}, (a, b) => compare(a, b)) == -1\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 2, 3}, (a, b) => compare(a, b)) == 1\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 3, 5}, (a, b) => compare(a, b)) == 0\n```\n\n**Please note:** The total ordering of List is different from Array,\nfor Array, we compare the length first and, only if the lengths are equal, elements one by one.\nFor lists, we just compare elements one by one." - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.List.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [ - "Uncurried version of [eq](#eq)." - ], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.List.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Check equality of `firstList` and `secondList` using `eqElem` for equality on\nelements, where `eqElem` is a function that returns `true` if items `x` and\n`y` meet some criterion for equality, `false` otherwise. eq `false` if length\nof `firstList` and `secondList` are not the same.\n\n## Examples\n\n```rescript\nBelt.List.eq(list{1, 2, 3}, list{1, 2}, (a, b) => a == b) == false\n\nBelt.List.eq(list{1, 2}, list{1, 2}, (a, b) => a == b) == true\n\nBelt.List.eq(list{1, 2, 3}, list{-1, -2, -3}, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.List.hasU", - "kind": "value", - "name": "hasU", - "docstrings": [ - "Uncurried version of [has](#has)." - ], - "signature": "let hasU: (t<'a>, 'b, ('a, 'b) => bool) => bool", - "deprecated": "Use `has` instead" - }, - { - "id": "Belt.List.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Returns `true` if the list contains at least one element for which\n`eqFunction(x)` returns true.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.has(2, (a, b) => a == b) == true\n\nlist{1, 2, 3}->Belt.List.has(4, (a, b) => a == b) == false\n\nlist{-1, -2, -3}->Belt.List.has(2, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let has: (t<'a>, 'b, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.getByU", - "kind": "value", - "name": "getByU", - "docstrings": [ - "Uncurried version of [getBy](#getBy)." - ], - "signature": "let getByU: (t<'a>, 'a => bool) => option<'a>", - "deprecated": "Use `getBy` instead" - }, - { - "id": "Belt.List.getBy", - "kind": "value", - "name": "getBy", - "docstrings": [ - "Returns `Some(value)` for the first value in `someList` that satisfies the\npredicate function `pred`. Returns `None` if no element satisfies the function.\n\n## Examples\n\n```rescript\nBelt.List.getBy(list{1, 4, 3, 2}, x => x > 3) == Some(4)\n\nBelt.List.getBy(list{1, 4, 3, 2}, x => x > 4) == None\n```" - ], - "signature": "let getBy: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Belt.List.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [ - "Uncurried version of [keep](#keep)." - ], - "signature": "let keepU: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.List.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.keep(list{1, 2, 3, 4}, isEven) == list{2, 4}\n\nBelt.List.keep(list{None, Some(2), Some(3), None}, Belt.Option.isSome) == list{Some(2), Some(3)}\n```" - ], - "signature": "let keep: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Belt.List.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.filter(list{1, 2, 3, 4}, isEven) == list{2, 4}\n\nBelt.List.filter(list{None, Some(2), Some(3), None}, Belt.Option.isSome) == list{Some(2), Some(3)}\n```" - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "This function will soon be deprecated. Please, use `List.keep` instead." - }, - { - "id": "Belt.List.keepWithIndexU", - "kind": "value", - "name": "keepWithIndexU", - "docstrings": [ - "Uncurried version of [keepWithIndex](#keepWithIndex)." - ], - "signature": "let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "Use `keepWithIndex` instead" - }, - { - "id": "Belt.List.keepWithIndex", - "kind": "value", - "name": "keepWithIndex", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.keepWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) == list{1, 3}\n```" - ], - "signature": "let keepWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" - }, - { - "id": "Belt.List.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.filterWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) == list{1, 3}\n```" - ], - "signature": "let filterWithIndex: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "This function will soon be deprecated. Please, use `List.keepWithIndex` \\\n instead." - }, - { - "id": "Belt.List.keepMapU", - "kind": "value", - "name": "keepMapU", - "docstrings": [ - "Uncurried version of [keepMap](#keepMap)." - ], - "signature": "let keepMapU: (t<'a>, 'a => option<'b>) => t<'b>", - "deprecated": "Use `keepMap` instead" - }, - { - "id": "Belt.List.keepMap", - "kind": "value", - "name": "keepMap", - "docstrings": [ - "Applies `f` to each element of `someList`. If `f(x)` returns `Some(value)`, then `value` is _kept_ in the resulting list.\nIf `f(x)` returns `None`, the element is _not_ retained in the result.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nlist{1, 2, 3, 4}->Belt.List.keepMap(x =>\n if isEven(x) {\n Some(x)\n } else {\n None\n }\n) /* list{2, 4} */\n\nlist{Some(1), Some(2), None}->Belt.List.keepMap(x => x) == list{1, 2}\n```" - ], - "signature": "let keepMap: (t<'a>, 'a => option<'b>) => t<'b>" - }, - { - "id": "Belt.List.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [ - "Uncurried version of [partition](#partition)." - ], - "signature": "let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.List.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "Creates a pair of lists; the first list consists of all elements of `someList` that satisfy the predicate function `pred`; the second list consists of all elements of `someList` that _do not_ satisfy \\`pred.\n\nIn other words:\n\n```\n(elementsThatSatisfies, elementsThatDoesNotSatisfy)\n```\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.partition(x => x > 2) == (list{3, 4}, list{1, 2})\n```" - ], - "signature": "let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)" - }, - { - "id": "Belt.List.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "Takes a list of pairs and creates a pair of lists. The first list contains all the first items of the pairs; the second list contains all the second items.\n\n## Examples\n\n```rescript\nBelt.List.unzip(list{(1, 2), (3, 4)}) == (list{1, 3}, list{2, 4})\n\nBelt.List.unzip(list{(\"H\", \"W\"), (\"e\", \"o\"), (\"l\", \"r\"), (\"l\", \"l\"), (\"o\", \"d\"), (\" \", \"!\")}) ==\n (list{\"H\", \"e\", \"l\", \"l\", \"o\", \" \"}, list{\"W\", \"o\", \"r\", \"l\", \"d\", \"!\"})\n```" - ], - "signature": "let unzip: t<('a, 'b)> => (t<'a>, t<'b>)" - }, - { - "id": "Belt.List.getAssocU", - "kind": "value", - "name": "getAssocU", - "docstrings": [ - "Uncurried version of [getAssoc](#getAssoc)." - ], - "signature": "let getAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>", - "deprecated": "Use `getAssoc` instead" - }, - { - "id": "Belt.List.getAssoc", - "kind": "value", - "name": "getAssoc", - "docstrings": [ - "Return the second element of a pair in `someList` where the first element equals `k` as per the predicate function `eqFunction`, or `None` if not found.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.getAssoc(3, (a, b) => a == b) /* Some(\"c\") */\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.getAssoc(15, (k, item) =>\n k /* 15 */ == item\n) == Some(\"afternoon\")\n/* 9, 5, 22 */\n```" - ], - "signature": "let getAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>" - }, - { - "id": "Belt.List.hasAssocU", - "kind": "value", - "name": "hasAssocU", - "docstrings": [ - "Uncurried version of [hasAssoc](#hasAssoc)." - ], - "signature": "let hasAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => bool", - "deprecated": "Use `hasAssoc` instead" - }, - { - "id": "Belt.List.hasAssoc", - "kind": "value", - "name": "hasAssoc", - "docstrings": [ - "Returns `true` if there is a pair in `someList` where the first element equals `k` as per the predicate function `eqFunction`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.hasAssoc(1, (a, b) => a == b) == true\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.hasAssoc(25, (k, item) =>\n k /* 25 */ == item\n) == false\n/* 9, 5, 22 */\n```" - ], - "signature": "let hasAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.removeAssocU", - "kind": "value", - "name": "removeAssocU", - "docstrings": [ - "Uncurried version of [removeAssoc](#removeAssoc)." - ], - "signature": "let removeAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => t<('a, 'c)>", - "deprecated": "Use `removeAssoc` instead" - }, - { - "id": "Belt.List.removeAssoc", - "kind": "value", - "name": "removeAssoc", - "docstrings": [ - "Return a list after removing the first pair whose first value is `k` per the equality predicate `eqFunction`; if not found, return a new list identical to `someList`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.removeAssoc(1, (a, b) => a == b) ==\n list{(2, \"b\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.removeAssoc(9, (k, item) =>\n k /* 9 */ == item\n) == list{(15, \"afternoon\"), (22, \"night\")}\n/* 9, 5, 22 */\n```" - ], - "signature": "let removeAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => t<('a, 'c)>" - }, - { - "id": "Belt.List.setAssocU", - "kind": "value", - "name": "setAssocU", - "docstrings": [ - "Uncurried version of [setAssoc](#setAssoc)." - ], - "signature": "let setAssocU: (t<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => t<('a, 'c)>", - "deprecated": "Use `setAssoc` instead" - }, - { - "id": "Belt.List.setAssoc", - "kind": "value", - "name": "setAssoc", - "docstrings": [ - "If `k` exists in `someList` by satisfying the `eqFunction` predicate, return a new list with the key and value replaced by the new `k` and `v`; otherwise, return a new list with the pair `k`, `v` added to the head of `someList`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.setAssoc(2, \"x\", (a, b) => a == b) ==\n list{(1, \"a\"), (2, \"x\"), (3, \"c\")}\n\nlist{(1, \"a\"), (3, \"c\")}->Belt.List.setAssoc(2, \"b\", (a, b) => a == b) ==\n list{(2, \"b\"), (1, \"a\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (3, \"morning?!\"), (22, \"night\")}->Belt.List.setAssoc(15, \"afternoon\", (a, b) =>\n mod(a, 12) == mod(b, 12)\n) == list{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n```\n\n**Please note**\n\nIn the last example, since: `15 mod 12` equals `3 mod 12`\n\nBoth the key _and_ the value are replaced in the list." - ], - "signature": "let setAssoc: (t<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => t<('a, 'c)>" - }, - { - "id": "Belt.List.sortU", - "kind": "value", - "name": "sortU", - "docstrings": [ - "Uncurried version of [sort](#sort)." - ], - "signature": "let sortU: (t<'a>, ('a, 'a) => int) => t<'a>", - "deprecated": "Use `sort` instead" - }, - { - "id": "Belt.List.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "Returns a sorted list.\n\n## Examples\n\n```rescript\nBelt.List.sort(list{5, 4, 9, 3, 7}, (a, b) => a - b) == list{3, 4, 5, 7, 9}\n```" - ], - "signature": "let sort: (t<'a>, ('a, 'a) => int) => t<'a>" - } - ] - }, - "belt/mutablestack": { - "id": "Belt.MutableStack", - "name": "MutableStack", - "docstrings": [ - "[`Belt.MutableStack`]()\n\n An FILO(first in last out) stack data structure", - "First in last out stack. This module implements stacks, with in-place\nmodification." - ], - "items": [ - { - "id": "Belt.MutableStack.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableStack.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a new stack, initially empty." - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableStack.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Discard all elements from the stack." - ], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableStack.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(x)` O(1) operation, return a new stack." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.MutableStack.push", - "kind": "value", - "name": "push", - "docstrings": [], - "signature": "let push: (t<'a>, 'a) => unit" - }, - { - "id": "Belt.MutableStack.popUndefined", - "kind": "value", - "name": "popUndefined", - "docstrings": [], - "signature": "let popUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableStack.pop", - "kind": "value", - "name": "pop", - "docstrings": [], - "signature": "let pop: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableStack.topUndefined", - "kind": "value", - "name": "topUndefined", - "docstrings": [], - "signature": "let topUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableStack.top", - "kind": "value", - "name": "top", - "docstrings": [], - "signature": "let top: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableStack.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableStack.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableStack.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableStack.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.MutableStack.dynamicPopIterU", - "kind": "value", - "name": "dynamicPopIterU", - "docstrings": [], - "signature": "let dynamicPopIterU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `dynamicPopIter` instead" - }, - { - "id": "Belt.MutableStack.dynamicPopIter", - "kind": "value", - "name": "dynamicPopIter", - "docstrings": [ - "`dynamicPopIter(s, f)` apply `f` to each element of `s`. The item is poped\nbefore applying `f`, `s` will be empty after this opeartion. This function is\nuseful for worklist algorithm." - ], - "signature": "let dynamicPopIter: (t<'a>, 'a => unit) => unit" - } - ] - }, - "belt/mutablequeue": { - "id": "Belt.MutableQueue", - "name": "MutableQueue", - "docstrings": [ - "[`Belt.MutableQueue`]()\n\n An FIFO(first in first out) queue data structure", - "A FIFO (first in first out) queue data structure." - ], - "items": [ - { - "id": "Belt.MutableQueue.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of queues containing elements of `type('a)`." - ], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableQueue.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a new queue, initially empty." - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableQueue.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Discard all elements from the queue." - ], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableQueue.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Returns `true` if the given queue is empty, `false` otherwise." - ], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableQueue.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` a is equivalent to `Array.forEach(a, add(q, a));`" - ], - "signature": "let fromArray: array<'a> => t<'a>" - }, - { - "id": "Belt.MutableQueue.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(q, x)` adds the element `x` at the end of the queue `q`." - ], - "signature": "let add: (t<'a>, 'a) => unit" - }, - { - "id": "Belt.MutableQueue.peek", - "kind": "value", - "name": "peek", - "docstrings": [ - "`peekOpt(q)` returns the first element in queue `q`, without removing it from the queue." - ], - "signature": "let peek: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableQueue.peekUndefined", - "kind": "value", - "name": "peekUndefined", - "docstrings": [ - "`peekUndefined(q)` returns `undefined` if not found." - ], - "signature": "let peekUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableQueue.peekExn", - "kind": "value", - "name": "peekExn", - "docstrings": [ - "`peekExn(q)` throws an exception if `q` is empty." - ], - "signature": "let peekExn: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.peekOrThrow", - "kind": "value", - "name": "peekOrThrow", - "docstrings": [ - "`peekOrThrow(q)` throws an exception if `q` is empty." - ], - "signature": "let peekOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "`pop(q)` removes and returns the first element in queue `q`." - ], - "signature": "let pop: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableQueue.popUndefined", - "kind": "value", - "name": "popUndefined", - "docstrings": [ - "`popUndefined(q)` removes and returns the first element in queue `q`. it will\nreturn `undefined` if it is already empty." - ], - "signature": "let popUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableQueue.popExn", - "kind": "value", - "name": "popExn", - "docstrings": [ - "`popExn(q)` throw an exception if q is empty." - ], - "signature": "let popExn: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.popOrThrow", - "kind": "value", - "name": "popOrThrow", - "docstrings": [ - "`popOrThrow(q)` throw an exception if q is empty." - ], - "signature": "let popOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(q)` returns a fresh queue." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.MutableQueue.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns the number of elements in a queue." - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableQueue.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableQueue.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.MutableQueue.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableQueue.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(q, f) applies`f`in turn to all elements of`q`, from the least\nrecently entered to the most recently entered. The queue itself is unchanged." - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.MutableQueue.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableQueue.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(q, accu, f)` is equivalent to `List.reduce(l, accu, f)`, where `l` is the\nlist of `q`'s elements. The queue remains unchanged." - ], - "signature": "let reduce: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableQueue.transfer", - "kind": "value", - "name": "transfer", - "docstrings": [ - "`transfer(q1, q2)` adds all of `q1`'s elements at the end of the queue `q2`,\nthen clears `q1`. It is equivalent to the sequence `forEach((x) => add(x, q2), q1)`;\nclear `q1`, but runs in constant time." - ], - "signature": "let transfer: (t<'a>, t<'a>) => unit" - }, - { - "id": "Belt.MutableQueue.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "First added will be in the beginning of the array." - ], - "signature": "let toArray: t<'a> => array<'a>" - } - ] - }, - "belt/sortarray": { - "id": "Belt.SortArray", - "name": "SortArray", - "docstrings": [ - "[`Belt.SortArray`]()\n\n The top level provides some generic sort related utilities.\n\n It also has two specialized inner modules\n [`Belt.SortArray.Int`]() and [`Belt.SortArray.String`]()", - "A module for Array sort relevant utiliites" - ], - "items": [ - { - "id": "Belt.SortArray.strictlySortedLengthU", - "kind": "value", - "name": "strictlySortedLengthU", - "docstrings": [], - "signature": "let strictlySortedLengthU: (array<'a>, ('a, 'a) => bool) => int", - "deprecated": "Use `strictlySortedLength` instead" - }, - { - "id": "Belt.SortArray.strictlySortedLength", - "kind": "value", - "name": "strictlySortedLength", - "docstrings": [ - "`strictlySortedLenght(xs, cmp);` return `+n` means increasing order `-n` means negative order\n\n## Examples\n\n```rescript\nBelt.SortArray.strictlySortedLength([1, 2, 3, 4, 3], (x, y) => x < y) == 4\n\nBelt.SortArray.strictlySortedLength([], (x, y) => x < y) == 0\n\nBelt.SortArray.strictlySortedLength([1], (x, y) => x < y) == 1\n\nBelt.SortArray.strictlySortedLength([4, 3, 2, 1], (x, y) => x < y) == -4\n```" - ], - "signature": "let strictlySortedLength: (array<'a>, ('a, 'a) => bool) => int" - }, - { - "id": "Belt.SortArray.isSortedU", - "kind": "value", - "name": "isSortedU", - "docstrings": [], - "signature": "let isSortedU: (array<'a>, ('a, 'a) => int) => bool", - "deprecated": "Use `isSorted` instead" - }, - { - "id": "Belt.SortArray.isSorted", - "kind": "value", - "name": "isSorted", - "docstrings": [ - "`isSorted(arr, cmp)`: Returns true if array is increasingly sorted (equal is okay)" - ], - "signature": "let isSorted: (array<'a>, ('a, 'a) => int) => bool" - }, - { - "id": "Belt.SortArray.stableSortInPlaceByU", - "kind": "value", - "name": "stableSortInPlaceByU", - "docstrings": [], - "signature": "let stableSortInPlaceByU: (array<'a>, ('a, 'a) => int) => unit", - "deprecated": "Use `stableSortInPlaceBy` instead" - }, - { - "id": "Belt.SortArray.stableSortInPlaceBy", - "kind": "value", - "name": "stableSortInPlaceBy", - "docstrings": [], - "signature": "let stableSortInPlaceBy: (array<'a>, ('a, 'a) => int) => unit" - }, - { - "id": "Belt.SortArray.stableSortByU", - "kind": "value", - "name": "stableSortByU", - "docstrings": [], - "signature": "let stableSortByU: (array<'a>, ('a, 'a) => int) => array<'a>", - "deprecated": "Use `stableSortBy` instead" - }, - { - "id": "Belt.SortArray.stableSortBy", - "kind": "value", - "name": "stableSortBy", - "docstrings": [ - "`stableSortBy(xs, cmp)`: Returns a fresh array Sort `xs` in place using\ncomparator `cmp`, the stable means if the elements are equal, their order will\nbe preserved" - ], - "signature": "let stableSortBy: (array<'a>, ('a, 'a) => int) => array<'a>" - }, - { - "id": "Belt.SortArray.binarySearchByU", - "kind": "value", - "name": "binarySearchByU", - "docstrings": [], - "signature": "let binarySearchByU: (array<'a>, 'a, ('a, 'a) => int) => int", - "deprecated": "Use `binarySearchBy` instead" - }, - { - "id": "Belt.SortArray.binarySearchBy", - "kind": "value", - "name": "binarySearchBy", - "docstrings": [ - "If value is not found and value is less than one or more elements in array, the\nnegative number returned is the bitwise complement of the index of the first\nelement that is larger than value.\n\nIf value is not found and value is greater\nthan all elements in array, the negative number returned is the bitwise\ncomplement of (the index of the last element plus 1)for example, if `key` is\nsmaller than all elements return `-1` since `lnot(-1) == 0` if `key` is larger\nthan all elements return `lnot(-1) == 0` since `lnot(- (len + 1)) == len`\n\n## Examples\n\n```rescript\nBelt.SortArray.binarySearchBy([1, 2, 3, 4, 33, 35, 36], 33, Pervasives.compare) == 4\n\nlnot(Belt.SortArray.binarySearchBy([1, 3, 5, 7], 4, Pervasives.compare)) == 2\n```" - ], - "signature": "let binarySearchBy: (array<'a>, 'a, ('a, 'a) => int) => int" - }, - { - "id": "Belt.SortArray.unionU", - "kind": "value", - "name": "unionU", - "docstrings": [], - "signature": "let unionU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int", - "deprecated": "Use `union` instead" - }, - { - "id": "Belt.SortArray.union", - "kind": "value", - "name": "union", - "docstrings": [ - "`union src src1ofs src1len src2 src2ofs src2len dst dstofs cmp` assume `src` and\n`src2` is strictly sorted. for equivalent elements, it is picked from `src`\nalso assume that `dst` is large enough to store all elements" - ], - "signature": "let union: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int" - }, - { - "id": "Belt.SortArray.intersectU", - "kind": "value", - "name": "intersectU", - "docstrings": [], - "signature": "let intersectU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int", - "deprecated": "Use `intersect` instead" - }, - { - "id": "Belt.SortArray.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "`union src src1ofs src1len src2 src2ofs src2len dst dstofs cmp`\n\n**return** the `offset` in the output array" - ], - "signature": "let intersect: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int" - }, - { - "id": "Belt.SortArray.diffU", - "kind": "value", - "name": "diffU", - "docstrings": [], - "signature": "let diffU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int", - "deprecated": "Use `diff` instead" - }, - { - "id": "Belt.SortArray.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int" - } - ] - }, - "belt/array": { - "id": "Belt.Array", - "name": "Array", - "docstrings": [ - "[`Belt.Array`]()\n\n **mutable array**: Utilities functions", - "Utilities for `Array` functions." - ], - "items": [ - { - "id": "Belt.Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = array<'a>" - }, - { - "id": "Belt.Array.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Return the size of the array\n\n## Examples\n\n```rescript\nBelt.Array.length([\"test\"]) == 1\n```" - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Belt.Array.size", - "kind": "value", - "name": "size", - "docstrings": [ - "See [`Belt.Array.length`]()" - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.Array.get", - "kind": "value", - "name": "get", - "docstrings": [ - "If `i <= 0 <= length(arr)` returns `Some(value)` where `value` is the item at index `i`.\nIf `i` is out of range returns `None`.\n\n## Examples\n\n```rescript\nBelt.Array.get([\"a\", \"b\", \"c\"], 0) == Some(\"a\")\nBelt.Array.get([\"a\", \"b\", \"c\"], 3) == None\nBelt.Array.get([\"a\", \"b\", \"c\"], -1) == None\n```" - ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, - { - "id": "Belt.Array.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Throw an exception if `i` is out of range.\nOtherwise return the value at index `i` in `arr`." - ], - "signature": "let getExn: (t<'a>, int) => 'a" - }, - { - "id": "Belt.Array.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Throw an exception if `i` is out of range.\nOtherwise return the value at index `i` in `arr`." - ], - "signature": "let getOrThrow: (t<'a>, int) => 'a" - }, - { - "id": "Belt.Array.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(arr, i)`\n\n**Unsafe**\n\nno bounds checking; this would cause type error if `i` does not stay within range" - ], - "signature": "let getUnsafe: (t<'a>, int) => 'a" - }, - { - "id": "Belt.Array.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "`getUndefined(arr, i)`\n\nIt does the samething in the runtime as [`getUnsafe`]();\nit is _type safe_ since the return type still track whether it is\nin range or not" - ], - "signature": "let getUndefined: (t<'a>, int) => Js.undefined<'a>" - }, - { - "id": "Belt.Array.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(arr, n, x)` modifies `arr` in place; it replaces the nth element of `arr`\nwith `x`. Returning `false` means not updated due to out of range." - ], - "signature": "let set: (t<'a>, int, 'a) => bool" - }, - { - "id": "Belt.Array.setExn", - "kind": "value", - "name": "setExn", - "docstrings": [ - "`setExn(arr, i, x)` throw an exception if `i` is out of range." - ], - "signature": "let setExn: (t<'a>, int, 'a) => unit" - }, - { - "id": "Belt.Array.setOrThrow", - "kind": "value", - "name": "setOrThrow", - "docstrings": [ - "`setOrThrow(arr, i, x)` throw an exception if `i` is out of range." - ], - "signature": "let setOrThrow: (t<'a>, int, 'a) => unit" - }, - { - "id": "Belt.Array.setUnsafe", - "kind": "value", - "name": "setUnsafe", - "docstrings": [], - "signature": "let setUnsafe: (t<'a>, int, 'a) => unit" - }, - { - "id": "Belt.Array.shuffleInPlace", - "kind": "value", - "name": "shuffleInPlace", - "docstrings": [ - "`shuffleInPlace(arr)` randomly re-orders the items in `arr`" - ], - "signature": "let shuffleInPlace: t<'a> => unit" - }, - { - "id": "Belt.Array.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "Returns a fresh array with items in original array randomly shuffled." - ], - "signature": "let shuffle: t<'a> => t<'a>" - }, - { - "id": "Belt.Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [ - "`reverseInPlace(arr)` reverses items in `arr` in place.\n\n## Examples\n\n```rescript\nlet arr = [10, 11, 12, 13, 14]\n\nlet () = Belt.Array.reverseInPlace(arr)\n\narr == [14, 13, 12, 11, 10]\n```" - ], - "signature": "let reverseInPlace: t<'a> => unit" - }, - { - "id": "Belt.Array.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(arr)` returns a fresh array with items in arr in reverse order.\n\n## Examples\n\n```rescript\nBelt.Array.reverse([10, 11, 12, 13, 14]) == [14, 13, 12, 11, 10]\n```" - ], - "signature": "let reverse: t<'a> => t<'a>" - }, - { - "id": "Belt.Array.makeUninitialized", - "kind": "value", - "name": "makeUninitialized", - "docstrings": [ - "`makeUninitialized(n)` creates an array of length `n` filled with the undefined\nvalue. You must specify the type of data that will eventually fill the array.\n\n## Examples\n\n```rescript\nlet arr: array> = Belt.Array.makeUninitialized(5)\n\nBelt.Array.getExn(arr, 0) == Js.undefined\n```" - ], - "signature": "let makeUninitialized: int => array>" - }, - { - "id": "Belt.Array.makeUninitializedUnsafe", - "kind": "value", - "name": "makeUninitializedUnsafe", - "docstrings": [ - "**Unsafe**\n\n## Examples\n\n```rescript\nlet arr = Belt.Array.makeUninitializedUnsafe(5)\n\nJs.log(Belt.Array.getExn(arr, 0)) // undefined\n\nBelt.Array.setExn(arr, 0, \"example\")\n\nBelt.Array.getExn(arr, 0) == \"example\"\n```" - ], - "signature": "let makeUninitializedUnsafe: int => t<'a>" - }, - { - "id": "Belt.Array.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(n, e)` return an array of size `n` filled with value `e`.\nReturns an empty array when `n` is negative." - ], - "signature": "let make: (int, 'a) => t<'a>" - }, - { - "id": "Belt.Array.range", - "kind": "value", - "name": "range", - "docstrings": [ - "`range(start, finish)` create an inclusive array.\n\n## Examples\n\n```rescript\nBelt.Array.range(0, 3) == [0, 1, 2, 3]\n\nBelt.Array.range(3, 0) == []\n\nBelt.Array.range(3, 3) == [3]\n```" - ], - "signature": "let range: (int, int) => array" - }, - { - "id": "Belt.Array.rangeBy", - "kind": "value", - "name": "rangeBy", - "docstrings": [ - "`rangeBy(start, finish, ~step)` returns empty array when step is 0 or negative.\nIt also return an empty array when `start > finish`.\n\n## Examples\n\n```rescript\nBelt.Array.rangeBy(0, 10, ~step=3) == [0, 3, 6, 9]\n\nBelt.Array.rangeBy(0, 12, ~step=3) == [0, 3, 6, 9, 12]\n\nBelt.Array.rangeBy(33, 0, ~step=1) == []\n\nBelt.Array.rangeBy(33, 0, ~step=-1) == []\n\nBelt.Array.rangeBy(3, 12, ~step=-1) == []\n\nBelt.Array.rangeBy(3, 3, ~step=0) == []\n\nBelt.Array.rangeBy(3, 3, ~step=1) == [3]\n```" - ], - "signature": "let rangeBy: (int, int, ~step: int) => array" - }, - { - "id": "Belt.Array.makeByU", - "kind": "value", - "name": "makeByU", - "docstrings": [], - "signature": "let makeByU: (int, int => 'a) => t<'a>", - "deprecated": "Use `makeBy` instead" - }, - { - "id": "Belt.Array.makeBy", - "kind": "value", - "name": "makeBy", - "docstrings": [ - "`makeBy(n, f)` return an empty array when n is negative return an array of size\nn populated by `f(i)` start from `0` to `n - 1`.\n\n## Examples\n\n```rescript\nBelt.Array.makeBy(5, i => i) == [0, 1, 2, 3, 4]\n\nBelt.Array.makeBy(5, i => i * i) == [0, 1, 4, 9, 16]\n```" - ], - "signature": "let makeBy: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.Array.makeByAndShuffleU", - "kind": "value", - "name": "makeByAndShuffleU", - "docstrings": [], - "signature": "let makeByAndShuffleU: (int, int => 'a) => t<'a>", - "deprecated": "Use `makeByAndShuffle` instead" - }, - { - "id": "Belt.Array.makeByAndShuffle", - "kind": "value", - "name": "makeByAndShuffle", - "docstrings": [ - "Equivalent to `shuffle(makeBy(n, f))`" - ], - "signature": "let makeByAndShuffle: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.Array.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "`zip(a, b)` create an array of pairs from corresponding elements of a and b.\nStop with the shorter array.\n\n## Examples\n\n```rescript\nBelt.Array.zip([1, 2], [3, 4, 5]) == [(1, 3), (2, 4)]\n```" - ], - "signature": "let zip: (t<'a>, array<'b>) => array<('a, 'b)>" - }, - { - "id": "Belt.Array.zipByU", - "kind": "value", - "name": "zipByU", - "docstrings": [], - "signature": "let zipByU: (t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>", - "deprecated": "Use `zipBy` instead" - }, - { - "id": "Belt.Array.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "`zipBy(xs, ys, f)` create an array by applying `f` to corresponding elements of\n`xs` and `ys`. Stops with shorter array.\n\nEquivalent to `map(zip(xs, ys), ((a, b)) => f(a, b))`\n\n## Examples\n\n```rescript\nBelt.Array.zipBy([1, 2, 3], [4, 5], (a, b) => 2 * a + b) == [6, 9]\n```" - ], - "signature": "let zipBy: (t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>" - }, - { - "id": "Belt.Array.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "`unzip(a)` takes an array of pairs and creates a pair of arrays. The first array\ncontains all the first items of the pairs; the second array contains all the\nsecond items.\n\n## Examples\n\n```rescript\nBelt.Array.unzip([(1, 2), (3, 4)]) == ([1, 3], [2, 4])\n\nBelt.Array.unzip([(1, 2), (3, 4), (5, 6), (7, 8)]) == ([1, 3, 5, 7], [2, 4, 6, 8])\n```" - ], - "signature": "let unzip: array<('a, 'b)> => (t<'a>, array<'b>)" - }, - { - "id": "Belt.Array.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(xs, ys)` returns a fresh array containing the concatenation of the arrays\n`v1` and `v2`, so even if `v1` or `v2` is empty; it can not be shared.\n\n## Examples\n\n```rescript\nBelt.Array.concat([1, 2, 3], [4, 5]) == [1, 2, 3, 4, 5]\n\nBelt.Array.concat([], [\"a\", \"b\", \"c\"]) == [\"a\", \"b\", \"c\"]\n```" - ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Belt.Array.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(xss)` returns a fresh array as the concatenation of `xss` (an array of arrays)\n\n## Examples\n\n```rescript\nBelt.Array.concatMany([[1, 2, 3], [4, 5, 6], [7, 8]]) == [1, 2, 3, 4, 5, 6, 7, 8]\n```" - ], - "signature": "let concatMany: array> => t<'a>" - }, - { - "id": "Belt.Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(xs, offset, len)` creates a new array with the len elements of `xs`\nstarting at `offset` for `offset` can be negative;and is evaluated as\n`length(xs) - offset(slice, xs) - 1(1)` means get the last element as a\nsingleton array `slice(xs, ~-len, len)` will return a copy of the array if the\narray does not have enough data; `slice` extracts through the end of sequence.\n\nif `len` is negative; returns the empty array.\n\n## Examples\n\n```rescript\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=2, ~len=3) == [12, 13, 14]\n\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=-4, ~len=3) == [13, 14, 15]\n\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=4, ~len=9) == [14, 15, 16]\n```" - ], - "signature": "let slice: (t<'a>, ~offset: int, ~len: int) => t<'a>" - }, - { - "id": "Belt.Array.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(xs, offset)` creates a new array with the elements of `xs` starting\nat `offset`\n\n`offset` can be negative; and is evaluated as `length(xs) - offset(sliceToEnd, xs) - 1`\nmeans get the last element as a singleton array\n\n`sliceToEnd(xs, 0)` will return a copy of the array\n\n## Examples\n\n```rescript\nBelt.Array.sliceToEnd([10, 11, 12, 13, 14, 15, 16], 2) == [12, 13, 14, 15, 16]\n\nBelt.Array.sliceToEnd([10, 11, 12, 13, 14, 15, 16], -4) == [13, 14, 15, 16]\n```" - ], - "signature": "let sliceToEnd: (t<'a>, int) => t<'a>" - }, - { - "id": "Belt.Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(a)` returns a copy of `a`; that is; a fresh array containing the same\nelements as `a`." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.Array.fill", - "kind": "value", - "name": "fill", - "docstrings": [ - "`fill(arr, ~offset, ~len, x)` modifies `arr` in place, storing `x` in elements\nnumber `offset` to `offset + len - 1`. `offset` can be negative; and is evaluated\nas `length(arr - offset)`.\n\n`fill(arr, ~offset=-1, ~len=1)` means fill the last element, if the array does not have enough data; `fill` will ignore it\n\n## Examples\n\n```rescript\nlet arr = Belt.Array.makeBy(5, i => i)\n\nBelt.Array.fill(arr, ~offset=2, ~len=2, 9)\n\narr == [0, 1, 9, 9, 4]\n\nBelt.Array.fill(arr, ~offset=7, ~len=2, 8)\n\narr == [0, 1, 9, 9, 4]\n```" - ], - "signature": "let fill: (t<'a>, ~offset: int, ~len: int, 'a) => unit" - }, - { - "id": "Belt.Array.blit", - "kind": "value", - "name": "blit", - "docstrings": [ - "`blit(~src=v1, ~srcOffset=o1, ~dst=v2, ~dstOffset=o2, ~len)` copies `len` elements\nfrom array `v1`;starting at element number `o1`;to array `v2`, starting at element\nnumber `o2`. It works correctly even if `v1` and `v2` are the same array and the\nsource and destination chunks overlap.\n\n`offset` can be negative; `-1` means `len - 1`; if `len + offset` is still negative;it will be set as 0\n\nFor each of the examples;presume that `v1 == [10, 11, 12, 13, 14, 15, 16, 17]` and `v2 == [20, 21, 22, 23, 24, 25, 26, 27]`. The result shown is the content of the destination array.\n\n## Examples\n\n```rescript\nlet v1 = [10, 11, 12, 13, 14, 15, 16, 17]\nlet v2 = [20, 21, 22, 23, 24, 25, 26, 27]\n\nBelt.Array.blit(~src=v1, ~srcOffset=4, ~dst=v2, ~dstOffset=2, ~len=3)\nv2 == [20, 21, 14, 15, 16, 25, 26, 27]\n\nBelt.Array.blit(~src=v1, ~srcOffset=4, ~dst=v1, ~dstOffset=2, ~len=3)\nv1 == [10, 11, 14, 15, 16, 15, 16, 17]\n```" - ], - "signature": "let blit: (\n ~src: t<'a>,\n ~srcOffset: int,\n ~dst: t<'a>,\n ~dstOffset: int,\n ~len: int,\n) => unit" - }, - { - "id": "Belt.Array.blitUnsafe", - "kind": "value", - "name": "blitUnsafe", - "docstrings": [ - "Unsafe blit without bounds checking." - ], - "signature": "let blitUnsafe: (\n ~src: t<'a>,\n ~srcOffset: int,\n ~dst: t<'a>,\n ~dstOffset: int,\n ~len: int,\n) => unit" - }, - { - "id": "Belt.Array.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(xs, f)`\n\nCall `f` on each element of `xs` from the beginning to end. `f` returns `unit`\nso no new array is created. Use `forEach` when you are primarily concerned with\nrepetitively creating side effects.\n\n## Examples\n\n```rescript\nBelt.Array.forEach([\"a\", \"b\", \"c\"], x => Js.log(\"Item: \" ++ x))\n\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\nlet total = ref(0)\n\nBelt.Array.forEach([1, 2, 3, 4], x => total := total.contents + x)\n\ntotal.contents == 1 + 2 + 3 + 4\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.Array.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => array<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Array.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(xs, f)` returns a new array by calling `f` for each element of `xs` from\nthe beginning to end.\n\n## Examples\n\n```rescript\nBelt.Array.map([1, 2], x => x + 1) == [2, 3]\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Belt.Array.flatMapU", - "kind": "value", - "name": "flatMapU", - "docstrings": [], - "signature": "let flatMapU: (t<'a>, 'a => array<'b>) => array<'b>", - "deprecated": "Use `flatMap` instead" - }, - { - "id": "Belt.Array.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(xs, f)` returns a new array by calling `f` for each element of `xs` from\nthe beginning to end, concatenating the results.\n\n## Examples\n\n```rescript\nBelt.Array.flatMap([1, 2], x => [x + 10, x + 20]) == [11, 21, 12, 22]\n```" - ], - "signature": "let flatMap: (t<'a>, 'a => array<'b>) => array<'b>" - }, - { - "id": "Belt.Array.getByU", - "kind": "value", - "name": "getByU", - "docstrings": [], - "signature": "let getByU: (t<'a>, 'a => bool) => option<'a>", - "deprecated": "Use `getBy` instead" - }, - { - "id": "Belt.Array.getBy", - "kind": "value", - "name": "getBy", - "docstrings": [ - "`getBy(xs, p)` returns `Some(value)` for the first value in `xs` that satisifies\nthe predicate function `p`; returns `None` if no element satisifies the function.\n\n## Examples\n\n```rescript\nBelt.Array.getBy([1, 4, 3, 2], x => mod(x, 2) == 0) == Some(4)\nBelt.Array.getBy([15, 13, 11], x => mod(x, 2) == 0) == None\n```" - ], - "signature": "let getBy: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Belt.Array.getIndexByU", - "kind": "value", - "name": "getIndexByU", - "docstrings": [], - "signature": "let getIndexByU: (t<'a>, 'a => bool) => option", - "deprecated": "Use `getIndexBy` instead" - }, - { - "id": "Belt.Array.getIndexBy", - "kind": "value", - "name": "getIndexBy", - "docstrings": [ - "`getIndexBy(xs, p)` returns `Some(index)` for the first value in `xs` that\nsatisifies the predicate function `p`; returns `None` if no element satisifies\nthe function.\n\n## Examples\n\n```rescript\nBelt.Array.getIndexBy([1, 4, 3, 2], x => mod(x, 2) == 0) == Some(1)\nBelt.Array.getIndexBy([15, 13, 11], x => mod(x, 2) == 0) == None\n```" - ], - "signature": "let getIndexBy: (t<'a>, 'a => bool) => option" - }, - { - "id": "Belt.Array.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Array.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(xs, p)` returns a new array that keep all elements satisfy `p`." - ], - "signature": "let keep: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Belt.Array.keepWithIndexU", - "kind": "value", - "name": "keepWithIndexU", - "docstrings": [], - "signature": "let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "Use `keepWithIndex` instead" - }, - { - "id": "Belt.Array.keepWithIndex", - "kind": "value", - "name": "keepWithIndex", - "docstrings": [ - "`keepWithIndex(xs, p)` returns a new array that keep all elements satisfy `p`.\n\n## Examples\n\n```rescript\nBelt.Array.keepWithIndex([1, 2, 3], (_x, i) => i == 1) == [2]\n```" - ], - "signature": "let keepWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" - }, - { - "id": "Belt.Array.keepMapU", - "kind": "value", - "name": "keepMapU", - "docstrings": [], - "signature": "let keepMapU: (t<'a>, 'a => option<'b>) => array<'b>", - "deprecated": "Use `keepMap` instead" - }, - { - "id": "Belt.Array.keepMap", - "kind": "value", - "name": "keepMap", - "docstrings": [ - "`keepMap(xs, p)` returns a new array that keep all elements that return a non\nNone applied `p`.\n\n## Examples\n\n```rescript\nBelt.Array.keepMap([1, 2, 3], x =>\n if mod(x, 2) == 0 {\n Some(x)\n } else {\n None\n }\n) == [2]\n```" - ], - "signature": "let keepMap: (t<'a>, 'a => option<'b>) => array<'b>" - }, - { - "id": "Belt.Array.forEachWithIndexU", - "kind": "value", - "name": "forEachWithIndexU", - "docstrings": [], - "signature": "let forEachWithIndexU: (t<'a>, (int, 'a) => unit) => unit", - "deprecated": "Use `forEachWithIndex` instead" - }, - { - "id": "Belt.Array.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(xs, f)` same as `Belt.Array.forEach`, except that `f` is\nsupplied two arguments: the index starting from 0 and the element from `xs`.\n\n## Examples\n\n```rescript\nBelt.Array.forEachWithIndex([\"a\", \"b\", \"c\"], (i, x) =>\n Js.log(\"Item \" ++ Belt.Int.toString(i) ++ \" is \" ++ x)\n)\n\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\nlet total = ref(0)\n\nBelt.Array.forEachWithIndex([10, 11, 12, 13], (i, x) => total := total.contents + x + i)\n\ntotal.contents == 0 + 10 + 1 + 11 + 2 + 12 + 3 + 13\n```" - ], - "signature": "let forEachWithIndex: (t<'a>, (int, 'a) => unit) => unit" - }, - { - "id": "Belt.Array.mapWithIndexU", - "kind": "value", - "name": "mapWithIndexU", - "docstrings": [], - "signature": "let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => array<'b>", - "deprecated": "Use `mapWithIndex` instead" - }, - { - "id": "Belt.Array.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(xs, f)` applies `f` to each element of `xs`. Function `f` takes\ntwo arguments: the index starting from 0 and the element from `xs`.\n\n## Examples\n\n```rescript\nBelt.Array.mapWithIndex([1, 2, 3], (i, x) => i + x) == [0 + 1, 1 + 2, 2 + 3]\n```" - ], - "signature": "let mapWithIndex: (t<'a>, (int, 'a) => 'b) => array<'b>" - }, - { - "id": "Belt.Array.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Array.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(f, a)` split array into tuple of two arrays based on predicate `f`;\nfirst of tuple where predicate cause true, second where predicate cause false\n\n## Examples\n\n```rescript\nBelt.Array.partition([1, 2, 3, 4, 5], x => mod(x, 2) == 0) == ([2, 4], [1, 3, 5])\n\nBelt.Array.partition([1, 2, 3, 4, 5], x => mod(x, 2) != 0) == ([1, 3, 5], [2, 4])\n```" - ], - "signature": "let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)" - }, - { - "id": "Belt.Array.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(xs, init, f)` applies `f` to each element of `xs` from beginning to end.\nFunction `f` has two parameters: the item from the list and an “accumulator”;\nwhich starts with a value of `init`. `reduce` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nBelt.Array.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\nBelt.Array.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n```" - ], - "signature": "let reduce: (array<'b>, 'a, ('a, 'b) => 'a) => 'a" - }, - { - "id": "Belt.Array.reduceReverseU", - "kind": "value", - "name": "reduceReverseU", - "docstrings": [], - "signature": "let reduceReverseU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a", - "deprecated": "Use `reduceReverse` instead" - }, - { - "id": "Belt.Array.reduceReverse", - "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "`reduceReverse(xs, init, f)` works like `Belt.Array.reduce` except that\nfunction `f` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nBelt.Array.reduceReverse([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n```" - ], - "signature": "let reduceReverse: (array<'b>, 'a, ('a, 'b) => 'a) => 'a" - }, - { - "id": "Belt.Array.reduceReverse2U", - "kind": "value", - "name": "reduceReverse2U", - "docstrings": [], - "signature": "let reduceReverse2U: (t<'a>, array<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c", - "deprecated": "Use `reduceReverse2` instead" - }, - { - "id": "Belt.Array.reduceReverse2", - "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "`reduceReverse2(xs, ys, init, f)` reduces two arrays xs and ys;taking items\nstarting at `min(length(xs), length(ys))` down to and including zero.\n\n## Examples\n\n```rescript\nBelt.Array.reduceReverse2([1, 2, 3], [1, 2], 0, (acc, x, y) => acc + x + y) == 6\n```" - ], - "signature": "let reduceReverse2: (t<'a>, array<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" - }, - { - "id": "Belt.Array.reduceWithIndexU", - "kind": "value", - "name": "reduceWithIndexU", - "docstrings": [], - "signature": "let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b", - "deprecated": "Use `reduceWithIndex` instead" - }, - { - "id": "Belt.Array.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "Applies `f` to each element of `xs` from beginning to end. Function `f` has\nthree parameters: the item from the array and an “accumulator”, which starts\nwith a value of `init` and the index of each element. `reduceWithIndex` returns\nthe final value of the accumulator.\n\n## Examples\n\n```rescript\nBelt.Array.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n```" - ], - "signature": "let reduceWithIndex: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Belt.Array.joinWithU", - "kind": "value", - "name": "joinWithU", - "docstrings": [], - "signature": "let joinWithU: (t<'a>, string, 'a => string) => string", - "deprecated": "Use `joinWith` instead" - }, - { - "id": "Belt.Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "`joinWith(xs, sep, toString)`\n\nConcatenates all the elements of `xs` converted to string with `toString`, each\nseparated by `sep`, the string given as the second argument, into a single string.\nIf the array has only one element, then that element will be returned without\nusing the separator. If the array is empty, the empty string will be returned.\n\n## Examples\n\n```rescript\nBelt.Array.joinWith([0, 1], \", \", Js.Int.toString) == \"0, 1\"\nBelt.Array.joinWith([], \" \", Js.Int.toString) == \"\"\nBelt.Array.joinWith([1], \" \", Js.Int.toString) == \"1\"\n```" - ], - "signature": "let joinWith: (t<'a>, string, 'a => string) => string" - }, - { - "id": "Belt.Array.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Array.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(xs, p)` returns true if at least one of the elements in `xs` satifies `p`;\nwhere `p` is a predicate: a function taking an element and returning a `bool`.\n\n## Examples\n\n```rescript\nBelt.Array.some([2, 3, 4], x => mod(x, 2) == 1) == true\n\nBelt.Array.some([-1, -3, -5], x => x > 0) == false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.Array.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Array.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(xs, p)` returns `true` if all elements satisfy `p`; where `p` is a\npredicate: a function taking an element and returning a `bool`.\n\n## Examples\n\n```rescript\nBelt.Array.every([1, 3, 5], x => mod(x, 2) == 1) == true\n\nBelt.Array.every([1, -3, 5], x => x > 0) == false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.Array.every2U", - "kind": "value", - "name": "every2U", - "docstrings": [], - "signature": "let every2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `every2` instead" - }, - { - "id": "Belt.Array.every2", - "kind": "value", - "name": "every2", - "docstrings": [ - "`every2(xs, ys, p)` returns true if `p(xi, yi)` is true for all pairs of\nelements up to the shorter length (i.e. `min(length(xs), length(ys))`)\n\n## Examples\n\n```rescript\nBelt.Array.every2([1, 2, 3], [0, 1], (a, b) => a > b) == true\n\nBelt.Array.every2([], [1], (x, y) => x > y) == true\n\nBelt.Array.every2([2, 3], [1], (x, y) => x > y) == true\n\nBelt.Array.every2([0, 1], [5, 0], (x, y) => x > y) == false\n```" - ], - "signature": "let every2: (t<'a>, array<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Array.some2U", - "kind": "value", - "name": "some2U", - "docstrings": [], - "signature": "let some2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `some2` instead" - }, - { - "id": "Belt.Array.some2", - "kind": "value", - "name": "some2", - "docstrings": [ - "`some2(xs, ys, p)` returns true if `p(xi, yi)` is true for any pair of elements\nup to the shorter length (i.e. `min(length(xs), length(ys))`)\n\n## Examples\n\n```rescript\nBelt.Array.some2([0, 2], [1, 0, 3], (a, b) => a > b) == true\n\nBelt.Array.some2([], [1], (x, y) => x > y) == false\n\nBelt.Array.some2([2, 3], [1, 4], (x, y) => x > y) == true\n```" - ], - "signature": "let some2: (t<'a>, array<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Array.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Array.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(xs, ys, f)` compared by length if `length(xs) != length(ys)`; returning `-1`\nif `length(xs) < length(ys)` or 1 if `length(xs) > length(ys)`. Otherwise\ncompare one by one `f(x, y)`. `f` returns a negative number if `x` is “less than” `y`\nzero if `x` is “equal to” `y` a positive number if `x` is “greater than”\n`y`. The comparison returns the first non-zero result of `f`; or zero if `f`\nreturns zero for all `x` and `y`.\n\n## Examples\n\n```rescript\nBelt.Array.cmp([1, 3, 5], [1, 4, 2], (a, b) => compare(a, b)) == -1\n\nBelt.Array.cmp([1, 3, 5], [1, 2, 3], (a, b) => compare(a, b)) == 1\n\nBelt.Array.cmp([1, 3, 5], [1, 3, 5], (a, b) => compare(a, b)) == 0\n```" - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.Array.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Array.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(xs, ys)` return `false` if length is not the same otherwise compare items\none by one using `f(xi, yi)`; and return true if all results are true false otherwise\n\n## Examples\n\n```rescript\nBelt.Array.eq([1, 2, 3], [-1, -2, -3], (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.Array.truncateToLengthUnsafe", - "kind": "value", - "name": "truncateToLengthUnsafe", - "docstrings": [ - "Unsafe `truncateToLengthUnsafe(xs, n)` sets length of array `xs` to `n`. If `n`\nis greater than the length of `xs`; the extra elements are set to `Js.Null_undefined.null`.\nIf `n` is less than zero; throws a `RangeError`.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n\nBelt.Array.truncateToLengthUnsafe(arr, 3)\n\narr == [\"ant\", \"bee\", \"cat\"]\n```" - ], - "signature": "let truncateToLengthUnsafe: (t<'a>, int) => unit" - }, - { - "id": "Belt.Array.initU", - "kind": "value", - "name": "initU", - "docstrings": [], - "signature": "let initU: (int, int => 'a) => t<'a>", - "deprecated": "Use `init` instead" - }, - { - "id": "Belt.Array.init", - "kind": "value", - "name": "init", - "docstrings": [], - "signature": "let init: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.Array.push", - "kind": "value", - "name": "push", - "docstrings": [ - "`arr->push(item)` pushes an element `item` into an array `arr`." - ], - "signature": "let push: (t<'a>, 'a) => unit" - } - ] - }, - "belt/id": { - "id": "Belt.Id", - "name": "Id", - "docstrings": [ - "[`Belt.Id`]()\n\n Provide utilities to create identified comparators or hashes for\n data structures used below.\n\n It create a unique identifier per module of\n functions so that different data structures with slightly different\n comparison functions won't mix", - "[`Belt.Id`]()\n\nProvide utiliites to create identified comparators or hashes for\ndata structures used below.\n\nIt create a unique identifer per module of functions so that different data structures with slightly different\ncomparison functions won't mix." - ], - "items": [ - { - "id": "Belt.Id.hash", - "kind": "type", - "name": "hash", - "docstrings": [ - "`('a, 'id) hash`\n\nIts runtime represenation is a `hash` function, but signed with a\ntype parameter, so that different hash functions type mismatch" - ], - "signature": "type hash<'a, 'id>" - }, - { - "id": "Belt.Id.eq", - "kind": "type", - "name": "eq", - "docstrings": [ - "`('a, 'id) eq`\n\nIts runtime represenation is an `eq` function, but signed with a\ntype parameter, so that different hash functions type mismatch" - ], - "signature": "type eq<'a, 'id>" - }, - { - "id": "Belt.Id.cmp", - "kind": "type", - "name": "cmp", - "docstrings": [ - "`('a,'id) cmp`\n\nIts runtime representation is a `cmp` function, but signed with a\ntype parameter, so that different hash functions type mismatch" - ], - "signature": "type cmp<'a, 'id>" - }, - { - "id": "Belt.Id.comparable", - "kind": "type", - "name": "comparable", - "docstrings": [ - "`('key, 'id) cmparable` is a module of functions, here it only includes `cmp`.\n\nUnlike normal functions, when created, it comes with a unique identity (guaranteed\nby the type system).\n\nIt can be created using function [`comparableU`]() or [`comparable`]().\n\nThe idea of a unique identity when created is that it makes sure two sets would type\nmismatch if they use different comparison function" - ], - "signature": "type comparable<'key, 'id> = module(Comparable\n with type identity = 'id\n and type t = 'key)" - }, - { - "id": "Belt.Id.comparableU", - "kind": "value", - "name": "comparableU", - "docstrings": [], - "signature": "let comparableU: (\n ~cmp: ('a, 'a) => int,\n) => module(Comparable with type t = 'a)", - "deprecated": "Use `comparable` instead" - }, - { - "id": "Belt.Id.comparable", - "kind": "value", - "name": "comparable", - "docstrings": [], - "signature": "let comparable: (\n ~cmp: ('a, 'a) => int,\n) => module(Comparable with type t = 'a)" - }, - { - "id": "Belt.Id.hashable", - "kind": "type", - "name": "hashable", - "docstrings": [ - "`('key, 'id) hashable` is a module of functions, here it only includes `hash`, `eq`.\n\nUnlike normal functions, when created, it comes with a unique identity (guaranteed\nby the type system).\n\nIt can be created using function [`hashableU`]() or [`hashable`]().\n\nThe idea of a unique identity when created is that it makes sure two hash sets would type\nmismatch if they use different comparison function" - ], - "signature": "type hashable<'key, 'id> = module(Hashable\n with type identity = 'id\n and type t = 'key)" - }, - { - "id": "Belt.Id.hashableU", - "kind": "value", - "name": "hashableU", - "docstrings": [], - "signature": "let hashableU: (\n ~hash: 'a => int,\n ~eq: ('a, 'a) => bool,\n) => module(Hashable with type t = 'a)", - "deprecated": "Use `hashable` instead" - }, - { - "id": "Belt.Id.hashable", - "kind": "value", - "name": "hashable", - "docstrings": [], - "signature": "let hashable: (\n ~hash: 'a => int,\n ~eq: ('a, 'a) => bool,\n) => module(Hashable with type t = 'a)" - }, - { - "id": "Belt.Id.getHashInternal", - "kind": "value", - "name": "getHashInternal", - "docstrings": [], - "signature": "let getHashInternal: hash<'a, 'id> => 'a => int" - }, - { - "id": "Belt.Id.getEqInternal", - "kind": "value", - "name": "getEqInternal", - "docstrings": [], - "signature": "let getEqInternal: eq<'a, 'id> => ('a, 'a) => bool" - }, - { - "id": "Belt.Id.getCmpInternal", - "kind": "value", - "name": "getCmpInternal", - "docstrings": [], - "signature": "let getCmpInternal: cmp<'a, 'id> => ('a, 'a) => int" - } - ] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v12.2.0/dom.json b/apps/docs/data/api/v12.2.0/dom.json deleted file mode 100644 index 2bf0f3038..000000000 --- a/apps/docs/data/api/v12.2.0/dom.json +++ /dev/null @@ -1,1962 +0,0 @@ -{ - "dom": { - "id": "Dom", - "name": "Dom", - "docstrings": [], - "items": [ - { - "id": "Dom._baseClass", - "kind": "type", - "name": "_baseClass", - "docstrings": [], - "signature": "type _baseClass" - }, - { - "id": "Dom.animation", - "kind": "type", - "name": "animation", - "docstrings": [], - "signature": "type animation" - }, - { - "id": "Dom.cssStyleDeclaration", - "kind": "type", - "name": "cssStyleDeclaration", - "docstrings": [], - "signature": "type cssStyleDeclaration" - }, - { - "id": "Dom.cssStyleSheet", - "kind": "type", - "name": "cssStyleSheet", - "docstrings": [], - "signature": "type cssStyleSheet" - }, - { - "id": "Dom.eventTarget_like", - "kind": "type", - "name": "eventTarget_like", - "docstrings": [], - "signature": "type eventTarget_like<'a>" - }, - { - "id": "Dom.eventTarget", - "kind": "type", - "name": "eventTarget", - "docstrings": [], - "signature": "type eventTarget = eventTarget_like<_baseClass>" - }, - { - "id": "Dom._node", - "kind": "type", - "name": "_node", - "docstrings": [], - "signature": "type _node<'a>" - }, - { - "id": "Dom.node_like", - "kind": "type", - "name": "node_like", - "docstrings": [], - "signature": "type node_like<'a> = eventTarget_like<_node<'a>>" - }, - { - "id": "Dom.node", - "kind": "type", - "name": "node", - "docstrings": [], - "signature": "type node = node_like<_baseClass>" - }, - { - "id": "Dom._attr", - "kind": "type", - "name": "_attr", - "docstrings": [], - "signature": "type _attr" - }, - { - "id": "Dom.attr", - "kind": "type", - "name": "attr", - "docstrings": [], - "signature": "type attr = node_like<_attr>" - }, - { - "id": "Dom._characterData", - "kind": "type", - "name": "_characterData", - "docstrings": [], - "signature": "type _characterData<'a>" - }, - { - "id": "Dom.characterData_like", - "kind": "type", - "name": "characterData_like", - "docstrings": [], - "signature": "type characterData_like<'a> = node_like<_characterData<'a>>" - }, - { - "id": "Dom.characterData", - "kind": "type", - "name": "characterData", - "docstrings": [], - "signature": "type characterData = characterData_like<_baseClass>" - }, - { - "id": "Dom._cdataSection", - "kind": "type", - "name": "_cdataSection", - "docstrings": [], - "signature": "type _cdataSection" - }, - { - "id": "Dom.cdataSection", - "kind": "type", - "name": "cdataSection", - "docstrings": [], - "signature": "type cdataSection = characterData_like<_cdataSection>" - }, - { - "id": "Dom._comment", - "kind": "type", - "name": "_comment", - "docstrings": [], - "signature": "type _comment" - }, - { - "id": "Dom.comment", - "kind": "type", - "name": "comment", - "docstrings": [], - "signature": "type comment = characterData_like<_comment>" - }, - { - "id": "Dom._document", - "kind": "type", - "name": "_document", - "docstrings": [], - "signature": "type _document<'a>" - }, - { - "id": "Dom.document_like", - "kind": "type", - "name": "document_like", - "docstrings": [], - "signature": "type document_like<'a> = node_like<_document<'a>>" - }, - { - "id": "Dom.document", - "kind": "type", - "name": "document", - "docstrings": [], - "signature": "type document = document_like<_baseClass>" - }, - { - "id": "Dom._documentFragment", - "kind": "type", - "name": "_documentFragment", - "docstrings": [], - "signature": "type _documentFragment" - }, - { - "id": "Dom.documentFragment", - "kind": "type", - "name": "documentFragment", - "docstrings": [], - "signature": "type documentFragment = node_like<_documentFragment>" - }, - { - "id": "Dom._documentType", - "kind": "type", - "name": "_documentType", - "docstrings": [], - "signature": "type _documentType" - }, - { - "id": "Dom.documentType", - "kind": "type", - "name": "documentType", - "docstrings": [], - "signature": "type documentType = node_like<_documentType>" - }, - { - "id": "Dom.domImplementation", - "kind": "type", - "name": "domImplementation", - "docstrings": [], - "signature": "type domImplementation" - }, - { - "id": "Dom._element", - "kind": "type", - "name": "_element", - "docstrings": [], - "signature": "type _element<'a>" - }, - { - "id": "Dom.element_like", - "kind": "type", - "name": "element_like", - "docstrings": [], - "signature": "type element_like<'a> = node_like<_element<'a>>" - }, - { - "id": "Dom.element", - "kind": "type", - "name": "element", - "docstrings": [], - "signature": "type element = element_like<_baseClass>" - }, - { - "id": "Dom.htmlCollection", - "kind": "type", - "name": "htmlCollection", - "docstrings": [], - "signature": "type htmlCollection" - }, - { - "id": "Dom.htmlFormControlsCollection", - "kind": "type", - "name": "htmlFormControlsCollection", - "docstrings": [], - "signature": "type htmlFormControlsCollection" - }, - { - "id": "Dom.htmlOptionsCollection", - "kind": "type", - "name": "htmlOptionsCollection", - "docstrings": [], - "signature": "type htmlOptionsCollection" - }, - { - "id": "Dom.intersectionObserver", - "kind": "type", - "name": "intersectionObserver", - "docstrings": [], - "signature": "type intersectionObserver" - }, - { - "id": "Dom.intersectionObserverEntry", - "kind": "type", - "name": "intersectionObserverEntry", - "docstrings": [], - "signature": "type intersectionObserverEntry" - }, - { - "id": "Dom.mutationObserver", - "kind": "type", - "name": "mutationObserver", - "docstrings": [], - "signature": "type mutationObserver" - }, - { - "id": "Dom.mutationRecord", - "kind": "type", - "name": "mutationRecord", - "docstrings": [], - "signature": "type mutationRecord" - }, - { - "id": "Dom.performanceObserver", - "kind": "type", - "name": "performanceObserver", - "docstrings": [], - "signature": "type performanceObserver" - }, - { - "id": "Dom.performanceObserverEntryList", - "kind": "type", - "name": "performanceObserverEntryList", - "docstrings": [], - "signature": "type performanceObserverEntryList" - }, - { - "id": "Dom.reportingObserver", - "kind": "type", - "name": "reportingObserver", - "docstrings": [], - "signature": "type reportingObserver" - }, - { - "id": "Dom.reportingObserverOptions", - "kind": "type", - "name": "reportingObserverOptions", - "docstrings": [], - "signature": "type reportingObserverOptions" - }, - { - "id": "Dom.resizeObserver", - "kind": "type", - "name": "resizeObserver", - "docstrings": [], - "signature": "type resizeObserver" - }, - { - "id": "Dom.resizeObserverEntry", - "kind": "type", - "name": "resizeObserverEntry", - "docstrings": [], - "signature": "type resizeObserverEntry" - }, - { - "id": "Dom.namedNodeMap", - "kind": "type", - "name": "namedNodeMap", - "docstrings": [], - "signature": "type namedNodeMap" - }, - { - "id": "Dom.nodeList", - "kind": "type", - "name": "nodeList", - "docstrings": [], - "signature": "type nodeList" - }, - { - "id": "Dom.radioNodeList", - "kind": "type", - "name": "radioNodeList", - "docstrings": [], - "signature": "type radioNodeList" - }, - { - "id": "Dom.processingInstruction", - "kind": "type", - "name": "processingInstruction", - "docstrings": [], - "signature": "type processingInstruction" - }, - { - "id": "Dom._shadowRoot", - "kind": "type", - "name": "_shadowRoot", - "docstrings": [], - "signature": "type _shadowRoot" - }, - { - "id": "Dom.shadowRoot", - "kind": "type", - "name": "shadowRoot", - "docstrings": [], - "signature": "type shadowRoot = node_like<_shadowRoot>" - }, - { - "id": "Dom._text", - "kind": "type", - "name": "_text", - "docstrings": [], - "signature": "type _text" - }, - { - "id": "Dom.text", - "kind": "type", - "name": "text", - "docstrings": [], - "signature": "type text = characterData_like<_text>" - }, - { - "id": "Dom.domRect", - "kind": "type", - "name": "domRect", - "docstrings": [], - "signature": "type domRect" - }, - { - "id": "Dom.dataTransfer", - "kind": "type", - "name": "dataTransfer", - "docstrings": [], - "signature": "type dataTransfer" - }, - { - "id": "Dom.domStringMap", - "kind": "type", - "name": "domStringMap", - "docstrings": [], - "signature": "type domStringMap" - }, - { - "id": "Dom.history", - "kind": "type", - "name": "history", - "docstrings": [], - "signature": "type history" - }, - { - "id": "Dom._htmlDocument", - "kind": "type", - "name": "_htmlDocument", - "docstrings": [], - "signature": "type _htmlDocument" - }, - { - "id": "Dom.htmlDocument", - "kind": "type", - "name": "htmlDocument", - "docstrings": [], - "signature": "type htmlDocument = document_like<_htmlDocument>" - }, - { - "id": "Dom._htmlElement", - "kind": "type", - "name": "_htmlElement", - "docstrings": [], - "signature": "type _htmlElement<'a>" - }, - { - "id": "Dom.htmlElement_like", - "kind": "type", - "name": "htmlElement_like", - "docstrings": [], - "signature": "type htmlElement_like<'a> = element_like<_htmlElement<'a>>" - }, - { - "id": "Dom.htmlElement", - "kind": "type", - "name": "htmlElement", - "docstrings": [], - "signature": "type htmlElement = htmlElement_like<_baseClass>" - }, - { - "id": "Dom._htmlAnchorElement", - "kind": "type", - "name": "_htmlAnchorElement", - "docstrings": [], - "signature": "type _htmlAnchorElement" - }, - { - "id": "Dom.htmlAnchorElement", - "kind": "type", - "name": "htmlAnchorElement", - "docstrings": [], - "signature": "type htmlAnchorElement = htmlElement_like<\n _htmlAnchorElement,\n>" - }, - { - "id": "Dom._htmlAreaElement", - "kind": "type", - "name": "_htmlAreaElement", - "docstrings": [], - "signature": "type _htmlAreaElement" - }, - { - "id": "Dom.htmlAreaElement", - "kind": "type", - "name": "htmlAreaElement", - "docstrings": [], - "signature": "type htmlAreaElement = htmlElement_like<_htmlAreaElement>" - }, - { - "id": "Dom._htmlAudioElement", - "kind": "type", - "name": "_htmlAudioElement", - "docstrings": [], - "signature": "type _htmlAudioElement" - }, - { - "id": "Dom.htmlAudioElement", - "kind": "type", - "name": "htmlAudioElement", - "docstrings": [], - "signature": "type htmlAudioElement = htmlElement_like<_htmlAudioElement>" - }, - { - "id": "Dom._htmlBaseElement", - "kind": "type", - "name": "_htmlBaseElement", - "docstrings": [], - "signature": "type _htmlBaseElement" - }, - { - "id": "Dom.htmlBaseElement", - "kind": "type", - "name": "htmlBaseElement", - "docstrings": [], - "signature": "type htmlBaseElement = htmlElement_like<_htmlBaseElement>" - }, - { - "id": "Dom._htmlBodyElement", - "kind": "type", - "name": "_htmlBodyElement", - "docstrings": [], - "signature": "type _htmlBodyElement" - }, - { - "id": "Dom.htmlBodyElement", - "kind": "type", - "name": "htmlBodyElement", - "docstrings": [], - "signature": "type htmlBodyElement = htmlElement_like<_htmlBodyElement>" - }, - { - "id": "Dom._htmlBrElement", - "kind": "type", - "name": "_htmlBrElement", - "docstrings": [], - "signature": "type _htmlBrElement" - }, - { - "id": "Dom.htmlBrElement", - "kind": "type", - "name": "htmlBrElement", - "docstrings": [], - "signature": "type htmlBrElement = htmlElement_like<_htmlBrElement>" - }, - { - "id": "Dom._htmlButtonElement", - "kind": "type", - "name": "_htmlButtonElement", - "docstrings": [], - "signature": "type _htmlButtonElement" - }, - { - "id": "Dom.htmlButtonElement", - "kind": "type", - "name": "htmlButtonElement", - "docstrings": [], - "signature": "type htmlButtonElement = htmlElement_like<\n _htmlButtonElement,\n>" - }, - { - "id": "Dom._htmlCanvasElement", - "kind": "type", - "name": "_htmlCanvasElement", - "docstrings": [], - "signature": "type _htmlCanvasElement" - }, - { - "id": "Dom.htmlCanvasElement", - "kind": "type", - "name": "htmlCanvasElement", - "docstrings": [], - "signature": "type htmlCanvasElement = htmlElement_like<\n _htmlCanvasElement,\n>" - }, - { - "id": "Dom._htmlDataElement", - "kind": "type", - "name": "_htmlDataElement", - "docstrings": [], - "signature": "type _htmlDataElement" - }, - { - "id": "Dom.htmlDataElement", - "kind": "type", - "name": "htmlDataElement", - "docstrings": [], - "signature": "type htmlDataElement = htmlElement_like<_htmlDataElement>" - }, - { - "id": "Dom._htmlDataListElement", - "kind": "type", - "name": "_htmlDataListElement", - "docstrings": [], - "signature": "type _htmlDataListElement" - }, - { - "id": "Dom.htmlDataListElement", - "kind": "type", - "name": "htmlDataListElement", - "docstrings": [], - "signature": "type htmlDataListElement = htmlElement_like<\n _htmlDataListElement,\n>" - }, - { - "id": "Dom._htmlDialogElement", - "kind": "type", - "name": "_htmlDialogElement", - "docstrings": [], - "signature": "type _htmlDialogElement" - }, - { - "id": "Dom.htmlDialogElement", - "kind": "type", - "name": "htmlDialogElement", - "docstrings": [], - "signature": "type htmlDialogElement = htmlElement_like<\n _htmlDialogElement,\n>" - }, - { - "id": "Dom._htmlDivElement", - "kind": "type", - "name": "_htmlDivElement", - "docstrings": [], - "signature": "type _htmlDivElement" - }, - { - "id": "Dom.htmlDivElement", - "kind": "type", - "name": "htmlDivElement", - "docstrings": [], - "signature": "type htmlDivElement = htmlElement_like<_htmlDivElement>" - }, - { - "id": "Dom._htmlDlistElement", - "kind": "type", - "name": "_htmlDlistElement", - "docstrings": [], - "signature": "type _htmlDlistElement" - }, - { - "id": "Dom.htmlDlistElement", - "kind": "type", - "name": "htmlDlistElement", - "docstrings": [], - "signature": "type htmlDlistElement = htmlElement_like<_htmlDlistElement>" - }, - { - "id": "Dom._htmlEmbedElement", - "kind": "type", - "name": "_htmlEmbedElement", - "docstrings": [], - "signature": "type _htmlEmbedElement" - }, - { - "id": "Dom.htmlEmbedElement", - "kind": "type", - "name": "htmlEmbedElement", - "docstrings": [], - "signature": "type htmlEmbedElement = htmlElement_like<_htmlEmbedElement>" - }, - { - "id": "Dom._htmlFieldSetElement", - "kind": "type", - "name": "_htmlFieldSetElement", - "docstrings": [], - "signature": "type _htmlFieldSetElement" - }, - { - "id": "Dom.htmlFieldSetElement", - "kind": "type", - "name": "htmlFieldSetElement", - "docstrings": [], - "signature": "type htmlFieldSetElement = htmlElement_like<\n _htmlFieldSetElement,\n>" - }, - { - "id": "Dom._htmlFormElement", - "kind": "type", - "name": "_htmlFormElement", - "docstrings": [], - "signature": "type _htmlFormElement" - }, - { - "id": "Dom.htmlFormElement", - "kind": "type", - "name": "htmlFormElement", - "docstrings": [], - "signature": "type htmlFormElement = htmlElement_like<_htmlFormElement>" - }, - { - "id": "Dom._htmlHeadElement", - "kind": "type", - "name": "_htmlHeadElement", - "docstrings": [], - "signature": "type _htmlHeadElement" - }, - { - "id": "Dom.htmlHeadElement", - "kind": "type", - "name": "htmlHeadElement", - "docstrings": [], - "signature": "type htmlHeadElement = htmlElement_like<_htmlHeadElement>" - }, - { - "id": "Dom._htmlHeadingElement", - "kind": "type", - "name": "_htmlHeadingElement", - "docstrings": [], - "signature": "type _htmlHeadingElement" - }, - { - "id": "Dom.htmlHeadingElement", - "kind": "type", - "name": "htmlHeadingElement", - "docstrings": [], - "signature": "type htmlHeadingElement = htmlElement_like<\n _htmlHeadingElement,\n>" - }, - { - "id": "Dom._htmlHrElement", - "kind": "type", - "name": "_htmlHrElement", - "docstrings": [], - "signature": "type _htmlHrElement" - }, - { - "id": "Dom.htmlHrElement", - "kind": "type", - "name": "htmlHrElement", - "docstrings": [], - "signature": "type htmlHrElement = htmlElement_like<_htmlHrElement>" - }, - { - "id": "Dom._htmlHtmlElement", - "kind": "type", - "name": "_htmlHtmlElement", - "docstrings": [], - "signature": "type _htmlHtmlElement" - }, - { - "id": "Dom.htmlHtmlElement", - "kind": "type", - "name": "htmlHtmlElement", - "docstrings": [], - "signature": "type htmlHtmlElement = htmlElement_like<_htmlHtmlElement>" - }, - { - "id": "Dom._htmlIframeElement", - "kind": "type", - "name": "_htmlIframeElement", - "docstrings": [], - "signature": "type _htmlIframeElement" - }, - { - "id": "Dom.htmlIframeElement", - "kind": "type", - "name": "htmlIframeElement", - "docstrings": [], - "signature": "type htmlIframeElement = htmlElement_like<\n _htmlIframeElement,\n>" - }, - { - "id": "Dom._htmlImageElement", - "kind": "type", - "name": "_htmlImageElement", - "docstrings": [], - "signature": "type _htmlImageElement" - }, - { - "id": "Dom.htmlImageElement", - "kind": "type", - "name": "htmlImageElement", - "docstrings": [], - "signature": "type htmlImageElement = htmlElement_like<_htmlImageElement>" - }, - { - "id": "Dom._htmlInputElement", - "kind": "type", - "name": "_htmlInputElement", - "docstrings": [], - "signature": "type _htmlInputElement" - }, - { - "id": "Dom.htmlInputElement", - "kind": "type", - "name": "htmlInputElement", - "docstrings": [], - "signature": "type htmlInputElement = htmlElement_like<_htmlInputElement>" - }, - { - "id": "Dom._htmlLabelElement", - "kind": "type", - "name": "_htmlLabelElement", - "docstrings": [], - "signature": "type _htmlLabelElement" - }, - { - "id": "Dom.htmlLabelElement", - "kind": "type", - "name": "htmlLabelElement", - "docstrings": [], - "signature": "type htmlLabelElement = htmlElement_like<_htmlLabelElement>" - }, - { - "id": "Dom._htmlLegendElement", - "kind": "type", - "name": "_htmlLegendElement", - "docstrings": [], - "signature": "type _htmlLegendElement" - }, - { - "id": "Dom.htmlLegendElement", - "kind": "type", - "name": "htmlLegendElement", - "docstrings": [], - "signature": "type htmlLegendElement = htmlElement_like<\n _htmlLegendElement,\n>" - }, - { - "id": "Dom._htmlLiElement", - "kind": "type", - "name": "_htmlLiElement", - "docstrings": [], - "signature": "type _htmlLiElement" - }, - { - "id": "Dom.htmlLiElement", - "kind": "type", - "name": "htmlLiElement", - "docstrings": [], - "signature": "type htmlLiElement = htmlElement_like<_htmlLiElement>" - }, - { - "id": "Dom._htmlLinkElement", - "kind": "type", - "name": "_htmlLinkElement", - "docstrings": [], - "signature": "type _htmlLinkElement" - }, - { - "id": "Dom.htmlLinkElement", - "kind": "type", - "name": "htmlLinkElement", - "docstrings": [], - "signature": "type htmlLinkElement = htmlElement_like<_htmlLinkElement>" - }, - { - "id": "Dom._htmlMapElement", - "kind": "type", - "name": "_htmlMapElement", - "docstrings": [], - "signature": "type _htmlMapElement" - }, - { - "id": "Dom.htmlMapElement", - "kind": "type", - "name": "htmlMapElement", - "docstrings": [], - "signature": "type htmlMapElement = htmlElement_like<_htmlMapElement>" - }, - { - "id": "Dom._htmlMediaElement", - "kind": "type", - "name": "_htmlMediaElement", - "docstrings": [], - "signature": "type _htmlMediaElement" - }, - { - "id": "Dom.htmlMediaElement", - "kind": "type", - "name": "htmlMediaElement", - "docstrings": [], - "signature": "type htmlMediaElement = htmlElement_like<_htmlMediaElement>" - }, - { - "id": "Dom._htmlMenuElement", - "kind": "type", - "name": "_htmlMenuElement", - "docstrings": [], - "signature": "type _htmlMenuElement" - }, - { - "id": "Dom.htmlMenuElement", - "kind": "type", - "name": "htmlMenuElement", - "docstrings": [], - "signature": "type htmlMenuElement = htmlElement_like<_htmlMenuElement>" - }, - { - "id": "Dom._htmlMetaElement", - "kind": "type", - "name": "_htmlMetaElement", - "docstrings": [], - "signature": "type _htmlMetaElement" - }, - { - "id": "Dom.htmlMetaElement", - "kind": "type", - "name": "htmlMetaElement", - "docstrings": [], - "signature": "type htmlMetaElement = htmlElement_like<_htmlMetaElement>" - }, - { - "id": "Dom._htmlMeterElement", - "kind": "type", - "name": "_htmlMeterElement", - "docstrings": [], - "signature": "type _htmlMeterElement" - }, - { - "id": "Dom.htmlMeterElement", - "kind": "type", - "name": "htmlMeterElement", - "docstrings": [], - "signature": "type htmlMeterElement = htmlElement_like<_htmlMeterElement>" - }, - { - "id": "Dom._htmlModElement", - "kind": "type", - "name": "_htmlModElement", - "docstrings": [], - "signature": "type _htmlModElement" - }, - { - "id": "Dom.htmlModElement", - "kind": "type", - "name": "htmlModElement", - "docstrings": [], - "signature": "type htmlModElement = htmlElement_like<_htmlModElement>" - }, - { - "id": "Dom._htmlOListElement", - "kind": "type", - "name": "_htmlOListElement", - "docstrings": [], - "signature": "type _htmlOListElement" - }, - { - "id": "Dom.htmlOListElement", - "kind": "type", - "name": "htmlOListElement", - "docstrings": [], - "signature": "type htmlOListElement = htmlElement_like<_htmlOListElement>" - }, - { - "id": "Dom._htmlObjectElement", - "kind": "type", - "name": "_htmlObjectElement", - "docstrings": [], - "signature": "type _htmlObjectElement" - }, - { - "id": "Dom.htmlObjectElement", - "kind": "type", - "name": "htmlObjectElement", - "docstrings": [], - "signature": "type htmlObjectElement = htmlElement_like<\n _htmlObjectElement,\n>" - }, - { - "id": "Dom._htmlOptGroupElement", - "kind": "type", - "name": "_htmlOptGroupElement", - "docstrings": [], - "signature": "type _htmlOptGroupElement" - }, - { - "id": "Dom.htmlOptGroupElement", - "kind": "type", - "name": "htmlOptGroupElement", - "docstrings": [], - "signature": "type htmlOptGroupElement = htmlElement_like<\n _htmlOptGroupElement,\n>" - }, - { - "id": "Dom._htmlOptionElement", - "kind": "type", - "name": "_htmlOptionElement", - "docstrings": [], - "signature": "type _htmlOptionElement" - }, - { - "id": "Dom.htmlOptionElement", - "kind": "type", - "name": "htmlOptionElement", - "docstrings": [], - "signature": "type htmlOptionElement = htmlElement_like<\n _htmlOptionElement,\n>" - }, - { - "id": "Dom._htmlOutputElement", - "kind": "type", - "name": "_htmlOutputElement", - "docstrings": [], - "signature": "type _htmlOutputElement" - }, - { - "id": "Dom.htmlOutputElement", - "kind": "type", - "name": "htmlOutputElement", - "docstrings": [], - "signature": "type htmlOutputElement = htmlElement_like<\n _htmlOutputElement,\n>" - }, - { - "id": "Dom._htmlParagraphElement", - "kind": "type", - "name": "_htmlParagraphElement", - "docstrings": [], - "signature": "type _htmlParagraphElement" - }, - { - "id": "Dom.htmlParagraphElement", - "kind": "type", - "name": "htmlParagraphElement", - "docstrings": [], - "signature": "type htmlParagraphElement = htmlElement_like<\n _htmlParagraphElement,\n>" - }, - { - "id": "Dom._htmlParamElement", - "kind": "type", - "name": "_htmlParamElement", - "docstrings": [], - "signature": "type _htmlParamElement" - }, - { - "id": "Dom.htmlParamElement", - "kind": "type", - "name": "htmlParamElement", - "docstrings": [], - "signature": "type htmlParamElement = htmlElement_like<_htmlParamElement>" - }, - { - "id": "Dom._htmlPreElement", - "kind": "type", - "name": "_htmlPreElement", - "docstrings": [], - "signature": "type _htmlPreElement" - }, - { - "id": "Dom.htmlPreElement", - "kind": "type", - "name": "htmlPreElement", - "docstrings": [], - "signature": "type htmlPreElement = htmlElement_like<_htmlPreElement>" - }, - { - "id": "Dom._htmlProgressElement", - "kind": "type", - "name": "_htmlProgressElement", - "docstrings": [], - "signature": "type _htmlProgressElement" - }, - { - "id": "Dom.htmlProgressElement", - "kind": "type", - "name": "htmlProgressElement", - "docstrings": [], - "signature": "type htmlProgressElement = htmlElement_like<\n _htmlProgressElement,\n>" - }, - { - "id": "Dom._htmlQuoteElement", - "kind": "type", - "name": "_htmlQuoteElement", - "docstrings": [], - "signature": "type _htmlQuoteElement" - }, - { - "id": "Dom.htmlQuoteElement", - "kind": "type", - "name": "htmlQuoteElement", - "docstrings": [], - "signature": "type htmlQuoteElement = htmlElement_like<_htmlQuoteElement>" - }, - { - "id": "Dom._htmlScriptElement", - "kind": "type", - "name": "_htmlScriptElement", - "docstrings": [], - "signature": "type _htmlScriptElement" - }, - { - "id": "Dom.htmlScriptElement", - "kind": "type", - "name": "htmlScriptElement", - "docstrings": [], - "signature": "type htmlScriptElement = htmlElement_like<\n _htmlScriptElement,\n>" - }, - { - "id": "Dom._htmlSelectElement", - "kind": "type", - "name": "_htmlSelectElement", - "docstrings": [], - "signature": "type _htmlSelectElement" - }, - { - "id": "Dom.htmlSelectElement", - "kind": "type", - "name": "htmlSelectElement", - "docstrings": [], - "signature": "type htmlSelectElement = htmlElement_like<\n _htmlSelectElement,\n>" - }, - { - "id": "Dom._htmlSlotElement", - "kind": "type", - "name": "_htmlSlotElement", - "docstrings": [], - "signature": "type _htmlSlotElement" - }, - { - "id": "Dom.htmlSlotElement", - "kind": "type", - "name": "htmlSlotElement", - "docstrings": [], - "signature": "type htmlSlotElement = htmlElement_like<_htmlSlotElement>" - }, - { - "id": "Dom._htmlSourceElement", - "kind": "type", - "name": "_htmlSourceElement", - "docstrings": [], - "signature": "type _htmlSourceElement" - }, - { - "id": "Dom.htmlSourceElement", - "kind": "type", - "name": "htmlSourceElement", - "docstrings": [], - "signature": "type htmlSourceElement = htmlElement_like<\n _htmlSourceElement,\n>" - }, - { - "id": "Dom._htmlSpanElement", - "kind": "type", - "name": "_htmlSpanElement", - "docstrings": [], - "signature": "type _htmlSpanElement" - }, - { - "id": "Dom.htmlSpanElement", - "kind": "type", - "name": "htmlSpanElement", - "docstrings": [], - "signature": "type htmlSpanElement = htmlElement_like<_htmlSpanElement>" - }, - { - "id": "Dom._htmlStyleElement", - "kind": "type", - "name": "_htmlStyleElement", - "docstrings": [], - "signature": "type _htmlStyleElement" - }, - { - "id": "Dom.htmlStyleElement", - "kind": "type", - "name": "htmlStyleElement", - "docstrings": [], - "signature": "type htmlStyleElement = htmlElement_like<_htmlStyleElement>" - }, - { - "id": "Dom._htmlTableCaptionElement", - "kind": "type", - "name": "_htmlTableCaptionElement", - "docstrings": [], - "signature": "type _htmlTableCaptionElement" - }, - { - "id": "Dom.htmlTableCaptionElement", - "kind": "type", - "name": "htmlTableCaptionElement", - "docstrings": [], - "signature": "type htmlTableCaptionElement = htmlElement_like<\n _htmlTableCaptionElement,\n>" - }, - { - "id": "Dom._htmlTableCellElement", - "kind": "type", - "name": "_htmlTableCellElement", - "docstrings": [], - "signature": "type _htmlTableCellElement" - }, - { - "id": "Dom.htmlTableCellElement", - "kind": "type", - "name": "htmlTableCellElement", - "docstrings": [], - "signature": "type htmlTableCellElement = htmlElement_like<\n _htmlTableCellElement,\n>" - }, - { - "id": "Dom._htmlTableColElement", - "kind": "type", - "name": "_htmlTableColElement", - "docstrings": [], - "signature": "type _htmlTableColElement" - }, - { - "id": "Dom.htmlTableColElement", - "kind": "type", - "name": "htmlTableColElement", - "docstrings": [], - "signature": "type htmlTableColElement = htmlElement_like<\n _htmlTableColElement,\n>" - }, - { - "id": "Dom._htmlTableDataCellElement", - "kind": "type", - "name": "_htmlTableDataCellElement", - "docstrings": [], - "signature": "type _htmlTableDataCellElement" - }, - { - "id": "Dom.htmlTableDataCellElement", - "kind": "type", - "name": "htmlTableDataCellElement", - "docstrings": [], - "signature": "type htmlTableDataCellElement = htmlElement_like<\n _htmlTableDataCellElement,\n>" - }, - { - "id": "Dom._htmlTableElement", - "kind": "type", - "name": "_htmlTableElement", - "docstrings": [], - "signature": "type _htmlTableElement" - }, - { - "id": "Dom.htmlTableElement", - "kind": "type", - "name": "htmlTableElement", - "docstrings": [], - "signature": "type htmlTableElement = htmlElement_like<_htmlTableElement>" - }, - { - "id": "Dom._htmlTableHeaderCellElement", - "kind": "type", - "name": "_htmlTableHeaderCellElement", - "docstrings": [], - "signature": "type _htmlTableHeaderCellElement" - }, - { - "id": "Dom.htmlTableHeaderCellElement", - "kind": "type", - "name": "htmlTableHeaderCellElement", - "docstrings": [], - "signature": "type htmlTableHeaderCellElement = htmlElement_like<\n _htmlTableHeaderCellElement,\n>" - }, - { - "id": "Dom._htmlTableRowElement", - "kind": "type", - "name": "_htmlTableRowElement", - "docstrings": [], - "signature": "type _htmlTableRowElement" - }, - { - "id": "Dom.htmlTableRowElement", - "kind": "type", - "name": "htmlTableRowElement", - "docstrings": [], - "signature": "type htmlTableRowElement = htmlElement_like<\n _htmlTableRowElement,\n>" - }, - { - "id": "Dom._htmlTableSectionElement", - "kind": "type", - "name": "_htmlTableSectionElement", - "docstrings": [], - "signature": "type _htmlTableSectionElement" - }, - { - "id": "Dom.htmlTableSectionElement", - "kind": "type", - "name": "htmlTableSectionElement", - "docstrings": [], - "signature": "type htmlTableSectionElement = htmlElement_like<\n _htmlTableSectionElement,\n>" - }, - { - "id": "Dom._htmlTextAreaElement", - "kind": "type", - "name": "_htmlTextAreaElement", - "docstrings": [], - "signature": "type _htmlTextAreaElement" - }, - { - "id": "Dom.htmlTextAreaElement", - "kind": "type", - "name": "htmlTextAreaElement", - "docstrings": [], - "signature": "type htmlTextAreaElement = htmlElement_like<\n _htmlTextAreaElement,\n>" - }, - { - "id": "Dom._htmlTimeElement", - "kind": "type", - "name": "_htmlTimeElement", - "docstrings": [], - "signature": "type _htmlTimeElement" - }, - { - "id": "Dom.htmlTimeElement", - "kind": "type", - "name": "htmlTimeElement", - "docstrings": [], - "signature": "type htmlTimeElement = htmlElement_like<_htmlTimeElement>" - }, - { - "id": "Dom._htmlTitleElement", - "kind": "type", - "name": "_htmlTitleElement", - "docstrings": [], - "signature": "type _htmlTitleElement" - }, - { - "id": "Dom.htmlTitleElement", - "kind": "type", - "name": "htmlTitleElement", - "docstrings": [], - "signature": "type htmlTitleElement = htmlElement_like<_htmlTitleElement>" - }, - { - "id": "Dom._htmlTrackElement", - "kind": "type", - "name": "_htmlTrackElement", - "docstrings": [], - "signature": "type _htmlTrackElement" - }, - { - "id": "Dom.htmlTrackElement", - "kind": "type", - "name": "htmlTrackElement", - "docstrings": [], - "signature": "type htmlTrackElement = htmlElement_like<_htmlTrackElement>" - }, - { - "id": "Dom._htmlUlistElement", - "kind": "type", - "name": "_htmlUlistElement", - "docstrings": [], - "signature": "type _htmlUlistElement" - }, - { - "id": "Dom.htmlUlistElement", - "kind": "type", - "name": "htmlUlistElement", - "docstrings": [], - "signature": "type htmlUlistElement = htmlElement_like<_htmlUlistElement>" - }, - { - "id": "Dom._htmlUnknownElement", - "kind": "type", - "name": "_htmlUnknownElement", - "docstrings": [], - "signature": "type _htmlUnknownElement" - }, - { - "id": "Dom.htmlUnknownElement", - "kind": "type", - "name": "htmlUnknownElement", - "docstrings": [], - "signature": "type htmlUnknownElement = htmlElement_like<\n _htmlUnknownElement,\n>" - }, - { - "id": "Dom._htmlVideoElement", - "kind": "type", - "name": "_htmlVideoElement", - "docstrings": [], - "signature": "type _htmlVideoElement" - }, - { - "id": "Dom.htmlVideoElement", - "kind": "type", - "name": "htmlVideoElement", - "docstrings": [], - "signature": "type htmlVideoElement = htmlElement_like<_htmlVideoElement>" - }, - { - "id": "Dom.location", - "kind": "type", - "name": "location", - "docstrings": [], - "signature": "type location" - }, - { - "id": "Dom.window", - "kind": "type", - "name": "window", - "docstrings": [], - "signature": "type window" - }, - { - "id": "Dom._xmlDocument", - "kind": "type", - "name": "_xmlDocument", - "docstrings": [], - "signature": "type _xmlDocument" - }, - { - "id": "Dom.xmlDocument", - "kind": "type", - "name": "xmlDocument", - "docstrings": [], - "signature": "type xmlDocument = document_like<_xmlDocument>" - }, - { - "id": "Dom.event_like", - "kind": "type", - "name": "event_like", - "docstrings": [], - "signature": "type event_like<'a>" - }, - { - "id": "Dom.event", - "kind": "type", - "name": "event", - "docstrings": [], - "signature": "type event = event_like<_baseClass>" - }, - { - "id": "Dom._uiEvent", - "kind": "type", - "name": "_uiEvent", - "docstrings": [], - "signature": "type _uiEvent<'a>" - }, - { - "id": "Dom.uiEvent_like", - "kind": "type", - "name": "uiEvent_like", - "docstrings": [], - "signature": "type uiEvent_like<'a> = event_like<_uiEvent<'a>>" - }, - { - "id": "Dom.uiEvent", - "kind": "type", - "name": "uiEvent", - "docstrings": [], - "signature": "type uiEvent = uiEvent_like<_baseClass>" - }, - { - "id": "Dom._animationEvent", - "kind": "type", - "name": "_animationEvent", - "docstrings": [], - "signature": "type _animationEvent" - }, - { - "id": "Dom.animationEvent", - "kind": "type", - "name": "animationEvent", - "docstrings": [], - "signature": "type animationEvent = event_like<_animationEvent>" - }, - { - "id": "Dom._beforeUnloadEvent", - "kind": "type", - "name": "_beforeUnloadEvent", - "docstrings": [], - "signature": "type _beforeUnloadEvent" - }, - { - "id": "Dom.beforeUnloadEvent", - "kind": "type", - "name": "beforeUnloadEvent", - "docstrings": [], - "signature": "type beforeUnloadEvent = event_like<_beforeUnloadEvent>" - }, - { - "id": "Dom._clipboardEvent", - "kind": "type", - "name": "_clipboardEvent", - "docstrings": [], - "signature": "type _clipboardEvent" - }, - { - "id": "Dom.clipboardEvent", - "kind": "type", - "name": "clipboardEvent", - "docstrings": [], - "signature": "type clipboardEvent = event_like<_clipboardEvent>" - }, - { - "id": "Dom._closeEvent", - "kind": "type", - "name": "_closeEvent", - "docstrings": [], - "signature": "type _closeEvent" - }, - { - "id": "Dom.closeEvent", - "kind": "type", - "name": "closeEvent", - "docstrings": [], - "signature": "type closeEvent = event_like<_closeEvent>" - }, - { - "id": "Dom._compositionEvent", - "kind": "type", - "name": "_compositionEvent", - "docstrings": [], - "signature": "type _compositionEvent" - }, - { - "id": "Dom.compositionEvent", - "kind": "type", - "name": "compositionEvent", - "docstrings": [], - "signature": "type compositionEvent = uiEvent_like<_compositionEvent>" - }, - { - "id": "Dom._customEvent", - "kind": "type", - "name": "_customEvent", - "docstrings": [], - "signature": "type _customEvent" - }, - { - "id": "Dom.customEvent", - "kind": "type", - "name": "customEvent", - "docstrings": [], - "signature": "type customEvent = event_like<_customEvent>" - }, - { - "id": "Dom._dragEvent", - "kind": "type", - "name": "_dragEvent", - "docstrings": [], - "signature": "type _dragEvent" - }, - { - "id": "Dom.dragEvent", - "kind": "type", - "name": "dragEvent", - "docstrings": [], - "signature": "type dragEvent = event_like<_dragEvent>" - }, - { - "id": "Dom._errorEvent", - "kind": "type", - "name": "_errorEvent", - "docstrings": [], - "signature": "type _errorEvent" - }, - { - "id": "Dom.errorEvent", - "kind": "type", - "name": "errorEvent", - "docstrings": [], - "signature": "type errorEvent = event_like<_errorEvent>" - }, - { - "id": "Dom._focusEvent", - "kind": "type", - "name": "_focusEvent", - "docstrings": [], - "signature": "type _focusEvent" - }, - { - "id": "Dom.focusEvent", - "kind": "type", - "name": "focusEvent", - "docstrings": [], - "signature": "type focusEvent = uiEvent_like<_focusEvent>" - }, - { - "id": "Dom._idbVersionChangeEvent", - "kind": "type", - "name": "_idbVersionChangeEvent", - "docstrings": [], - "signature": "type _idbVersionChangeEvent" - }, - { - "id": "Dom.idbVersionChangeEvent", - "kind": "type", - "name": "idbVersionChangeEvent", - "docstrings": [], - "signature": "type idbVersionChangeEvent = event_like<\n _idbVersionChangeEvent,\n>" - }, - { - "id": "Dom._inputEvent", - "kind": "type", - "name": "_inputEvent", - "docstrings": [], - "signature": "type _inputEvent" - }, - { - "id": "Dom.inputEvent", - "kind": "type", - "name": "inputEvent", - "docstrings": [], - "signature": "type inputEvent = uiEvent_like<_inputEvent>" - }, - { - "id": "Dom._keyboardEvent", - "kind": "type", - "name": "_keyboardEvent", - "docstrings": [], - "signature": "type _keyboardEvent" - }, - { - "id": "Dom.keyboardEvent", - "kind": "type", - "name": "keyboardEvent", - "docstrings": [], - "signature": "type keyboardEvent = uiEvent_like<_keyboardEvent>" - }, - { - "id": "Dom._mouseEvent", - "kind": "type", - "name": "_mouseEvent", - "docstrings": [], - "signature": "type _mouseEvent<'a>" - }, - { - "id": "Dom.mouseEvent_like", - "kind": "type", - "name": "mouseEvent_like", - "docstrings": [], - "signature": "type mouseEvent_like<'a> = uiEvent_like<_mouseEvent<'a>>" - }, - { - "id": "Dom.mouseEvent", - "kind": "type", - "name": "mouseEvent", - "docstrings": [], - "signature": "type mouseEvent = mouseEvent_like<_baseClass>" - }, - { - "id": "Dom._pageTransitionEvent", - "kind": "type", - "name": "_pageTransitionEvent", - "docstrings": [], - "signature": "type _pageTransitionEvent" - }, - { - "id": "Dom.pageTransitionEvent", - "kind": "type", - "name": "pageTransitionEvent", - "docstrings": [], - "signature": "type pageTransitionEvent = event_like<_pageTransitionEvent>" - }, - { - "id": "Dom._pointerEvent", - "kind": "type", - "name": "_pointerEvent", - "docstrings": [], - "signature": "type _pointerEvent" - }, - { - "id": "Dom.pointerEvent", - "kind": "type", - "name": "pointerEvent", - "docstrings": [], - "signature": "type pointerEvent = mouseEvent_like<_pointerEvent>" - }, - { - "id": "Dom._popStateEvent", - "kind": "type", - "name": "_popStateEvent", - "docstrings": [], - "signature": "type _popStateEvent" - }, - { - "id": "Dom.popStateEvent", - "kind": "type", - "name": "popStateEvent", - "docstrings": [], - "signature": "type popStateEvent = event_like<_popStateEvent>" - }, - { - "id": "Dom._progressEvent", - "kind": "type", - "name": "_progressEvent", - "docstrings": [], - "signature": "type _progressEvent" - }, - { - "id": "Dom.progressEvent", - "kind": "type", - "name": "progressEvent", - "docstrings": [], - "signature": "type progressEvent = event_like<_progressEvent>" - }, - { - "id": "Dom._relatedEvent", - "kind": "type", - "name": "_relatedEvent", - "docstrings": [], - "signature": "type _relatedEvent" - }, - { - "id": "Dom.relatedEvent", - "kind": "type", - "name": "relatedEvent", - "docstrings": [], - "signature": "type relatedEvent = event_like<_relatedEvent>" - }, - { - "id": "Dom._storageEvent", - "kind": "type", - "name": "_storageEvent", - "docstrings": [], - "signature": "type _storageEvent" - }, - { - "id": "Dom.storageEvent", - "kind": "type", - "name": "storageEvent", - "docstrings": [], - "signature": "type storageEvent = event_like<_storageEvent>" - }, - { - "id": "Dom._svgZoomEvent", - "kind": "type", - "name": "_svgZoomEvent", - "docstrings": [], - "signature": "type _svgZoomEvent" - }, - { - "id": "Dom.svgZoomEvent", - "kind": "type", - "name": "svgZoomEvent", - "docstrings": [], - "signature": "type svgZoomEvent = event_like<_svgZoomEvent>" - }, - { - "id": "Dom._timeEvent", - "kind": "type", - "name": "_timeEvent", - "docstrings": [], - "signature": "type _timeEvent" - }, - { - "id": "Dom.timeEvent", - "kind": "type", - "name": "timeEvent", - "docstrings": [], - "signature": "type timeEvent = event_like<_timeEvent>" - }, - { - "id": "Dom._touchEvent", - "kind": "type", - "name": "_touchEvent", - "docstrings": [], - "signature": "type _touchEvent" - }, - { - "id": "Dom.touchEvent", - "kind": "type", - "name": "touchEvent", - "docstrings": [], - "signature": "type touchEvent = uiEvent_like<_touchEvent>" - }, - { - "id": "Dom._trackEvent", - "kind": "type", - "name": "_trackEvent", - "docstrings": [], - "signature": "type _trackEvent" - }, - { - "id": "Dom.trackEvent", - "kind": "type", - "name": "trackEvent", - "docstrings": [], - "signature": "type trackEvent = event_like<_trackEvent>" - }, - { - "id": "Dom._transitionEvent", - "kind": "type", - "name": "_transitionEvent", - "docstrings": [], - "signature": "type _transitionEvent" - }, - { - "id": "Dom.transitionEvent", - "kind": "type", - "name": "transitionEvent", - "docstrings": [], - "signature": "type transitionEvent = event_like<_transitionEvent>" - }, - { - "id": "Dom._webGlContextEvent", - "kind": "type", - "name": "_webGlContextEvent", - "docstrings": [], - "signature": "type _webGlContextEvent" - }, - { - "id": "Dom.webGlContextEvent", - "kind": "type", - "name": "webGlContextEvent", - "docstrings": [], - "signature": "type webGlContextEvent = event_like<_webGlContextEvent>" - }, - { - "id": "Dom._wheelEvent", - "kind": "type", - "name": "_wheelEvent", - "docstrings": [], - "signature": "type _wheelEvent" - }, - { - "id": "Dom.wheelEvent", - "kind": "type", - "name": "wheelEvent", - "docstrings": [], - "signature": "type wheelEvent = uiEvent_like<_wheelEvent>" - }, - { - "id": "Dom.range", - "kind": "type", - "name": "range", - "docstrings": [], - "signature": "type range" - }, - { - "id": "Dom.selection", - "kind": "type", - "name": "selection", - "docstrings": [], - "signature": "type selection" - }, - { - "id": "Dom.domTokenList", - "kind": "type", - "name": "domTokenList", - "docstrings": [], - "signature": "type domTokenList" - }, - { - "id": "Dom.domSettableTokenList", - "kind": "type", - "name": "domSettableTokenList", - "docstrings": [], - "signature": "type domSettableTokenList" - }, - { - "id": "Dom.nodeFilter", - "kind": "type", - "name": "nodeFilter", - "docstrings": [], - "signature": "type nodeFilter = {acceptNode: element => int}" - }, - { - "id": "Dom.nodeIterator", - "kind": "type", - "name": "nodeIterator", - "docstrings": [], - "signature": "type nodeIterator" - }, - { - "id": "Dom.treeWalker", - "kind": "type", - "name": "treeWalker", - "docstrings": [], - "signature": "type treeWalker" - }, - { - "id": "Dom.svgRect", - "kind": "type", - "name": "svgRect", - "docstrings": [], - "signature": "type svgRect" - }, - { - "id": "Dom.svgPoint", - "kind": "type", - "name": "svgPoint", - "docstrings": [], - "signature": "type svgPoint" - }, - { - "id": "Dom.eventPointerId", - "kind": "type", - "name": "eventPointerId", - "docstrings": [], - "signature": "type eventPointerId" - } - ] - }, - "dom/storage2": { - "id": "Dom.Storage2", - "name": "Storage2", - "docstrings": [], - "items": [ - { - "id": "Dom.Storage2.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Dom.Storage2.getItem", - "kind": "value", - "name": "getItem", - "docstrings": [], - "signature": "let getItem: (t, string) => option" - }, - { - "id": "Dom.Storage2.setItem", - "kind": "value", - "name": "setItem", - "docstrings": [], - "signature": "let setItem: (t, string, string) => unit" - }, - { - "id": "Dom.Storage2.removeItem", - "kind": "value", - "name": "removeItem", - "docstrings": [], - "signature": "let removeItem: (t, string) => unit" - }, - { - "id": "Dom.Storage2.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Dom.Storage2.key", - "kind": "value", - "name": "key", - "docstrings": [], - "signature": "let key: (t, int) => option" - }, - { - "id": "Dom.Storage2.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int" - }, - { - "id": "Dom.Storage2.localStorage", - "kind": "value", - "name": "localStorage", - "docstrings": [], - "signature": "let localStorage: t" - }, - { - "id": "Dom.Storage2.sessionStorage", - "kind": "value", - "name": "sessionStorage", - "docstrings": [], - "signature": "let sessionStorage: t" - } - ] - }, - "dom/storage": { - "id": "Dom.Storage", - "name": "Storage", - "docstrings": [], - "items": [ - { - "id": "Dom.Storage.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Dom_storage2.t" - }, - { - "id": "Dom.Storage.getItem", - "kind": "value", - "name": "getItem", - "docstrings": [], - "signature": "let getItem: (string, t) => option" - }, - { - "id": "Dom.Storage.setItem", - "kind": "value", - "name": "setItem", - "docstrings": [], - "signature": "let setItem: (string, string, t) => unit" - }, - { - "id": "Dom.Storage.removeItem", - "kind": "value", - "name": "removeItem", - "docstrings": [], - "signature": "let removeItem: (string, t) => unit" - }, - { - "id": "Dom.Storage.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Dom.Storage.key", - "kind": "value", - "name": "key", - "docstrings": [], - "signature": "let key: (int, t) => option" - }, - { - "id": "Dom.Storage.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int" - }, - { - "id": "Dom.Storage.localStorage", - "kind": "value", - "name": "localStorage", - "docstrings": [], - "signature": "let localStorage: t" - }, - { - "id": "Dom.Storage.sessionStorage", - "kind": "value", - "name": "sessionStorage", - "docstrings": [], - "signature": "let sessionStorage: t" - } - ] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v12.2.0/js.json b/apps/docs/data/api/v12.2.0/js.json deleted file mode 100644 index b6d50b8ef..000000000 --- a/apps/docs/data/api/v12.2.0/js.json +++ /dev/null @@ -1,12866 +0,0 @@ -{ - "js": { - "id": "Js", - "name": "Js", - "docstrings": [ - "The Js module mostly contains ReScript bindings to _standard JavaScript APIs_\nlike [console.log](https://developer.mozilla.org/en-US/docs/Web/API/Console/log),\nor the JavaScript\n[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String),\n[Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date), and\n[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\nclasses.\n\nIt is meant as a zero-abstraction interop layer and directly exposes JavaScript functions as they are. If you can find your API in this module, prefer this over an equivalent Belt helper. For example, prefer [Js.Array2](js/array2) over [Belt.Array](belt/array)\n\n## Argument Order\n\nFor historical reasons, some APIs in the Js namespace (e.g. [Js.String](js/string)) are\nusing the data-last argument order whereas others (e.g. [Js.Date](js/date)) are using data-first.\n\nFor more information about these argument orders and the trade-offs between them, see\n[this blog post](https://www.javierchavarri.com/data-first-and-data-last-a-comparison/).\n\n_Eventually, all modules in the Js namespace are going to be migrated to data-first though._\n\n## Js.Xxx2 Modules\n\nPrefer `Js.Array2` over `Js.Array`, `Js.String2` over `Js.String`, etc. The latters are old modules." - ], - "items": [ - { - "id": "Js.t", - "kind": "type", - "name": "t", - "docstrings": [ - "JS object type" - ], - "signature": "type t<'a> = 'a\n constraint 'a = {..}", - "deprecated": "This has been deprecated and will be removed in v13. Use the `{..}` type directly instead." - }, - { - "id": "Js.globalThis", - "kind": "value", - "name": "globalThis", - "docstrings": [ - "JS global object reference" - ], - "signature": "let globalThis: t<{..}>", - "deprecated": "" - }, - { - "id": "Js.null", - "kind": "type", - "name": "null", - "docstrings": [], - "signature": "@unboxed\ntype null<'a> = Js_null.t<'a> = Value('a) | @as(null) Null", - "deprecated": "" - }, - { - "id": "Js.undefined", - "kind": "type", - "name": "undefined", - "docstrings": [], - "signature": "type undefined<'a> = Js_undefined.t<'a>", - "deprecated": "This has been deprecated and will be removed in v13." - }, - { - "id": "Js.nullable", - "kind": "type", - "name": "nullable", - "docstrings": [], - "signature": "@unboxed\ntype nullable<'a> = Js_null_undefined.t<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined", - "deprecated": "" - }, - { - "id": "Js.null_undefined", - "kind": "type", - "name": "null_undefined", - "docstrings": [], - "signature": "type null_undefined<'a> = nullable<'a>", - "deprecated": "" - }, - { - "id": "Js.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [], - "signature": "let toOption: nullable<'a> => option<'a>" - }, - { - "id": "Js.undefinedToOption", - "kind": "value", - "name": "undefinedToOption", - "docstrings": [], - "signature": "let undefinedToOption: undefined<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.nullToOption", - "kind": "value", - "name": "nullToOption", - "docstrings": [], - "signature": "let nullToOption: null<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [], - "signature": "let isNullable: nullable<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.import", - "kind": "value", - "name": "import", - "docstrings": [], - "signature": "let import: 'a => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.testAny", - "kind": "value", - "name": "testAny", - "docstrings": [ - "The same as {!test} except that it is more permissive on the types of input" - ], - "signature": "let testAny: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.promise", - "kind": "type", - "name": "promise", - "docstrings": [ - "The promise type, defined here for interoperation across packages." - ], - "signature": "type promise<+'a, +'e>", - "deprecated": "This is deprecated and will be removed in v13. Use the `promise` type directly instead." - }, - { - "id": "Js.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The same as empty in `Js.Null`. Compiles to `null`." - ], - "signature": "let null: null<'a>", - "deprecated": "" - }, - { - "id": "Js.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The same as empty `Js.Undefined`. Compiles to `undefined`." - ], - "signature": "let undefined: undefined<'a>", - "deprecated": "" - }, - { - "id": "Js.typeof", - "kind": "value", - "name": "typeof", - "docstrings": [ - "`typeof x` will be compiled as `typeof x` in JS. Please consider functions in\n`Js.Types` for a type safe way of reflection." - ], - "signature": "let typeof: 'a => string", - "deprecated": "" - }, - { - "id": "Js.log", - "kind": "value", - "name": "log", - "docstrings": [ - "Equivalent to console.log any value." - ], - "signature": "let log: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.log2", - "kind": "value", - "name": "log2", - "docstrings": [], - "signature": "let log2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.log3", - "kind": "value", - "name": "log3", - "docstrings": [], - "signature": "let log3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.log4", - "kind": "value", - "name": "log4", - "docstrings": [], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.logMany", - "kind": "value", - "name": "logMany", - "docstrings": [ - "A convenience function to console.log more than 4 arguments" - ], - "signature": "let logMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.eqNull", - "kind": "value", - "name": "eqNull", - "docstrings": [], - "signature": "let eqNull: ('a, null<'a>) => bool", - "deprecated": "" - }, - { - "id": "Js.eqUndefined", - "kind": "value", - "name": "eqUndefined", - "docstrings": [], - "signature": "let eqUndefined: ('a, undefined<'a>) => bool", - "deprecated": "" - }, - { - "id": "Js.eqNullable", - "kind": "value", - "name": "eqNullable", - "docstrings": [], - "signature": "let eqNullable: ('a, nullable<'a>) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_lt", - "kind": "value", - "name": "unsafe_lt", - "docstrings": [ - "`unsafe_lt(a, b)` will be compiled as `a < b`.\n It is marked as unsafe, since it is impossible\n to give a proper semantics for comparision which applies to any type" - ], - "signature": "let unsafe_lt: ('a, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_le", - "kind": "value", - "name": "unsafe_le", - "docstrings": [ - "`unsafe_le(a, b)` will be compiled as `a <= b`.\n See also `Js.unsafe_lt`." - ], - "signature": "let unsafe_le: ('a, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_gt", - "kind": "value", - "name": "unsafe_gt", - "docstrings": [ - "`unsafe_gt(a, b)` will be compiled as `a > b`.\n See also `Js.unsafe_lt`." - ], - "signature": "let unsafe_gt: ('a, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_ge", - "kind": "value", - "name": "unsafe_ge", - "docstrings": [ - "`unsafe_ge(a, b)` will be compiled as `a >= b`.\n See also `Js.unsafe_lt`." - ], - "signature": "let unsafe_ge: ('a, 'a) => bool", - "deprecated": "" - } - ] - }, - "js/typedarray2/dataview": { - "id": "Js.TypedArray2.DataView", - "name": "DataView", - "docstrings": [ - "The DataView view provides a low-level interface for reading and writing\nmultiple number types in an ArrayBuffer irrespective of the platform's endianness.\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)" - ], - "items": [ - { - "id": "Js.TypedArray2.DataView.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Js.TypedArray2.DataView.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array_buffer => t" - }, - { - "id": "Js.TypedArray2.DataView.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.DataView.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [], - "signature": "let fromBufferOffset: (array_buffer, int) => t" - }, - { - "id": "Js.TypedArray2.DataView.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t" - }, - { - "id": "Js.TypedArray2.DataView.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.DataView.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.DataView.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt8", - "kind": "value", - "name": "getInt8", - "docstrings": [], - "signature": "let getInt8: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint8", - "kind": "value", - "name": "getUint8", - "docstrings": [], - "signature": "let getUint8: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt16", - "kind": "value", - "name": "getInt16", - "docstrings": [], - "signature": "let getInt16: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt16LittleEndian", - "kind": "value", - "name": "getInt16LittleEndian", - "docstrings": [], - "signature": "let getInt16LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint16", - "kind": "value", - "name": "getUint16", - "docstrings": [], - "signature": "let getUint16: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint16LittleEndian", - "kind": "value", - "name": "getUint16LittleEndian", - "docstrings": [], - "signature": "let getUint16LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt32", - "kind": "value", - "name": "getInt32", - "docstrings": [], - "signature": "let getInt32: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt32LittleEndian", - "kind": "value", - "name": "getInt32LittleEndian", - "docstrings": [], - "signature": "let getInt32LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint32", - "kind": "value", - "name": "getUint32", - "docstrings": [], - "signature": "let getUint32: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint32LittleEndian", - "kind": "value", - "name": "getUint32LittleEndian", - "docstrings": [], - "signature": "let getUint32LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getFloat32", - "kind": "value", - "name": "getFloat32", - "docstrings": [], - "signature": "let getFloat32: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.getFloat32LittleEndian", - "kind": "value", - "name": "getFloat32LittleEndian", - "docstrings": [], - "signature": "let getFloat32LittleEndian: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.getFloat64", - "kind": "value", - "name": "getFloat64", - "docstrings": [], - "signature": "let getFloat64: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.getFloat64LittleEndian", - "kind": "value", - "name": "getFloat64LittleEndian", - "docstrings": [], - "signature": "let getFloat64LittleEndian: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.setInt8", - "kind": "value", - "name": "setInt8", - "docstrings": [], - "signature": "let setInt8: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint8", - "kind": "value", - "name": "setUint8", - "docstrings": [], - "signature": "let setUint8: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt16", - "kind": "value", - "name": "setInt16", - "docstrings": [], - "signature": "let setInt16: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt16LittleEndian", - "kind": "value", - "name": "setInt16LittleEndian", - "docstrings": [], - "signature": "let setInt16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint16", - "kind": "value", - "name": "setUint16", - "docstrings": [], - "signature": "let setUint16: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint16LittleEndian", - "kind": "value", - "name": "setUint16LittleEndian", - "docstrings": [], - "signature": "let setUint16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt32", - "kind": "value", - "name": "setInt32", - "docstrings": [], - "signature": "let setInt32: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt32LittleEndian", - "kind": "value", - "name": "setInt32LittleEndian", - "docstrings": [], - "signature": "let setInt32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint32", - "kind": "value", - "name": "setUint32", - "docstrings": [], - "signature": "let setUint32: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint32LittleEndian", - "kind": "value", - "name": "setUint32LittleEndian", - "docstrings": [], - "signature": "let setUint32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat32", - "kind": "value", - "name": "setFloat32", - "docstrings": [], - "signature": "let setFloat32: (t, int, float) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat32LittleEndian", - "kind": "value", - "name": "setFloat32LittleEndian", - "docstrings": [], - "signature": "let setFloat32LittleEndian: (t, int, float) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat64", - "kind": "value", - "name": "setFloat64", - "docstrings": [], - "signature": "let setFloat64: (t, int, float) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat64LittleEndian", - "kind": "value", - "name": "setFloat64LittleEndian", - "docstrings": [], - "signature": "let setFloat64LittleEndian: (t, int, float) => unit" - } - ] - }, - "js/typedarray2/float64array": { - "id": "Js.TypedArray2.Float64Array", - "name": "Float64Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Float64Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.TypedArray2.Float64Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Float64Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Float64Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Float64Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Float64Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Float64Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Float64Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Float64Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/float32array": { - "id": "Js.TypedArray2.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Float32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.TypedArray2.Float32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Float32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Float32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Float32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Float32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Float32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Float32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Float32Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/uint32array": { - "id": "Js.TypedArray2.Uint32Array", - "name": "Uint32Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint32Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/int32array": { - "id": "Js.TypedArray2.Int32Array", - "name": "Int32Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Int32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Int32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Int32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Int32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Int32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Int32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Int32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Int32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Int32Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/uint16array": { - "id": "Js.TypedArray2.Uint16Array", - "name": "Uint16Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t" - }, - { - "id": "Js.TypedArray2.Uint16Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t" - }, - { - "id": "Js.TypedArray2.Uint16Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>" - }, - { - "id": "Js.TypedArray2.Uint16Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b" - }, - { - "id": "Js.TypedArray2.Uint16Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b" - }, - { - "id": "Js.TypedArray2.Uint16Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b" - }, - { - "id": "Js.TypedArray2.Uint16Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/int16array": { - "id": "Js.TypedArray2.Int16Array", - "name": "Int16Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Int16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Int16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Int16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Int16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Int16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Int16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Int16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Int16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Int16Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int" - }, - { - "id": "Js.TypedArray2.Int16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t" - }, - { - "id": "Js.TypedArray2.Int16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t" - } - ] - }, - "js/typedarray2/uint8clampedarray": { - "id": "Js.TypedArray2.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint8ClampedArray.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/uint8array": { - "id": "Js.TypedArray2.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint8Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t" - }, - { - "id": "Js.TypedArray2.Uint8Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/int8array": { - "id": "Js.TypedArray2.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Int8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Int8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Int8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Int8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Int8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Int8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Int8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Int8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Int8Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Int8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/arraybuffer": { - "id": "Js.TypedArray2.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [ - "The underlying buffer that the typed arrays provide views of\n\n **see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)" - ], - "items": [ - { - "id": "Js.TypedArray2.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = array_buffer" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.make", - "kind": "value", - "name": "make", - "docstrings": [ - "takes length. initializes elements to 0" - ], - "signature": "let make: int => t" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (t, ~start: int, ~end_: int) => array_buffer", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => array_buffer", - "deprecated": "" - } - ] - }, - "js/typed_array/dataview": { - "id": "Js.Typed_array.DataView", - "name": "DataView", - "docstrings": [ - "The DataView view provides a low-level interface for reading and writing\nmultiple number types in an ArrayBuffer irrespective of the platform's endianness.\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)" - ], - "items": [ - { - "id": "Js.Typed_array.DataView.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Js_typed_array2.DataView.t" - }, - { - "id": "Js.Typed_array.DataView.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array_buffer => t" - }, - { - "id": "Js.Typed_array.DataView.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.DataView.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [], - "signature": "let fromBufferOffset: (array_buffer, int) => t" - }, - { - "id": "Js.Typed_array.DataView.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t" - }, - { - "id": "Js.Typed_array.DataView.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.DataView.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.DataView.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.DataView.getInt8", - "kind": "value", - "name": "getInt8", - "docstrings": [], - "signature": "let getInt8: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint8", - "kind": "value", - "name": "getUint8", - "docstrings": [], - "signature": "let getUint8: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt16", - "kind": "value", - "name": "getInt16", - "docstrings": [], - "signature": "let getInt16: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt16LittleEndian", - "kind": "value", - "name": "getInt16LittleEndian", - "docstrings": [], - "signature": "let getInt16LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint16", - "kind": "value", - "name": "getUint16", - "docstrings": [], - "signature": "let getUint16: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint16LittleEndian", - "kind": "value", - "name": "getUint16LittleEndian", - "docstrings": [], - "signature": "let getUint16LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt32", - "kind": "value", - "name": "getInt32", - "docstrings": [], - "signature": "let getInt32: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt32LittleEndian", - "kind": "value", - "name": "getInt32LittleEndian", - "docstrings": [], - "signature": "let getInt32LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint32", - "kind": "value", - "name": "getUint32", - "docstrings": [], - "signature": "let getUint32: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint32LittleEndian", - "kind": "value", - "name": "getUint32LittleEndian", - "docstrings": [], - "signature": "let getUint32LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getFloat32", - "kind": "value", - "name": "getFloat32", - "docstrings": [], - "signature": "let getFloat32: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.getFloat32LittleEndian", - "kind": "value", - "name": "getFloat32LittleEndian", - "docstrings": [], - "signature": "let getFloat32LittleEndian: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.getFloat64", - "kind": "value", - "name": "getFloat64", - "docstrings": [], - "signature": "let getFloat64: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.getFloat64LittleEndian", - "kind": "value", - "name": "getFloat64LittleEndian", - "docstrings": [], - "signature": "let getFloat64LittleEndian: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.setInt8", - "kind": "value", - "name": "setInt8", - "docstrings": [], - "signature": "let setInt8: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint8", - "kind": "value", - "name": "setUint8", - "docstrings": [], - "signature": "let setUint8: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt16", - "kind": "value", - "name": "setInt16", - "docstrings": [], - "signature": "let setInt16: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt16LittleEndian", - "kind": "value", - "name": "setInt16LittleEndian", - "docstrings": [], - "signature": "let setInt16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint16", - "kind": "value", - "name": "setUint16", - "docstrings": [], - "signature": "let setUint16: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint16LittleEndian", - "kind": "value", - "name": "setUint16LittleEndian", - "docstrings": [], - "signature": "let setUint16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt32", - "kind": "value", - "name": "setInt32", - "docstrings": [], - "signature": "let setInt32: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt32LittleEndian", - "kind": "value", - "name": "setInt32LittleEndian", - "docstrings": [], - "signature": "let setInt32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint32", - "kind": "value", - "name": "setUint32", - "docstrings": [], - "signature": "let setUint32: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint32LittleEndian", - "kind": "value", - "name": "setUint32LittleEndian", - "docstrings": [], - "signature": "let setUint32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat32", - "kind": "value", - "name": "setFloat32", - "docstrings": [], - "signature": "let setFloat32: (t, int, float) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat32LittleEndian", - "kind": "value", - "name": "setFloat32LittleEndian", - "docstrings": [], - "signature": "let setFloat32LittleEndian: (t, int, float) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat64", - "kind": "value", - "name": "setFloat64", - "docstrings": [], - "signature": "let setFloat64: (t, int, float) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat64LittleEndian", - "kind": "value", - "name": "setFloat64LittleEndian", - "docstrings": [], - "signature": "let setFloat64LittleEndian: (t, int, float) => unit" - } - ] - }, - "js/typed_array/float64_array": { - "id": "Js.Typed_array.Float64_array", - "name": "Float64_array", - "docstrings": [], - "items": [] - }, - "js/typed_array/float64array": { - "id": "Js.Typed_array.Float64Array", - "name": "Float64Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Float64Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.Typed_array.Float64Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Float64Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Float64Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Float64Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Float64Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Float64Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Float64Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Float64Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Float64Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.create", - "kind": "value", - "name": "create", - "docstrings": [], - "signature": "let create: array => t", - "deprecated": "use `make` instead" - }, - { - "id": "Js.Typed_array.Float64Array.of_buffer", - "kind": "value", - "name": "of_buffer", - "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" - } - ] - }, - "js/typed_array/float32_array": { - "id": "Js.Typed_array.Float32_array", - "name": "Float32_array", - "docstrings": [], - "items": [] - }, - "js/typed_array/float32array": { - "id": "Js.Typed_array.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Float32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.Typed_array.Float32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Float32Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Float32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Float32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Float32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Float32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Float32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Float32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Float32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.create", - "kind": "value", - "name": "create", - "docstrings": [], - "signature": "let create: array => t", - "deprecated": "use `make` instead" - }, - { - "id": "Js.Typed_array.Float32Array.of_buffer", - "kind": "value", - "name": "of_buffer", - "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" - } - ] - }, - "js/typed_array/uint32array": { - "id": "Js.Typed_array.Uint32Array", - "name": "Uint32Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint32Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/int32_array": { - "id": "Js.Typed_array.Int32_array", - "name": "Int32_array", - "docstrings": [], - "items": [] - }, - "js/typed_array/int32array": { - "id": "Js.Typed_array.Int32Array", - "name": "Int32Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Int32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Int32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int32Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Int32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Int32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Int32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Int32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Int32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Int32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Int32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.create", - "kind": "value", - "name": "create", - "docstrings": [], - "signature": "let create: array => t", - "deprecated": "use `make` instead" - }, - { - "id": "Js.Typed_array.Int32Array.of_buffer", - "kind": "value", - "name": "of_buffer", - "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" - } - ] - }, - "js/typed_array/uint16array": { - "id": "Js.Typed_array.Uint16Array", - "name": "Uint16Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint16Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/int16array": { - "id": "Js.Typed_array.Int16Array", - "name": "Int16Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Int16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Int16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int16Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Int16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Int16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Int16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Int16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Int16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Int16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Int16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/uint8clampedarray": { - "id": "Js.Typed_array.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint8ClampedArray.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint8ClampedArray.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/uint8array": { - "id": "Js.Typed_array.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint8Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.Uint8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/int8array": { - "id": "Js.Typed_array.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Int8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Int8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int8Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Int8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Int8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Int8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Int8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Int8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Int8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Int8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "Use `TypedArray.slice` instead." - }, - { - "id": "Js.Typed_array.Int8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "Use `TypedArray.sliceToEnd` instead." - }, - { - "id": "Js.Typed_array.Int8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.Int8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "throw Js.Exn.Error throw Js exception\n\n param offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "throw Js.Exn.Error throws Js exception\n\n param offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/s": { - "id": "Js.Typed_array.S", - "name": "S", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.S.elt", - "kind": "type", - "name": "elt", - "docstrings": [], - "signature": "type elt" - }, - { - "id": "Js.Typed_array.S.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.Typed_array.S.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.S.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.S.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.S.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.S.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.S.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.S.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int" - }, - { - "id": "Js.Typed_array.S.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t" - }, - { - "id": "Js.Typed_array.S.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: elt => bool", - "deprecated": "" - }, - { - "id": "Js.Typed_array.S.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "should we use `bool` or `boolean` seems they are intechangeable here" - ], - "signature": "let filter: (elt => bool) => t" - } - ] - }, - "js/typed_array/arraybuffer": { - "id": "Js.Typed_array.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [ - "The underlying buffer that the typed arrays provide views of\n\n **see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)" - ], - "items": [ - { - "id": "Js.Typed_array.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = array_buffer" - }, - { - "id": "Js.Typed_array.ArrayBuffer.make", - "kind": "value", - "name": "make", - "docstrings": [ - "takes length. initializes elements to 0" - ], - "signature": "let make: int => t" - }, - { - "id": "Js.Typed_array.ArrayBuffer.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - } - ] - }, - "js/typed_array/type": { - "id": "Js.Typed_array.Type", - "name": "Type", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Type.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - } - ] - }, - "js/json/kind": { - "id": "Js.Json.Kind", - "name": "Kind", - "docstrings": [], - "items": [ - { - "id": "Js.Json.Kind.json", - "kind": "type", - "name": "json", - "docstrings": [], - "signature": "type json = t" - }, - { - "id": "Js.Json.Kind.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Underlying type of a JSON value" - ], - "signature": "type t<_> =\n | String: t\n | Number: t\n | Object: t>\n | Array: t>\n | Boolean: t\n | Null: t" - } - ] - }, - "js/weakmap": { - "id": "Js.WeakMap", - "name": "WeakMap", - "docstrings": [ - "Provides bindings for ES6 WeakMap", - "ES6 WeakMap API" - ], - "items": [ - { - "id": "Js.WeakMap.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v> = WeakMap.t<'k, 'v>", - "deprecated": "" - } - ] - }, - "js/map": { - "id": "Js.Map", - "name": "Map", - "docstrings": [ - "Provides bindings for ES6 Map", - "ES6 Map API" - ], - "items": [ - { - "id": "Js.Map.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v> = Map.t<'k, 'v>", - "deprecated": "" - } - ] - }, - "js/weakset": { - "id": "Js.WeakSet", - "name": "WeakSet", - "docstrings": [ - "Provides bindings for ES6 WeakSet", - "ES6 WeakSet API" - ], - "items": [ - { - "id": "Js.WeakSet.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = WeakSet.t<'a>", - "deprecated": "" - } - ] - }, - "js/set": { - "id": "Js.Set", - "name": "Set", - "docstrings": [ - "Provides bindings for ES6 Set", - "ES6 Set API" - ], - "items": [ - { - "id": "Js.Set.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = Set.t<'a>", - "deprecated": "" - } - ] - }, - "js/console": { - "id": "Js.Console", - "name": "Console", - "docstrings": [ - "Provides bindings for console" - ], - "items": [ - { - "id": "Js.Console.log", - "kind": "value", - "name": "log", - "docstrings": [], - "signature": "let log: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.log2", - "kind": "value", - "name": "log2", - "docstrings": [], - "signature": "let log2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.log3", - "kind": "value", - "name": "log3", - "docstrings": [], - "signature": "let log3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.log4", - "kind": "value", - "name": "log4", - "docstrings": [], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.logMany", - "kind": "value", - "name": "logMany", - "docstrings": [], - "signature": "let logMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info", - "kind": "value", - "name": "info", - "docstrings": [], - "signature": "let info: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info2", - "kind": "value", - "name": "info2", - "docstrings": [], - "signature": "let info2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info3", - "kind": "value", - "name": "info3", - "docstrings": [], - "signature": "let info3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info4", - "kind": "value", - "name": "info4", - "docstrings": [], - "signature": "let info4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.infoMany", - "kind": "value", - "name": "infoMany", - "docstrings": [], - "signature": "let infoMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn", - "kind": "value", - "name": "warn", - "docstrings": [], - "signature": "let warn: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn2", - "kind": "value", - "name": "warn2", - "docstrings": [], - "signature": "let warn2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn3", - "kind": "value", - "name": "warn3", - "docstrings": [], - "signature": "let warn3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn4", - "kind": "value", - "name": "warn4", - "docstrings": [], - "signature": "let warn4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warnMany", - "kind": "value", - "name": "warnMany", - "docstrings": [], - "signature": "let warnMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error", - "kind": "value", - "name": "error", - "docstrings": [], - "signature": "let error: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error2", - "kind": "value", - "name": "error2", - "docstrings": [], - "signature": "let error2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error3", - "kind": "value", - "name": "error3", - "docstrings": [], - "signature": "let error3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error4", - "kind": "value", - "name": "error4", - "docstrings": [], - "signature": "let error4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.errorMany", - "kind": "value", - "name": "errorMany", - "docstrings": [], - "signature": "let errorMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.trace", - "kind": "value", - "name": "trace", - "docstrings": [], - "signature": "let trace: unit => unit", - "deprecated": "" - }, - { - "id": "Js.Console.timeStart", - "kind": "value", - "name": "timeStart", - "docstrings": [], - "signature": "let timeStart: string => unit", - "deprecated": "" - }, - { - "id": "Js.Console.timeEnd", - "kind": "value", - "name": "timeEnd", - "docstrings": [], - "signature": "let timeEnd: string => unit", - "deprecated": "" - }, - { - "id": "Js.Console.table", - "kind": "value", - "name": "table", - "docstrings": [], - "signature": "let table: 'a => unit", - "deprecated": "" - } - ] - }, - "js/result": { - "id": "Js.Result", - "name": "Result", - "docstrings": [ - "Define the interface for result" - ], - "items": [ - { - "id": "Js.Result.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'good, 'bad> = Ok('good) | Error('bad)", - "deprecated": "" - } - ] - }, - "js/option": { - "id": "Js.Option", - "name": "Option", - "docstrings": [ - "Provide utilities for option" - ], - "items": [ - { - "id": "Js.Option.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = option<'a>", - "deprecated": "" - }, - { - "id": "Js.Option.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: 'a => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Option.isSome", - "kind": "value", - "name": "isSome", - "docstrings": [], - "signature": "let isSome: option<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Option.isSomeValue", - "kind": "value", - "name": "isSomeValue", - "docstrings": [], - "signature": "let isSomeValue: (('a, 'a) => bool, 'a, option<'a>) => bool", - "deprecated": "Use `Option.equal` instead." - }, - { - "id": "Js.Option.isNone", - "kind": "value", - "name": "isNone", - "docstrings": [], - "signature": "let isNone: option<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Option.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: option<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Option.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (('a, 'b) => bool, option<'a>, option<'b>) => bool", - "deprecated": "" - }, - { - "id": "Js.Option.andThen", - "kind": "value", - "name": "andThen", - "docstrings": [], - "signature": "let andThen: ('a => option<'b>, option<'a>) => option<'b>", - "deprecated": "" - }, - { - "id": "Js.Option.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: ('a => 'b, option<'a>) => option<'b>", - "deprecated": "" - }, - { - "id": "Js.Option.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: ('a, option<'a>) => 'a", - "deprecated": "" - }, - { - "id": "Js.Option.default", - "kind": "value", - "name": "default", - "docstrings": [], - "signature": "let default: ('a, option<'a>) => 'a", - "deprecated": "" - }, - { - "id": "Js.Option.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: ('a => bool, option<'a>) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Option.firstSome", - "kind": "value", - "name": "firstSome", - "docstrings": [], - "signature": "let firstSome: (option<'a>, option<'a>) => option<'a>", - "deprecated": "" - } - ] - }, - "js/blob": { - "id": "Js.Blob", - "name": "Blob", - "docstrings": [ - "Provide utilities for Blob", - "JavaScript Blob API" - ], - "items": [ - { - "id": "Js.Blob.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - } - ] - }, - "js/file": { - "id": "Js.File", - "name": "File", - "docstrings": [ - "Provide utilities for File", - "JavaScript File API" - ], - "items": [ - { - "id": "Js.File.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - } - ] - }, - "js/bigint": { - "id": "Js.BigInt", - "name": "BigInt", - "docstrings": [ - "Provide utilities for bigint", - "JavaScript BigInt API" - ], - "items": [ - { - "id": "Js.BigInt.fromStringExn", - "kind": "value", - "name": "fromStringExn", - "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Return the\nnumber as a `bigint` if successfully parsed. Uncaught syntax exception otherwise.\n\n## Examples\n\n```rescript\n/* returns 123n */\nJs.BigInt.fromStringExn(\"123\")\n\n/* returns 0n */\nJs.BigInt.fromStringExn(\"\")\n\n/* returns 17n */\nJs.BigInt.fromStringExn(\"0x11\")\n\n/* returns 3n */\nJs.BigInt.fromStringExn(\"0b11\")\n\n/* returns 9n */\nJs.BigInt.fromStringExn(\"0o11\")\n\n/* catch exception */\ntry {\n Js.BigInt.fromStringExn(\"a\")\n} catch {\n| _ => Console.error(\"Error parsing bigint\")\n}\n```" - ], - "signature": "let fromStringExn: string => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.~-", - "kind": "value", - "name": "~-", - "docstrings": [], - "signature": "let ~-: bigint => bigint" - }, - { - "id": "Js.BigInt.~+", - "kind": "value", - "name": "~+", - "docstrings": [], - "signature": "let ~+: bigint => bigint" - }, - { - "id": "Js.BigInt.+", - "kind": "value", - "name": "+", - "docstrings": [], - "signature": "let +: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.-", - "kind": "value", - "name": "-", - "docstrings": [], - "signature": "let -: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.*", - "kind": "value", - "name": "*", - "docstrings": [], - "signature": "let *: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt./", - "kind": "value", - "name": "/", - "docstrings": [], - "signature": "let /: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.mod", - "kind": "value", - "name": "mod", - "docstrings": [], - "signature": "let mod: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.**", - "kind": "value", - "name": "**", - "docstrings": [], - "signature": "let **: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.land", - "kind": "value", - "name": "land", - "docstrings": [], - "signature": "let land: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lor", - "kind": "value", - "name": "lor", - "docstrings": [], - "signature": "let lor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lxor", - "kind": "value", - "name": "lxor", - "docstrings": [], - "signature": "let lxor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lnot", - "kind": "value", - "name": "lnot", - "docstrings": [], - "signature": "let lnot: bigint => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lsl", - "kind": "value", - "name": "lsl", - "docstrings": [], - "signature": "let lsl: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.asr", - "kind": "value", - "name": "asr", - "docstrings": [], - "signature": "let asr: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats a `bigint` as a string. Return a `string` representing the given value.\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123\" */\nJs.BigInt.toString(123n)->Js.log\n```" - ], - "signature": "let toString: bigint => string", - "deprecated": "" - }, - { - "id": "Js.BigInt.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Returns a string with a language-sensitive representation of this BigInt value.\n\n## Examples\n\n```rescript\n/* prints \"123\" */\nJs.BigInt.toString(123n)->Js.log\n```" - ], - "signature": "let toLocaleString: bigint => string", - "deprecated": "" - } - ] - }, - "js/int": { - "id": "Js.Int", - "name": "Int", - "docstrings": [ - "Provide utilities for int", - "Provide utilities for handling `int`." - ], - "items": [ - { - "id": "Js.Int.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "Formats an `int` using exponential (scientific) notation.\nReturns a `string` representing the given value in exponential notation.\nThrows `RangeError` if digits is not in the range \\[0, 20\\] (inclusive).\n\nSee [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.7e+1\" */\nJs.log(Js.Int.toExponential(77))\n```" - ], - "signature": "let toExponential: int => string", - "deprecated": "" - }, - { - "id": "Js.Int.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "Formats an `int` using exponential (scientific) notation.\n`digits` specifies how many digits should appear after the decimal point. The value must be in the range \\[0, 20\\] (inclusive).\n\nReturns a `string` representing the given value in exponential notation.\n\nThe output will be rounded or padded with zeroes if necessary.\nThrows `RangeError` if `digits` is not in the range \\[0, 20\\] (inclusive).\n\nSee [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.70e+1\" */\nJs.log(Js.Int.toExponentialWithPrecision(77, ~digits=2))\n\n/* prints \"5.68e+3\" */\nJs.log(Js.Int.toExponentialWithPrecision(5678, ~digits=2))\n```" - ], - "signature": "let toExponentialWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Int.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "Formats an `int` using some fairly arbitrary rules.\nReturns a `string` representing the given value in fixed-point (usually).\n\n`toPrecision` differs from `toFixed` in that the former will format the number with full precision, while the latter will not output any digits after the decimal point.\nThrows `RangeError` if `digits` is not in the range accepted by this function.\n\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123456789\" */\nJs.log(Js.Int.toPrecision(123456789))\n```" - ], - "signature": "let toPrecision: int => string", - "deprecated": "" - }, - { - "id": "Js.Int.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "Formats an `int` using some fairly arbitrary rules.\n`digits` specifies how many digits should appear in total. The value must between 0 and some arbitrary number that's hopefully at least larger than 20 (for Node it's 21. Why? Who knows).\n\nReturns a `string` representing the given value in fixed-point or scientific notation.\n\nThe output will be rounded or padded with zeroes if necessary.\n\n`toPrecisionWithPrecision` differs from `toFixedWithPrecision` in that the former will count all digits against the precision, while the latter will count only the digits after the decimal point.\n`toPrecisionWithPrecision` will also use scientific notation if the specified precision is less than the number of digits before the decimal point.\nThrows `RangeError` if `digits` is not in the range accepted by this function.\n\n\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"1.2e+8\" */\nJs.log(Js.Int.toPrecisionWithPrecision(123456789, ~digits=2))\n\n/* prints \"0.0\" */\nJs.log(Js.Int.toPrecisionWithPrecision(0, ~digits=2))\n```" - ], - "signature": "let toPrecisionWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Int.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats an `int` as a `string`. Returns a `string` representing the given value\nin fixed-point (usually).\n\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123456789\" */\nJs.log(Js.Int.toString(123456789))\n```" - ], - "signature": "let toString: int => string", - "deprecated": "" - }, - { - "id": "Js.Int.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "Formats an `int` as a `string`. `radix` specifies the radix base to use for the\nformatted number. The value must be in the range \\[2, 36\\] (inclusive). Returns\na `string` representing the given value in fixed-point (usually). Throws\n`RangeError` if `radix` is not in the range \\[2, 36\\] (inclusive).\n\n\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"110\" */\nJs.log(Js.Int.toStringWithRadix(6, ~radix=2))\n\n/* prints \"deadbeef\" */\nJs.log(Js.Int.toStringWithRadix(3735928559, ~radix=16))\n\n/* prints \"2n9c\" */\nJs.log(Js.Int.toStringWithRadix(123456, ~radix=36))\n```" - ], - "signature": "let toStringWithRadix: (int, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Js.Int.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [], - "signature": "let toFloat: int => float", - "deprecated": "" - }, - { - "id": "Js.Int.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (int, int) => bool", - "deprecated": "" - }, - { - "id": "Js.Int.max", - "kind": "value", - "name": "max", - "docstrings": [], - "signature": "let max: int" - }, - { - "id": "Js.Int.min", - "kind": "value", - "name": "min", - "docstrings": [], - "signature": "let min: int" - } - ] - }, - "js/float": { - "id": "Js.Float", - "name": "Float", - "docstrings": [ - "Provide utilities for JS float", - "Provide utilities for JS float." - ], - "items": [ - { - "id": "Js.Float._NaN", - "kind": "value", - "name": "_NaN", - "docstrings": [ - "The special value \"Not a Number\". See [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN) on MDN." - ], - "signature": "let _NaN: float", - "deprecated": "" - }, - { - "id": "Js.Float.isNaN", - "kind": "value", - "name": "isNaN", - "docstrings": [ - "Tests if the given value is `_NaN`\n\nNote that both `_NaN = _NaN` and `_NaN == _NaN` will return `false`. `isNaN` is\ntherefore necessary to test for `_NaN`. Return `true` if the given value is\n`_NaN`, `false` otherwise. See [`isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) on MDN." - ], - "signature": "let isNaN: float => bool", - "deprecated": "" - }, - { - "id": "Js.Float.isFinite", - "kind": "value", - "name": "isFinite", - "docstrings": [ - "Tests if the given value is finite. Return `true` if the given value is a finite\nnumber, `false` otherwise. See [`isFinite`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite) on MDN.\n\n## Examples\n\n```rescript\n/* returns [false] */\nJs.Float.isFinite(infinity)\n\n/* returns [false] */\nJs.Float.isFinite(neg_infinity)\n\n/* returns [false] */\nJs.Float.isFinite(Js.Float._NaN)\n\n/* returns [true] */\nJs.Float.isFinite(1234.)\n```" - ], - "signature": "let isFinite: float => bool", - "deprecated": "" - }, - { - "id": "Js.Float.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "Formats a `float` using exponential (scientific) notation. Return a\n`string` representing the given value in exponential notation. Throw\nRangeError if digits is not in the range \\[0, 20\\] (inclusive). See [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.71234e+1\" */\nJs.Float.toExponential(77.1234)->Js.log\n\n/* prints \"7.7e+1\" */\nJs.Float.toExponential(77.)->Js.log\n```" - ], - "signature": "let toExponential: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "Formats a `float` using exponential (scientific) notation. `digits` specifies\nhow many digits should appear after the decimal point. The value must be in\nthe range \\[0, 20\\] (inclusive). Return a `string` representing the given value\nin exponential notation. The output will be rounded or padded with zeroes if\nnecessary. Throw RangeError if `digits` is not in the range \\[0, 20\\] (inclusive).\nSee [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.71e+1\" */\nJs.Float.toExponentialWithPrecision(77.1234, ~digits=2)->Js.log\n```" - ], - "signature": "let toExponentialWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.toFixed", - "kind": "value", - "name": "toFixed", - "docstrings": [ - "Formats a `float` using fixed point notation. Return a `string` representing the\ngiven value in fixed-point notation (usually). Throw RangeError if digits is not\nin the range \\[0, 20\\] (inclusive). See [`toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"12346\" (note the rounding) */\nJs.Float.toFixed(12345.6789)->Js.log\n\n/* print \"1.2e+21\" */\nJs.Float.toFixed(1.2e21)->Js.log\n```" - ], - "signature": "let toFixed: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toFixedWithPrecision", - "kind": "value", - "name": "toFixedWithPrecision", - "docstrings": [ - "Formats a `float` using fixed point notation. `digits` specifies how many digits\nshould appear after the decimal point. The value must be in the range \\[0, 20\\]\n(inclusive). Defaults to `0`. Return a `string` representing the given value in\nfixed-point notation (usually). See [`toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\nThe output will be rounded or padded with zeroes if necessary.\n\nThrow RangeError if digits is not in the range \\[0, 20\\] (inclusive)\n\n## Examples\n\n```rescript\n/* prints \"12345.7\" (note the rounding) */\nJs.Float.toFixedWithPrecision(12345.6789, ~digits=1)->Js.log\n\n/* prints \"0.00\" (note the added zeroes) */\nJs.Float.toFixedWithPrecision(0., ~digits=2)->Js.log\n```" - ], - "signature": "let toFixedWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "Formats a `float` using some fairly arbitrary rules. Return a `string`\nrepresenting the given value in fixed-point (usually). `toPrecision` differs\nfrom `Js.Float.toFixed` in that the former will format the number with full\nprecision, while the latter will not output any digits after the decimal point.\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\nThrow RangeError if digits is not in the range accepted by this function (what do you mean \"vague\"?)\n\n## Examples\n\n```rescript\n/* prints \"12345.6789\" */\nJs.Float.toPrecision(12345.6789)->Js.log\n\n/* print \"1.2e+21\" */\nJs.Float.toPrecision(1.2e21)->Js.log\n```" - ], - "signature": "let toPrecision: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "Formats a `float` using some fairly arbitrary rules. `digits` specifies how many\ndigits should appear in total. The value must between 0 and some arbitrary number\nthat's hopefully at least larger than 20 (for Node it's 21. Why? Who knows).\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\nReturn a `string` representing the given value in fixed-point or scientific\nnotation. The output will be rounded or padded with zeroes if necessary.\n\n`toPrecisionWithPrecision` differs from `toFixedWithPrecision` in that the former\nwill count all digits against the precision, while the latter will count only\nthe digits after the decimal point. `toPrecisionWithPrecision` will also use\nscientific notation if the specified precision is less than the number for digits\nbefore the decimal point.\n\nThrow RangeError if digits is not in the range accepted by this function (what do you mean \"vague\"?)\n\n## Examples\n\n```rescript\n/* prints \"1e+4\" */\nJs.Float.toPrecisionWithPrecision(12345.6789, ~digits=1)->Js.log\n\n/* prints \"0.0\" */\nJs.Float.toPrecisionWithPrecision(0., ~digits=2)->Js.log\n```" - ], - "signature": "let toPrecisionWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats a `float` as a string. Return a `string` representing the given value in\nfixed-point (usually). See [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"12345.6789\" */\nJs.Float.toString(12345.6789)->Js.log\n```" - ], - "signature": "let toString: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "Formats a `float` as a string. `radix` specifies the radix base to use for the\nformatted number. The value must be in the range \\[2, 36\\] (inclusive). Return a\n`string` representing the given value in fixed-point (usually). See [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\nThrow RangeError if radix is not in the range \\[2, 36\\] (inclusive)\n\n## Examples\n\n```rescript\n/* prints \"110\" */\nJs.Float.toStringWithRadix(6., ~radix=2)->Js.log\n\n/* prints \"11.001000111101011100001010001111010111000010100011111\" */\nJs.Float.toStringWithRadix(3.14, ~radix=2)->Js.log\n\n/* prints \"deadbeef\" */\nJs.Float.toStringWithRadix(3735928559., ~radix=16)->Js.log\n\n/* prints \"3f.gez4w97ry0a18ymf6qadcxr\" */\nJs.Float.toStringWithRadix(123.456, ~radix=36)->Js.log\n```" - ], - "signature": "let toStringWithRadix: (float, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Parses the given `string` into a `float` using JavaScript semantics. Return the\nnumber as a `float` if successfully parsed, `_NaN` otherwise.\n\n## Examples\n\n```rescript\n/* returns 123 */\nJs.Float.fromString(\"123\")\n\n/* returns 12.3 */\nJs.Float.fromString(\"12.3\")\n\n/* returns 0 */\nJs.Float.fromString(\"\")\n\n/* returns 17 */\nJs.Float.fromString(\"0x11\")\n\n/* returns 3 */\nJs.Float.fromString(\"0b11\")\n\n/* returns 9 */\nJs.Float.fromString(\"0o11\")\n\n/* returns [_NaN] */\nJs.Float.fromString(\"hello\")\n\n/* returns [_NaN] */\nJs.Float.fromString(\"100a\")\n```" - ], - "signature": "let fromString: string => float", - "deprecated": "" - } - ] - }, - "js/types": { - "id": "Js.Types", - "name": "Types", - "docstrings": [ - "Provide utilities for manipulating JS types", - "Provide utilities for manipulating JS types." - ], - "items": [ - { - "id": "Js.Types.symbol", - "kind": "type", - "name": "symbol", - "docstrings": [ - "Js symbol type (only available in ES6)" - ], - "signature": "type symbol = Symbol.t", - "deprecated": "" - }, - { - "id": "Js.Types.obj_val", - "kind": "type", - "name": "obj_val", - "docstrings": [], - "signature": "type obj_val = \\\"Type.Classify\".object", - "deprecated": "" - }, - { - "id": "Js.Types.undefined_val", - "kind": "type", - "name": "undefined_val", - "docstrings": [ - "This type has only one value `undefined`" - ], - "signature": "type undefined_val", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.null_val", - "kind": "type", - "name": "null_val", - "docstrings": [ - "This type has only one value `null`" - ], - "signature": "type null_val", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.function_val", - "kind": "type", - "name": "function_val", - "docstrings": [], - "signature": "type function_val = \\\"Type.Classify\".function", - "deprecated": "" - }, - { - "id": "Js.Types.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<_> =\n | Undefined: t\n | Null: t\n | Boolean: t\n | Number: t\n | String: t\n | Function: t\n | Object: t\n | Symbol: t\n | BigInt: t", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.test", - "kind": "value", - "name": "test", - "docstrings": [ - "`test(value, t)` returns `true` if `value` is `typeof t`, otherwise `false`.\nThis is useful for doing runtime reflection on any given value.\n\n## Examples\n\n```rescript\ntest(\"test\", String) == true\ntest(() => true, Function) == true\ntest(\"test\", Boolean) == false\n```" - ], - "signature": "let test: ('a, t<'b>) => bool", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.tagged_t", - "kind": "type", - "name": "tagged_t", - "docstrings": [], - "signature": "type tagged_t =\n | JSFalse\n | JSTrue\n | JSNull\n | JSUndefined\n | JSNumber(float)\n | JSString(string)\n | JSFunction(function_val)\n | JSObject(obj_val)\n | JSSymbol(symbol)\n | JSBigInt(bigint)", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.classify", - "kind": "value", - "name": "classify", - "docstrings": [], - "signature": "let classify: 'a => tagged_t", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - } - ] - }, - "js/typedarray2": { - "id": "Js.TypedArray2", - "name": "TypedArray2", - "docstrings": [ - "Provide bindings for JS typed array", - "JavaScript Typed Array API\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)" - ], - "items": [ - { - "id": "Js.TypedArray2.array_buffer", - "kind": "type", - "name": "array_buffer", - "docstrings": [], - "signature": "type array_buffer = ArrayBuffer.t" - }, - { - "id": "Js.TypedArray2.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [], - "signature": "type array_like<'a>" - } - ] - }, - "js/typed_array": { - "id": "Js.Typed_array", - "name": "Typed_array", - "docstrings": [ - "Provide bindings for JS typed array", - "JavaScript Typed Array API\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)" - ], - "items": [ - { - "id": "Js.Typed_array.array_buffer", - "kind": "type", - "name": "array_buffer", - "docstrings": [], - "signature": "type array_buffer = Js_typed_array2.array_buffer", - "deprecated": "" - }, - { - "id": "Js.Typed_array.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [], - "signature": "type array_like<'a> = Js_typed_array2.array_like<'a>", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `TypedArray` module instead." - } - ] - }, - "js/obj": { - "id": "Js.Obj", - "name": "Obj", - "docstrings": [ - "Provide utilities for `Js.t`", - "Provides functions for inspecting and manipulating native JavaScript objects" - ], - "items": [ - { - "id": "Js.Obj.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "`empty()` returns the empty object `{}`" - ], - "signature": "let empty: unit => {..}", - "deprecated": "" - }, - { - "id": "Js.Obj.assign", - "kind": "value", - "name": "assign", - "docstrings": [ - "`assign(target, source)` copies properties from source to target.\nProperties in `target` will be overwritten by properties in `source` if they have the same key.\nReturns `target`.\n\n**See** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\n\n## Examples\n\n```rescript\n/* Copy an object */\n\nlet obj = {\"a\": 1}\n\nlet copy = Js.Obj.assign(Js.Obj.empty(), obj)\n\n/* prints \"{ a: 1 }\" */\nJs.log(copy)\n\n/* Merge objects with same properties */\n\nlet target = {\"a\": 1, \"b\": 1}\nlet source = {\"b\": 2}\n\nlet obj = Js.Obj.assign(target, source)\n\n/* prints \"{ a: 1, b: 2 }\" */\nJs.log(obj)\n\n/* prints \"{ a: 1, b: 2 }\", target is modified */\nJs.log(target)\n```" - ], - "signature": "let assign: ({..}, {..}) => {..}", - "deprecated": "" - }, - { - "id": "Js.Obj.keys", - "kind": "value", - "name": "keys", - "docstrings": [ - "`keys(obj)` returns an `array` of the keys of `obj`'s own enumerable properties." - ], - "signature": "let keys: {..} => array", - "deprecated": "" - } - ] - }, - "js/math": { - "id": "Js.Math", - "name": "Math", - "docstrings": [ - "Provide bindings for JS `Math` object", - "Provide utilities for JS Math. Note: The constants `_E`, `_LN10`, `_LN2`,\n`_LOG10E`, `_LOG2E`, `_PI`, `_SQRT1_2`, and `_SQRT2` begin with an underscore\nbecause ReScript variable names cannot begin with a capital letter. (Module\nnames begin with upper case.)" - ], - "items": [ - { - "id": "Js.Math._E", - "kind": "value", - "name": "_E", - "docstrings": [ - "Euler's number; ≈ 2.718281828459045. See\n[`Math.E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/E)\non MDN." - ], - "signature": "let _E: float", - "deprecated": "" - }, - { - "id": "Js.Math._LN2", - "kind": "value", - "name": "_LN2", - "docstrings": [ - "Natural logarithm of 2; ≈ 0.6931471805599453. See\n[`Math.LN2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN2)\non MDN." - ], - "signature": "let _LN2: float", - "deprecated": "" - }, - { - "id": "Js.Math._LN10", - "kind": "value", - "name": "_LN10", - "docstrings": [ - "Natural logarithm of 10; ≈ 2.302585092994046. See\n[`Math.LN10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN10)\non MDN." - ], - "signature": "let _LN10: float", - "deprecated": "" - }, - { - "id": "Js.Math._LOG2E", - "kind": "value", - "name": "_LOG2E", - "docstrings": [ - "Base 2 logarithm of E; ≈ 1.4426950408889634. See\n[`Math.LOG2E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG2E)\non MDN." - ], - "signature": "let _LOG2E: float", - "deprecated": "" - }, - { - "id": "Js.Math._LOG10E", - "kind": "value", - "name": "_LOG10E", - "docstrings": [ - "Base 10 logarithm of E; ≈ 0.4342944819032518. See\n[`Math.LOG10E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG10E)\non MDN." - ], - "signature": "let _LOG10E: float", - "deprecated": "" - }, - { - "id": "Js.Math._PI", - "kind": "value", - "name": "_PI", - "docstrings": [ - "Pi - ratio of the circumference to the diameter of a circle; ≈ 3.141592653589793. See\n[`Math.PI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/PI)\non MDN." - ], - "signature": "let _PI: float", - "deprecated": "" - }, - { - "id": "Js.Math._SQRT1_2", - "kind": "value", - "name": "_SQRT1_2", - "docstrings": [ - "Square root of 1/2; ≈ 0.7071067811865476. See\n[`Math.SQRT1_2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2)\non MDN." - ], - "signature": "let _SQRT1_2: float", - "deprecated": "" - }, - { - "id": "Js.Math._SQRT2", - "kind": "value", - "name": "_SQRT2", - "docstrings": [ - "Square root of 2; ≈ 1.4142135623730951. See\n[`Math.SQRT2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT2)\non MDN." - ], - "signature": "let _SQRT2: float", - "deprecated": "" - }, - { - "id": "Js.Math.abs_int", - "kind": "value", - "name": "abs_int", - "docstrings": [ - "Absolute value for integer argument. See\n[`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs)\non MDN." - ], - "signature": "let abs_int: int => int", - "deprecated": "" - }, - { - "id": "Js.Math.abs_float", - "kind": "value", - "name": "abs_float", - "docstrings": [ - "Absolute value for float argument. See\n[`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs)\non MDN." - ], - "signature": "let abs_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.acos", - "kind": "value", - "name": "acos", - "docstrings": [ - "Arccosine (in radians) of argument; returns `NaN` if the argument is outside\nthe range [-1.0, 1.0]. See\n[`Math.acos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acos)\non MDN." - ], - "signature": "let acos: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.acosh", - "kind": "value", - "name": "acosh", - "docstrings": [ - "Hyperbolic arccosine (in radians) of argument; returns `NaN` if the argument\nis less than 1.0. See\n[`Math.acosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acosh)\non MDN." - ], - "signature": "let acosh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.asin", - "kind": "value", - "name": "asin", - "docstrings": [ - "Arcsine (in radians) of argument; returns `NaN` if the argument is outside\nthe range [-1.0, 1.0]. See\n[`Math.asin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asin)\non MDN." - ], - "signature": "let asin: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.asinh", - "kind": "value", - "name": "asinh", - "docstrings": [ - "Hyperbolic arcsine (in radians) of argument. See\n[`Math.asinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh)\non MDN." - ], - "signature": "let asinh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.atan", - "kind": "value", - "name": "atan", - "docstrings": [ - "Arctangent (in radians) of argument. See\n[`Math.atan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan)\non MDN." - ], - "signature": "let atan: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.atanh", - "kind": "value", - "name": "atanh", - "docstrings": [ - "Hyperbolic arctangent (in radians) of argument; returns `NaN` if the argument\nis is outside the range [-1.0, 1.0]. Returns `-Infinity` and `Infinity` for\narguments -1.0 and 1.0. See\n[`Math.atanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh)\non MDN." - ], - "signature": "let atanh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.atan2", - "kind": "value", - "name": "atan2", - "docstrings": [ - "Returns the angle (in radians) of the quotient `y /. x`. It is also the angle\nbetween the *x*\\-axis and point (*x*, *y*). See\n[`Math.atan2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.atan2(~y=0.0, ~x=10.0, ()) == 0.0\nJs.Math.atan2(~x=5.0, ~y=5.0, ()) == Js.Math._PI /. 4.0\nJs.Math.atan2(~x=-5.0, ~y=5.0, ())\nJs.Math.atan2(~x=-5.0, ~y=5.0, ()) == 3.0 *. Js.Math._PI /. 4.0\nJs.Math.atan2(~x=-0.0, ~y=-5.0, ()) == -.Js.Math._PI /. 2.0\n```" - ], - "signature": "let atan2: (~y: float, ~x: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Math.cbrt", - "kind": "value", - "name": "cbrt", - "docstrings": [ - "Cube root. See\n[`Math.cbrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt)\non MDN" - ], - "signature": "let cbrt: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_ceil_int", - "kind": "value", - "name": "unsafe_ceil_int", - "docstrings": [ - "Returns the smallest integer greater than or equal to the argument. This\nfunction may return values not representable by `int`, whose range is\n\\-2147483648 to 2147483647. This is because, in JavaScript, there are only\n64-bit floating point numbers, which can represent integers in the range\n±(253\\-1) exactly. See\n[`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.unsafe_ceil_int(3.1) == 4\nJs.Math.unsafe_ceil_int(3.0) == 3\nJs.Math.unsafe_ceil_int(-3.1) == -3\nJs.Math.unsafe_ceil_int(1.0e15) // result is outside range of int datatype\n```" - ], - "signature": "let unsafe_ceil_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_ceil", - "kind": "value", - "name": "unsafe_ceil", - "docstrings": [], - "signature": "let unsafe_ceil: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.ceil_int", - "kind": "value", - "name": "ceil_int", - "docstrings": [ - "Returns the smallest `int` greater than or equal to the argument; the result\nis pinned to the range of the `int` data type: -2147483648 to 2147483647. See\n[`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.ceil_int(3.1) == 4\nJs.Math.ceil_int(3.0) == 3\nJs.Math.ceil_int(-3.1) == -3\nJs.Math.ceil_int(-1.0e15) == -2147483648\nJs.Math.ceil_int(1.0e15) == 2147483647\n```" - ], - "signature": "let ceil_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.ceil", - "kind": "value", - "name": "ceil", - "docstrings": [], - "signature": "let ceil: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.ceil_float", - "kind": "value", - "name": "ceil_float", - "docstrings": [ - "Returns the smallest integral value greater than or equal to the argument.\nThe result is a `float` and is not restricted to the `int` data type range.\nSee\n[`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.ceil_float(3.1) == 4.0\nJs.Math.ceil_float(3.0) == 3.0\nJs.Math.ceil_float(-3.1) == -3.0\nJs.Math.ceil_float(2_150_000_000.3) == 2_150_000_001.0\n```" - ], - "signature": "let ceil_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.clz32", - "kind": "value", - "name": "clz32", - "docstrings": [ - "Number of leading zero bits of the argument's 32 bit int representation. See\n[`Math.clz32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.clz32(0) == 32\nJs.Math.clz32(-1) == 0\nJs.Math.clz32(255) == 24\n```" - ], - "signature": "let clz32: int => int", - "deprecated": "" - }, - { - "id": "Js.Math.cos", - "kind": "value", - "name": "cos", - "docstrings": [ - "Cosine of argument, which must be specified in radians. See\n[`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos)\non MDN." - ], - "signature": "let cos: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.cosh", - "kind": "value", - "name": "cosh", - "docstrings": [ - "Hyperbolic cosine of argument, which must be specified in radians. See\n[`Math.cosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh)\non MDN." - ], - "signature": "let cosh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.exp", - "kind": "value", - "name": "exp", - "docstrings": [ - "Natural exponentional; returns *e* (the base of natural logarithms) to the\npower of the given argument. See\n[`Math.exp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/exp)\non MDN." - ], - "signature": "let exp: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.expm1", - "kind": "value", - "name": "expm1", - "docstrings": [ - "Returns *e* (the base of natural logarithms) to the power of the given\nargument minus 1. See\n[`Math.expm1`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1)\non MDN." - ], - "signature": "let expm1: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_floor_int", - "kind": "value", - "name": "unsafe_floor_int", - "docstrings": [ - "Returns the largest integer less than or equal to the argument. This function\nmay return values not representable by `int`, whose range is -2147483648 to\n2147483647. This is because, in JavaScript, there are only 64-bit floating\npoint numbers, which can represent integers in the range\n±(253\\-1) exactly. See\n[`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.unsafe_floor_int(3.7) == 3\nJs.Math.unsafe_floor_int(3.0) == 3\nJs.Math.unsafe_floor_int(-3.7) == -4\nJs.Math.unsafe_floor_int(1.0e15) // result is outside range of int datatype\n```" - ], - "signature": "let unsafe_floor_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_floor", - "kind": "value", - "name": "unsafe_floor", - "docstrings": [], - "signature": "let unsafe_floor: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.floor_int", - "kind": "value", - "name": "floor_int", - "docstrings": [ - "Returns the largest `int` less than or equal to the argument; the result is\npinned to the range of the `int` data type: -2147483648 to 2147483647. See\n[`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.floor_int(3.7) == 3\nJs.Math.floor_int(3.0) == 3\nJs.Math.floor_int(-3.1) == -4\nJs.Math.floor_int(-1.0e15) == -2147483648\nJs.Math.floor_int(1.0e15) == 2147483647\n```" - ], - "signature": "let floor_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.floor", - "kind": "value", - "name": "floor", - "docstrings": [], - "signature": "let floor: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.floor_float", - "kind": "value", - "name": "floor_float", - "docstrings": [ - "Returns the largest integral value less than or equal to the argument. The\nresult is a `float` and is not restricted to the `int` data type range. See\n[`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.floor_float(3.7) == 3.0\nJs.Math.floor_float(3.0) == 3.0\nJs.Math.floor_float(-3.1) == -4.0\nJs.Math.floor_float(2_150_000_000.3) == 2_150_000_000.0\n```" - ], - "signature": "let floor_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.fround", - "kind": "value", - "name": "fround", - "docstrings": [ - "Round to nearest single precision float. See\n[`Math.fround`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.fround(5.5) == 5.5\nJs.Math.fround(5.05) == 5.050000190734863\n```" - ], - "signature": "let fround: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.hypot", - "kind": "value", - "name": "hypot", - "docstrings": [ - "Returns the square root of the sum of squares of its two arguments (the\nPythagorean formula). See\n[`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot)\non MDN." - ], - "signature": "let hypot: (float, float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.hypotMany", - "kind": "value", - "name": "hypotMany", - "docstrings": [ - "Returns the square root of the sum of squares of the numbers in the array\nargument (generalized Pythagorean equation). Using an array allows you to\nhave more than two items. See\n[`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.hypotMany([3.0, 4.0, 12.0]) == 13.0\n```" - ], - "signature": "let hypotMany: array => float", - "deprecated": "" - }, - { - "id": "Js.Math.imul", - "kind": "value", - "name": "imul", - "docstrings": [ - "32-bit integer multiplication. Use this only when you need to optimize\nperformance of multiplication of numbers stored as 32-bit integers. See\n[`Math.imul`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul)\non MDN." - ], - "signature": "let imul: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.log", - "kind": "value", - "name": "log", - "docstrings": [ - "Returns the natural logarithm of its argument; this is the number *x* such\nthat *e**x* equals the argument. Returns `NaN` for negative\narguments. See\n[`Math.log`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log(Js.Math._E) == 1.0\nJs.Math.log(100.0) == 4.605170185988092\n```" - ], - "signature": "let log: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.log1p", - "kind": "value", - "name": "log1p", - "docstrings": [ - "Returns the natural logarithm of one plus the argument. Returns `NaN` for\narguments less than -1. See\n[`Math.log1p`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log1p)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log1p(Js.Math._E -. 1.0) == 1.0\nJs.Math.log1p(99.0) == 4.605170185988092\n```" - ], - "signature": "let log1p: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.log10", - "kind": "value", - "name": "log10", - "docstrings": [ - "Returns the base 10 logarithm of its argument. Returns `NaN` for negative\narguments. See\n[`Math.log10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log10)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log10(1000.0) == 3.0\nJs.Math.log10(0.01) == -2.0\nJs.Math.log10(Js.Math.sqrt(10.0)) == 0.5\n```" - ], - "signature": "let log10: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.log2", - "kind": "value", - "name": "log2", - "docstrings": [ - "Returns the base 2 logarithm of its argument. Returns `NaN` for negative\narguments. See\n[`Math.log2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log2(512.0) == 9.0\nJs.Math.log2(0.125) == -3.0\nJs.Math.log2(Js.Math._SQRT2) == 0.5000000000000001 // due to precision\n```" - ], - "signature": "let log2: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.max_int", - "kind": "value", - "name": "max_int", - "docstrings": [ - "Returns the maximum of its two integer arguments. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let max_int: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.maxMany_int", - "kind": "value", - "name": "maxMany_int", - "docstrings": [ - "Returns the maximum of the integers in the given array. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let maxMany_int: array => int", - "deprecated": "" - }, - { - "id": "Js.Math.max_float", - "kind": "value", - "name": "max_float", - "docstrings": [ - "Returns the maximum of its two floating point arguments. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let max_float: (float, float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.maxMany_float", - "kind": "value", - "name": "maxMany_float", - "docstrings": [ - "Returns the maximum of the floating point values in the given array. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let maxMany_float: array => float", - "deprecated": "" - }, - { - "id": "Js.Math.min_int", - "kind": "value", - "name": "min_int", - "docstrings": [ - "Returns the minimum of its two integer arguments. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let min_int: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.minMany_int", - "kind": "value", - "name": "minMany_int", - "docstrings": [ - "Returns the minimum of the integers in the given array. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let minMany_int: array => int", - "deprecated": "" - }, - { - "id": "Js.Math.min_float", - "kind": "value", - "name": "min_float", - "docstrings": [ - "Returns the minimum of its two floating point arguments. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let min_float: (float, float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.minMany_float", - "kind": "value", - "name": "minMany_float", - "docstrings": [ - "Returns the minimum of the floating point values in the given array. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let minMany_float: array => float", - "deprecated": "" - }, - { - "id": "Js.Math.pow_int", - "kind": "value", - "name": "pow_int", - "docstrings": [ - "Throws the given base to the given exponent. (Arguments and result are\nintegers.) See\n[`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.pow_int(~base=3, ~exp=4) == 81\n```" - ], - "signature": "let pow_int: (~base: int, ~exp: int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.pow_float", - "kind": "value", - "name": "pow_float", - "docstrings": [ - "Throws the given base to the given exponent. (Arguments and result are\nfloats.) Returns `NaN` if the result would be imaginary. See\n[`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.pow_float(~base=3.0, ~exp=4.0) == 81.0\nJs.Math.pow_float(~base=4.0, ~exp=-2.0) == 0.0625\nJs.Math.pow_float(~base=625.0, ~exp=0.5) == 25.0\nJs.Math.pow_float(~base=625.0, ~exp=-0.5) == 0.04\nJs.Float.isNaN(Js.Math.pow_float(~base=-2.0, ~exp=0.5)) == true\n```" - ], - "signature": "let pow_float: (~base: float, ~exp: float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.random", - "kind": "value", - "name": "random", - "docstrings": [ - "Returns a random number in the half-closed interval [0,1). See\n[`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\non MDN." - ], - "signature": "let random: unit => float", - "deprecated": "" - }, - { - "id": "Js.Math.random_int", - "kind": "value", - "name": "random_int", - "docstrings": [ - "A call to `random_int(minVal, maxVal)` returns a random number in the\nhalf-closed interval [minVal, maxVal). See\n[`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\non MDN." - ], - "signature": "let random_int: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_round", - "kind": "value", - "name": "unsafe_round", - "docstrings": [ - "Rounds its argument to nearest integer. For numbers with a fractional portion\nof exactly 0.5, the argument is rounded to the next integer in the direction\nof positive infinity. This function may return values not representable by\n`int`, whose range is -2147483648 to 2147483647. This is because, in\nJavaScript, there are only 64-bit floating point numbers, which can represent\nintegers in the range ±(253\\-1) exactly. See\n[`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.unsafe_round(3.7) == 4\nJs.Math.unsafe_round(-3.5) == -3\nJs.Math.unsafe_round(2_150_000_000_000.3) // out of range for int\n```" - ], - "signature": "let unsafe_round: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.round", - "kind": "value", - "name": "round", - "docstrings": [ - "Rounds to nearest integral value (expressed as a float). See\n[`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round)\non MDN." - ], - "signature": "let round: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sign_int", - "kind": "value", - "name": "sign_int", - "docstrings": [ - "Returns the sign of its integer argument: -1 if negative, 0 if zero, 1 if\npositive. See\n[`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign)\non MDN." - ], - "signature": "let sign_int: int => int", - "deprecated": "" - }, - { - "id": "Js.Math.sign_float", - "kind": "value", - "name": "sign_float", - "docstrings": [ - "Returns the sign of its float argument: -1.0 if negative, 0.0 if zero, 1.0 if\npositive. See\n[`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign)\non MDN." - ], - "signature": "let sign_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sin", - "kind": "value", - "name": "sin", - "docstrings": [ - "Sine of argument, which must be specified in radians. See\n[`Math.sin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin)\non MDN." - ], - "signature": "let sin: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sinh", - "kind": "value", - "name": "sinh", - "docstrings": [ - "Hyperbolic sine of argument, which must be specified in radians. See\n[`Math.sinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sinh)\non MDN." - ], - "signature": "let sinh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sqrt", - "kind": "value", - "name": "sqrt", - "docstrings": [ - "Square root. If the argument is negative, this function returns `NaN`. See\n[`Math.sqrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt)\non MDN." - ], - "signature": "let sqrt: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.tan", - "kind": "value", - "name": "tan", - "docstrings": [ - "Tangent of argument, which must be specified in radians. Returns `NaN` if the\nargument is positive infinity or negative infinity. See\n[`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos)\non MDN." - ], - "signature": "let tan: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.tanh", - "kind": "value", - "name": "tanh", - "docstrings": [ - "Hyperbolic tangent of argument, which must be specified in radians. See\n[`Math.tanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tanh)\non MDN." - ], - "signature": "let tanh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_trunc", - "kind": "value", - "name": "unsafe_trunc", - "docstrings": [ - "Truncates its argument; i.e., removes fractional digits. This function may\nreturn values not representable by `int`, whose range is -2147483648 to\n2147483647. This is because, in JavaScript, there are only 64-bit floating\npoint numbers, which can represent integers in the range ±(253-1)\nexactly. See\n[`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc)\non MDN." - ], - "signature": "let unsafe_trunc: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.trunc", - "kind": "value", - "name": "trunc", - "docstrings": [ - "Truncates its argument; i.e., removes fractional digits. See\n[`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc)\non MDN." - ], - "signature": "let trunc: float => float", - "deprecated": "" - } - ] - }, - "js/json": { - "id": "Js.Json", - "name": "Json", - "docstrings": [ - "Provide utilities for json", - "Efficient JSON encoding using JavaScript API\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON)" - ], - "items": [ - { - "id": "Js.Json.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The JSON data structure" - ], - "signature": "@unboxed\ntype t = JSON.t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)", - "deprecated": "" - }, - { - "id": "Js.Json.tagged_t", - "kind": "type", - "name": "tagged_t", - "docstrings": [], - "signature": "type tagged_t =\n | JSONFalse\n | JSONTrue\n | JSONNull\n | JSONString(string)\n | JSONNumber(float)\n | JSONObject(dict)\n | JSONArray(array)", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.classify", - "kind": "value", - "name": "classify", - "docstrings": [], - "signature": "let classify: t => tagged_t", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.test", - "kind": "value", - "name": "test", - "docstrings": [ - "`test(v, kind)` returns `true` if `v` is of `kind`." - ], - "signature": "let test: ('a, Kind.t<'b>) => bool", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.decodeString", - "kind": "value", - "name": "decodeString", - "docstrings": [ - "`decodeString(json)` returns `Some(s)` if `json` is a `string`, `None` otherwise." - ], - "signature": "let decodeString: t => option", - "deprecated": "" - }, - { - "id": "Js.Json.decodeNumber", - "kind": "value", - "name": "decodeNumber", - "docstrings": [ - "`decodeNumber(json)` returns `Some(n)` if `json` is a `number`, `None` otherwise." - ], - "signature": "let decodeNumber: t => option", - "deprecated": "" - }, - { - "id": "Js.Json.decodeObject", - "kind": "value", - "name": "decodeObject", - "docstrings": [ - "`decodeObject(json)` returns `Some(o)` if `json` is an `object`, `None` otherwise." - ], - "signature": "let decodeObject: t => option>", - "deprecated": "" - }, - { - "id": "Js.Json.decodeArray", - "kind": "value", - "name": "decodeArray", - "docstrings": [ - "`decodeArray(json)` returns `Some(a)` if `json` is an `array`, `None` otherwise." - ], - "signature": "let decodeArray: t => option>", - "deprecated": "" - }, - { - "id": "Js.Json.decodeBoolean", - "kind": "value", - "name": "decodeBoolean", - "docstrings": [ - "`decodeBoolean(json)` returns `Some(b)` if `json` is a `boolean`, `None` otherwise." - ], - "signature": "let decodeBoolean: t => option", - "deprecated": "" - }, - { - "id": "Js.Json.decodeNull", - "kind": "value", - "name": "decodeNull", - "docstrings": [ - "`decodeNull(json)` returns `Some(null)` if `json` is a `null`, `None` otherwise." - ], - "signature": "let decodeNull: t => option>", - "deprecated": "" - }, - { - "id": "Js.Json.null", - "kind": "value", - "name": "null", - "docstrings": [ - "`null` is the singleton null JSON value." - ], - "signature": "let null: t", - "deprecated": "" - }, - { - "id": "Js.Json.string", - "kind": "value", - "name": "string", - "docstrings": [ - "`string(s)` makes a JSON string of the `string` `s`." - ], - "signature": "let string: string => t", - "deprecated": "" - }, - { - "id": "Js.Json.number", - "kind": "value", - "name": "number", - "docstrings": [ - "`number(n)` makes a JSON number of the `float` `n`." - ], - "signature": "let number: float => t", - "deprecated": "" - }, - { - "id": "Js.Json.boolean", - "kind": "value", - "name": "boolean", - "docstrings": [ - "`boolean(b)` makes a JSON boolean of the `bool` `b`." - ], - "signature": "let boolean: bool => t", - "deprecated": "" - }, - { - "id": "Js.Json.object_", - "kind": "value", - "name": "object_", - "docstrings": [ - "`object_(dict)` makes a JSON object of the `dict`." - ], - "signature": "let object_: dict => t", - "deprecated": "" - }, - { - "id": "Js.Json.array", - "kind": "value", - "name": "array", - "docstrings": [ - "`array_(a)` makes a JSON array of the `Js.Json.t` array `a`." - ], - "signature": "let array: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.stringArray", - "kind": "value", - "name": "stringArray", - "docstrings": [ - "`stringArray(a)` makes a JSON array of the `string` array `a`." - ], - "signature": "let stringArray: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.numberArray", - "kind": "value", - "name": "numberArray", - "docstrings": [ - "`numberArray(a)` makes a JSON array of the `float` array `a`." - ], - "signature": "let numberArray: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.booleanArray", - "kind": "value", - "name": "booleanArray", - "docstrings": [ - "`booleanArray(a)` makes a JSON array of the `bool` array `a`." - ], - "signature": "let booleanArray: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.objectArray", - "kind": "value", - "name": "objectArray", - "docstrings": [ - "`objectArray(a) makes a JSON array of the `JsDict.t` array `a`." - ], - "signature": "let objectArray: array> => t", - "deprecated": "" - }, - { - "id": "Js.Json.parseExn", - "kind": "value", - "name": "parseExn", - "docstrings": [ - "`parseExn(s)` parses the `string` `s` into a JSON data structure.\nReturns a JSON data structure.\nThrows `SyntaxError` if the given string is not a valid JSON. Note: `SyntaxError` is a JavaScript exception.\n\nSee [`parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) on MDN.\n\n## Examples\n\n```rescript\n/* parse a simple JSON string */\n\nlet json = try Js.Json.parseExn(` \"hello\" `) catch {\n| _ => failwith(\"Error parsing JSON string\")\n}\n\nswitch Js.Json.classify(json) {\n| Js.Json.JSONString(value) => Js.log(value)\n| _ => failwith(\"Expected a string\")\n}\n```\n\n```rescript\n/* parse a complex JSON string */\n\nlet getIds = s => {\n let json = try Js.Json.parseExn(s) catch {\n | _ => failwith(\"Error parsing JSON string\")\n }\n\n switch Js.Json.classify(json) {\n | Js.Json.JSONObject(value) =>\n /* In this branch, compiler infer value : Js.Json.t dict */\n switch Js.Dict.get(value, \"ids\") {\n | Some(ids) =>\n switch Js.Json.classify(ids) {\n | Js.Json.JSONArray(ids) => /* In this branch compiler infer ids : Js.Json.t array */\n ids\n | _ => failwith(\"Expected an array\")\n }\n | None => failwith(\"Expected an `ids` property\")\n }\n | _ => failwith(\"Expected an object\")\n }\n}\n\n/* prints `1, 2, 3` */\nJs.log(getIds(` { \"ids\" : [1, 2, 3 ] } `))\n```" - ], - "signature": "let parseExn: string => t", - "deprecated": "" - }, - { - "id": "Js.Json.stringify", - "kind": "value", - "name": "stringify", - "docstrings": [ - "`stringify(json)` formats the JSON data structure as a `string`.\nReturns the string representation of a given JSON data structure.\n\nSee [`stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) on MDN.\n\n## Examples\n\n```rescript\n/* Creates and stringifies a simple JS object */\n\nlet dict = Js.Dict.empty()\nJs.Dict.set(dict, \"name\", Js.Json.string(\"John Doe\"))\nJs.Dict.set(dict, \"age\", Js.Json.number(30.0))\nJs.Dict.set(dict, \"likes\", Js.Json.stringArray([\"ReScript\", \"ocaml\", \"js\"]))\n\nJs.log(Js.Json.stringify(Js.Json.object_(dict)))\n```" - ], - "signature": "let stringify: t => string", - "deprecated": "" - }, - { - "id": "Js.Json.stringifyWithSpace", - "kind": "value", - "name": "stringifyWithSpace", - "docstrings": [ - "`stringifyWithSpace(json)` formats the JSON data structure as a `string`.\nReturns the string representation of a given JSON data structure with spacing.\n\nSee [`stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) on MDN.\n\n## Examples\n\n```rescript\n/* Creates and stringifies a simple JS object with spacing */\n\nlet dict = Js.Dict.empty()\nJs.Dict.set(dict, \"name\", Js.Json.string(\"John Doe\"))\nJs.Dict.set(dict, \"age\", Js.Json.number(30.0))\nJs.Dict.set(dict, \"likes\", Js.Json.stringArray([\"ReScript\", \"ocaml\", \"js\"]))\n\nJs.log(Js.Json.stringifyWithSpace(Js.Json.object_(dict), 2))\n```" - ], - "signature": "let stringifyWithSpace: (t, int) => string", - "deprecated": "" - }, - { - "id": "Js.Json.stringifyAny", - "kind": "value", - "name": "stringifyAny", - "docstrings": [ - "`stringifyAny(value)` formats any value into a JSON string.\n\n## Examples\n\n```rescript\n/* prints `[\"hello\", \"world\"]` */\nJs.log(Js.Json.stringifyAny([\"hello\", \"world\"]))\n```" - ], - "signature": "let stringifyAny: 'a => option", - "deprecated": "" - }, - { - "id": "Js.Json.deserializeUnsafe", - "kind": "value", - "name": "deserializeUnsafe", - "docstrings": [ - "Best-effort serialization, it tries to seralize as\nmany objects as possible and deserialize it back\n\nIt is unsafe in two aspects\n- It may throw during parsing\n- when you cast it to a specific type, it may have a type mismatch" - ], - "signature": "let deserializeUnsafe: string => 'a", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.serializeExn", - "kind": "value", - "name": "serializeExn", - "docstrings": [ - "It will throw in such situations:\n- The object can not be serlialized to a JSON\n- There are cycles\n- Some JS engines can not stringify deeply nested json objects" - ], - "signature": "let serializeExn: 'a => string", - "deprecated": "This functionality has been deprecated and will be removed in v13." - } - ] - }, - "js/global": { - "id": "Js.Global", - "name": "Global", - "docstrings": [ - "Provide bindings to JS global functions in global namespace", - "Contains functions available in the global scope (`window` in a browser context)" - ], - "items": [ - { - "id": "Js.Global.intervalId", - "kind": "type", - "name": "intervalId", - "docstrings": [ - "Identify an interval started by `Js.Global.setInterval`." - ], - "signature": "type intervalId = Global.intervalId", - "deprecated": "" - }, - { - "id": "Js.Global.timeoutId", - "kind": "type", - "name": "timeoutId", - "docstrings": [ - "Identify timeout started by `Js.Global.setTimeout`." - ], - "signature": "type timeoutId = Global.timeoutId", - "deprecated": "" - }, - { - "id": "Js.Global.clearInterval", - "kind": "value", - "name": "clearInterval", - "docstrings": [ - "Clear an interval started by `Js.Global.setInterval`\n\n## Examples\n\n```rescript\n/* API for a somewhat aggressive snoozing alarm clock */\n\nlet punchSleepyGuy = () => Js.log(\"Punch\")\n\nlet interval = ref(Js.Nullable.null)\n\nlet remind = () => {\n Js.log(\"Wake Up!\")\n punchSleepyGuy()\n}\n\nlet snooze = mins => interval := Js.Nullable.return(Js.Global.setInterval(remind, mins * 60 * 1000))\n\nlet cancel = () =>\n Js.Nullable.iter(interval.contents, intervalId => Js.Global.clearInterval(intervalId))\n```" - ], - "signature": "let clearInterval: intervalId => unit", - "deprecated": "" - }, - { - "id": "Js.Global.clearTimeout", - "kind": "value", - "name": "clearTimeout", - "docstrings": [ - "Clear a timeout started by `Js.Global.setTimeout`.\n\n## Examples\n\n```rescript\n/* A simple model of a code monkey's brain */\n\nlet closeHackerNewsTab = () => Js.log(\"close\")\n\nlet timer = ref(Js.Nullable.null)\n\nlet work = () => closeHackerNewsTab()\n\nlet procrastinate = mins => {\n Js.Nullable.iter(timer.contents, timer => Js.Global.clearTimeout(timer))\n timer := Js.Nullable.return(Js.Global.setTimeout(work, mins * 60 * 1000))\n}\n```" - ], - "signature": "let clearTimeout: timeoutId => unit", - "deprecated": "" - }, - { - "id": "Js.Global.setInterval", - "kind": "value", - "name": "setInterval", - "docstrings": [ - "Repeatedly executes a callback with a specified interval (in milliseconds)\nbetween calls. Returns a `Js.Global.intervalId` that can be passed to\n`Js.Global.clearInterval` to cancel the timeout.\n\n## Examples\n\n```rescript\n/* Will count up and print the count to the console every second */\n\nlet count = ref(0)\n\nlet tick = () => {\n count := count.contents + 1\n Js.log(Belt.Int.toString(count.contents))\n}\n\nJs.Global.setInterval(tick, 1000)\n```" - ], - "signature": "let setInterval: (unit => unit, int) => intervalId", - "deprecated": "" - }, - { - "id": "Js.Global.setIntervalFloat", - "kind": "value", - "name": "setIntervalFloat", - "docstrings": [ - "Repeatedly executes a callback with a specified interval (in milliseconds)\nbetween calls. Returns a `Js.Global.intervalId` that can be passed to\n`Js.Global.clearInterval` to cancel the timeout.\n\n## Examples\n\n```rescript\n/* Will count up and print the count to the console every second */\n\nlet count = ref(0)\n\nlet tick = () => {\n count := count.contents + 1\n Js.log(Belt.Int.toString(count.contents))\n}\n\nJs.Global.setIntervalFloat(tick, 1000.0)\n```" - ], - "signature": "let setIntervalFloat: (unit => unit, float) => intervalId", - "deprecated": "" - }, - { - "id": "Js.Global.setTimeout", - "kind": "value", - "name": "setTimeout", - "docstrings": [ - "Execute a callback after a specified delay (in milliseconds). Returns a\n`Js.Global.timeoutId` that can be passed to `Js.Global.clearTimeout` to cancel\nthe timeout.\n\n## Examples\n\n```rescript\n/* Prints \"Timed out!\" in the console after one second */\n\nlet message = \"Timed out!\"\n\nJs.Global.setTimeout(() => Js.log(message), 1000)\n```" - ], - "signature": "let setTimeout: (unit => unit, int) => timeoutId", - "deprecated": "" - }, - { - "id": "Js.Global.setTimeoutFloat", - "kind": "value", - "name": "setTimeoutFloat", - "docstrings": [ - "Execute a callback after a specified delay (in milliseconds). Returns a\n`Js.Global.timeoutId` that can be passed to `Js.Global.clearTimeout` to cancel\nthe timeout.\n\n## Examples\n\n```rescript\n/* Prints \"Timed out!\" in the console after one second */\n\nlet message = \"Timed out!\"\n\nJs.Global.setTimeoutFloat(() => Js.log(message), 1000.0)\n```" - ], - "signature": "let setTimeoutFloat: (unit => unit, float) => timeoutId", - "deprecated": "" - }, - { - "id": "Js.Global.encodeURI", - "kind": "value", - "name": "encodeURI", - "docstrings": [ - "URL-encodes a string.\n\nSee [`encodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI) on MDN." - ], - "signature": "let encodeURI: string => string", - "deprecated": "" - }, - { - "id": "Js.Global.decodeURI", - "kind": "value", - "name": "decodeURI", - "docstrings": [ - "Decodes a URL-enmcoded string produced by `encodeURI`\n\nSee [`decodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI) on MDN." - ], - "signature": "let decodeURI: string => string", - "deprecated": "" - }, - { - "id": "Js.Global.encodeURIComponent", - "kind": "value", - "name": "encodeURIComponent", - "docstrings": [ - "URL-encodes a string, including characters with special meaning in a URI.\n\nSee [`encodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) on MDN." - ], - "signature": "let encodeURIComponent: string => string", - "deprecated": "" - }, - { - "id": "Js.Global.decodeURIComponent", - "kind": "value", - "name": "decodeURIComponent", - "docstrings": [ - "Decodes a URL-enmcoded string produced by `encodeURIComponent`\n\nSee [`decodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) on MDN." - ], - "signature": "let decodeURIComponent: string => string", - "deprecated": "" - } - ] - }, - "js/dict": { - "id": "Js.Dict", - "name": "Dict", - "docstrings": [ - "Provide utilities for JS dictionary object", - "Provide utilities for JS dictionary object.\n\n**Note:** This module's examples will assume this predeclared dictionary:\n\n## Examples\n\n```rescript\nlet ages = Js.Dict.fromList(list{(\"Maria\", 30), (\"Vinh\", 22), (\"Fred\", 49)})\n```" - ], - "items": [ - { - "id": "Js.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = dict<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.key", - "kind": "type", - "name": "key", - "docstrings": [ - "The type for dictionary keys. This means that dictionaries *must* use `string`s as their keys." - ], - "signature": "type key = string", - "deprecated": "" - }, - { - "id": "Js.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`Js.Dict.get(key)` returns `None` if the key is not found in the dictionary,\n`Some(value)` otherwise.\n\n## Examples\n\n```rescript\nJs.Dict.get(ages, \"Vinh\") == Some(22)\nJs.Dict.get(ages, \"Paul\") == None\n```" - ], - "signature": "let get: (t<'a>, key) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.unsafeGet", - "kind": "value", - "name": "unsafeGet", - "docstrings": [ - "`Js.Dict.unsafeGet(key)` returns the value if the key exists, otherwise an `undefined` value is returned. Use this only when you are sure the key exists (i.e. when having used the `keys()` function to check that the key is valid).\n\n## Examples\n\n```rescript\nJs.Dict.unsafeGet(ages, \"Fred\") == 49\nJs.Dict.unsafeGet(ages, \"Paul\") // returns undefined\n```" - ], - "signature": "let unsafeGet: (t<'a>, key) => 'a", - "deprecated": "" - }, - { - "id": "Js.Dict.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`Js.Dict.set(dict, key, value)` sets the key/value in the dictionary `dict`. If\nthe key does not exist, and entry will be created for it.\n\n*This function modifies the original dictionary.*\n\n## Examples\n\n```rescript\nJs.Dict.set(ages, \"Maria\", 31)\nJs.log(ages == Js.Dict.fromList(list{(\"Maria\", 31), (\"Vinh\", 22), (\"Fred\", 49)}))\n\nJs.Dict.set(ages, \"David\", 66)\nJs.log(ages == Js.Dict.fromList(list{(\"Maria\", 31), (\"Vinh\", 22), (\"Fred\", 49), (\"David\", 66)}))\n```" - ], - "signature": "let set: (t<'a>, key, 'a) => unit", - "deprecated": "" - }, - { - "id": "Js.Dict.keys", - "kind": "value", - "name": "keys", - "docstrings": [ - "Returns all the keys in the dictionary `dict`.\n\n## Examples\n\n```rescript\nJs.Dict.keys(ages) == [\"Maria\", \"Vinh\", \"Fred\"]\n```" - ], - "signature": "let keys: t<'a> => array", - "deprecated": "" - }, - { - "id": "Js.Dict.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "Returns an empty dictionary." - ], - "signature": "let empty: unit => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.unsafeDeleteKey", - "kind": "value", - "name": "unsafeDeleteKey", - "docstrings": [ - "Experimental internal function" - ], - "signature": "let unsafeDeleteKey: (t, string) => unit", - "deprecated": "" - }, - { - "id": "Js.Dict.entries", - "kind": "value", - "name": "entries", - "docstrings": [ - "Returns an array of key/value pairs in the given dictionary (ES2017).\n\n## Examples\n\n```rescript\nJs.Dict.entries(ages) == [(\"Maria\", 30), (\"Vinh\", 22), (\"Fred\", 49)]\n```" - ], - "signature": "let entries: t<'a> => array<(key, 'a)>", - "deprecated": "" - }, - { - "id": "Js.Dict.values", - "kind": "value", - "name": "values", - "docstrings": [ - "Returns the values in the given dictionary (ES2017).\n\n## Examples\n\n```rescript\nJs.Dict.values(ages) == [30, 22, 49]\n```" - ], - "signature": "let values: t<'a> => array<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.fromList", - "kind": "value", - "name": "fromList", - "docstrings": [ - "Creates a new dictionary containing each (key, value) pair in its list\nargument.\n\n## Examples\n\n```rescript\nlet capitals = Js.Dict.fromList(list{(\"Japan\", \"Tokyo\"), (\"France\", \"Paris\"), (\"Egypt\", \"Cairo\")})\n```" - ], - "signature": "let fromList: list<(key, 'a)> => t<'a>", - "deprecated": "Use `Dict.fromArray(List.toArray(...))` instead." - }, - { - "id": "Js.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates a new dictionary containing each (key, value) pair in its array\nargument.\n\n## Examples\n\n```rescript\nlet capitals2 = Js.Dict.fromArray([(\"Germany\", \"Berlin\"), (\"Burkina Faso\", \"Ouagadougou\")])\n```" - ], - "signature": "let fromArray: array<(key, 'a)> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(f, dict)` maps `dict` to a new dictionary with the same keys, using the\nfunction `f` to map each value.\n\n## Examples\n\n```rescript\nlet prices = Js.Dict.fromList(list{(\"pen\", 1.00), (\"book\", 5.00), (\"stapler\", 7.00)})\n\nlet discount = price => price *. 0.90\nlet salePrices = Js.Dict.map(discount, prices)\n\nsalePrices == Js.Dict.fromList(list{(\"pen\", 0.90), (\"book\", 4.50), (\"stapler\", 6.30)})\n```" - ], - "signature": "let map: ('a => 'b, t<'a>) => t<'b>", - "deprecated": "" - } - ] - }, - "js/date": { - "id": "Js.Date", - "name": "Date", - "docstrings": [ - "Provide bindings for JS Date", - "Provide bindings to JS date. (See\n[`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)\non MDN.) JavaScript stores dates as the number of milliseconds since the UNIX\n*epoch*, midnight 1 January 1970, UTC." - ], - "items": [ - { - "id": "Js.Date.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Date.t", - "deprecated": "" - }, - { - "id": "Js.Date.valueOf", - "kind": "value", - "name": "valueOf", - "docstrings": [ - "Returns the primitive value of this date, equivalent to `getTime()`. (See\n[`Date.valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/valueOf)\non MDN.)\n\n## Examples\n\n```rescript\nJs.Date.valueOf(exampleDate) == 123456654321.0\n```" - ], - "signature": "let valueOf: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a date representing the current time. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nlet now = Js.Date.make()\n```" - ], - "signature": "let make: unit => t", - "deprecated": "" - }, - { - "id": "Js.Date.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "Returns a date representing the given argument, which is a number of\nmilliseconds since the epoch. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.fromFloat(123456654321.0) == exampleDate\n```" - ], - "signature": "let fromFloat: float => t", - "deprecated": "" - }, - { - "id": "Js.Date.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Returns a `Js.Date.t` represented by the given string. The string can be in\n“IETF-compliant RFC 2822 timestamps, and also strings in a version of ISO8601.”\nReturns `NaN` if given an invalid date string. According to the [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\ndocumentation on MDN, its use is discouraged.\n\n## Examples\n\n```rescript\nJs.Date.fromString(\"Thu, 29 Nov 1973 21:30:54.321 GMT\") == exampleDate\nJs.Date.fromString(\"1973-11-29T21:30:54.321Z00:00\") == exampleDate\nJs.Date.fromString(\"Thor, 32 Lok -19 60:70:80 XYZ\") // returns NaN\n```" - ], - "signature": "let fromString: string => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYM", - "kind": "value", - "name": "makeWithYM", - "docstrings": [ - "Returns a date representing midnight of the first day of the given month and\nyear in the current time zone. Fractional parts of arguments are ignored. See\n[`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nlet november1 = Js.Date.makeWithYM(~year=2020.0, ~month=10.0, ())\n```" - ], - "signature": "let makeWithYM: (~year: float, ~month: float, unit) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMD", - "kind": "value", - "name": "makeWithYMD", - "docstrings": [ - "Returns a date representing midnight of the given date of the given month and\nyear in the current time zone. Fractional parts of arguments are ignored. See\n[`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN." - ], - "signature": "let makeWithYMD: (~year: float, ~month: float, ~date: float, unit) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMDH", - "kind": "value", - "name": "makeWithYMDH", - "docstrings": [ - "Returns a date representing the given date of the given month and year, at zero\nminutes and zero seconds past the given `hours`, in the current time zone.\nFractional parts of arguments are ignored. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN. Fractional parts of the arguments are ignored." - ], - "signature": "let makeWithYMDH: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n unit,\n) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMDHM", - "kind": "value", - "name": "makeWithYMDHM", - "docstrings": [ - "Returns a date representing the given date of the given month and year, at zero\nseconds past the given time in hours and minutes in the current time zone.\nFractional parts of arguments are ignored. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN." - ], - "signature": "let makeWithYMDHM: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n unit,\n) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMDHMS", - "kind": "value", - "name": "makeWithYMDHMS", - "docstrings": [ - "Returns a date representing the given date of the given month and year, at the\ngiven time in hours, minutes, and seconds in the current time zone. Fractional\nparts of arguments are ignored. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.makeWithYMDHMS(\n ~year=1973.0,\n ~month=11.0,\n ~date=29.0,\n ~hours=21.0,\n ~minutes=30.0,\n ~seconds=54.321,\n (),\n) == exampleDate\n```" - ], - "signature": "let makeWithYMDHMS: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => t", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYM", - "kind": "value", - "name": "utcWithYM", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the first day of the given month and year in UTC. Fractional parts\nof arguments are ignored. See\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN.\n\n## Examples\n\n```rescript\nlet november1 = Js.Date.utcWithYM(~year=2020.0, ~month=10.0, ())\n```" - ], - "signature": "let utcWithYM: (~year: float, ~month: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMD", - "kind": "value", - "name": "utcWithYMD", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year in UTC. Fractional parts\nof arguments are ignored. See\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMD: (~year: float, ~month: float, ~date: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMDH", - "kind": "value", - "name": "utcWithYMDH", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year, at zero minutes and\nseconds past the given hours in UTC. Fractional parts of arguments are ignored.\nSee\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMDH: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMDHM", - "kind": "value", - "name": "utcWithYMDHM", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year, at zero seconds past\nthe given number of minutes past the given hours in UTC. Fractional parts of\narguments are ignored. See\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMDHM: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMDHMS", - "kind": "value", - "name": "utcWithYMDHMS", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year, at the given time in\nhours, minutes and seconds in UTC. Fractional parts of arguments are ignored.\n\nSee\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMDHMS: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.now", - "kind": "value", - "name": "now", - "docstrings": [ - "Returns the current time as number of milliseconds since Unix epoch." - ], - "signature": "let now: unit => float", - "deprecated": "" - }, - { - "id": "Js.Date.parse", - "kind": "value", - "name": "parse", - "docstrings": [], - "signature": "let parse: string => t", - "deprecated": "" - }, - { - "id": "Js.Date.parseAsFloat", - "kind": "value", - "name": "parseAsFloat", - "docstrings": [ - "Returns a float with the number of milliseconds past the epoch represented by\nthe given string. The string can be in “IETF-compliant RFC 2822 timestamps, and\nalso strings in a version of ISO8601.” Returns `NaN` if given an invalid date\nstring. According to the\n[`Date.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse)\ndocumentation on MDN, its use is discouraged. Returns `NaN` if passed invalid\ndate string." - ], - "signature": "let parseAsFloat: string => float", - "deprecated": "" - }, - { - "id": "Js.Date.getDate", - "kind": "value", - "name": "getDate", - "docstrings": [ - "Returns the day of the month for its argument. The argument is evaluated in the\ncurrent time zone. See\n[`Date.getDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDate)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getDate(exampleDate) == 29.0\n```" - ], - "signature": "let getDate: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getDay", - "kind": "value", - "name": "getDay", - "docstrings": [ - "Returns the day of the week (0.0-6.0) for its argument, where 0.0 represents\nSunday. The argument is evaluated in the current time zone. See\n[`Date.getDay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDay)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getDay(exampleDate) == 4.0\n```" - ], - "signature": "let getDay: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getFullYear", - "kind": "value", - "name": "getFullYear", - "docstrings": [ - "Returns the full year (as opposed to the range 0-99) for its argument. The\nargument is evaluated in the current time zone. See\n[`Date.getFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getFullYear)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getFullYear(exampleDate) == 1973.0\n```" - ], - "signature": "let getFullYear: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getHours", - "kind": "value", - "name": "getHours", - "docstrings": [ - "Returns the hours for its argument, evaluated in the current time zone. See\n[`Date.getHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getHours)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getHours(exampleDate) == 22.0 // Vienna is in GMT+01:00\n```" - ], - "signature": "let getHours: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getMilliseconds", - "kind": "value", - "name": "getMilliseconds", - "docstrings": [ - "Returns the number of milliseconds for its argument, evaluated in the current\ntime zone. See\n[`Date.getMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getMilliseconds(exampleDate) == 321.0\n```" - ], - "signature": "let getMilliseconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getMinutes", - "kind": "value", - "name": "getMinutes", - "docstrings": [ - "Returns the number of minutes for its argument, evaluated in the current time\nzone. See\n[`Date.getMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMinutes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getMinutes(exampleDate) == 30.0\n```" - ], - "signature": "let getMinutes: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getMonth", - "kind": "value", - "name": "getMonth", - "docstrings": [ - "Returns the month (0.0-11.0) for its argument, evaluated in the current time\nzone. January is month zero. See\n[`Date.getMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMonth)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getMonth(exampleDate) == 10.0\n```" - ], - "signature": "let getMonth: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getSeconds", - "kind": "value", - "name": "getSeconds", - "docstrings": [ - "Returns the seconds for its argument, evaluated in the current time zone. See\n[`Date.getSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getSeconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getSeconds(exampleDate) == 54.0\n```" - ], - "signature": "let getSeconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getTime", - "kind": "value", - "name": "getTime", - "docstrings": [ - "Returns the number of milliseconds since Unix epoch, evaluated in UTC. See\n[`Date.getTime`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getTime(exampleDate) == 123456654321.0\n```" - ], - "signature": "let getTime: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getTimezoneOffset", - "kind": "value", - "name": "getTimezoneOffset", - "docstrings": [ - "Returns the time zone offset in minutes from the current time zone to UTC. See\n[`Date.getTimezoneOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getTimezoneOffset(exampleDate) == -60.0\n```" - ], - "signature": "let getTimezoneOffset: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCDate", - "kind": "value", - "name": "getUTCDate", - "docstrings": [ - "Returns the day of the month of the argument, evaluated in UTC. See\n[`Date.getUTCDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCDate)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCDate(exampleDate) == 29.0\n```" - ], - "signature": "let getUTCDate: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCDay", - "kind": "value", - "name": "getUTCDay", - "docstrings": [ - "Returns the day of the week of the argument, evaluated in UTC. The range of the\nreturn value is 0.0-6.0, where Sunday is zero. See\n[`Date.getUTCDay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCDay)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCDay(exampleDate) == 4.0\n```" - ], - "signature": "let getUTCDay: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCFullYear", - "kind": "value", - "name": "getUTCFullYear", - "docstrings": [ - "Returns the full year (as opposed to the range 0-99) for its argument. The\nargument is evaluated in UTC. See\n[`Date.getUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCFullYear(exampleDate) == 1973.0\n```" - ], - "signature": "let getUTCFullYear: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCHours", - "kind": "value", - "name": "getUTCHours", - "docstrings": [ - "Returns the hours for its argument, evaluated in the current time zone. See\n[`Date.getUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCHours(exampleDate) == 21.0\n```" - ], - "signature": "let getUTCHours: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCMilliseconds", - "kind": "value", - "name": "getUTCMilliseconds", - "docstrings": [ - "Returns the number of milliseconds for its argument, evaluated in UTC. See\n[`Date.getUTCMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCMilliseconds(exampleDate) == 321.0\n```" - ], - "signature": "let getUTCMilliseconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCMinutes", - "kind": "value", - "name": "getUTCMinutes", - "docstrings": [ - "Returns the number of minutes for its argument, evaluated in UTC. See\n[`Date.getUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCMinutes(exampleDate) == 30.0\n```" - ], - "signature": "let getUTCMinutes: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCMonth", - "kind": "value", - "name": "getUTCMonth", - "docstrings": [ - "Returns the month (0.0-11.0) for its argument, evaluated in UTC. January is\nmonth zero. See\n[`Date.getUTCMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMonth)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCMonth(exampleDate) == 10.0\n```" - ], - "signature": "let getUTCMonth: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCSeconds", - "kind": "value", - "name": "getUTCSeconds", - "docstrings": [ - "Returns the seconds for its argument, evaluated in UTC. See\n[`Date.getUTCSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCSeconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCSeconds(exampleDate) == 54.0\n```" - ], - "signature": "let getUTCSeconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getYear", - "kind": "value", - "name": "getYear", - "docstrings": [], - "signature": "let getYear: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.setDate", - "kind": "value", - "name": "setDate", - "docstrings": [ - "Sets the given `Date`’s day of month to the value in the second argument\naccording to the current time zone. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setDate)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet twoWeeksBefore = Js.Date.setDate(date1, 15.0)\ndate1 == Js.Date.fromString(\"1973-11-15T21:30:54.321Z00:00\")\ntwoWeeksBefore == Js.Date.getTime(date1)\n```" - ], - "signature": "let setDate: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setFullYear", - "kind": "value", - "name": "setFullYear", - "docstrings": [ - "Sets the given `Date`’s year to the value in the second argument according to\nthe current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextYear = Js.Date.setFullYear(date1, 1974.0)\ndate1 == Js.Date.fromString(\"1974-11-15T21:30:54.321Z00:00\")\nnextYear == Js.Date.getTime(date1)\n```" - ], - "signature": "let setFullYear: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setFullYearM", - "kind": "value", - "name": "setFullYearM", - "docstrings": [ - "Sets the given `Date`’s year and month to the values in the labeled arguments\naccording to the current time zone. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setFullYearM(date1, ~year=1974.0, ~month=0.0, ())\ndate1 == Js.Date.fromString(\"1974-01-22T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setFullYearM: (t, ~year: float, ~month: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setFullYearMD", - "kind": "value", - "name": "setFullYearMD", - "docstrings": [ - "Sets the given `Date`’s year, month, and day of month to the values in the\nlabeled arguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setFullYearMD(date1, ~year=1974.0, ~month=0.0, ~date=7.0, ())\ndate1 == Js.Date.fromString(\"1974-01-07T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setFullYearMD: (\n t,\n ~year: float,\n ~month: float,\n ~date: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHours", - "kind": "value", - "name": "setHours", - "docstrings": [ - "Sets the given `Date`’s hours to the value in the second argument according to\nthe current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextHour = Js.Date.setHours(date1, 22.0)\ndate1 == Js.Date.fromString(\"1973-11-29T22:30:54.321Z00:00\")\nnextHour == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHours: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHoursM", - "kind": "value", - "name": "setHoursM", - "docstrings": [ - "Sets the given `Date`’s hours and minutes to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setHoursM(date1, ~hours=22.0, ~minutes=46.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:54.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHoursM: (t, ~hours: float, ~minutes: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHoursMS", - "kind": "value", - "name": "setHoursMS", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, and seconds to the values in the\nlabeled arguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setHoursMS(date1, ~hours=22.0, ~minutes=46.0, ~seconds=37.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHoursMS: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHoursMSMs", - "kind": "value", - "name": "setHoursMSMs", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, seconds, and milliseconds to the values\nin the labeled arguments according to the current time zone. Returns the number\nof milliseconds since the epoch of the updated `Date`. *This function modifies\nthe original `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setHoursMSMs(\n date1,\n ~hours=22.0,\n ~minutes=46.0,\n ~seconds=37.0,\n ~milliseconds=494.0,\n (),\n)\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHoursMSMs: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMilliseconds", - "kind": "value", - "name": "setMilliseconds", - "docstrings": [ - "Sets the given `Date`’s milliseconds to the value in the second argument\naccording to the current time zone. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMilliseconds(date1, 494.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:30:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMilliseconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMinutes", - "kind": "value", - "name": "setMinutes", - "docstrings": [ - "Sets the given `Date`’s minutes to the value in the second argument according\nto the current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMinutes(date1, 34.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMinutes: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMinutesS", - "kind": "value", - "name": "setMinutesS", - "docstrings": [ - "Sets the given `Date`’s minutes and seconds to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMinutesS(date1, ~minutes=34.0, ~seconds=56.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMinutesS: (t, ~minutes: float, ~seconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMinutesSMs", - "kind": "value", - "name": "setMinutesSMs", - "docstrings": [ - "Sets the given `Date`’s minutes, seconds, and milliseconds to the values in the\nlabeled arguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMinutesSMs(date1, ~minutes=34.0, ~seconds=56.0, ~milliseconds=789.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMinutesSMs: (\n t,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMonth", - "kind": "value", - "name": "setMonth", - "docstrings": [ - "Sets the given `Date`’s month to the value in the second argument according to\nthe current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMonth(date1, 11.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMonth: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMonthD", - "kind": "value", - "name": "setMonthD", - "docstrings": [ - "Sets the given `Date`’s month and day of month to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMonthD(date1, ~month=11.0, ~date=8.0, ())\ndate1 == Js.Date.fromString(\"1973-12-08T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMonthD: (t, ~month: float, ~date: float, unit) => float", - "deprecated": "Use `Date.setMonth` then `Date.setDate`. No direct 1:1 migration available." - }, - { - "id": "Js.Date.setSeconds", - "kind": "value", - "name": "setSeconds", - "docstrings": [ - "Sets the given `Date`’s seconds to the value in the second argument according\nto the current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setSeconds(date1, 56.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setSeconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setSecondsMs", - "kind": "value", - "name": "setSecondsMs", - "docstrings": [ - "Sets the given `Date`’s seconds and milliseconds to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setSecondsMs(date1, ~seconds=56.0, ~milliseconds=789.0, ())\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setSecondsMs: (t, ~seconds: float, ~milliseconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setTime", - "kind": "value", - "name": "setTime", - "docstrings": [ - "Sets the given `Date`’s value in terms of milliseconds since the epoch. Returns\nthe number of milliseconds since the epoch of the updated `Date`. *This\nfunction modifies the original `Date`.* See\n[`Date.setTime`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setTime)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setTime(date1, 198765432101.0)\n\ndate1 == Js.Date.fromString(\"1976-04-19T12:37:12.101Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setTime: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCDate", - "kind": "value", - "name": "setUTCDate", - "docstrings": [ - "Sets the given `Date`’s day of month to the value in the second argument\naccording to UTC. Returns the number of milliseconds since the epoch of the\nupdated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCDate)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet twoWeeksBefore = Js.Date.setUTCDate(date1, 15.0)\ndate1 == Js.Date.fromString(\"1973-11-15T21:30:54.321Z00:00\")\ntwoWeeksBefore == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCDate: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCFullYear", - "kind": "value", - "name": "setUTCFullYear", - "docstrings": [ - "Sets the given `Date`’s year to the value in the second argument according to\nUTC. Returns the number of milliseconds since the epoch of the updated `Date`.\n*This function modifies the original `Date`.* See\n[`Date.setUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextYear = Js.Date.setUTCFullYear(date1, 1974.0)\ndate1 == Js.Date.fromString(\"1974-11-15T21:30:54.321Z00:00\")\nnextYear == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCFullYear: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCFullYearM", - "kind": "value", - "name": "setUTCFullYearM", - "docstrings": [ - "Sets the given `Date`’s year and month to the values in the labeled arguments\naccording to UTC. Returns the number of milliseconds since the epoch of the\nupdated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setUTCFullYearM(date1, ~year=1974.0, ~month=0.0, ())\ndate1 == Js.Date.fromString(\"1974-01-22T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCFullYearM: (t, ~year: float, ~month: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCFullYearMD", - "kind": "value", - "name": "setUTCFullYearMD", - "docstrings": [ - "Sets the given `Date`’s year, month, and day of month to the values in the\nlabeled arguments according to UTC. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setUTCFullYearMD(date1, ~year=1974.0, ~month=0.0, ~date=7.0, ())\ndate1 == Js.Date.fromString(\"1974-01-07T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCFullYearMD: (\n t,\n ~year: float,\n ~month: float,\n ~date: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHours", - "kind": "value", - "name": "setUTCHours", - "docstrings": [ - "Sets the given `Date`’s hours to the value in the second argument according to\nUTC. Returns the number of milliseconds since the epoch of the updated `Date`.\n*This function modifies the original `Date`.* See\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextHour = Js.Date.setUTCHours(date1, 22.0)\ndate1 == Js.Date.fromString(\"1973-11-29T22:30:54.321Z00:00\")\nnextHour == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHours: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHoursM", - "kind": "value", - "name": "setUTCHoursM", - "docstrings": [ - "Sets the given `Date`’s hours and minutes to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCHoursM(date1, ~hours=22.0, ~minutes=46.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:54.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHoursM: (t, ~hours: float, ~minutes: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHoursMS", - "kind": "value", - "name": "setUTCHoursMS", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, and seconds to the values in the\nlabeled arguments according to UTC. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\n\nSee\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCHoursMS(date1, ~hours=22.0, ~minutes=46.0, ~seconds=37.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHoursMS: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHoursMSMs", - "kind": "value", - "name": "setUTCHoursMSMs", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, seconds, and milliseconds to the values\nin the labeled arguments according to UTC. Returns the number of milliseconds\nsince the epoch of the updated `Date`. *This function modifies the original\n`Date`.* See\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCHoursMSMs(\n date1,\n ~hours=22.0,\n ~minutes=46.0,\n ~seconds=37.0,\n ~milliseconds=494.0,\n (),\n)\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHoursMSMs: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMilliseconds", - "kind": "value", - "name": "setUTCMilliseconds", - "docstrings": [ - "Sets the given `Date`’s milliseconds to the value in the second argument\naccording to UTC. Returns the number of milliseconds since the epoch of the\nupdated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMilliseconds(date1, 494.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:30:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMilliseconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMinutes", - "kind": "value", - "name": "setUTCMinutes", - "docstrings": [ - "Sets the given `Date`’s minutes to the value in the second argument according\nto the current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMinutes(date1, 34.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMinutes: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMinutesS", - "kind": "value", - "name": "setUTCMinutesS", - "docstrings": [ - "Sets the given `Date`’s minutes and seconds to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMinutesS(date1, ~minutes=34.0, ~seconds=56.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMinutesS: (t, ~minutes: float, ~seconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMinutesSMs", - "kind": "value", - "name": "setUTCMinutesSMs", - "docstrings": [ - "Sets the given `Date`’s minutes, seconds, and milliseconds to the values in the\nlabeled arguments according to UTC. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMinutesSMs(\n date1,\n ~minutes=34.0,\n ~seconds=56.0,\n ~milliseconds=789.0,\n (),\n)\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMinutesSMs: (\n t,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMonth", - "kind": "value", - "name": "setUTCMonth", - "docstrings": [ - "Sets the given `Date`’s month to the value in the second argument according to\nUTC. Returns the number of milliseconds since the epoch of the updated `Date`.\n*This function modifies the original `Date`.* See\n[`Date.setUTCMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMonth(date1, 11.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMonth: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMonthD", - "kind": "value", - "name": "setUTCMonthD", - "docstrings": [ - "Sets the given `Date`’s month and day of month to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMonthD(date1, ~month=11.0, ~date=8.0, ())\ndate1 == Js.Date.fromString(\"1973-12-08T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMonthD: (t, ~month: float, ~date: float, unit) => float", - "deprecated": "Use `Date.setUTCMonth` then `Date.setUTCDate`. No direct 1:1 migration available." - }, - { - "id": "Js.Date.setUTCSeconds", - "kind": "value", - "name": "setUTCSeconds", - "docstrings": [ - "Sets the given `Date`’s seconds to the value in the second argument according\nto UTC. Returns the number of milliseconds since the epoch of the updated\n`Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCSeconds(date1, 56.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCSeconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCSecondsMs", - "kind": "value", - "name": "setUTCSecondsMs", - "docstrings": [ - "Sets the given `Date`’s seconds and milliseconds to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCSecondsMs(date1, ~seconds=56.0, ~milliseconds=789.0, ())\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCSecondsMs: (t, ~seconds: float, ~milliseconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCTime", - "kind": "value", - "name": "setUTCTime", - "docstrings": [ - "Same as [`setTime()`](#settime)." - ], - "signature": "let setUTCTime: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setYear", - "kind": "value", - "name": "setYear", - "docstrings": [], - "signature": "let setYear: (t, float) => float", - "deprecated": "Use `setFullYear` instead" - }, - { - "id": "Js.Date.toDateString", - "kind": "value", - "name": "toDateString", - "docstrings": [ - "Returns the date (day of week, year, month, and day of month) portion of a\n`Date` in English. See\n[`Date.toDateString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toDateString(exampleDate) == \"Thu Nov 29 1973\"\n```" - ], - "signature": "let toDateString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toGMTString", - "kind": "value", - "name": "toGMTString", - "docstrings": [], - "signature": "let toGMTString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toISOString", - "kind": "value", - "name": "toISOString", - "docstrings": [ - "Returns a simplified version of the ISO 8601 format for the date. See\n[`Date.toISOString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toISOString(exampleDate) == \"1973-11-29T21:30:54.321Z\"\n```" - ], - "signature": "let toISOString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toJSON", - "kind": "value", - "name": "toJSON", - "docstrings": [], - "signature": "let toJSON: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toJSONUnsafe", - "kind": "value", - "name": "toJSONUnsafe", - "docstrings": [ - "Returns a string representation of the given date. See\n[`Date.toJSON`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON)\non MDN." - ], - "signature": "let toJSONUnsafe: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toLocaleDateString", - "kind": "value", - "name": "toLocaleDateString", - "docstrings": [ - "Returns the year, month, and day for the given `Date` in the current locale\nformat. See\n[`Date.toLocaleDateString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toLocaleDateString(exampleDate) == \"11/29/1973\" // for en_US.utf8\nJs.Date.toLocaleDateString(exampleDate) == \"29.11.73\" // for de_DE.utf8\n```" - ], - "signature": "let toLocaleDateString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Returns the time and date for the given `Date` in the current locale format.\nSee\n[`Date.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toLocaleString(exampleDate) == \"11/29/1973, 10:30:54 PM\" // for en_US.utf8\nJs.Date.toLocaleString(exampleDate) == \"29.11.1973, 22:30:54\" // for de_DE.utf8\n```" - ], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toLocaleTimeString", - "kind": "value", - "name": "toLocaleTimeString", - "docstrings": [ - "Returns the time of day for the given `Date` in the current locale format. See\n[`Date.toLocaleTimeString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toLocaleString(exampleDate) == \"10:30:54 PM\" // for en_US.utf8\nJs.Date.toLocaleString(exampleDate) == \"22:30:54\" // for de_DE.utf8\n```" - ], - "signature": "let toLocaleTimeString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Returns a string representing the date and time of day for the given `Date` in\nthe current locale and time zone. See\n[`Date.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toString(\n exampleDate,\n) == \"Thu Nov 29 1973 22:30:54 GMT+0100 (Central European Standard Time)\"\n```" - ], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toTimeString", - "kind": "value", - "name": "toTimeString", - "docstrings": [ - "Returns a string representing the time of day for the given `Date` in the\ncurrent locale and time zone. See\n[`Date.toTimeString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toTimeString(exampleDate) == \"22:30:54 GMT+0100 (Central European Standard Time)\"\n```" - ], - "signature": "let toTimeString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toUTCString", - "kind": "value", - "name": "toUTCString", - "docstrings": [ - "Returns a string representing the date and time of day for the given `Date` in\nthe current locale and UTC (GMT time zone). See\n[`Date.toUTCString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toUTCString(exampleDate) == \"Thu, 29 Nov 1973 21:30:54 GMT\"\n```" - ], - "signature": "let toUTCString: t => string", - "deprecated": "" - } - ] - }, - "js/promise2": { - "id": "Js.Promise2", - "name": "Promise2", - "docstrings": [ - "Provide bindings to JS Promise" - ], - "items": [ - { - "id": "Js.Promise2.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.error", - "kind": "type", - "name": "error", - "docstrings": [], - "signature": "type error" - }, - { - "id": "Js.Promise2.then", - "kind": "value", - "name": "then", - "docstrings": [ - "Type-safe t-first then" - ], - "signature": "let then: (promise<'a>, 'a => promise<'b>) => promise<'b>", - "deprecated": "" - }, - { - "id": "Js.Promise2.catch", - "kind": "value", - "name": "catch", - "docstrings": [ - "Type-safe t-first catch" - ], - "signature": "let catch: (promise<'a>, error => promise<'a>) => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (\n (~resolve: 'a => unit, ~reject: exn => unit) => unit,\n) => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.resolve", - "kind": "value", - "name": "resolve", - "docstrings": [], - "signature": "let resolve: 'a => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.reject", - "kind": "value", - "name": "reject", - "docstrings": [], - "signature": "let reject: exn => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all", - "kind": "value", - "name": "all", - "docstrings": [], - "signature": "let all: array> => promise>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all2", - "kind": "value", - "name": "all2", - "docstrings": [], - "signature": "let all2: ((promise<'a0>, promise<'a1>)) => promise<('a0, 'a1)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all3", - "kind": "value", - "name": "all3", - "docstrings": [], - "signature": "let all3: (\n (promise<'a0>, promise<'a1>, promise<'a2>),\n) => promise<('a0, 'a1, 'a2)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all4", - "kind": "value", - "name": "all4", - "docstrings": [], - "signature": "let all4: (\n (promise<'a0>, promise<'a1>, promise<'a2>, promise<'a3>),\n) => promise<('a0, 'a1, 'a2, 'a3)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all5", - "kind": "value", - "name": "all5", - "docstrings": [], - "signature": "let all5: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all6", - "kind": "value", - "name": "all6", - "docstrings": [], - "signature": "let all6: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n promise<'a5>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4, 'a5)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.race", - "kind": "value", - "name": "race", - "docstrings": [], - "signature": "let race: array> => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.unsafe_async", - "kind": "value", - "name": "unsafe_async", - "docstrings": [], - "signature": "let unsafe_async: 'a => promise<'a>" - }, - { - "id": "Js.Promise2.unsafe_await", - "kind": "value", - "name": "unsafe_await", - "docstrings": [], - "signature": "let unsafe_await: promise<'a> => 'a" - } - ] - }, - "js/promise": { - "id": "Js.Promise", - "name": "Promise", - "docstrings": [ - "Provide bindings to JS Promise", - "Deprecation note: These bindings are pretty outdated and cannot be used properly\nwith the `->` operator.\n\nMore details on proper Promise usage can be found here:\nhttps://rescript-lang.org/docs/manual/latest/promise#promise-legacy" - ], - "items": [ - { - "id": "Js.Promise.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.error", - "kind": "type", - "name": "error", - "docstrings": [], - "signature": "type error = Js_promise2.error", - "deprecated": "" - }, - { - "id": "Js.Promise.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (\n (~resolve: 'a => unit, ~reject: exn => unit) => unit,\n) => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.resolve", - "kind": "value", - "name": "resolve", - "docstrings": [], - "signature": "let resolve: 'a => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.reject", - "kind": "value", - "name": "reject", - "docstrings": [], - "signature": "let reject: exn => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.all", - "kind": "value", - "name": "all", - "docstrings": [], - "signature": "let all: array> => promise>", - "deprecated": "" - }, - { - "id": "Js.Promise.all2", - "kind": "value", - "name": "all2", - "docstrings": [], - "signature": "let all2: ((promise<'a0>, promise<'a1>)) => promise<('a0, 'a1)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all3", - "kind": "value", - "name": "all3", - "docstrings": [], - "signature": "let all3: (\n (promise<'a0>, promise<'a1>, promise<'a2>),\n) => promise<('a0, 'a1, 'a2)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all4", - "kind": "value", - "name": "all4", - "docstrings": [], - "signature": "let all4: (\n (promise<'a0>, promise<'a1>, promise<'a2>, promise<'a3>),\n) => promise<('a0, 'a1, 'a2, 'a3)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all5", - "kind": "value", - "name": "all5", - "docstrings": [], - "signature": "let all5: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all6", - "kind": "value", - "name": "all6", - "docstrings": [], - "signature": "let all6: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n promise<'a5>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4, 'a5)>", - "deprecated": "" - }, - { - "id": "Js.Promise.race", - "kind": "value", - "name": "race", - "docstrings": [], - "signature": "let race: array> => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.then_", - "kind": "value", - "name": "then_", - "docstrings": [], - "signature": "let then_: ('a => promise<'b>, promise<'a>) => promise<'b>", - "deprecated": "" - }, - { - "id": "Js.Promise.catch", - "kind": "value", - "name": "catch", - "docstrings": [], - "signature": "let catch: (error => promise<'a>, promise<'a>) => promise<'a>", - "deprecated": "" - } - ] - }, - "js/re": { - "id": "Js.Re", - "name": "Re", - "docstrings": [ - "Provide bindings to JS regex expression", - "Provide bindings to JS regular expressions (RegExp).\n\n**Note:** This is not an immutable API. A RegExp object with the `global` (\"g\")\nflag set will modify the [`lastIndex`]() property when the RegExp object is used,\nand subsequent uses will continue the search from the previous [`lastIndex`]()." - ], - "items": [ - { - "id": "Js.Re.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The RegExp object." - ], - "signature": "type t = RegExp.t", - "deprecated": "" - }, - { - "id": "Js.Re.result", - "kind": "type", - "name": "result", - "docstrings": [ - "The result of a executing a RegExp on a string." - ], - "signature": "type result" - }, - { - "id": "Js.Re.captures", - "kind": "value", - "name": "captures", - "docstrings": [ - "An `array` of the match and captures, the first is the full match and the\nremaining are the substring captures." - ], - "signature": "let captures: result => array>", - "deprecated": "" - }, - { - "id": "Js.Re.matches", - "kind": "value", - "name": "matches", - "docstrings": [], - "signature": "let matches: result => array", - "deprecated": "" - }, - { - "id": "Js.Re.index", - "kind": "value", - "name": "index", - "docstrings": [ - "0-based index of the match in the input string." - ], - "signature": "let index: result => int", - "deprecated": "" - }, - { - "id": "Js.Re.input", - "kind": "value", - "name": "input", - "docstrings": [ - "The original input string." - ], - "signature": "let input: result => string", - "deprecated": "" - }, - { - "id": "Js.Re.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Constructs a RegExp object (Js.Re.t) from a `string`.\nRegex literals `/.../` should generally be preferred, but `fromString`\nis useful when you need to dynamically construct a regex using strings,\nexactly like when you do so in JavaScript.\n\n## Examples\n\n```rescript\nlet firstReScriptFileExtension = (filename, content) => {\n let result = Js.Re.fromString(filename ++ \"\\.(res|resi)\")->Js.Re.exec_(content)\n switch result {\n | Some(r) => Js.Nullable.toOption(Js.Re.captures(r)[1])\n | None => None\n }\n}\n\n// outputs \"res\"\nfirstReScriptFileExtension(\"School\", \"School.res School.resi Main.js School.bs.js\")\n```" - ], - "signature": "let fromString: string => t", - "deprecated": "" - }, - { - "id": "Js.Re.fromStringWithFlags", - "kind": "value", - "name": "fromStringWithFlags", - "docstrings": [ - "Constructs a RegExp object (`Js.Re.t`) from a string with the given flags.\nSee `Js.Re.fromString`.\n\nValid flags:\n\n- **g** global\n- **i** ignore case\n- **m** multiline\n- **u** unicode (es2015)\n- **y** sticky (es2015)" - ], - "signature": "let fromStringWithFlags: (string, ~flags: string) => t", - "deprecated": "" - }, - { - "id": "Js.Re.flags", - "kind": "value", - "name": "flags", - "docstrings": [ - "Returns the enabled flags as a string." - ], - "signature": "let flags: t => string", - "deprecated": "" - }, - { - "id": "Js.Re.global", - "kind": "value", - "name": "global", - "docstrings": [ - "Returns a `bool` indicating whether the global flag is set." - ], - "signature": "let global: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.ignoreCase", - "kind": "value", - "name": "ignoreCase", - "docstrings": [ - "Returns a `bool` indicating whether the ignoreCase flag is set." - ], - "signature": "let ignoreCase: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.lastIndex", - "kind": "value", - "name": "lastIndex", - "docstrings": [ - "Returns the index where the next match will start its search. This property\nwill be modified when the RegExp object is used, if the global (\"g\") flag is\nset.\n\n## Examples\n\n```rescript\nlet re = /ab*TODO/g\nlet str = \"abbcdefabh\"\n\nlet break = ref(false)\nwhile !break.contents {\n switch Js.Re.exec_(re, str) {\n | Some(result) =>\n Js.Nullable.iter(Js.Re.captures(result)[0], match_ => {\n let next = Belt.Int.toString(Js.Re.lastIndex(re))\n Js.log(\"Found \" ++ (match_ ++ (\". Next match starts at \" ++ next)))\n })\n | None => break := true\n }\n}\n```\n\nSee\n[`RegExp: lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex)\non MDN." - ], - "signature": "let lastIndex: t => int", - "deprecated": "" - }, - { - "id": "Js.Re.setLastIndex", - "kind": "value", - "name": "setLastIndex", - "docstrings": [ - "Sets the index at which the next match will start its search from." - ], - "signature": "let setLastIndex: (t, int) => unit", - "deprecated": "" - }, - { - "id": "Js.Re.multiline", - "kind": "value", - "name": "multiline", - "docstrings": [ - "Returns a `bool` indicating whether the multiline flag is set." - ], - "signature": "let multiline: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.source", - "kind": "value", - "name": "source", - "docstrings": [ - "Returns the pattern as a `string`." - ], - "signature": "let source: t => string", - "deprecated": "" - }, - { - "id": "Js.Re.sticky", - "kind": "value", - "name": "sticky", - "docstrings": [ - "Returns a `bool` indicating whether the sticky flag is set." - ], - "signature": "let sticky: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.unicode", - "kind": "value", - "name": "unicode", - "docstrings": [ - "Returns a `bool` indicating whether the unicode flag is set." - ], - "signature": "let unicode: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.exec_", - "kind": "value", - "name": "exec_", - "docstrings": [ - "Executes a search on a given string using the given RegExp object.\nReturns `Some(Js.Re.result)` if a match is found, `None` otherwise.\n\n## Examples\n\n```rescript\n/* Match \"quick brown\" followed by \"jumps\", ignoring characters in between\n * Remember \"brown\" and \"jumps\"\n * Ignore case\n */\n\nlet re = /quick\\s(brown).+?(jumps)/ig\nlet result = Js.Re.exec_(re, \"The Quick Brown Fox Jumps Over The Lazy Dog\")\n```\n\nSee [`RegExp.prototype.exec()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec)\non MDN." - ], - "signature": "let exec_: (t, string) => option", - "deprecated": "" - }, - { - "id": "Js.Re.test_", - "kind": "value", - "name": "test_", - "docstrings": [ - "Tests whether the given RegExp object will match a given `string`.\nReturns true if a match is found, false otherwise.\n\n## Examples\n\n```rescript\n/* A simple implementation of Js.String.startsWith */\n\nlet str = \"hello world!\"\n\nlet startsWith = (target, substring) => Js.Re.fromString(\"^\" ++ substring)->Js.Re.test_(target)\n\nJs.log(str->startsWith(\"hello\")) /* prints \"true\" */\n```\n\nSee [`RegExp.prototype.test()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test)\non MDN." - ], - "signature": "let test_: (t, string) => bool", - "deprecated": "" - } - ] - }, - "js/string2": { - "id": "Js.String2", - "name": "String2", - "docstrings": [ - "Provide bindings to JS string", - "Provide bindings to JS string. Optimized for pipe-first." - ], - "items": [ - { - "id": "Js.String2.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = string", - "deprecated": "" - }, - { - "id": "Js.String2.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nJs.String2.make(3.5) == \"3.5\"\nJs.String2.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCharCode", - "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to\nthat number; `n` ranges from 0 to 65535.If out of range, the lower 16 bits of\nthe value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as\n`fromCharCode(0xF63A)`.\n\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCharCode(65) == \"A\"\nJs.String2.fromCharCode(0x3c8) == `ψ`\nJs.String2.fromCharCode(0xd55c) == `한`\nJs.String2.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCharCodeMany", - "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`.\n\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)\non MDN." - ], - "signature": "let fromCharCodeMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCodePoint", - "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point. If the number is not a valid code point, it throws\n`RangeError`. Thus, `fromCodePoint(0x1F63A)` will produce a correct value,\nunlike `fromCharCode(0x1F63A)`, and `fromCodePoint(-5)` will throw a\n`RangeError`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePoint(65) == \"A\"\nJs.String2.fromCodePoint(0x3c8) == `ψ`\nJs.String2.fromCodePoint(0xd55c) == `한`\nJs.String2.fromCodePoint(0x1f63a) == `😺`\n```" - ], - "signature": "let fromCodePoint: int => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCodePointMany", - "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```" - ], - "signature": "let fromCodePointMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String2.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(s)` returns the length of the given `string`.\n\nSee [`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.length(\"abcd\") == 4\n```" - ], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.String2.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(s, n)` returns as a `string` the character at the given index number. If\n`n` is out of range, this function returns `undefined`,so at some point this\nfunction may be modified to return `option`.\n\n## Examples\n\n```rescript\nJs.String2.get(\"Reason\", 0) == \"R\"\nJs.String2.get(\"Reason\", 4) == \"o\"\nJs.String2.get(`Rẽasöń`, 5) == `ń`\n```" - ], - "signature": "let get: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.charAt", - "kind": "value", - "name": "charAt", - "docstrings": [ - "`charAt(s, n)` gets the character at index `n` within string `s`. If `n` is\nnegative or greater than the length of `s`, it returns the empty string. If the\nstring contains characters outside the range \\\\u0000-\\\\uffff, it will return the\nfirst 16-bit value at that position in the string.\n\nSee [`String.charAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.charAt(\"Reason\", 0) == \"R\"\nJs.String2.charAt(\"Reason\", 12) == \"\"\nJs.String2.charAt(`Rẽasöń`, 5) == `ń`\n```" - ], - "signature": "let charAt: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.charCodeAt", - "kind": "value", - "name": "charCodeAt", - "docstrings": [ - "`charCodeAt(s, n)` returns the character code at position `n` in string `s`;\nthe result is in the range 0-65535, unlke `codePointAt`, so it will not work\ncorrectly for characters with code points greater than or equal to 0x10000. The\nreturn type is `float` because this function returns NaN if `n` is less than\nzero or greater than the length of the string.\n\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.charCodeAt(`😺`, 0) == 0xd83d->Belt.Int.toFloat\nJs.String2.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" - ], - "signature": "let charCodeAt: (t, int) => float", - "deprecated": "" - }, - { - "id": "Js.String2.codePointAt", - "kind": "value", - "name": "codePointAt", - "docstrings": [ - "`codePointAt(s, n)` returns the code point at position `n` within string `s` as\na `Some(value)`. The return value handles code points greater than or equal to\n0x10000. If there is no code point at the given position, the function returns\n`None`.\n\nSee [`String.codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.codePointAt(`¿😺?`, 1) == Some(0x1f63a)\nJs.String2.codePointAt(\"abc\", 5) == None\n```" - ], - "signature": "let codePointAt: (t, int) => option", - "deprecated": "" - }, - { - "id": "Js.String2.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(original, append)` returns a new `string` with `append` added after\n`original`.\n\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.concat(\"cow\", \"bell\") == \"cowbell\"\n```" - ], - "signature": "let concat: (t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(original, arr)` returns a new `string` consisting of each item of an\narray of strings added to the `original` string.\n\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.concatMany(\"1st\", [\"2nd\", \"3rd\", \"4th\"]) == \"1st2nd3rd4th\"\n```" - ], - "signature": "let concatMany: (t, array) => t", - "deprecated": "" - }, - { - "id": "Js.String2.endsWith", - "kind": "value", - "name": "endsWith", - "docstrings": [ - "ES2015: `endsWith(str, substr)` returns `true` if the `str` ends with `substr`,\n`false` otherwise.\n\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.endsWith(\"ReScript\", \"Script\") == true\nJs.String2.endsWith(\"C++\", \"Script\") == false\n```" - ], - "signature": "let endsWith: (t, t) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.endsWithFrom", - "kind": "value", - "name": "endsWithFrom", - "docstrings": [ - "`endsWithFrom(str, ending, len)` returns `true` if the first len characters of\n`str` end with `ending`, `false` otherwise. If `len` is greater than or equal\nto the length of `str`, then it works like `endsWith`. (Honestly, this should\nhave been named endsWithAt, but oh well).\n\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.endsWithFrom(\"abcd\", \"cd\", 4) == true\nJs.String2.endsWithFrom(\"abcde\", \"cd\", 3) == false\nJs.String2.endsWithFrom(\"abcde\", \"cde\", 99) == true\nJs.String2.endsWithFrom(\"example.dat\", \"ple\", 7) == true\n```" - ], - "signature": "let endsWithFrom: (t, t, int) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "ES2015: `includes(str, searchValue)` returns `true` if `searchValue` is found\nanywhere within `str`, false otherwise.\n\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.includes(\"programmer\", \"gram\") == true\nJs.String2.includes(\"programmer\", \"er\") == true\nJs.String2.includes(\"programmer\", \"pro\") == true\nJs.String2.includes(\"programmer.dat\", \"xyz\") == false\n```" - ], - "signature": "let includes: (t, t) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.includesFrom", - "kind": "value", - "name": "includesFrom", - "docstrings": [ - "ES2015: `includes(str, searchValue start)` returns `true` if `searchValue` is\nfound anywhere within `str` starting at character number `start` (where 0 is\nthe first character), `false` otherwise.\n\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.includesFrom(\"programmer\", \"gram\", 1) == true\nJs.String2.includesFrom(\"programmer\", \"gram\", 4) == false\nJs.String2.includesFrom(`대한민국`, `한`, 1) == true\n```" - ], - "signature": "let includesFrom: (t, t, int) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "ES2015: `indexOf(str, searchValue)` returns the position at which `searchValue`\nwas first found within `str`, or -1 if `searchValue` is not in `str`.\n\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.indexOf(\"bookseller\", \"ok\") == 2\nJs.String2.indexOf(\"bookseller\", \"sell\") == 4\nJs.String2.indexOf(\"beekeeper\", \"ee\") == 1\nJs.String2.indexOf(\"bookseller\", \"xyz\") == -1\n```" - ], - "signature": "let indexOf: (t, t) => int", - "deprecated": "" - }, - { - "id": "Js.String2.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "`indexOfFrom(str, searchValue, start)` returns the position at which\n`searchValue` was found within `str` starting at character position `start`, or\n\\-1 if `searchValue` is not found in that portion of `str`. The return value is\nrelative to the beginning of the string, no matter where the search started\nfrom.\n\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.indexOfFrom(\"bookseller\", \"ok\", 1) == 2\nJs.String2.indexOfFrom(\"bookseller\", \"sell\", 2) == 4\nJs.String2.indexOfFrom(\"bookseller\", \"sell\", 5) == -1\n```" - ], - "signature": "let indexOfFrom: (t, t, int) => int", - "deprecated": "" - }, - { - "id": "Js.String2.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(str, searchValue)` returns the position of the last occurrence of\n`searchValue` within `str`, searching backwards from the end of the string.\nReturns -1 if `searchValue` is not in `str`. The return value is always\nrelative to the beginning of the string.\n\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.lastIndexOf(\"bookseller\", \"ok\") == 2\nJs.String2.lastIndexOf(\"beekeeper\", \"ee\") == 4\nJs.String2.lastIndexOf(\"abcdefg\", \"xyz\") == -1\n```" - ], - "signature": "let lastIndexOf: (t, t) => int", - "deprecated": "" - }, - { - "id": "Js.String2.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "`lastIndexOfFrom(str, searchValue, start)` returns the position of the last\noccurrence of `searchValue` within `str`, searching backwards from the given\nstart position. Returns -1 if `searchValue` is not in `str`. The return value\nis always relative to the beginning of the string.\n\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.lastIndexOfFrom(\"bookseller\", \"ok\", 6) == 2\nJs.String2.lastIndexOfFrom(\"beekeeper\", \"ee\", 8) == 4\nJs.String2.lastIndexOfFrom(\"beekeeper\", \"ee\", 3) == 1\nJs.String2.lastIndexOfFrom(\"abcdefg\", \"xyz\", 4) == -1\n```" - ], - "signature": "let lastIndexOfFrom: (t, t, int) => int", - "deprecated": "" - }, - { - "id": "Js.String2.localeCompare", - "kind": "value", - "name": "localeCompare", - "docstrings": [ - "`localeCompare(reference, comparison)` returns\n- a negative value if reference comes before comparison in sort order\n- zero if reference and comparison have the same sort order\n- a positive value if reference comes after comparison in sort order\n\nSee [`String.localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.localeCompare(\"zebra\", \"ant\") > 0.0\nJs.String2.localeCompare(\"ant\", \"zebra\") < 0.0\nJs.String2.localeCompare(\"cat\", \"cat\") == 0.0\nJs.String2.localeCompare(\"CAT\", \"cat\") > 0.0\n```" - ], - "signature": "let localeCompare: (t, t) => float", - "deprecated": "" - }, - { - "id": "Js.String2.match_", - "kind": "value", - "name": "match_", - "docstrings": [ - "`match(str, regexp)` matches a `string` against the given `regexp`. If there is\nno match, it returns `None`. For regular expressions without the g modifier, if\nthere is a match, the return value is `Some(array)` where the array contains:\n- The entire matched string\n- Any capture groups if the regexp had parentheses\n For regular expressions with the g modifier, a matched expression returns\n `Some(array)` with all the matched substrings and no capture groups.\n\nSee [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.match_(\"The better bats\", /b[aeiou]t/) == Some([\"bet\"])\nJs.String2.match_(\"The better bats\", /b[aeiou]t/g) == Some([\"bet\", \"bat\"])\nJs.String2.match_(\"Today is 2018-04-05.\", /(\\d+)-(\\d+)-(\\d+)/) ==\n Some([\"2018-04-05\", \"2018\", \"04\", \"05\"])\nJs.String2.match_(\"The large container.\", /b[aeiou]g/) == None\n```" - ], - "signature": "let match_: (t, Js_re.t) => option>>", - "deprecated": "" - }, - { - "id": "Js.String2.normalize", - "kind": "value", - "name": "normalize", - "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\u00e3 or the combination of a lower case letter A\n\\u0061 and a combining tilde \\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)\non MDN. See also [Unicode technical report\n#15](https://unicode.org/reports/tr15/) for details." - ], - "signature": "let normalize: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.normalizeByForm", - "kind": "value", - "name": "normalizeByForm", - "docstrings": [ - "ES2015: `normalize(str, form)` returns the normalized Unicode string using the\nspecified form of normalization, which may be one of:\n- \"NFC\" — Normalization Form Canonical Composition.\n- \"NFD\" — Normalization Form Canonical Decomposition.\n- \"NFKC\" — Normalization Form Compatibility Composition.\n- \"NFKD\" — Normalization Form Compatibility Decomposition.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\nSee also [Unicode technical report #15](https://unicode.org/reports/tr15/) for details." - ], - "signature": "let normalizeByForm: (t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.repeat", - "kind": "value", - "name": "repeat", - "docstrings": [ - "`repeat(str, n)` returns a `string` that consists of `n` repetitions of `str`.\nThrows `RangeError` if `n` is negative.\n\nSee [`String.repeat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.repeat(\"ha\", 3) == \"hahaha\"\nJs.String2.repeat(\"empty\", 0) == \"\"\n```" - ], - "signature": "let repeat: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.replace", - "kind": "value", - "name": "replace", - "docstrings": [ - "ES2015: `replace(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with the first matching instance of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.replace(\"old string\", \"old\", \"new\") == \"new string\"\nJs.String2.replace(\"the cat and the dog\", \"the\", \"this\") == \"this cat and the dog\"\n```" - ], - "signature": "let replace: (t, t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.replaceByRe", - "kind": "value", - "name": "replaceByRe", - "docstrings": [ - "`replaceByRe(str, regex, replacement)` returns a new `string` where occurrences\nmatching regex have been replaced by `replacement`.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.replaceByRe(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nJs.String2.replaceByRe(\"Juan Fulano\", /(\\w+) (\\w+)/, \"$2, $1\") == \"Fulano, Juan\"\n```" - ], - "signature": "let replaceByRe: (t, Js_re.t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy0", - "kind": "value", - "name": "unsafeReplaceBy0", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with no capturing\nparentheses replaced by the value returned from the given function. The\nfunction receives as its parameters the matched string, the offset at which the\nmatch begins, and the whole string being matched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (matchPart, _offset, _wholeString) => Js.String2.toUpperCase(matchPart)\n\nJs.String2.unsafeReplaceBy0(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" - ], - "signature": "let unsafeReplaceBy0: (t, Js_re.t, (t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy1", - "kind": "value", - "name": "unsafeReplaceBy1", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with one set of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstring, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (_match, part1, _offset, _wholeString) => {\n part1 ++ \"41\"\n}\n\nJs.String2.unsafeReplaceBy1(str, re, matchFn) == \"Jony is 41\"\n```" - ], - "signature": "let unsafeReplaceBy1: (t, Js_re.t, (t, t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy2", - "kind": "value", - "name": "unsafeReplaceBy2", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with two sets of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstrings, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (_match, p1, p2, _offset, _wholeString) => {\n switch (Belt.Int.fromString(p1), Belt.Int.fromString(p2)) {\n | (Some(x), Some(y)) => Belt.Int.toString(x * y)\n | _ => \"???\"\n }\n}\n\nJs.String2.unsafeReplaceBy2(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let unsafeReplaceBy2: (t, Js_re.t, (t, t, t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy3", - "kind": "value", - "name": "unsafeReplaceBy3", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with three sets of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstrings, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN." - ], - "signature": "let unsafeReplaceBy3: (t, Js_re.t, (t, t, t, t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.search", - "kind": "value", - "name": "search", - "docstrings": [ - "`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\n\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.search(\"testing 1 2 3\", /\\d+/) == 8\nJs.String2.search(\"no numbers\", /\\d+/) == -1\n```" - ], - "signature": "let search: (t, Js_re.t) => int", - "deprecated": "" - }, - { - "id": "Js.String2.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(str, from:n1, to_:n2)` returns the substring of `str` starting at\ncharacter `n1` up to but not including `n2`.\n- If either `n1` or `n2` is negative, then it is evaluated as `length(str - n1)` or `length(str - n2)`.\n- If `n2` is greater than the length of `str`, then it is treated as `length(str)`.\n- If `n1` is greater than `n2`, slice returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=5) == \"cde\"\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=9) == \"cdefg\"\nJs.String2.slice(\"abcdefg\", ~from=-4, ~to_=-2) == \"de\"\nJs.String2.slice(\"abcdefg\", ~from=5, ~to_=1) == \"\"\n```" - ], - "signature": "let slice: (t, ~from: int, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(str, from:n)` returns the substring of `str` starting at character\n`n` to the end of the string.\n- If `n` is negative, then it is evaluated as `length(str - n)`.\n- If `n` is greater than the length of `str`, then sliceToEnd returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.sliceToEnd(\"abcdefg\", ~from=4) == \"efg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=-2) == \"fg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=7) == \"\"\n```" - ], - "signature": "let sliceToEnd: (t, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nJs.String2.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nJs.String2.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nJs.String2.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```" - ], - "signature": "let split: (t, t) => array", - "deprecated": "" - }, - { - "id": "Js.String2.splitAtMost", - "kind": "value", - "name": "splitAtMost", - "docstrings": [ - "`splitAtMost delimiter ~limit: n str` splits the given `str` at every occurrence of `delimiter` and returns an array of the first `n` resulting substrings. If `n` is negative or greater than the number of substrings, the array will contain all the substrings.\n\n```\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 3 = [|\"ant\"; \"bee\"; \"cat\"|];;\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 0 = [| |];;\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 9 = [|\"ant\"; \"bee\"; \"cat\"; \"dog\"; \"elk\"|];;\n```" - ], - "signature": "let splitAtMost: (t, t, ~limit: int) => array", - "deprecated": "" - }, - { - "id": "Js.String2.splitByRe", - "kind": "value", - "name": "splitByRe", - "docstrings": [ - "`splitByRe(str, regex)` splits the given `str` at every occurrence of `regex`\nand returns an array of the resulting substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.splitByRe(\"art; bed , cog ;dad\", /\\s*[,;]\\s*TODO/) == [\n Some(\"art\"),\n Some(\"bed\"),\n Some(\"cog\"),\n Some(\"dad\"),\n ]\n```" - ], - "signature": "let splitByRe: (t, Js_re.t) => array>", - "deprecated": "" - }, - { - "id": "Js.String2.splitByReAtMost", - "kind": "value", - "name": "splitByReAtMost", - "docstrings": [ - "`splitByReAtMost(str, regex, ~limit:n)` splits the given `str` at every\noccurrence of `regex` and returns an array of the first `n` resulting\nsubstrings. If `n` is negative or greater than the number of substrings, the\narray will contain all the substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=3) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n ]\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=0) == []\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=8) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n Some(\"four\"),\n ]\n```" - ], - "signature": "let splitByReAtMost: (t, Js_re.t, ~limit: int) => array>", - "deprecated": "" - }, - { - "id": "Js.String2.startsWith", - "kind": "value", - "name": "startsWith", - "docstrings": [ - "ES2015: `startsWith(str, substr)` returns `true` if the `str` starts with\n`substr`, `false` otherwise.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWith(\"ReScript\", \"Re\") == true\nJs.String2.startsWith(\"ReScript\", \"\") == true\nJs.String2.startsWith(\"JavaScript\", \"Re\") == false\n```" - ], - "signature": "let startsWith: (t, t) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.startsWithFrom", - "kind": "value", - "name": "startsWithFrom", - "docstrings": [ - "ES2015: `startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, false otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWithFrom(\"ReScript\", \"Scri\", 2) == true\nJs.String2.startsWithFrom(\"ReScript\", \"\", 2) == true\nJs.String2.startsWithFrom(\"JavaScript\", \"Scri\", 2) == false\n```" - ], - "signature": "let startsWithFrom: (t, t, int) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.substr", - "kind": "value", - "name": "substr", - "docstrings": [ - "`substr(str, ~from:n)` returns the substring of `str` from position `n` to the\nend of the string.\n- If `n` is less than zero, the starting position is the length of `str - n`.\n- If `n` is greater than or equal to the length of `str`, returns the empty string.\n\nJavaScript’s `String.substr()` is a legacy function. When possible, use\n`substring()` instead.\n\nSee [`String.substr`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.substr(\"abcdefghij\", ~from=3) == \"defghij\"\nJs.String2.substr(\"abcdefghij\", ~from=-3) == \"hij\"\nJs.String2.substr(\"abcdefghij\", ~from=12) == \"\"\n```" - ], - "signature": "let substr: (t, ~from: int) => t", - "deprecated": "Use `String.substring` instead" - }, - { - "id": "Js.String2.substrAtMost", - "kind": "value", - "name": "substrAtMost", - "docstrings": [ - "`substrAtMost(str, ~from: pos, ~length: n)` returns the substring of `str` of\nlength `n` starting at position `pos`.\n- If `pos` is less than zero, the starting position is the length of `str - pos`.\n- If `pos` is greater than or equal to the length of `str`, returns the empty string.\n- If `n` is less than or equal to zero, returns the empty string.\n\nJavaScript’s `String.substr()` is a legacy function. When possible, use\n`substring()` instead.\n\nSee [`String.substr`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.substrAtMost(\"abcdefghij\", ~from=3, ~length=4) == \"defg\"\nJs.String2.substrAtMost(\"abcdefghij\", ~from=-3, ~length=4) == \"hij\"\nJs.String2.substrAtMost(\"abcdefghij\", ~from=12, ~length=2) == \"\"\n```" - ], - "signature": "let substrAtMost: (t, ~from: int, ~length: int) => t", - "deprecated": "Use `String.substringAtMost` instead" - }, - { - "id": "Js.String2.substring", - "kind": "value", - "name": "substring", - "docstrings": [ - "`substring(str, ~from: start, ~to_: finish)` returns characters `start` up to\nbut not including finish from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `finish` is zero or negative, the empty string is returned.\n- If `start` is greater than `finish`, the `start` and `finish` points are swapped.\n\nSee [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.substring(\"playground\", ~from=3, ~to_=6) == \"ygr\"\nJs.String2.substring(\"playground\", ~from=6, ~to_=3) == \"ygr\"\nJs.String2.substring(\"playground\", ~from=4, ~to_=12) == \"ground\"\n```" - ], - "signature": "let substring: (t, ~from: int, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.substringToEnd", - "kind": "value", - "name": "substringToEnd", - "docstrings": [ - "`substringToEnd(str, ~from: start)` returns the substring of `str` from\nposition `start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string is returned.\n\nSee [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.substringToEnd(\"playground\", ~from=4) == \"ground\"\nJs.String2.substringToEnd(\"playground\", ~from=-3) == \"playground\"\nJs.String2.substringToEnd(\"playground\", ~from=12) == \"\"\n```" - ], - "signature": "let substringToEnd: (t, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.toLowerCase", - "kind": "value", - "name": "toLowerCase", - "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms; one when it is the last\ncharacter in a string and another when it is not.\n\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.toLowerCase(\"ABC\") == \"abc\"\nJs.String2.toLowerCase(`ΣΠ`) == `σπ`\nJs.String2.toLowerCase(`ΠΣ`) == `πς`\n```" - ], - "signature": "let toLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.toLocaleLowerCase", - "kind": "value", - "name": "toLocaleLowerCase", - "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase)\non MDN." - ], - "signature": "let toLocaleLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.toUpperCase", - "kind": "value", - "name": "toUpperCase", - "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result; for example the German ß\ncapitalizes to two Ses in a row.\n\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.toUpperCase(\"abc\") == \"ABC\"\nJs.String2.toUpperCase(`Straße`) == `STRASSE`\nJs.String2.toUpperCase(`πς`) == `ΠΣ`\n```" - ], - "signature": "let toUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.toLocaleUpperCase", - "kind": "value", - "name": "toLocaleUpperCase", - "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\nSee [`String.to:LocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\non MDN." - ], - "signature": "let toLocaleUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.trim", - "kind": "value", - "name": "trim", - "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\n\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.trim(\" abc def \") == \"abc def\"\nJs.String2.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" - ], - "signature": "let trim: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.anchor", - "kind": "value", - "name": "anchor", - "docstrings": [ - "`anchor(anchorText, anchorName)` creates a string with an HTML `` element\nwith name attribute of `anchorName` and `anchorText` as its content. Please do\nnot use this method, as it has been removed from the relevant web standards.\n\nSee [`String.anchor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/anchor)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.anchor(\"Page One\", \"page1\") == \"Page One\"\n```" - ], - "signature": "let anchor: (t, t) => t", - "deprecated": "This function has been removed from the relevant web standards." - }, - { - "id": "Js.String2.link", - "kind": "value", - "name": "link", - "docstrings": [ - "ES2015: `link(linkText, urlText)` creates a string with an HTML `` element\nwith href attribute of `urlText` and `linkText` as its content. Please do not\nuse this method, as it has been removed from the relevant web standards. See\n[`String.link`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/link)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.link(\"Go to page two\", \"page2.html\") == \"Go to page two\"\n```" - ], - "signature": "let link: (t, t) => t", - "deprecated": "This function has been removed from the relevant web standards." - }, - { - "id": "Js.String2.castToArrayLike", - "kind": "value", - "name": "castToArrayLike", - "docstrings": [ - "Casts its argument to an `array_like` entity that can be processed by functions\nsuch as `Js.Array2.fromMap()`\n\n## Examples\n\n```rescript\nlet s = \"abcde\"\nlet arr = Js.Array2.fromMap(Js.String2.castToArrayLike(s), x => x)\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let castToArrayLike: t => Js_array2.array_like", - "deprecated": "" - } - ] - }, - "js/string": { - "id": "Js.String", - "name": "String", - "docstrings": [ - "Provide bindings to JS string", - "JavaScript String API" - ], - "items": [ - { - "id": "Js.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = string", - "deprecated": "" - }, - { - "id": "Js.String.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nJs.String2.make(3.5) == \"3.5\"\nJs.String2.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCharCode", - "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to that number; `n` ranges from 0 to 65535.\nIf out of range, the lower 16 bits of the value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as `fromCharCode(0xF63A)`. See [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCharCode(65) == \"A\"\nJs.String2.fromCharCode(0x3c8) == `ψ`\nJs.String2.fromCharCode(0xd55c) == `한`\nJs.String2.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCharCodeMany", - "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`. See\n[`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)\non MDN." - ], - "signature": "let fromCharCodeMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCodePoint", - "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point. If the number is not a valid code point, it throws\n`RangeError`.Thus, `fromCodePoint(0x1F63A)` will produce a correct value,\nunlike `fromCharCode(0x1F63A)`, and `fromCodePoint(-5)` will throw a\n`RangeError`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePoint(65) == \"A\"\nJs.String2.fromCodePoint(0x3c8) == `ψ`\nJs.String2.fromCodePoint(0xd55c) == `한`\nJs.String2.fromCodePoint(0x1f63a) == `😺`\n```" - ], - "signature": "let fromCodePoint: int => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCodePointMany", - "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```" - ], - "signature": "let fromCodePointMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(s)` returns the length of the given `string`. See\n[`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.length(\"abcd\") == 4\n```" - ], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.String.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(s, n)` returns as a `string` the character at the given index number. If\n`n` is out of range, this function returns `undefined`, so at some point this\nfunction may be modified to return `option`.\n\n## Examples\n\n```rescript\nJs.String2.get(\"Reason\", 0) == \"R\"\nJs.String2.get(\"Reason\", 4) == \"o\"\nJs.String2.get(`Rẽasöń`, 5) == `ń`\n```" - ], - "signature": "let get: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String.charAt", - "kind": "value", - "name": "charAt", - "docstrings": [], - "signature": "let charAt: (int, t) => t" - }, - { - "id": "Js.String.charCodeAt", - "kind": "value", - "name": "charCodeAt", - "docstrings": [], - "signature": "let charCodeAt: (int, t) => float" - }, - { - "id": "Js.String.codePointAt", - "kind": "value", - "name": "codePointAt", - "docstrings": [], - "signature": "let codePointAt: (int, t) => option" - }, - { - "id": "Js.String.concat", - "kind": "value", - "name": "concat", - "docstrings": [], - "signature": "let concat: (t, t) => t" - }, - { - "id": "Js.String.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [], - "signature": "let concatMany: (array, t) => t" - }, - { - "id": "Js.String.endsWith", - "kind": "value", - "name": "endsWith", - "docstrings": [], - "signature": "let endsWith: (t, t) => bool" - }, - { - "id": "Js.String.endsWithFrom", - "kind": "value", - "name": "endsWithFrom", - "docstrings": [], - "signature": "let endsWithFrom: (t, int, t) => bool" - }, - { - "id": "Js.String.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, t) => bool" - }, - { - "id": "Js.String.includesFrom", - "kind": "value", - "name": "includesFrom", - "docstrings": [], - "signature": "let includesFrom: (t, int, t) => bool" - }, - { - "id": "Js.String.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, t) => int" - }, - { - "id": "Js.String.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, int, t) => int" - }, - { - "id": "Js.String.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, t) => int" - }, - { - "id": "Js.String.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, int, t) => int" - }, - { - "id": "Js.String.localeCompare", - "kind": "value", - "name": "localeCompare", - "docstrings": [], - "signature": "let localeCompare: (t, t) => float" - }, - { - "id": "Js.String.match_", - "kind": "value", - "name": "match_", - "docstrings": [], - "signature": "let match_: (Js_re.t, t) => option>>" - }, - { - "id": "Js.String.normalize", - "kind": "value", - "name": "normalize", - "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\u00e3 or the combination of a lower case letter A\n\\u0061 and a combining tilde \\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)\non MDN.\n\nSee also [Unicode technical report #15](https://unicode.org/reports/tr15/) for\ndetails." - ], - "signature": "let normalize: t => t", - "deprecated": "" - }, - { - "id": "Js.String.normalizeByForm", - "kind": "value", - "name": "normalizeByForm", - "docstrings": [], - "signature": "let normalizeByForm: (t, t) => t" - }, - { - "id": "Js.String.repeat", - "kind": "value", - "name": "repeat", - "docstrings": [], - "signature": "let repeat: (int, t) => t" - }, - { - "id": "Js.String.replace", - "kind": "value", - "name": "replace", - "docstrings": [], - "signature": "let replace: (t, t, t) => t" - }, - { - "id": "Js.String.replaceByRe", - "kind": "value", - "name": "replaceByRe", - "docstrings": [], - "signature": "let replaceByRe: (Js_re.t, t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy0", - "kind": "value", - "name": "unsafeReplaceBy0", - "docstrings": [], - "signature": "let unsafeReplaceBy0: (Js_re.t, (t, int, t) => t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy1", - "kind": "value", - "name": "unsafeReplaceBy1", - "docstrings": [], - "signature": "let unsafeReplaceBy1: (Js_re.t, (t, t, int, t) => t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy2", - "kind": "value", - "name": "unsafeReplaceBy2", - "docstrings": [], - "signature": "let unsafeReplaceBy2: (Js_re.t, (t, t, t, int, t) => t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy3", - "kind": "value", - "name": "unsafeReplaceBy3", - "docstrings": [], - "signature": "let unsafeReplaceBy3: (Js_re.t, (t, t, t, t, int, t) => t, t) => t" - }, - { - "id": "Js.String.search", - "kind": "value", - "name": "search", - "docstrings": [], - "signature": "let search: (Js_re.t, t) => int" - }, - { - "id": "Js.String.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~from: int, ~to_: int, t) => t" - }, - { - "id": "Js.String.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [], - "signature": "let sliceToEnd: (~from: int, t) => t" - }, - { - "id": "Js.String.split", - "kind": "value", - "name": "split", - "docstrings": [], - "signature": "let split: (t, t) => array" - }, - { - "id": "Js.String.splitAtMost", - "kind": "value", - "name": "splitAtMost", - "docstrings": [], - "signature": "let splitAtMost: (t, ~limit: int, t) => array" - }, - { - "id": "Js.String.splitByRe", - "kind": "value", - "name": "splitByRe", - "docstrings": [], - "signature": "let splitByRe: (Js_re.t, t) => array>" - }, - { - "id": "Js.String.splitByReAtMost", - "kind": "value", - "name": "splitByReAtMost", - "docstrings": [], - "signature": "let splitByReAtMost: (Js_re.t, ~limit: int, t) => array>" - }, - { - "id": "Js.String.startsWith", - "kind": "value", - "name": "startsWith", - "docstrings": [], - "signature": "let startsWith: (t, t) => bool" - }, - { - "id": "Js.String.startsWithFrom", - "kind": "value", - "name": "startsWithFrom", - "docstrings": [], - "signature": "let startsWithFrom: (t, int, t) => bool" - }, - { - "id": "Js.String.substr", - "kind": "value", - "name": "substr", - "docstrings": [], - "signature": "let substr: (~from: int, t) => t" - }, - { - "id": "Js.String.substrAtMost", - "kind": "value", - "name": "substrAtMost", - "docstrings": [], - "signature": "let substrAtMost: (~from: int, ~length: int, t) => t" - }, - { - "id": "Js.String.substring", - "kind": "value", - "name": "substring", - "docstrings": [], - "signature": "let substring: (~from: int, ~to_: int, t) => t" - }, - { - "id": "Js.String.substringToEnd", - "kind": "value", - "name": "substringToEnd", - "docstrings": [], - "signature": "let substringToEnd: (~from: int, t) => t" - }, - { - "id": "Js.String.toLowerCase", - "kind": "value", - "name": "toLowerCase", - "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms; one when it is the last\ncharacter in a string and another when it is not.\n\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.toLowerCase(\"ABC\") == \"abc\"\nJs.String.toLowerCase(`ΣΠ`) == `σπ`\nJs.String.toLowerCase(`ΠΣ`) == `πς`\n```" - ], - "signature": "let toLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.toLocaleLowerCase", - "kind": "value", - "name": "toLocaleLowerCase", - "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\n\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase)\non MDN." - ], - "signature": "let toLocaleLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.toUpperCase", - "kind": "value", - "name": "toUpperCase", - "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result; for example the German ß\ncapitalizes to two Ses in a row.\n\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.toUpperCase(\"abc\") == \"ABC\"\nJs.String.toUpperCase(`Straße`) == `STRASSE`\nJs.String.toUpperCase(`πς`) == `ΠΣ`\n```" - ], - "signature": "let toUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.toLocaleUpperCase", - "kind": "value", - "name": "toLocaleUpperCase", - "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\n\nSee [`String.to:LocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\non MDN." - ], - "signature": "let toLocaleUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.trim", - "kind": "value", - "name": "trim", - "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\n\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.trim(\" abc def \") == \"abc def\"\nJs.String.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" - ], - "signature": "let trim: t => t", - "deprecated": "" - }, - { - "id": "Js.String.anchor", - "kind": "value", - "name": "anchor", - "docstrings": [], - "signature": "let anchor: (t, t) => t" - }, - { - "id": "Js.String.link", - "kind": "value", - "name": "link", - "docstrings": [], - "signature": "let link: (t, t) => t" - }, - { - "id": "Js.String.castToArrayLike", - "kind": "value", - "name": "castToArrayLike", - "docstrings": [ - "Casts its argument to an `array_like` entity that can be processed by functions\nsuch as `Js.Array2.fromMap()`\n\n## Examples\n\n```rescript\nlet s = \"abcde\"\nlet arr = Js.Array2.fromMap(Js.String.castToArrayLike(s), x => x)\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let castToArrayLike: t => Js_array2.array_like", - "deprecated": "This has been deprecated and will be removed in v13. Use functions from the `String` module instead." - } - ] - }, - "js/array2": { - "id": "Js.Array2", - "name": "Array2", - "docstrings": [ - "Provide bindings to JS array", - "Provides bindings to JavaScript’s `Array` functions. These bindings are optimized for pipe-first (`->`), where the array to be processed is the first parameter in the function.\n\nHere is an example to find the sum of squares of all even numbers in an array.\nWithout pipe first, we must call the functions in reverse order:\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nlet square = x => x * x\nlet result = {\n open Js.Array2\n reduce(map(filter([5, 2, 3, 4, 1], isEven), square), \"+\", 0)\n}\n```\n\nWith pipe first, we call the functions in the “natural” order:\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nlet square = x => x * x\nlet result = {\n open Js.Array2\n [5, 2, 3, 4, 1]->filter(isEven)->map(square)->reduce(\"+\", 0)\n}\n```" - ], - "items": [ - { - "id": "Js.Array2.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type used to describe a JavaScript array." - ], - "signature": "type t<'a> = array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [ - "A type used to describe JavaScript objects that are like an array or are iterable." - ], - "signature": "type array_like<'a> = Array.arrayLike<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.from", - "kind": "value", - "name": "from", - "docstrings": [ - "Creates a shallow copy of an array from an array-like object. See\n[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\non MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nJs.Array2.from(strArr) == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let from: array_like<'a> => array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fromMap", - "kind": "value", - "name": "fromMap", - "docstrings": [ - "Creates a new array by applying a function (the second argument) to each item\nin the `array_like` first argument. See\n[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\non MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nlet code = s => Js.String.charCodeAt(0, s)\nJs.Array2.fromMap(strArr, code) == [97.0, 98.0, 99.0, 100.0]\n```" - ], - "signature": "let fromMap: (array_like<'a>, 'a => 'b) => array<'b>", - "deprecated": "" - }, - { - "id": "Js.Array2.isArray", - "kind": "value", - "name": "isArray", - "docstrings": [ - "Returns `true` if its argument is an array; `false` otherwise. This is a runtime check, which is why the second example returns `true`\\---a list is internally represented as a nested JavaScript array.\n\n## Examples\n\n```rescript\nJs.Array2.isArray([5, 2, 3, 1, 4]) == true\nJs.Array2.isArray(list{5, 2, 3, 1, 4}) == true\nJs.Array2.isArray(\"abcd\") == false\n```" - ], - "signature": "let isArray: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Returns the number of elements in the array. See\n[`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length)\non MDN." - ], - "signature": "let length: array<'a> => int", - "deprecated": "" - }, - { - "id": "Js.Array2.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [ - "Copies from the first element in the given array to the designated `~to_`\nposition, returning the resulting array. *This function modifies the original\narray.* See\n[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.copyWithin(arr, ~to_=2) == [100, 101, 100, 101, 102]\narr == [100, 101, 100, 101, 102]\n```" - ], - "signature": "let copyWithin: (t<'a>, ~to_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [ - "Copies starting at element `~from` in the given array to the designated `~to_`\nposition, returning the resulting array. *This function modifies the original\narray.* See\n[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.copyWithinFrom(arr, ~from=2, ~to_=0) == [102, 103, 104, 103, 104]\narr == [102, 103, 104, 103, 104]\n```" - ], - "signature": "let copyWithinFrom: (t<'a>, ~to_: int, ~from: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [ - "Copies starting at element `~start` in the given array up to but not including\n`~end_` to the designated `~to_` position, returning the resulting array. *This\nfunction modifies the original array.* See\n[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105]\nJs.Array2.copyWithinFromRange(arr, ~start=2, ~end_=5, ~to_=1) == [100, 102, 103, 104, 104, 105]\narr == [100, 102, 103, 104, 104, 105]\n```" - ], - "signature": "let copyWithinFromRange: (t<'a>, ~to_: int, ~start: int, ~end_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [ - "Sets all elements of the given array (the first arumgent) to the designated\nvalue (the secon argument), returning the resulting array. *This function\nmodifies the original array.*\n\nSee\n[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.fillInPlace(arr, 99) == [99, 99, 99, 99, 99]\narr == [99, 99, 99, 99, 99]\n```" - ], - "signature": "let fillInPlace: (t<'a>, 'a) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [ - "Sets all elements of the given array (the first arumgent) from position `~from`\nto the end to the designated value (the second argument), returning the\nresulting array. *This function modifies the original array.* See\n[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.fillFromInPlace(arr, 99, ~from=2) == [100, 101, 99, 99, 99]\narr == [100, 101, 99, 99, 99]\n```" - ], - "signature": "let fillFromInPlace: (t<'a>, 'a, ~from: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [ - "Sets the elements of the given array (the first arumgent) from position\n`~start` up to but not including position `~end_` to the designated value (the\nsecond argument), returning the resulting array. *This function modifies the\noriginal array.* See\n[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.fillRangeInPlace(arr, 99, ~start=1, ~end_=4) == [100, 99, 99, 99, 104]\narr == [100, 99, 99, 99, 104]\n```" - ], - "signature": "let fillRangeInPlace: (t<'a>, 'a, ~start: int, ~end_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "If the array is not empty, removes the last element and returns it as\n`Some(value)`; returns `None` if the array is empty. *This function modifies\nthe original array.* See\n[`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.pop(arr) == Some(104)\narr == [100, 101, 102, 103]\n\nlet empty: array = []\nJs.Array2.pop(empty) == None\n```" - ], - "signature": "let pop: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.push", - "kind": "value", - "name": "push", - "docstrings": [ - "Appends the given value to the array, returning the number of elements in the\nupdated array. *This function modifies the original array.* See\n[`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array2.push(arr, \"dog\") == 4\narr == [\"ant\", \"bee\", \"cat\", \"dog\"]\n```" - ], - "signature": "let push: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.pushMany", - "kind": "value", - "name": "pushMany", - "docstrings": [ - "Appends the values from one array (the second argument) to another (the first\nargument), returning the number of elements in the updated array. *This\nfunction modifies the original array.* See\n[`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array2.pushMany(arr, [\"dog\", \"elk\"]) == 5\narr == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```" - ], - "signature": "let pushMany: (t<'a>, array<'a>) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [ - "Returns an array with the elements of the input array in reverse order. *This\nfunction modifies the original array.* See\n[`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array2.reverseInPlace(arr) == [\"cat\", \"bee\", \"ant\"]\narr == [\"cat\", \"bee\", \"ant\"]\n```" - ], - "signature": "let reverseInPlace: t<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.shift", - "kind": "value", - "name": "shift", - "docstrings": [ - "If the array is not empty, removes the first element and returns it as\n`Some(value)`; returns `None` if the array is empty. *This function modifies\nthe original array.* See\n[`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.shift(arr) == Some(100)\narr == [101, 102, 103, 104]\n\nlet empty: array = []\nJs.Array2.shift(empty) == None\n```" - ], - "signature": "let shift: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [ - "Sorts the given array in place and returns the sorted array. JavaScript sorts\nthe array by converting the arguments to UTF-16 strings and sorting them. See\nthe second example with sorting numbers, which does not do a numeric sort.\n*This function modifies the original array.* See\n[`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\non MDN.\n\n## Examples\n\n```rescript\nlet words = [\"bee\", \"dog\", \"ant\", \"cat\"]\nJs.Array2.sortInPlace(words) == [\"ant\", \"bee\", \"cat\", \"dog\"]\nwords == [\"ant\", \"bee\", \"cat\", \"dog\"]\n\nlet numbers = [3, 30, 10, 1, 20, 2]\nJs.Array2.sortInPlace(numbers) == [1, 10, 2, 20, 3, 30]\nnumbers == [1, 10, 2, 20, 3, 30]\n```" - ], - "signature": "let sortInPlace: t<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [ - "Sorts the given array in place and returns the sorted array. *This function\nmodifies the original array.*\n\nThe first argument to `sortInPlaceWith()` is a function that compares two items\nfrom the array and returns:\n\n* an integer less than zero if the first item is less than the second item \\*\n zero if the items are equal \\* an integer greater than zero if the first item is\n greater than the second item\n\nSee\n[`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\non MDN.\n\n## Examples\n\n```rescript\n// sort by word length\nlet words = [\"horse\", \"aardvark\", \"dog\", \"camel\"]\nlet byLength = (s1, s2) => Js.String.length(s1) - Js.String.length(s2)\n\nJs.Array2.sortInPlaceWith(words, byLength) == [\"dog\", \"horse\", \"camel\", \"aardvark\"]\n\n// sort in reverse numeric order\nlet numbers = [3, 30, 10, 1, 20, 2]\nlet reverseNumeric = (n1, n2) => n2 - n1\nJs.Array2.sortInPlaceWith(numbers, reverseNumeric) == [30, 20, 10, 3, 2, 1]\n```" - ], - "signature": "let sortInPlaceWith: (t<'a>, ('a, 'a) => int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.spliceInPlace", - "kind": "value", - "name": "spliceInPlace", - "docstrings": [ - "Starting at position `~pos`, remove `~remove` elements and then add the\nelements from the `~add` array. Returns an array consisting of the removed\nitems. *This function modifies the original array.* See\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.spliceInPlace(arr, ~pos=2, ~remove=2, ~add=[\"x\", \"y\", \"z\"]) == [\"c\", \"d\"]\narr == [\"a\", \"b\", \"x\", \"y\", \"z\", \"e\", \"f\"]\n\nlet arr2 = [\"a\", \"b\", \"c\", \"d\"]\nJs.Array2.spliceInPlace(arr2, ~pos=3, ~remove=0, ~add=[\"x\", \"y\"]) == []\narr2 == [\"a\", \"b\", \"c\", \"x\", \"y\", \"d\"]\n\nlet arr3 = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.spliceInPlace(arr3, ~pos=9, ~remove=2, ~add=[\"x\", \"y\", \"z\"]) == []\narr3 == [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"x\", \"y\", \"z\"]\n```" - ], - "signature": "let spliceInPlace: (t<'a>, ~pos: int, ~remove: int, ~add: array<'a>) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.removeFromInPlace", - "kind": "value", - "name": "removeFromInPlace", - "docstrings": [ - "Removes elements from the given array starting at position `~pos` to the end of\nthe array, returning the removed elements. *This function modifies the original\narray.* See\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.removeFromInPlace(arr, ~pos=4) == [\"e\", \"f\"]\narr == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let removeFromInPlace: (t<'a>, ~pos: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.removeCountInPlace", - "kind": "value", - "name": "removeCountInPlace", - "docstrings": [ - "Removes `~count` elements from the given array starting at position `~pos`,\nreturning the removed elements. *This function modifies the original array.*\nSee\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.removeCountInPlace(arr, ~pos=2, ~count=3) == [\"c\", \"d\", \"e\"]\narr == [\"a\", \"b\", \"f\"]\n```" - ], - "signature": "let removeCountInPlace: (t<'a>, ~pos: int, ~count: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.unshift", - "kind": "value", - "name": "unshift", - "docstrings": [ - "Adds the given element to the array, returning the new number of elements in\nthe array. *This function modifies the original array.* See\n[`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"b\", \"c\", \"d\"]\nJs.Array2.unshift(arr, \"a\") == 4\narr == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let unshift: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.unshiftMany", - "kind": "value", - "name": "unshiftMany", - "docstrings": [ - "Adds the elements in the second array argument at the beginning of the first\narray argument, returning the new number of elements in the array. *This\nfunction modifies the original array.* See\n[`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"d\", \"e\"]\nJs.Array2.unshiftMany(arr, [\"a\", \"b\", \"c\"]) == 5\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let unshiftMany: (t<'a>, array<'a>) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.append", - "kind": "value", - "name": "append", - "docstrings": [], - "signature": "let append: (t<'a>, 'a) => t<'a>", - "deprecated": "`append` is not type-safe. Use `concat` instead." - }, - { - "id": "Js.Array2.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "Concatenates the second array argument to the first array argument, returning a\nnew array. The original arrays are not modified. See\n[`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.concat([\"a\", \"b\"], [\"c\", \"d\", \"e\"]) == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "The second argument to `concatMany()` is an array of arrays; these are added at\nthe end of the first argument, returning a new array. See\n[`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.concatMany([\"a\", \"b\", \"c\"], [[\"d\", \"e\"], [\"f\", \"g\", \"h\"]]) == [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n ]\n```" - ], - "signature": "let concatMany: (t<'a>, array>) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "Returns true if the given value is in the array, `false` otherwise. See\n[`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.includes([\"a\", \"b\", \"c\"], \"b\") == true\nJs.Array2.includes([\"a\", \"b\", \"c\"], \"x\") == false\n```" - ], - "signature": "let includes: (t<'a>, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "Returns the index of the first element in the array that has the given value.\nIf the value is not in the array, returns -1. See\n[`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.indexOf([100, 101, 102, 103], 102) == 2\nJs.Array2.indexOf([100, 101, 102, 103], 999) == -1\n```" - ], - "signature": "let indexOf: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "Returns the index of the first element in the array with the given value. The\nsearch starts at position `~from`. See\n[`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.indexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\"], \"a\", ~from=2) == 2\nJs.Array2.indexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\"], \"a\", ~from=3) == 4\nJs.Array2.indexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\"], \"b\", ~from=2) == -1\n```" - ], - "signature": "let indexOfFrom: (t<'a>, 'a, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "This function converts each element of the array to a string (via JavaScript)\nand concatenates them, separated by the string given in the first argument,\ninto a single string. See\n[`Array.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.joinWith([\"ant\", \"bee\", \"cat\"], \"--\") == \"ant--bee--cat\"\nJs.Array2.joinWith([\"door\", \"bell\"], \"\") == \"doorbell\"\nJs.Array2.joinWith([2020, 9, 4], \"/\") == \"2020/9/4\"\nJs.Array2.joinWith([2.5, 3.6, 3e-2], \";\") == \"2.5;3.6;0.03\"\n```" - ], - "signature": "let joinWith: (t<'a>, string) => string", - "deprecated": "" - }, - { - "id": "Js.Array2.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "Returns the index of the last element in the array that has the given value. If\nthe value is not in the array, returns -1. See\n[`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.lastIndexOf([\"a\", \"b\", \"a\", \"c\"], \"a\") == 2\nJs.Array2.lastIndexOf([\"a\", \"b\", \"a\", \"c\"], \"x\") == -1\n```" - ], - "signature": "let lastIndexOf: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "Returns the index of the last element in the array that has the given value,\nsearching from position `~from` down to the start of the array. If the value is\nnot in the array, returns -1. See\n[`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.lastIndexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\", \"d\"], \"a\", ~from=3) == 2\nJs.Array2.lastIndexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\", \"d\"], \"c\", ~from=2) == -1\n```" - ], - "signature": "let lastIndexOfFrom: (t<'a>, 'a, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "Returns a shallow copy of the given array from the `~start` index up to but not\nincluding the `~end_` position. Negative numbers indicate an offset from the\nend of the array. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105, 106]\nJs.Array2.slice(arr, ~start=2, ~end_=5) == [102, 103, 104]\nJs.Array2.slice(arr, ~start=-3, ~end_=-1) == [104, 105]\nJs.Array2.slice(arr, ~start=9, ~end_=10) == []\n```" - ], - "signature": "let slice: (t<'a>, ~start: int, ~end_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Returns a copy of the entire array. Same as `Js.Array2.Slice(arr, ~start=0,\n~end_=Js.Array2.length(arr))`. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." - ], - "signature": "let copy: t<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [ - "Returns a shallow copy of the given array from the given index to the end. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." - ], - "signature": "let sliceFrom: (t<'a>, int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts the array to a string. Each element is converted to a string using\nJavaScript. Unlike the JavaScript `Array.toString()`, all elements in a\nReasonML array must have the same type. See\n[`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.toString([3.5, 4.6, 7.8]) == \"3.5,4.6,7.8\"\nJs.Array2.toString([\"a\", \"b\", \"c\"]) == \"a,b,c\"\n```" - ], - "signature": "let toString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array2.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Converts the array to a string using the conventions of the current locale.\nEach element is converted to a string using JavaScript. Unlike the JavaScript\n`Array.toLocaleString()`, all elements in a ReasonML array must have the same\ntype. See\n[`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.toLocaleString([Js.Date.make()])\n// returns \"3/19/2020, 10:52:11 AM\" for locale en_US.utf8\n// returns \"2020-3-19 10:52:11\" for locale de_DE.utf8\n```" - ], - "signature": "let toLocaleString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array2.every", - "kind": "value", - "name": "every", - "docstrings": [ - "The first argument to `every()` is an array. The second argument is a predicate\nfunction that returns a boolean. The `every()` function returns `true` if the\npredicate function is true for all items in the given array. If given an empty\narray, returns `true`. See\n[`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every)\non MDN.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nJs.Array2.every([6, 22, 8, 4], isEven) == true\nJs.Array2.every([6, 22, 7, 4], isEven) == false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [ - "The first argument to `everyi()` is an array. The second argument is a\npredicate function with two arguments: an array element and that element’s\nindex; it returns a boolean. The `everyi()` function returns `true` if the\npredicate function is true for all items in the given array. If given an empty\narray, returns `true`. See\n[`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every)\non MDN.\n\n## Examples\n\n```rescript\n// determine if all even-index items are positive\nlet evenIndexPositive = (item, index) => mod(index, 2) == 0 ? item > 0 : true\n\nJs.Array2.everyi([6, -3, 5, 8], evenIndexPositive) == true\nJs.Array2.everyi([6, 3, -5, 8], evenIndexPositive) == false\n```" - ], - "signature": "let everyi: (t<'a>, ('a, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "Applies the given predicate function (the second argument) to each element in\nthe array; the result is an array of those elements for which the predicate\nfunction returned `true`. See\n[`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\non MDN.\n\n## Examples\n\n```rescript\nlet nonEmpty = s => s != \"\"\nJs.Array2.filter([\"abc\", \"\", \"\", \"def\", \"ghi\"], nonEmpty) == [\"abc\", \"def\", \"ghi\"]\n```" - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [ - "Each element of the given array are passed to the predicate function. The\nreturn value is an array of all those elements for which the predicate function\nreturned `true`.\n\nSee\n[`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\non MDN.\n\n## Examples\n\n```rescript\n// keep only positive elements at odd indices\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array2.filteri([6, 3, 5, 8, 7, -4, 1], positiveOddElement) == [3, 8]\n```" - ], - "signature": "let filteri: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.find", - "kind": "value", - "name": "find", - "docstrings": [ - "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find first negative element\nJs.Array2.find([33, 22, -55, 77, -44], x => x < 0) == Some(-55)\nJs.Array2.find([33, 22, 55, 77, 44], x => x < 0) == None\n```" - ], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.findi", - "kind": "value", - "name": "findi", - "docstrings": [ - "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate. The\npredicate function takes an array element and an index as its parameters. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find first positive item at an odd index\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array2.findi([66, -33, 55, 88, 22], positiveOddElement) == Some(88)\nJs.Array2.findi([66, -33, 55, -88, 22], positiveOddElement) == None\n```" - ], - "signature": "let findi: (t<'a>, ('a, int) => bool) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [ - "Returns the index of the first element in the array that satisifies the given\npredicate function, or -1 if no element satisifies the predicate. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.findIndex([33, 22, -55, 77, -44], x => x < 0) == 2\nJs.Array2.findIndex([33, 22, 55, 77, 44], x => x < 0) == -1\n```" - ], - "signature": "let findIndex: (t<'a>, 'a => bool) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [ - "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate. The\npredicate function takes an array element and an index as its parameters. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find index of first positive item at an odd index\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array2.findIndexi([66, -33, 55, 88, 22], positiveOddElement) == 3\nJs.Array2.findIndexi([66, -33, 55, -88, 22], positiveOddElement) == -1\n```" - ], - "signature": "let findIndexi: (t<'a>, ('a, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "The `forEach()` function applies the function given as the second argument to\neach element in the array. The function you provide returns `unit`, and the\n`forEach()` function also returns `unit`. You use `forEach()` when you need to\nprocess each element in the array but not return any new array or value; for\nexample, to print the items in an array. See\n[`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\non MDN.\n\n## Examples\n\n```rescript\n// display all elements in an array\nJs.Array2.forEach([\"a\", \"b\", \"c\"], x => Js.log(x)) == ()\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Array2.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [ - "The `forEachi()` function applies the function given as the second argument to\neach element in the array. The function you provide takes an item in the array\nand its index number, and returns `unit`. The `forEachi()` function also\nreturns `unit`. You use `forEachi()` when you need to process each element in\nthe array but not return any new array or value; for example, to print the\nitems in an array. See\n[`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\non MDN.\n\n## Examples\n\n```rescript\n// display all elements in an array as a numbered list\nJs.Array2.forEachi([\"a\", \"b\", \"c\"], (item, index) => Js.log2(index + 1, item)) == ()\n```" - ], - "signature": "let forEachi: (t<'a>, ('a, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Array2.map", - "kind": "value", - "name": "map", - "docstrings": [ - "Applies the function (the second argument) to each item in the array, returning\na new array. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]\nJs.Array2.map([\"animal\", \"vegetable\", \"mineral\"], Js.String.length) == [6, 9, 7]\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Array2.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [ - "Applies the function (the second argument) to each item in the array, returning\na new array. The function acceps two arguments: an item from the array and its\nindex number. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array2.mapi([10, 11, 12], product) == [0, 11, 24]\n```" - ], - "signature": "let mapi: (t<'a>, ('a, int) => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Array2.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "The `reduce()` function takes three parameters: an array, a *reducer function*,\nand a beginning accumulator value. The reducer function has two parameters: an\naccumulated value and an element of the array.\n\n`reduce()` first calls the reducer function with the beginning value and the\nfirst element in the array. The result becomes the new accumulator value, which\nis passed in to the reducer function along with the second element in the\narray. `reduce()` proceeds through the array, passing in the result of each\nstage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduce()`. See\n[`Array.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\non MDN.\n\n## Examples\n\n```rescript\nlet sumOfSquares = (accumulator, item) => accumulator + item * item\n\nJs.Array2.reduce([10, 2, 4], sumOfSquares, 0) == 120\nJs.Array2.reduce([10, 2, 4], \"*\", 1) == 80\nJs.Array2.reduce(\n [\"animal\", \"vegetable\", \"mineral\"],\n (acc, item) => acc + Js.String.length(item),\n 0,\n) == 22 // 6 + 9 + 7\nJs.Array2.reduce([2.0, 4.0], (acc, item) => item /. acc, 1.0) == 2.0 // 4.0 / (2.0 / 1.0)\n```" - ], - "signature": "let reduce: (t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [ - "The `reducei()` function takes three parameters: an array, a *reducer\nfunction*, and a beginning accumulator value. The reducer function has three\nparameters: an accumulated value, an element of the array, and the index of\nthat element.\n\n`reducei()` first calls the reducer function with the beginning value, the\nfirst element in the array, and zero (its index). The result becomes the new\naccumulator value, which is passed to the reducer function along with the\nsecond element in the array and one (its index). `reducei()` proceeds from left\nto right through the array, passing in the result of each stage as the\naccumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reducei()`. See\n[`Array.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\non MDN.\n\n## Examples\n\n```rescript\n// find sum of even-index elements in array\nlet sumOfEvens = (accumulator, item, index) =>\n if mod(index, 2) == 0 {\n accumulator + item\n } else {\n accumulator\n }\n\nJs.Array2.reducei([2, 5, 1, 4, 3], sumOfEvens, 0) == 6\n```" - ], - "signature": "let reducei: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [ - "The `reduceRight()` function takes three parameters: an array, a *reducer\nfunction*, and a beginning accumulator value. The reducer function has two\nparameters: an accumulated value and an element of the array.\n\n`reduceRight()` first calls the reducer function with the beginning value and\nthe last element in the array. The result becomes the new accumulator value,\nwhich is passed in to the reducer function along with the next-to-last element\nin the array. `reduceRight()` proceeds from right to left through the array,\npassing in the result of each stage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduceRight()`. See\n[`Array.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight)\non MDN.\n\n**NOTE:** In many cases, `reduce()` and `reduceRight()` give the same result.\nHowever, see the last example here and compare it to the example from\n`reduce()`, where order makes a difference.\n\n## Examples\n\n```rescript\nlet sumOfSquares = (accumulator, item) => accumulator + item * item\n\nJs.Array2.reduceRight([10, 2, 4], sumOfSquares, 0) == 120\nJs.Array2.reduceRight([2.0, 4.0], (acc, item) => item /. acc, 1.0) == 0.5 // 2.0 / (4.0 / 1.0)\n```" - ], - "signature": "let reduceRight: (t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [ - "The `reduceRighti()` function takes three parameters: an array, a *reducer\nfunction*, and a beginning accumulator value. The reducer function has three\nparameters: an accumulated value, an element of the array, and the index of\nthat element. `reduceRighti()` first calls the reducer function with the\nbeginning value, the last element in the array, and its index (length of array\nminus one). The result becomes the new accumulator value, which is passed in to\nthe reducer function along with the second element in the array and one (its\nindex). `reduceRighti()` proceeds from right to left through the array, passing\nin the result of each stage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduceRighti()`. See\n[`Array.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight)\non MDN.\n\n**NOTE:** In many cases, `reducei()` and `reduceRighti()` give the same result.\nHowever, there are cases where the order in which items are processed makes a\ndifference.\n\n## Examples\n\n```rescript\n// find sum of even-index elements in array\nlet sumOfEvens = (accumulator, item, index) =>\n if mod(index, 2) == 0 {\n accumulator + item\n } else {\n accumulator\n }\n\nJs.Array2.reduceRighti([2, 5, 1, 4, 3], sumOfEvens, 0) == 6\n```" - ], - "signature": "let reduceRighti: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Returns `true` if the predicate function given as the second argument to\n`some()` returns `true` for any element in the array; `false` otherwise.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nJs.Array2.some([3, 7, 5, 2, 9], isEven) == true\nJs.Array2.some([3, 7, 5, 1, 9], isEven) == false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.somei", - "kind": "value", - "name": "somei", - "docstrings": [ - "Returns `true` if the predicate function given as the second argument to\n`somei()` returns `true` for any element in the array; `false` otherwise. The\npredicate function has two arguments: an item from the array and the index\nvalue\n\n## Examples\n\n```rescript\n// Does any string in the array\n// have the same length as its index?\n\nlet sameLength = (str, index) => Js.String.length(str) == index\n\n// \"ef\" has length 2 and is it at index 2\nJs.Array2.somei([\"ab\", \"cd\", \"ef\", \"gh\"], sameLength) == true\n// no item has the same length as its index\nJs.Array2.somei([\"a\", \"bc\", \"def\", \"gh\"], sameLength) == false\n```" - ], - "signature": "let somei: (t<'a>, ('a, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [ - "Returns the value at the given position in the array if the position is in\nbounds; returns the JavaScript value `undefined` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array2.unsafe_get(arr, 3) == 103\nJs.Array2.unsafe_get(arr, 4) // returns undefined\n```" - ], - "signature": "let unsafe_get: (array<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Js.Array2.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [ - "Sets the value at the given position in the array if the position is in bounds.\nIf the index is out of bounds, well, “here there be dragons.“\n\n*This function modifies the original array.*\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array2.unsafe_set(arr, 3, 99)\n// result is [100, 101, 102, 99];\n\nJs.Array2.unsafe_set(arr, 4, 88)\n// result is [100, 101, 102, 99, 88]\n\nJs.Array2.unsafe_set(arr, 6, 77)\n// result is [100, 101, 102, 99, 88, <1 empty item>, 77]\n\nJs.Array2.unsafe_set(arr, -1, 66)\n// you don't want to know.\n```" - ], - "signature": "let unsafe_set: (array<'a>, int, 'a) => unit", - "deprecated": "" - } - ] - }, - "js/array": { - "id": "Js.Array", - "name": "Array", - "docstrings": [ - "Provide bindings to JS array", - "Provides bindings to JavaScript’s `Array` functions. These bindings are\noptimized for pipe-last (`|>`), where the array to be processed is the last\nparameter in the function." - ], - "items": [ - { - "id": "Js.Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type used to describe a JavaScript array." - ], - "signature": "type t<'a> = array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [ - "A type used to describe JavaScript objects that are like an array or are iterable." - ], - "signature": "type array_like<'a> = Js_array2.array_like<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.from", - "kind": "value", - "name": "from", - "docstrings": [ - "Creates a shallow copy of an array from an array-like object. See [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nJs.Array.from(strArr) == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let from: array_like<'a> => array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.fromMap", - "kind": "value", - "name": "fromMap", - "docstrings": [ - "Creates a new array by applying a function (the second argument) to each item\nin the `array_like` first argument. See\n[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\non MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nlet code = s => Js.String.charCodeAt(0, s)\nJs.Array.fromMap(strArr, code) == [97.0, 98.0, 99.0, 100.0]\n```" - ], - "signature": "let fromMap: (array_like<'a>, 'a => 'b) => array<'b>", - "deprecated": "" - }, - { - "id": "Js.Array.isArray", - "kind": "value", - "name": "isArray", - "docstrings": [], - "signature": "let isArray: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.Array.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Returns the number of elements in the array. See [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN." - ], - "signature": "let length: array<'a> => int", - "deprecated": "" - }, - { - "id": "Js.Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (~to_: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (~to_: int, ~from: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: ('a, t<'a>) => 'b" - }, - { - "id": "Js.Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: ('a, ~from: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: ('a, ~start: int, ~end_: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "If the array is not empty, removes the last element and returns it as `Some(value)`; returns `None` if the array is empty. *This function modifies the original array.* See [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array.pop(arr) == Some(104)\narr == [100, 101, 102, 103]\n\nlet empty: array = []\nJs.Array.pop(empty) == None\n```" - ], - "signature": "let pop: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.push", - "kind": "value", - "name": "push", - "docstrings": [], - "signature": "let push: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.pushMany", - "kind": "value", - "name": "pushMany", - "docstrings": [], - "signature": "let pushMany: (array<'a>, t<'a>) => int" - }, - { - "id": "Js.Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [ - "Returns an array with the elements of the input array in reverse order. *This function modifies the original array.* See [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array.reverseInPlace(arr) == [\"cat\", \"bee\", \"ant\"]\narr == [\"cat\", \"bee\", \"ant\"]\n```" - ], - "signature": "let reverseInPlace: t<'a> => 'this", - "deprecated": "" - }, - { - "id": "Js.Array.shift", - "kind": "value", - "name": "shift", - "docstrings": [ - "If the array is not empty, removes the first element and returns it as `Some(value)`; returns `None` if the array is empty. *This function modifies the original array.* See [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array.shift(arr) == Some(100)\narr == [101, 102, 103, 104]\n\nlet empty: array = []\nJs.Array.shift(empty) == None\n```" - ], - "signature": "let shift: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [ - "Sorts the given array in place and returns the sorted array. JavaScript sorts the array by converting the arguments to UTF-16 strings and sorting them. See the second example with sorting numbers, which does not do a numeric sort. *This function modifies the original array.* See [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet words = [\"bee\", \"dog\", \"ant\", \"cat\"]\nJs.Array.sortInPlace(words) == [\"ant\", \"bee\", \"cat\", \"dog\"]\nwords == [\"ant\", \"bee\", \"cat\", \"dog\"]\n\nlet numbers = [3, 30, 10, 1, 20, 2]\nJs.Array.sortInPlace(numbers) == [1, 10, 2, 20, 3, 30]\nnumbers == [1, 10, 2, 20, 3, 30]\n```" - ], - "signature": "let sortInPlace: t<'a> => 'this", - "deprecated": "This has been deprecated and will be removed in v13. Use functions from the `Array` module instead." - }, - { - "id": "Js.Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (('a, 'a) => int, t<'a>) => 'b" - }, - { - "id": "Js.Array.spliceInPlace", - "kind": "value", - "name": "spliceInPlace", - "docstrings": [], - "signature": "let spliceInPlace: (~pos: int, ~remove: int, ~add: array<'a>, t<'a>) => 'b" - }, - { - "id": "Js.Array.removeFromInPlace", - "kind": "value", - "name": "removeFromInPlace", - "docstrings": [], - "signature": "let removeFromInPlace: (~pos: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.removeCountInPlace", - "kind": "value", - "name": "removeCountInPlace", - "docstrings": [], - "signature": "let removeCountInPlace: (~pos: int, ~count: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.unshift", - "kind": "value", - "name": "unshift", - "docstrings": [], - "signature": "let unshift: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.unshiftMany", - "kind": "value", - "name": "unshiftMany", - "docstrings": [], - "signature": "let unshiftMany: (array<'a>, t<'a>) => int" - }, - { - "id": "Js.Array.concat", - "kind": "value", - "name": "concat", - "docstrings": [], - "signature": "let concat: ('a, t<'b>) => 'a" - }, - { - "id": "Js.Array.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [], - "signature": "let concatMany: (array<'a>, t<'b>) => 'a" - }, - { - "id": "Js.Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: ('a, t<'a>) => bool" - }, - { - "id": "Js.Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: ('a, ~from: int, t<'a>) => int" - }, - { - "id": "Js.Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (string, t<'a>) => string" - }, - { - "id": "Js.Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: ('a, ~from: int, t<'a>) => int" - }, - { - "id": "Js.Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (int, ~end_: int, ~obj: t<'a>) => 'b" - }, - { - "id": "Js.Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Returns a copy of the entire array. Same as `Js.Array.Slice(~start=0,\n~end_=Js.Array.length(arr), arr)`. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." - ], - "signature": "let copy: t<'a> => 'this", - "deprecated": "" - }, - { - "id": "Js.Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (int, t<'a>) => 'b" - }, - { - "id": "Js.Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts the array to a string. Each element is converted to a string using\nJavaScript. Unlike the JavaScript `Array.toString()`, all elements in a\nReasonML array must have the same type. See\n[`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.toString([3.5, 4.6, 7.8]) == \"3.5,4.6,7.8\"\nJs.Array.toString([\"a\", \"b\", \"c\"]) == \"a,b,c\"\n```" - ], - "signature": "let toString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Converts the array to a string using the conventions of the current locale.\nEach element is converted to a string using JavaScript. Unlike the JavaScript\n`Array.toLocaleString()`, all elements in a ReasonML array must have the same\ntype. See\n[`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.toLocaleString([Js.Date.make()])\n// returns \"3/19/2020, 10:52:11 AM\" for locale en_US.utf8\n// returns \"2020-3-19 10:52:11\" for locale de_DE.utf8\n```" - ], - "signature": "let toLocaleString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: ('a => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (('a, int) => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: ('a => bool, t<'a>) => 'b" - }, - { - "id": "Js.Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (('a, int) => bool, t<'a>) => 'b" - }, - { - "id": "Js.Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: ('a => bool, t<'a>) => option<'a>" - }, - { - "id": "Js.Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (('a, int) => bool, t<'a>) => option<'a>" - }, - { - "id": "Js.Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: ('a => bool, t<'a>) => int" - }, - { - "id": "Js.Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (('a, int) => bool, t<'a>) => int" - }, - { - "id": "Js.Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: ('a => unit, t<'a>) => unit" - }, - { - "id": "Js.Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (('a, int) => unit, t<'a>) => unit" - }, - { - "id": "Js.Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: ('a => 'b, t<'a>) => t<'b>" - }, - { - "id": "Js.Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (('a, int) => 'b, t<'a>) => t<'b>" - }, - { - "id": "Js.Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (('a, 'b) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (('a, 'b, int) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (('a, 'b) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (('a, 'b, int) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: ('a => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (('a, int) => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [ - "Returns the value at the given position in the array if the position is in\nbounds; returns the JavaScript value `undefined` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array.unsafe_get(arr, 3) == 103\nJs.Array.unsafe_get(arr, 4) // returns undefined\n```" - ], - "signature": "let unsafe_get: (array<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Js.Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [ - "Sets the value at the given position in the array if the position is in bounds.\nIf the index is out of bounds, well, “here there be dragons.“ *This function\nmodifies the original array.*\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array.unsafe_set(arr, 3, 99)\n// result is [100, 101, 102, 99]\n\nJs.Array.unsafe_set(arr, 4, 88)\n// result is [100, 101, 102, 99, 88]\n\nJs.Array.unsafe_set(arr, 6, 77)\n// result is [100, 101, 102, 99, 88, <1 empty item>, 77]\n\nJs.Array.unsafe_set(arr, -1, 66)\n// you don't want to know.\n```" - ], - "signature": "let unsafe_set: (array<'a>, int, 'a) => unit", - "deprecated": "" - } - ] - }, - "js/exn": { - "id": "Js.Exn", - "name": "Exn", - "docstrings": [ - "Provide utilities for dealing with Js exceptions", - "Provide utilities for dealing with JS exceptions." - ], - "items": [ - { - "id": "Js.Exn.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JS exception" - ], - "signature": "type t", - "deprecated": "" - }, - { - "id": "Js.Exn.asJsExn", - "kind": "value", - "name": "asJsExn", - "docstrings": [], - "signature": "let asJsExn: exn => option", - "deprecated": "" - }, - { - "id": "Js.Exn.stack", - "kind": "value", - "name": "stack", - "docstrings": [], - "signature": "let stack: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.message", - "kind": "value", - "name": "message", - "docstrings": [], - "signature": "let message: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.name", - "kind": "value", - "name": "name", - "docstrings": [], - "signature": "let name: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [], - "signature": "let fileName: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.anyToExnInternal", - "kind": "value", - "name": "anyToExnInternal", - "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a Exn.Error if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." - ], - "signature": "let anyToExnInternal: 'a => exn", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseError", - "kind": "value", - "name": "raiseError", - "docstrings": [ - "Raise Js exception Error object with stacktrace" - ], - "signature": "let raiseError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseEvalError", - "kind": "value", - "name": "raiseEvalError", - "docstrings": [], - "signature": "let raiseEvalError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseRangeError", - "kind": "value", - "name": "raiseRangeError", - "docstrings": [], - "signature": "let raiseRangeError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseReferenceError", - "kind": "value", - "name": "raiseReferenceError", - "docstrings": [], - "signature": "let raiseReferenceError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseSyntaxError", - "kind": "value", - "name": "raiseSyntaxError", - "docstrings": [], - "signature": "let raiseSyntaxError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseTypeError", - "kind": "value", - "name": "raiseTypeError", - "docstrings": [], - "signature": "let raiseTypeError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseUriError", - "kind": "value", - "name": "raiseUriError", - "docstrings": [], - "signature": "let raiseUriError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(exn)` ignores the provided exn and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit", - "deprecated": "" - } - ] - }, - "js/null_undefined": { - "id": "Js.Null_undefined", - "name": "Null_undefined", - "docstrings": [ - "Contains functionality for dealing with values that can be both `null` and `undefined`" - ], - "items": [ - { - "id": "Js.Null_undefined.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.null_undefined<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [ - "Returns `true` if the given value is null or undefined, `false` otherwise." - ], - "signature": "let isNullable: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The null value of type `Js.null_undefined<'a>`." - ], - "signature": "let null: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The undefined value of type `Js.null_undefined<'a>`." - ], - "signature": "let undefined: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\n\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped, mapped to\na `'b` using the given function `a' => 'b`, then wrapped back up and returned\nas `Js.null_undefined<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.null_undefined) =>\n Js.Null_undefined.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function.\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped and applied to the given function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.null_undefined) =>\n Js.Null_undefined.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.null_undefined<'a>`.\n`Some(a)` => `a`\n`None` => `undefined`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.null_undefined<'a>` to `option<'a>`.\n`a` => `Some(a)`\n`undefined` => `None`\n`null` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - }, - "js/nullable": { - "id": "Js.Nullable", - "name": "Nullable", - "docstrings": [ - "Provide utilities for `Js.null_undefined`", - "Contains functionality for dealing with values that can be both `null` and `undefined`" - ], - "items": [ - { - "id": "Js.Nullable.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined", - "deprecated": "" - }, - { - "id": "Js.Nullable.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.null_undefined<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [ - "Returns `true` if the given value is null or undefined, `false` otherwise." - ], - "signature": "let isNullable: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Nullable.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The null value of type `Js.null_undefined<'a>`." - ], - "signature": "let null: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The undefined value of type `Js.null_undefined<'a>`." - ], - "signature": "let undefined: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\n\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped, mapped to\na `'b` using the given function `a' => 'b`, then wrapped back up and returned\nas `Js.null_undefined<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.null_undefined) =>\n Js.Null_undefined.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Nullable.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function.\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped and applied to the given function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.null_undefined) =>\n Js.Null_undefined.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Nullable.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.null_undefined<'a>`.\n`Some(a)` => `a`\n`None` => `undefined`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.null_undefined<'a>` to `option<'a>`.\n`a` => `Some(a)`\n`undefined` => `None`\n`null` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - }, - "js/undefined": { - "id": "Js.Undefined", - "name": "Undefined", - "docstrings": [ - "Provide utilities for `Js.undefined<'a>`", - "Provides functionality for dealing with the `Js.undefined<'a>` type" - ], - "items": [ - { - "id": "Js.Undefined.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Local alias for `Js.undefined<'a>`" - ], - "signature": "type t<'a> = undefined<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.undefined<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.test", - "kind": "value", - "name": "test", - "docstrings": [ - "Returns `true` if the given value is empty (undefined), `false` otherwise." - ], - "signature": "let test: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Undefined.testAny", - "kind": "value", - "name": "testAny", - "docstrings": [ - "Returns `true` if the given value is empty (undefined).\n\n**since 1.6.1**" - ], - "signature": "let testAny: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.Undefined.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "The empty value, `undefined`" - ], - "signature": "let empty: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [], - "signature": "let getUnsafe: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Undefined.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Undefined.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\nIf `Js.undefined<'a>` contains a value, that value is unwrapped, mapped to a\n`'b` using the given function `a' => 'b`, then wrapped back up and returned as\n`Js.undefined<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.undefined) =>\n Js.Undefined.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Undefined.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function. If\n`Js.undefined<'a>` contains a value, that value is unwrapped and applied to the\ngiven function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.undefined) =>\n Js.Undefined.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Undefined.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.undefined<'a>`.\n`Some(a)` => `a`\n`None` => `empty`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.undefined<'a>` to `option<'a>`\n`a` => `Some(a)`\n`empty` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - }, - "js/null": { - "id": "Js.Null", - "name": "Null", - "docstrings": [ - "Provide utilities for `Js.null<'a>`", - "Provides functionality for dealing with the `Js.null<'a>` type" - ], - "items": [ - { - "id": "Js.Null.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "@unboxed\ntype t<'a> = null<'a> =\n | Value('a)\n | @as(null) Null", - "deprecated": "" - }, - { - "id": "Js.Null.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.null<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.test", - "kind": "value", - "name": "test", - "docstrings": [ - "Returns `true` if the given value is empty (`null`), `false` otherwise." - ], - "signature": "let test: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Null.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "The empty value, `null`" - ], - "signature": "let empty: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [], - "signature": "let getUnsafe: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Null.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Null.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\n\nIf `Js.null<'a>` contains a value, that value is unwrapped, mapped to a `'b`\nusing the given function `'a => 'b`, then wrapped back up and returned as\n`Js.null<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.null) =>\n Js.Null.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Null.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function.\nIf `Js.null<'a>` contains a value, that value is unwrapped and applied to the given function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.null) =>\n Js.Null.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Null.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.null<'a>`.\n`Some(a)` => `a`\n`None` => `empty`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.null<'a>` to `option<'a>`.\n`a` => `Some(a)`\n`empty` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v12.2.0/toc_tree.json b/apps/docs/data/api/v12.2.0/toc_tree.json deleted file mode 100644 index 7304b0e63..000000000 --- a/apps/docs/data/api/v12.2.0/toc_tree.json +++ /dev/null @@ -1 +0,0 @@ -{"belt":{"name":"Belt","path":["belt"],"children":[{"name":"Float","path":["belt","float"],"children":[]},{"name":"Int","path":["belt","int"],"children":[]},{"name":"Result","path":["belt","result"],"children":[]},{"name":"Option","path":["belt","option"],"children":[]},{"name":"HashMap","path":["belt","hashmap"],"children":[{"name":"String","path":["belt","hashmap","string"],"children":[]},{"name":"Int","path":["belt","hashmap","int"],"children":[]}]},{"name":"HashSet","path":["belt","hashset"],"children":[{"name":"String","path":["belt","hashset","string"],"children":[]},{"name":"Int","path":["belt","hashset","int"],"children":[]}]},{"name":"MutableMap","path":["belt","mutablemap"],"children":[{"name":"String","path":["belt","mutablemap","string"],"children":[]},{"name":"Int","path":["belt","mutablemap","int"],"children":[]}]},{"name":"MutableSet","path":["belt","mutableset"],"children":[{"name":"String","path":["belt","mutableset","string"],"children":[]},{"name":"Int","path":["belt","mutableset","int"],"children":[]}]},{"name":"Map","path":["belt","map"],"children":[{"name":"Dict","path":["belt","map","dict"],"children":[]},{"name":"String","path":["belt","map","string"],"children":[]},{"name":"Int","path":["belt","map","int"],"children":[]}]},{"name":"Set","path":["belt","set"],"children":[{"name":"Dict","path":["belt","set","dict"],"children":[]},{"name":"String","path":["belt","set","string"],"children":[]},{"name":"Int","path":["belt","set","int"],"children":[]}]},{"name":"Range","path":["belt","range"],"children":[]},{"name":"List","path":["belt","list"],"children":[]},{"name":"MutableStack","path":["belt","mutablestack"],"children":[]},{"name":"MutableQueue","path":["belt","mutablequeue"],"children":[]},{"name":"SortArray","path":["belt","sortarray"],"children":[{"name":"String","path":["belt","sortarray","string"],"children":[]},{"name":"Int","path":["belt","sortarray","int"],"children":[]}]},{"name":"Array","path":["belt","array"],"children":[]},{"name":"Id","path":["belt","id"],"children":[{"name":"MakeHashable","path":["belt","id","makehashable"],"children":[]},{"name":"MakeHashableU","path":["belt","id","makehashableu"],"children":[]},{"name":"MakeComparable","path":["belt","id","makecomparable"],"children":[]},{"name":"MakeComparableU","path":["belt","id","makecomparableu"],"children":[]}]}]},"dom":{"name":"Dom","path":["dom"],"children":[{"name":"Storage2","path":["dom","storage2"],"children":[]},{"name":"Storage","path":["dom","storage"],"children":[]}]},"js":{"name":"Js","path":["js"],"children":[{"name":"WeakMap","path":["js","weakmap"],"children":[]},{"name":"Map","path":["js","map"],"children":[]},{"name":"WeakSet","path":["js","weakset"],"children":[]},{"name":"Set","path":["js","set"],"children":[]},{"name":"Console","path":["js","console"],"children":[]},{"name":"Result","path":["js","result"],"children":[]},{"name":"Option","path":["js","option"],"children":[]},{"name":"Blob","path":["js","blob"],"children":[]},{"name":"File","path":["js","file"],"children":[]},{"name":"BigInt","path":["js","bigint"],"children":[]},{"name":"Int","path":["js","int"],"children":[]},{"name":"Float","path":["js","float"],"children":[]},{"name":"Types","path":["js","types"],"children":[]},{"name":"TypedArray2","path":["js","typedarray2"],"children":[{"name":"DataView","path":["js","typedarray2","dataview"],"children":[]},{"name":"Float64Array","path":["js","typedarray2","float64array"],"children":[]},{"name":"Float32Array","path":["js","typedarray2","float32array"],"children":[]},{"name":"Uint32Array","path":["js","typedarray2","uint32array"],"children":[]},{"name":"Int32Array","path":["js","typedarray2","int32array"],"children":[]},{"name":"Uint16Array","path":["js","typedarray2","uint16array"],"children":[]},{"name":"Int16Array","path":["js","typedarray2","int16array"],"children":[]},{"name":"Uint8ClampedArray","path":["js","typedarray2","uint8clampedarray"],"children":[]},{"name":"Uint8Array","path":["js","typedarray2","uint8array"],"children":[]},{"name":"Int8Array","path":["js","typedarray2","int8array"],"children":[]},{"name":"ArrayBuffer","path":["js","typedarray2","arraybuffer"],"children":[]}]},{"name":"Typed_array","path":["js","typed_array"],"children":[{"name":"DataView","path":["js","typed_array","dataview"],"children":[]},{"name":"Float64_array","path":["js","typed_array","float64_array"],"children":[]},{"name":"Float64Array","path":["js","typed_array","float64array"],"children":[]},{"name":"Float32_array","path":["js","typed_array","float32_array"],"children":[]},{"name":"Float32Array","path":["js","typed_array","float32array"],"children":[]},{"name":"Uint32Array","path":["js","typed_array","uint32array"],"children":[]},{"name":"Int32_array","path":["js","typed_array","int32_array"],"children":[]},{"name":"Int32Array","path":["js","typed_array","int32array"],"children":[]},{"name":"Uint16Array","path":["js","typed_array","uint16array"],"children":[]},{"name":"Int16Array","path":["js","typed_array","int16array"],"children":[]},{"name":"Uint8ClampedArray","path":["js","typed_array","uint8clampedarray"],"children":[]},{"name":"Uint8Array","path":["js","typed_array","uint8array"],"children":[]},{"name":"Int8Array","path":["js","typed_array","int8array"],"children":[]},{"name":"S","path":["js","typed_array","s"],"children":[]},{"name":"ArrayBuffer","path":["js","typed_array","arraybuffer"],"children":[]},{"name":"Type","path":["js","typed_array","type"],"children":[]}]},{"name":"Obj","path":["js","obj"],"children":[]},{"name":"Math","path":["js","math"],"children":[]},{"name":"Json","path":["js","json"],"children":[{"name":"Kind","path":["js","json","kind"],"children":[]}]},{"name":"Global","path":["js","global"],"children":[]},{"name":"Dict","path":["js","dict"],"children":[]},{"name":"Date","path":["js","date"],"children":[]},{"name":"Promise2","path":["js","promise2"],"children":[]},{"name":"Promise","path":["js","promise"],"children":[]},{"name":"Re","path":["js","re"],"children":[]},{"name":"String2","path":["js","string2"],"children":[]},{"name":"String","path":["js","string"],"children":[]},{"name":"Array2","path":["js","array2"],"children":[]},{"name":"Array","path":["js","array"],"children":[]},{"name":"Exn","path":["js","exn"],"children":[]},{"name":"Null_undefined","path":["js","null_undefined"],"children":[]},{"name":"Nullable","path":["js","nullable"],"children":[]},{"name":"Undefined","path":["js","undefined"],"children":[]},{"name":"Null","path":["js","null"],"children":[]}]},"stdlib":{"name":"Stdlib","path":["stdlib"],"children":[{"name":"BigUint64Array","path":["stdlib","biguint64array"],"children":[{"name":"Constants","path":["stdlib","biguint64array","constants"],"children":[]}]},{"name":"BigInt64Array","path":["stdlib","bigint64array"],"children":[{"name":"Constants","path":["stdlib","bigint64array","constants"],"children":[]}]},{"name":"Uint8ClampedArray","path":["stdlib","uint8clampedarray"],"children":[{"name":"Constants","path":["stdlib","uint8clampedarray","constants"],"children":[]}]},{"name":"Uint32Array","path":["stdlib","uint32array"],"children":[{"name":"Constants","path":["stdlib","uint32array","constants"],"children":[]}]},{"name":"Uint16Array","path":["stdlib","uint16array"],"children":[{"name":"Constants","path":["stdlib","uint16array","constants"],"children":[]}]},{"name":"Uint8Array","path":["stdlib","uint8array"],"children":[{"name":"Constants","path":["stdlib","uint8array","constants"],"children":[]}]},{"name":"Int32Array","path":["stdlib","int32array"],"children":[{"name":"Constants","path":["stdlib","int32array","constants"],"children":[]}]},{"name":"Int16Array","path":["stdlib","int16array"],"children":[{"name":"Constants","path":["stdlib","int16array","constants"],"children":[]}]},{"name":"Int8Array","path":["stdlib","int8array"],"children":[{"name":"Constants","path":["stdlib","int8array","constants"],"children":[]}]},{"name":"Float64Array","path":["stdlib","float64array"],"children":[{"name":"Constants","path":["stdlib","float64array","constants"],"children":[]}]},{"name":"Float32Array","path":["stdlib","float32array"],"children":[{"name":"Constants","path":["stdlib","float32array","constants"],"children":[]}]},{"name":"TypedArray","path":["stdlib","typedarray"],"children":[]},{"name":"ArrayBuffer","path":["stdlib","arraybuffer"],"children":[]},{"name":"WeakSet","path":["stdlib","weakset"],"children":[]},{"name":"Set","path":["stdlib","set"],"children":[]},{"name":"WeakMap","path":["stdlib","weakmap"],"children":[]},{"name":"Map","path":["stdlib","map"],"children":[]},{"name":"AsyncIterator","path":["stdlib","asynciterator"],"children":[]},{"name":"Iterator","path":["stdlib","iterator"],"children":[]},{"name":"Type","path":["stdlib","type"],"children":[{"name":"Classify","path":["stdlib","type","classify"],"children":[]}]},{"name":"Symbol","path":["stdlib","symbol"],"children":[]},{"name":"String","path":["stdlib","string"],"children":[]},{"name":"Result","path":["stdlib","result"],"children":[]},{"name":"RegExp","path":["stdlib","regexp"],"children":[{"name":"Result","path":["stdlib","regexp","result"],"children":[]}]},{"name":"Promise","path":["stdlib","promise"],"children":[]},{"name":"Pair","path":["stdlib","pair"],"children":[]},{"name":"Ordering","path":["stdlib","ordering"],"children":[]},{"name":"Option","path":["stdlib","option"],"children":[]},{"name":"Object","path":["stdlib","object"],"children":[]},{"name":"Nullable","path":["stdlib","nullable"],"children":[]},{"name":"Null","path":["stdlib","null"],"children":[]},{"name":"Math","path":["stdlib","math"],"children":[{"name":"Int","path":["stdlib","math","int"],"children":[]},{"name":"Constants","path":["stdlib","math","constants"],"children":[]}]},{"name":"List","path":["stdlib","list"],"children":[]},{"name":"Lazy","path":["stdlib","lazy"],"children":[]},{"name":"JSON","path":["stdlib","json"],"children":[{"name":"Decode","path":["stdlib","json","decode"],"children":[]},{"name":"Encode","path":["stdlib","json","encode"],"children":[]},{"name":"Classify","path":["stdlib","json","classify"],"children":[]}]},{"name":"JsExn","path":["stdlib","jsexn"],"children":[]},{"name":"JsError","path":["stdlib","jserror"],"children":[{"name":"URIError","path":["stdlib","jserror","urierror"],"children":[]},{"name":"TypeError","path":["stdlib","jserror","typeerror"],"children":[]},{"name":"SyntaxError","path":["stdlib","jserror","syntaxerror"],"children":[]},{"name":"ReferenceError","path":["stdlib","jserror","referenceerror"],"children":[]},{"name":"RangeError","path":["stdlib","jserror","rangeerror"],"children":[]},{"name":"EvalError","path":["stdlib","jserror","evalerror"],"children":[]}]},{"name":"Intl","path":["stdlib","intl"],"children":[{"name":"Segments","path":["stdlib","intl","segments"],"children":[]},{"name":"Segmenter","path":["stdlib","intl","segmenter"],"children":[]},{"name":"RelativeTimeFormat","path":["stdlib","intl","relativetimeformat"],"children":[]},{"name":"PluralRules","path":["stdlib","intl","pluralrules"],"children":[]},{"name":"NumberFormat","path":["stdlib","intl","numberformat"],"children":[{"name":"Grouping","path":["stdlib","intl","numberformat","grouping"],"children":[]}]},{"name":"Locale","path":["stdlib","intl","locale"],"children":[]},{"name":"ListFormat","path":["stdlib","intl","listformat"],"children":[]},{"name":"DateTimeFormat","path":["stdlib","intl","datetimeformat"],"children":[]},{"name":"Collator","path":["stdlib","intl","collator"],"children":[]},{"name":"Common","path":["stdlib","intl","common"],"children":[]}]},{"name":"Int","path":["stdlib","int"],"children":[{"name":"Ref","path":["stdlib","int","ref"],"children":[]},{"name":"Bitwise","path":["stdlib","int","bitwise"],"children":[]},{"name":"Constants","path":["stdlib","int","constants"],"children":[]}]},{"name":"Float","path":["stdlib","float"],"children":[{"name":"Constants","path":["stdlib","float","constants"],"children":[]}]},{"name":"Error","path":["stdlib","error"],"children":[{"name":"URIError","path":["stdlib","error","urierror"],"children":[]},{"name":"TypeError","path":["stdlib","error","typeerror"],"children":[]},{"name":"SyntaxError","path":["stdlib","error","syntaxerror"],"children":[]},{"name":"ReferenceError","path":["stdlib","error","referenceerror"],"children":[]},{"name":"RangeError","path":["stdlib","error","rangeerror"],"children":[]},{"name":"EvalError","path":["stdlib","error","evalerror"],"children":[]}]},{"name":"Exn","path":["stdlib","exn"],"children":[]},{"name":"Dict","path":["stdlib","dict"],"children":[]},{"name":"Date","path":["stdlib","date"],"children":[{"name":"UTC","path":["stdlib","date","utc"],"children":[]}]},{"name":"DataView","path":["stdlib","dataview"],"children":[]},{"name":"Console","path":["stdlib","console"],"children":[]},{"name":"Bool","path":["stdlib","bool"],"children":[]},{"name":"BigInt","path":["stdlib","bigint"],"children":[]},{"name":"Array","path":["stdlib","array"],"children":[]},{"name":"IntervalId","path":["stdlib","intervalid"],"children":[]},{"name":"TimeoutId","path":["stdlib","timeoutid"],"children":[]}]}} \ No newline at end of file diff --git a/apps/docs/data/api/v13.0.0/belt.json b/apps/docs/data/api/v13.0.0/belt.json deleted file mode 100644 index cd007676d..000000000 --- a/apps/docs/data/api/v13.0.0/belt.json +++ /dev/null @@ -1,9274 +0,0 @@ -{ - "belt": { - "id": "Belt", - "name": "Belt", - "docstrings": [ - "The ReScript standard library.\n\nBelt is currently mostly covering collection types. It has no string or date functions yet, although Belt.String is in the works. In the meantime, use [Js.String](js/string) for string functions and [Js.Date](js/date) for date functions.\n\n## Motivation\n\nBelt provides:\n\n- The **highest quality** immutable data structures in JavaScript.\n- Safety by default: A Belt function will never throw exceptions, unless it is\n indicated explicitly in the function name (suffix \"Exn\").\n- Better performance and smaller code size running on the JS platform.\n- Ready for [Tree Shaking](https://webpack.js.org/guides/tree-shaking/).\n\n## Usage\n\nTo use modules from Belt, either refer to them by their fully qualified name (`Belt.List`, `Belt.Array` etc.) or open the `Belt` module by putting\n\n## Examples\n\n```rescript\nopen Belt\n```\n\nat the top of your source files. After opening Belt this way, `Array` will refer to `Belt.Array`, `List` will refer to `Belt.List` etc. in the subsequent code.\n\nIf you want to open Belt globally for all files in your project instead, you can put\n\n```json\n{\n \"compiler-flags\": [\"-open Belt\"]\n}\n```\n\ninto your `rescript.json`.\n\n**Note**: this is the **only** `open` we encourage.\n\nExample usage:\n\n## Examples\n\n```rescript\nlet someNumbers = [1, 1, 4, 2, 3, 6, 3, 4, 2]\n\nlet greaterThan2UniqueAndSorted =\n someNumbers\n ->Belt.Array.keep(x => x > 2)\n // convert to and from set to make values unique\n ->Belt.Set.Int.fromArray\n ->Belt.Set.Int.toArray // output is already sorted\n\nJs.log2(\"result\", greaterThan2UniqueAndSorted)\n```\n\n## Specialized Collections\n\nFor collections types like set or map, Belt provides both a generic module as well as specialized, more efficient implementations for string and int keys.\n\nFor example, Belt has the following set modules:\n\n- [Belt.Set](belt/set)\n- [Belt.Set.Int](belt/set/int)\n- [Belt.Set.String](belt/set/string)\n\n## Implementation Details\n\n### Array access runtime safety\n\nOne common confusion comes from the way Belt handles array access. It differs from than the default standard library's.\n\n## Examples\n\n```rescript\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0] // a == \"a\"\nlet capitalA = Js.String.toUpperCase(a)\nlet k = letters[10] // Throws an exception! The 10th index doesn't exist.\n```\n\nBecause Belt avoids exceptions and returns `options` instead, this code behaves differently:\n\n## Examples\n\n```rescript\nopen Belt\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0] // a == Some(\"a\")\nlet captialA = Js.String.toUpperCase(a) // Type error! This code will not compile.\nlet k = letters[10] // k == None\n```\n\nAlthough we've fixed the problem where `k` throws an exception, we now have a type error when trying to capitalize `a`. There are a few things going on here:\n\n- Reason transforms array index access to the function `Array.get`. So `letters[0]` is the same as `Array.get(letters, 0)`.\n- The compiler uses whichever `Array` module is in scope. If you `open Belt`, then it uses `Belt.Array`.\n- `Belt.Array.get` returns values wrapped in options, so `letters[0] == Some(\"a\")`.\n\nFortunately, this is easy to fix:\n\n## Examples\n\n```rescript\nopen Belt\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0]\n\n// Use a switch statement:\nlet capitalA = switch a {\n| Some(a) => Some(Js.String.toUpperCase(a))\n| None => None\n}\n\nlet k = letters[10] // k == None\n```\n\nWith that little bit of tweaking, our code now compiles successfully and is 100% free of runtime errors\\!\n\n### A Special Encoding for Collection Safety\n\nWhen we create a collection library for a custom data type we need a way to provide a comparator function. Take Set for example, suppose its element type is a pair of ints, it needs a custom compare function that takes two tuples and returns their order. The Set could not just be typed as Set.t (int \\* int) , its customized compare function needs to manifest itself in the signature, otherwise, if the user creates another customized compare function, the two collection could mix which would result in runtime error.\n\nWe use a phantom type to solve the problem:\n\n## Examples\n\n```rescript\nmodule Comparable1 = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet1 = Belt.Set.make(~id=module(Comparable1))\n\nmodule Comparable2 = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet2 = Belt.Set.make(~id=module(Comparable2))\n```\n\nHere, the compiler would infer `mySet1` and `mySet2` having different type, so e.g. a `merge` operation that tries to merge these two sets will correctly fail.\n\n## Examples\n\n```rescript\nlet mySet1: t<(int, int), Comparable1.identity> = %todo\nlet mySet2: t<(int, int), Comparable2.identity> = %todo\n```\n\n`Comparable1.identity` and `Comparable2.identity` are not the same using our encoding scheme." - ], - "items": [] - }, - "belt/hashmap/string": { - "id": "Belt.HashMap.String", - "name": "String", - "docstrings": [ - "Specalized when key type is `string`, more efficient than the generic type" - ], - "items": [ - { - "id": "Belt.HashMap.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.HashMap.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'b>" - }, - { - "id": "Belt.HashMap.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t<'b>" - }, - { - "id": "Belt.HashMap.String.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'b> => unit" - }, - { - "id": "Belt.HashMap.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.HashMap.String.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`setDone(tbl, k, v)` if `k` does not exist, add the binding `k,v`, otherwise,\nupdate the old value with the new `v`" - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.HashMap.String.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.HashMap.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.HashMap.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'b>, key) => bool" - }, - { - "id": "Belt.HashMap.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.HashMap.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'b>, (key, 'b) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashMap.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'b>, (key, 'b) => unit) => unit" - }, - { - "id": "Belt.HashMap.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashMap.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c" - }, - { - "id": "Belt.HashMap.String.keepMapInPlaceU", - "kind": "value", - "name": "keepMapInPlaceU", - "docstrings": [], - "signature": "let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit", - "deprecated": "Use `keepMapInPlace` instead" - }, - { - "id": "Belt.HashMap.String.keepMapInPlace", - "kind": "value", - "name": "keepMapInPlace", - "docstrings": [], - "signature": "let keepMapInPlace: (t<'a>, (key, 'a) => option<'a>) => unit" - }, - { - "id": "Belt.HashMap.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.HashMap.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.HashMap.String.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.HashMap.String.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.HashMap.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.HashMap.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'a>, array<(key, 'a)>) => unit" - }, - { - "id": "Belt.HashMap.String.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t<'a> => array" - }, - { - "id": "Belt.HashMap.String.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t<'a> => unit" - } - ] - }, - "belt/hashmap/int": { - "id": "Belt.HashMap.Int", - "name": "Int", - "docstrings": [ - "Specalized when key type is `int`, more efficient than the generic type" - ], - "items": [ - { - "id": "Belt.HashMap.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.HashMap.Int.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'b>" - }, - { - "id": "Belt.HashMap.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t<'b>" - }, - { - "id": "Belt.HashMap.Int.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'b> => unit" - }, - { - "id": "Belt.HashMap.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.HashMap.Int.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`setDone(tbl, k, v)` if `k` does not exist, add the binding `k,v`, otherwise,\nupdate the old value with the new `v`" - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.HashMap.Int.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.HashMap.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.HashMap.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'b>, key) => bool" - }, - { - "id": "Belt.HashMap.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.HashMap.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'b>, (key, 'b) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashMap.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'b>, (key, 'b) => unit) => unit" - }, - { - "id": "Belt.HashMap.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashMap.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c" - }, - { - "id": "Belt.HashMap.Int.keepMapInPlaceU", - "kind": "value", - "name": "keepMapInPlaceU", - "docstrings": [], - "signature": "let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit", - "deprecated": "Use `keepMapInPlace` instead" - }, - { - "id": "Belt.HashMap.Int.keepMapInPlace", - "kind": "value", - "name": "keepMapInPlace", - "docstrings": [], - "signature": "let keepMapInPlace: (t<'a>, (key, 'a) => option<'a>) => unit" - }, - { - "id": "Belt.HashMap.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.HashMap.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.HashMap.Int.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.HashMap.Int.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.HashMap.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.HashMap.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'a>, array<(key, 'a)>) => unit" - }, - { - "id": "Belt.HashMap.Int.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t<'a> => array" - }, - { - "id": "Belt.HashMap.Int.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t<'a> => unit" - } - ] - }, - "belt/hashset/string": { - "id": "Belt.HashSet.String", - "name": "String", - "docstrings": [ - "Specalized when key type is `string`, more efficient than the generic type", - "This module is [`Belt.HashSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.HashSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.HashSet`]()" - ], - "items": [ - { - "id": "Belt.HashSet.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.HashSet.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Belt.HashSet.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t" - }, - { - "id": "Belt.HashSet.String.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Belt.HashSet.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.HashSet.String.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, key) => unit" - }, - { - "id": "Belt.HashSet.String.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.HashSet.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, key) => bool" - }, - { - "id": "Belt.HashSet.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, key) => unit" - }, - { - "id": "Belt.HashSet.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, key => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashSet.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, key => unit) => unit" - }, - { - "id": "Belt.HashSet.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'c, ('c, key) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashSet.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, 'c, ('c, key) => 'c) => 'c" - }, - { - "id": "Belt.HashSet.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.HashSet.String.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t => unit" - }, - { - "id": "Belt.HashSet.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.HashSet.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.HashSet.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.HashSet.String.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t => array" - } - ] - }, - "belt/hashset/int": { - "id": "Belt.HashSet.Int", - "name": "Int", - "docstrings": [ - "Specalized when key type is `int`, more efficient than the generic type", - "This module is [`Belt.HashSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.HashSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.HashSet`]()" - ], - "items": [ - { - "id": "Belt.HashSet.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.HashSet.Int.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Belt.HashSet.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t" - }, - { - "id": "Belt.HashSet.Int.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Belt.HashSet.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.HashSet.Int.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, key) => unit" - }, - { - "id": "Belt.HashSet.Int.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.HashSet.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, key) => bool" - }, - { - "id": "Belt.HashSet.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, key) => unit" - }, - { - "id": "Belt.HashSet.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, key => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashSet.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, key => unit) => unit" - }, - { - "id": "Belt.HashSet.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'c, ('c, key) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashSet.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, 'c, ('c, key) => 'c) => 'c" - }, - { - "id": "Belt.HashSet.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.HashSet.Int.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t => unit" - }, - { - "id": "Belt.HashSet.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.HashSet.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.HashSet.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.HashSet.Int.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t => array" - } - ] - }, - "belt/mutablemap/string": { - "id": "Belt.MutableMap.String", - "name": "String", - "docstrings": [], - "items": [ - { - "id": "Belt.MutableMap.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.MutableMap.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableMap.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableMap.String.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableMap.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a>, key) => bool" - }, - { - "id": "Belt.MutableMap.String.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.MutableMap.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m1, m2, cmp)`. First compare by size, if size is the same, compare by key,\nvalue pair" - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.MutableMap.String.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.MutableMap.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, cmp)`" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, (key, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableMap.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the key as\nfirst argument, and the associated value as second argument. The application \norder of `f` is in increasing order." - ], - "signature": "let forEach: (t<'a>, (key, 'a) => unit) => unit" - }, - { - "id": "Belt.MutableMap.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableMap.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`, where `k1 ... kN` are\nthe keys of all bindings in `m` (in increasing order), and `d1 ... dN` are the\nassociated data." - ], - "signature": "let reduce: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableMap.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableMap.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let every: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableMap.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let some: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableMap.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t<'a> => list<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order" - ], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.MutableMap.String.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.MutableMap.String.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.MutableMap.String.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.String.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.MutableMap.String.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, key, 'a) => 'a" - }, - { - "id": "Belt.MutableMap.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` do the in-place modification" - ], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.MutableMap.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'a>, array) => unit" - }, - { - "id": "Belt.MutableMap.String.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` do the in-place modification, return `m` for chaining. If `x` was\nalready bound in `m`, its previous binding disappears." - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.MutableMap.String.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'a>, key, option<'a> => option<'a>) => unit", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.MutableMap.String.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'a>, key, option<'a> => option<'a>) => unit" - }, - { - "id": "Belt.MutableMap.String.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableMap.String.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.MutableMap.String.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'a>, (key, 'a) => 'b) => t<'b>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.MutableMap.String.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'a>, (key, 'a) => 'b) => t<'b>" - } - ] - }, - "belt/mutablemap/int": { - "id": "Belt.MutableMap.Int", - "name": "Int", - "docstrings": [], - "items": [ - { - "id": "Belt.MutableMap.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.MutableMap.Int.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableMap.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableMap.Int.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableMap.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a>, key) => bool" - }, - { - "id": "Belt.MutableMap.Int.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.MutableMap.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m1, m2, cmp)`. First compare by size, if size is the same, compare by key,\nvalue pair" - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.MutableMap.Int.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.MutableMap.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, cmp)`" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, (key, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableMap.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the key as\nfirst argument, and the associated value as second argument. The application \norder of `f` is in increasing order." - ], - "signature": "let forEach: (t<'a>, (key, 'a) => unit) => unit" - }, - { - "id": "Belt.MutableMap.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableMap.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`, where `k1 ... kN` are\nthe keys of all bindings in `m` (in increasing order), and `d1 ... dN` are the\nassociated data." - ], - "signature": "let reduce: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableMap.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableMap.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let every: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableMap.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let some: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableMap.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t<'a> => list<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order" - ], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.MutableMap.Int.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.MutableMap.Int.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.MutableMap.Int.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.Int.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.MutableMap.Int.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, key, 'a) => 'a" - }, - { - "id": "Belt.MutableMap.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**Throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` do the in-place modification" - ], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.MutableMap.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'a>, array) => unit" - }, - { - "id": "Belt.MutableMap.Int.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` do the in-place modification, return `m` for chaining. If `x` was\nalready bound in `m`, its previous binding disappears." - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.MutableMap.Int.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'a>, key, option<'a> => option<'a>) => unit", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.MutableMap.Int.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'a>, key, option<'a> => option<'a>) => unit" - }, - { - "id": "Belt.MutableMap.Int.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableMap.Int.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.MutableMap.Int.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'a>, (key, 'a) => 'b) => t<'b>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.MutableMap.Int.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'a>, (key, 'a) => 'b) => t<'b>" - } - ] - }, - "belt/mutableset/string": { - "id": "Belt.MutableSet.String", - "name": "String", - "docstrings": [ - "Specialized when key type is `string`, more efficient than the generic type", - "This module is [`Belt.MutableSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.MutableSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.MutableSet`]()" - ], - "items": [ - { - "id": "Belt.MutableSet.String.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = string" - }, - { - "id": "Belt.MutableSet.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.MutableSet.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t" - }, - { - "id": "Belt.MutableSet.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.MutableSet.String.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.MutableSet.String.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.MutableSet.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.MutableSet.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.String.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.String.addCheck", - "kind": "value", - "name": "addCheck", - "docstrings": [], - "signature": "let addCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.String.removeCheck", - "kind": "value", - "name": "removeCheck", - "docstrings": [], - "signature": "let removeCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.String.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.MutableSet.String.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.MutableSet.String.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.MutableSet.String.subset", - "kind": "value", - "name": "subset", - "docstrings": [], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.MutableSet.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableSet.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.MutableSet.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableSet.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.MutableSet.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableSet.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`.\nOrder unspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableSet.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.String.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.MutableSet.String.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(s, p)` returns a fresh copy of the set of all elements in `s` that satisfy\npredicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.MutableSet.String.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.MutableSet.String.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(s, p)` returns a fresh copy pair of sets `(s1, s2)`, where `s1` is\nthe set of all the elements of `s` that satisfy the predicate `p`, and `s2` is\nthe set of all the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.MutableSet.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.MutableSet.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.MutableSet.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.MutableSet.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.MutableSet.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.MutableSet.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.MutableSet.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.MutableSet.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.MutableSet.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(s, key)` return a fresh copy of each" - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.MutableSet.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/mutableset/int": { - "id": "Belt.MutableSet.Int", - "name": "Int", - "docstrings": [ - "Specialized when key type is `int`, more efficient than the generic type", - "This module is [`Belt.MutableSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.MutableSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.MutableSet`]()" - ], - "items": [ - { - "id": "Belt.MutableSet.Int.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = int" - }, - { - "id": "Belt.MutableSet.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.MutableSet.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t" - }, - { - "id": "Belt.MutableSet.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.MutableSet.Int.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.MutableSet.Int.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.MutableSet.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.MutableSet.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.Int.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.Int.addCheck", - "kind": "value", - "name": "addCheck", - "docstrings": [], - "signature": "let addCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.Int.removeCheck", - "kind": "value", - "name": "removeCheck", - "docstrings": [], - "signature": "let removeCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.Int.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.MutableSet.Int.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.MutableSet.Int.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.MutableSet.Int.subset", - "kind": "value", - "name": "subset", - "docstrings": [], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.MutableSet.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableSet.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.MutableSet.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableSet.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.MutableSet.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableSet.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`.\nOrder unspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableSet.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.Int.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.MutableSet.Int.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(s, p)` returns a fresh copy of the set of all elements in `s` that satisfy\npredicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.MutableSet.Int.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.MutableSet.Int.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(s, p)` returns a fresh copy pair of sets `(s1, s2)`, where `s1` is\nthe set of all the elements of `s` that satisfy the predicate `p`, and `s2` is\nthe set of all the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.MutableSet.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.MutableSet.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.MutableSet.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "In increasing order with respect" - ], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.MutableSet.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.MutableSet.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.MutableSet.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.MutableSet.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.MutableSet.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.MutableSet.Int.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(s, key)` return a fresh copy of each" - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.MutableSet.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/map/dict": { - "id": "Belt.Map.Dict", - "name": "Dict", - "docstrings": [ - "This module separates identity from data, it is a bit more verbose but\nslightly more efficient due to the fact that there is no need to pack\nidentity and data back after each operation.\n\n**_Advanced usage only_**" - ], - "items": [ - { - "id": "Belt.Map.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'key, 'value, 'id>" - }, - { - "id": "Belt.Map.Dict.cmp", - "kind": "type", - "name": "cmp", - "docstrings": [], - "signature": "type cmp<'key, 'id> = Belt_Id.cmp<'key, 'id>" - }, - { - "id": "Belt.Map.Dict.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.Dict.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'k, 'v, 'id> => bool" - }, - { - "id": "Belt.Map.Dict.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => bool" - }, - { - "id": "Belt.Map.Dict.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (\n t<'k, 'v, 'id>,\n t<'k, 'v, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~vcmp: ('v, 'v) => int,\n) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.Dict.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (\n t<'k, 'v, 'id>,\n t<'k, 'v, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~vcmp: ('v, 'v) => int,\n) => int" - }, - { - "id": "Belt.Map.Dict.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (\n t<'k, 'a, 'id>,\n t<'k, 'a, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~veq: ('a, 'a) => bool,\n) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.Dict.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, cmp)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `cmp` is the\nequality predicate used to compare the data associated with the keys." - ], - "signature": "let eq: (\n t<'k, 'a, 'id>,\n t<'k, 'a, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~veq: ('a, 'a) => bool,\n) => bool" - }, - { - "id": "Belt.Map.Dict.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.Dict.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`findFirstBy(m, p)` uses function `f` to find the first key value pair to\nmatch predicate `p`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Map.Dict.fromArray([(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")], ~cmp=IntCmp.cmp)\n\nBelt.Map.Dict.findFirstBy(s0, (k, _) => k == 4) == Some((4, \"4\"))\n```" - ], - "signature": "let findFirstBy: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>" - }, - { - "id": "Belt.Map.Dict.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.Dict.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the\nkey as first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys." - ], - "signature": "let forEach: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit" - }, - { - "id": "Belt.Map.Dict.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.Dict.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `f(kN, dN ... f(k1, d1, a)...)`, where `k1 ... kN` \nare the keys of all bindings in `m` (in increasing order), and `d1 ... dN` \nare the associated data." - ], - "signature": "let reduce: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b" - }, - { - "id": "Belt.Map.Dict.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.Dict.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let every: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.Map.Dict.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.Dict.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the\npredicate `p`. Order unspecified" - ], - "signature": "let some: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.Map.Dict.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'k, 'a, 'id> => int" - }, - { - "id": "Belt.Map.Dict.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'k, 'a, 'id> => list<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'k, 'a, 'id> => array<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: (array<('k, 'a)>, ~cmp: cmp<'k, 'id>) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.Map.Dict.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'k, 'a, 'id> => array<'k>" - }, - { - "id": "Belt.Map.Dict.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'k, 'a, 'id> => array<'a>" - }, - { - "id": "Belt.Map.Dict.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.Dict.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.Dict.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => option<'a>" - }, - { - "id": "Belt.Map.Dict.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'k, 'a, 'id>, 'k, 'a, ~cmp: cmp<'k, 'id>) => 'a" - }, - { - "id": "Belt.Map.Dict.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => 'a" - }, - { - "id": "Belt.Map.Dict.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => 'a" - }, - { - "id": "Belt.Map.Dict.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [], - "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit" - }, - { - "id": "Belt.Map.Dict.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` returns a map containing the same bindings as `m`, except\nfor `x` which is unbound in the returned map." - ], - "signature": "let remove: (t<'a, 'b, 'id>, 'a, ~cmp: cmp<'a, 'id>) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (\n t<'a, 'b, 'id>,\n array<'a>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as `m`, plus a\nbinding of `x` to `y`. If `x` was already bound in `m`, its previous\nbinding disappears." - ], - "signature": "let set: (\n t<'a, 'b, 'id>,\n 'a,\n 'b,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (\n t<'a, 'b, 'id>,\n 'a,\n option<'b> => option<'b>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.Dict.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (\n t<'a, 'b, 'id>,\n 'a,\n option<'b> => option<'b>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'a, 'b, 'id>,\n t<'a, 'c, 'id>,\n ('a, option<'b>, option<'c>) => option<'d>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'd, 'id>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.Dict.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'a, 'b, 'id>,\n t<'a, 'c, 'id>,\n ('a, option<'b>, option<'c>) => option<'d>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'd, 'id>" - }, - { - "id": "Belt.Map.Dict.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (\n t<'a, 'b, 'id>,\n array<('a, 'b)>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => t<'k, 'a, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.Dict.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in `m` that satisfy\npredicate `p`." - ], - "signature": "let keep: (t<'k, 'a, 'id>, ('k, 'a) => bool) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.Map.Dict.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'k, 'a, 'id>,\n ('k, 'a) => bool,\n) => (t<'k, 'a, 'id>, t<'k, 'a, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.Dict.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains\nall the bindings of `s` that satisfy the predicate `p`, and `m2` is the map\nwith all the bindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (\n t<'k, 'a, 'id>,\n ('k, 'a) => bool,\n) => (t<'k, 'a, 'id>, t<'k, 'a, 'id>)" - }, - { - "id": "Belt.Map.Dict.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with\nall the bindings of `m` whose key is strictly less than `x`; `r` is the map\nwith all the bindings of `m` whose key is strictly greater than `x`; `data`\nis `None` if `m` contains no binding for `x`, or `Some(v)` if `m` binds `v`\nto `x`." - ], - "signature": "let split: (\n t<'a, 'b, 'id>,\n 'a,\n ~cmp: cmp<'a, 'id>,\n) => ((t<'a, 'b, 'id>, t<'a, 'b, 'id>), option<'b>)" - }, - { - "id": "Belt.Map.Dict.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.Dict.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated\nvalue `a` of all bindings of `m` has been replaced by the result of the\napplication of `f` to `a`. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let map: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.Dict.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>" - } - ] - }, - "belt/map/string": { - "id": "Belt.Map.String", - "name": "String", - "docstrings": [], - "items": [ - { - "id": "Belt.Map.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.Map.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of maps from type `key` to type `'value`." - ], - "signature": "type t<'value>" - }, - { - "id": "Belt.Map.String.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t<'v>" - }, - { - "id": "Belt.Map.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'v> => bool" - }, - { - "id": "Belt.Map.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'v>, key) => bool" - }, - { - "id": "Belt.Map.String.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'v>, t<'v>, ('v, 'v) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t<'v>, t<'v>, ('v, 'v) => int) => int" - }, - { - "id": "Belt.Map.String.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'v>, t<'v>, ('v, 'v) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2)` tests whether the maps `m1` and `m2` are\nequal, that is, contain equal keys and associate them with\nequal data." - ], - "signature": "let eq: (t<'v>, t<'v>, ('v, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.String.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.String.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`findFirstBy(m, p)` uses funcion `f` to find the first key value pair\nto match predicate `p`.\n\n## Examples\n\n```rescript\nlet mapString = Belt.Map.String.fromArray([(\"1\", \"one\"), (\"2\", \"two\"), (\"3\", \"three\")])\n\nmapString->Belt.Map.String.findFirstBy((k, v) => k == \"1\" && v == \"one\") == Some(\"1\", \"one\")\n```" - ], - "signature": "let findFirstBy: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>" - }, - { - "id": "Belt.Map.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'v>, (key, 'v) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`.\n`f` receives the key as first argument, and the associated value\nas second argument. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let forEach: (t<'v>, (key, 'v) => unit) => unit" - }, - { - "id": "Belt.Map.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`,\nwhere `k1 ... kN` are the keys of all bindings in `m`\n(in increasing order), and `d1 ... dN` are the associated data." - ], - "signature": "let reduce: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2" - }, - { - "id": "Belt.Map.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nOrder unspecified" - ], - "signature": "let every: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let some: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'v> => int" - }, - { - "id": "Belt.Map.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'v> => list<(key, 'v)>" - }, - { - "id": "Belt.Map.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'v> => array<(key, 'v)>" - }, - { - "id": "Belt.Map.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'v)> => t<'v>" - }, - { - "id": "Belt.Map.String.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'v> => array" - }, - { - "id": "Belt.Map.String.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'v> => array<'v>" - }, - { - "id": "Belt.Map.String.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.Map.String.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.Map.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'v>, key) => option<'v>" - }, - { - "id": "Belt.Map.String.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'v>, key, 'v) => 'v" - }, - { - "id": "Belt.Map.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.Map.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove m x` returns a map containing the same bindings as\n `m`, except for `x` which is unbound in the returned map." - ], - "signature": "let remove: (t<'v>, key) => t<'v>" - }, - { - "id": "Belt.Map.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'v>, array) => t<'v>" - }, - { - "id": "Belt.Map.String.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as\n`m`, plus a binding of `x` to `y`. If `x` was already bound\nin `m`, its previous binding disappears." - ], - "signature": "let set: (t<'v>, key, 'v) => t<'v>" - }, - { - "id": "Belt.Map.String.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'v>, key, option<'v> => option<'v>) => t<'v>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.String.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'v>, key, option<'v> => option<'v>) => t<'v>" - }, - { - "id": "Belt.Map.String.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.String.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>" - }, - { - "id": "Belt.Map.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'v>, array<(key, 'v)>) => t<'v>" - }, - { - "id": "Belt.Map.String.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'v>, (key, 'v) => bool) => t<'v>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.String.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in `m` that satisfy predicate\n`p`." - ], - "signature": "let keep: (t<'v>, (key, 'v) => bool) => t<'v>" - }, - { - "id": "Belt.Map.String.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.String.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains all the\nbindings of `s` that satisfy the predicate `p`, and `m2` is the map with all the\nbindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)" - }, - { - "id": "Belt.Map.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with all the\nbindings of `m` whose key is strictly less than `x`; `r` is the map with all the\nbindings of `m` whose key is strictly greater than `x`; `data` is `None` if `m`\ncontains no binding for `x`, or `Some(v)` if `m` binds `v` to `x`." - ], - "signature": "let split: (key, t<'v>) => (t<'v>, option<'v>, t<'v>)" - }, - { - "id": "Belt.Map.String.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'v>, 'v => 'v2) => t<'v2>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.String.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'v>, 'v => 'v2) => t<'v2>" - }, - { - "id": "Belt.Map.String.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'v>, (key, 'v) => 'v2) => t<'v2>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.String.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'v>, (key, 'v) => 'v2) => t<'v2>" - } - ] - }, - "belt/map/int": { - "id": "Belt.Map.Int", - "name": "Int", - "docstrings": [ - "## Examples\n\n```rescript\ntype t<'key, 'value, 'identity>\ntype id<'key, 'id> = Belt_Id.comparable<'key, 'id>\n```" - ], - "items": [ - { - "id": "Belt.Map.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.Map.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of maps from type `key` to type `'value`." - ], - "signature": "type t<'value>" - }, - { - "id": "Belt.Map.Int.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t<'v>" - }, - { - "id": "Belt.Map.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'v> => bool" - }, - { - "id": "Belt.Map.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'v>, key) => bool" - }, - { - "id": "Belt.Map.Int.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'v>, t<'v>, ('v, 'v) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t<'v>, t<'v>, ('v, 'v) => int) => int" - }, - { - "id": "Belt.Map.Int.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'v>, t<'v>, ('v, 'v) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2)` tests whether the maps `m1` and `m2` are\nequal, that is, contain equal keys and associate them with\nequal data." - ], - "signature": "let eq: (t<'v>, t<'v>, ('v, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.Int.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.Int.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`findFirstBy(m, p)` uses funcion `f` to find the first key value pair\nto match predicate `p`.\n\n## Examples\n\n```rescript\nlet mapInt = Belt.Map.Int.fromArray([(1, \"one\"), (2, \"two\"), (3, \"three\")])\n\nmapInt->Belt.Map.Int.findFirstBy((k, v) => k == 1 && v == \"one\") == Some(1, \"one\")\n```" - ], - "signature": "let findFirstBy: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'v>, (key, 'v) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`.\n`f` receives the key as first argument, and the associated value\nas second argument. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let forEach: (t<'v>, (key, 'v) => unit) => unit" - }, - { - "id": "Belt.Map.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`,\nwhere `k1 ... kN` are the keys of all bindings in `m`\n(in increasing order), and `d1 ... dN` are the associated data." - ], - "signature": "let reduce: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2" - }, - { - "id": "Belt.Map.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nOrder unspecified" - ], - "signature": "let every: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let some: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'v> => int" - }, - { - "id": "Belt.Map.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'v> => list<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'v> => array<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'v)> => t<'v>" - }, - { - "id": "Belt.Map.Int.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'v> => array" - }, - { - "id": "Belt.Map.Int.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'v> => array<'v>" - }, - { - "id": "Belt.Map.Int.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.Map.Int.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.Map.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'v>, key) => option<'v>" - }, - { - "id": "Belt.Map.Int.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'v>, key, 'v) => 'v" - }, - { - "id": "Belt.Map.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.Map.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove m x` returns a map containing the same bindings as\n `m`, except for `x` which is unbound in the returned map." - ], - "signature": "let remove: (t<'v>, key) => t<'v>" - }, - { - "id": "Belt.Map.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'v>, array) => t<'v>" - }, - { - "id": "Belt.Map.Int.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as\n`m`, plus a binding of `x` to `y`. If `x` was already bound\nin `m`, its previous binding disappears." - ], - "signature": "let set: (t<'v>, key, 'v) => t<'v>" - }, - { - "id": "Belt.Map.Int.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'v>, key, option<'v> => option<'v>) => t<'v>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.Int.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'v>, key, option<'v> => option<'v>) => t<'v>" - }, - { - "id": "Belt.Map.Int.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.Int.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>" - }, - { - "id": "Belt.Map.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'v>, array<(key, 'v)>) => t<'v>" - }, - { - "id": "Belt.Map.Int.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'v>, (key, 'v) => bool) => t<'v>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.Int.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in `m` that satisfy predicate\n`p`." - ], - "signature": "let keep: (t<'v>, (key, 'v) => bool) => t<'v>" - }, - { - "id": "Belt.Map.Int.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.Int.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains all the\nbindings of `s` that satisfy the predicate `p`, and `m2` is the map with all the\nbindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)" - }, - { - "id": "Belt.Map.Int.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with all the\nbindings of `m` whose key is strictly less than `x`; `r` is the map with all the\nbindings of `m` whose key is strictly greater than `x`; `data` is `None` if `m`\ncontains no binding for `x`, or `Some(v)` if `m` binds `v` to `x`." - ], - "signature": "let split: (key, t<'v>) => (t<'v>, option<'v>, t<'v>)" - }, - { - "id": "Belt.Map.Int.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'v>, 'v => 'v2) => t<'v2>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.Int.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'v>, 'v => 'v2) => t<'v2>" - }, - { - "id": "Belt.Map.Int.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'v>, (key, 'v) => 'v2) => t<'v2>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.Int.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'v>, (key, 'v) => 'v2) => t<'v2>" - } - ] - }, - "belt/set/dict": { - "id": "Belt.Set.Dict", - "name": "Dict", - "docstrings": [ - "This module separates identity from data, it is a bit more verbose but slightly\nmore efficient due to the fact that there is no need to pack identity and data back\nafter each operation", - "This module separates identity from data. It is a bit more verbose but slightly\nmore efficient due to the fact that there is no need to pack identity and data\nback after each operation." - ], - "items": [ - { - "id": "Belt.Set.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'value, 'identity>" - }, - { - "id": "Belt.Set.Dict.cmp", - "kind": "type", - "name": "cmp", - "docstrings": [ - "Type of compare function." - ], - "signature": "type cmp<'value, 'id> = Belt_Id.cmp<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "## Examples\n\n```rescript\nlet s0 = Belt.Set.Dict.empty\n```" - ], - "signature": "let empty: t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 3, 2, 4], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let fromArray: (array<'value>, ~cmp: cmp<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [ - "The same as [fromArray][#fromarray] except it is after assuming the input array\nis already sorted." - ], - "signature": "let fromSortedArrayUnsafe: array<'value> => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.Set.Dict.fromArray([], ~cmp=IntCmp.cmp)\nlet notEmpty = Belt.Set.Dict.fromArray([1], ~cmp=IntCmp.cmp)\n\nBelt.Set.Dict.isEmpty(empty) == true\nBelt.Set.Dict.isEmpty(notEmpty) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.Set.Dict.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if an element exists in the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.fromArray([1, 4, 2, 5], ~cmp=IntCmp.cmp)\n\nset->Belt.Set.Dict.has(3, ~cmp=IntCmp.cmp) == false\nset->Belt.Set.Dict.has(1, ~cmp=IntCmp.cmp) == true\n```" - ], - "signature": "let has: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => bool" - }, - { - "id": "Belt.Set.Dict.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = s0->Belt.Set.Dict.add(1, ~cmp=IntCmp.cmp)\nlet s2 = s1->Belt.Set.Dict.add(2, ~cmp=IntCmp.cmp)\nlet s3 = s2->Belt.Set.Dict.add(2, ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.toArray == []\ns1->Belt.Set.Dict.toArray == [1]\ns2->Belt.Set.Dict.toArray == [1, 2]\ns3->Belt.Set.Dict.toArray == [1, 2]\ns2 == s3\n```" - ], - "signature": "let add: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "Adds each element of array to set. Unlike [add](#add), the reference of return value might be changed even if all values in array already exist in set\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.empty\n\nlet newSet = set->Belt.Set.Dict.mergeMany([5, 4, 3, 2, 1], ~cmp=IntCmp.cmp)\nnewSet->Belt.Set.Dict.toArray == [1, 2, 3, 4, 5]\n```" - ], - "signature": "let mergeMany: (\n t<'value, 'id>,\n array<'value>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([2, 3, 1, 4, 5], ~cmp=IntCmp.cmp)\nlet s1 = s0->Belt.Set.Dict.remove(1, ~cmp=IntCmp.cmp)\nlet s2 = s1->Belt.Set.Dict.remove(3, ~cmp=IntCmp.cmp)\nlet s3 = s2->Belt.Set.Dict.remove(3, ~cmp=IntCmp.cmp)\n\ns1->Belt.Set.Dict.toArray == [2, 3, 4, 5]\ns2->Belt.Set.Dict.toArray == [2, 4, 5]\ns2 == s3\n```" - ], - "signature": "let remove: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "Removes each element of array from set. Unlike [remove](#remove), the reference of return value might be changed even if any values in array not existed in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.fromArray([1, 2, 3, 4], ~cmp=IntCmp.cmp)\n\nlet newSet = set->Belt.Set.Dict.removeMany([5, 4, 3, 2, 1], ~cmp=IntCmp.cmp)\nnewSet->Belt.Set.Dict.toArray == []\n```" - ], - "signature": "let removeMany: (\n t<'value, 'id>,\n array<'value>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet union = Belt.Set.Dict.union(s0, s1, ~cmp=IntCmp.cmp)\nunion->Belt.Set.Dict.toArray == [1, 2, 3, 4, 5, 6]\n```" - ], - "signature": "let union: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet intersect = Belt.Set.Dict.intersect(s0, s1, ~cmp=IntCmp.cmp)\nintersect->Belt.Set.Dict.toArray == [2, 3, 5]\n```" - ], - "signature": "let intersect: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.diff", - "kind": "value", - "name": "diff", - "docstrings": [ - "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\n\nlet diff1 = Belt.Set.Dict.diff(s0, s1, ~cmp=IntCmp.cmp)\nlet diff2 = Belt.Set.Dict.diff(s1, s0, ~cmp=IntCmp.cmp)\n\ndiff1->Belt.Set.Dict.toArray == [6]\ndiff2->Belt.Set.Dict.toArray == [1, 4]\n```" - ], - "signature": "let diff: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet s2 = Belt.Set.Dict.intersect(s0, s1, ~cmp=IntCmp.cmp)\nBelt.Set.Dict.subset(s2, s0, ~cmp=IntCmp.cmp) == true\nBelt.Set.Dict.subset(s2, s1, ~cmp=IntCmp.cmp) == true\nBelt.Set.Dict.subset(s1, s0, ~cmp=IntCmp.cmp) == false\n```" - ], - "signature": "let subset: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => bool" - }, - { - "id": "Belt.Set.Dict.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets. It compares size first and then iterates over each element following the\norder of elements." - ], - "signature": "let cmp: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => int" - }, - { - "id": "Belt.Set.Dict.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 5], ~cmp=IntCmp.cmp)\n\nBelt.Set.Dict.eq(s0, s1, ~cmp=IntCmp.cmp) == true\n```" - ], - "signature": "let eq: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => bool" - }, - { - "id": "Belt.Set.Dict.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as [forEach](##forEach) but takes uncurried functon." - ], - "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.Dict.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet acc = ref(list{})\ns0->Belt.Set.Dict.forEach(x => acc := Belt.List.add(acc.contents, x))\nacc.contents == list{6, 5, 3, 2}\n```" - ], - "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit" - }, - { - "id": "Belt.Set.Dict.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.Dict.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) == list{6, 5, 3, 2}\n```" - ], - "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a" - }, - { - "id": "Belt.Set.Dict.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.Dict.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.Dict.fromArray([2, 4, 6, 8], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.every(isEven) == true\n```" - ], - "signature": "let every: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.Dict.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.Dict.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 4, 6, 8], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.some(isOdd) == true\n```" - ], - "signature": "let some: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.Dict.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.Dict.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\nlet s1 = s0->Belt.Set.Dict.keep(isEven)\n\ns1->Belt.Set.Dict.toArray == [2, 4]\n```" - ], - "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.Dict.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "Returns a pair of sets, where first is the set of all the elements of set that satisfy the predicate, and second is the set of all the elements of set that do not satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\nlet (s1, s2) = s0->Belt.Set.Dict.partition(isOdd)\n\ns1->Belt.Set.Dict.toArray == [1, 3, 5]\ns2->Belt.Set.Dict.toArray == [2, 4]\n```" - ], - "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)" - }, - { - "id": "Belt.Set.Dict.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.size == 4\n```" - ], - "signature": "let size: t<'value, 'id> => int" - }, - { - "id": "Belt.Set.Dict.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toList == list{1, 2, 3, 5}\n```" - ], - "signature": "let toList: t<'value, 'id> => list<'value>" - }, - { - "id": "Belt.Set.Dict.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toArray == [1, 2, 3, 5]\n```" - ], - "signature": "let toArray: t<'value, 'id> => array<'value>" - }, - { - "id": "Belt.Set.Dict.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.minimum == None\ns1->Belt.Set.Dict.minimum == Some(1)\n```" - ], - "signature": "let minimum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.Dict.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.maximum == None\ns1->Belt.Set.Dict.maximum == Some(5)\n```" - ], - "signature": "let maximum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the reference of the value which is equivalent to value using the comparator\nspecifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.get(3, ~cmp=IntCmp.cmp) == Some(3)\ns0->Belt.Set.Dict.get(20, ~cmp=IntCmp.cmp) == None\n```" - ], - "signature": "let get: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => option<'value>" - }, - { - "id": "Belt.Set.Dict.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getExn: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => 'value" - }, - { - "id": "Belt.Set.Dict.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getOrThrow: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => 'value" - }, - { - "id": "Belt.Set.Dict.split", - "kind": "value", - "name": "split", - "docstrings": [ - "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\n\nlet ((smaller, larger), present) = s0->Belt.Set.Dict.split(3, ~cmp=IntCmp.cmp)\n\npresent == true\nsmaller->Belt.Set.Dict.toArray == [1, 2]\nlarger->Belt.Set.Dict.toArray == [4, 5]\n```" - ], - "signature": "let split: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)" - }, - { - "id": "Belt.Set.Dict.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b> => unit" - } - ] - }, - "belt/set/string": { - "id": "Belt.Set.String", - "name": "String", - "docstrings": [ - "Specialized when value type is `string`, more efficient than the generic type,\nits compare behavior is fixed using the built-in comparison", - "This module is [`Belt.Set`]() specialized with value type to be a primitive type.\nIt is more efficient in general, the API is the same with [`Belt_Set`]() except its value type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.Set`]()" - ], - "items": [ - { - "id": "Belt.Set.String.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = string" - }, - { - "id": "Belt.Set.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.Set.String.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t" - }, - { - "id": "Belt.Set.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.Set.String.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.Set.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.Set.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.Set.String.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(s, x)` If `x` was already in `s`, `s` is returned unchanged." - ], - "signature": "let add: (t, value) => t" - }, - { - "id": "Belt.Set.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => t" - }, - { - "id": "Belt.Set.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` If `x` was not in `m`, `m` is returned reference unchanged." - ], - "signature": "let remove: (t, value) => t" - }, - { - "id": "Belt.Set.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => t" - }, - { - "id": "Belt.Set.String.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.Set.String.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.Set.String.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.Set.String.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "`subset(s1, s2)` tests whether the set `s1` is a subset of the set `s2`." - ], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.Set.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets." - ], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.Set.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(s1, s2)` tests whether the sets `s1` and `s2` are equal, that is, contain\nequal elements." - ], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.Set.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(s, f)` applies `f` in turn to all elements of `s`. In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.Set.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.Set.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`. Order\nunspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.String.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.String.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(p, s)` returns the set of all elements in `s` that satisfy predicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.Set.String.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.String.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(p, s)` returns a pair of sets `(s1, s2)`, where `s1` is the set of\nall the elements of `s` that satisfy the predicate `p`, and `s2` is the set of\nall the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.Set.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.Set.String.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.Set.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.Set.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.Set.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.Set.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.Set.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.Set.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.Set.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, s)` returns a triple `(l, present, r)`, where `l` is the set of\nelements of `s` that are strictly less than `x`;`r` is the set of elements of\n`s` that are strictly greater than `x`; `present` is `false` if `s` contains no\nelement equal to `x`, or `true` if `s` contains an element equal to `x`." - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.Set.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/set/int": { - "id": "Belt.Set.Int", - "name": "Int", - "docstrings": [ - "Specialized when value type is `int`, more efficient than the generic type, its\ncompare behavior is fixed using the built-in comparison", - "This module is [`Belt.Set`]() specialized with value type to be a primitive type.\nIt is more efficient in general, the API is the same with [`Belt_Set`]() except its value type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.Set`]()" - ], - "items": [ - { - "id": "Belt.Set.Int.value", - "kind": "type", - "name": "value", - "docstrings": [ - "The type of the set elements." - ], - "signature": "type value = int" - }, - { - "id": "Belt.Set.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of sets." - ], - "signature": "type t" - }, - { - "id": "Belt.Set.Int.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t" - }, - { - "id": "Belt.Set.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.Set.Int.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.Set.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.Set.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.Set.Int.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(s, x)` If `x` was already in `s`, `s` is returned unchanged." - ], - "signature": "let add: (t, value) => t" - }, - { - "id": "Belt.Set.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => t" - }, - { - "id": "Belt.Set.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` If `x` was not in `m`, `m` is returned reference unchanged." - ], - "signature": "let remove: (t, value) => t" - }, - { - "id": "Belt.Set.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => t" - }, - { - "id": "Belt.Set.Int.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.Set.Int.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.Set.Int.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.Set.Int.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "`subset(s1, s2)` tests whether the set `s1` is a subset of the set `s2`." - ], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.Set.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets." - ], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.Set.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(s1, s2)` tests whether the sets `s1` and `s2` are equal, that is, contain\nequal elements." - ], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.Set.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(s, f)` applies `f` in turn to all elements of `s`. In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.Set.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Iterate in increasing order." - ], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.Set.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`. Order\nunspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.Int.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.Int.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(p, s)` returns the set of all elements in `s` that satisfy predicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.Set.Int.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.Int.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(p, s)` returns a pair of sets `(s1, s2)`, where `s1` is the set of\nall the elements of `s` that satisfy the predicate `p`, and `s2` is the set of\nall the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.Set.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.Set.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order" - ], - "signature": "let toList: t => list" - }, - { - "id": "Belt.Set.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.Set.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.Set.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.Set.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.Set.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.Set.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.Set.Int.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, s)` returns a triple `(l, present, r)`, where `l` is the set of\nelements of `s` that are strictly less than `x`;`r` is the set of elements of\n`s` that are strictly greater than `x`; `present` is `false` if `s` contains no\nelement equal to `x`, or `true` if `s` contains an element equal to `x`." - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.Set.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/sortarray/string": { - "id": "Belt.SortArray.String", - "name": "String", - "docstrings": [ - "Specalized when key type is `string`, more efficient than the generic type", - "This is a specialized module for [`Belt_SortArray`](), the docs in that module also\napplies here, except the comparator is fixed and inlined" - ], - "items": [ - { - "id": "Belt.SortArray.String.element", - "kind": "type", - "name": "element", - "docstrings": [], - "signature": "type element = string" - }, - { - "id": "Belt.SortArray.String.strictlySortedLength", - "kind": "value", - "name": "strictlySortedLength", - "docstrings": [ - "The same as [`Belt_SortArray.strictlySortedLength`]() except the comparator is fixed\n\n**return** `+n` means increasing order `-n` means negative order" - ], - "signature": "let strictlySortedLength: array => int" - }, - { - "id": "Belt.SortArray.String.isSorted", - "kind": "value", - "name": "isSorted", - "docstrings": [ - "`sorted(xs)` return true if `xs` is in non strict increasing order" - ], - "signature": "let isSorted: array => bool" - }, - { - "id": "Belt.SortArray.String.stableSortInPlace", - "kind": "value", - "name": "stableSortInPlace", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortInPlaceBy`]() except the comparator is fixed" - ], - "signature": "let stableSortInPlace: array => unit" - }, - { - "id": "Belt.SortArray.String.stableSort", - "kind": "value", - "name": "stableSort", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortBy`]() except the comparator is fixed" - ], - "signature": "let stableSort: array => array" - }, - { - "id": "Belt.SortArray.String.binarySearch", - "kind": "value", - "name": "binarySearch", - "docstrings": [ - "If value is not found and value is less than one or more elements in array,\nthe negative number returned is the bitwise complement of the index of the first element\nthat is larger than value.\n\nIf value is not found and value is greater than all elements in array,\nthe negative number returned is the bitwise complement of\n(the index of the last element plus 1)\n\nfor example, if `key` is smaller than all elements return `-1` since `lnot (-1) = 0`\nif `key` is larger than all elements return `- (len + 1)` since `lnot (-(len+1)) = len`" - ], - "signature": "let binarySearch: (array, element) => int" - }, - { - "id": "Belt.SortArray.String.union", - "kind": "value", - "name": "union", - "docstrings": [ - "`union(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp)` assume\n`src` and `src2` is strictly sorted. for equivalent elements, it is picked from\n`src` also assume that `dst` is large enough to store all elements" - ], - "signature": "let union: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.String.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.String.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - } - ] - }, - "belt/sortarray/int": { - "id": "Belt.SortArray.Int", - "name": "Int", - "docstrings": [ - "Specalized when key type is `int`, more efficient than the generic type", - "This is a specialized module for [`Belt_SortArray`](), the docs in that module also\napplies here, except the comparator is fixed and inlined" - ], - "items": [ - { - "id": "Belt.SortArray.Int.element", - "kind": "type", - "name": "element", - "docstrings": [], - "signature": "type element = int" - }, - { - "id": "Belt.SortArray.Int.strictlySortedLength", - "kind": "value", - "name": "strictlySortedLength", - "docstrings": [ - "The same as [`Belt_SortArray.strictlySortedLength`]() except the comparator is fixed\n\n**return** `+n` means increasing order `-n` means negative order" - ], - "signature": "let strictlySortedLength: array => int" - }, - { - "id": "Belt.SortArray.Int.isSorted", - "kind": "value", - "name": "isSorted", - "docstrings": [ - "`sorted(xs)` return true if `xs` is in non strict increasing order" - ], - "signature": "let isSorted: array => bool" - }, - { - "id": "Belt.SortArray.Int.stableSortInPlace", - "kind": "value", - "name": "stableSortInPlace", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortInPlaceBy`]() except the comparator is fixed" - ], - "signature": "let stableSortInPlace: array => unit" - }, - { - "id": "Belt.SortArray.Int.stableSort", - "kind": "value", - "name": "stableSort", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortBy`]() except the comparator is fixed" - ], - "signature": "let stableSort: array => array" - }, - { - "id": "Belt.SortArray.Int.binarySearch", - "kind": "value", - "name": "binarySearch", - "docstrings": [ - "If value is not found and value is less than one or more elements in array,\nthe negative number returned is the bitwise complement of the index of the first element\nthat is larger than value.\n\nIf value is not found and value is greater than all elements in array,\nthe negative number returned is the bitwise complement of\n(the index of the last element plus 1)\n\nfor example, if `key` is smaller than all elements return `-1` since `lnot (-1) = 0`\nif `key` is larger than all elements return `- (len + 1)` since `lnot (-(len+1)) = len`" - ], - "signature": "let binarySearch: (array, element) => int" - }, - { - "id": "Belt.SortArray.Int.union", - "kind": "value", - "name": "union", - "docstrings": [ - "`union(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp)` assume\n`src` and `src2` is strictly sorted. for equivalent elements, it is picked from\n`src` also assume that `dst` is large enough to store all elements" - ], - "signature": "let union: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.Int.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.Int.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - } - ] - }, - "belt/id/makehashable": { - "id": "Belt.Id.MakeHashable", - "name": "MakeHashable", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeHashable.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeHashable.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeHashable.hash", - "kind": "value", - "name": "hash", - "docstrings": [], - "signature": "let hash: hash" - }, - { - "id": "Belt.Id.MakeHashable.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: eq" - } - ] - }, - "belt/id/makehashableu": { - "id": "Belt.Id.MakeHashableU", - "name": "MakeHashableU", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeHashableU.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeHashableU.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeHashableU.hash", - "kind": "value", - "name": "hash", - "docstrings": [], - "signature": "let hash: hash" - }, - { - "id": "Belt.Id.MakeHashableU.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: eq" - } - ] - }, - "belt/id/makecomparable": { - "id": "Belt.Id.MakeComparable", - "name": "MakeComparable", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeComparable.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeComparable.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeComparable.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: cmp" - } - ] - }, - "belt/id/makecomparableu": { - "id": "Belt.Id.MakeComparableU", - "name": "MakeComparableU", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeComparableU.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeComparableU.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeComparableU.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: cmp" - } - ] - }, - "belt/float": { - "id": "Belt.Float", - "name": "Float", - "docstrings": [ - "[`Belt.Float`]()\n\n Utilities for Float.", - "This module includes convenience methods for handling `float` types." - ], - "items": [ - { - "id": "Belt.Float.toInt", - "kind": "value", - "name": "toInt", - "docstrings": [ - "Converts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nBelt.Float.toInt(1.0) == 1\n```" - ], - "signature": "let toInt: float => int" - }, - { - "id": "Belt.Float.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "Converts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nBelt.Float.fromInt(1) == 1.0\n```" - ], - "signature": "let fromInt: int => float" - }, - { - "id": "Belt.Float.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Converts a given `string` to a `float`. Returns `Some(float)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nBelt.Float.fromString(\"1.0\") == Some(1.0)\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Belt.Float.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts a given `float` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nBelt.Float.toString(1.0) == \"1\"\n```" - ], - "signature": "let toString: float => string" - }, - { - "id": "Belt.Float.+", - "kind": "value", - "name": "+", - "docstrings": [ - "Addition of two `float` values.\nCan be opened in a module to avoid dot-notation (`+.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n2.0 + 2.0 == 4.0\n```" - ], - "signature": "let +: (float, float) => float" - }, - { - "id": "Belt.Float.-", - "kind": "value", - "name": "-", - "docstrings": [ - "Subtraction of two `float` values.\nCan be opened in a module to avoid dot-notation (`-.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n2.0 - 1.0 == 1.0\n```" - ], - "signature": "let -: (float, float) => float" - }, - { - "id": "Belt.Float.*", - "kind": "value", - "name": "*", - "docstrings": [ - "Multiplication of two `float` values.\nCan be opened in a module to avoid dot-notation (`*.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n2.0 * 2.0 == 4.0\n```" - ], - "signature": "let *: (float, float) => float" - }, - { - "id": "Belt.Float./", - "kind": "value", - "name": "/", - "docstrings": [ - "Division of two `float` values.\nCan be opened in a module to avoid dot-notation (`/.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n4.0 / 2.0 == 2.0\n```" - ], - "signature": "let /: (float, float) => float" - } - ] - }, - "belt/int": { - "id": "Belt.Int", - "name": "Int", - "docstrings": [ - "[`Belt.Int`]()\n\n Utilities for Int.", - "This module includes convenience methods for handling `int` types." - ], - "items": [ - { - "id": "Belt.Int.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [ - "Converts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nBelt.Int.toFloat(1) == 1.0\n```" - ], - "signature": "let toFloat: int => float" - }, - { - "id": "Belt.Int.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "Converts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nBelt.Int.fromFloat(1.0) == 1\n```" - ], - "signature": "let fromFloat: float => int" - }, - { - "id": "Belt.Int.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Converts a given `string` to an `int`. Returns `Some(int)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nBelt.Int.fromString(\"1\") == Some(1)\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Belt.Int.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nBelt.Int.toString(1) == \"1\"\n```" - ], - "signature": "let toString: int => string" - }, - { - "id": "Belt.Int.+", - "kind": "value", - "name": "+", - "docstrings": [ - "Addition of two `int` values. Same as the addition from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n2 + 2 == 4\n```" - ], - "signature": "let +: (int, int) => int" - }, - { - "id": "Belt.Int.-", - "kind": "value", - "name": "-", - "docstrings": [ - "Subtraction of two `int` values. Same as the subtraction from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n2 - 1 == 1\n```" - ], - "signature": "let -: (int, int) => int" - }, - { - "id": "Belt.Int.*", - "kind": "value", - "name": "*", - "docstrings": [ - "Multiplication of two `int` values. Same as the multiplication from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n2 * 2 == 4\n```" - ], - "signature": "let *: (int, int) => int" - }, - { - "id": "Belt.Int./", - "kind": "value", - "name": "/", - "docstrings": [ - "Division of two `int` values. Same as the division from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n4 / 2 == 2\n```" - ], - "signature": "let /: (int, int) => int" - } - ] - }, - "belt/result": { - "id": "Belt.Result", - "name": "Result", - "docstrings": [ - "[`Belt.Result`]()\n\n Utilities for result data type.", - "Result types are really useful to describe the result of a certain operation\nwithout relying on exceptions or `option` types.\n\nThis module gives you useful utilities to create and combine `Result` data." - ], - "items": [ - { - "id": "Belt.Result.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a, 'b> = result<'a, 'b> = Ok('a) | Error('b)" - }, - { - "id": "Belt.Result.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(res)`: when `res` is `Ok(n)`, returns `n` when `res` is `Error(m)`, throw an exception\n\n## Examples\n\n```rescript\nBelt.Result.Ok(42)->Belt.Result.getExn == 42\n\nswitch Belt.Result.getExn(Belt.Result.Error(\"Invalid data\")) {\n// throw a exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getExn: t<'a, 'b> => 'a" - }, - { - "id": "Belt.Result.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(res)`: when `res` is `Ok(n)`, returns `n` when `res` is `Error(m)`, throw an exception\n\n## Examples\n\n```rescript\nBelt.Result.Ok(42)->Belt.Result.getOrThrow == 42\n\nswitch Belt.Result.getOrThrow(Belt.Result.Error(\"Invalid data\")) {\n// throw a exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getOrThrow: t<'a, 'b> => 'a" - }, - { - "id": "Belt.Result.mapWithDefaultU", - "kind": "value", - "name": "mapWithDefaultU", - "docstrings": [], - "signature": "let mapWithDefaultU: (t<'a, 'c>, 'b, 'a => 'b) => 'b", - "deprecated": "Use `mapWithDefault` instead" - }, - { - "id": "Belt.Result.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [ - "`mapWithDefault(res, default, f)`: When res is `Ok(n)`, returns `f(n)`,\notherwise `default`.\n\n## Examples\n\n```rescript\nlet ok = Belt.Result.Ok(42)\nBelt.Result.mapWithDefault(ok, 0, x => x / 2) == 21\n\nlet error = Belt.Result.Error(\"Invalid data\")\nBelt.Result.mapWithDefault(error, 0, x => x / 2) == 0\n```" - ], - "signature": "let mapWithDefault: (t<'a, 'c>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Belt.Result.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a, 'c>, 'a => 'b) => t<'b, 'c>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Result.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(res, f)`: When res is `Ok(n)`, returns `Ok(f(n))`. Otherwise returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns an\nordinary value.\n\n## Examples\n\n```rescript\nlet f = x => sqrt(Belt.Int.toFloat(x))\n\nBelt.Result.map(Ok(64), f) == Ok(8.0)\n\nBelt.Result.map(Error(\"Invalid data\"), f) == Error(\"Invalid data\")\n```" - ], - "signature": "let map: (t<'a, 'c>, 'a => 'b) => t<'b, 'c>" - }, - { - "id": "Belt.Result.flatMapU", - "kind": "value", - "name": "flatMapU", - "docstrings": [], - "signature": "let flatMapU: (t<'a, 'c>, 'a => t<'b, 'c>) => t<'b, 'c>", - "deprecated": "Use `flatMap` instead" - }, - { - "id": "Belt.Result.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(res, f)`: When res is `Ok(n)`, returns `f(n)`. Otherwise, returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns a\n`Belt.Result`.\n\n## Examples\n\n```rescript\nlet recip = x =>\n if x !== 0.0 {\n Belt.Result.Ok(1.0 /. x)\n } else {\n Belt.Result.Error(\"Divide by zero\")\n }\n\nBelt.Result.flatMap(Ok(2.0), recip) == Ok(0.5)\n\nBelt.Result.flatMap(Ok(0.0), recip) == Error(\"Divide by zero\")\n\nBelt.Result.flatMap(Error(\"Already bad\"), recip) == Error(\"Already bad\")\n```" - ], - "signature": "let flatMap: (t<'a, 'c>, 'a => t<'b, 'c>) => t<'b, 'c>" - }, - { - "id": "Belt.Result.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [ - "`getWithDefault(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`,\notherwise `default`\n\n## Examples\n\n```rescript\nBelt.Result.getWithDefault(Ok(42), 0) == 42\n\nBelt.Result.getWithDefault(Error(\"Invalid Data\"), 0) == 0\n```" - ], - "signature": "let getWithDefault: (t<'a, 'b>, 'a) => 'a" - }, - { - "id": "Belt.Result.isOk", - "kind": "value", - "name": "isOk", - "docstrings": [ - "`isOk(res)`: Returns `true` if `res` is of the form `Ok(n)`, `false` if it is\nthe `Error(e)` variant." - ], - "signature": "let isOk: t<'a, 'b> => bool" - }, - { - "id": "Belt.Result.isError", - "kind": "value", - "name": "isError", - "docstrings": [ - "`isError(res)`: Returns `true` if `res` is of the form `Error(e)`, `false` if\nit is the `Ok(n)` variant." - ], - "signature": "let isError: t<'a, 'b> => bool" - }, - { - "id": "Belt.Result.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Result.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(res1, res2, f)`: Determine if two `Belt.Result` variables are equal with\nrespect to an equality function. If `res1` and `res2` are of the form `Ok(n)`\nand `Ok(m)`, return the result of `f(n, m)`. If one of `res1` and `res2` are of\nthe form `Error(e)`, return false If both `res1` and `res2` are of the form\n`Error(e)`, return true\n\n## Examples\n\n```rescript\nlet good1 = Belt.Result.Ok(42)\n\nlet good2 = Belt.Result.Ok(32)\n\nlet bad1 = Belt.Result.Error(\"invalid\")\n\nlet bad2 = Belt.Result.Error(\"really invalid\")\n\nlet mod10equal = (a, b) => mod(a, 10) === mod(b, 10)\n\nBelt.Result.eq(good1, good2, mod10equal) == true\n\nBelt.Result.eq(good1, bad1, mod10equal) == false\n\nBelt.Result.eq(bad2, good2, mod10equal) == false\n\nBelt.Result.eq(bad1, bad2, mod10equal) == true\n```" - ], - "signature": "let eq: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Result.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Result.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(res1, res2, f)`: Compare two `Belt.Result` variables with respect to a\ncomparison function. The comparison function returns -1 if the first variable\nis \"less than\" the second, 0 if the two variables are equal, and 1 if the first\nis \"greater than\" the second.\n\nIf `res1` and `res2` are of the form `Ok(n)` and `Ok(m)`, return the result of\n`f(n, m)`. If `res1` is of the form `Error(e)` and `res2` of the form `Ok(n)`,\nreturn -1 (nothing is less than something) If `res1` is of the form `Ok(n)` and\n`res2` of the form `Error(e)`, return 1 (something is greater than nothing) If\nboth `res1` and `res2` are of the form `Error(e)`, return 0 (equal)\n\n## Examples\n\n```rescript\nlet good1 = Belt.Result.Ok(59)\n\nlet good2 = Belt.Result.Ok(37)\n\nlet bad1 = Belt.Result.Error(\"invalid\")\n\nlet bad2 = Belt.Result.Error(\"really invalid\")\n\nlet mod10cmp = (a, b) => Pervasives.compare(mod(a, 10), mod(b, 10))\n\nBelt.Result.cmp(Ok(39), Ok(57), mod10cmp) == 1\n\nBelt.Result.cmp(Ok(57), Ok(39), mod10cmp) == -1\n\nBelt.Result.cmp(Ok(39), Error(\"y\"), mod10cmp) == 1\n\nBelt.Result.cmp(Error(\"x\"), Ok(57), mod10cmp) == -1\n\nBelt.Result.cmp(Error(\"x\"), Error(\"y\"), mod10cmp) == 0\n```" - ], - "signature": "let cmp: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => int) => int" - } - ] - }, - "belt/option": { - "id": "Belt.Option", - "name": "Option", - "docstrings": [ - "[`Belt.Option`]()\n\n Utilities for option data type.", - "In Belt we represent the existence and nonexistence of a value by wrapping it\nwith the `option` type. In order to make it a bit more convenient to work with\noption-types, Belt provides utility-functions for it.\n\nThe `option` type is a part of the ReScript standard library which is defined like this:\n\n## Examples\n\n```rescript\ntype option<'a> = None | Some('a)\n```\n\n```rescript\nlet someString: option = Some(\"hello\")\n```" - ], - "items": [ - { - "id": "Belt.Option.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [ - "Uncurried version of `keep`" - ], - "signature": "let keepU: (option<'a>, 'a => bool) => option<'a>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Option.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "If `optionValue` is `Some(value)` and `p(value) = true`, it returns `Some(value)`; otherwise returns `None`\n\n## Examples\n\n```rescript\nBelt.Option.keep(Some(10), x => x > 5) == Some(10)\nBelt.Option.keep(Some(4), x => x > 5) == None\nBelt.Option.keep(None, x => x > 5) == None\n```" - ], - "signature": "let keep: (option<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Belt.Option.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Uncurried version of `forEach`" - ], - "signature": "let forEachU: (option<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Option.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "If `optionValue` is `Some(value`), it calls `f(value)`; otherwise returns `()`\n\n## Examples\n\n```rescript\nBelt.Option.forEach(Some(\"thing\"), x => Js.log(x)) /* logs \"thing\" */\nBelt.Option.forEach(None, x => Js.log(x)) /* returns () */\n```" - ], - "signature": "let forEach: (option<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.Option.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Throws an Error in case `None` is provided. Use with care.\n\n## Examples\n\n```rescript\nSome(3)->Belt.Option.getExn == 3\n\nswitch Belt.Option.getExn(None) {\n// Throws an exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getExn: option<'a> => 'a" - }, - { - "id": "Belt.Option.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Throws an Error in case `None` is provided. Use with care.\n\n## Examples\n\n```rescript\nSome(3)->Belt.Option.getOrThrow == 3\n\nswitch Belt.Option.getOrThrow(None) {\n// Throws an exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getOrThrow: option<'a> => 'a" - }, - { - "id": "Belt.Option.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(x)` returns `x`\n\nThis is an unsafe operation, it assumes `x` is neither `None`\nnor `Some(None(...)))`" - ], - "signature": "let getUnsafe: option<'a> => 'a" - }, - { - "id": "Belt.Option.mapWithDefaultU", - "kind": "value", - "name": "mapWithDefaultU", - "docstrings": [ - "Uncurried version of `mapWithDefault`" - ], - "signature": "let mapWithDefaultU: (option<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "Use `mapWithDefault` instead" - }, - { - "id": "Belt.Option.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [ - "If `optionValue` is of `Some(value)`,\nthis function returns that value applied with `f`, in other words `f(value)`.\n\nIf `optionValue` is `None`, the default is returned.\n\n## Examples\n\n```rescript\nlet someValue = Some(3)\nsomeValue->Belt.Option.mapWithDefault(0, x => x + 5) == 8\n\nlet noneValue = None\nnoneValue->Belt.Option.mapWithDefault(0, x => x + 5) == 0\n```" - ], - "signature": "let mapWithDefault: (option<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Belt.Option.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [ - "Uncurried version of `map`" - ], - "signature": "let mapU: (option<'a>, 'a => 'b) => option<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Option.map", - "kind": "value", - "name": "map", - "docstrings": [ - "If `optionValue` is `Some(value)` this returns `f(value)`, otherwise it returns `None`.\n\n## Examples\n\n```rescript\nBelt.Option.map(Some(3), x => x * x) == Some(9)\n\nBelt.Option.map(None, x => x * x) == None\n```" - ], - "signature": "let map: (option<'a>, 'a => 'b) => option<'b>" - }, - { - "id": "Belt.Option.flatMapU", - "kind": "value", - "name": "flatMapU", - "docstrings": [ - "Uncurried version of `flatMap`" - ], - "signature": "let flatMapU: (option<'a>, 'a => option<'b>) => option<'b>", - "deprecated": "Use `flatMap` instead" - }, - { - "id": "Belt.Option.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "If `optionValue` is `Some(value)`, returns `f(value)`, otherwise returns\n`None`.
\nThe function `f` must have a return type of `option<'b>`.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Some(value + 1)\n } else {\n None\n }\n\nBelt.Option.flatMap(Some(2), addIfAboveOne) == Some(3)\n\nBelt.Option.flatMap(Some(-4), addIfAboveOne) == None\n\nBelt.Option.flatMap(None, addIfAboveOne) == None\n```" - ], - "signature": "let flatMap: (option<'a>, 'a => option<'b>) => option<'b>" - }, - { - "id": "Belt.Option.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [ - "If `optionalValue` is `Some(value)`, returns `value`, otherwise default.\n\n## Examples\n\n```rescript\nBelt.Option.getWithDefault(None, \"Banana\") == \"Banana\"\n\nBelt.Option.getWithDefault(Some(\"Apple\"), \"Banana\") == \"Apple\"\n```\n\n```rescript\nlet greet = (firstName: option) =>\n \"Greetings \" ++ firstName->Belt.Option.getWithDefault(\"Anonymous\")\n\nSome(\"Jane\")->greet == \"Greetings Jane\"\n\nNone->greet == \"Greetings Anonymous\"\n```" - ], - "signature": "let getWithDefault: (option<'a>, 'a) => 'a" - }, - { - "id": "Belt.Option.orElse", - "kind": "value", - "name": "orElse", - "docstrings": [ - "`orElse(optionalValue, otherOptional)` if `optionalValue` is `Some(value)`,\nreturns `Some(value)`, otherwise `otherOptional`\n\n## Examples\n\n```rescript\nBelt.Option.orElse(Some(1812), Some(1066)) == Some(1812)\nBelt.Option.orElse(None, Some(1066)) == Some(1066)\nBelt.Option.orElse(None, None) == None\n```" - ], - "signature": "let orElse: (option<'a>, option<'a>) => option<'a>" - }, - { - "id": "Belt.Option.isSome", - "kind": "value", - "name": "isSome", - "docstrings": [ - "Returns `true` if the argument is `Some(value)`, `false` otherwise.\n\n## Examples\n\n```rescript\nBelt.Option.isSome(None) == false\n\nBelt.Option.isSome(Some(1)) == true\n```" - ], - "signature": "let isSome: option<'a> => bool" - }, - { - "id": "Belt.Option.isNone", - "kind": "value", - "name": "isNone", - "docstrings": [ - "Returns `true` if the argument is `None`, `false` otherwise.\n\n## Examples\n\n```rescript\nBelt.Option.isNone(None) == true\n\nBelt.Option.isNone(Some(1)) == false\n```" - ], - "signature": "let isNone: option<'a> => bool" - }, - { - "id": "Belt.Option.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [ - "Uncurried version of `eq`" - ], - "signature": "let eqU: (option<'a>, option<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Option.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Evaluates two optional values for equality with respect to a predicate\nfunction. If both `optValue1` and `optValue2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\n\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`predicate(value1, value2)`; the predicate function must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Belt.Option\n\neq(Some(3), Some(15), clockEqual) == true\n\neq(Some(3), None, clockEqual) == false\n\neq(None, Some(3), clockEqual) == false\n\neq(None, None, clockEqual) == true\n```" - ], - "signature": "let eq: (option<'a>, option<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Option.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [ - "Uncurried version of `cmp`" - ], - "signature": "let cmpU: (option<'a>, option<'b>, ('a, 'b) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Option.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(optValue1, optValue2, comparisonFunction)` compares two optional values\nwith respect to given `comparisonFunction`.\n\nIf both `optValue1` and `optValue2` are `None`, it returns `0`.\n\nIf the first argument is `Some(value1)` and the second is `None`, returns `1`\n(something is greater than nothing).\n\nIf the first argument is `None` and the second is `Some(value2)`, returns `-1`\n(nothing is less than something).\n\nIf the arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`comparisonFunction(value1, value2)`; comparisonFunction takes two arguments\nand returns `-1` if the first argument is less than the second, `0` if the\narguments are equal, and `1` if the first argument is greater than the second.\n\n## Examples\n\n```rescript\nlet clockCompare = (a, b) => compare(mod(a, 12), mod(b, 12))\n\nopen Belt.Option\n\ncmp(Some(3), Some(15), clockCompare) == 0\n\ncmp(Some(3), Some(14), clockCompare) == 1\n\ncmp(Some(2), Some(15), clockCompare) == -1\n\ncmp(None, Some(15), clockCompare) == -1\n\ncmp(Some(14), None, clockCompare) == 1\n\ncmp(None, None, clockCompare) == 0\n```" - ], - "signature": "let cmp: (option<'a>, option<'b>, ('a, 'b) => int) => int" - } - ] - }, - "belt/hashmap": { - "id": "Belt.HashMap", - "name": "HashMap", - "docstrings": [ - "[`Belt.HashMap`]()\n\n The top level provides generic **mutable** hash map operations.\n\n It also has two specialized inner modules\n [`Belt.HashMap.Int`]() and [`Belt.HashMap.String`]()", - "A **mutable** Hash map which allows customized [`hash`]() behavior.\n\nAll data are parameterized by not its only type but also a unique identity in\nthe time of initialization, so that two _HashMaps of ints_ initialized with different\n_hash_ functions will have different type.\n\n## Examples\n\n```rescript\ntype t = int\nmodule I0 = unpack(Belt.Id.hashable(~hash=(_: t) => 0xff_ff, ~eq=(a, b) => a == b))\nlet s0: Belt.HashMap.t = Belt.HashMap.make(~hintSize=40, ~id=module(I0))\n\nmodule I1 = unpack(Belt.Id.hashable(~hash=(_: t) => 0xff, ~eq=(a, b) => a == b))\nlet s1: Belt.HashMap.t = Belt.HashMap.make(~hintSize=40, ~id=module(I1))\n```\n\nThe invariant must be held: for two elements who are _equal_,\ntheir hashed value should be the same\n\nHere the compiler would infer `s0` and `s1` having different type so that\nit would not mix.\n\n## Examples\n\n```\nlet s0: t\nlet s1: t\n```\n\nWe can add elements to the collection:\n\n## Examples\n\n```rescript\nlet () = {\n Belt.HashMap.set(s0, 0, 3)\n Belt.HashMap.set(s1, 1, \"3\")\n}\n```\n\nSince this is an mutable data strucure, `s1` will contain two pairs." - ], - "items": [ - { - "id": "Belt.HashMap.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of hash tables from type `'key` to type `'value`." - ], - "signature": "type t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making an empty hash map." - ], - "signature": "type id<'a, 'id> = Belt_Id.hashable<'a, 'id>" - }, - { - "id": "Belt.HashMap.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(~hintSize=10, ~id)` creates a new map by taking in the comparator and `hintSize`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\n\nBelt.HashMap.set(hMap, 0, \"a\")\n```" - ], - "signature": "let make: (~hintSize: int, ~id: id<'key, 'id>) => t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Clears a hash table.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.fromArray([(1, \"1\")], ~id=module(IntHash))\nBelt.HashMap.clear(hMap)\nBelt.HashMap.isEmpty(hMap) == true\n```" - ], - "signature": "let clear: t<'key, 'value, 'id> => unit" - }, - { - "id": "Belt.HashMap.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(m)` checks whether a hash map is empty.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nBelt.HashMap.isEmpty(Belt.HashMap.fromArray([(1, \"1\")], ~id=module(IntHash))) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b, 'c> => bool" - }, - { - "id": "Belt.HashMap.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(hMap, k, v)` if `k` does not exist, add the binding `k,v`, otherwise, update the old value with the new `v`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntHash))\n\nBelt.HashMap.set(s0, 2, \"3\")\n\nBelt.HashMap.valuesToArray(s0) == [\"1\", \"3\", \"3\"]\n```" - ], - "signature": "let set: (t<'key, 'value, 'id>, 'key, 'value) => unit" - }, - { - "id": "Belt.HashMap.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Creates copy of a hash map.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntHash))\nlet s1 = Belt.HashMap.copy(s0)\n\nBelt.HashMap.set(s0, 2, \"3\")\n\n(Belt.HashMap.get(s0, 2) != Belt.HashMap.get(s1, 2)) == true\n```" - ], - "signature": "let copy: t<'key, 'value, 'id> => t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns value bound under specific key. If values not exist returns `None`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\n\nBelt.HashMap.get(s0, 1) == Some(\"value1\")\nBelt.HashMap.get(s0, 2) == None\n```" - ], - "signature": "let get: (t<'key, 'value, 'id>, 'key) => option<'value>" - }, - { - "id": "Belt.HashMap.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if `x` is bound in `tbl`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\n\nBelt.HashMap.has(s0, 1) == true\nBelt.HashMap.has(s0, 2) == false\n```" - ], - "signature": "let has: (t<'key, 'value, 'id>, 'key) => bool" - }, - { - "id": "Belt.HashMap.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "If bound exists, removes it from the hash map.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.remove(s0, 1)\nBelt.HashMap.has(s0, 1) == false\n```" - ], - "signature": "let remove: (t<'key, 'value, 'id>, 'key) => unit" - }, - { - "id": "Belt.HashMap.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as [forEach](#forEach) but takes uncurried function." - ], - "signature": "let forEachU: (t<'key, 'value, 'id>, ('key, 'value) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashMap.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(tbl, f)` applies `f` to all bindings in table `tbl`. `f` receives the key as first argument, and the associated value as second argument. Each binding is presented exactly once to `f`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.forEach(s0, (key, value) => Js.log2(key, value))\n// prints (1, \"value1\")\n```" - ], - "signature": "let forEach: (t<'key, 'value, 'id>, ('key, 'value) => unit) => unit" - }, - { - "id": "Belt.HashMap.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashMap.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(tbl, init, f)` computes `(f(kN, dN) ... (f(k1, d1, init))...)`, where `k1 ... kN` are the keys of all bindings in `tbl`, and `d1 ... dN` are the associated values. Each binding is presented exactly once to `f`.\n\nThe order in which the bindings are passed to `f` is unspecified. However, if the table contains several bindings for the same key, they are passed to `f` in reverse order of introduction, that is, the most recent binding is passed first.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\n\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\ns0->Belt.HashMap.reduce(\"\", (acc, _, value) => acc ++ (\", \" ++ value)) == \", value1, value2\"\n```\n\n## More Examples\n\n```rescript\nConsole.log(\"lol\")\n```" - ], - "signature": "let reduce: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c" - }, - { - "id": "Belt.HashMap.keepMapInPlaceU", - "kind": "value", - "name": "keepMapInPlaceU", - "docstrings": [ - "Same as [keepMapInPlace](#keepMapInPlace) but takes uncurried function." - ], - "signature": "let keepMapInPlaceU: (\n t<'key, 'value, 'id>,\n ('key, 'value) => option<'value>,\n) => unit", - "deprecated": "Use `keepMapInPlace` instead" - }, - { - "id": "Belt.HashMap.keepMapInPlace", - "kind": "value", - "name": "keepMapInPlace", - "docstrings": [ - "Filters out values for which function `f` returned `None`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.keepMapInPlace(s0, (key, value) => key == 1 ? None : Some(value))\n```" - ], - "signature": "let keepMapInPlace: (\n t<'key, 'value, 'id>,\n ('key, 'value) => option<'value>,\n) => unit" - }, - { - "id": "Belt.HashMap.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(tbl)` returns the number of bindings in `tbl`. It takes constant time.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.size(s0) == 2\n```" - ], - "signature": "let size: t<'a, 'b, 'c> => int" - }, - { - "id": "Belt.HashMap.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of key value pairs.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.toArray(s0) == [(1, \"value1\"), (2, \"value2\")]\n```" - ], - "signature": "let toArray: t<'key, 'value, 'id> => array<('key, 'value)>" - }, - { - "id": "Belt.HashMap.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "Returns array of keys.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.keysToArray(s0) == [1, 2]\n```" - ], - "signature": "let keysToArray: t<'key, 'a, 'b> => array<'key>" - }, - { - "id": "Belt.HashMap.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [ - "Returns array of values.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.valuesToArray(s0) == [\"value1\", \"value2\"]\n```" - ], - "signature": "let valuesToArray: t<'a, 'value, 'b> => array<'value>" - }, - { - "id": "Belt.HashMap.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new hash map from array of pairs.\n\nReturns array of values.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(1, \"value1\"), (2, \"value2\")], ~id=module(IntHash))\nBelt.HashMap.toArray(s0) == [(1, \"value1\"), (2, \"value2\")]\n```" - ], - "signature": "let fromArray: (\n array<('key, 'value)>,\n ~id: id<'key, 'id>,\n) => t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.mergeMany(hMap, [(1, \"1\"), (2, \"2\")])\n```" - ], - "signature": "let mergeMany: (t<'key, 'value, 'id>, array<('key, 'value)>) => unit" - }, - { - "id": "Belt.HashMap.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(hMap, 1, \"1\")\n\nBelt.HashMap.getBucketHistogram(hMap)\n```" - ], - "signature": "let getBucketHistogram: t<'a, 'b, 'c> => array" - }, - { - "id": "Belt.HashMap.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(hMap, 1, \"1\")\n\nBelt.HashMap.logStats(hMap)\n```" - ], - "signature": "let logStats: t<'a, 'b, 'c> => unit" - } - ] - }, - "belt/hashset": { - "id": "Belt.HashSet", - "name": "HashSet", - "docstrings": [ - "[`Belt.HashSet`]()\n\n The top level provides generic **mutable** hash set operations.\n\n It also has two specialized inner modules\n [`Belt.HashSet.Int`]() and [`Belt.HashSet.String`]()", - "A **mutable** Hash set which allows customized `hash` behavior.\n\nAll data are parameterized by not its only type but also a unique identity in\nthe time of initialization, so that two _HashSets of ints_ initialized with\ndifferent _hash_ functions will have different type.\n\n## Examples\n\n```rescript\nmodule I0 = unpack(Belt.Id.hashable(~hash=(a: int) => land(a, 65535), ~eq=(a, b) => a == b))\n\nlet s0 = Belt.HashSet.make(~id=module(I0), ~hintSize=40)\n\nmodule I1 = unpack(Belt.Id.hashable(~hash=(a: int) => land(a, 255), ~eq=(a, b) => a == b))\n\nlet s1 = Belt.HashSet.make(~id=module(I1), ~hintSize=40)\n\nBelt.HashSet.add(s1, 0)\nBelt.HashSet.add(s1, 1)\n```\n\nThe invariant must be held: for two elements who are equal, their hashed\nvalue should be the same.\n\nHere the compiler would infer `s0` and `s1` having different type so that it\nwould not mix.\n\nSignatures:\n\n```\nlet s0: Belt.HashSet.t\nlet s1: Belt.HashSet.t\n```\n\nWe can add elements to the collection (see last two lines in the example\nabove). Since this is an mutable data structure, `s1` will contain two pairs." - ], - "items": [ - { - "id": "Belt.HashSet.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a, 'id>" - }, - { - "id": "Belt.HashSet.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The type of hash tables from type `'a` to type `'b`." - ], - "signature": "type id<'a, 'id> = Belt_Id.hashable<'a, 'id>" - }, - { - "id": "Belt.HashSet.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int, ~id: id<'a, 'id>) => t<'a, 'id>" - }, - { - "id": "Belt.HashSet.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a, 'id> => unit" - }, - { - "id": "Belt.HashSet.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.HashSet.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t<'a, 'id>, 'a) => unit" - }, - { - "id": "Belt.HashSet.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a, 'id> => t<'a, 'id>" - }, - { - "id": "Belt.HashSet.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a, 'id>, 'a) => bool" - }, - { - "id": "Belt.HashSet.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t<'a, 'id>, 'a) => unit" - }, - { - "id": "Belt.HashSet.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a, 'id>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashSet.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Order unspecified." - ], - "signature": "let forEach: (t<'a, 'id>, 'a => unit) => unit" - }, - { - "id": "Belt.HashSet.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a, 'id>, 'c, ('c, 'a) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashSet.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Order unspecified." - ], - "signature": "let reduce: (t<'a, 'id>, 'c, ('c, 'a) => 'c) => 'c" - }, - { - "id": "Belt.HashSet.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a, 'id> => int" - }, - { - "id": "Belt.HashSet.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t<'a, 'b> => unit" - }, - { - "id": "Belt.HashSet.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'a, 'id> => array<'a>" - }, - { - "id": "Belt.HashSet.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: (array<'a>, ~id: id<'a, 'id>) => t<'a, 'id>" - }, - { - "id": "Belt.HashSet.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'a, 'id>, array<'a>) => unit" - }, - { - "id": "Belt.HashSet.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t<'a, 'b> => array" - } - ] - }, - "belt/mutablemap": { - "id": "Belt.MutableMap", - "name": "MutableMap", - "docstrings": [ - "[`Belt.MutableMap`]()\n\n The top level provides generic **mutable** map operations.\n\n It also has two specialized inner modules\n [`Belt.MutableMap.Int`]() and [`Belt.MutableMap.String`]()" - ], - "items": [ - { - "id": "Belt.MutableMap.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v, 'id>" - }, - { - "id": "Belt.MutableMap.id", - "kind": "type", - "name": "id", - "docstrings": [], - "signature": "type id<'key, 'id> = Belt_Id.comparable<'key, 'id>" - }, - { - "id": "Belt.MutableMap.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~id: id<'k, 'id>) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.MutableMap.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a, 'b, 'c> => unit" - }, - { - "id": "Belt.MutableMap.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a, 'b, 'c> => bool" - }, - { - "id": "Belt.MutableMap.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'k, 'a, 'b>, 'k) => bool" - }, - { - "id": "Belt.MutableMap.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.MutableMap.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m1, m2, cmp)` First compare by size, if size is the same, compare by\nkey, value pair." - ], - "signature": "let cmp: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.MutableMap.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.MutableMap.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, eqf)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `eqf` is the\nequality predicate used to compare the data associated with the keys." - ], - "signature": "let eq: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableMap.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies f to all bindings in map `m`. `f` receives the `'k`\nas first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys." - ], - "signature": "let forEach: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit" - }, - { - "id": "Belt.MutableMap.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableMap.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f), computes`(f(kN, dN) ... (f(k1, d1, a))...)`, where`k1 ...\nkN`are the keys of all bindings in`m`(in increasing order), and`d1 ... dN`\nare the associated data." - ], - "signature": "let reduce: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableMap.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableMap.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`." - ], - "signature": "let every: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableMap.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`." - ], - "signature": "let some: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'k, 'a, 'id> => int" - }, - { - "id": "Belt.MutableMap.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order." - ], - "signature": "let toList: t<'k, 'a, 'id> => list<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'k, 'a, 'id> => array<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: (array<('k, 'a)>, ~id: id<'k, 'id>) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.MutableMap.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'k, 'a, 'b> => array<'k>" - }, - { - "id": "Belt.MutableMap.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'b, 'a, 'c> => array<'a>" - }, - { - "id": "Belt.MutableMap.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.MutableMap.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.MutableMap.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'k, 'a, 'id>, 'k) => option<'a>" - }, - { - "id": "Belt.MutableMap.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'k, 'a, 'id>, 'k, 'a) => 'a" - }, - { - "id": "Belt.MutableMap.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'k, 'a, 'id>, 'k) => 'a" - }, - { - "id": "Belt.MutableMap.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'k, 'a, 'id>, 'k) => 'a" - }, - { - "id": "Belt.MutableMap.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "Throw when invariant is not held." - ], - "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit" - }, - { - "id": "Belt.MutableMap.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` do the in-place modification." - ], - "signature": "let remove: (t<'k, 'a, 'id>, 'k) => unit" - }, - { - "id": "Belt.MutableMap.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'k, 'a, 'id>, array<'k>) => unit" - }, - { - "id": "Belt.MutableMap.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` do the in-place modification" - ], - "signature": "let set: (t<'k, 'a, 'id>, 'k, 'a) => unit" - }, - { - "id": "Belt.MutableMap.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'k, 'a, 'id>, 'k, option<'a> => option<'a>) => unit", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.MutableMap.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'k, 'a, 'id>, 'k, option<'a> => option<'a>) => unit" - }, - { - "id": "Belt.MutableMap.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'k, 'a, 'id>, array<('k, 'a)>) => unit" - }, - { - "id": "Belt.MutableMap.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableMap.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated\nvalue a of all bindings of `m` has been replaced by the result of the\napplication of `f` to `a`. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let map: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>" - }, - { - "id": "Belt.MutableMap.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.MutableMap.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>" - } - ] - }, - "belt/mutableset": { - "id": "Belt.MutableSet", - "name": "MutableSet", - "docstrings": [ - "[`Belt.MutableSet`]()\n\n The top level provides generic **mutable** set operations.\n\n It also has two specialized inner modules\n [`Belt.MutableSet.Int`]() and [`Belt.MutableSet.String`]()", - "A **mutable** sorted set module which allows customized compare behavior.\nThe implementation uses balanced binary trees, and therefore searching and insertion take time logarithmic in the size of the map.\n\nIt also has two specialized inner modules [Belt.MutableSet.Int](mutable-set-int) and [Belt.MutableSet.String](mutable-set-string) - This module separates data from function which is more verbose but slightly more efficient\n\n## Examples\n\n```rescript\nmodule PairComparator = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet = Belt.MutableSet.make(~id=module(PairComparator))\nmySet->Belt.MutableSet.add((1, 2))\n```" - ], - "items": [ - { - "id": "Belt.MutableSet.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'value, 'identity>" - }, - { - "id": "Belt.MutableSet.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making a set from scratch" - ], - "signature": "type id<'value, 'id> = Belt_Id.comparable<'value, 'id>" - }, - { - "id": "Belt.MutableSet.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new set by taking in the comparator" - ], - "signature": "let make: (~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let fromArray: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [ - "The same as [fromArray][#fromarray] except it is after assuming the input array is already sorted." - ], - "signature": "let fromSortedArrayUnsafe: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Returns copy of a set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\nlet copied = s0->Belt.MutableSet.copy\ncopied->Belt.MutableSet.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let copy: t<'value, 'id> => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.MutableSet.fromArray([], ~id=module(IntCmp))\nlet notEmpty = Belt.MutableSet.fromArray([1], ~id=module(IntCmp))\n\nBelt.MutableSet.isEmpty(empty) == true\nBelt.MutableSet.isEmpty(notEmpty) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.MutableSet.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if element exists in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.fromArray([1, 4, 2, 5], ~id=module(IntCmp))\n\nset->Belt.MutableSet.has(3) == false\nset->Belt.MutableSet.has(1) == true\n```" - ], - "signature": "let has: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.MutableSet.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\ns0->Belt.MutableSet.add(1)\ns0->Belt.MutableSet.add(2)\ns0->Belt.MutableSet.add(2)\n\ns0->Belt.MutableSet.toArray == [1, 2]\n```" - ], - "signature": "let add: (t<'value, 'id>, 'value) => unit" - }, - { - "id": "Belt.MutableSet.addCheck", - "kind": "value", - "name": "addCheck", - "docstrings": [], - "signature": "let addCheck: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.MutableSet.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "Adds each element of array to set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.make(~id=module(IntCmp))\n\nset->Belt.MutableSet.mergeMany([5, 4, 3, 2, 1])\nset->Belt.MutableSet.toArray == [1, 2, 3, 4, 5]\n```" - ], - "signature": "let mergeMany: (t<'value, 'id>, array<'value>) => unit" - }, - { - "id": "Belt.MutableSet.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([2, 3, 1, 4, 5], ~id=module(IntCmp))\ns0->Belt.MutableSet.remove(1)\ns0->Belt.MutableSet.remove(3)\ns0->Belt.MutableSet.remove(3)\n\ns0->Belt.MutableSet.toArray == [2, 4, 5]\n```" - ], - "signature": "let remove: (t<'value, 'id>, 'value) => unit" - }, - { - "id": "Belt.MutableSet.removeCheck", - "kind": "value", - "name": "removeCheck", - "docstrings": [], - "signature": "let removeCheck: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.MutableSet.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "Removes each element of array from set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\nset->Belt.MutableSet.removeMany([5, 4, 3, 2, 1])\nset->Belt.MutableSet.toArray == []\n```" - ], - "signature": "let removeMany: (t<'value, 'id>, array<'value>) => unit" - }, - { - "id": "Belt.MutableSet.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet union = Belt.MutableSet.union(s0, s1)\nunion->Belt.MutableSet.toArray == [1, 2, 3, 4, 5, 6]\n```" - ], - "signature": "let union: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet intersect = Belt.MutableSet.intersect(s0, s1)\nintersect->Belt.MutableSet.toArray == [2, 3, 5]\n```" - ], - "signature": "let intersect: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.diff", - "kind": "value", - "name": "diff", - "docstrings": [ - "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nBelt.MutableSet.toArray(Belt.MutableSet.diff(s0, s1)) == [6]\nBelt.MutableSet.toArray(Belt.MutableSet.diff(s1, s0)) == [1, 4]\n```" - ], - "signature": "let diff: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet s2 = Belt.MutableSet.intersect(s0, s1)\nBelt.MutableSet.subset(s2, s0) == true\nBelt.MutableSet.subset(s2, s1) == true\nBelt.MutableSet.subset(s1, s0) == false\n```" - ], - "signature": "let subset: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.MutableSet.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets of sets.\nIt compares size first and then iterates over each element following the order of elements." - ], - "signature": "let cmp: (t<'value, 'id>, t<'value, 'id>) => int" - }, - { - "id": "Belt.MutableSet.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 5], ~id=module(IntCmp))\n\nBelt.MutableSet.eq(s0, s1) == true\n```" - ], - "signature": "let eq: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.MutableSet.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as `Belt.MutableSet.forEach` but takes uncurried functon." - ], - "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableSet.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet acc = ref(list{})\ns0->Belt.MutableSet.forEach(x => acc := Belt.List.add(acc.contents, x))\nacc.contents == list{6, 5, 3, 2}\n```" - ], - "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit" - }, - { - "id": "Belt.MutableSet.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableSet.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\ns0->Belt.MutableSet.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) ==\n list{6, 5, 3, 2}\n```" - ], - "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a" - }, - { - "id": "Belt.MutableSet.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableSet.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.MutableSet.fromArray([2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.MutableSet.every(isEven) == true\n```" - ], - "signature": "let every: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.MutableSet.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableSet.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.MutableSet.some(isOdd) == true\n```" - ], - "signature": "let some: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.MutableSet.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.MutableSet.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.MutableSet.keep(isEven)\n\ns1->Belt.MutableSet.toArray == [2, 4]\n```" - ], - "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.MutableSet.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet (s1, s2) = s0->Belt.MutableSet.partition(isOdd)\n\ns1->Belt.MutableSet.toArray == [1, 3, 5]\ns2->Belt.MutableSet.toArray == [2, 4]\n```" - ], - "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)" - }, - { - "id": "Belt.MutableSet.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.size == 4\n```" - ], - "signature": "let size: t<'value, 'id> => int" - }, - { - "id": "Belt.MutableSet.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toList == list{1, 2, 3, 5}\n```" - ], - "signature": "let toList: t<'value, 'id> => list<'value>" - }, - { - "id": "Belt.MutableSet.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toArray == [1, 2, 3, 5]\n```" - ], - "signature": "let toArray: t<'value, 'id> => array<'value>" - }, - { - "id": "Belt.MutableSet.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.minimum == None\ns1->Belt.MutableSet.minimum == Some(1)\n```" - ], - "signature": "let minimum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.MutableSet.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.maximum == None\ns1->Belt.MutableSet.maximum == Some(5)\n```" - ], - "signature": "let maximum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.MutableSet.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the reference of the value which is equivalent to value using the comparator specifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.get(3) == Some(3)\ns0->Belt.MutableSet.get(20) == None\n```" - ], - "signature": "let get: (t<'value, 'id>, 'value) => option<'value>" - }, - { - "id": "Belt.MutableSet.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as `Belt.MutableSet.get` but throw when element does not exist." - ], - "signature": "let getExn: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.MutableSet.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as `Belt.MutableSet.get` but throw when element does not exist." - ], - "signature": "let getOrThrow: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.MutableSet.split", - "kind": "value", - "name": "split", - "docstrings": [ - "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\nlet ((smaller, larger), present) = s0->Belt.MutableSet.split(3)\n\npresent == true\nsmaller->Belt.MutableSet.toArray == [1, 2]\nlarger->Belt.MutableSet.toArray == [4, 5]\n```" - ], - "signature": "let split: (\n t<'value, 'id>,\n 'value,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)" - }, - { - "id": "Belt.MutableSet.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b> => unit" - } - ] - }, - "belt/map": { - "id": "Belt.Map", - "name": "Map", - "docstrings": [ - "[`Belt.Map`](),\n\n The top level provides generic **immutable** map operations.\n\n It also has three specialized inner modules\n [`Belt.Map.Int`](), [`Belt.Map.String`]() and\n\n [`Belt.Map.Dict`](): This module separates data from function\n which is more verbose but slightly more efficient", - "The top level provides generic immutable map operations.\n\nIt also has three specialized inner modules `Belt.Map.Int`, `Belt.Map.String`\nand `Belt.Map.Dict`." - ], - "items": [ - { - "id": "Belt.Map.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'key` is the field type\n\n`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'key, 'value, 'identity>" - }, - { - "id": "Belt.Map.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making an empty map." - ], - "signature": "type id<'key, 'id> = Belt_Id.comparable<'key, 'id>" - }, - { - "id": "Belt.Map.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(~id)` creates a new map by taking in the comparator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet m = Belt.Map.make(~id=module(IntCmp))\n\nBelt.Map.set(m, 0, \"a\")\n```" - ], - "signature": "let make: (~id: id<'k, 'id>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(m)` checks whether a map m is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.isEmpty(Belt.Map.fromArray([(1, \"1\")], ~id=module(IntCmp))) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b, 'c> => bool" - }, - { - "id": "Belt.Map.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(m, k)` checks whether `m` has the key `k`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.has(Belt.Map.fromArray([(1, \"1\")], ~id=module(IntCmp)), 1) == true\n```" - ], - "signature": "let has: (t<'k, 'v, 'id>, 'k) => bool" - }, - { - "id": "Belt.Map.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m0, m1, vcmp);`\n\nTotal ordering of map given total ordering of value function.\n\nIt will compare size first and each element following the order one by one." - ], - "signature": "let cmp: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => int) => int" - }, - { - "id": "Belt.Map.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "eq(m1, m2, veq)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `veq` is the\nequality predicate used to compare the data associated with the keys." - ], - "signature": "let eq: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`\nfindFirstBy(m, p)` uses function `f` to find the first key value pair to match predicate `p`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"\")])\n\ns0->Belt.Map.findFirstBy((k, _) => k == 4) == Some(4, \"4\")\n```" - ], - "signature": "let findFirstBy: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>" - }, - { - "id": "Belt.Map.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'k, 'v, 'id>, ('k, 'v) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the\n`'k` as first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")])\n\nlet acc = ref(list{})\n\nBelt.Map.forEach(s0, (k, v) => acc := list{(k, v), ...acc.contents})\n\nacc.contents == list{(4, \"4\"), (3, \"3\"), (2, \"2\"), (1, \"1\")}\n```" - ], - "signature": "let forEach: (t<'k, 'v, 'id>, ('k, 'v) => unit) => unit" - }, - { - "id": "Belt.Map.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'k, 'v, 'id>, 'acc, ('acc, 'k, 'v) => 'acc) => 'acc", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f(kN, dN) ... (f(k1, d1, a))...)`, where `k1\n... kN` are the keys of all bindings in m (in increasing order), and `d1\n... dN` are the associated data.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")])\n\nBelt.Map.reduce(s0, list{}, (acc, k, v) => list{(k, v), ...acc}) ==\n list{(4, \"4\"), (3, \"3\"), (2, \"2\"), (1, \"1\")}\n```" - ], - "signature": "let reduce: (t<'k, 'v, 'id>, 'acc, ('acc, 'k, 'v) => 'acc) => 'acc" - }, - { - "id": "Belt.Map.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let every: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate \n`p`. Order unspecified" - ], - "signature": "let some: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(s)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.size(Belt.Map.fromArray([(2, \"2\"), (2, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == 2\n```" - ], - "signature": "let size: t<'k, 'v, 'id> => int" - }, - { - "id": "Belt.Map.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(s)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.toArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n (1, \"1\"),\n (2, \"2\"),\n (3, \"3\"),\n ]\n```" - ], - "signature": "let toArray: t<'k, 'v, 'id> => array<('k, 'v)>" - }, - { - "id": "Belt.Map.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "In increasing order. See `Belt.Map.toArray`" - ], - "signature": "let toList: t<'k, 'v, 'id> => list<('k, 'v)>" - }, - { - "id": "Belt.Map.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(kvs, ~id);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.toArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n (1, \"1\"),\n (2, \"2\"),\n (3, \"3\"),\n ]\n```" - ], - "signature": "let fromArray: (array<('k, 'v)>, ~id: id<'k, 'id>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "`keysToArray(s);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.keysToArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n 1,\n 2,\n 3,\n ]\n```" - ], - "signature": "let keysToArray: t<'k, 'v, 'id> => array<'k>" - }, - { - "id": "Belt.Map.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [ - "`valuesToArray(s);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.valuesToArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n \"1\",\n \"2\",\n \"3\",\n ]\n```" - ], - "signature": "let valuesToArray: t<'k, 'v, 'id> => array<'v>" - }, - { - "id": "Belt.Map.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [ - "`minKey(s)` returns the minimum key, None if not exist." - ], - "signature": "let minKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [ - "`maxKey(s)` returns the maximum key, None if not exist." - ], - "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "`minimum(s)` returns the minimum key value pair, None if not exist." - ], - "signature": "let minimum: t<'k, 'v, 'a> => option<('k, 'v)>" - }, - { - "id": "Belt.Map.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "`maximum(s)` returns the maximum key value pair, None if not exist." - ], - "signature": "let maximum: t<'k, 'v, 'a> => option<('k, 'v)>" - }, - { - "id": "Belt.Map.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(s, k)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.get(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp)), 2) == Some(\"2\")\n\nBelt.Map.get(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp)), 4) == None\n```" - ], - "signature": "let get: (t<'k, 'v, 'id>, 'k) => option<'v>" - }, - { - "id": "Belt.Map.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [ - "`getWithDefault(s, k, default)`\n\nSee `Belt.Map.get`\n\nReturns default when `k` is not found." - ], - "signature": "let getWithDefault: (t<'k, 'v, 'id>, 'k, 'v) => 'v" - }, - { - "id": "Belt.Map.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(s, k)`\n\nSee `Belt.Map.get`\n\nthrow when `k` not exist" - ], - "signature": "let getExn: (t<'k, 'v, 'id>, 'k) => 'v" - }, - { - "id": "Belt.Map.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(s, k)`\n\nSee `Belt.Map.get`\n\nthrow when `k` not exist" - ], - "signature": "let getOrThrow: (t<'k, 'v, 'id>, 'k) => 'v" - }, - { - "id": "Belt.Map.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` when `x` is not in `m`, `m` is returned reference unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))\n\nlet s1 = Belt.Map.remove(s0, 1)\n\nlet s2 = Belt.Map.remove(s1, 1)\n\ns1 == s2\n\nBelt.Map.keysToArray(s1) == [2, 3]\n```" - ], - "signature": "let remove: (t<'k, 'v, 'id>, 'k) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "`removeMany(s, xs)`\n\nRemoving each of `xs` to `s`, note unlike `Belt.Map.remove`, the reference\nof return value might be changed even if none in `xs` exists `s`." - ], - "signature": "let removeMany: (t<'k, 'v, 'id>, array<'k>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as `m`, with a\nnew binding of `x` to `y`. If `x` was already bound in `m`, its previous\nbinding disappears.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))\n\nlet s1 = Belt.Map.set(s0, 2, \"3\")\n\nBelt.Map.valuesToArray(s1) == [\"1\", \"3\", \"3\"]\n```" - ], - "signature": "let set: (t<'k, 'v, 'id>, 'k, 'v) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (\n t<'k, 'v, 'id>,\n 'k,\n option<'v> => option<'v>,\n) => t<'k, 'v, 'id>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.update", - "kind": "value", - "name": "update", - "docstrings": [ - "`update(m, x, f)` returns a map containing the same bindings as `m`, except\nfor the binding of `x`. Depending on the value of `y` where `y` is\n`f(get(m, x))`, the binding of `x` is added, removed or updated. If `y` is\n`None`, the binding is removed if it exists; otherwise, if `y` is `Some(z)`\nthen `x` is associated to `z` in the resulting map." - ], - "signature": "let update: (\n t<'k, 'v, 'id>,\n 'k,\n option<'v> => option<'v>,\n) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "`mergeMany(s, xs)`\n\nAdding each of `xs` to `s`, note unlike `add`, the reference of return\nvalue might be changed even if all values in `xs` exist `s`." - ], - "signature": "let mergeMany: (t<'k, 'v, 'id>, array<('k, 'v)>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'k, 'v, 'id>,\n t<'k, 'v2, 'id>,\n ('k, option<'v>, option<'v2>) => option<'v3>,\n) => t<'k, 'v3, 'id>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'k, 'v, 'id>,\n t<'k, 'v2, 'id>,\n ('k, option<'v>, option<'v2>) => option<'v3>,\n) => t<'k, 'v3, 'id>" - }, - { - "id": "Belt.Map.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => t<'k, 'v, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in m that satisfy\npredicate `p`." - ], - "signature": "let keep: (t<'k, 'v, 'id>, ('k, 'v) => bool) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'k, 'v, 'id>,\n ('k, 'v) => bool,\n) => (t<'k, 'v, 'id>, t<'k, 'v, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains\nall the bindings of `s` that satisfy the predicate `p`, and `m2` is the map\nwith all the bindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (\n t<'k, 'v, 'id>,\n ('k, 'v) => bool,\n) => (t<'k, 'v, 'id>, t<'k, 'v, 'id>)" - }, - { - "id": "Belt.Map.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a tuple `(l, r)`, data, where `l` is the map with all\nthe bindings of `m` whose 'k is strictly less than `x`; `r` is the map with\nall the bindings of m whose 'k is strictly greater than `x`; `data` is\n`None` if `m` contains no binding for `x`, or `Some(v)` if `m` binds `v` to\n`x`." - ], - "signature": "let split: (\n t<'k, 'v, 'id>,\n 'k,\n) => ((t<'k, 'v, 'id>, t<'k, 'v, 'id>), option<'v>)" - }, - { - "id": "Belt.Map.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'k, 'v, 'id>, 'v => 'v2) => t<'k, 'v2, 'id>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'k, 'v, 'id>, 'v => 'v2) => t<'k, 'v2, 'id>" - }, - { - "id": "Belt.Map.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'k, 'v, 'id>, ('k, 'v) => 'v2) => t<'k, 'v2, 'id>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [ - "`mapWithKey(m, f)`\n\nThe same as `Belt.Map.map` except that `f` is supplied with one more\nargument: the key." - ], - "signature": "let mapWithKey: (t<'k, 'v, 'id>, ('k, 'v) => 'v2) => t<'k, 'v2, 'id>" - }, - { - "id": "Belt.Map.getData", - "kind": "value", - "name": "getData", - "docstrings": [ - "`getData(s0)`\n\nAdvanced usage only\n\nReturns the raw data (detached from comparator), but its type is still\nmanifested, so that user can pass identity directly without boxing." - ], - "signature": "let getData: t<'k, 'v, 'id> => Belt_MapDict.t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.getId", - "kind": "value", - "name": "getId", - "docstrings": [ - "Advanced usage only. Returns the identity of s0." - ], - "signature": "let getId: t<'k, 'v, 'id> => id<'k, 'id>" - }, - { - "id": "Belt.Map.packIdData", - "kind": "value", - "name": "packIdData", - "docstrings": [ - "`packIdData(~id, ~data)`\n\nAdvanced usage only\n\nReturns the packed collection." - ], - "signature": "let packIdData: (\n ~id: id<'k, 'id>,\n ~data: Belt_MapDict.t<'k, 'v, 'id>,\n) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit" - } - ] - }, - "belt/set": { - "id": "Belt.Set", - "name": "Set", - "docstrings": [ - "[`Belt.Set`]()\n\n The top level provides generic **immutable** set operations.\n\n It also has three specialized inner modules\n [`Belt.Set.Int`](), [`Belt.Set.String`]() and\n\n [`Belt.Set.Dict`](): This module separates data from function\n which is more verbose but slightly more efficient", - "An _immutable_ sorted set module which allows customized _compare_ behavior.\n\nThe implementation uses balanced binary trees, and therefore searching\nand insertion take time logarithmic in the size of the map.\n\nFor more info on this module's usage of identity, `make` and others, please see\nthe top level documentation of Belt, **A special encoding for collection safety**.\n\n## Examples\n\n```rescript\nmodule PairComparator = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet = Belt.Set.make(~id=module(PairComparator))\nlet mySet2 = Belt.Set.add(mySet, (1, 2))\n```\n\n**Note:** This module's examples will assume a predeclared module for integers\ncalled `IntCmp`. It is declared like this:\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n```" - ], - "items": [ - { - "id": "Belt.Set.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'value, 'identity>" - }, - { - "id": "Belt.Set.id", - "kind": "type", - "name": "id", - "docstrings": [ - "The identity needed for making a set from scratch" - ], - "signature": "type id<'value, 'id> = Belt_Id.comparable<'value, 'id>" - }, - { - "id": "Belt.Set.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new set by taking in the comparator\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.make(~id=module(IntCmp))\n\nBelt.Set.isEmpty(set) == true\n```" - ], - "signature": "let make: (~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\ns0->Belt.Set.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let fromArray: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [ - "The same as [fromArray][#fromarray] except it is after assuming the input array\nis already sorted." - ], - "signature": "let fromSortedArrayUnsafe: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.Set.fromArray([], ~id=module(IntCmp))\nlet notEmpty = Belt.Set.fromArray([1], ~id=module(IntCmp))\n\nBelt.Set.isEmpty(empty) == true\nBelt.Set.isEmpty(notEmpty) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.Set.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if element exists in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.fromArray([1, 4, 2, 5], ~id=module(IntCmp))\n\nset->Belt.Set.has(3) == false\nset->Belt.Set.has(1) == true\n```" - ], - "signature": "let has: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.Set.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\n\nlet s1 = s0->Belt.Set.add(1)\nlet s2 = s1->Belt.Set.add(2)\nlet s3 = s2->Belt.Set.add(2)\n\ns0->Belt.Set.toArray == []\ns1->Belt.Set.toArray == [1]\ns2->Belt.Set.toArray == [1, 2]\ns3->Belt.Set.toArray == [1, 2]\ns2 == s3\n```" - ], - "signature": "let add: (t<'value, 'id>, 'value) => t<'value, 'id>" - }, - { - "id": "Belt.Set.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "Adds each element of array to set. Unlike `Belt.Set.add`\\](\\#add), the reference of return value might be changed even if all values in array already exist in set\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.make(~id=module(IntCmp))\n\nlet newSet = set->Belt.Set.mergeMany([5, 4, 3, 2, 1])\n\nnewSet->Belt.Set.toArray == [1, 2, 3, 4, 5]\n```" - ], - "signature": "let mergeMany: (t<'value, 'id>, array<'value>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([2, 3, 1, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.Set.remove(1)\nlet s2 = s1->Belt.Set.remove(3)\nlet s3 = s2->Belt.Set.remove(3)\n\ns1->Belt.Set.toArray == [2, 3, 4, 5]\ns2->Belt.Set.toArray == [2, 4, 5]\ns2 == s3\n```" - ], - "signature": "let remove: (t<'value, 'id>, 'value) => t<'value, 'id>" - }, - { - "id": "Belt.Set.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "Removes each element of array from set. Unlike [remove](#remove), the reference of return value might be changed even if none of values in array existed in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\nlet newSet = set->Belt.Set.removeMany([5, 4, 3, 2, 1])\n\nnewSet->Belt.Set.toArray == []\n```" - ], - "signature": "let removeMany: (t<'value, 'id>, array<'value>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet union = Belt.Set.union(s0, s1)\n\nunion->Belt.Set.toArray == [1, 2, 3, 4, 5, 6]\n```" - ], - "signature": "let union: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\n\nlet intersect = Belt.Set.intersect(s0, s1)\n\nintersect->Belt.Set.toArray == [2, 3, 5]\n```" - ], - "signature": "let intersect: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.diff", - "kind": "value", - "name": "diff", - "docstrings": [ - "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\n\nBelt.Set.diff(s0, s1)->Belt.Set.toArray == [6]\n\nBelt.Set.diff(s1, s0)->Belt.Set.toArray == [1, 4]\n```" - ], - "signature": "let diff: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet s2 = Belt.Set.intersect(s0, s1)\n\nBelt.Set.subset(s2, s0) == true\nBelt.Set.subset(s2, s1) == true\nBelt.Set.subset(s1, s0) == false\n```" - ], - "signature": "let subset: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.Set.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets. It compares size first and then iterates over each element following\nthe order of elements." - ], - "signature": "let cmp: (t<'value, 'id>, t<'value, 'id>) => int" - }, - { - "id": "Belt.Set.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 5], ~id=module(IntCmp))\n\nBelt.Set.eq(s0, s1) == true\n```" - ], - "signature": "let eq: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.Set.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as [forEach](#forEach) but takes uncurried functon." - ], - "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\n\nlet acc = ref(list{})\n\ns0->Belt.Set.forEach(x => {\n acc := Belt.List.add(acc.contents, x)\n})\n\nacc.contents == list{6, 5, 3, 2}\n```" - ], - "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit" - }, - { - "id": "Belt.Set.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\ns0->Belt.Set.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) == list{6, 5, 3, 2}\n```" - ], - "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a" - }, - { - "id": "Belt.Set.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.fromArray([2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.Set.every(isEven) == true\n```" - ], - "signature": "let every: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.fromArray([1, 2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.Set.some(isOdd) == true\n```" - ], - "signature": "let some: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.Set.keep(isEven)\n\ns1->Belt.Set.toArray == [2, 4]\n```" - ], - "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>" - }, - { - "id": "Belt.Set.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "Returns a pair of sets, where first is the set of all the elements of set that satisfy the predicate, and second is the set of all the elements of set that do not satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet (s1, s2) = s0->Belt.Set.partition(isOdd)\n\ns1->Belt.Set.toArray == [1, 3, 5]\ns2->Belt.Set.toArray == [2, 4]\n```" - ], - "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)" - }, - { - "id": "Belt.Set.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\ns0->Belt.Set.size == 4\n```" - ], - "signature": "let size: t<'value, 'id> => int" - }, - { - "id": "Belt.Set.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.toArray == [1, 2, 3, 5]\n```" - ], - "signature": "let toArray: t<'value, 'id> => array<'value>" - }, - { - "id": "Belt.Set.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.toList == list{1, 2, 3, 5}\n```" - ], - "signature": "let toList: t<'value, 'id> => list<'value>" - }, - { - "id": "Belt.Set.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.minimum == None\ns1->Belt.Set.minimum == Some(1)\n```" - ], - "signature": "let minimum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.maximum == None\ns1->Belt.Set.maximum == Some(5)\n```" - ], - "signature": "let maximum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the reference of the value which is equivalent to value using the comparator specifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.get(3) == Some(3)\ns0->Belt.Set.get(20) == None\n```" - ], - "signature": "let get: (t<'value, 'id>, 'value) => option<'value>" - }, - { - "id": "Belt.Set.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getExn: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.Set.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getOrThrow: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.Set.split", - "kind": "value", - "name": "split", - "docstrings": [ - "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\nlet ((smaller, larger), present) = s0->Belt.Set.split(3)\n\npresent == true\nsmaller->Belt.Set.toArray == [1, 2]\nlarger->Belt.Set.toArray == [4, 5]\n```" - ], - "signature": "let split: (\n t<'value, 'id>,\n 'value,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)" - }, - { - "id": "Belt.Set.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [ - "**throw** when invariant is not held" - ], - "signature": "let checkInvariantInternal: t<'a, 'b> => unit" - }, - { - "id": "Belt.Set.getData", - "kind": "value", - "name": "getData", - "docstrings": [ - "**Advanced usage only**\n\nReturns the raw data (detached from comparator), but its type is still manifested,\nso that user can pass identity directly without boxing." - ], - "signature": "let getData: t<'value, 'id> => Belt_SetDict.t<'value, 'id>" - }, - { - "id": "Belt.Set.getId", - "kind": "value", - "name": "getId", - "docstrings": [ - "**Advanced usage only**\n\nReturns the identity of set." - ], - "signature": "let getId: t<'value, 'id> => id<'value, 'id>" - }, - { - "id": "Belt.Set.packIdData", - "kind": "value", - "name": "packIdData", - "docstrings": [ - "**Advanced usage only**\n\nReturns the packed collection." - ], - "signature": "let packIdData: (\n ~id: id<'value, 'id>,\n ~data: Belt_SetDict.t<'value, 'id>,\n) => t<'value, 'id>" - } - ] - }, - "belt/range": { - "id": "Belt.Range", - "name": "Range", - "docstrings": [ - "[`Belt.Range`]()\n\n Utilities for a closed range `(from, start)`", - "A small utility module to provide inclusive range operations for `[start, finish]`.\nInternally it is relying on loops instead of creating new arrays, which makes it\npretty performant and memory friendly." - ], - "items": [ - { - "id": "Belt.Range.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (int, int, int => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Range.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(start, finish, action)` equivalent to `Belt.Array.forEach(Belt.Array.range(start, finish), action))`\n\n## Examples\n\n```rescript\nBelt.Range.forEach(0, 4, i => Js.log(i))\n\n// Prints:\n// 0\n// 1\n// 2\n// 3\n// 4\n```" - ], - "signature": "let forEach: (int, int, int => unit) => unit" - }, - { - "id": "Belt.Range.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (int, int, int => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Range.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(start, finish, p)` equivalent to `Belt.Array.every(Belt.Array.range(start, finish), p)`\n## Examples\n\n```rescript\nBelt.Range.every(0, 4, i => i < 5) == true\n\nBelt.Range.every(0, 4, i => i < 4) == false\n```" - ], - "signature": "let every: (int, int, int => bool) => bool" - }, - { - "id": "Belt.Range.everyByU", - "kind": "value", - "name": "everyByU", - "docstrings": [], - "signature": "let everyByU: (int, int, ~step: int, int => bool) => bool", - "deprecated": "Use `everyBy` instead" - }, - { - "id": "Belt.Range.everyBy", - "kind": "value", - "name": "everyBy", - "docstrings": [ - "`everyBy(start, finish, ~step, p)`. See `Belt.Array.rangeBy`, equivalent to\n`Belt.Array.every(Belt.Array.rangeBy(start, finish, ~step), p)`\n\n## Examples\n\n```rescript\nBelt.Range.everyBy(0, 4, ~step=1, i => mod(i, 2) === 0) == false\n\nBelt.Range.everyBy(0, 4, ~step=2, i => mod(i, 2) === 0) == true\n```" - ], - "signature": "let everyBy: (int, int, ~step: int, int => bool) => bool" - }, - { - "id": "Belt.Range.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (int, int, int => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Range.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(start, finish, p)` equivalent to `Belt.Array.some(Belt.Array.range(start, finish), p)`\n\n## Examples\n\n```rescript\nBelt.Range.some(0, 4, i => i > 5) == false\n\nBelt.Range.some(0, 4, i => i > 2) == true\n```" - ], - "signature": "let some: (int, int, int => bool) => bool" - }, - { - "id": "Belt.Range.someByU", - "kind": "value", - "name": "someByU", - "docstrings": [], - "signature": "let someByU: (int, int, ~step: int, int => bool) => bool", - "deprecated": "Use `someBy` instead" - }, - { - "id": "Belt.Range.someBy", - "kind": "value", - "name": "someBy", - "docstrings": [ - "`someBy(start, finish, ~step, p)` See `Belt.Array.rangeBy`, equivalent to\n`Belt.Array.some(Belt.Array.rangeBy(start, finish, ~step), p)`\n\n## Examples\n\n```rescript\nBelt.Range.someBy(1, 5, ~step=2, i => mod(i, 2) === 0) == false\nBelt.Range.someBy(0, 4, ~step=2, i => mod(i, 2) === 0) == true\n```" - ], - "signature": "let someBy: (int, int, ~step: int, int => bool) => bool" - } - ] - }, - "belt/list": { - "id": "Belt.List", - "name": "List", - "docstrings": [ - "[`Belt.List`]()\n\n Utilities for List data type", - "Collection functions for manipulating the `list` data structures, a singly-linked list.\n\n**Prefer Array** if you need any of the following:\n\n- Random access of element\n- Better interop with JavaScript\n- Better memory usage & performance." - ], - "items": [ - { - "id": "Belt.List.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'a t` is compatible with built-in `list` type" - ], - "signature": "type t<'a> = list<'a>" - }, - { - "id": "Belt.List.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Returns the length of a list.\n\n## Examples\n\n```rescript\nBelt.List.length(list{1, 2, 3}) == 3\n```" - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Belt.List.size", - "kind": "value", - "name": "size", - "docstrings": [ - "See `Belt.List.length`" - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.List.head", - "kind": "value", - "name": "head", - "docstrings": [ - "Returns `Some(value)` where `value` is the first element in the list, or\n`None` if `someList` is an empty list.\n\n## Examples\n\n```rescript\nBelt.List.head(list{}) == None\nBelt.List.head(list{1, 2, 3}) == Some(1)\n```" - ], - "signature": "let head: t<'a> => option<'a>" - }, - { - "id": "Belt.List.headExn", - "kind": "value", - "name": "headExn", - "docstrings": [ - "Same as `Belt.List.head` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.headExn(list{1, 2, 3}) == 1\n\nswitch Belt.List.headExn(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let headExn: t<'a> => 'a" - }, - { - "id": "Belt.List.headOrThrow", - "kind": "value", - "name": "headOrThrow", - "docstrings": [ - "Same as `Belt.List.head` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.headOrThrow(list{1, 2, 3}) == 1\n\nswitch Belt.List.headOrThrow(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let headOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.List.tail", - "kind": "value", - "name": "tail", - "docstrings": [ - "Returns `None` if `someList` is empty, otherwise it returns `Some(tail)`\nwhere `tail` is everything except the first element of `someList`.\n\n## Examples\n\n```rescript\nBelt.List.tail(list{1, 2, 3}) == Some(list{2, 3})\n\nBelt.List.tail(list{}) == None\n```" - ], - "signature": "let tail: t<'a> => option>" - }, - { - "id": "Belt.List.tailExn", - "kind": "value", - "name": "tailExn", - "docstrings": [ - "Same as `Belt.List.tail` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.tailExn(list{1, 2, 3}) == list{2, 3}\n\nswitch Belt.List.tailExn(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let tailExn: t<'a> => t<'a>" - }, - { - "id": "Belt.List.tailOrThrow", - "kind": "value", - "name": "tailOrThrow", - "docstrings": [ - "Same as `Belt.List.tail` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.tailOrThrow(list{1, 2, 3}) == list{2, 3}\n\nswitch Belt.List.tailOrThrow(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let tailOrThrow: t<'a> => t<'a>" - }, - { - "id": "Belt.List.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds `value` to the beginning of `someList`.\n\n## Examples\n\n```rescript\nBelt.List.add(list{2, 3}, 1) // list{1, 2, 3}\n\nBelt.List.add(list{\"World\", \"!\"}, \"Hello\") == list{\"Hello\", \"World\", \"!\"}\n```" - ], - "signature": "let add: (t<'a>, 'a) => t<'a>" - }, - { - "id": "Belt.List.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Return the nth element in `someList`, or `None` if `index` is larger than the\nlength.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.get(1) == Some(\"B\")\n\nabc->Belt.List.get(4) == None\n```" - ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, - { - "id": "Belt.List.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as `Belt.List.get` but throws an exception if `index` is larger than the\nlength. Use with care.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.getExn(1) == \"B\"\n\nswitch abc->Belt.List.getExn(4) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getExn: (t<'a>, int) => 'a" - }, - { - "id": "Belt.List.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as `Belt.List.get` but throws an exception if `index` is larger than the\nlength. Use with care.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.getOrThrow(1) == \"B\"\n\nswitch abc->Belt.List.getOrThrow(4) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getOrThrow: (t<'a>, int) => 'a" - }, - { - "id": "Belt.List.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a list of length `numItems` with each element filled with value `v`. Returns an empty list if `numItems` is negative.\n\n## Examples\n\n```rescript\nBelt.List.make(3, 1) == list{1, 1, 1}\n```" - ], - "signature": "let make: (int, 'a) => t<'a>" - }, - { - "id": "Belt.List.makeByU", - "kind": "value", - "name": "makeByU", - "docstrings": [ - "Uncurried version of [makeBy](#makeBy)" - ], - "signature": "let makeByU: (int, int => 'a) => t<'a>", - "deprecated": "Use `makeBy` instead" - }, - { - "id": "Belt.List.makeBy", - "kind": "value", - "name": "makeBy", - "docstrings": [ - "Return a list of length `numItems` with element `i` initialized with `f(i)`.\nReturns an empty list if `numItems` is negative.\n\n## Examples\n\n```rescript\nBelt.List.makeBy(5, i => i) == list{0, 1, 2, 3, 4}\n\nBelt.List.makeBy(5, i => i * i) == list{0, 1, 4, 9, 16}\n```" - ], - "signature": "let makeBy: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.List.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "Returns a new list in random order.\n\n## Examples\n\n```rescript\nBelt.List.shuffle(list{1, 2, 3}) // list{2, 1, 3}\n```" - ], - "signature": "let shuffle: t<'a> => t<'a>" - }, - { - "id": "Belt.List.drop", - "kind": "value", - "name": "drop", - "docstrings": [ - "Return a new list, dropping the first `n` elements. Returns `None` if `someList` has fewer than `n` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.drop(2) == Some(list{3})\n\nlist{1, 2, 3}->Belt.List.drop(3) == Some(list{})\n\nlist{1, 2, 3}->Belt.List.drop(4) == None\n```" - ], - "signature": "let drop: (t<'a>, int) => option>" - }, - { - "id": "Belt.List.take", - "kind": "value", - "name": "take", - "docstrings": [ - "Returns a list with the first `n` elements from `someList`, or `None` if `someList` has fewer than `n` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.take(1) == Some(list{1})\n\nlist{1, 2, 3}->Belt.List.take(2) == Some(list{1, 2})\n\nlist{1, 2, 3}->Belt.List.take(4) == None\n```" - ], - "signature": "let take: (t<'a>, int) => option>" - }, - { - "id": "Belt.List.splitAt", - "kind": "value", - "name": "splitAt", - "docstrings": [ - "Split the list `someList` at `index`. Returns `None` when the length of `someList` is less than `index`.\n\n## Examples\n\n```rescript\nlist{\"Hello\", \"World\"}->Belt.List.splitAt(1) == Some((list{\"Hello\"}, list{\"World\"}))\n\nlist{0, 1, 2, 3, 4}->Belt.List.splitAt(2) == Some((list{0, 1}, list{2, 3, 4}))\n```" - ], - "signature": "let splitAt: (t<'a>, int) => option<(list<'a>, list<'a>)>" - }, - { - "id": "Belt.List.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "Returns the list obtained by adding `secondList` after `firstList`.\n\n## Examples\n\n```rescript\nBelt.List.concat(list{1, 2, 3}, list{4, 5}) == list{1, 2, 3, 4, 5}\n```" - ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Belt.List.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "Returns the list obtained by concatenating all the lists in array `a`, in\norder.\n\n## Examples\n\n```rescript\nBelt.List.concatMany([list{1, 2, 3}, list{}, list{3}]) == list{1, 2, 3, 3}\n```" - ], - "signature": "let concatMany: array> => t<'a>" - }, - { - "id": "Belt.List.reverseConcat", - "kind": "value", - "name": "reverseConcat", - "docstrings": [ - "Equivalent to writing: `concat(reverse(firstList, secondList)`\n\n## Examples\n\n```rescript\nBelt.List.reverseConcat(list{1, 2}, list{3, 4}) == list{2, 1, 3, 4}\n```" - ], - "signature": "let reverseConcat: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Belt.List.flatten", - "kind": "value", - "name": "flatten", - "docstrings": [ - "Return the list obtained by concatenating all the lists in list `ls`, in order.\n\n## Examples\n\n```rescript\nBelt.List.flatten(list{list{1, 2, 3}, list{}, list{3}}) == list{1, 2, 3, 3}\n```" - ], - "signature": "let flatten: t> => t<'a>" - }, - { - "id": "Belt.List.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [ - "Uncurried version of [map](#map)." - ], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.List.map", - "kind": "value", - "name": "map", - "docstrings": [ - "Returns a new list with `f` applied to each element of `someList`.\n\n## Examples\n\n```rescript\nlist{1, 2}->Belt.List.map(x => x + 1) == list{2, 3}\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.List.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "Returns a list of pairs from the two lists with the length of the shorter list.\n\n## Examples\n\n```rescript\nBelt.List.zip(list{1, 2}, list{3, 4, 5}) == list{(1, 3), (2, 4)}\n```" - ], - "signature": "let zip: (t<'a>, t<'b>) => t<('a, 'b)>" - }, - { - "id": "Belt.List.zipByU", - "kind": "value", - "name": "zipByU", - "docstrings": [ - "Uncurried version of [zipBy](#zipBy)." - ], - "signature": "let zipByU: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>", - "deprecated": "Use `zipBy` instead" - }, - { - "id": "Belt.List.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "See [Belt.List.zip](#zip)\n\n## Examples\n\n```rescript\nBelt.List.zipBy(list{1, 2, 3}, list{4, 5}, (a, b) => 2 * a + b) == list{6, 9}\n```" - ], - "signature": "let zipBy: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>" - }, - { - "id": "Belt.List.mapWithIndexU", - "kind": "value", - "name": "mapWithIndexU", - "docstrings": [ - "Uncurried version of [mapWithIndex](#mapWithIndex)." - ], - "signature": "let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => t<'b>", - "deprecated": "Use `mapWithIndex` instead" - }, - { - "id": "Belt.List.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "Applies `f` to each element of `someList`.\nFunction `f` takes two arguments: the index starting from 0 and the element from `someList`, in that order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.mapWithIndex((index, x) => index + x) == list{1, 3, 5}\n```" - ], - "signature": "let mapWithIndex: (t<'a>, (int, 'a) => 'b) => t<'b>" - }, - { - "id": "Belt.List.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Converts the given array to a list.\n\n## Examples\n\n```rescript\nBelt.List.fromArray([1, 2, 3]) == list{1, 2, 3}\n```" - ], - "signature": "let fromArray: array<'a> => t<'a>" - }, - { - "id": "Belt.List.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Converts the given list to an array.\n\n## Examples\n\n```rescript\nBelt.List.toArray(list{1, 2, 3}) == [1, 2, 3]\n```" - ], - "signature": "let toArray: t<'a> => array<'a>" - }, - { - "id": "Belt.List.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "Returns a new list whose elements are those of `someList` in reversed order.\n\n## Examples\n\n```rescript\nBelt.List.reverse(list{1, 2, 3}) == list{3, 2, 1}\n```" - ], - "signature": "let reverse: t<'a> => t<'a>" - }, - { - "id": "Belt.List.mapReverseU", - "kind": "value", - "name": "mapReverseU", - "docstrings": [ - "Uncurried version of [mapReverse](#mapReverse)." - ], - "signature": "let mapReverseU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `mapReverse` instead" - }, - { - "id": "Belt.List.mapReverse", - "kind": "value", - "name": "mapReverse", - "docstrings": [ - "Equivalent to `Belt.List.map(someList, f)->Belt.List.reverse`\n\n## Examples\n\n```rescript\nlist{3, 4, 5}->Belt.List.mapReverse(x => x * x) == list{25, 16, 9}\n```" - ], - "signature": "let mapReverse: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.List.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Uncurried version of [forEach](#forEach)." - ], - "signature": "let forEachU: (t<'a>, 'a => 'b) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.List.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Call `f` on each element of `someList` from the beginning to end.\n`f` returns `unit`, so no new array is created. Use `forEach` when you are primarily concerned with repetitively creating side effects.\n\n## Examples\n\n```rescript\nBelt.List.forEach(list{\"a\", \"b\", \"c\"}, x => Js.log(\"Item: \" ++ x))\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\n```" - ], - "signature": "let forEach: (t<'a>, 'a => 'b) => unit" - }, - { - "id": "Belt.List.forEachWithIndexU", - "kind": "value", - "name": "forEachWithIndexU", - "docstrings": [ - "Uncurried version of [forEachWithIndex](#forEachWithIndex)." - ], - "signature": "let forEachWithIndexU: (t<'a>, (int, 'a) => 'b) => unit", - "deprecated": "Use `forEachWithIndex` instead" - }, - { - "id": "Belt.List.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "Call `f` on each element of `someList` from beginning to end.\nFunction `f` takes two arguments: the index starting from 0 and the element from `someList`. `f` returns `unit`.\n\n## Examples\n\n```rescript\nBelt.List.forEachWithIndex(list{\"a\", \"b\", \"c\"}, (index, x) => {\n Js.log(\"Item \" ++ Belt.Int.toString(index) ++ \" is \" ++ x)\n})\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\n```" - ], - "signature": "let forEachWithIndex: (t<'a>, (int, 'a) => 'b) => unit" - }, - { - "id": "Belt.List.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [ - "Uncurried version of [reduce](#reduce)." - ], - "signature": "let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.List.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies `f` to each element of `someList` from beginning to end. Function `f` has two parameters: the item from the list and an “accumulator”, which starts with a value of `initialValue`. reduce returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduce(0, (a, b) => a + b) == 10\n\n/* same as */\n\nlist{1, 2, 3, 4}->Belt.List.reduce(0, (acc, item) => acc + item) == 10\n```" - ], - "signature": "let reduce: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Belt.List.reduceWithIndexU", - "kind": "value", - "name": "reduceWithIndexU", - "docstrings": [ - "Uncurried version of [reduceWithIndex](#reduceWithIndex)." - ], - "signature": "let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b", - "deprecated": "Use `reduceWithIndex` instead" - }, - { - "id": "Belt.List.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "Applies `f` to each element of `someList` from beginning to end. Function `f` has three parameters: the item from the list and an “accumulator”, which starts with a value of `initialValue` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduceWithIndex(0, (acc, item, index) => acc + item + index) == 16\n```" - ], - "signature": "let reduceWithIndex: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Belt.List.reduceReverseU", - "kind": "value", - "name": "reduceReverseU", - "docstrings": [ - "Uncurried version of [reduceReverse](#reduceReverse)." - ], - "signature": "let reduceReverseU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b", - "deprecated": "Use `reduceReverse` instead" - }, - { - "id": "Belt.List.reduceReverse", - "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "Works like [reduce](#reduce), except that function `f` is applied to each\nitem of `someList` from the last back to the first.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(0, (a, b) => a + b) == 10\n\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(10, (a, b) => a - b) == 0\n\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(list{}, Belt.List.add) == list{1, 2, 3, 4}\n```" - ], - "signature": "let reduceReverse: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Belt.List.mapReverse2U", - "kind": "value", - "name": "mapReverse2U", - "docstrings": [ - "Uncurried version of [mapReverse2](#mapReverse2)." - ], - "signature": "let mapReverse2U: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>", - "deprecated": "Use `mapReverse2` instead" - }, - { - "id": "Belt.List.mapReverse2", - "kind": "value", - "name": "mapReverse2", - "docstrings": [ - "Equivalent to: `zipBy(xs, ys, f)->reverse`\n\n## Examples\n\n```rescript\nBelt.List.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) == list{4, 2}\n```" - ], - "signature": "let mapReverse2: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>" - }, - { - "id": "Belt.List.forEach2U", - "kind": "value", - "name": "forEach2U", - "docstrings": [ - "Uncurried version of [forEach2](#forEach2)." - ], - "signature": "let forEach2U: (t<'a>, t<'b>, ('a, 'b) => 'c) => unit", - "deprecated": "Use `forEach2` instead" - }, - { - "id": "Belt.List.forEach2", - "kind": "value", - "name": "forEach2", - "docstrings": [ - "Stops at the length of the shorter list.\n\n## Examples\n\n```rescript\nBelt.List.forEach2(list{\"Z\", \"Y\"}, list{\"A\", \"B\", \"C\"}, (x, y) => Js.log2(x, y))\n\n/*\n prints:\n \"Z\" \"A\"\n \"Y\" \"B\"\n*/\n```" - ], - "signature": "let forEach2: (t<'a>, t<'b>, ('a, 'b) => 'c) => unit" - }, - { - "id": "Belt.List.reduce2U", - "kind": "value", - "name": "reduce2U", - "docstrings": [ - "Uncurried version of [reduce2](#reduce2)." - ], - "signature": "let reduce2U: (t<'b>, t<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a", - "deprecated": "Use `reduce2` instead" - }, - { - "id": "Belt.List.reduce2", - "kind": "value", - "name": "reduce2", - "docstrings": [ - "Applies `f` to each element of `firstList` and `secondList` from beginning to end. Stops with the shorter list. Function `f` has three parameters: an “accumulator” which starts with a value of `initialValue`, an item from `firstList`, and an item from `secondList`. `reduce2` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nBelt.List.reduce2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduce2: (t<'b>, t<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a" - }, - { - "id": "Belt.List.reduceReverse2U", - "kind": "value", - "name": "reduceReverse2U", - "docstrings": [ - "Uncurried version of [reduceReverse2](#reduceReverse2)." - ], - "signature": "let reduceReverse2U: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c", - "deprecated": "Use `reduceReverse2` instead" - }, - { - "id": "Belt.List.reduceReverse2", - "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "Applies `f` to each element of `firstList` and `secondList` from end to\nbeginning. Stops with the shorter list. Function `f` has three parameters: an\n“accumulator” which starts with a value of init, an item from `firstList`,\nand an item from `secondList`. `reduce2` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nBelt.List.reduceReverse2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduceReverse2: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" - }, - { - "id": "Belt.List.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [ - "Uncurried version of [every](#every)." - ], - "signature": "let everyU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.List.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Returns `true` if all elements satisfy `pred`, where `pred` is a predicate: a function taking an element and returning a bool.\n\n## Examples\n\n```rescript\nlet isBelow10 = value => value < 10\n\nlist{1, 9, 8, 2}->Belt.List.every(isBelow10) == true\n\nlist{1, 99, 8, 2}->Belt.List.every(isBelow10) == false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.List.someU", - "kind": "value", - "name": "someU", - "docstrings": [ - "Uncurried version of [some](#some)." - ], - "signature": "let someU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.List.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Returns `true` if at least _one_ of the elements in `someList` satisfies\n`pred`, where `pred` is a predicate: a function taking an element and\nreturning a bool.\n\n## Examples\n\n```rescript\nlet isAbove100 = value => value > 100\n\nlist{101, 1, 2, 3}->Belt.List.some(isAbove100) == true\n\nlist{1, 2, 3, 4}->Belt.List.some(isAbove100) == false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.List.every2U", - "kind": "value", - "name": "every2U", - "docstrings": [ - "Uncurried version of [every2](#every2)." - ], - "signature": "let every2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `every2` instead" - }, - { - "id": "Belt.List.every2", - "kind": "value", - "name": "every2", - "docstrings": [ - "Returns `true` if predicate `pred(a, b)` is `true` for all pairs of elements\nup to the shorter length (i.e. `min(length(firstList), length(secondList))`)\n\n## Examples\n\n```rescript\nBelt.List.every2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nBelt.List.every2(list{}, list{1}, (a, b) => a > b) == true\n\nBelt.List.every2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nBelt.List.every2(list{0, 1}, list{5, 0}, (a, b) => a > b) == false\n```" - ], - "signature": "let every2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.some2U", - "kind": "value", - "name": "some2U", - "docstrings": [ - "Uncurried version of [some2](#some2)." - ], - "signature": "let some2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `some2` instead" - }, - { - "id": "Belt.List.some2", - "kind": "value", - "name": "some2", - "docstrings": [ - "Returns `true` if predicate `pred(a, b)` is true for any pair of elements up\nto the shorter length (i.e. `min(length(firstList), length(secondList))`)\n\n## Examples\n\n```rescript\nBelt.List.some2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nBelt.List.some2(list{}, list{1}, (a, b) => a > b) == false\n\nBelt.List.some2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nBelt.List.some2(list{0, 1}, list{5, 0}, (a, b) => a > b) == true\n```" - ], - "signature": "let some2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.cmpByLength", - "kind": "value", - "name": "cmpByLength", - "docstrings": [ - "Compare two lists solely by length. Returns `-1` if `length(firstList)` is\nless than `length(secondList)`, `0` if `length(firstList)` equals\n`length(secondList)`, and `1` if `length(firstList)` is greater than\n`length(secondList)`.\n\n## Examples\n\n```rescript\nBelt.List.cmpByLength(list{1, 2}, list{3, 4, 5, 6}) == -1\n\nBelt.List.cmpByLength(list{1, 2, 3}, list{4, 5, 6}) == 0\n\nBelt.List.cmpByLength(list{1, 2, 3, 4}, list{5, 6}) == 1\n```" - ], - "signature": "let cmpByLength: (t<'a>, t<'a>) => int" - }, - { - "id": "Belt.List.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [ - "Uncurried version of [cmp](#cmp)." - ], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.List.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Compare elements one by one `compareFn(a, b)`. `compareFn` returns a negative number if `a` is \"less than\" `b`, zero if `a` is \"equal to\" `b`, a positive number if `a` is \"greater than\" `b`.\n\nThe comparison returns the first non-zero result of `compareFn`, or zero if `compareFn` returns zero for all `a` and `b`.\n\nIf all items have compared equal, but `firstList` is exhausted first, return `-1`. (`firstList` is shorter).\nIf all items have compared equal, but `secondList` is exhausted first, return `1` (`firstList` is longer).\n\n## Examples\n\n```rescript\nBelt.List.cmp(list{3}, list{3, 7}, (a, b) => compare(a, b)) == -1\n\nBelt.List.cmp(list{5, 3}, list{5}, (a, b) => compare(a, b)) == 1\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 4, 2}, (a, b) => compare(a, b)) == -1\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 2, 3}, (a, b) => compare(a, b)) == 1\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 3, 5}, (a, b) => compare(a, b)) == 0\n```\n\n**Please note:** The total ordering of List is different from Array,\nfor Array, we compare the length first and, only if the lengths are equal, elements one by one.\nFor lists, we just compare elements one by one." - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.List.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [ - "Uncurried version of [eq](#eq)." - ], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.List.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Check equality of `firstList` and `secondList` using `eqElem` for equality on\nelements, where `eqElem` is a function that returns `true` if items `x` and\n`y` meet some criterion for equality, `false` otherwise. eq `false` if length\nof `firstList` and `secondList` are not the same.\n\n## Examples\n\n```rescript\nBelt.List.eq(list{1, 2, 3}, list{1, 2}, (a, b) => a == b) == false\n\nBelt.List.eq(list{1, 2}, list{1, 2}, (a, b) => a == b) == true\n\nBelt.List.eq(list{1, 2, 3}, list{-1, -2, -3}, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.List.hasU", - "kind": "value", - "name": "hasU", - "docstrings": [ - "Uncurried version of [has](#has)." - ], - "signature": "let hasU: (t<'a>, 'b, ('a, 'b) => bool) => bool", - "deprecated": "Use `has` instead" - }, - { - "id": "Belt.List.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Returns `true` if the list contains at least one element for which\n`eqFunction(x)` returns true.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.has(2, (a, b) => a == b) == true\n\nlist{1, 2, 3}->Belt.List.has(4, (a, b) => a == b) == false\n\nlist{-1, -2, -3}->Belt.List.has(2, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let has: (t<'a>, 'b, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.getByU", - "kind": "value", - "name": "getByU", - "docstrings": [ - "Uncurried version of [getBy](#getBy)." - ], - "signature": "let getByU: (t<'a>, 'a => bool) => option<'a>", - "deprecated": "Use `getBy` instead" - }, - { - "id": "Belt.List.getBy", - "kind": "value", - "name": "getBy", - "docstrings": [ - "Returns `Some(value)` for the first value in `someList` that satisfies the\npredicate function `pred`. Returns `None` if no element satisfies the function.\n\n## Examples\n\n```rescript\nBelt.List.getBy(list{1, 4, 3, 2}, x => x > 3) == Some(4)\n\nBelt.List.getBy(list{1, 4, 3, 2}, x => x > 4) == None\n```" - ], - "signature": "let getBy: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Belt.List.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [ - "Uncurried version of [keep](#keep)." - ], - "signature": "let keepU: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.List.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.keep(list{1, 2, 3, 4}, isEven) == list{2, 4}\n\nBelt.List.keep(list{None, Some(2), Some(3), None}, Belt.Option.isSome) == list{Some(2), Some(3)}\n```" - ], - "signature": "let keep: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Belt.List.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.filter(list{1, 2, 3, 4}, isEven) == list{2, 4}\n\nBelt.List.filter(list{None, Some(2), Some(3), None}, Belt.Option.isSome) == list{Some(2), Some(3)}\n```" - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "This function will soon be deprecated. Please, use `List.keep` instead." - }, - { - "id": "Belt.List.keepWithIndexU", - "kind": "value", - "name": "keepWithIndexU", - "docstrings": [ - "Uncurried version of [keepWithIndex](#keepWithIndex)." - ], - "signature": "let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "Use `keepWithIndex` instead" - }, - { - "id": "Belt.List.keepWithIndex", - "kind": "value", - "name": "keepWithIndex", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.keepWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) == list{1, 3}\n```" - ], - "signature": "let keepWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" - }, - { - "id": "Belt.List.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.filterWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) == list{1, 3}\n```" - ], - "signature": "let filterWithIndex: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "This function will soon be deprecated. Please, use `List.keepWithIndex` \\\n instead." - }, - { - "id": "Belt.List.keepMapU", - "kind": "value", - "name": "keepMapU", - "docstrings": [ - "Uncurried version of [keepMap](#keepMap)." - ], - "signature": "let keepMapU: (t<'a>, 'a => option<'b>) => t<'b>", - "deprecated": "Use `keepMap` instead" - }, - { - "id": "Belt.List.keepMap", - "kind": "value", - "name": "keepMap", - "docstrings": [ - "Applies `f` to each element of `someList`. If `f(x)` returns `Some(value)`, then `value` is _kept_ in the resulting list.\nIf `f(x)` returns `None`, the element is _not_ retained in the result.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nlist{1, 2, 3, 4}->Belt.List.keepMap(x =>\n if isEven(x) {\n Some(x)\n } else {\n None\n }\n) /* list{2, 4} */\n\nlist{Some(1), Some(2), None}->Belt.List.keepMap(x => x) == list{1, 2}\n```" - ], - "signature": "let keepMap: (t<'a>, 'a => option<'b>) => t<'b>" - }, - { - "id": "Belt.List.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [ - "Uncurried version of [partition](#partition)." - ], - "signature": "let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.List.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "Creates a pair of lists; the first list consists of all elements of `someList` that satisfy the predicate function `pred`; the second list consists of all elements of `someList` that _do not_ satisfy \\`pred.\n\nIn other words:\n\n```\n(elementsThatSatisfies, elementsThatDoesNotSatisfy)\n```\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.partition(x => x > 2) == (list{3, 4}, list{1, 2})\n```" - ], - "signature": "let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)" - }, - { - "id": "Belt.List.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "Takes a list of pairs and creates a pair of lists. The first list contains all the first items of the pairs; the second list contains all the second items.\n\n## Examples\n\n```rescript\nBelt.List.unzip(list{(1, 2), (3, 4)}) == (list{1, 3}, list{2, 4})\n\nBelt.List.unzip(list{(\"H\", \"W\"), (\"e\", \"o\"), (\"l\", \"r\"), (\"l\", \"l\"), (\"o\", \"d\"), (\" \", \"!\")}) ==\n (list{\"H\", \"e\", \"l\", \"l\", \"o\", \" \"}, list{\"W\", \"o\", \"r\", \"l\", \"d\", \"!\"})\n```" - ], - "signature": "let unzip: t<('a, 'b)> => (t<'a>, t<'b>)" - }, - { - "id": "Belt.List.getAssocU", - "kind": "value", - "name": "getAssocU", - "docstrings": [ - "Uncurried version of [getAssoc](#getAssoc)." - ], - "signature": "let getAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>", - "deprecated": "Use `getAssoc` instead" - }, - { - "id": "Belt.List.getAssoc", - "kind": "value", - "name": "getAssoc", - "docstrings": [ - "Return the second element of a pair in `someList` where the first element equals `k` as per the predicate function `eqFunction`, or `None` if not found.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.getAssoc(3, (a, b) => a == b) /* Some(\"c\") */\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.getAssoc(15, (k, item) =>\n k /* 15 */ == item\n) == Some(\"afternoon\")\n/* 9, 5, 22 */\n```" - ], - "signature": "let getAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>" - }, - { - "id": "Belt.List.hasAssocU", - "kind": "value", - "name": "hasAssocU", - "docstrings": [ - "Uncurried version of [hasAssoc](#hasAssoc)." - ], - "signature": "let hasAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => bool", - "deprecated": "Use `hasAssoc` instead" - }, - { - "id": "Belt.List.hasAssoc", - "kind": "value", - "name": "hasAssoc", - "docstrings": [ - "Returns `true` if there is a pair in `someList` where the first element equals `k` as per the predicate function `eqFunction`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.hasAssoc(1, (a, b) => a == b) == true\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.hasAssoc(25, (k, item) =>\n k /* 25 */ == item\n) == false\n/* 9, 5, 22 */\n```" - ], - "signature": "let hasAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.removeAssocU", - "kind": "value", - "name": "removeAssocU", - "docstrings": [ - "Uncurried version of [removeAssoc](#removeAssoc)." - ], - "signature": "let removeAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => t<('a, 'c)>", - "deprecated": "Use `removeAssoc` instead" - }, - { - "id": "Belt.List.removeAssoc", - "kind": "value", - "name": "removeAssoc", - "docstrings": [ - "Return a list after removing the first pair whose first value is `k` per the equality predicate `eqFunction`; if not found, return a new list identical to `someList`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.removeAssoc(1, (a, b) => a == b) ==\n list{(2, \"b\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.removeAssoc(9, (k, item) =>\n k /* 9 */ == item\n) == list{(15, \"afternoon\"), (22, \"night\")}\n/* 9, 5, 22 */\n```" - ], - "signature": "let removeAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => t<('a, 'c)>" - }, - { - "id": "Belt.List.setAssocU", - "kind": "value", - "name": "setAssocU", - "docstrings": [ - "Uncurried version of [setAssoc](#setAssoc)." - ], - "signature": "let setAssocU: (t<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => t<('a, 'c)>", - "deprecated": "Use `setAssoc` instead" - }, - { - "id": "Belt.List.setAssoc", - "kind": "value", - "name": "setAssoc", - "docstrings": [ - "If `k` exists in `someList` by satisfying the `eqFunction` predicate, return a new list with the key and value replaced by the new `k` and `v`; otherwise, return a new list with the pair `k`, `v` added to the head of `someList`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.setAssoc(2, \"x\", (a, b) => a == b) ==\n list{(1, \"a\"), (2, \"x\"), (3, \"c\")}\n\nlist{(1, \"a\"), (3, \"c\")}->Belt.List.setAssoc(2, \"b\", (a, b) => a == b) ==\n list{(2, \"b\"), (1, \"a\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (3, \"morning?!\"), (22, \"night\")}->Belt.List.setAssoc(15, \"afternoon\", (a, b) =>\n mod(a, 12) == mod(b, 12)\n) == list{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n```\n\n**Please note**\n\nIn the last example, since: `15 mod 12` equals `3 mod 12`\n\nBoth the key _and_ the value are replaced in the list." - ], - "signature": "let setAssoc: (t<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => t<('a, 'c)>" - }, - { - "id": "Belt.List.sortU", - "kind": "value", - "name": "sortU", - "docstrings": [ - "Uncurried version of [sort](#sort)." - ], - "signature": "let sortU: (t<'a>, ('a, 'a) => int) => t<'a>", - "deprecated": "Use `sort` instead" - }, - { - "id": "Belt.List.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "Returns a sorted list.\n\n## Examples\n\n```rescript\nBelt.List.sort(list{5, 4, 9, 3, 7}, (a, b) => a - b) == list{3, 4, 5, 7, 9}\n```" - ], - "signature": "let sort: (t<'a>, ('a, 'a) => int) => t<'a>" - } - ] - }, - "belt/mutablestack": { - "id": "Belt.MutableStack", - "name": "MutableStack", - "docstrings": [ - "[`Belt.MutableStack`]()\n\n An FILO(first in last out) stack data structure", - "First in last out stack. This module implements stacks, with in-place\nmodification." - ], - "items": [ - { - "id": "Belt.MutableStack.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableStack.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a new stack, initially empty." - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableStack.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Discard all elements from the stack." - ], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableStack.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(x)` O(1) operation, return a new stack." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.MutableStack.push", - "kind": "value", - "name": "push", - "docstrings": [], - "signature": "let push: (t<'a>, 'a) => unit" - }, - { - "id": "Belt.MutableStack.pop", - "kind": "value", - "name": "pop", - "docstrings": [], - "signature": "let pop: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableStack.popOrThrow", - "kind": "value", - "name": "popOrThrow", - "docstrings": [], - "signature": "let popOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.MutableStack.top", - "kind": "value", - "name": "top", - "docstrings": [], - "signature": "let top: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableStack.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableStack.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableStack.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableStack.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.MutableStack.dynamicPopIterU", - "kind": "value", - "name": "dynamicPopIterU", - "docstrings": [], - "signature": "let dynamicPopIterU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `dynamicPopIter` instead" - }, - { - "id": "Belt.MutableStack.dynamicPopIter", - "kind": "value", - "name": "dynamicPopIter", - "docstrings": [ - "`dynamicPopIter(s, f)` apply `f` to each element of `s`. The item is poped\nbefore applying `f`, `s` will be empty after this opeartion. This function is\nuseful for worklist algorithm." - ], - "signature": "let dynamicPopIter: (t<'a>, 'a => unit) => unit" - } - ] - }, - "belt/mutablequeue": { - "id": "Belt.MutableQueue", - "name": "MutableQueue", - "docstrings": [ - "[`Belt.MutableQueue`]()\n\n An FIFO(first in first out) queue data structure", - "A FIFO (first in first out) queue data structure." - ], - "items": [ - { - "id": "Belt.MutableQueue.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of queues containing elements of `type('a)`." - ], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableQueue.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a new queue, initially empty." - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableQueue.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Discard all elements from the queue." - ], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableQueue.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Returns `true` if the given queue is empty, `false` otherwise." - ], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableQueue.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` a is equivalent to `Array.forEach(a, add(q, a));`" - ], - "signature": "let fromArray: array<'a> => t<'a>" - }, - { - "id": "Belt.MutableQueue.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(q, x)` adds the element `x` at the end of the queue `q`." - ], - "signature": "let add: (t<'a>, 'a) => unit" - }, - { - "id": "Belt.MutableQueue.peek", - "kind": "value", - "name": "peek", - "docstrings": [ - "`peekOpt(q)` returns the first element in queue `q`, without removing it from the queue." - ], - "signature": "let peek: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableQueue.peekExn", - "kind": "value", - "name": "peekExn", - "docstrings": [ - "`peekExn(q)` throws an exception if `q` is empty." - ], - "signature": "let peekExn: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.peekOrThrow", - "kind": "value", - "name": "peekOrThrow", - "docstrings": [ - "`peekOrThrow(q)` throws an exception if `q` is empty." - ], - "signature": "let peekOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "`pop(q)` removes and returns the first element in queue `q`." - ], - "signature": "let pop: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableQueue.popExn", - "kind": "value", - "name": "popExn", - "docstrings": [ - "`popExn(q)` throw an exception if q is empty." - ], - "signature": "let popExn: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.popOrThrow", - "kind": "value", - "name": "popOrThrow", - "docstrings": [ - "`popOrThrow(q)` throw an exception if q is empty." - ], - "signature": "let popOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(q)` returns a fresh queue." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.MutableQueue.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns the number of elements in a queue." - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableQueue.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableQueue.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.MutableQueue.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableQueue.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(q, f) applies`f`in turn to all elements of`q`, from the least\nrecently entered to the most recently entered. The queue itself is unchanged." - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.MutableQueue.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableQueue.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(q, accu, f)` is equivalent to `List.reduce(l, accu, f)`, where `l` is the\nlist of `q`'s elements. The queue remains unchanged." - ], - "signature": "let reduce: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableQueue.transfer", - "kind": "value", - "name": "transfer", - "docstrings": [ - "`transfer(q1, q2)` adds all of `q1`'s elements at the end of the queue `q2`,\nthen clears `q1`. It is equivalent to the sequence `forEach((x) => add(x, q2), q1)`;\nclear `q1`, but runs in constant time." - ], - "signature": "let transfer: (t<'a>, t<'a>) => unit" - }, - { - "id": "Belt.MutableQueue.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "First added will be in the beginning of the array." - ], - "signature": "let toArray: t<'a> => array<'a>" - } - ] - }, - "belt/sortarray": { - "id": "Belt.SortArray", - "name": "SortArray", - "docstrings": [ - "[`Belt.SortArray`]()\n\n The top level provides some generic sort related utilities.\n\n It also has two specialized inner modules\n [`Belt.SortArray.Int`]() and [`Belt.SortArray.String`]()", - "A module for Array sort relevant utiliites" - ], - "items": [ - { - "id": "Belt.SortArray.strictlySortedLengthU", - "kind": "value", - "name": "strictlySortedLengthU", - "docstrings": [], - "signature": "let strictlySortedLengthU: (array<'a>, ('a, 'a) => bool) => int", - "deprecated": "Use `strictlySortedLength` instead" - }, - { - "id": "Belt.SortArray.strictlySortedLength", - "kind": "value", - "name": "strictlySortedLength", - "docstrings": [ - "`strictlySortedLenght(xs, cmp);` return `+n` means increasing order `-n` means negative order\n\n## Examples\n\n```rescript\nBelt.SortArray.strictlySortedLength([1, 2, 3, 4, 3], (x, y) => x < y) == 4\n\nBelt.SortArray.strictlySortedLength([], (x, y) => x < y) == 0\n\nBelt.SortArray.strictlySortedLength([1], (x, y) => x < y) == 1\n\nBelt.SortArray.strictlySortedLength([4, 3, 2, 1], (x, y) => x < y) == -4\n```" - ], - "signature": "let strictlySortedLength: (array<'a>, ('a, 'a) => bool) => int" - }, - { - "id": "Belt.SortArray.isSortedU", - "kind": "value", - "name": "isSortedU", - "docstrings": [], - "signature": "let isSortedU: (array<'a>, ('a, 'a) => int) => bool", - "deprecated": "Use `isSorted` instead" - }, - { - "id": "Belt.SortArray.isSorted", - "kind": "value", - "name": "isSorted", - "docstrings": [ - "`isSorted(arr, cmp)`: Returns true if array is increasingly sorted (equal is okay)" - ], - "signature": "let isSorted: (array<'a>, ('a, 'a) => int) => bool" - }, - { - "id": "Belt.SortArray.stableSortInPlaceByU", - "kind": "value", - "name": "stableSortInPlaceByU", - "docstrings": [], - "signature": "let stableSortInPlaceByU: (array<'a>, ('a, 'a) => int) => unit", - "deprecated": "Use `stableSortInPlaceBy` instead" - }, - { - "id": "Belt.SortArray.stableSortInPlaceBy", - "kind": "value", - "name": "stableSortInPlaceBy", - "docstrings": [], - "signature": "let stableSortInPlaceBy: (array<'a>, ('a, 'a) => int) => unit" - }, - { - "id": "Belt.SortArray.stableSortByU", - "kind": "value", - "name": "stableSortByU", - "docstrings": [], - "signature": "let stableSortByU: (array<'a>, ('a, 'a) => int) => array<'a>", - "deprecated": "Use `stableSortBy` instead" - }, - { - "id": "Belt.SortArray.stableSortBy", - "kind": "value", - "name": "stableSortBy", - "docstrings": [ - "`stableSortBy(xs, cmp)`: Returns a fresh array Sort `xs` in place using\ncomparator `cmp`, the stable means if the elements are equal, their order will\nbe preserved" - ], - "signature": "let stableSortBy: (array<'a>, ('a, 'a) => int) => array<'a>" - }, - { - "id": "Belt.SortArray.binarySearchByU", - "kind": "value", - "name": "binarySearchByU", - "docstrings": [], - "signature": "let binarySearchByU: (array<'a>, 'a, ('a, 'a) => int) => int", - "deprecated": "Use `binarySearchBy` instead" - }, - { - "id": "Belt.SortArray.binarySearchBy", - "kind": "value", - "name": "binarySearchBy", - "docstrings": [ - "If value is not found and value is less than one or more elements in array, the\nnegative number returned is the bitwise complement of the index of the first\nelement that is larger than value.\n\nIf value is not found and value is greater\nthan all elements in array, the negative number returned is the bitwise\ncomplement of (the index of the last element plus 1)for example, if `key` is\nsmaller than all elements return `-1` since `lnot(-1) == 0` if `key` is larger\nthan all elements return `lnot(-1) == 0` since `lnot(- (len + 1)) == len`\n\n## Examples\n\n```rescript\nBelt.SortArray.binarySearchBy([1, 2, 3, 4, 33, 35, 36], 33, Pervasives.compare) == 4\n\nlnot(Belt.SortArray.binarySearchBy([1, 3, 5, 7], 4, Pervasives.compare)) == 2\n```" - ], - "signature": "let binarySearchBy: (array<'a>, 'a, ('a, 'a) => int) => int" - }, - { - "id": "Belt.SortArray.unionU", - "kind": "value", - "name": "unionU", - "docstrings": [], - "signature": "let unionU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int", - "deprecated": "Use `union` instead" - }, - { - "id": "Belt.SortArray.union", - "kind": "value", - "name": "union", - "docstrings": [ - "`union src src1ofs src1len src2 src2ofs src2len dst dstofs cmp` assume `src` and\n`src2` is strictly sorted. for equivalent elements, it is picked from `src`\nalso assume that `dst` is large enough to store all elements" - ], - "signature": "let union: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int" - }, - { - "id": "Belt.SortArray.intersectU", - "kind": "value", - "name": "intersectU", - "docstrings": [], - "signature": "let intersectU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int", - "deprecated": "Use `intersect` instead" - }, - { - "id": "Belt.SortArray.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "`union src src1ofs src1len src2 src2ofs src2len dst dstofs cmp`\n\n**return** the `offset` in the output array" - ], - "signature": "let intersect: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int" - }, - { - "id": "Belt.SortArray.diffU", - "kind": "value", - "name": "diffU", - "docstrings": [], - "signature": "let diffU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int", - "deprecated": "Use `diff` instead" - }, - { - "id": "Belt.SortArray.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int" - } - ] - }, - "belt/array": { - "id": "Belt.Array", - "name": "Array", - "docstrings": [ - "[`Belt.Array`]()\n\n **mutable array**: Utilities functions", - "Utilities for `Array` functions." - ], - "items": [ - { - "id": "Belt.Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = array<'a>" - }, - { - "id": "Belt.Array.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Return the size of the array\n\n## Examples\n\n```rescript\nBelt.Array.length([\"test\"]) == 1\n```" - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Belt.Array.size", - "kind": "value", - "name": "size", - "docstrings": [ - "See [`Belt.Array.length`]()" - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.Array.get", - "kind": "value", - "name": "get", - "docstrings": [ - "If `i <= 0 <= length(arr)` returns `Some(value)` where `value` is the item at index `i`.\nIf `i` is out of range returns `None`.\n\n## Examples\n\n```rescript\nBelt.Array.get([\"a\", \"b\", \"c\"], 0) == Some(\"a\")\nBelt.Array.get([\"a\", \"b\", \"c\"], 3) == None\nBelt.Array.get([\"a\", \"b\", \"c\"], -1) == None\n```" - ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, - { - "id": "Belt.Array.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Throw an exception if `i` is out of range.\nOtherwise return the value at index `i` in `arr`." - ], - "signature": "let getExn: (t<'a>, int) => 'a" - }, - { - "id": "Belt.Array.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Throw an exception if `i` is out of range.\nOtherwise return the value at index `i` in `arr`." - ], - "signature": "let getOrThrow: (t<'a>, int) => 'a" - }, - { - "id": "Belt.Array.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(arr, i)`\n\n**Unsafe**\n\nno bounds checking; this would cause type error if `i` does not stay within range" - ], - "signature": "let getUnsafe: (t<'a>, int) => 'a" - }, - { - "id": "Belt.Array.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(arr, n, x)` modifies `arr` in place; it replaces the nth element of `arr`\nwith `x`. Returning `false` means not updated due to out of range." - ], - "signature": "let set: (t<'a>, int, 'a) => bool" - }, - { - "id": "Belt.Array.setExn", - "kind": "value", - "name": "setExn", - "docstrings": [ - "`setExn(arr, i, x)` throw an exception if `i` is out of range." - ], - "signature": "let setExn: (t<'a>, int, 'a) => unit" - }, - { - "id": "Belt.Array.setOrThrow", - "kind": "value", - "name": "setOrThrow", - "docstrings": [ - "`setOrThrow(arr, i, x)` throw an exception if `i` is out of range." - ], - "signature": "let setOrThrow: (t<'a>, int, 'a) => unit" - }, - { - "id": "Belt.Array.setUnsafe", - "kind": "value", - "name": "setUnsafe", - "docstrings": [], - "signature": "let setUnsafe: (t<'a>, int, 'a) => unit" - }, - { - "id": "Belt.Array.shuffleInPlace", - "kind": "value", - "name": "shuffleInPlace", - "docstrings": [ - "`shuffleInPlace(arr)` randomly re-orders the items in `arr`" - ], - "signature": "let shuffleInPlace: t<'a> => unit" - }, - { - "id": "Belt.Array.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "Returns a fresh array with items in original array randomly shuffled." - ], - "signature": "let shuffle: t<'a> => t<'a>" - }, - { - "id": "Belt.Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [ - "`reverseInPlace(arr)` reverses items in `arr` in place.\n\n## Examples\n\n```rescript\nlet arr = [10, 11, 12, 13, 14]\n\nlet () = Belt.Array.reverseInPlace(arr)\n\narr == [14, 13, 12, 11, 10]\n```" - ], - "signature": "let reverseInPlace: t<'a> => unit" - }, - { - "id": "Belt.Array.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(arr)` returns a fresh array with items in arr in reverse order.\n\n## Examples\n\n```rescript\nBelt.Array.reverse([10, 11, 12, 13, 14]) == [14, 13, 12, 11, 10]\n```" - ], - "signature": "let reverse: t<'a> => t<'a>" - }, - { - "id": "Belt.Array.makeUninitialized", - "kind": "value", - "name": "makeUninitialized", - "docstrings": [ - "`makeUninitialized(n)` creates an array of length `n` filled with the undefined\nvalue. You must specify the type of data that will eventually fill the array.\n\n## Examples\n\n```rescript\nlet arr: array> = Belt.Array.makeUninitialized(5)\n\nBelt.Array.getExn(arr, 0) == Js.undefined\n```" - ], - "signature": "let makeUninitialized: int => array>" - }, - { - "id": "Belt.Array.makeUninitializedUnsafe", - "kind": "value", - "name": "makeUninitializedUnsafe", - "docstrings": [ - "**Unsafe**\n\n## Examples\n\n```rescript\nlet arr = Belt.Array.makeUninitializedUnsafe(5)\n\nJs.log(Belt.Array.getExn(arr, 0)) // undefined\n\nBelt.Array.setExn(arr, 0, \"example\")\n\nBelt.Array.getExn(arr, 0) == \"example\"\n```" - ], - "signature": "let makeUninitializedUnsafe: int => t<'a>" - }, - { - "id": "Belt.Array.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(n, e)` return an array of size `n` filled with value `e`.\nReturns an empty array when `n` is negative." - ], - "signature": "let make: (int, 'a) => t<'a>" - }, - { - "id": "Belt.Array.range", - "kind": "value", - "name": "range", - "docstrings": [ - "`range(start, finish)` create an inclusive array.\n\n## Examples\n\n```rescript\nBelt.Array.range(0, 3) == [0, 1, 2, 3]\n\nBelt.Array.range(3, 0) == []\n\nBelt.Array.range(3, 3) == [3]\n```" - ], - "signature": "let range: (int, int) => array" - }, - { - "id": "Belt.Array.rangeBy", - "kind": "value", - "name": "rangeBy", - "docstrings": [ - "`rangeBy(start, finish, ~step)` returns empty array when step is 0 or negative.\nIt also return an empty array when `start > finish`.\n\n## Examples\n\n```rescript\nBelt.Array.rangeBy(0, 10, ~step=3) == [0, 3, 6, 9]\n\nBelt.Array.rangeBy(0, 12, ~step=3) == [0, 3, 6, 9, 12]\n\nBelt.Array.rangeBy(33, 0, ~step=1) == []\n\nBelt.Array.rangeBy(33, 0, ~step=-1) == []\n\nBelt.Array.rangeBy(3, 12, ~step=-1) == []\n\nBelt.Array.rangeBy(3, 3, ~step=0) == []\n\nBelt.Array.rangeBy(3, 3, ~step=1) == [3]\n```" - ], - "signature": "let rangeBy: (int, int, ~step: int) => array" - }, - { - "id": "Belt.Array.makeByU", - "kind": "value", - "name": "makeByU", - "docstrings": [], - "signature": "let makeByU: (int, int => 'a) => t<'a>", - "deprecated": "Use `makeBy` instead" - }, - { - "id": "Belt.Array.makeBy", - "kind": "value", - "name": "makeBy", - "docstrings": [ - "`makeBy(n, f)` return an empty array when n is negative return an array of size\nn populated by `f(i)` start from `0` to `n - 1`.\n\n## Examples\n\n```rescript\nBelt.Array.makeBy(5, i => i) == [0, 1, 2, 3, 4]\n\nBelt.Array.makeBy(5, i => i * i) == [0, 1, 4, 9, 16]\n```" - ], - "signature": "let makeBy: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.Array.makeByAndShuffleU", - "kind": "value", - "name": "makeByAndShuffleU", - "docstrings": [], - "signature": "let makeByAndShuffleU: (int, int => 'a) => t<'a>", - "deprecated": "Use `makeByAndShuffle` instead" - }, - { - "id": "Belt.Array.makeByAndShuffle", - "kind": "value", - "name": "makeByAndShuffle", - "docstrings": [ - "Equivalent to `shuffle(makeBy(n, f))`" - ], - "signature": "let makeByAndShuffle: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.Array.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "`zip(a, b)` create an array of pairs from corresponding elements of a and b.\nStop with the shorter array.\n\n## Examples\n\n```rescript\nBelt.Array.zip([1, 2], [3, 4, 5]) == [(1, 3), (2, 4)]\n```" - ], - "signature": "let zip: (t<'a>, array<'b>) => array<('a, 'b)>" - }, - { - "id": "Belt.Array.zipByU", - "kind": "value", - "name": "zipByU", - "docstrings": [], - "signature": "let zipByU: (t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>", - "deprecated": "Use `zipBy` instead" - }, - { - "id": "Belt.Array.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "`zipBy(xs, ys, f)` create an array by applying `f` to corresponding elements of\n`xs` and `ys`. Stops with shorter array.\n\nEquivalent to `map(zip(xs, ys), ((a, b)) => f(a, b))`\n\n## Examples\n\n```rescript\nBelt.Array.zipBy([1, 2, 3], [4, 5], (a, b) => 2 * a + b) == [6, 9]\n```" - ], - "signature": "let zipBy: (t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>" - }, - { - "id": "Belt.Array.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "`unzip(a)` takes an array of pairs and creates a pair of arrays. The first array\ncontains all the first items of the pairs; the second array contains all the\nsecond items.\n\n## Examples\n\n```rescript\nBelt.Array.unzip([(1, 2), (3, 4)]) == ([1, 3], [2, 4])\n\nBelt.Array.unzip([(1, 2), (3, 4), (5, 6), (7, 8)]) == ([1, 3, 5, 7], [2, 4, 6, 8])\n```" - ], - "signature": "let unzip: array<('a, 'b)> => (t<'a>, array<'b>)" - }, - { - "id": "Belt.Array.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(xs, ys)` returns a fresh array containing the concatenation of the arrays\n`v1` and `v2`, so even if `v1` or `v2` is empty; it can not be shared.\n\n## Examples\n\n```rescript\nBelt.Array.concat([1, 2, 3], [4, 5]) == [1, 2, 3, 4, 5]\n\nBelt.Array.concat([], [\"a\", \"b\", \"c\"]) == [\"a\", \"b\", \"c\"]\n```" - ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Belt.Array.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(xss)` returns a fresh array as the concatenation of `xss` (an array of arrays)\n\n## Examples\n\n```rescript\nBelt.Array.concatMany([[1, 2, 3], [4, 5, 6], [7, 8]]) == [1, 2, 3, 4, 5, 6, 7, 8]\n```" - ], - "signature": "let concatMany: array> => t<'a>" - }, - { - "id": "Belt.Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(xs, offset, len)` creates a new array with the len elements of `xs`\nstarting at `offset` for `offset` can be negative;and is evaluated as\n`length(xs) - offset(slice, xs) - 1(1)` means get the last element as a\nsingleton array `slice(xs, ~-len, len)` will return a copy of the array if the\narray does not have enough data; `slice` extracts through the end of sequence.\n\nif `len` is negative; returns the empty array.\n\n## Examples\n\n```rescript\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=2, ~len=3) == [12, 13, 14]\n\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=-4, ~len=3) == [13, 14, 15]\n\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=4, ~len=9) == [14, 15, 16]\n```" - ], - "signature": "let slice: (t<'a>, ~offset: int, ~len: int) => t<'a>" - }, - { - "id": "Belt.Array.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(xs, offset)` creates a new array with the elements of `xs` starting\nat `offset`\n\n`offset` can be negative; and is evaluated as `length(xs) - offset(sliceToEnd, xs) - 1`\nmeans get the last element as a singleton array\n\n`sliceToEnd(xs, 0)` will return a copy of the array\n\n## Examples\n\n```rescript\nBelt.Array.sliceToEnd([10, 11, 12, 13, 14, 15, 16], 2) == [12, 13, 14, 15, 16]\n\nBelt.Array.sliceToEnd([10, 11, 12, 13, 14, 15, 16], -4) == [13, 14, 15, 16]\n```" - ], - "signature": "let sliceToEnd: (t<'a>, int) => t<'a>" - }, - { - "id": "Belt.Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(a)` returns a copy of `a`; that is; a fresh array containing the same\nelements as `a`." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.Array.fill", - "kind": "value", - "name": "fill", - "docstrings": [ - "`fill(arr, ~offset, ~len, x)` modifies `arr` in place, storing `x` in elements\nnumber `offset` to `offset + len - 1`. `offset` can be negative; and is evaluated\nas `length(arr - offset)`.\n\n`fill(arr, ~offset=-1, ~len=1)` means fill the last element, if the array does not have enough data; `fill` will ignore it\n\n## Examples\n\n```rescript\nlet arr = Belt.Array.makeBy(5, i => i)\n\nBelt.Array.fill(arr, ~offset=2, ~len=2, 9)\n\narr == [0, 1, 9, 9, 4]\n\nBelt.Array.fill(arr, ~offset=7, ~len=2, 8)\n\narr == [0, 1, 9, 9, 4]\n```" - ], - "signature": "let fill: (t<'a>, ~offset: int, ~len: int, 'a) => unit" - }, - { - "id": "Belt.Array.blit", - "kind": "value", - "name": "blit", - "docstrings": [ - "`blit(~src=v1, ~srcOffset=o1, ~dst=v2, ~dstOffset=o2, ~len)` copies `len` elements\nfrom array `v1`;starting at element number `o1`;to array `v2`, starting at element\nnumber `o2`. It works correctly even if `v1` and `v2` are the same array and the\nsource and destination chunks overlap.\n\n`offset` can be negative; `-1` means `len - 1`; if `len + offset` is still negative;it will be set as 0\n\nFor each of the examples;presume that `v1 == [10, 11, 12, 13, 14, 15, 16, 17]` and `v2 == [20, 21, 22, 23, 24, 25, 26, 27]`. The result shown is the content of the destination array.\n\n## Examples\n\n```rescript\nlet v1 = [10, 11, 12, 13, 14, 15, 16, 17]\nlet v2 = [20, 21, 22, 23, 24, 25, 26, 27]\n\nBelt.Array.blit(~src=v1, ~srcOffset=4, ~dst=v2, ~dstOffset=2, ~len=3)\nv2 == [20, 21, 14, 15, 16, 25, 26, 27]\n\nBelt.Array.blit(~src=v1, ~srcOffset=4, ~dst=v1, ~dstOffset=2, ~len=3)\nv1 == [10, 11, 14, 15, 16, 15, 16, 17]\n```" - ], - "signature": "let blit: (\n ~src: t<'a>,\n ~srcOffset: int,\n ~dst: t<'a>,\n ~dstOffset: int,\n ~len: int,\n) => unit" - }, - { - "id": "Belt.Array.blitUnsafe", - "kind": "value", - "name": "blitUnsafe", - "docstrings": [ - "Unsafe blit without bounds checking." - ], - "signature": "let blitUnsafe: (\n ~src: t<'a>,\n ~srcOffset: int,\n ~dst: t<'a>,\n ~dstOffset: int,\n ~len: int,\n) => unit" - }, - { - "id": "Belt.Array.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(xs, f)`\n\nCall `f` on each element of `xs` from the beginning to end. `f` returns `unit`\nso no new array is created. Use `forEach` when you are primarily concerned with\nrepetitively creating side effects.\n\n## Examples\n\n```rescript\nBelt.Array.forEach([\"a\", \"b\", \"c\"], x => Js.log(\"Item: \" ++ x))\n\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\nlet total = ref(0)\n\nBelt.Array.forEach([1, 2, 3, 4], x => total := total.contents + x)\n\ntotal.contents == 1 + 2 + 3 + 4\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.Array.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => array<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Array.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(xs, f)` returns a new array by calling `f` for each element of `xs` from\nthe beginning to end.\n\n## Examples\n\n```rescript\nBelt.Array.map([1, 2], x => x + 1) == [2, 3]\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Belt.Array.flatMapU", - "kind": "value", - "name": "flatMapU", - "docstrings": [], - "signature": "let flatMapU: (t<'a>, 'a => array<'b>) => array<'b>", - "deprecated": "Use `flatMap` instead" - }, - { - "id": "Belt.Array.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(xs, f)` returns a new array by calling `f` for each element of `xs` from\nthe beginning to end, concatenating the results.\n\n## Examples\n\n```rescript\nBelt.Array.flatMap([1, 2], x => [x + 10, x + 20]) == [11, 21, 12, 22]\n```" - ], - "signature": "let flatMap: (t<'a>, 'a => array<'b>) => array<'b>" - }, - { - "id": "Belt.Array.getByU", - "kind": "value", - "name": "getByU", - "docstrings": [], - "signature": "let getByU: (t<'a>, 'a => bool) => option<'a>", - "deprecated": "Use `getBy` instead" - }, - { - "id": "Belt.Array.getBy", - "kind": "value", - "name": "getBy", - "docstrings": [ - "`getBy(xs, p)` returns `Some(value)` for the first value in `xs` that satisifies\nthe predicate function `p`; returns `None` if no element satisifies the function.\n\n## Examples\n\n```rescript\nBelt.Array.getBy([1, 4, 3, 2], x => mod(x, 2) == 0) == Some(4)\nBelt.Array.getBy([15, 13, 11], x => mod(x, 2) == 0) == None\n```" - ], - "signature": "let getBy: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Belt.Array.getIndexByU", - "kind": "value", - "name": "getIndexByU", - "docstrings": [], - "signature": "let getIndexByU: (t<'a>, 'a => bool) => option", - "deprecated": "Use `getIndexBy` instead" - }, - { - "id": "Belt.Array.getIndexBy", - "kind": "value", - "name": "getIndexBy", - "docstrings": [ - "`getIndexBy(xs, p)` returns `Some(index)` for the first value in `xs` that\nsatisifies the predicate function `p`; returns `None` if no element satisifies\nthe function.\n\n## Examples\n\n```rescript\nBelt.Array.getIndexBy([1, 4, 3, 2], x => mod(x, 2) == 0) == Some(1)\nBelt.Array.getIndexBy([15, 13, 11], x => mod(x, 2) == 0) == None\n```" - ], - "signature": "let getIndexBy: (t<'a>, 'a => bool) => option" - }, - { - "id": "Belt.Array.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Array.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(xs, p)` returns a new array that keep all elements satisfy `p`." - ], - "signature": "let keep: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Belt.Array.keepWithIndexU", - "kind": "value", - "name": "keepWithIndexU", - "docstrings": [], - "signature": "let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "Use `keepWithIndex` instead" - }, - { - "id": "Belt.Array.keepWithIndex", - "kind": "value", - "name": "keepWithIndex", - "docstrings": [ - "`keepWithIndex(xs, p)` returns a new array that keep all elements satisfy `p`.\n\n## Examples\n\n```rescript\nBelt.Array.keepWithIndex([1, 2, 3], (_x, i) => i == 1) == [2]\n```" - ], - "signature": "let keepWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" - }, - { - "id": "Belt.Array.keepMapU", - "kind": "value", - "name": "keepMapU", - "docstrings": [], - "signature": "let keepMapU: (t<'a>, 'a => option<'b>) => array<'b>", - "deprecated": "Use `keepMap` instead" - }, - { - "id": "Belt.Array.keepMap", - "kind": "value", - "name": "keepMap", - "docstrings": [ - "`keepMap(xs, p)` returns a new array that keep all elements that return a non\nNone applied `p`.\n\n## Examples\n\n```rescript\nBelt.Array.keepMap([1, 2, 3], x =>\n if mod(x, 2) == 0 {\n Some(x)\n } else {\n None\n }\n) == [2]\n```" - ], - "signature": "let keepMap: (t<'a>, 'a => option<'b>) => array<'b>" - }, - { - "id": "Belt.Array.forEachWithIndexU", - "kind": "value", - "name": "forEachWithIndexU", - "docstrings": [], - "signature": "let forEachWithIndexU: (t<'a>, (int, 'a) => unit) => unit", - "deprecated": "Use `forEachWithIndex` instead" - }, - { - "id": "Belt.Array.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(xs, f)` same as `Belt.Array.forEach`, except that `f` is\nsupplied two arguments: the index starting from 0 and the element from `xs`.\n\n## Examples\n\n```rescript\nBelt.Array.forEachWithIndex([\"a\", \"b\", \"c\"], (i, x) =>\n Js.log(\"Item \" ++ Belt.Int.toString(i) ++ \" is \" ++ x)\n)\n\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\nlet total = ref(0)\n\nBelt.Array.forEachWithIndex([10, 11, 12, 13], (i, x) => total := total.contents + x + i)\n\ntotal.contents == 0 + 10 + 1 + 11 + 2 + 12 + 3 + 13\n```" - ], - "signature": "let forEachWithIndex: (t<'a>, (int, 'a) => unit) => unit" - }, - { - "id": "Belt.Array.mapWithIndexU", - "kind": "value", - "name": "mapWithIndexU", - "docstrings": [], - "signature": "let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => array<'b>", - "deprecated": "Use `mapWithIndex` instead" - }, - { - "id": "Belt.Array.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(xs, f)` applies `f` to each element of `xs`. Function `f` takes\ntwo arguments: the index starting from 0 and the element from `xs`.\n\n## Examples\n\n```rescript\nBelt.Array.mapWithIndex([1, 2, 3], (i, x) => i + x) == [0 + 1, 1 + 2, 2 + 3]\n```" - ], - "signature": "let mapWithIndex: (t<'a>, (int, 'a) => 'b) => array<'b>" - }, - { - "id": "Belt.Array.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Array.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(f, a)` split array into tuple of two arrays based on predicate `f`;\nfirst of tuple where predicate cause true, second where predicate cause false\n\n## Examples\n\n```rescript\nBelt.Array.partition([1, 2, 3, 4, 5], x => mod(x, 2) == 0) == ([2, 4], [1, 3, 5])\n\nBelt.Array.partition([1, 2, 3, 4, 5], x => mod(x, 2) != 0) == ([1, 3, 5], [2, 4])\n```" - ], - "signature": "let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)" - }, - { - "id": "Belt.Array.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(xs, init, f)` applies `f` to each element of `xs` from beginning to end.\nFunction `f` has two parameters: the item from the list and an “accumulator”;\nwhich starts with a value of `init`. `reduce` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nBelt.Array.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\nBelt.Array.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n```" - ], - "signature": "let reduce: (array<'b>, 'a, ('a, 'b) => 'a) => 'a" - }, - { - "id": "Belt.Array.reduceReverseU", - "kind": "value", - "name": "reduceReverseU", - "docstrings": [], - "signature": "let reduceReverseU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a", - "deprecated": "Use `reduceReverse` instead" - }, - { - "id": "Belt.Array.reduceReverse", - "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "`reduceReverse(xs, init, f)` works like `Belt.Array.reduce` except that\nfunction `f` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nBelt.Array.reduceReverse([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n```" - ], - "signature": "let reduceReverse: (array<'b>, 'a, ('a, 'b) => 'a) => 'a" - }, - { - "id": "Belt.Array.reduceReverse2U", - "kind": "value", - "name": "reduceReverse2U", - "docstrings": [], - "signature": "let reduceReverse2U: (t<'a>, array<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c", - "deprecated": "Use `reduceReverse2` instead" - }, - { - "id": "Belt.Array.reduceReverse2", - "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "`reduceReverse2(xs, ys, init, f)` reduces two arrays xs and ys;taking items\nstarting at `min(length(xs), length(ys))` down to and including zero.\n\n## Examples\n\n```rescript\nBelt.Array.reduceReverse2([1, 2, 3], [1, 2], 0, (acc, x, y) => acc + x + y) == 6\n```" - ], - "signature": "let reduceReverse2: (t<'a>, array<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" - }, - { - "id": "Belt.Array.reduceWithIndexU", - "kind": "value", - "name": "reduceWithIndexU", - "docstrings": [], - "signature": "let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b", - "deprecated": "Use `reduceWithIndex` instead" - }, - { - "id": "Belt.Array.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "Applies `f` to each element of `xs` from beginning to end. Function `f` has\nthree parameters: the item from the array and an “accumulator”, which starts\nwith a value of `init` and the index of each element. `reduceWithIndex` returns\nthe final value of the accumulator.\n\n## Examples\n\n```rescript\nBelt.Array.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n```" - ], - "signature": "let reduceWithIndex: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Belt.Array.joinWithU", - "kind": "value", - "name": "joinWithU", - "docstrings": [], - "signature": "let joinWithU: (t<'a>, string, 'a => string) => string", - "deprecated": "Use `joinWith` instead" - }, - { - "id": "Belt.Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "`joinWith(xs, sep, toString)`\n\nConcatenates all the elements of `xs` converted to string with `toString`, each\nseparated by `sep`, the string given as the second argument, into a single string.\nIf the array has only one element, then that element will be returned without\nusing the separator. If the array is empty, the empty string will be returned.\n\n## Examples\n\n```rescript\nBelt.Array.joinWith([0, 1], \", \", Js.Int.toString) == \"0, 1\"\nBelt.Array.joinWith([], \" \", Js.Int.toString) == \"\"\nBelt.Array.joinWith([1], \" \", Js.Int.toString) == \"1\"\n```" - ], - "signature": "let joinWith: (t<'a>, string, 'a => string) => string" - }, - { - "id": "Belt.Array.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Array.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(xs, p)` returns true if at least one of the elements in `xs` satifies `p`;\nwhere `p` is a predicate: a function taking an element and returning a `bool`.\n\n## Examples\n\n```rescript\nBelt.Array.some([2, 3, 4], x => mod(x, 2) == 1) == true\n\nBelt.Array.some([-1, -3, -5], x => x > 0) == false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.Array.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Array.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(xs, p)` returns `true` if all elements satisfy `p`; where `p` is a\npredicate: a function taking an element and returning a `bool`.\n\n## Examples\n\n```rescript\nBelt.Array.every([1, 3, 5], x => mod(x, 2) == 1) == true\n\nBelt.Array.every([1, -3, 5], x => x > 0) == false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.Array.every2U", - "kind": "value", - "name": "every2U", - "docstrings": [], - "signature": "let every2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `every2` instead" - }, - { - "id": "Belt.Array.every2", - "kind": "value", - "name": "every2", - "docstrings": [ - "`every2(xs, ys, p)` returns true if `p(xi, yi)` is true for all pairs of\nelements up to the shorter length (i.e. `min(length(xs), length(ys))`)\n\n## Examples\n\n```rescript\nBelt.Array.every2([1, 2, 3], [0, 1], (a, b) => a > b) == true\n\nBelt.Array.every2([], [1], (x, y) => x > y) == true\n\nBelt.Array.every2([2, 3], [1], (x, y) => x > y) == true\n\nBelt.Array.every2([0, 1], [5, 0], (x, y) => x > y) == false\n```" - ], - "signature": "let every2: (t<'a>, array<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Array.some2U", - "kind": "value", - "name": "some2U", - "docstrings": [], - "signature": "let some2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `some2` instead" - }, - { - "id": "Belt.Array.some2", - "kind": "value", - "name": "some2", - "docstrings": [ - "`some2(xs, ys, p)` returns true if `p(xi, yi)` is true for any pair of elements\nup to the shorter length (i.e. `min(length(xs), length(ys))`)\n\n## Examples\n\n```rescript\nBelt.Array.some2([0, 2], [1, 0, 3], (a, b) => a > b) == true\n\nBelt.Array.some2([], [1], (x, y) => x > y) == false\n\nBelt.Array.some2([2, 3], [1, 4], (x, y) => x > y) == true\n```" - ], - "signature": "let some2: (t<'a>, array<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Array.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Array.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(xs, ys, f)` compared by length if `length(xs) != length(ys)`; returning `-1`\nif `length(xs) < length(ys)` or 1 if `length(xs) > length(ys)`. Otherwise\ncompare one by one `f(x, y)`. `f` returns a negative number if `x` is “less than” `y`\nzero if `x` is “equal to” `y` a positive number if `x` is “greater than”\n`y`. The comparison returns the first non-zero result of `f`; or zero if `f`\nreturns zero for all `x` and `y`.\n\n## Examples\n\n```rescript\nBelt.Array.cmp([1, 3, 5], [1, 4, 2], (a, b) => compare(a, b)) == -1\n\nBelt.Array.cmp([1, 3, 5], [1, 2, 3], (a, b) => compare(a, b)) == 1\n\nBelt.Array.cmp([1, 3, 5], [1, 3, 5], (a, b) => compare(a, b)) == 0\n```" - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.Array.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Array.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(xs, ys)` return `false` if length is not the same otherwise compare items\none by one using `f(xi, yi)`; and return true if all results are true false otherwise\n\n## Examples\n\n```rescript\nBelt.Array.eq([1, 2, 3], [-1, -2, -3], (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.Array.truncateToLengthUnsafe", - "kind": "value", - "name": "truncateToLengthUnsafe", - "docstrings": [ - "Unsafe `truncateToLengthUnsafe(xs, n)` sets length of array `xs` to `n`. If `n`\nis greater than the length of `xs`; the extra elements are set to `Js.Null_undefined.null`.\nIf `n` is less than zero; throws a `RangeError`.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n\nBelt.Array.truncateToLengthUnsafe(arr, 3)\n\narr == [\"ant\", \"bee\", \"cat\"]\n```" - ], - "signature": "let truncateToLengthUnsafe: (t<'a>, int) => unit" - }, - { - "id": "Belt.Array.initU", - "kind": "value", - "name": "initU", - "docstrings": [], - "signature": "let initU: (int, int => 'a) => t<'a>", - "deprecated": "Use `init` instead" - }, - { - "id": "Belt.Array.init", - "kind": "value", - "name": "init", - "docstrings": [], - "signature": "let init: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.Array.push", - "kind": "value", - "name": "push", - "docstrings": [ - "`arr->push(item)` pushes an element `item` into an array `arr`." - ], - "signature": "let push: (t<'a>, 'a) => unit" - } - ] - }, - "belt/id": { - "id": "Belt.Id", - "name": "Id", - "docstrings": [ - "[`Belt.Id`]()\n\n Provide utilities to create identified comparators or hashes for\n data structures used below.\n\n It create a unique identifier per module of\n functions so that different data structures with slightly different\n comparison functions won't mix", - "[`Belt.Id`]()\n\nProvide utiliites to create identified comparators or hashes for\ndata structures used below.\n\nIt create a unique identifer per module of functions so that different data structures with slightly different\ncomparison functions won't mix." - ], - "items": [ - { - "id": "Belt.Id.hash", - "kind": "type", - "name": "hash", - "docstrings": [ - "`('a, 'id) hash`\n\nIts runtime represenation is a `hash` function, but signed with a\ntype parameter, so that different hash functions type mismatch" - ], - "signature": "type hash<'a, 'id>" - }, - { - "id": "Belt.Id.eq", - "kind": "type", - "name": "eq", - "docstrings": [ - "`('a, 'id) eq`\n\nIts runtime represenation is an `eq` function, but signed with a\ntype parameter, so that different hash functions type mismatch" - ], - "signature": "type eq<'a, 'id>" - }, - { - "id": "Belt.Id.cmp", - "kind": "type", - "name": "cmp", - "docstrings": [ - "`('a,'id) cmp`\n\nIts runtime representation is a `cmp` function, but signed with a\ntype parameter, so that different hash functions type mismatch" - ], - "signature": "type cmp<'a, 'id>" - }, - { - "id": "Belt.Id.comparable", - "kind": "type", - "name": "comparable", - "docstrings": [ - "`('key, 'id) cmparable` is a module of functions, here it only includes `cmp`.\n\nUnlike normal functions, when created, it comes with a unique identity (guaranteed\nby the type system).\n\nIt can be created using function [`comparableU`]() or [`comparable`]().\n\nThe idea of a unique identity when created is that it makes sure two sets would type\nmismatch if they use different comparison function" - ], - "signature": "type comparable<'key, 'id> = module(Comparable\n with type identity = 'id\n and type t = 'key)" - }, - { - "id": "Belt.Id.comparableU", - "kind": "value", - "name": "comparableU", - "docstrings": [], - "signature": "let comparableU: (\n ~cmp: ('a, 'a) => int,\n) => module(Comparable with type t = 'a)", - "deprecated": "Use `comparable` instead" - }, - { - "id": "Belt.Id.comparable", - "kind": "value", - "name": "comparable", - "docstrings": [], - "signature": "let comparable: (\n ~cmp: ('a, 'a) => int,\n) => module(Comparable with type t = 'a)" - }, - { - "id": "Belt.Id.hashable", - "kind": "type", - "name": "hashable", - "docstrings": [ - "`('key, 'id) hashable` is a module of functions, here it only includes `hash`, `eq`.\n\nUnlike normal functions, when created, it comes with a unique identity (guaranteed\nby the type system).\n\nIt can be created using function [`hashableU`]() or [`hashable`]().\n\nThe idea of a unique identity when created is that it makes sure two hash sets would type\nmismatch if they use different comparison function" - ], - "signature": "type hashable<'key, 'id> = module(Hashable\n with type identity = 'id\n and type t = 'key)" - }, - { - "id": "Belt.Id.hashableU", - "kind": "value", - "name": "hashableU", - "docstrings": [], - "signature": "let hashableU: (\n ~hash: 'a => int,\n ~eq: ('a, 'a) => bool,\n) => module(Hashable with type t = 'a)", - "deprecated": "Use `hashable` instead" - }, - { - "id": "Belt.Id.hashable", - "kind": "value", - "name": "hashable", - "docstrings": [], - "signature": "let hashable: (\n ~hash: 'a => int,\n ~eq: ('a, 'a) => bool,\n) => module(Hashable with type t = 'a)" - }, - { - "id": "Belt.Id.getHashInternal", - "kind": "value", - "name": "getHashInternal", - "docstrings": [], - "signature": "let getHashInternal: hash<'a, 'id> => 'a => int" - }, - { - "id": "Belt.Id.getEqInternal", - "kind": "value", - "name": "getEqInternal", - "docstrings": [], - "signature": "let getEqInternal: eq<'a, 'id> => ('a, 'a) => bool" - }, - { - "id": "Belt.Id.getCmpInternal", - "kind": "value", - "name": "getCmpInternal", - "docstrings": [], - "signature": "let getCmpInternal: cmp<'a, 'id> => ('a, 'a) => int" - } - ] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v13.0.0/dom.json b/apps/docs/data/api/v13.0.0/dom.json deleted file mode 100644 index 2bf0f3038..000000000 --- a/apps/docs/data/api/v13.0.0/dom.json +++ /dev/null @@ -1,1962 +0,0 @@ -{ - "dom": { - "id": "Dom", - "name": "Dom", - "docstrings": [], - "items": [ - { - "id": "Dom._baseClass", - "kind": "type", - "name": "_baseClass", - "docstrings": [], - "signature": "type _baseClass" - }, - { - "id": "Dom.animation", - "kind": "type", - "name": "animation", - "docstrings": [], - "signature": "type animation" - }, - { - "id": "Dom.cssStyleDeclaration", - "kind": "type", - "name": "cssStyleDeclaration", - "docstrings": [], - "signature": "type cssStyleDeclaration" - }, - { - "id": "Dom.cssStyleSheet", - "kind": "type", - "name": "cssStyleSheet", - "docstrings": [], - "signature": "type cssStyleSheet" - }, - { - "id": "Dom.eventTarget_like", - "kind": "type", - "name": "eventTarget_like", - "docstrings": [], - "signature": "type eventTarget_like<'a>" - }, - { - "id": "Dom.eventTarget", - "kind": "type", - "name": "eventTarget", - "docstrings": [], - "signature": "type eventTarget = eventTarget_like<_baseClass>" - }, - { - "id": "Dom._node", - "kind": "type", - "name": "_node", - "docstrings": [], - "signature": "type _node<'a>" - }, - { - "id": "Dom.node_like", - "kind": "type", - "name": "node_like", - "docstrings": [], - "signature": "type node_like<'a> = eventTarget_like<_node<'a>>" - }, - { - "id": "Dom.node", - "kind": "type", - "name": "node", - "docstrings": [], - "signature": "type node = node_like<_baseClass>" - }, - { - "id": "Dom._attr", - "kind": "type", - "name": "_attr", - "docstrings": [], - "signature": "type _attr" - }, - { - "id": "Dom.attr", - "kind": "type", - "name": "attr", - "docstrings": [], - "signature": "type attr = node_like<_attr>" - }, - { - "id": "Dom._characterData", - "kind": "type", - "name": "_characterData", - "docstrings": [], - "signature": "type _characterData<'a>" - }, - { - "id": "Dom.characterData_like", - "kind": "type", - "name": "characterData_like", - "docstrings": [], - "signature": "type characterData_like<'a> = node_like<_characterData<'a>>" - }, - { - "id": "Dom.characterData", - "kind": "type", - "name": "characterData", - "docstrings": [], - "signature": "type characterData = characterData_like<_baseClass>" - }, - { - "id": "Dom._cdataSection", - "kind": "type", - "name": "_cdataSection", - "docstrings": [], - "signature": "type _cdataSection" - }, - { - "id": "Dom.cdataSection", - "kind": "type", - "name": "cdataSection", - "docstrings": [], - "signature": "type cdataSection = characterData_like<_cdataSection>" - }, - { - "id": "Dom._comment", - "kind": "type", - "name": "_comment", - "docstrings": [], - "signature": "type _comment" - }, - { - "id": "Dom.comment", - "kind": "type", - "name": "comment", - "docstrings": [], - "signature": "type comment = characterData_like<_comment>" - }, - { - "id": "Dom._document", - "kind": "type", - "name": "_document", - "docstrings": [], - "signature": "type _document<'a>" - }, - { - "id": "Dom.document_like", - "kind": "type", - "name": "document_like", - "docstrings": [], - "signature": "type document_like<'a> = node_like<_document<'a>>" - }, - { - "id": "Dom.document", - "kind": "type", - "name": "document", - "docstrings": [], - "signature": "type document = document_like<_baseClass>" - }, - { - "id": "Dom._documentFragment", - "kind": "type", - "name": "_documentFragment", - "docstrings": [], - "signature": "type _documentFragment" - }, - { - "id": "Dom.documentFragment", - "kind": "type", - "name": "documentFragment", - "docstrings": [], - "signature": "type documentFragment = node_like<_documentFragment>" - }, - { - "id": "Dom._documentType", - "kind": "type", - "name": "_documentType", - "docstrings": [], - "signature": "type _documentType" - }, - { - "id": "Dom.documentType", - "kind": "type", - "name": "documentType", - "docstrings": [], - "signature": "type documentType = node_like<_documentType>" - }, - { - "id": "Dom.domImplementation", - "kind": "type", - "name": "domImplementation", - "docstrings": [], - "signature": "type domImplementation" - }, - { - "id": "Dom._element", - "kind": "type", - "name": "_element", - "docstrings": [], - "signature": "type _element<'a>" - }, - { - "id": "Dom.element_like", - "kind": "type", - "name": "element_like", - "docstrings": [], - "signature": "type element_like<'a> = node_like<_element<'a>>" - }, - { - "id": "Dom.element", - "kind": "type", - "name": "element", - "docstrings": [], - "signature": "type element = element_like<_baseClass>" - }, - { - "id": "Dom.htmlCollection", - "kind": "type", - "name": "htmlCollection", - "docstrings": [], - "signature": "type htmlCollection" - }, - { - "id": "Dom.htmlFormControlsCollection", - "kind": "type", - "name": "htmlFormControlsCollection", - "docstrings": [], - "signature": "type htmlFormControlsCollection" - }, - { - "id": "Dom.htmlOptionsCollection", - "kind": "type", - "name": "htmlOptionsCollection", - "docstrings": [], - "signature": "type htmlOptionsCollection" - }, - { - "id": "Dom.intersectionObserver", - "kind": "type", - "name": "intersectionObserver", - "docstrings": [], - "signature": "type intersectionObserver" - }, - { - "id": "Dom.intersectionObserverEntry", - "kind": "type", - "name": "intersectionObserverEntry", - "docstrings": [], - "signature": "type intersectionObserverEntry" - }, - { - "id": "Dom.mutationObserver", - "kind": "type", - "name": "mutationObserver", - "docstrings": [], - "signature": "type mutationObserver" - }, - { - "id": "Dom.mutationRecord", - "kind": "type", - "name": "mutationRecord", - "docstrings": [], - "signature": "type mutationRecord" - }, - { - "id": "Dom.performanceObserver", - "kind": "type", - "name": "performanceObserver", - "docstrings": [], - "signature": "type performanceObserver" - }, - { - "id": "Dom.performanceObserverEntryList", - "kind": "type", - "name": "performanceObserverEntryList", - "docstrings": [], - "signature": "type performanceObserverEntryList" - }, - { - "id": "Dom.reportingObserver", - "kind": "type", - "name": "reportingObserver", - "docstrings": [], - "signature": "type reportingObserver" - }, - { - "id": "Dom.reportingObserverOptions", - "kind": "type", - "name": "reportingObserverOptions", - "docstrings": [], - "signature": "type reportingObserverOptions" - }, - { - "id": "Dom.resizeObserver", - "kind": "type", - "name": "resizeObserver", - "docstrings": [], - "signature": "type resizeObserver" - }, - { - "id": "Dom.resizeObserverEntry", - "kind": "type", - "name": "resizeObserverEntry", - "docstrings": [], - "signature": "type resizeObserverEntry" - }, - { - "id": "Dom.namedNodeMap", - "kind": "type", - "name": "namedNodeMap", - "docstrings": [], - "signature": "type namedNodeMap" - }, - { - "id": "Dom.nodeList", - "kind": "type", - "name": "nodeList", - "docstrings": [], - "signature": "type nodeList" - }, - { - "id": "Dom.radioNodeList", - "kind": "type", - "name": "radioNodeList", - "docstrings": [], - "signature": "type radioNodeList" - }, - { - "id": "Dom.processingInstruction", - "kind": "type", - "name": "processingInstruction", - "docstrings": [], - "signature": "type processingInstruction" - }, - { - "id": "Dom._shadowRoot", - "kind": "type", - "name": "_shadowRoot", - "docstrings": [], - "signature": "type _shadowRoot" - }, - { - "id": "Dom.shadowRoot", - "kind": "type", - "name": "shadowRoot", - "docstrings": [], - "signature": "type shadowRoot = node_like<_shadowRoot>" - }, - { - "id": "Dom._text", - "kind": "type", - "name": "_text", - "docstrings": [], - "signature": "type _text" - }, - { - "id": "Dom.text", - "kind": "type", - "name": "text", - "docstrings": [], - "signature": "type text = characterData_like<_text>" - }, - { - "id": "Dom.domRect", - "kind": "type", - "name": "domRect", - "docstrings": [], - "signature": "type domRect" - }, - { - "id": "Dom.dataTransfer", - "kind": "type", - "name": "dataTransfer", - "docstrings": [], - "signature": "type dataTransfer" - }, - { - "id": "Dom.domStringMap", - "kind": "type", - "name": "domStringMap", - "docstrings": [], - "signature": "type domStringMap" - }, - { - "id": "Dom.history", - "kind": "type", - "name": "history", - "docstrings": [], - "signature": "type history" - }, - { - "id": "Dom._htmlDocument", - "kind": "type", - "name": "_htmlDocument", - "docstrings": [], - "signature": "type _htmlDocument" - }, - { - "id": "Dom.htmlDocument", - "kind": "type", - "name": "htmlDocument", - "docstrings": [], - "signature": "type htmlDocument = document_like<_htmlDocument>" - }, - { - "id": "Dom._htmlElement", - "kind": "type", - "name": "_htmlElement", - "docstrings": [], - "signature": "type _htmlElement<'a>" - }, - { - "id": "Dom.htmlElement_like", - "kind": "type", - "name": "htmlElement_like", - "docstrings": [], - "signature": "type htmlElement_like<'a> = element_like<_htmlElement<'a>>" - }, - { - "id": "Dom.htmlElement", - "kind": "type", - "name": "htmlElement", - "docstrings": [], - "signature": "type htmlElement = htmlElement_like<_baseClass>" - }, - { - "id": "Dom._htmlAnchorElement", - "kind": "type", - "name": "_htmlAnchorElement", - "docstrings": [], - "signature": "type _htmlAnchorElement" - }, - { - "id": "Dom.htmlAnchorElement", - "kind": "type", - "name": "htmlAnchorElement", - "docstrings": [], - "signature": "type htmlAnchorElement = htmlElement_like<\n _htmlAnchorElement,\n>" - }, - { - "id": "Dom._htmlAreaElement", - "kind": "type", - "name": "_htmlAreaElement", - "docstrings": [], - "signature": "type _htmlAreaElement" - }, - { - "id": "Dom.htmlAreaElement", - "kind": "type", - "name": "htmlAreaElement", - "docstrings": [], - "signature": "type htmlAreaElement = htmlElement_like<_htmlAreaElement>" - }, - { - "id": "Dom._htmlAudioElement", - "kind": "type", - "name": "_htmlAudioElement", - "docstrings": [], - "signature": "type _htmlAudioElement" - }, - { - "id": "Dom.htmlAudioElement", - "kind": "type", - "name": "htmlAudioElement", - "docstrings": [], - "signature": "type htmlAudioElement = htmlElement_like<_htmlAudioElement>" - }, - { - "id": "Dom._htmlBaseElement", - "kind": "type", - "name": "_htmlBaseElement", - "docstrings": [], - "signature": "type _htmlBaseElement" - }, - { - "id": "Dom.htmlBaseElement", - "kind": "type", - "name": "htmlBaseElement", - "docstrings": [], - "signature": "type htmlBaseElement = htmlElement_like<_htmlBaseElement>" - }, - { - "id": "Dom._htmlBodyElement", - "kind": "type", - "name": "_htmlBodyElement", - "docstrings": [], - "signature": "type _htmlBodyElement" - }, - { - "id": "Dom.htmlBodyElement", - "kind": "type", - "name": "htmlBodyElement", - "docstrings": [], - "signature": "type htmlBodyElement = htmlElement_like<_htmlBodyElement>" - }, - { - "id": "Dom._htmlBrElement", - "kind": "type", - "name": "_htmlBrElement", - "docstrings": [], - "signature": "type _htmlBrElement" - }, - { - "id": "Dom.htmlBrElement", - "kind": "type", - "name": "htmlBrElement", - "docstrings": [], - "signature": "type htmlBrElement = htmlElement_like<_htmlBrElement>" - }, - { - "id": "Dom._htmlButtonElement", - "kind": "type", - "name": "_htmlButtonElement", - "docstrings": [], - "signature": "type _htmlButtonElement" - }, - { - "id": "Dom.htmlButtonElement", - "kind": "type", - "name": "htmlButtonElement", - "docstrings": [], - "signature": "type htmlButtonElement = htmlElement_like<\n _htmlButtonElement,\n>" - }, - { - "id": "Dom._htmlCanvasElement", - "kind": "type", - "name": "_htmlCanvasElement", - "docstrings": [], - "signature": "type _htmlCanvasElement" - }, - { - "id": "Dom.htmlCanvasElement", - "kind": "type", - "name": "htmlCanvasElement", - "docstrings": [], - "signature": "type htmlCanvasElement = htmlElement_like<\n _htmlCanvasElement,\n>" - }, - { - "id": "Dom._htmlDataElement", - "kind": "type", - "name": "_htmlDataElement", - "docstrings": [], - "signature": "type _htmlDataElement" - }, - { - "id": "Dom.htmlDataElement", - "kind": "type", - "name": "htmlDataElement", - "docstrings": [], - "signature": "type htmlDataElement = htmlElement_like<_htmlDataElement>" - }, - { - "id": "Dom._htmlDataListElement", - "kind": "type", - "name": "_htmlDataListElement", - "docstrings": [], - "signature": "type _htmlDataListElement" - }, - { - "id": "Dom.htmlDataListElement", - "kind": "type", - "name": "htmlDataListElement", - "docstrings": [], - "signature": "type htmlDataListElement = htmlElement_like<\n _htmlDataListElement,\n>" - }, - { - "id": "Dom._htmlDialogElement", - "kind": "type", - "name": "_htmlDialogElement", - "docstrings": [], - "signature": "type _htmlDialogElement" - }, - { - "id": "Dom.htmlDialogElement", - "kind": "type", - "name": "htmlDialogElement", - "docstrings": [], - "signature": "type htmlDialogElement = htmlElement_like<\n _htmlDialogElement,\n>" - }, - { - "id": "Dom._htmlDivElement", - "kind": "type", - "name": "_htmlDivElement", - "docstrings": [], - "signature": "type _htmlDivElement" - }, - { - "id": "Dom.htmlDivElement", - "kind": "type", - "name": "htmlDivElement", - "docstrings": [], - "signature": "type htmlDivElement = htmlElement_like<_htmlDivElement>" - }, - { - "id": "Dom._htmlDlistElement", - "kind": "type", - "name": "_htmlDlistElement", - "docstrings": [], - "signature": "type _htmlDlistElement" - }, - { - "id": "Dom.htmlDlistElement", - "kind": "type", - "name": "htmlDlistElement", - "docstrings": [], - "signature": "type htmlDlistElement = htmlElement_like<_htmlDlistElement>" - }, - { - "id": "Dom._htmlEmbedElement", - "kind": "type", - "name": "_htmlEmbedElement", - "docstrings": [], - "signature": "type _htmlEmbedElement" - }, - { - "id": "Dom.htmlEmbedElement", - "kind": "type", - "name": "htmlEmbedElement", - "docstrings": [], - "signature": "type htmlEmbedElement = htmlElement_like<_htmlEmbedElement>" - }, - { - "id": "Dom._htmlFieldSetElement", - "kind": "type", - "name": "_htmlFieldSetElement", - "docstrings": [], - "signature": "type _htmlFieldSetElement" - }, - { - "id": "Dom.htmlFieldSetElement", - "kind": "type", - "name": "htmlFieldSetElement", - "docstrings": [], - "signature": "type htmlFieldSetElement = htmlElement_like<\n _htmlFieldSetElement,\n>" - }, - { - "id": "Dom._htmlFormElement", - "kind": "type", - "name": "_htmlFormElement", - "docstrings": [], - "signature": "type _htmlFormElement" - }, - { - "id": "Dom.htmlFormElement", - "kind": "type", - "name": "htmlFormElement", - "docstrings": [], - "signature": "type htmlFormElement = htmlElement_like<_htmlFormElement>" - }, - { - "id": "Dom._htmlHeadElement", - "kind": "type", - "name": "_htmlHeadElement", - "docstrings": [], - "signature": "type _htmlHeadElement" - }, - { - "id": "Dom.htmlHeadElement", - "kind": "type", - "name": "htmlHeadElement", - "docstrings": [], - "signature": "type htmlHeadElement = htmlElement_like<_htmlHeadElement>" - }, - { - "id": "Dom._htmlHeadingElement", - "kind": "type", - "name": "_htmlHeadingElement", - "docstrings": [], - "signature": "type _htmlHeadingElement" - }, - { - "id": "Dom.htmlHeadingElement", - "kind": "type", - "name": "htmlHeadingElement", - "docstrings": [], - "signature": "type htmlHeadingElement = htmlElement_like<\n _htmlHeadingElement,\n>" - }, - { - "id": "Dom._htmlHrElement", - "kind": "type", - "name": "_htmlHrElement", - "docstrings": [], - "signature": "type _htmlHrElement" - }, - { - "id": "Dom.htmlHrElement", - "kind": "type", - "name": "htmlHrElement", - "docstrings": [], - "signature": "type htmlHrElement = htmlElement_like<_htmlHrElement>" - }, - { - "id": "Dom._htmlHtmlElement", - "kind": "type", - "name": "_htmlHtmlElement", - "docstrings": [], - "signature": "type _htmlHtmlElement" - }, - { - "id": "Dom.htmlHtmlElement", - "kind": "type", - "name": "htmlHtmlElement", - "docstrings": [], - "signature": "type htmlHtmlElement = htmlElement_like<_htmlHtmlElement>" - }, - { - "id": "Dom._htmlIframeElement", - "kind": "type", - "name": "_htmlIframeElement", - "docstrings": [], - "signature": "type _htmlIframeElement" - }, - { - "id": "Dom.htmlIframeElement", - "kind": "type", - "name": "htmlIframeElement", - "docstrings": [], - "signature": "type htmlIframeElement = htmlElement_like<\n _htmlIframeElement,\n>" - }, - { - "id": "Dom._htmlImageElement", - "kind": "type", - "name": "_htmlImageElement", - "docstrings": [], - "signature": "type _htmlImageElement" - }, - { - "id": "Dom.htmlImageElement", - "kind": "type", - "name": "htmlImageElement", - "docstrings": [], - "signature": "type htmlImageElement = htmlElement_like<_htmlImageElement>" - }, - { - "id": "Dom._htmlInputElement", - "kind": "type", - "name": "_htmlInputElement", - "docstrings": [], - "signature": "type _htmlInputElement" - }, - { - "id": "Dom.htmlInputElement", - "kind": "type", - "name": "htmlInputElement", - "docstrings": [], - "signature": "type htmlInputElement = htmlElement_like<_htmlInputElement>" - }, - { - "id": "Dom._htmlLabelElement", - "kind": "type", - "name": "_htmlLabelElement", - "docstrings": [], - "signature": "type _htmlLabelElement" - }, - { - "id": "Dom.htmlLabelElement", - "kind": "type", - "name": "htmlLabelElement", - "docstrings": [], - "signature": "type htmlLabelElement = htmlElement_like<_htmlLabelElement>" - }, - { - "id": "Dom._htmlLegendElement", - "kind": "type", - "name": "_htmlLegendElement", - "docstrings": [], - "signature": "type _htmlLegendElement" - }, - { - "id": "Dom.htmlLegendElement", - "kind": "type", - "name": "htmlLegendElement", - "docstrings": [], - "signature": "type htmlLegendElement = htmlElement_like<\n _htmlLegendElement,\n>" - }, - { - "id": "Dom._htmlLiElement", - "kind": "type", - "name": "_htmlLiElement", - "docstrings": [], - "signature": "type _htmlLiElement" - }, - { - "id": "Dom.htmlLiElement", - "kind": "type", - "name": "htmlLiElement", - "docstrings": [], - "signature": "type htmlLiElement = htmlElement_like<_htmlLiElement>" - }, - { - "id": "Dom._htmlLinkElement", - "kind": "type", - "name": "_htmlLinkElement", - "docstrings": [], - "signature": "type _htmlLinkElement" - }, - { - "id": "Dom.htmlLinkElement", - "kind": "type", - "name": "htmlLinkElement", - "docstrings": [], - "signature": "type htmlLinkElement = htmlElement_like<_htmlLinkElement>" - }, - { - "id": "Dom._htmlMapElement", - "kind": "type", - "name": "_htmlMapElement", - "docstrings": [], - "signature": "type _htmlMapElement" - }, - { - "id": "Dom.htmlMapElement", - "kind": "type", - "name": "htmlMapElement", - "docstrings": [], - "signature": "type htmlMapElement = htmlElement_like<_htmlMapElement>" - }, - { - "id": "Dom._htmlMediaElement", - "kind": "type", - "name": "_htmlMediaElement", - "docstrings": [], - "signature": "type _htmlMediaElement" - }, - { - "id": "Dom.htmlMediaElement", - "kind": "type", - "name": "htmlMediaElement", - "docstrings": [], - "signature": "type htmlMediaElement = htmlElement_like<_htmlMediaElement>" - }, - { - "id": "Dom._htmlMenuElement", - "kind": "type", - "name": "_htmlMenuElement", - "docstrings": [], - "signature": "type _htmlMenuElement" - }, - { - "id": "Dom.htmlMenuElement", - "kind": "type", - "name": "htmlMenuElement", - "docstrings": [], - "signature": "type htmlMenuElement = htmlElement_like<_htmlMenuElement>" - }, - { - "id": "Dom._htmlMetaElement", - "kind": "type", - "name": "_htmlMetaElement", - "docstrings": [], - "signature": "type _htmlMetaElement" - }, - { - "id": "Dom.htmlMetaElement", - "kind": "type", - "name": "htmlMetaElement", - "docstrings": [], - "signature": "type htmlMetaElement = htmlElement_like<_htmlMetaElement>" - }, - { - "id": "Dom._htmlMeterElement", - "kind": "type", - "name": "_htmlMeterElement", - "docstrings": [], - "signature": "type _htmlMeterElement" - }, - { - "id": "Dom.htmlMeterElement", - "kind": "type", - "name": "htmlMeterElement", - "docstrings": [], - "signature": "type htmlMeterElement = htmlElement_like<_htmlMeterElement>" - }, - { - "id": "Dom._htmlModElement", - "kind": "type", - "name": "_htmlModElement", - "docstrings": [], - "signature": "type _htmlModElement" - }, - { - "id": "Dom.htmlModElement", - "kind": "type", - "name": "htmlModElement", - "docstrings": [], - "signature": "type htmlModElement = htmlElement_like<_htmlModElement>" - }, - { - "id": "Dom._htmlOListElement", - "kind": "type", - "name": "_htmlOListElement", - "docstrings": [], - "signature": "type _htmlOListElement" - }, - { - "id": "Dom.htmlOListElement", - "kind": "type", - "name": "htmlOListElement", - "docstrings": [], - "signature": "type htmlOListElement = htmlElement_like<_htmlOListElement>" - }, - { - "id": "Dom._htmlObjectElement", - "kind": "type", - "name": "_htmlObjectElement", - "docstrings": [], - "signature": "type _htmlObjectElement" - }, - { - "id": "Dom.htmlObjectElement", - "kind": "type", - "name": "htmlObjectElement", - "docstrings": [], - "signature": "type htmlObjectElement = htmlElement_like<\n _htmlObjectElement,\n>" - }, - { - "id": "Dom._htmlOptGroupElement", - "kind": "type", - "name": "_htmlOptGroupElement", - "docstrings": [], - "signature": "type _htmlOptGroupElement" - }, - { - "id": "Dom.htmlOptGroupElement", - "kind": "type", - "name": "htmlOptGroupElement", - "docstrings": [], - "signature": "type htmlOptGroupElement = htmlElement_like<\n _htmlOptGroupElement,\n>" - }, - { - "id": "Dom._htmlOptionElement", - "kind": "type", - "name": "_htmlOptionElement", - "docstrings": [], - "signature": "type _htmlOptionElement" - }, - { - "id": "Dom.htmlOptionElement", - "kind": "type", - "name": "htmlOptionElement", - "docstrings": [], - "signature": "type htmlOptionElement = htmlElement_like<\n _htmlOptionElement,\n>" - }, - { - "id": "Dom._htmlOutputElement", - "kind": "type", - "name": "_htmlOutputElement", - "docstrings": [], - "signature": "type _htmlOutputElement" - }, - { - "id": "Dom.htmlOutputElement", - "kind": "type", - "name": "htmlOutputElement", - "docstrings": [], - "signature": "type htmlOutputElement = htmlElement_like<\n _htmlOutputElement,\n>" - }, - { - "id": "Dom._htmlParagraphElement", - "kind": "type", - "name": "_htmlParagraphElement", - "docstrings": [], - "signature": "type _htmlParagraphElement" - }, - { - "id": "Dom.htmlParagraphElement", - "kind": "type", - "name": "htmlParagraphElement", - "docstrings": [], - "signature": "type htmlParagraphElement = htmlElement_like<\n _htmlParagraphElement,\n>" - }, - { - "id": "Dom._htmlParamElement", - "kind": "type", - "name": "_htmlParamElement", - "docstrings": [], - "signature": "type _htmlParamElement" - }, - { - "id": "Dom.htmlParamElement", - "kind": "type", - "name": "htmlParamElement", - "docstrings": [], - "signature": "type htmlParamElement = htmlElement_like<_htmlParamElement>" - }, - { - "id": "Dom._htmlPreElement", - "kind": "type", - "name": "_htmlPreElement", - "docstrings": [], - "signature": "type _htmlPreElement" - }, - { - "id": "Dom.htmlPreElement", - "kind": "type", - "name": "htmlPreElement", - "docstrings": [], - "signature": "type htmlPreElement = htmlElement_like<_htmlPreElement>" - }, - { - "id": "Dom._htmlProgressElement", - "kind": "type", - "name": "_htmlProgressElement", - "docstrings": [], - "signature": "type _htmlProgressElement" - }, - { - "id": "Dom.htmlProgressElement", - "kind": "type", - "name": "htmlProgressElement", - "docstrings": [], - "signature": "type htmlProgressElement = htmlElement_like<\n _htmlProgressElement,\n>" - }, - { - "id": "Dom._htmlQuoteElement", - "kind": "type", - "name": "_htmlQuoteElement", - "docstrings": [], - "signature": "type _htmlQuoteElement" - }, - { - "id": "Dom.htmlQuoteElement", - "kind": "type", - "name": "htmlQuoteElement", - "docstrings": [], - "signature": "type htmlQuoteElement = htmlElement_like<_htmlQuoteElement>" - }, - { - "id": "Dom._htmlScriptElement", - "kind": "type", - "name": "_htmlScriptElement", - "docstrings": [], - "signature": "type _htmlScriptElement" - }, - { - "id": "Dom.htmlScriptElement", - "kind": "type", - "name": "htmlScriptElement", - "docstrings": [], - "signature": "type htmlScriptElement = htmlElement_like<\n _htmlScriptElement,\n>" - }, - { - "id": "Dom._htmlSelectElement", - "kind": "type", - "name": "_htmlSelectElement", - "docstrings": [], - "signature": "type _htmlSelectElement" - }, - { - "id": "Dom.htmlSelectElement", - "kind": "type", - "name": "htmlSelectElement", - "docstrings": [], - "signature": "type htmlSelectElement = htmlElement_like<\n _htmlSelectElement,\n>" - }, - { - "id": "Dom._htmlSlotElement", - "kind": "type", - "name": "_htmlSlotElement", - "docstrings": [], - "signature": "type _htmlSlotElement" - }, - { - "id": "Dom.htmlSlotElement", - "kind": "type", - "name": "htmlSlotElement", - "docstrings": [], - "signature": "type htmlSlotElement = htmlElement_like<_htmlSlotElement>" - }, - { - "id": "Dom._htmlSourceElement", - "kind": "type", - "name": "_htmlSourceElement", - "docstrings": [], - "signature": "type _htmlSourceElement" - }, - { - "id": "Dom.htmlSourceElement", - "kind": "type", - "name": "htmlSourceElement", - "docstrings": [], - "signature": "type htmlSourceElement = htmlElement_like<\n _htmlSourceElement,\n>" - }, - { - "id": "Dom._htmlSpanElement", - "kind": "type", - "name": "_htmlSpanElement", - "docstrings": [], - "signature": "type _htmlSpanElement" - }, - { - "id": "Dom.htmlSpanElement", - "kind": "type", - "name": "htmlSpanElement", - "docstrings": [], - "signature": "type htmlSpanElement = htmlElement_like<_htmlSpanElement>" - }, - { - "id": "Dom._htmlStyleElement", - "kind": "type", - "name": "_htmlStyleElement", - "docstrings": [], - "signature": "type _htmlStyleElement" - }, - { - "id": "Dom.htmlStyleElement", - "kind": "type", - "name": "htmlStyleElement", - "docstrings": [], - "signature": "type htmlStyleElement = htmlElement_like<_htmlStyleElement>" - }, - { - "id": "Dom._htmlTableCaptionElement", - "kind": "type", - "name": "_htmlTableCaptionElement", - "docstrings": [], - "signature": "type _htmlTableCaptionElement" - }, - { - "id": "Dom.htmlTableCaptionElement", - "kind": "type", - "name": "htmlTableCaptionElement", - "docstrings": [], - "signature": "type htmlTableCaptionElement = htmlElement_like<\n _htmlTableCaptionElement,\n>" - }, - { - "id": "Dom._htmlTableCellElement", - "kind": "type", - "name": "_htmlTableCellElement", - "docstrings": [], - "signature": "type _htmlTableCellElement" - }, - { - "id": "Dom.htmlTableCellElement", - "kind": "type", - "name": "htmlTableCellElement", - "docstrings": [], - "signature": "type htmlTableCellElement = htmlElement_like<\n _htmlTableCellElement,\n>" - }, - { - "id": "Dom._htmlTableColElement", - "kind": "type", - "name": "_htmlTableColElement", - "docstrings": [], - "signature": "type _htmlTableColElement" - }, - { - "id": "Dom.htmlTableColElement", - "kind": "type", - "name": "htmlTableColElement", - "docstrings": [], - "signature": "type htmlTableColElement = htmlElement_like<\n _htmlTableColElement,\n>" - }, - { - "id": "Dom._htmlTableDataCellElement", - "kind": "type", - "name": "_htmlTableDataCellElement", - "docstrings": [], - "signature": "type _htmlTableDataCellElement" - }, - { - "id": "Dom.htmlTableDataCellElement", - "kind": "type", - "name": "htmlTableDataCellElement", - "docstrings": [], - "signature": "type htmlTableDataCellElement = htmlElement_like<\n _htmlTableDataCellElement,\n>" - }, - { - "id": "Dom._htmlTableElement", - "kind": "type", - "name": "_htmlTableElement", - "docstrings": [], - "signature": "type _htmlTableElement" - }, - { - "id": "Dom.htmlTableElement", - "kind": "type", - "name": "htmlTableElement", - "docstrings": [], - "signature": "type htmlTableElement = htmlElement_like<_htmlTableElement>" - }, - { - "id": "Dom._htmlTableHeaderCellElement", - "kind": "type", - "name": "_htmlTableHeaderCellElement", - "docstrings": [], - "signature": "type _htmlTableHeaderCellElement" - }, - { - "id": "Dom.htmlTableHeaderCellElement", - "kind": "type", - "name": "htmlTableHeaderCellElement", - "docstrings": [], - "signature": "type htmlTableHeaderCellElement = htmlElement_like<\n _htmlTableHeaderCellElement,\n>" - }, - { - "id": "Dom._htmlTableRowElement", - "kind": "type", - "name": "_htmlTableRowElement", - "docstrings": [], - "signature": "type _htmlTableRowElement" - }, - { - "id": "Dom.htmlTableRowElement", - "kind": "type", - "name": "htmlTableRowElement", - "docstrings": [], - "signature": "type htmlTableRowElement = htmlElement_like<\n _htmlTableRowElement,\n>" - }, - { - "id": "Dom._htmlTableSectionElement", - "kind": "type", - "name": "_htmlTableSectionElement", - "docstrings": [], - "signature": "type _htmlTableSectionElement" - }, - { - "id": "Dom.htmlTableSectionElement", - "kind": "type", - "name": "htmlTableSectionElement", - "docstrings": [], - "signature": "type htmlTableSectionElement = htmlElement_like<\n _htmlTableSectionElement,\n>" - }, - { - "id": "Dom._htmlTextAreaElement", - "kind": "type", - "name": "_htmlTextAreaElement", - "docstrings": [], - "signature": "type _htmlTextAreaElement" - }, - { - "id": "Dom.htmlTextAreaElement", - "kind": "type", - "name": "htmlTextAreaElement", - "docstrings": [], - "signature": "type htmlTextAreaElement = htmlElement_like<\n _htmlTextAreaElement,\n>" - }, - { - "id": "Dom._htmlTimeElement", - "kind": "type", - "name": "_htmlTimeElement", - "docstrings": [], - "signature": "type _htmlTimeElement" - }, - { - "id": "Dom.htmlTimeElement", - "kind": "type", - "name": "htmlTimeElement", - "docstrings": [], - "signature": "type htmlTimeElement = htmlElement_like<_htmlTimeElement>" - }, - { - "id": "Dom._htmlTitleElement", - "kind": "type", - "name": "_htmlTitleElement", - "docstrings": [], - "signature": "type _htmlTitleElement" - }, - { - "id": "Dom.htmlTitleElement", - "kind": "type", - "name": "htmlTitleElement", - "docstrings": [], - "signature": "type htmlTitleElement = htmlElement_like<_htmlTitleElement>" - }, - { - "id": "Dom._htmlTrackElement", - "kind": "type", - "name": "_htmlTrackElement", - "docstrings": [], - "signature": "type _htmlTrackElement" - }, - { - "id": "Dom.htmlTrackElement", - "kind": "type", - "name": "htmlTrackElement", - "docstrings": [], - "signature": "type htmlTrackElement = htmlElement_like<_htmlTrackElement>" - }, - { - "id": "Dom._htmlUlistElement", - "kind": "type", - "name": "_htmlUlistElement", - "docstrings": [], - "signature": "type _htmlUlistElement" - }, - { - "id": "Dom.htmlUlistElement", - "kind": "type", - "name": "htmlUlistElement", - "docstrings": [], - "signature": "type htmlUlistElement = htmlElement_like<_htmlUlistElement>" - }, - { - "id": "Dom._htmlUnknownElement", - "kind": "type", - "name": "_htmlUnknownElement", - "docstrings": [], - "signature": "type _htmlUnknownElement" - }, - { - "id": "Dom.htmlUnknownElement", - "kind": "type", - "name": "htmlUnknownElement", - "docstrings": [], - "signature": "type htmlUnknownElement = htmlElement_like<\n _htmlUnknownElement,\n>" - }, - { - "id": "Dom._htmlVideoElement", - "kind": "type", - "name": "_htmlVideoElement", - "docstrings": [], - "signature": "type _htmlVideoElement" - }, - { - "id": "Dom.htmlVideoElement", - "kind": "type", - "name": "htmlVideoElement", - "docstrings": [], - "signature": "type htmlVideoElement = htmlElement_like<_htmlVideoElement>" - }, - { - "id": "Dom.location", - "kind": "type", - "name": "location", - "docstrings": [], - "signature": "type location" - }, - { - "id": "Dom.window", - "kind": "type", - "name": "window", - "docstrings": [], - "signature": "type window" - }, - { - "id": "Dom._xmlDocument", - "kind": "type", - "name": "_xmlDocument", - "docstrings": [], - "signature": "type _xmlDocument" - }, - { - "id": "Dom.xmlDocument", - "kind": "type", - "name": "xmlDocument", - "docstrings": [], - "signature": "type xmlDocument = document_like<_xmlDocument>" - }, - { - "id": "Dom.event_like", - "kind": "type", - "name": "event_like", - "docstrings": [], - "signature": "type event_like<'a>" - }, - { - "id": "Dom.event", - "kind": "type", - "name": "event", - "docstrings": [], - "signature": "type event = event_like<_baseClass>" - }, - { - "id": "Dom._uiEvent", - "kind": "type", - "name": "_uiEvent", - "docstrings": [], - "signature": "type _uiEvent<'a>" - }, - { - "id": "Dom.uiEvent_like", - "kind": "type", - "name": "uiEvent_like", - "docstrings": [], - "signature": "type uiEvent_like<'a> = event_like<_uiEvent<'a>>" - }, - { - "id": "Dom.uiEvent", - "kind": "type", - "name": "uiEvent", - "docstrings": [], - "signature": "type uiEvent = uiEvent_like<_baseClass>" - }, - { - "id": "Dom._animationEvent", - "kind": "type", - "name": "_animationEvent", - "docstrings": [], - "signature": "type _animationEvent" - }, - { - "id": "Dom.animationEvent", - "kind": "type", - "name": "animationEvent", - "docstrings": [], - "signature": "type animationEvent = event_like<_animationEvent>" - }, - { - "id": "Dom._beforeUnloadEvent", - "kind": "type", - "name": "_beforeUnloadEvent", - "docstrings": [], - "signature": "type _beforeUnloadEvent" - }, - { - "id": "Dom.beforeUnloadEvent", - "kind": "type", - "name": "beforeUnloadEvent", - "docstrings": [], - "signature": "type beforeUnloadEvent = event_like<_beforeUnloadEvent>" - }, - { - "id": "Dom._clipboardEvent", - "kind": "type", - "name": "_clipboardEvent", - "docstrings": [], - "signature": "type _clipboardEvent" - }, - { - "id": "Dom.clipboardEvent", - "kind": "type", - "name": "clipboardEvent", - "docstrings": [], - "signature": "type clipboardEvent = event_like<_clipboardEvent>" - }, - { - "id": "Dom._closeEvent", - "kind": "type", - "name": "_closeEvent", - "docstrings": [], - "signature": "type _closeEvent" - }, - { - "id": "Dom.closeEvent", - "kind": "type", - "name": "closeEvent", - "docstrings": [], - "signature": "type closeEvent = event_like<_closeEvent>" - }, - { - "id": "Dom._compositionEvent", - "kind": "type", - "name": "_compositionEvent", - "docstrings": [], - "signature": "type _compositionEvent" - }, - { - "id": "Dom.compositionEvent", - "kind": "type", - "name": "compositionEvent", - "docstrings": [], - "signature": "type compositionEvent = uiEvent_like<_compositionEvent>" - }, - { - "id": "Dom._customEvent", - "kind": "type", - "name": "_customEvent", - "docstrings": [], - "signature": "type _customEvent" - }, - { - "id": "Dom.customEvent", - "kind": "type", - "name": "customEvent", - "docstrings": [], - "signature": "type customEvent = event_like<_customEvent>" - }, - { - "id": "Dom._dragEvent", - "kind": "type", - "name": "_dragEvent", - "docstrings": [], - "signature": "type _dragEvent" - }, - { - "id": "Dom.dragEvent", - "kind": "type", - "name": "dragEvent", - "docstrings": [], - "signature": "type dragEvent = event_like<_dragEvent>" - }, - { - "id": "Dom._errorEvent", - "kind": "type", - "name": "_errorEvent", - "docstrings": [], - "signature": "type _errorEvent" - }, - { - "id": "Dom.errorEvent", - "kind": "type", - "name": "errorEvent", - "docstrings": [], - "signature": "type errorEvent = event_like<_errorEvent>" - }, - { - "id": "Dom._focusEvent", - "kind": "type", - "name": "_focusEvent", - "docstrings": [], - "signature": "type _focusEvent" - }, - { - "id": "Dom.focusEvent", - "kind": "type", - "name": "focusEvent", - "docstrings": [], - "signature": "type focusEvent = uiEvent_like<_focusEvent>" - }, - { - "id": "Dom._idbVersionChangeEvent", - "kind": "type", - "name": "_idbVersionChangeEvent", - "docstrings": [], - "signature": "type _idbVersionChangeEvent" - }, - { - "id": "Dom.idbVersionChangeEvent", - "kind": "type", - "name": "idbVersionChangeEvent", - "docstrings": [], - "signature": "type idbVersionChangeEvent = event_like<\n _idbVersionChangeEvent,\n>" - }, - { - "id": "Dom._inputEvent", - "kind": "type", - "name": "_inputEvent", - "docstrings": [], - "signature": "type _inputEvent" - }, - { - "id": "Dom.inputEvent", - "kind": "type", - "name": "inputEvent", - "docstrings": [], - "signature": "type inputEvent = uiEvent_like<_inputEvent>" - }, - { - "id": "Dom._keyboardEvent", - "kind": "type", - "name": "_keyboardEvent", - "docstrings": [], - "signature": "type _keyboardEvent" - }, - { - "id": "Dom.keyboardEvent", - "kind": "type", - "name": "keyboardEvent", - "docstrings": [], - "signature": "type keyboardEvent = uiEvent_like<_keyboardEvent>" - }, - { - "id": "Dom._mouseEvent", - "kind": "type", - "name": "_mouseEvent", - "docstrings": [], - "signature": "type _mouseEvent<'a>" - }, - { - "id": "Dom.mouseEvent_like", - "kind": "type", - "name": "mouseEvent_like", - "docstrings": [], - "signature": "type mouseEvent_like<'a> = uiEvent_like<_mouseEvent<'a>>" - }, - { - "id": "Dom.mouseEvent", - "kind": "type", - "name": "mouseEvent", - "docstrings": [], - "signature": "type mouseEvent = mouseEvent_like<_baseClass>" - }, - { - "id": "Dom._pageTransitionEvent", - "kind": "type", - "name": "_pageTransitionEvent", - "docstrings": [], - "signature": "type _pageTransitionEvent" - }, - { - "id": "Dom.pageTransitionEvent", - "kind": "type", - "name": "pageTransitionEvent", - "docstrings": [], - "signature": "type pageTransitionEvent = event_like<_pageTransitionEvent>" - }, - { - "id": "Dom._pointerEvent", - "kind": "type", - "name": "_pointerEvent", - "docstrings": [], - "signature": "type _pointerEvent" - }, - { - "id": "Dom.pointerEvent", - "kind": "type", - "name": "pointerEvent", - "docstrings": [], - "signature": "type pointerEvent = mouseEvent_like<_pointerEvent>" - }, - { - "id": "Dom._popStateEvent", - "kind": "type", - "name": "_popStateEvent", - "docstrings": [], - "signature": "type _popStateEvent" - }, - { - "id": "Dom.popStateEvent", - "kind": "type", - "name": "popStateEvent", - "docstrings": [], - "signature": "type popStateEvent = event_like<_popStateEvent>" - }, - { - "id": "Dom._progressEvent", - "kind": "type", - "name": "_progressEvent", - "docstrings": [], - "signature": "type _progressEvent" - }, - { - "id": "Dom.progressEvent", - "kind": "type", - "name": "progressEvent", - "docstrings": [], - "signature": "type progressEvent = event_like<_progressEvent>" - }, - { - "id": "Dom._relatedEvent", - "kind": "type", - "name": "_relatedEvent", - "docstrings": [], - "signature": "type _relatedEvent" - }, - { - "id": "Dom.relatedEvent", - "kind": "type", - "name": "relatedEvent", - "docstrings": [], - "signature": "type relatedEvent = event_like<_relatedEvent>" - }, - { - "id": "Dom._storageEvent", - "kind": "type", - "name": "_storageEvent", - "docstrings": [], - "signature": "type _storageEvent" - }, - { - "id": "Dom.storageEvent", - "kind": "type", - "name": "storageEvent", - "docstrings": [], - "signature": "type storageEvent = event_like<_storageEvent>" - }, - { - "id": "Dom._svgZoomEvent", - "kind": "type", - "name": "_svgZoomEvent", - "docstrings": [], - "signature": "type _svgZoomEvent" - }, - { - "id": "Dom.svgZoomEvent", - "kind": "type", - "name": "svgZoomEvent", - "docstrings": [], - "signature": "type svgZoomEvent = event_like<_svgZoomEvent>" - }, - { - "id": "Dom._timeEvent", - "kind": "type", - "name": "_timeEvent", - "docstrings": [], - "signature": "type _timeEvent" - }, - { - "id": "Dom.timeEvent", - "kind": "type", - "name": "timeEvent", - "docstrings": [], - "signature": "type timeEvent = event_like<_timeEvent>" - }, - { - "id": "Dom._touchEvent", - "kind": "type", - "name": "_touchEvent", - "docstrings": [], - "signature": "type _touchEvent" - }, - { - "id": "Dom.touchEvent", - "kind": "type", - "name": "touchEvent", - "docstrings": [], - "signature": "type touchEvent = uiEvent_like<_touchEvent>" - }, - { - "id": "Dom._trackEvent", - "kind": "type", - "name": "_trackEvent", - "docstrings": [], - "signature": "type _trackEvent" - }, - { - "id": "Dom.trackEvent", - "kind": "type", - "name": "trackEvent", - "docstrings": [], - "signature": "type trackEvent = event_like<_trackEvent>" - }, - { - "id": "Dom._transitionEvent", - "kind": "type", - "name": "_transitionEvent", - "docstrings": [], - "signature": "type _transitionEvent" - }, - { - "id": "Dom.transitionEvent", - "kind": "type", - "name": "transitionEvent", - "docstrings": [], - "signature": "type transitionEvent = event_like<_transitionEvent>" - }, - { - "id": "Dom._webGlContextEvent", - "kind": "type", - "name": "_webGlContextEvent", - "docstrings": [], - "signature": "type _webGlContextEvent" - }, - { - "id": "Dom.webGlContextEvent", - "kind": "type", - "name": "webGlContextEvent", - "docstrings": [], - "signature": "type webGlContextEvent = event_like<_webGlContextEvent>" - }, - { - "id": "Dom._wheelEvent", - "kind": "type", - "name": "_wheelEvent", - "docstrings": [], - "signature": "type _wheelEvent" - }, - { - "id": "Dom.wheelEvent", - "kind": "type", - "name": "wheelEvent", - "docstrings": [], - "signature": "type wheelEvent = uiEvent_like<_wheelEvent>" - }, - { - "id": "Dom.range", - "kind": "type", - "name": "range", - "docstrings": [], - "signature": "type range" - }, - { - "id": "Dom.selection", - "kind": "type", - "name": "selection", - "docstrings": [], - "signature": "type selection" - }, - { - "id": "Dom.domTokenList", - "kind": "type", - "name": "domTokenList", - "docstrings": [], - "signature": "type domTokenList" - }, - { - "id": "Dom.domSettableTokenList", - "kind": "type", - "name": "domSettableTokenList", - "docstrings": [], - "signature": "type domSettableTokenList" - }, - { - "id": "Dom.nodeFilter", - "kind": "type", - "name": "nodeFilter", - "docstrings": [], - "signature": "type nodeFilter = {acceptNode: element => int}" - }, - { - "id": "Dom.nodeIterator", - "kind": "type", - "name": "nodeIterator", - "docstrings": [], - "signature": "type nodeIterator" - }, - { - "id": "Dom.treeWalker", - "kind": "type", - "name": "treeWalker", - "docstrings": [], - "signature": "type treeWalker" - }, - { - "id": "Dom.svgRect", - "kind": "type", - "name": "svgRect", - "docstrings": [], - "signature": "type svgRect" - }, - { - "id": "Dom.svgPoint", - "kind": "type", - "name": "svgPoint", - "docstrings": [], - "signature": "type svgPoint" - }, - { - "id": "Dom.eventPointerId", - "kind": "type", - "name": "eventPointerId", - "docstrings": [], - "signature": "type eventPointerId" - } - ] - }, - "dom/storage2": { - "id": "Dom.Storage2", - "name": "Storage2", - "docstrings": [], - "items": [ - { - "id": "Dom.Storage2.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Dom.Storage2.getItem", - "kind": "value", - "name": "getItem", - "docstrings": [], - "signature": "let getItem: (t, string) => option" - }, - { - "id": "Dom.Storage2.setItem", - "kind": "value", - "name": "setItem", - "docstrings": [], - "signature": "let setItem: (t, string, string) => unit" - }, - { - "id": "Dom.Storage2.removeItem", - "kind": "value", - "name": "removeItem", - "docstrings": [], - "signature": "let removeItem: (t, string) => unit" - }, - { - "id": "Dom.Storage2.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Dom.Storage2.key", - "kind": "value", - "name": "key", - "docstrings": [], - "signature": "let key: (t, int) => option" - }, - { - "id": "Dom.Storage2.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int" - }, - { - "id": "Dom.Storage2.localStorage", - "kind": "value", - "name": "localStorage", - "docstrings": [], - "signature": "let localStorage: t" - }, - { - "id": "Dom.Storage2.sessionStorage", - "kind": "value", - "name": "sessionStorage", - "docstrings": [], - "signature": "let sessionStorage: t" - } - ] - }, - "dom/storage": { - "id": "Dom.Storage", - "name": "Storage", - "docstrings": [], - "items": [ - { - "id": "Dom.Storage.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Dom_storage2.t" - }, - { - "id": "Dom.Storage.getItem", - "kind": "value", - "name": "getItem", - "docstrings": [], - "signature": "let getItem: (string, t) => option" - }, - { - "id": "Dom.Storage.setItem", - "kind": "value", - "name": "setItem", - "docstrings": [], - "signature": "let setItem: (string, string, t) => unit" - }, - { - "id": "Dom.Storage.removeItem", - "kind": "value", - "name": "removeItem", - "docstrings": [], - "signature": "let removeItem: (string, t) => unit" - }, - { - "id": "Dom.Storage.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Dom.Storage.key", - "kind": "value", - "name": "key", - "docstrings": [], - "signature": "let key: (int, t) => option" - }, - { - "id": "Dom.Storage.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int" - }, - { - "id": "Dom.Storage.localStorage", - "kind": "value", - "name": "localStorage", - "docstrings": [], - "signature": "let localStorage: t" - }, - { - "id": "Dom.Storage.sessionStorage", - "kind": "value", - "name": "sessionStorage", - "docstrings": [], - "signature": "let sessionStorage: t" - } - ] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v13.0.0/js.json b/apps/docs/data/api/v13.0.0/js.json deleted file mode 100644 index a6030fbc9..000000000 --- a/apps/docs/data/api/v13.0.0/js.json +++ /dev/null @@ -1,12866 +0,0 @@ -{ - "js": { - "id": "Js", - "name": "Js", - "docstrings": [ - "The Js module mostly contains ReScript bindings to _standard JavaScript APIs_\nlike [console.log](https://developer.mozilla.org/en-US/docs/Web/API/Console/log),\nor the JavaScript\n[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String),\n[Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date), and\n[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\nclasses.\n\nIt is meant as a zero-abstraction interop layer and directly exposes JavaScript functions as they are. If you can find your API in this module, prefer this over an equivalent Belt helper. For example, prefer [Js.Array2](js/array2) over [Belt.Array](belt/array)\n\n## Argument Order\n\nFor historical reasons, some APIs in the Js namespace (e.g. [Js.String](js/string)) are\nusing the data-last argument order whereas others (e.g. [Js.Date](js/date)) are using data-first.\n\nFor more information about these argument orders and the trade-offs between them, see\n[this blog post](https://www.javierchavarri.com/data-first-and-data-last-a-comparison/).\n\n_Eventually, all modules in the Js namespace are going to be migrated to data-first though._\n\n## Js.Xxx2 Modules\n\nPrefer `Js.Array2` over `Js.Array`, `Js.String2` over `Js.String`, etc. The latters are old modules." - ], - "items": [ - { - "id": "Js.t", - "kind": "type", - "name": "t", - "docstrings": [ - "JS object type" - ], - "signature": "type t<'a> = 'a\n constraint 'a = {..}", - "deprecated": "This has been deprecated and will be removed in v13. Use the `{..}` type directly instead." - }, - { - "id": "Js.globalThis", - "kind": "value", - "name": "globalThis", - "docstrings": [ - "JS global object reference" - ], - "signature": "let globalThis: t<{..}>", - "deprecated": "" - }, - { - "id": "Js.null", - "kind": "type", - "name": "null", - "docstrings": [], - "signature": "@unboxed\ntype null<'a> = Js_null.t<'a> = Value('a) | @as(null) Null", - "deprecated": "" - }, - { - "id": "Js.undefined", - "kind": "type", - "name": "undefined", - "docstrings": [], - "signature": "type undefined<'a> = Js_undefined.t<'a>", - "deprecated": "This has been deprecated and will be removed in v13." - }, - { - "id": "Js.nullable", - "kind": "type", - "name": "nullable", - "docstrings": [], - "signature": "@unboxed\ntype nullable<'a> = Js_null_undefined.t<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined", - "deprecated": "" - }, - { - "id": "Js.null_undefined", - "kind": "type", - "name": "null_undefined", - "docstrings": [], - "signature": "type null_undefined<'a> = nullable<'a>", - "deprecated": "" - }, - { - "id": "Js.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [], - "signature": "let toOption: nullable<'a> => option<'a>" - }, - { - "id": "Js.undefinedToOption", - "kind": "value", - "name": "undefinedToOption", - "docstrings": [], - "signature": "let undefinedToOption: undefined<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.nullToOption", - "kind": "value", - "name": "nullToOption", - "docstrings": [], - "signature": "let nullToOption: null<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [], - "signature": "let isNullable: nullable<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.import", - "kind": "value", - "name": "import", - "docstrings": [], - "signature": "let import: 'a => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.testAny", - "kind": "value", - "name": "testAny", - "docstrings": [ - "The same as {!test} except that it is more permissive on the types of input" - ], - "signature": "let testAny: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.promise", - "kind": "type", - "name": "promise", - "docstrings": [ - "The promise type, defined here for interoperation across packages." - ], - "signature": "type promise<+'a, +'e>", - "deprecated": "This is deprecated and will be removed in v13. Use the `promise` type directly instead." - }, - { - "id": "Js.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The same as empty in `Js.Null`. Compiles to `null`." - ], - "signature": "let null: null<'a>", - "deprecated": "" - }, - { - "id": "Js.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The same as empty `Js.Undefined`. Compiles to `undefined`." - ], - "signature": "let undefined: undefined<'a>", - "deprecated": "" - }, - { - "id": "Js.typeof", - "kind": "value", - "name": "typeof", - "docstrings": [ - "`typeof x` will be compiled as `typeof x` in JS. Please consider functions in\n`Js.Types` for a type safe way of reflection." - ], - "signature": "let typeof: 'a => string", - "deprecated": "" - }, - { - "id": "Js.log", - "kind": "value", - "name": "log", - "docstrings": [ - "Equivalent to console.log any value." - ], - "signature": "let log: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.log2", - "kind": "value", - "name": "log2", - "docstrings": [], - "signature": "let log2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.log3", - "kind": "value", - "name": "log3", - "docstrings": [], - "signature": "let log3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.log4", - "kind": "value", - "name": "log4", - "docstrings": [], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.logMany", - "kind": "value", - "name": "logMany", - "docstrings": [ - "A convenience function to console.log more than 4 arguments" - ], - "signature": "let logMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.eqNull", - "kind": "value", - "name": "eqNull", - "docstrings": [], - "signature": "let eqNull: ('a, null<'a>) => bool", - "deprecated": "" - }, - { - "id": "Js.eqUndefined", - "kind": "value", - "name": "eqUndefined", - "docstrings": [], - "signature": "let eqUndefined: ('a, undefined<'a>) => bool", - "deprecated": "" - }, - { - "id": "Js.eqNullable", - "kind": "value", - "name": "eqNullable", - "docstrings": [], - "signature": "let eqNullable: ('a, nullable<'a>) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_lt", - "kind": "value", - "name": "unsafe_lt", - "docstrings": [ - "`unsafe_lt(a, b)` will be compiled as `a < b`.\n It is marked as unsafe, since it is impossible\n to give a proper semantics for comparision which applies to any type" - ], - "signature": "let unsafe_lt: ('a, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_le", - "kind": "value", - "name": "unsafe_le", - "docstrings": [ - "`unsafe_le(a, b)` will be compiled as `a <= b`.\n See also `Js.unsafe_lt`." - ], - "signature": "let unsafe_le: ('a, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_gt", - "kind": "value", - "name": "unsafe_gt", - "docstrings": [ - "`unsafe_gt(a, b)` will be compiled as `a > b`.\n See also `Js.unsafe_lt`." - ], - "signature": "let unsafe_gt: ('a, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_ge", - "kind": "value", - "name": "unsafe_ge", - "docstrings": [ - "`unsafe_ge(a, b)` will be compiled as `a >= b`.\n See also `Js.unsafe_lt`." - ], - "signature": "let unsafe_ge: ('a, 'a) => bool", - "deprecated": "" - } - ] - }, - "js/typedarray2/dataview": { - "id": "Js.TypedArray2.DataView", - "name": "DataView", - "docstrings": [ - "The DataView view provides a low-level interface for reading and writing\nmultiple number types in an ArrayBuffer irrespective of the platform's endianness.\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)" - ], - "items": [ - { - "id": "Js.TypedArray2.DataView.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Js.TypedArray2.DataView.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array_buffer => t" - }, - { - "id": "Js.TypedArray2.DataView.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.DataView.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [], - "signature": "let fromBufferOffset: (array_buffer, int) => t" - }, - { - "id": "Js.TypedArray2.DataView.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t" - }, - { - "id": "Js.TypedArray2.DataView.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.DataView.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.DataView.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt8", - "kind": "value", - "name": "getInt8", - "docstrings": [], - "signature": "let getInt8: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint8", - "kind": "value", - "name": "getUint8", - "docstrings": [], - "signature": "let getUint8: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt16", - "kind": "value", - "name": "getInt16", - "docstrings": [], - "signature": "let getInt16: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt16LittleEndian", - "kind": "value", - "name": "getInt16LittleEndian", - "docstrings": [], - "signature": "let getInt16LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint16", - "kind": "value", - "name": "getUint16", - "docstrings": [], - "signature": "let getUint16: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint16LittleEndian", - "kind": "value", - "name": "getUint16LittleEndian", - "docstrings": [], - "signature": "let getUint16LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt32", - "kind": "value", - "name": "getInt32", - "docstrings": [], - "signature": "let getInt32: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt32LittleEndian", - "kind": "value", - "name": "getInt32LittleEndian", - "docstrings": [], - "signature": "let getInt32LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint32", - "kind": "value", - "name": "getUint32", - "docstrings": [], - "signature": "let getUint32: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint32LittleEndian", - "kind": "value", - "name": "getUint32LittleEndian", - "docstrings": [], - "signature": "let getUint32LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getFloat32", - "kind": "value", - "name": "getFloat32", - "docstrings": [], - "signature": "let getFloat32: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.getFloat32LittleEndian", - "kind": "value", - "name": "getFloat32LittleEndian", - "docstrings": [], - "signature": "let getFloat32LittleEndian: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.getFloat64", - "kind": "value", - "name": "getFloat64", - "docstrings": [], - "signature": "let getFloat64: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.getFloat64LittleEndian", - "kind": "value", - "name": "getFloat64LittleEndian", - "docstrings": [], - "signature": "let getFloat64LittleEndian: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.setInt8", - "kind": "value", - "name": "setInt8", - "docstrings": [], - "signature": "let setInt8: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint8", - "kind": "value", - "name": "setUint8", - "docstrings": [], - "signature": "let setUint8: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt16", - "kind": "value", - "name": "setInt16", - "docstrings": [], - "signature": "let setInt16: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt16LittleEndian", - "kind": "value", - "name": "setInt16LittleEndian", - "docstrings": [], - "signature": "let setInt16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint16", - "kind": "value", - "name": "setUint16", - "docstrings": [], - "signature": "let setUint16: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint16LittleEndian", - "kind": "value", - "name": "setUint16LittleEndian", - "docstrings": [], - "signature": "let setUint16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt32", - "kind": "value", - "name": "setInt32", - "docstrings": [], - "signature": "let setInt32: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt32LittleEndian", - "kind": "value", - "name": "setInt32LittleEndian", - "docstrings": [], - "signature": "let setInt32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint32", - "kind": "value", - "name": "setUint32", - "docstrings": [], - "signature": "let setUint32: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint32LittleEndian", - "kind": "value", - "name": "setUint32LittleEndian", - "docstrings": [], - "signature": "let setUint32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat32", - "kind": "value", - "name": "setFloat32", - "docstrings": [], - "signature": "let setFloat32: (t, int, float) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat32LittleEndian", - "kind": "value", - "name": "setFloat32LittleEndian", - "docstrings": [], - "signature": "let setFloat32LittleEndian: (t, int, float) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat64", - "kind": "value", - "name": "setFloat64", - "docstrings": [], - "signature": "let setFloat64: (t, int, float) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat64LittleEndian", - "kind": "value", - "name": "setFloat64LittleEndian", - "docstrings": [], - "signature": "let setFloat64LittleEndian: (t, int, float) => unit" - } - ] - }, - "js/typedarray2/float64array": { - "id": "Js.TypedArray2.Float64Array", - "name": "Float64Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Float64Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.TypedArray2.Float64Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Float64Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Float64Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Float64Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Float64Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Float64Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Float64Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Float64Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/float32array": { - "id": "Js.TypedArray2.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Float32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.TypedArray2.Float32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Float32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Float32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Float32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Float32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Float32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Float32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Float32Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/uint32array": { - "id": "Js.TypedArray2.Uint32Array", - "name": "Uint32Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint32Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/int32array": { - "id": "Js.TypedArray2.Int32Array", - "name": "Int32Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Int32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Int32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Int32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Int32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Int32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Int32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Int32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Int32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Int32Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/uint16array": { - "id": "Js.TypedArray2.Uint16Array", - "name": "Uint16Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t" - }, - { - "id": "Js.TypedArray2.Uint16Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t" - }, - { - "id": "Js.TypedArray2.Uint16Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>" - }, - { - "id": "Js.TypedArray2.Uint16Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b" - }, - { - "id": "Js.TypedArray2.Uint16Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b" - }, - { - "id": "Js.TypedArray2.Uint16Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b" - }, - { - "id": "Js.TypedArray2.Uint16Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/int16array": { - "id": "Js.TypedArray2.Int16Array", - "name": "Int16Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Int16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Int16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Int16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Int16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Int16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Int16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Int16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Int16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Int16Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int" - }, - { - "id": "Js.TypedArray2.Int16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t" - }, - { - "id": "Js.TypedArray2.Int16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t" - } - ] - }, - "js/typedarray2/uint8clampedarray": { - "id": "Js.TypedArray2.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint8ClampedArray.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/uint8array": { - "id": "Js.TypedArray2.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint8Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t" - }, - { - "id": "Js.TypedArray2.Uint8Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/int8array": { - "id": "Js.TypedArray2.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Int8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Int8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Int8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Int8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Int8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Int8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Int8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Int8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Int8Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`start` is inclusive, `end_` exclusive" - ], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Int8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/arraybuffer": { - "id": "Js.TypedArray2.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [ - "The underlying buffer that the typed arrays provide views of\n\n **see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)" - ], - "items": [ - { - "id": "Js.TypedArray2.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = array_buffer" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.make", - "kind": "value", - "name": "make", - "docstrings": [ - "takes length. initializes elements to 0" - ], - "signature": "let make: int => t" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (t, ~start: int, ~end_: int) => array_buffer", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => array_buffer", - "deprecated": "" - } - ] - }, - "js/typed_array/dataview": { - "id": "Js.Typed_array.DataView", - "name": "DataView", - "docstrings": [ - "The DataView view provides a low-level interface for reading and writing\nmultiple number types in an ArrayBuffer irrespective of the platform's endianness.\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)" - ], - "items": [ - { - "id": "Js.Typed_array.DataView.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Js_typed_array2.DataView.t" - }, - { - "id": "Js.Typed_array.DataView.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array_buffer => t" - }, - { - "id": "Js.Typed_array.DataView.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.DataView.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [], - "signature": "let fromBufferOffset: (array_buffer, int) => t" - }, - { - "id": "Js.Typed_array.DataView.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t" - }, - { - "id": "Js.Typed_array.DataView.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.DataView.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.DataView.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.DataView.getInt8", - "kind": "value", - "name": "getInt8", - "docstrings": [], - "signature": "let getInt8: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint8", - "kind": "value", - "name": "getUint8", - "docstrings": [], - "signature": "let getUint8: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt16", - "kind": "value", - "name": "getInt16", - "docstrings": [], - "signature": "let getInt16: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt16LittleEndian", - "kind": "value", - "name": "getInt16LittleEndian", - "docstrings": [], - "signature": "let getInt16LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint16", - "kind": "value", - "name": "getUint16", - "docstrings": [], - "signature": "let getUint16: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint16LittleEndian", - "kind": "value", - "name": "getUint16LittleEndian", - "docstrings": [], - "signature": "let getUint16LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt32", - "kind": "value", - "name": "getInt32", - "docstrings": [], - "signature": "let getInt32: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt32LittleEndian", - "kind": "value", - "name": "getInt32LittleEndian", - "docstrings": [], - "signature": "let getInt32LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint32", - "kind": "value", - "name": "getUint32", - "docstrings": [], - "signature": "let getUint32: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint32LittleEndian", - "kind": "value", - "name": "getUint32LittleEndian", - "docstrings": [], - "signature": "let getUint32LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getFloat32", - "kind": "value", - "name": "getFloat32", - "docstrings": [], - "signature": "let getFloat32: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.getFloat32LittleEndian", - "kind": "value", - "name": "getFloat32LittleEndian", - "docstrings": [], - "signature": "let getFloat32LittleEndian: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.getFloat64", - "kind": "value", - "name": "getFloat64", - "docstrings": [], - "signature": "let getFloat64: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.getFloat64LittleEndian", - "kind": "value", - "name": "getFloat64LittleEndian", - "docstrings": [], - "signature": "let getFloat64LittleEndian: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.setInt8", - "kind": "value", - "name": "setInt8", - "docstrings": [], - "signature": "let setInt8: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint8", - "kind": "value", - "name": "setUint8", - "docstrings": [], - "signature": "let setUint8: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt16", - "kind": "value", - "name": "setInt16", - "docstrings": [], - "signature": "let setInt16: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt16LittleEndian", - "kind": "value", - "name": "setInt16LittleEndian", - "docstrings": [], - "signature": "let setInt16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint16", - "kind": "value", - "name": "setUint16", - "docstrings": [], - "signature": "let setUint16: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint16LittleEndian", - "kind": "value", - "name": "setUint16LittleEndian", - "docstrings": [], - "signature": "let setUint16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt32", - "kind": "value", - "name": "setInt32", - "docstrings": [], - "signature": "let setInt32: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt32LittleEndian", - "kind": "value", - "name": "setInt32LittleEndian", - "docstrings": [], - "signature": "let setInt32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint32", - "kind": "value", - "name": "setUint32", - "docstrings": [], - "signature": "let setUint32: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint32LittleEndian", - "kind": "value", - "name": "setUint32LittleEndian", - "docstrings": [], - "signature": "let setUint32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat32", - "kind": "value", - "name": "setFloat32", - "docstrings": [], - "signature": "let setFloat32: (t, int, float) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat32LittleEndian", - "kind": "value", - "name": "setFloat32LittleEndian", - "docstrings": [], - "signature": "let setFloat32LittleEndian: (t, int, float) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat64", - "kind": "value", - "name": "setFloat64", - "docstrings": [], - "signature": "let setFloat64: (t, int, float) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat64LittleEndian", - "kind": "value", - "name": "setFloat64LittleEndian", - "docstrings": [], - "signature": "let setFloat64LittleEndian: (t, int, float) => unit" - } - ] - }, - "js/typed_array/float64_array": { - "id": "Js.Typed_array.Float64_array", - "name": "Float64_array", - "docstrings": [], - "items": [] - }, - "js/typed_array/float64array": { - "id": "Js.Typed_array.Float64Array", - "name": "Float64Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Float64Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.Typed_array.Float64Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Float64Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Float64Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Float64Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Float64Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Float64Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Float64Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Float64Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Float64Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.create", - "kind": "value", - "name": "create", - "docstrings": [], - "signature": "let create: array => t", - "deprecated": "use `make` instead" - }, - { - "id": "Js.Typed_array.Float64Array.of_buffer", - "kind": "value", - "name": "of_buffer", - "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" - } - ] - }, - "js/typed_array/float32_array": { - "id": "Js.Typed_array.Float32_array", - "name": "Float32_array", - "docstrings": [], - "items": [] - }, - "js/typed_array/float32array": { - "id": "Js.Typed_array.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Float32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = float" - }, - { - "id": "Js.Typed_array.Float32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Float32Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Float32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Float32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Float32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Float32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Float32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Float32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Float32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.create", - "kind": "value", - "name": "create", - "docstrings": [], - "signature": "let create: array => t", - "deprecated": "use `make` instead" - }, - { - "id": "Js.Typed_array.Float32Array.of_buffer", - "kind": "value", - "name": "of_buffer", - "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" - } - ] - }, - "js/typed_array/uint32array": { - "id": "Js.Typed_array.Uint32Array", - "name": "Uint32Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint32Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/int32_array": { - "id": "Js.Typed_array.Int32_array", - "name": "Int32_array", - "docstrings": [], - "items": [] - }, - "js/typed_array/int32array": { - "id": "Js.Typed_array.Int32Array", - "name": "Int32Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Int32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Int32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int32Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Int32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Int32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Int32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Int32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Int32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Int32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Int32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.create", - "kind": "value", - "name": "create", - "docstrings": [], - "signature": "let create: array => t", - "deprecated": "use `make` instead" - }, - { - "id": "Js.Typed_array.Int32Array.of_buffer", - "kind": "value", - "name": "of_buffer", - "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" - } - ] - }, - "js/typed_array/uint16array": { - "id": "Js.Typed_array.Uint16Array", - "name": "Uint16Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint16Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/int16array": { - "id": "Js.Typed_array.Int16Array", - "name": "Int16Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Int16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Int16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int16Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Int16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Int16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Int16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Int16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Int16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Int16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Int16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/uint8clampedarray": { - "id": "Js.Typed_array.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint8ClampedArray.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint8ClampedArray.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/uint8array": { - "id": "Js.Typed_array.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint8Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.Uint8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/int8array": { - "id": "Js.Typed_array.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Int8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Int8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int8Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Int8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Int8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Int8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Int8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Int8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Int8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Int8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "Use `TypedArray.slice` instead." - }, - { - "id": "Js.Typed_array.Int8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "Use `TypedArray.sliceToEnd` instead." - }, - { - "id": "Js.Typed_array.Int8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "can throw" - ], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.Int8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "throw Js.Exn.Error throw Js exception\n\n param offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "throw Js.Exn.Error throws Js exception\n\n param offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/s": { - "id": "Js.Typed_array.S", - "name": "S", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.S.elt", - "kind": "type", - "name": "elt", - "docstrings": [], - "signature": "type elt" - }, - { - "id": "Js.Typed_array.S.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.Typed_array.S.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.S.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.S.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.S.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.S.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.S.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.S.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int" - }, - { - "id": "Js.Typed_array.S.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t" - }, - { - "id": "Js.Typed_array.S.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: elt => bool", - "deprecated": "" - }, - { - "id": "Js.Typed_array.S.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "should we use `bool` or `boolean` seems they are intechangeable here" - ], - "signature": "let filter: (elt => bool) => t" - } - ] - }, - "js/typed_array/arraybuffer": { - "id": "Js.Typed_array.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [ - "The underlying buffer that the typed arrays provide views of\n\n **see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)" - ], - "items": [ - { - "id": "Js.Typed_array.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = array_buffer" - }, - { - "id": "Js.Typed_array.ArrayBuffer.make", - "kind": "value", - "name": "make", - "docstrings": [ - "takes length. initializes elements to 0" - ], - "signature": "let make: int => t" - }, - { - "id": "Js.Typed_array.ArrayBuffer.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - } - ] - }, - "js/typed_array/type": { - "id": "Js.Typed_array.Type", - "name": "Type", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Type.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - } - ] - }, - "js/json/kind": { - "id": "Js.Json.Kind", - "name": "Kind", - "docstrings": [], - "items": [ - { - "id": "Js.Json.Kind.json", - "kind": "type", - "name": "json", - "docstrings": [], - "signature": "type json = t" - }, - { - "id": "Js.Json.Kind.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Underlying type of a JSON value" - ], - "signature": "type t<_> =\n | String: t\n | Number: t\n | Object: t>\n | Array: t>\n | Boolean: t\n | Null: t" - } - ] - }, - "js/weakmap": { - "id": "Js.WeakMap", - "name": "WeakMap", - "docstrings": [ - "Provides bindings for ES6 WeakMap", - "ES6 WeakMap API" - ], - "items": [ - { - "id": "Js.WeakMap.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v> = WeakMap.t<'k, 'v>", - "deprecated": "" - } - ] - }, - "js/map": { - "id": "Js.Map", - "name": "Map", - "docstrings": [ - "Provides bindings for ES6 Map", - "ES6 Map API" - ], - "items": [ - { - "id": "Js.Map.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v> = Map.t<'k, 'v>", - "deprecated": "" - } - ] - }, - "js/weakset": { - "id": "Js.WeakSet", - "name": "WeakSet", - "docstrings": [ - "Provides bindings for ES6 WeakSet", - "ES6 WeakSet API" - ], - "items": [ - { - "id": "Js.WeakSet.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = WeakSet.t<'a>", - "deprecated": "" - } - ] - }, - "js/set": { - "id": "Js.Set", - "name": "Set", - "docstrings": [ - "Provides bindings for ES6 Set", - "ES6 Set API" - ], - "items": [ - { - "id": "Js.Set.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = Set.t<'a>", - "deprecated": "" - } - ] - }, - "js/console": { - "id": "Js.Console", - "name": "Console", - "docstrings": [ - "Provides bindings for console" - ], - "items": [ - { - "id": "Js.Console.log", - "kind": "value", - "name": "log", - "docstrings": [], - "signature": "let log: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.log2", - "kind": "value", - "name": "log2", - "docstrings": [], - "signature": "let log2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.log3", - "kind": "value", - "name": "log3", - "docstrings": [], - "signature": "let log3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.log4", - "kind": "value", - "name": "log4", - "docstrings": [], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.logMany", - "kind": "value", - "name": "logMany", - "docstrings": [], - "signature": "let logMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info", - "kind": "value", - "name": "info", - "docstrings": [], - "signature": "let info: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info2", - "kind": "value", - "name": "info2", - "docstrings": [], - "signature": "let info2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info3", - "kind": "value", - "name": "info3", - "docstrings": [], - "signature": "let info3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info4", - "kind": "value", - "name": "info4", - "docstrings": [], - "signature": "let info4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.infoMany", - "kind": "value", - "name": "infoMany", - "docstrings": [], - "signature": "let infoMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn", - "kind": "value", - "name": "warn", - "docstrings": [], - "signature": "let warn: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn2", - "kind": "value", - "name": "warn2", - "docstrings": [], - "signature": "let warn2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn3", - "kind": "value", - "name": "warn3", - "docstrings": [], - "signature": "let warn3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn4", - "kind": "value", - "name": "warn4", - "docstrings": [], - "signature": "let warn4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warnMany", - "kind": "value", - "name": "warnMany", - "docstrings": [], - "signature": "let warnMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error", - "kind": "value", - "name": "error", - "docstrings": [], - "signature": "let error: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error2", - "kind": "value", - "name": "error2", - "docstrings": [], - "signature": "let error2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error3", - "kind": "value", - "name": "error3", - "docstrings": [], - "signature": "let error3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error4", - "kind": "value", - "name": "error4", - "docstrings": [], - "signature": "let error4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.errorMany", - "kind": "value", - "name": "errorMany", - "docstrings": [], - "signature": "let errorMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.trace", - "kind": "value", - "name": "trace", - "docstrings": [], - "signature": "let trace: unit => unit", - "deprecated": "" - }, - { - "id": "Js.Console.timeStart", - "kind": "value", - "name": "timeStart", - "docstrings": [], - "signature": "let timeStart: string => unit", - "deprecated": "" - }, - { - "id": "Js.Console.timeEnd", - "kind": "value", - "name": "timeEnd", - "docstrings": [], - "signature": "let timeEnd: string => unit", - "deprecated": "" - }, - { - "id": "Js.Console.table", - "kind": "value", - "name": "table", - "docstrings": [], - "signature": "let table: 'a => unit", - "deprecated": "" - } - ] - }, - "js/result": { - "id": "Js.Result", - "name": "Result", - "docstrings": [ - "Define the interface for result" - ], - "items": [ - { - "id": "Js.Result.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'good, 'bad> = Ok('good) | Error('bad)", - "deprecated": "" - } - ] - }, - "js/option": { - "id": "Js.Option", - "name": "Option", - "docstrings": [ - "Provide utilities for option" - ], - "items": [ - { - "id": "Js.Option.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = option<'a>", - "deprecated": "" - }, - { - "id": "Js.Option.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: 'a => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Option.isSome", - "kind": "value", - "name": "isSome", - "docstrings": [], - "signature": "let isSome: option<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Option.isSomeValue", - "kind": "value", - "name": "isSomeValue", - "docstrings": [], - "signature": "let isSomeValue: (('a, 'a) => bool, 'a, option<'a>) => bool", - "deprecated": "Use `Option.equal` instead." - }, - { - "id": "Js.Option.isNone", - "kind": "value", - "name": "isNone", - "docstrings": [], - "signature": "let isNone: option<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Option.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: option<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Option.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (('a, 'b) => bool, option<'a>, option<'b>) => bool", - "deprecated": "" - }, - { - "id": "Js.Option.andThen", - "kind": "value", - "name": "andThen", - "docstrings": [], - "signature": "let andThen: ('a => option<'b>, option<'a>) => option<'b>", - "deprecated": "" - }, - { - "id": "Js.Option.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: ('a => 'b, option<'a>) => option<'b>", - "deprecated": "" - }, - { - "id": "Js.Option.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: ('a, option<'a>) => 'a", - "deprecated": "" - }, - { - "id": "Js.Option.default", - "kind": "value", - "name": "default", - "docstrings": [], - "signature": "let default: ('a, option<'a>) => 'a", - "deprecated": "" - }, - { - "id": "Js.Option.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: ('a => bool, option<'a>) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Option.firstSome", - "kind": "value", - "name": "firstSome", - "docstrings": [], - "signature": "let firstSome: (option<'a>, option<'a>) => option<'a>", - "deprecated": "" - } - ] - }, - "js/blob": { - "id": "Js.Blob", - "name": "Blob", - "docstrings": [ - "Provide utilities for Blob", - "JavaScript Blob API" - ], - "items": [ - { - "id": "Js.Blob.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - } - ] - }, - "js/file": { - "id": "Js.File", - "name": "File", - "docstrings": [ - "Provide utilities for File", - "JavaScript File API" - ], - "items": [ - { - "id": "Js.File.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - } - ] - }, - "js/bigint": { - "id": "Js.BigInt", - "name": "BigInt", - "docstrings": [ - "Provide utilities for bigint", - "JavaScript BigInt API" - ], - "items": [ - { - "id": "Js.BigInt.fromStringExn", - "kind": "value", - "name": "fromStringExn", - "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Return the\nnumber as a `bigint` if successfully parsed. Uncaught syntax exception otherwise.\n\n## Examples\n\n```rescript\n/* returns 123n */\nJs.BigInt.fromStringExn(\"123\")\n\n/* returns 0n */\nJs.BigInt.fromStringExn(\"\")\n\n/* returns 17n */\nJs.BigInt.fromStringExn(\"0x11\")\n\n/* returns 3n */\nJs.BigInt.fromStringExn(\"0b11\")\n\n/* returns 9n */\nJs.BigInt.fromStringExn(\"0o11\")\n\n/* catch exception */\ntry {\n Js.BigInt.fromStringExn(\"a\")\n} catch {\n| _ => Console.error(\"Error parsing bigint\")\n}\n```" - ], - "signature": "let fromStringExn: string => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.~-", - "kind": "value", - "name": "~-", - "docstrings": [], - "signature": "let ~-: bigint => bigint" - }, - { - "id": "Js.BigInt.~+", - "kind": "value", - "name": "~+", - "docstrings": [], - "signature": "let ~+: bigint => bigint" - }, - { - "id": "Js.BigInt.+", - "kind": "value", - "name": "+", - "docstrings": [], - "signature": "let +: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.-", - "kind": "value", - "name": "-", - "docstrings": [], - "signature": "let -: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.*", - "kind": "value", - "name": "*", - "docstrings": [], - "signature": "let *: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt./", - "kind": "value", - "name": "/", - "docstrings": [], - "signature": "let /: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.mod", - "kind": "value", - "name": "mod", - "docstrings": [], - "signature": "let mod: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.**", - "kind": "value", - "name": "**", - "docstrings": [], - "signature": "let **: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.land", - "kind": "value", - "name": "land", - "docstrings": [], - "signature": "let land: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lor", - "kind": "value", - "name": "lor", - "docstrings": [], - "signature": "let lor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lxor", - "kind": "value", - "name": "lxor", - "docstrings": [], - "signature": "let lxor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lnot", - "kind": "value", - "name": "lnot", - "docstrings": [], - "signature": "let lnot: bigint => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lsl", - "kind": "value", - "name": "lsl", - "docstrings": [], - "signature": "let lsl: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.asr", - "kind": "value", - "name": "asr", - "docstrings": [], - "signature": "let asr: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats a `bigint` as a string. Return a `string` representing the given value.\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123\" */\nJs.BigInt.toString(123n)->Js.log\n```" - ], - "signature": "let toString: bigint => string", - "deprecated": "" - }, - { - "id": "Js.BigInt.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Returns a string with a language-sensitive representation of this BigInt value.\n\n## Examples\n\n```rescript\n/* prints \"123\" */\nJs.BigInt.toString(123n)->Js.log\n```" - ], - "signature": "let toLocaleString: bigint => string", - "deprecated": "" - } - ] - }, - "js/int": { - "id": "Js.Int", - "name": "Int", - "docstrings": [ - "Provide utilities for int", - "Provide utilities for handling `int`." - ], - "items": [ - { - "id": "Js.Int.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "Formats an `int` using exponential (scientific) notation.\nReturns a `string` representing the given value in exponential notation.\nThrows `RangeError` if digits is not in the range \\[0, 20\\] (inclusive).\n\nSee [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.7e+1\" */\nJs.log(Js.Int.toExponential(77))\n```" - ], - "signature": "let toExponential: int => string", - "deprecated": "" - }, - { - "id": "Js.Int.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "Formats an `int` using exponential (scientific) notation.\n`digits` specifies how many digits should appear after the decimal point. The value must be in the range \\[0, 20\\] (inclusive).\n\nReturns a `string` representing the given value in exponential notation.\n\nThe output will be rounded or padded with zeroes if necessary.\nThrows `RangeError` if `digits` is not in the range \\[0, 20\\] (inclusive).\n\nSee [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.70e+1\" */\nJs.log(Js.Int.toExponentialWithPrecision(77, ~digits=2))\n\n/* prints \"5.68e+3\" */\nJs.log(Js.Int.toExponentialWithPrecision(5678, ~digits=2))\n```" - ], - "signature": "let toExponentialWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Int.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "Formats an `int` using some fairly arbitrary rules.\nReturns a `string` representing the given value in fixed-point (usually).\n\n`toPrecision` differs from `toFixed` in that the former will format the number with full precision, while the latter will not output any digits after the decimal point.\nThrows `RangeError` if `digits` is not in the range accepted by this function.\n\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123456789\" */\nJs.log(Js.Int.toPrecision(123456789))\n```" - ], - "signature": "let toPrecision: int => string", - "deprecated": "" - }, - { - "id": "Js.Int.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "Formats an `int` using some fairly arbitrary rules.\n`digits` specifies how many digits should appear in total. The value must between 0 and some arbitrary number that's hopefully at least larger than 20 (for Node it's 21. Why? Who knows).\n\nReturns a `string` representing the given value in fixed-point or scientific notation.\n\nThe output will be rounded or padded with zeroes if necessary.\n\n`toPrecisionWithPrecision` differs from `toFixedWithPrecision` in that the former will count all digits against the precision, while the latter will count only the digits after the decimal point.\n`toPrecisionWithPrecision` will also use scientific notation if the specified precision is less than the number of digits before the decimal point.\nThrows `RangeError` if `digits` is not in the range accepted by this function.\n\n\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"1.2e+8\" */\nJs.log(Js.Int.toPrecisionWithPrecision(123456789, ~digits=2))\n\n/* prints \"0.0\" */\nJs.log(Js.Int.toPrecisionWithPrecision(0, ~digits=2))\n```" - ], - "signature": "let toPrecisionWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Int.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats an `int` as a `string`. Returns a `string` representing the given value\nin fixed-point (usually).\n\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123456789\" */\nJs.log(Js.Int.toString(123456789))\n```" - ], - "signature": "let toString: int => string", - "deprecated": "" - }, - { - "id": "Js.Int.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "Formats an `int` as a `string`. `radix` specifies the radix base to use for the\nformatted number. The value must be in the range \\[2, 36\\] (inclusive). Returns\na `string` representing the given value in fixed-point (usually). Throws\n`RangeError` if `radix` is not in the range \\[2, 36\\] (inclusive).\n\n\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"110\" */\nJs.log(Js.Int.toStringWithRadix(6, ~radix=2))\n\n/* prints \"deadbeef\" */\nJs.log(Js.Int.toStringWithRadix(3735928559, ~radix=16))\n\n/* prints \"2n9c\" */\nJs.log(Js.Int.toStringWithRadix(123456, ~radix=36))\n```" - ], - "signature": "let toStringWithRadix: (int, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Js.Int.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [], - "signature": "let toFloat: int => float", - "deprecated": "" - }, - { - "id": "Js.Int.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (int, int) => bool", - "deprecated": "" - }, - { - "id": "Js.Int.max", - "kind": "value", - "name": "max", - "docstrings": [], - "signature": "let max: int" - }, - { - "id": "Js.Int.min", - "kind": "value", - "name": "min", - "docstrings": [], - "signature": "let min: int" - } - ] - }, - "js/float": { - "id": "Js.Float", - "name": "Float", - "docstrings": [ - "Provide utilities for JS float", - "Provide utilities for JS float." - ], - "items": [ - { - "id": "Js.Float._NaN", - "kind": "value", - "name": "_NaN", - "docstrings": [ - "The special value \"Not a Number\". See [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN) on MDN." - ], - "signature": "let _NaN: float", - "deprecated": "" - }, - { - "id": "Js.Float.isNaN", - "kind": "value", - "name": "isNaN", - "docstrings": [ - "Tests if the given value is `_NaN`\n\nNote that both `_NaN = _NaN` and `_NaN == _NaN` will return `false`. `isNaN` is\ntherefore necessary to test for `_NaN`. Return `true` if the given value is\n`_NaN`, `false` otherwise. See [`isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) on MDN." - ], - "signature": "let isNaN: float => bool", - "deprecated": "" - }, - { - "id": "Js.Float.isFinite", - "kind": "value", - "name": "isFinite", - "docstrings": [ - "Tests if the given value is finite. Return `true` if the given value is a finite\nnumber, `false` otherwise. See [`isFinite`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite) on MDN.\n\n## Examples\n\n```rescript\n/* returns [false] */\nJs.Float.isFinite(infinity)\n\n/* returns [false] */\nJs.Float.isFinite(neg_infinity)\n\n/* returns [false] */\nJs.Float.isFinite(Js.Float._NaN)\n\n/* returns [true] */\nJs.Float.isFinite(1234.)\n```" - ], - "signature": "let isFinite: float => bool", - "deprecated": "" - }, - { - "id": "Js.Float.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "Formats a `float` using exponential (scientific) notation. Return a\n`string` representing the given value in exponential notation. Throw\nRangeError if digits is not in the range \\[0, 20\\] (inclusive). See [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.71234e+1\" */\nJs.Float.toExponential(77.1234)->Js.log\n\n/* prints \"7.7e+1\" */\nJs.Float.toExponential(77.)->Js.log\n```" - ], - "signature": "let toExponential: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "Formats a `float` using exponential (scientific) notation. `digits` specifies\nhow many digits should appear after the decimal point. The value must be in\nthe range \\[0, 20\\] (inclusive). Return a `string` representing the given value\nin exponential notation. The output will be rounded or padded with zeroes if\nnecessary. Throw RangeError if `digits` is not in the range \\[0, 20\\] (inclusive).\nSee [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.71e+1\" */\nJs.Float.toExponentialWithPrecision(77.1234, ~digits=2)->Js.log\n```" - ], - "signature": "let toExponentialWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.toFixed", - "kind": "value", - "name": "toFixed", - "docstrings": [ - "Formats a `float` using fixed point notation. Return a `string` representing the\ngiven value in fixed-point notation (usually). Throw RangeError if digits is not\nin the range \\[0, 20\\] (inclusive). See [`toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"12346\" (note the rounding) */\nJs.Float.toFixed(12345.6789)->Js.log\n\n/* print \"1.2e+21\" */\nJs.Float.toFixed(1.2e21)->Js.log\n```" - ], - "signature": "let toFixed: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toFixedWithPrecision", - "kind": "value", - "name": "toFixedWithPrecision", - "docstrings": [ - "Formats a `float` using fixed point notation. `digits` specifies how many digits\nshould appear after the decimal point. The value must be in the range \\[0, 20\\]\n(inclusive). Defaults to `0`. Return a `string` representing the given value in\nfixed-point notation (usually). See [`toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\nThe output will be rounded or padded with zeroes if necessary.\n\nThrow RangeError if digits is not in the range \\[0, 20\\] (inclusive)\n\n## Examples\n\n```rescript\n/* prints \"12345.7\" (note the rounding) */\nJs.Float.toFixedWithPrecision(12345.6789, ~digits=1)->Js.log\n\n/* prints \"0.00\" (note the added zeroes) */\nJs.Float.toFixedWithPrecision(0., ~digits=2)->Js.log\n```" - ], - "signature": "let toFixedWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "Formats a `float` using some fairly arbitrary rules. Return a `string`\nrepresenting the given value in fixed-point (usually). `toPrecision` differs\nfrom `Js.Float.toFixed` in that the former will format the number with full\nprecision, while the latter will not output any digits after the decimal point.\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\nThrow RangeError if digits is not in the range accepted by this function (what do you mean \"vague\"?)\n\n## Examples\n\n```rescript\n/* prints \"12345.6789\" */\nJs.Float.toPrecision(12345.6789)->Js.log\n\n/* print \"1.2e+21\" */\nJs.Float.toPrecision(1.2e21)->Js.log\n```" - ], - "signature": "let toPrecision: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "Formats a `float` using some fairly arbitrary rules. `digits` specifies how many\ndigits should appear in total. The value must between 0 and some arbitrary number\nthat's hopefully at least larger than 20 (for Node it's 21. Why? Who knows).\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\nReturn a `string` representing the given value in fixed-point or scientific\nnotation. The output will be rounded or padded with zeroes if necessary.\n\n`toPrecisionWithPrecision` differs from `toFixedWithPrecision` in that the former\nwill count all digits against the precision, while the latter will count only\nthe digits after the decimal point. `toPrecisionWithPrecision` will also use\nscientific notation if the specified precision is less than the number for digits\nbefore the decimal point.\n\nThrow RangeError if digits is not in the range accepted by this function (what do you mean \"vague\"?)\n\n## Examples\n\n```rescript\n/* prints \"1e+4\" */\nJs.Float.toPrecisionWithPrecision(12345.6789, ~digits=1)->Js.log\n\n/* prints \"0.0\" */\nJs.Float.toPrecisionWithPrecision(0., ~digits=2)->Js.log\n```" - ], - "signature": "let toPrecisionWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats a `float` as a string. Return a `string` representing the given value in\nfixed-point (usually). See [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"12345.6789\" */\nJs.Float.toString(12345.6789)->Js.log\n```" - ], - "signature": "let toString: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "Formats a `float` as a string. `radix` specifies the radix base to use for the\nformatted number. The value must be in the range \\[2, 36\\] (inclusive). Return a\n`string` representing the given value in fixed-point (usually). See [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\nThrow RangeError if radix is not in the range \\[2, 36\\] (inclusive)\n\n## Examples\n\n```rescript\n/* prints \"110\" */\nJs.Float.toStringWithRadix(6., ~radix=2)->Js.log\n\n/* prints \"11.001000111101011100001010001111010111000010100011111\" */\nJs.Float.toStringWithRadix(3.14, ~radix=2)->Js.log\n\n/* prints \"deadbeef\" */\nJs.Float.toStringWithRadix(3735928559., ~radix=16)->Js.log\n\n/* prints \"3f.gez4w97ry0a18ymf6qadcxr\" */\nJs.Float.toStringWithRadix(123.456, ~radix=36)->Js.log\n```" - ], - "signature": "let toStringWithRadix: (float, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Parses the given `string` into a `float` using JavaScript semantics. Return the\nnumber as a `float` if successfully parsed, `_NaN` otherwise.\n\n## Examples\n\n```rescript\n/* returns 123 */\nJs.Float.fromString(\"123\")\n\n/* returns 12.3 */\nJs.Float.fromString(\"12.3\")\n\n/* returns 0 */\nJs.Float.fromString(\"\")\n\n/* returns 17 */\nJs.Float.fromString(\"0x11\")\n\n/* returns 3 */\nJs.Float.fromString(\"0b11\")\n\n/* returns 9 */\nJs.Float.fromString(\"0o11\")\n\n/* returns [_NaN] */\nJs.Float.fromString(\"hello\")\n\n/* returns [_NaN] */\nJs.Float.fromString(\"100a\")\n```" - ], - "signature": "let fromString: string => float", - "deprecated": "" - } - ] - }, - "js/types": { - "id": "Js.Types", - "name": "Types", - "docstrings": [ - "Provide utilities for manipulating JS types", - "Provide utilities for manipulating JS types." - ], - "items": [ - { - "id": "Js.Types.symbol", - "kind": "type", - "name": "symbol", - "docstrings": [ - "Js symbol type (only available in ES6)" - ], - "signature": "type symbol = Symbol.t", - "deprecated": "" - }, - { - "id": "Js.Types.obj_val", - "kind": "type", - "name": "obj_val", - "docstrings": [], - "signature": "type obj_val = \\\"Type.Classify\".object", - "deprecated": "" - }, - { - "id": "Js.Types.undefined_val", - "kind": "type", - "name": "undefined_val", - "docstrings": [ - "This type has only one value `undefined`" - ], - "signature": "type undefined_val", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.null_val", - "kind": "type", - "name": "null_val", - "docstrings": [ - "This type has only one value `null`" - ], - "signature": "type null_val", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.function_val", - "kind": "type", - "name": "function_val", - "docstrings": [], - "signature": "type function_val = \\\"Type.Classify\".function", - "deprecated": "" - }, - { - "id": "Js.Types.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<_> =\n | Undefined: t\n | Null: t\n | Boolean: t\n | Number: t\n | String: t\n | Function: t\n | Object: t\n | Symbol: t\n | BigInt: t", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.test", - "kind": "value", - "name": "test", - "docstrings": [ - "`test(value, t)` returns `true` if `value` is `typeof t`, otherwise `false`.\nThis is useful for doing runtime reflection on any given value.\n\n## Examples\n\n```rescript\ntest(\"test\", String) == true\ntest(() => true, Function) == true\ntest(\"test\", Boolean) == false\n```" - ], - "signature": "let test: ('a, t<'b>) => bool", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.tagged_t", - "kind": "type", - "name": "tagged_t", - "docstrings": [], - "signature": "type tagged_t =\n | JSFalse\n | JSTrue\n | JSNull\n | JSUndefined\n | JSNumber(float)\n | JSString(string)\n | JSFunction(function_val)\n | JSObject(obj_val)\n | JSSymbol(symbol)\n | JSBigInt(bigint)", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.classify", - "kind": "value", - "name": "classify", - "docstrings": [], - "signature": "let classify: 'a => tagged_t", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - } - ] - }, - "js/typedarray2": { - "id": "Js.TypedArray2", - "name": "TypedArray2", - "docstrings": [ - "Provide bindings for JS typed array", - "JavaScript Typed Array API\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)" - ], - "items": [ - { - "id": "Js.TypedArray2.array_buffer", - "kind": "type", - "name": "array_buffer", - "docstrings": [], - "signature": "type array_buffer = ArrayBuffer.t" - }, - { - "id": "Js.TypedArray2.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [], - "signature": "type array_like<'a>" - } - ] - }, - "js/typed_array": { - "id": "Js.Typed_array", - "name": "Typed_array", - "docstrings": [ - "Provide bindings for JS typed array", - "JavaScript Typed Array API\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)" - ], - "items": [ - { - "id": "Js.Typed_array.array_buffer", - "kind": "type", - "name": "array_buffer", - "docstrings": [], - "signature": "type array_buffer = Js_typed_array2.array_buffer", - "deprecated": "" - }, - { - "id": "Js.Typed_array.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [], - "signature": "type array_like<'a> = Js_typed_array2.array_like<'a>", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `TypedArray` module instead." - } - ] - }, - "js/obj": { - "id": "Js.Obj", - "name": "Obj", - "docstrings": [ - "Provide utilities for `Js.t`", - "Provides functions for inspecting and manipulating native JavaScript objects" - ], - "items": [ - { - "id": "Js.Obj.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "`empty()` returns the empty object `{}`" - ], - "signature": "let empty: unit => {..}", - "deprecated": "" - }, - { - "id": "Js.Obj.assign", - "kind": "value", - "name": "assign", - "docstrings": [ - "`assign(target, source)` copies properties from source to target.\nProperties in `target` will be overwritten by properties in `source` if they have the same key.\nReturns `target`.\n\n**See** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\n\n## Examples\n\n```rescript\n/* Copy an object */\n\nlet obj = {\"a\": 1}\n\nlet copy = Js.Obj.assign(Js.Obj.empty(), obj)\n\n/* prints \"{ a: 1 }\" */\nJs.log(copy)\n\n/* Merge objects with same properties */\n\nlet target = {\"a\": 1, \"b\": 1}\nlet source = {\"b\": 2}\n\nlet obj = Js.Obj.assign(target, source)\n\n/* prints \"{ a: 1, b: 2 }\" */\nJs.log(obj)\n\n/* prints \"{ a: 1, b: 2 }\", target is modified */\nJs.log(target)\n```" - ], - "signature": "let assign: ({..}, {..}) => {..}", - "deprecated": "" - }, - { - "id": "Js.Obj.keys", - "kind": "value", - "name": "keys", - "docstrings": [ - "`keys(obj)` returns an `array` of the keys of `obj`'s own enumerable properties." - ], - "signature": "let keys: {..} => array", - "deprecated": "" - } - ] - }, - "js/math": { - "id": "Js.Math", - "name": "Math", - "docstrings": [ - "Provide bindings for JS `Math` object", - "Provide utilities for JS Math. Note: The constants `_E`, `_LN10`, `_LN2`,\n`_LOG10E`, `_LOG2E`, `_PI`, `_SQRT1_2`, and `_SQRT2` begin with an underscore\nbecause ReScript variable names cannot begin with a capital letter. (Module\nnames begin with upper case.)" - ], - "items": [ - { - "id": "Js.Math._E", - "kind": "value", - "name": "_E", - "docstrings": [ - "Euler's number; ≈ 2.718281828459045. See\n[`Math.E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/E)\non MDN." - ], - "signature": "let _E: float", - "deprecated": "" - }, - { - "id": "Js.Math._LN2", - "kind": "value", - "name": "_LN2", - "docstrings": [ - "Natural logarithm of 2; ≈ 0.6931471805599453. See\n[`Math.LN2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN2)\non MDN." - ], - "signature": "let _LN2: float", - "deprecated": "" - }, - { - "id": "Js.Math._LN10", - "kind": "value", - "name": "_LN10", - "docstrings": [ - "Natural logarithm of 10; ≈ 2.302585092994046. See\n[`Math.LN10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN10)\non MDN." - ], - "signature": "let _LN10: float", - "deprecated": "" - }, - { - "id": "Js.Math._LOG2E", - "kind": "value", - "name": "_LOG2E", - "docstrings": [ - "Base 2 logarithm of E; ≈ 1.4426950408889634. See\n[`Math.LOG2E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG2E)\non MDN." - ], - "signature": "let _LOG2E: float", - "deprecated": "" - }, - { - "id": "Js.Math._LOG10E", - "kind": "value", - "name": "_LOG10E", - "docstrings": [ - "Base 10 logarithm of E; ≈ 0.4342944819032518. See\n[`Math.LOG10E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG10E)\non MDN." - ], - "signature": "let _LOG10E: float", - "deprecated": "" - }, - { - "id": "Js.Math._PI", - "kind": "value", - "name": "_PI", - "docstrings": [ - "Pi - ratio of the circumference to the diameter of a circle; ≈ 3.141592653589793. See\n[`Math.PI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/PI)\non MDN." - ], - "signature": "let _PI: float", - "deprecated": "" - }, - { - "id": "Js.Math._SQRT1_2", - "kind": "value", - "name": "_SQRT1_2", - "docstrings": [ - "Square root of 1/2; ≈ 0.7071067811865476. See\n[`Math.SQRT1_2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2)\non MDN." - ], - "signature": "let _SQRT1_2: float", - "deprecated": "" - }, - { - "id": "Js.Math._SQRT2", - "kind": "value", - "name": "_SQRT2", - "docstrings": [ - "Square root of 2; ≈ 1.4142135623730951. See\n[`Math.SQRT2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT2)\non MDN." - ], - "signature": "let _SQRT2: float", - "deprecated": "" - }, - { - "id": "Js.Math.abs_int", - "kind": "value", - "name": "abs_int", - "docstrings": [ - "Absolute value for integer argument. See\n[`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs)\non MDN." - ], - "signature": "let abs_int: int => int", - "deprecated": "" - }, - { - "id": "Js.Math.abs_float", - "kind": "value", - "name": "abs_float", - "docstrings": [ - "Absolute value for float argument. See\n[`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs)\non MDN." - ], - "signature": "let abs_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.acos", - "kind": "value", - "name": "acos", - "docstrings": [ - "Arccosine (in radians) of argument; returns `NaN` if the argument is outside\nthe range [-1.0, 1.0]. See\n[`Math.acos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acos)\non MDN." - ], - "signature": "let acos: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.acosh", - "kind": "value", - "name": "acosh", - "docstrings": [ - "Hyperbolic arccosine (in radians) of argument; returns `NaN` if the argument\nis less than 1.0. See\n[`Math.acosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acosh)\non MDN." - ], - "signature": "let acosh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.asin", - "kind": "value", - "name": "asin", - "docstrings": [ - "Arcsine (in radians) of argument; returns `NaN` if the argument is outside\nthe range [-1.0, 1.0]. See\n[`Math.asin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asin)\non MDN." - ], - "signature": "let asin: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.asinh", - "kind": "value", - "name": "asinh", - "docstrings": [ - "Hyperbolic arcsine (in radians) of argument. See\n[`Math.asinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh)\non MDN." - ], - "signature": "let asinh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.atan", - "kind": "value", - "name": "atan", - "docstrings": [ - "Arctangent (in radians) of argument. See\n[`Math.atan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan)\non MDN." - ], - "signature": "let atan: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.atanh", - "kind": "value", - "name": "atanh", - "docstrings": [ - "Hyperbolic arctangent (in radians) of argument; returns `NaN` if the argument\nis is outside the range [-1.0, 1.0]. Returns `-Infinity` and `Infinity` for\narguments -1.0 and 1.0. See\n[`Math.atanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh)\non MDN." - ], - "signature": "let atanh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.atan2", - "kind": "value", - "name": "atan2", - "docstrings": [ - "Returns the angle (in radians) of the quotient `y /. x`. It is also the angle\nbetween the *x*\\-axis and point (*x*, *y*). See\n[`Math.atan2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.atan2(~y=0.0, ~x=10.0, ()) == 0.0\nJs.Math.atan2(~x=5.0, ~y=5.0, ()) == Js.Math._PI /. 4.0\nJs.Math.atan2(~x=-5.0, ~y=5.0, ())\nJs.Math.atan2(~x=-5.0, ~y=5.0, ()) == 3.0 *. Js.Math._PI /. 4.0\nJs.Math.atan2(~x=-0.0, ~y=-5.0, ()) == -.Js.Math._PI /. 2.0\n```" - ], - "signature": "let atan2: (~y: float, ~x: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Math.cbrt", - "kind": "value", - "name": "cbrt", - "docstrings": [ - "Cube root. See\n[`Math.cbrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt)\non MDN" - ], - "signature": "let cbrt: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_ceil_int", - "kind": "value", - "name": "unsafe_ceil_int", - "docstrings": [ - "Returns the smallest integer greater than or equal to the argument. This\nfunction may return values not representable by `int`, whose range is\n\\-2147483648 to 2147483647. This is because, in JavaScript, there are only\n64-bit floating point numbers, which can represent integers in the range\n±(253\\-1) exactly. See\n[`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.unsafe_ceil_int(3.1) == 4\nJs.Math.unsafe_ceil_int(3.0) == 3\nJs.Math.unsafe_ceil_int(-3.1) == -3\nJs.Math.unsafe_ceil_int(1.0e15) // result is outside range of int datatype\n```" - ], - "signature": "let unsafe_ceil_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_ceil", - "kind": "value", - "name": "unsafe_ceil", - "docstrings": [], - "signature": "let unsafe_ceil: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.ceil_int", - "kind": "value", - "name": "ceil_int", - "docstrings": [ - "Returns the smallest `int` greater than or equal to the argument; the result\nis pinned to the range of the `int` data type: -2147483648 to 2147483647. See\n[`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.ceil_int(3.1) == 4\nJs.Math.ceil_int(3.0) == 3\nJs.Math.ceil_int(-3.1) == -3\nJs.Math.ceil_int(-1.0e15) == -2147483648\nJs.Math.ceil_int(1.0e15) == 2147483647\n```" - ], - "signature": "let ceil_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.ceil", - "kind": "value", - "name": "ceil", - "docstrings": [], - "signature": "let ceil: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.ceil_float", - "kind": "value", - "name": "ceil_float", - "docstrings": [ - "Returns the smallest integral value greater than or equal to the argument.\nThe result is a `float` and is not restricted to the `int` data type range.\nSee\n[`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.ceil_float(3.1) == 4.0\nJs.Math.ceil_float(3.0) == 3.0\nJs.Math.ceil_float(-3.1) == -3.0\nJs.Math.ceil_float(2_150_000_000.3) == 2_150_000_001.0\n```" - ], - "signature": "let ceil_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.clz32", - "kind": "value", - "name": "clz32", - "docstrings": [ - "Number of leading zero bits of the argument's 32 bit int representation. See\n[`Math.clz32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.clz32(0) == 32\nJs.Math.clz32(-1) == 0\nJs.Math.clz32(255) == 24\n```" - ], - "signature": "let clz32: int => int", - "deprecated": "" - }, - { - "id": "Js.Math.cos", - "kind": "value", - "name": "cos", - "docstrings": [ - "Cosine of argument, which must be specified in radians. See\n[`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos)\non MDN." - ], - "signature": "let cos: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.cosh", - "kind": "value", - "name": "cosh", - "docstrings": [ - "Hyperbolic cosine of argument, which must be specified in radians. See\n[`Math.cosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh)\non MDN." - ], - "signature": "let cosh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.exp", - "kind": "value", - "name": "exp", - "docstrings": [ - "Natural exponentional; returns *e* (the base of natural logarithms) to the\npower of the given argument. See\n[`Math.exp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/exp)\non MDN." - ], - "signature": "let exp: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.expm1", - "kind": "value", - "name": "expm1", - "docstrings": [ - "Returns *e* (the base of natural logarithms) to the power of the given\nargument minus 1. See\n[`Math.expm1`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1)\non MDN." - ], - "signature": "let expm1: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_floor_int", - "kind": "value", - "name": "unsafe_floor_int", - "docstrings": [ - "Returns the largest integer less than or equal to the argument. This function\nmay return values not representable by `int`, whose range is -2147483648 to\n2147483647. This is because, in JavaScript, there are only 64-bit floating\npoint numbers, which can represent integers in the range\n±(253\\-1) exactly. See\n[`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.unsafe_floor_int(3.7) == 3\nJs.Math.unsafe_floor_int(3.0) == 3\nJs.Math.unsafe_floor_int(-3.7) == -4\nJs.Math.unsafe_floor_int(1.0e15) // result is outside range of int datatype\n```" - ], - "signature": "let unsafe_floor_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_floor", - "kind": "value", - "name": "unsafe_floor", - "docstrings": [], - "signature": "let unsafe_floor: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.floor_int", - "kind": "value", - "name": "floor_int", - "docstrings": [ - "Returns the largest `int` less than or equal to the argument; the result is\npinned to the range of the `int` data type: -2147483648 to 2147483647. See\n[`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.floor_int(3.7) == 3\nJs.Math.floor_int(3.0) == 3\nJs.Math.floor_int(-3.1) == -4\nJs.Math.floor_int(-1.0e15) == -2147483648\nJs.Math.floor_int(1.0e15) == 2147483647\n```" - ], - "signature": "let floor_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.floor", - "kind": "value", - "name": "floor", - "docstrings": [], - "signature": "let floor: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.floor_float", - "kind": "value", - "name": "floor_float", - "docstrings": [ - "Returns the largest integral value less than or equal to the argument. The\nresult is a `float` and is not restricted to the `int` data type range. See\n[`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.floor_float(3.7) == 3.0\nJs.Math.floor_float(3.0) == 3.0\nJs.Math.floor_float(-3.1) == -4.0\nJs.Math.floor_float(2_150_000_000.3) == 2_150_000_000.0\n```" - ], - "signature": "let floor_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.fround", - "kind": "value", - "name": "fround", - "docstrings": [ - "Round to nearest single precision float. See\n[`Math.fround`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.fround(5.5) == 5.5\nJs.Math.fround(5.05) == 5.050000190734863\n```" - ], - "signature": "let fround: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.hypot", - "kind": "value", - "name": "hypot", - "docstrings": [ - "Returns the square root of the sum of squares of its two arguments (the\nPythagorean formula). See\n[`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot)\non MDN." - ], - "signature": "let hypot: (float, float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.hypotMany", - "kind": "value", - "name": "hypotMany", - "docstrings": [ - "Returns the square root of the sum of squares of the numbers in the array\nargument (generalized Pythagorean equation). Using an array allows you to\nhave more than two items. See\n[`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.hypotMany([3.0, 4.0, 12.0]) == 13.0\n```" - ], - "signature": "let hypotMany: array => float", - "deprecated": "" - }, - { - "id": "Js.Math.imul", - "kind": "value", - "name": "imul", - "docstrings": [ - "32-bit integer multiplication. Use this only when you need to optimize\nperformance of multiplication of numbers stored as 32-bit integers. See\n[`Math.imul`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul)\non MDN." - ], - "signature": "let imul: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.log", - "kind": "value", - "name": "log", - "docstrings": [ - "Returns the natural logarithm of its argument; this is the number *x* such\nthat *e**x* equals the argument. Returns `NaN` for negative\narguments. See\n[`Math.log`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log(Js.Math._E) == 1.0\nJs.Math.log(100.0) == 4.605170185988092\n```" - ], - "signature": "let log: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.log1p", - "kind": "value", - "name": "log1p", - "docstrings": [ - "Returns the natural logarithm of one plus the argument. Returns `NaN` for\narguments less than -1. See\n[`Math.log1p`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log1p)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log1p(Js.Math._E -. 1.0) == 1.0\nJs.Math.log1p(99.0) == 4.605170185988092\n```" - ], - "signature": "let log1p: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.log10", - "kind": "value", - "name": "log10", - "docstrings": [ - "Returns the base 10 logarithm of its argument. Returns `NaN` for negative\narguments. See\n[`Math.log10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log10)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log10(1000.0) == 3.0\nJs.Math.log10(0.01) == -2.0\nJs.Math.log10(Js.Math.sqrt(10.0)) == 0.5\n```" - ], - "signature": "let log10: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.log2", - "kind": "value", - "name": "log2", - "docstrings": [ - "Returns the base 2 logarithm of its argument. Returns `NaN` for negative\narguments. See\n[`Math.log2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log2(512.0) == 9.0\nJs.Math.log2(0.125) == -3.0\nJs.Math.log2(Js.Math._SQRT2) == 0.5000000000000001 // due to precision\n```" - ], - "signature": "let log2: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.max_int", - "kind": "value", - "name": "max_int", - "docstrings": [ - "Returns the maximum of its two integer arguments. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let max_int: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.maxMany_int", - "kind": "value", - "name": "maxMany_int", - "docstrings": [ - "Returns the maximum of the integers in the given array. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let maxMany_int: array => int", - "deprecated": "" - }, - { - "id": "Js.Math.max_float", - "kind": "value", - "name": "max_float", - "docstrings": [ - "Returns the maximum of its two floating point arguments. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let max_float: (float, float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.maxMany_float", - "kind": "value", - "name": "maxMany_float", - "docstrings": [ - "Returns the maximum of the floating point values in the given array. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let maxMany_float: array => float", - "deprecated": "" - }, - { - "id": "Js.Math.min_int", - "kind": "value", - "name": "min_int", - "docstrings": [ - "Returns the minimum of its two integer arguments. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let min_int: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.minMany_int", - "kind": "value", - "name": "minMany_int", - "docstrings": [ - "Returns the minimum of the integers in the given array. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let minMany_int: array => int", - "deprecated": "" - }, - { - "id": "Js.Math.min_float", - "kind": "value", - "name": "min_float", - "docstrings": [ - "Returns the minimum of its two floating point arguments. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let min_float: (float, float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.minMany_float", - "kind": "value", - "name": "minMany_float", - "docstrings": [ - "Returns the minimum of the floating point values in the given array. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let minMany_float: array => float", - "deprecated": "" - }, - { - "id": "Js.Math.pow_int", - "kind": "value", - "name": "pow_int", - "docstrings": [ - "Throws the given base to the given exponent. (Arguments and result are\nintegers.) See\n[`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.pow_int(~base=3, ~exp=4) == 81\n```" - ], - "signature": "let pow_int: (~base: int, ~exp: int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.pow_float", - "kind": "value", - "name": "pow_float", - "docstrings": [ - "Throws the given base to the given exponent. (Arguments and result are\nfloats.) Returns `NaN` if the result would be imaginary. See\n[`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.pow_float(~base=3.0, ~exp=4.0) == 81.0\nJs.Math.pow_float(~base=4.0, ~exp=-2.0) == 0.0625\nJs.Math.pow_float(~base=625.0, ~exp=0.5) == 25.0\nJs.Math.pow_float(~base=625.0, ~exp=-0.5) == 0.04\nJs.Float.isNaN(Js.Math.pow_float(~base=-2.0, ~exp=0.5)) == true\n```" - ], - "signature": "let pow_float: (~base: float, ~exp: float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.random", - "kind": "value", - "name": "random", - "docstrings": [ - "Returns a random number in the half-closed interval [0,1). See\n[`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\non MDN." - ], - "signature": "let random: unit => float", - "deprecated": "" - }, - { - "id": "Js.Math.random_int", - "kind": "value", - "name": "random_int", - "docstrings": [ - "A call to `random_int(minVal, maxVal)` returns a random number in the\nhalf-closed interval [minVal, maxVal). See\n[`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\non MDN." - ], - "signature": "let random_int: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_round", - "kind": "value", - "name": "unsafe_round", - "docstrings": [ - "Rounds its argument to nearest integer. For numbers with a fractional portion\nof exactly 0.5, the argument is rounded to the next integer in the direction\nof positive infinity. This function may return values not representable by\n`int`, whose range is -2147483648 to 2147483647. This is because, in\nJavaScript, there are only 64-bit floating point numbers, which can represent\nintegers in the range ±(253\\-1) exactly. See\n[`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.unsafe_round(3.7) == 4\nJs.Math.unsafe_round(-3.5) == -3\nJs.Math.unsafe_round(2_150_000_000_000.3) // out of range for int\n```" - ], - "signature": "let unsafe_round: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.round", - "kind": "value", - "name": "round", - "docstrings": [ - "Rounds to nearest integral value (expressed as a float). See\n[`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round)\non MDN." - ], - "signature": "let round: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sign_int", - "kind": "value", - "name": "sign_int", - "docstrings": [ - "Returns the sign of its integer argument: -1 if negative, 0 if zero, 1 if\npositive. See\n[`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign)\non MDN." - ], - "signature": "let sign_int: int => int", - "deprecated": "" - }, - { - "id": "Js.Math.sign_float", - "kind": "value", - "name": "sign_float", - "docstrings": [ - "Returns the sign of its float argument: -1.0 if negative, 0.0 if zero, 1.0 if\npositive. See\n[`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign)\non MDN." - ], - "signature": "let sign_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sin", - "kind": "value", - "name": "sin", - "docstrings": [ - "Sine of argument, which must be specified in radians. See\n[`Math.sin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin)\non MDN." - ], - "signature": "let sin: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sinh", - "kind": "value", - "name": "sinh", - "docstrings": [ - "Hyperbolic sine of argument, which must be specified in radians. See\n[`Math.sinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sinh)\non MDN." - ], - "signature": "let sinh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sqrt", - "kind": "value", - "name": "sqrt", - "docstrings": [ - "Square root. If the argument is negative, this function returns `NaN`. See\n[`Math.sqrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt)\non MDN." - ], - "signature": "let sqrt: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.tan", - "kind": "value", - "name": "tan", - "docstrings": [ - "Tangent of argument, which must be specified in radians. Returns `NaN` if the\nargument is positive infinity or negative infinity. See\n[`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos)\non MDN." - ], - "signature": "let tan: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.tanh", - "kind": "value", - "name": "tanh", - "docstrings": [ - "Hyperbolic tangent of argument, which must be specified in radians. See\n[`Math.tanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tanh)\non MDN." - ], - "signature": "let tanh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_trunc", - "kind": "value", - "name": "unsafe_trunc", - "docstrings": [ - "Truncates its argument; i.e., removes fractional digits. This function may\nreturn values not representable by `int`, whose range is -2147483648 to\n2147483647. This is because, in JavaScript, there are only 64-bit floating\npoint numbers, which can represent integers in the range ±(253-1)\nexactly. See\n[`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc)\non MDN." - ], - "signature": "let unsafe_trunc: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.trunc", - "kind": "value", - "name": "trunc", - "docstrings": [ - "Truncates its argument; i.e., removes fractional digits. See\n[`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc)\non MDN." - ], - "signature": "let trunc: float => float", - "deprecated": "" - } - ] - }, - "js/json": { - "id": "Js.Json", - "name": "Json", - "docstrings": [ - "Provide utilities for json", - "Efficient JSON encoding using JavaScript API\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON)" - ], - "items": [ - { - "id": "Js.Json.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The JSON data structure" - ], - "signature": "@unboxed\ntype t = JSON.t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)", - "deprecated": "" - }, - { - "id": "Js.Json.tagged_t", - "kind": "type", - "name": "tagged_t", - "docstrings": [], - "signature": "type tagged_t =\n | JSONFalse\n | JSONTrue\n | JSONNull\n | JSONString(string)\n | JSONNumber(float)\n | JSONObject(dict)\n | JSONArray(array)", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.classify", - "kind": "value", - "name": "classify", - "docstrings": [], - "signature": "let classify: t => tagged_t", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.test", - "kind": "value", - "name": "test", - "docstrings": [ - "`test(v, kind)` returns `true` if `v` is of `kind`." - ], - "signature": "let test: ('a, Kind.t<'b>) => bool", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.decodeString", - "kind": "value", - "name": "decodeString", - "docstrings": [ - "`decodeString(json)` returns `Some(s)` if `json` is a `string`, `None` otherwise." - ], - "signature": "let decodeString: t => option", - "deprecated": "" - }, - { - "id": "Js.Json.decodeNumber", - "kind": "value", - "name": "decodeNumber", - "docstrings": [ - "`decodeNumber(json)` returns `Some(n)` if `json` is a `number`, `None` otherwise." - ], - "signature": "let decodeNumber: t => option", - "deprecated": "" - }, - { - "id": "Js.Json.decodeObject", - "kind": "value", - "name": "decodeObject", - "docstrings": [ - "`decodeObject(json)` returns `Some(o)` if `json` is an `object`, `None` otherwise." - ], - "signature": "let decodeObject: t => option>", - "deprecated": "" - }, - { - "id": "Js.Json.decodeArray", - "kind": "value", - "name": "decodeArray", - "docstrings": [ - "`decodeArray(json)` returns `Some(a)` if `json` is an `array`, `None` otherwise." - ], - "signature": "let decodeArray: t => option>", - "deprecated": "" - }, - { - "id": "Js.Json.decodeBoolean", - "kind": "value", - "name": "decodeBoolean", - "docstrings": [ - "`decodeBoolean(json)` returns `Some(b)` if `json` is a `boolean`, `None` otherwise." - ], - "signature": "let decodeBoolean: t => option", - "deprecated": "" - }, - { - "id": "Js.Json.decodeNull", - "kind": "value", - "name": "decodeNull", - "docstrings": [ - "`decodeNull(json)` returns `Some(null)` if `json` is a `null`, `None` otherwise." - ], - "signature": "let decodeNull: t => option>", - "deprecated": "" - }, - { - "id": "Js.Json.null", - "kind": "value", - "name": "null", - "docstrings": [ - "`null` is the singleton null JSON value." - ], - "signature": "let null: t", - "deprecated": "" - }, - { - "id": "Js.Json.string", - "kind": "value", - "name": "string", - "docstrings": [ - "`string(s)` makes a JSON string of the `string` `s`." - ], - "signature": "let string: string => t", - "deprecated": "" - }, - { - "id": "Js.Json.number", - "kind": "value", - "name": "number", - "docstrings": [ - "`number(n)` makes a JSON number of the `float` `n`." - ], - "signature": "let number: float => t", - "deprecated": "" - }, - { - "id": "Js.Json.boolean", - "kind": "value", - "name": "boolean", - "docstrings": [ - "`boolean(b)` makes a JSON boolean of the `bool` `b`." - ], - "signature": "let boolean: bool => t", - "deprecated": "" - }, - { - "id": "Js.Json.object_", - "kind": "value", - "name": "object_", - "docstrings": [ - "`object_(dict)` makes a JSON object of the `dict`." - ], - "signature": "let object_: dict => t", - "deprecated": "" - }, - { - "id": "Js.Json.array", - "kind": "value", - "name": "array", - "docstrings": [ - "`array_(a)` makes a JSON array of the `Js.Json.t` array `a`." - ], - "signature": "let array: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.stringArray", - "kind": "value", - "name": "stringArray", - "docstrings": [ - "`stringArray(a)` makes a JSON array of the `string` array `a`." - ], - "signature": "let stringArray: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.numberArray", - "kind": "value", - "name": "numberArray", - "docstrings": [ - "`numberArray(a)` makes a JSON array of the `float` array `a`." - ], - "signature": "let numberArray: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.booleanArray", - "kind": "value", - "name": "booleanArray", - "docstrings": [ - "`booleanArray(a)` makes a JSON array of the `bool` array `a`." - ], - "signature": "let booleanArray: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.objectArray", - "kind": "value", - "name": "objectArray", - "docstrings": [ - "`objectArray(a) makes a JSON array of the `JsDict.t` array `a`." - ], - "signature": "let objectArray: array> => t", - "deprecated": "" - }, - { - "id": "Js.Json.parseExn", - "kind": "value", - "name": "parseExn", - "docstrings": [ - "`parseExn(s)` parses the `string` `s` into a JSON data structure.\nReturns a JSON data structure.\nThrows `SyntaxError` if the given string is not a valid JSON. Note: `SyntaxError` is a JavaScript exception.\n\nSee [`parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) on MDN.\n\n## Examples\n\n```rescript\n/* parse a simple JSON string */\n\nlet json = try Js.Json.parseExn(` \"hello\" `) catch {\n| _ => failwith(\"Error parsing JSON string\")\n}\n\nswitch Js.Json.classify(json) {\n| Js.Json.JSONString(value) => Js.log(value)\n| _ => failwith(\"Expected a string\")\n}\n```\n\n```rescript\n/* parse a complex JSON string */\n\nlet getIds = s => {\n let json = try Js.Json.parseExn(s) catch {\n | _ => failwith(\"Error parsing JSON string\")\n }\n\n switch Js.Json.classify(json) {\n | Js.Json.JSONObject(value) =>\n /* In this branch, compiler infer value : Js.Json.t dict */\n switch Js.Dict.get(value, \"ids\") {\n | Some(ids) =>\n switch Js.Json.classify(ids) {\n | Js.Json.JSONArray(ids) => /* In this branch compiler infer ids : Js.Json.t array */\n ids\n | _ => failwith(\"Expected an array\")\n }\n | None => failwith(\"Expected an `ids` property\")\n }\n | _ => failwith(\"Expected an object\")\n }\n}\n\n/* prints `1, 2, 3` */\nJs.log(getIds(` { \"ids\" : [1, 2, 3 ] } `))\n```" - ], - "signature": "let parseExn: string => t", - "deprecated": "" - }, - { - "id": "Js.Json.stringify", - "kind": "value", - "name": "stringify", - "docstrings": [ - "`stringify(json)` formats the JSON data structure as a `string`.\nReturns the string representation of a given JSON data structure.\n\nSee [`stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) on MDN.\n\n## Examples\n\n```rescript\n/* Creates and stringifies a simple JS object */\n\nlet dict = Js.Dict.empty()\nJs.Dict.set(dict, \"name\", Js.Json.string(\"John Doe\"))\nJs.Dict.set(dict, \"age\", Js.Json.number(30.0))\nJs.Dict.set(dict, \"likes\", Js.Json.stringArray([\"ReScript\", \"ocaml\", \"js\"]))\n\nJs.log(Js.Json.stringify(Js.Json.object_(dict)))\n```" - ], - "signature": "let stringify: t => string", - "deprecated": "" - }, - { - "id": "Js.Json.stringifyWithSpace", - "kind": "value", - "name": "stringifyWithSpace", - "docstrings": [ - "`stringifyWithSpace(json)` formats the JSON data structure as a `string`.\nReturns the string representation of a given JSON data structure with spacing.\n\nSee [`stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) on MDN.\n\n## Examples\n\n```rescript\n/* Creates and stringifies a simple JS object with spacing */\n\nlet dict = Js.Dict.empty()\nJs.Dict.set(dict, \"name\", Js.Json.string(\"John Doe\"))\nJs.Dict.set(dict, \"age\", Js.Json.number(30.0))\nJs.Dict.set(dict, \"likes\", Js.Json.stringArray([\"ReScript\", \"ocaml\", \"js\"]))\n\nJs.log(Js.Json.stringifyWithSpace(Js.Json.object_(dict), 2))\n```" - ], - "signature": "let stringifyWithSpace: (t, int) => string", - "deprecated": "" - }, - { - "id": "Js.Json.stringifyAny", - "kind": "value", - "name": "stringifyAny", - "docstrings": [ - "`stringifyAny(value)` formats any value into a JSON string.\n\n## Examples\n\n```rescript\n/* prints `[\"hello\", \"world\"]` */\nJs.log(Js.Json.stringifyAny([\"hello\", \"world\"]))\n```" - ], - "signature": "let stringifyAny: 'a => option", - "deprecated": "" - }, - { - "id": "Js.Json.deserializeUnsafe", - "kind": "value", - "name": "deserializeUnsafe", - "docstrings": [ - "Best-effort serialization, it tries to seralize as\nmany objects as possible and deserialize it back\n\nIt is unsafe in two aspects\n- It may throw during parsing\n- when you cast it to a specific type, it may have a type mismatch" - ], - "signature": "let deserializeUnsafe: string => 'a", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.serializeExn", - "kind": "value", - "name": "serializeExn", - "docstrings": [ - "It will throw in such situations:\n- The object can not be serlialized to a JSON\n- There are cycles\n- Some JS engines can not stringify deeply nested json objects" - ], - "signature": "let serializeExn: 'a => string", - "deprecated": "This functionality has been deprecated and will be removed in v13." - } - ] - }, - "js/global": { - "id": "Js.Global", - "name": "Global", - "docstrings": [ - "Provide bindings to JS global functions in global namespace", - "Contains functions available in the global scope (`window` in a browser context)" - ], - "items": [ - { - "id": "Js.Global.intervalId", - "kind": "type", - "name": "intervalId", - "docstrings": [ - "Identify an interval started by `Js.Global.setInterval`." - ], - "signature": "type intervalId = Global.intervalId", - "deprecated": "" - }, - { - "id": "Js.Global.timeoutId", - "kind": "type", - "name": "timeoutId", - "docstrings": [ - "Identify timeout started by `Js.Global.setTimeout`." - ], - "signature": "type timeoutId = Global.timeoutId", - "deprecated": "" - }, - { - "id": "Js.Global.clearInterval", - "kind": "value", - "name": "clearInterval", - "docstrings": [ - "Clear an interval started by `Js.Global.setInterval`\n\n## Examples\n\n```rescript\n/* API for a somewhat aggressive snoozing alarm clock */\n\nlet punchSleepyGuy = () => Js.log(\"Punch\")\n\nlet interval = ref(Js.Nullable.null)\n\nlet remind = () => {\n Js.log(\"Wake Up!\")\n punchSleepyGuy()\n}\n\nlet snooze = mins => interval := Js.Nullable.return(Js.Global.setInterval(remind, mins * 60 * 1000))\n\nlet cancel = () =>\n Js.Nullable.iter(interval.contents, intervalId => Js.Global.clearInterval(intervalId))\n```" - ], - "signature": "let clearInterval: intervalId => unit", - "deprecated": "" - }, - { - "id": "Js.Global.clearTimeout", - "kind": "value", - "name": "clearTimeout", - "docstrings": [ - "Clear a timeout started by `Js.Global.setTimeout`.\n\n## Examples\n\n```rescript\n/* A simple model of a code monkey's brain */\n\nlet closeHackerNewsTab = () => Js.log(\"close\")\n\nlet timer = ref(Js.Nullable.null)\n\nlet work = () => closeHackerNewsTab()\n\nlet procrastinate = mins => {\n Js.Nullable.iter(timer.contents, timer => Js.Global.clearTimeout(timer))\n timer := Js.Nullable.return(Js.Global.setTimeout(work, mins * 60 * 1000))\n}\n```" - ], - "signature": "let clearTimeout: timeoutId => unit", - "deprecated": "" - }, - { - "id": "Js.Global.setInterval", - "kind": "value", - "name": "setInterval", - "docstrings": [ - "Repeatedly executes a callback with a specified interval (in milliseconds)\nbetween calls. Returns a `Js.Global.intervalId` that can be passed to\n`Js.Global.clearInterval` to cancel the timeout.\n\n## Examples\n\n```rescript\n/* Will count up and print the count to the console every second */\n\nlet count = ref(0)\n\nlet tick = () => {\n count := count.contents + 1\n Js.log(Belt.Int.toString(count.contents))\n}\n\nJs.Global.setInterval(tick, 1000)\n```" - ], - "signature": "let setInterval: (unit => unit, int) => intervalId", - "deprecated": "" - }, - { - "id": "Js.Global.setIntervalFloat", - "kind": "value", - "name": "setIntervalFloat", - "docstrings": [ - "Repeatedly executes a callback with a specified interval (in milliseconds)\nbetween calls. Returns a `Js.Global.intervalId` that can be passed to\n`Js.Global.clearInterval` to cancel the timeout.\n\n## Examples\n\n```rescript\n/* Will count up and print the count to the console every second */\n\nlet count = ref(0)\n\nlet tick = () => {\n count := count.contents + 1\n Js.log(Belt.Int.toString(count.contents))\n}\n\nJs.Global.setIntervalFloat(tick, 1000.0)\n```" - ], - "signature": "let setIntervalFloat: (unit => unit, float) => intervalId", - "deprecated": "" - }, - { - "id": "Js.Global.setTimeout", - "kind": "value", - "name": "setTimeout", - "docstrings": [ - "Execute a callback after a specified delay (in milliseconds). Returns a\n`Js.Global.timeoutId` that can be passed to `Js.Global.clearTimeout` to cancel\nthe timeout.\n\n## Examples\n\n```rescript\n/* Prints \"Timed out!\" in the console after one second */\n\nlet message = \"Timed out!\"\n\nJs.Global.setTimeout(() => Js.log(message), 1000)\n```" - ], - "signature": "let setTimeout: (unit => unit, int) => timeoutId", - "deprecated": "" - }, - { - "id": "Js.Global.setTimeoutFloat", - "kind": "value", - "name": "setTimeoutFloat", - "docstrings": [ - "Execute a callback after a specified delay (in milliseconds). Returns a\n`Js.Global.timeoutId` that can be passed to `Js.Global.clearTimeout` to cancel\nthe timeout.\n\n## Examples\n\n```rescript\n/* Prints \"Timed out!\" in the console after one second */\n\nlet message = \"Timed out!\"\n\nJs.Global.setTimeoutFloat(() => Js.log(message), 1000.0)\n```" - ], - "signature": "let setTimeoutFloat: (unit => unit, float) => timeoutId", - "deprecated": "" - }, - { - "id": "Js.Global.encodeURI", - "kind": "value", - "name": "encodeURI", - "docstrings": [ - "URL-encodes a string.\n\nSee [`encodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI) on MDN." - ], - "signature": "let encodeURI: string => string", - "deprecated": "" - }, - { - "id": "Js.Global.decodeURI", - "kind": "value", - "name": "decodeURI", - "docstrings": [ - "Decodes a URL-enmcoded string produced by `encodeURI`\n\nSee [`decodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI) on MDN." - ], - "signature": "let decodeURI: string => string", - "deprecated": "" - }, - { - "id": "Js.Global.encodeURIComponent", - "kind": "value", - "name": "encodeURIComponent", - "docstrings": [ - "URL-encodes a string, including characters with special meaning in a URI.\n\nSee [`encodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) on MDN." - ], - "signature": "let encodeURIComponent: string => string", - "deprecated": "" - }, - { - "id": "Js.Global.decodeURIComponent", - "kind": "value", - "name": "decodeURIComponent", - "docstrings": [ - "Decodes a URL-enmcoded string produced by `encodeURIComponent`\n\nSee [`decodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) on MDN." - ], - "signature": "let decodeURIComponent: string => string", - "deprecated": "" - } - ] - }, - "js/dict": { - "id": "Js.Dict", - "name": "Dict", - "docstrings": [ - "Provide utilities for JS dictionary object", - "Provide utilities for JS dictionary object.\n\n**Note:** This module's examples will assume this predeclared dictionary:\n\n## Examples\n\n```rescript\nlet ages = Js.Dict.fromList(list{(\"Maria\", 30), (\"Vinh\", 22), (\"Fred\", 49)})\n```" - ], - "items": [ - { - "id": "Js.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = dict<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.key", - "kind": "type", - "name": "key", - "docstrings": [ - "The type for dictionary keys. This means that dictionaries *must* use `string`s as their keys." - ], - "signature": "type key = string", - "deprecated": "" - }, - { - "id": "Js.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`Js.Dict.get(key)` returns `None` if the key is not found in the dictionary,\n`Some(value)` otherwise.\n\n## Examples\n\n```rescript\nJs.Dict.get(ages, \"Vinh\") == Some(22)\nJs.Dict.get(ages, \"Paul\") == None\n```" - ], - "signature": "let get: (t<'a>, key) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.unsafeGet", - "kind": "value", - "name": "unsafeGet", - "docstrings": [ - "`Js.Dict.unsafeGet(key)` returns the value if the key exists, otherwise an `undefined` value is returned. Use this only when you are sure the key exists (i.e. when having used the `keys()` function to check that the key is valid).\n\n## Examples\n\n```rescript\nJs.Dict.unsafeGet(ages, \"Fred\") == 49\nJs.Dict.unsafeGet(ages, \"Paul\") // returns undefined\n```" - ], - "signature": "let unsafeGet: (t<'a>, key) => 'a", - "deprecated": "" - }, - { - "id": "Js.Dict.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`Js.Dict.set(dict, key, value)` sets the key/value in the dictionary `dict`. If\nthe key does not exist, and entry will be created for it.\n\n*This function modifies the original dictionary.*\n\n## Examples\n\n```rescript\nJs.Dict.set(ages, \"Maria\", 31)\nJs.log(ages == Js.Dict.fromList(list{(\"Maria\", 31), (\"Vinh\", 22), (\"Fred\", 49)}))\n\nJs.Dict.set(ages, \"David\", 66)\nJs.log(ages == Js.Dict.fromList(list{(\"Maria\", 31), (\"Vinh\", 22), (\"Fred\", 49), (\"David\", 66)}))\n```" - ], - "signature": "let set: (t<'a>, key, 'a) => unit", - "deprecated": "" - }, - { - "id": "Js.Dict.keys", - "kind": "value", - "name": "keys", - "docstrings": [ - "Returns all the keys in the dictionary `dict`.\n\n## Examples\n\n```rescript\nJs.Dict.keys(ages) == [\"Maria\", \"Vinh\", \"Fred\"]\n```" - ], - "signature": "let keys: t<'a> => array", - "deprecated": "" - }, - { - "id": "Js.Dict.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "Returns an empty dictionary." - ], - "signature": "let empty: unit => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.unsafeDeleteKey", - "kind": "value", - "name": "unsafeDeleteKey", - "docstrings": [ - "Experimental internal function" - ], - "signature": "let unsafeDeleteKey: (t, string) => unit", - "deprecated": "" - }, - { - "id": "Js.Dict.entries", - "kind": "value", - "name": "entries", - "docstrings": [ - "Returns an array of key/value pairs in the given dictionary (ES2017).\n\n## Examples\n\n```rescript\nJs.Dict.entries(ages) == [(\"Maria\", 30), (\"Vinh\", 22), (\"Fred\", 49)]\n```" - ], - "signature": "let entries: t<'a> => array<(key, 'a)>", - "deprecated": "" - }, - { - "id": "Js.Dict.values", - "kind": "value", - "name": "values", - "docstrings": [ - "Returns the values in the given dictionary (ES2017).\n\n## Examples\n\n```rescript\nJs.Dict.values(ages) == [30, 22, 49]\n```" - ], - "signature": "let values: t<'a> => array<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.fromList", - "kind": "value", - "name": "fromList", - "docstrings": [ - "Creates a new dictionary containing each (key, value) pair in its list\nargument.\n\n## Examples\n\n```rescript\nlet capitals = Js.Dict.fromList(list{(\"Japan\", \"Tokyo\"), (\"France\", \"Paris\"), (\"Egypt\", \"Cairo\")})\n```" - ], - "signature": "let fromList: list<(key, 'a)> => t<'a>", - "deprecated": "Use `Dict.fromArray(List.toArray(...))` instead." - }, - { - "id": "Js.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates a new dictionary containing each (key, value) pair in its array\nargument.\n\n## Examples\n\n```rescript\nlet capitals2 = Js.Dict.fromArray([(\"Germany\", \"Berlin\"), (\"Burkina Faso\", \"Ouagadougou\")])\n```" - ], - "signature": "let fromArray: array<(key, 'a)> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(f, dict)` maps `dict` to a new dictionary with the same keys, using the\nfunction `f` to map each value.\n\n## Examples\n\n```rescript\nlet prices = Js.Dict.fromList(list{(\"pen\", 1.00), (\"book\", 5.00), (\"stapler\", 7.00)})\n\nlet discount = price => price *. 0.90\nlet salePrices = Js.Dict.map(discount, prices)\n\nsalePrices == Js.Dict.fromList(list{(\"pen\", 0.90), (\"book\", 4.50), (\"stapler\", 6.30)})\n```" - ], - "signature": "let map: ('a => 'b, t<'a>) => t<'b>", - "deprecated": "" - } - ] - }, - "js/date": { - "id": "Js.Date", - "name": "Date", - "docstrings": [ - "Provide bindings for JS Date", - "Provide bindings to JS date. (See\n[`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)\non MDN.) JavaScript stores dates as the number of milliseconds since the UNIX\n*epoch*, midnight 1 January 1970, UTC." - ], - "items": [ - { - "id": "Js.Date.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Date.t", - "deprecated": "" - }, - { - "id": "Js.Date.valueOf", - "kind": "value", - "name": "valueOf", - "docstrings": [ - "Returns the primitive value of this date, equivalent to `getTime()`. (See\n[`Date.valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/valueOf)\non MDN.)\n\n## Examples\n\n```rescript\nJs.Date.valueOf(exampleDate) == 123456654321.0\n```" - ], - "signature": "let valueOf: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a date representing the current time. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nlet now = Js.Date.make()\n```" - ], - "signature": "let make: unit => t", - "deprecated": "" - }, - { - "id": "Js.Date.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "Returns a date representing the given argument, which is a number of\nmilliseconds since the epoch. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.fromFloat(123456654321.0) == exampleDate\n```" - ], - "signature": "let fromFloat: float => t", - "deprecated": "" - }, - { - "id": "Js.Date.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Returns a `Js.Date.t` represented by the given string. The string can be in\n“IETF-compliant RFC 2822 timestamps, and also strings in a version of ISO8601.”\nReturns `NaN` if given an invalid date string. According to the [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\ndocumentation on MDN, its use is discouraged.\n\n## Examples\n\n```rescript\nJs.Date.fromString(\"Thu, 29 Nov 1973 21:30:54.321 GMT\") == exampleDate\nJs.Date.fromString(\"1973-11-29T21:30:54.321Z00:00\") == exampleDate\nJs.Date.fromString(\"Thor, 32 Lok -19 60:70:80 XYZ\") // returns NaN\n```" - ], - "signature": "let fromString: string => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYM", - "kind": "value", - "name": "makeWithYM", - "docstrings": [ - "Returns a date representing midnight of the first day of the given month and\nyear in the current time zone. Fractional parts of arguments are ignored. See\n[`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nlet november1 = Js.Date.makeWithYM(~year=2020.0, ~month=10.0, ())\n```" - ], - "signature": "let makeWithYM: (~year: float, ~month: float, unit) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMD", - "kind": "value", - "name": "makeWithYMD", - "docstrings": [ - "Returns a date representing midnight of the given date of the given month and\nyear in the current time zone. Fractional parts of arguments are ignored. See\n[`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN." - ], - "signature": "let makeWithYMD: (~year: float, ~month: float, ~date: float, unit) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMDH", - "kind": "value", - "name": "makeWithYMDH", - "docstrings": [ - "Returns a date representing the given date of the given month and year, at zero\nminutes and zero seconds past the given `hours`, in the current time zone.\nFractional parts of arguments are ignored. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN. Fractional parts of the arguments are ignored." - ], - "signature": "let makeWithYMDH: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n unit,\n) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMDHM", - "kind": "value", - "name": "makeWithYMDHM", - "docstrings": [ - "Returns a date representing the given date of the given month and year, at zero\nseconds past the given time in hours and minutes in the current time zone.\nFractional parts of arguments are ignored. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN." - ], - "signature": "let makeWithYMDHM: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n unit,\n) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMDHMS", - "kind": "value", - "name": "makeWithYMDHMS", - "docstrings": [ - "Returns a date representing the given date of the given month and year, at the\ngiven time in hours, minutes, and seconds in the current time zone. Fractional\nparts of arguments are ignored. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.makeWithYMDHMS(\n ~year=1973.0,\n ~month=11.0,\n ~date=29.0,\n ~hours=21.0,\n ~minutes=30.0,\n ~seconds=54.321,\n (),\n) == exampleDate\n```" - ], - "signature": "let makeWithYMDHMS: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => t", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYM", - "kind": "value", - "name": "utcWithYM", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the first day of the given month and year in UTC. Fractional parts\nof arguments are ignored. See\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN.\n\n## Examples\n\n```rescript\nlet november1 = Js.Date.utcWithYM(~year=2020.0, ~month=10.0, ())\n```" - ], - "signature": "let utcWithYM: (~year: float, ~month: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMD", - "kind": "value", - "name": "utcWithYMD", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year in UTC. Fractional parts\nof arguments are ignored. See\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMD: (~year: float, ~month: float, ~date: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMDH", - "kind": "value", - "name": "utcWithYMDH", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year, at zero minutes and\nseconds past the given hours in UTC. Fractional parts of arguments are ignored.\nSee\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMDH: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMDHM", - "kind": "value", - "name": "utcWithYMDHM", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year, at zero seconds past\nthe given number of minutes past the given hours in UTC. Fractional parts of\narguments are ignored. See\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMDHM: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMDHMS", - "kind": "value", - "name": "utcWithYMDHMS", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year, at the given time in\nhours, minutes and seconds in UTC. Fractional parts of arguments are ignored.\n\nSee\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMDHMS: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.now", - "kind": "value", - "name": "now", - "docstrings": [ - "Returns the current time as number of milliseconds since Unix epoch." - ], - "signature": "let now: unit => float", - "deprecated": "" - }, - { - "id": "Js.Date.parse", - "kind": "value", - "name": "parse", - "docstrings": [], - "signature": "let parse: string => t", - "deprecated": "" - }, - { - "id": "Js.Date.parseAsFloat", - "kind": "value", - "name": "parseAsFloat", - "docstrings": [ - "Returns a float with the number of milliseconds past the epoch represented by\nthe given string. The string can be in “IETF-compliant RFC 2822 timestamps, and\nalso strings in a version of ISO8601.” Returns `NaN` if given an invalid date\nstring. According to the\n[`Date.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse)\ndocumentation on MDN, its use is discouraged. Returns `NaN` if passed invalid\ndate string." - ], - "signature": "let parseAsFloat: string => float", - "deprecated": "" - }, - { - "id": "Js.Date.getDate", - "kind": "value", - "name": "getDate", - "docstrings": [ - "Returns the day of the month for its argument. The argument is evaluated in the\ncurrent time zone. See\n[`Date.getDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDate)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getDate(exampleDate) == 29.0\n```" - ], - "signature": "let getDate: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getDay", - "kind": "value", - "name": "getDay", - "docstrings": [ - "Returns the day of the week (0.0-6.0) for its argument, where 0.0 represents\nSunday. The argument is evaluated in the current time zone. See\n[`Date.getDay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDay)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getDay(exampleDate) == 4.0\n```" - ], - "signature": "let getDay: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getFullYear", - "kind": "value", - "name": "getFullYear", - "docstrings": [ - "Returns the full year (as opposed to the range 0-99) for its argument. The\nargument is evaluated in the current time zone. See\n[`Date.getFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getFullYear)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getFullYear(exampleDate) == 1973.0\n```" - ], - "signature": "let getFullYear: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getHours", - "kind": "value", - "name": "getHours", - "docstrings": [ - "Returns the hours for its argument, evaluated in the current time zone. See\n[`Date.getHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getHours)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getHours(exampleDate) == 22.0 // Vienna is in GMT+01:00\n```" - ], - "signature": "let getHours: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getMilliseconds", - "kind": "value", - "name": "getMilliseconds", - "docstrings": [ - "Returns the number of milliseconds for its argument, evaluated in the current\ntime zone. See\n[`Date.getMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getMilliseconds(exampleDate) == 321.0\n```" - ], - "signature": "let getMilliseconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getMinutes", - "kind": "value", - "name": "getMinutes", - "docstrings": [ - "Returns the number of minutes for its argument, evaluated in the current time\nzone. See\n[`Date.getMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMinutes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getMinutes(exampleDate) == 30.0\n```" - ], - "signature": "let getMinutes: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getMonth", - "kind": "value", - "name": "getMonth", - "docstrings": [ - "Returns the month (0.0-11.0) for its argument, evaluated in the current time\nzone. January is month zero. See\n[`Date.getMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMonth)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getMonth(exampleDate) == 10.0\n```" - ], - "signature": "let getMonth: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getSeconds", - "kind": "value", - "name": "getSeconds", - "docstrings": [ - "Returns the seconds for its argument, evaluated in the current time zone. See\n[`Date.getSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getSeconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getSeconds(exampleDate) == 54.0\n```" - ], - "signature": "let getSeconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getTime", - "kind": "value", - "name": "getTime", - "docstrings": [ - "Returns the number of milliseconds since Unix epoch, evaluated in UTC. See\n[`Date.getTime`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getTime(exampleDate) == 123456654321.0\n```" - ], - "signature": "let getTime: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getTimezoneOffset", - "kind": "value", - "name": "getTimezoneOffset", - "docstrings": [ - "Returns the time zone offset in minutes from the current time zone to UTC. See\n[`Date.getTimezoneOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getTimezoneOffset(exampleDate) == -60.0\n```" - ], - "signature": "let getTimezoneOffset: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCDate", - "kind": "value", - "name": "getUTCDate", - "docstrings": [ - "Returns the day of the month of the argument, evaluated in UTC. See\n[`Date.getUTCDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCDate)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCDate(exampleDate) == 29.0\n```" - ], - "signature": "let getUTCDate: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCDay", - "kind": "value", - "name": "getUTCDay", - "docstrings": [ - "Returns the day of the week of the argument, evaluated in UTC. The range of the\nreturn value is 0.0-6.0, where Sunday is zero. See\n[`Date.getUTCDay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCDay)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCDay(exampleDate) == 4.0\n```" - ], - "signature": "let getUTCDay: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCFullYear", - "kind": "value", - "name": "getUTCFullYear", - "docstrings": [ - "Returns the full year (as opposed to the range 0-99) for its argument. The\nargument is evaluated in UTC. See\n[`Date.getUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCFullYear(exampleDate) == 1973.0\n```" - ], - "signature": "let getUTCFullYear: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCHours", - "kind": "value", - "name": "getUTCHours", - "docstrings": [ - "Returns the hours for its argument, evaluated in the current time zone. See\n[`Date.getUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCHours(exampleDate) == 21.0\n```" - ], - "signature": "let getUTCHours: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCMilliseconds", - "kind": "value", - "name": "getUTCMilliseconds", - "docstrings": [ - "Returns the number of milliseconds for its argument, evaluated in UTC. See\n[`Date.getUTCMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCMilliseconds(exampleDate) == 321.0\n```" - ], - "signature": "let getUTCMilliseconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCMinutes", - "kind": "value", - "name": "getUTCMinutes", - "docstrings": [ - "Returns the number of minutes for its argument, evaluated in UTC. See\n[`Date.getUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCMinutes(exampleDate) == 30.0\n```" - ], - "signature": "let getUTCMinutes: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCMonth", - "kind": "value", - "name": "getUTCMonth", - "docstrings": [ - "Returns the month (0.0-11.0) for its argument, evaluated in UTC. January is\nmonth zero. See\n[`Date.getUTCMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMonth)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCMonth(exampleDate) == 10.0\n```" - ], - "signature": "let getUTCMonth: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCSeconds", - "kind": "value", - "name": "getUTCSeconds", - "docstrings": [ - "Returns the seconds for its argument, evaluated in UTC. See\n[`Date.getUTCSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCSeconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCSeconds(exampleDate) == 54.0\n```" - ], - "signature": "let getUTCSeconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getYear", - "kind": "value", - "name": "getYear", - "docstrings": [], - "signature": "let getYear: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.setDate", - "kind": "value", - "name": "setDate", - "docstrings": [ - "Sets the given `Date`’s day of month to the value in the second argument\naccording to the current time zone. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setDate)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet twoWeeksBefore = Js.Date.setDate(date1, 15.0)\ndate1 == Js.Date.fromString(\"1973-11-15T21:30:54.321Z00:00\")\ntwoWeeksBefore == Js.Date.getTime(date1)\n```" - ], - "signature": "let setDate: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setFullYear", - "kind": "value", - "name": "setFullYear", - "docstrings": [ - "Sets the given `Date`’s year to the value in the second argument according to\nthe current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextYear = Js.Date.setFullYear(date1, 1974.0)\ndate1 == Js.Date.fromString(\"1974-11-15T21:30:54.321Z00:00\")\nnextYear == Js.Date.getTime(date1)\n```" - ], - "signature": "let setFullYear: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setFullYearM", - "kind": "value", - "name": "setFullYearM", - "docstrings": [ - "Sets the given `Date`’s year and month to the values in the labeled arguments\naccording to the current time zone. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setFullYearM(date1, ~year=1974.0, ~month=0.0, ())\ndate1 == Js.Date.fromString(\"1974-01-22T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setFullYearM: (t, ~year: float, ~month: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setFullYearMD", - "kind": "value", - "name": "setFullYearMD", - "docstrings": [ - "Sets the given `Date`’s year, month, and day of month to the values in the\nlabeled arguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setFullYearMD(date1, ~year=1974.0, ~month=0.0, ~date=7.0, ())\ndate1 == Js.Date.fromString(\"1974-01-07T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setFullYearMD: (\n t,\n ~year: float,\n ~month: float,\n ~date: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHours", - "kind": "value", - "name": "setHours", - "docstrings": [ - "Sets the given `Date`’s hours to the value in the second argument according to\nthe current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextHour = Js.Date.setHours(date1, 22.0)\ndate1 == Js.Date.fromString(\"1973-11-29T22:30:54.321Z00:00\")\nnextHour == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHours: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHoursM", - "kind": "value", - "name": "setHoursM", - "docstrings": [ - "Sets the given `Date`’s hours and minutes to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setHoursM(date1, ~hours=22.0, ~minutes=46.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:54.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHoursM: (t, ~hours: float, ~minutes: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHoursMS", - "kind": "value", - "name": "setHoursMS", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, and seconds to the values in the\nlabeled arguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setHoursMS(date1, ~hours=22.0, ~minutes=46.0, ~seconds=37.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHoursMS: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHoursMSMs", - "kind": "value", - "name": "setHoursMSMs", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, seconds, and milliseconds to the values\nin the labeled arguments according to the current time zone. Returns the number\nof milliseconds since the epoch of the updated `Date`. *This function modifies\nthe original `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setHoursMSMs(\n date1,\n ~hours=22.0,\n ~minutes=46.0,\n ~seconds=37.0,\n ~milliseconds=494.0,\n (),\n)\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHoursMSMs: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMilliseconds", - "kind": "value", - "name": "setMilliseconds", - "docstrings": [ - "Sets the given `Date`’s milliseconds to the value in the second argument\naccording to the current time zone. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMilliseconds(date1, 494.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:30:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMilliseconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMinutes", - "kind": "value", - "name": "setMinutes", - "docstrings": [ - "Sets the given `Date`’s minutes to the value in the second argument according\nto the current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMinutes(date1, 34.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMinutes: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMinutesS", - "kind": "value", - "name": "setMinutesS", - "docstrings": [ - "Sets the given `Date`’s minutes and seconds to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMinutesS(date1, ~minutes=34.0, ~seconds=56.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMinutesS: (t, ~minutes: float, ~seconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMinutesSMs", - "kind": "value", - "name": "setMinutesSMs", - "docstrings": [ - "Sets the given `Date`’s minutes, seconds, and milliseconds to the values in the\nlabeled arguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMinutesSMs(date1, ~minutes=34.0, ~seconds=56.0, ~milliseconds=789.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMinutesSMs: (\n t,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMonth", - "kind": "value", - "name": "setMonth", - "docstrings": [ - "Sets the given `Date`’s month to the value in the second argument according to\nthe current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMonth(date1, 11.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMonth: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMonthD", - "kind": "value", - "name": "setMonthD", - "docstrings": [ - "Sets the given `Date`’s month and day of month to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMonthD(date1, ~month=11.0, ~date=8.0, ())\ndate1 == Js.Date.fromString(\"1973-12-08T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMonthD: (t, ~month: float, ~date: float, unit) => float", - "deprecated": "Use `Date.setMonth` then `Date.setDate`. No direct 1:1 migration available." - }, - { - "id": "Js.Date.setSeconds", - "kind": "value", - "name": "setSeconds", - "docstrings": [ - "Sets the given `Date`’s seconds to the value in the second argument according\nto the current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setSeconds(date1, 56.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setSeconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setSecondsMs", - "kind": "value", - "name": "setSecondsMs", - "docstrings": [ - "Sets the given `Date`’s seconds and milliseconds to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setSecondsMs(date1, ~seconds=56.0, ~milliseconds=789.0, ())\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setSecondsMs: (t, ~seconds: float, ~milliseconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setTime", - "kind": "value", - "name": "setTime", - "docstrings": [ - "Sets the given `Date`’s value in terms of milliseconds since the epoch. Returns\nthe number of milliseconds since the epoch of the updated `Date`. *This\nfunction modifies the original `Date`.* See\n[`Date.setTime`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setTime)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setTime(date1, 198765432101.0)\n\ndate1 == Js.Date.fromString(\"1976-04-19T12:37:12.101Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setTime: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCDate", - "kind": "value", - "name": "setUTCDate", - "docstrings": [ - "Sets the given `Date`’s day of month to the value in the second argument\naccording to UTC. Returns the number of milliseconds since the epoch of the\nupdated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCDate)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet twoWeeksBefore = Js.Date.setUTCDate(date1, 15.0)\ndate1 == Js.Date.fromString(\"1973-11-15T21:30:54.321Z00:00\")\ntwoWeeksBefore == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCDate: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCFullYear", - "kind": "value", - "name": "setUTCFullYear", - "docstrings": [ - "Sets the given `Date`’s year to the value in the second argument according to\nUTC. Returns the number of milliseconds since the epoch of the updated `Date`.\n*This function modifies the original `Date`.* See\n[`Date.setUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextYear = Js.Date.setUTCFullYear(date1, 1974.0)\ndate1 == Js.Date.fromString(\"1974-11-15T21:30:54.321Z00:00\")\nnextYear == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCFullYear: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCFullYearM", - "kind": "value", - "name": "setUTCFullYearM", - "docstrings": [ - "Sets the given `Date`’s year and month to the values in the labeled arguments\naccording to UTC. Returns the number of milliseconds since the epoch of the\nupdated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setUTCFullYearM(date1, ~year=1974.0, ~month=0.0, ())\ndate1 == Js.Date.fromString(\"1974-01-22T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCFullYearM: (t, ~year: float, ~month: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCFullYearMD", - "kind": "value", - "name": "setUTCFullYearMD", - "docstrings": [ - "Sets the given `Date`’s year, month, and day of month to the values in the\nlabeled arguments according to UTC. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setUTCFullYearMD(date1, ~year=1974.0, ~month=0.0, ~date=7.0, ())\ndate1 == Js.Date.fromString(\"1974-01-07T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCFullYearMD: (\n t,\n ~year: float,\n ~month: float,\n ~date: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHours", - "kind": "value", - "name": "setUTCHours", - "docstrings": [ - "Sets the given `Date`’s hours to the value in the second argument according to\nUTC. Returns the number of milliseconds since the epoch of the updated `Date`.\n*This function modifies the original `Date`.* See\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextHour = Js.Date.setUTCHours(date1, 22.0)\ndate1 == Js.Date.fromString(\"1973-11-29T22:30:54.321Z00:00\")\nnextHour == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHours: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHoursM", - "kind": "value", - "name": "setUTCHoursM", - "docstrings": [ - "Sets the given `Date`’s hours and minutes to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCHoursM(date1, ~hours=22.0, ~minutes=46.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:54.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHoursM: (t, ~hours: float, ~minutes: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHoursMS", - "kind": "value", - "name": "setUTCHoursMS", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, and seconds to the values in the\nlabeled arguments according to UTC. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\n\nSee\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCHoursMS(date1, ~hours=22.0, ~minutes=46.0, ~seconds=37.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHoursMS: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHoursMSMs", - "kind": "value", - "name": "setUTCHoursMSMs", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, seconds, and milliseconds to the values\nin the labeled arguments according to UTC. Returns the number of milliseconds\nsince the epoch of the updated `Date`. *This function modifies the original\n`Date`.* See\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCHoursMSMs(\n date1,\n ~hours=22.0,\n ~minutes=46.0,\n ~seconds=37.0,\n ~milliseconds=494.0,\n (),\n)\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHoursMSMs: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMilliseconds", - "kind": "value", - "name": "setUTCMilliseconds", - "docstrings": [ - "Sets the given `Date`’s milliseconds to the value in the second argument\naccording to UTC. Returns the number of milliseconds since the epoch of the\nupdated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMilliseconds(date1, 494.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:30:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMilliseconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMinutes", - "kind": "value", - "name": "setUTCMinutes", - "docstrings": [ - "Sets the given `Date`’s minutes to the value in the second argument according\nto the current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMinutes(date1, 34.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMinutes: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMinutesS", - "kind": "value", - "name": "setUTCMinutesS", - "docstrings": [ - "Sets the given `Date`’s minutes and seconds to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMinutesS(date1, ~minutes=34.0, ~seconds=56.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMinutesS: (t, ~minutes: float, ~seconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMinutesSMs", - "kind": "value", - "name": "setUTCMinutesSMs", - "docstrings": [ - "Sets the given `Date`’s minutes, seconds, and milliseconds to the values in the\nlabeled arguments according to UTC. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMinutesSMs(\n date1,\n ~minutes=34.0,\n ~seconds=56.0,\n ~milliseconds=789.0,\n (),\n)\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMinutesSMs: (\n t,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMonth", - "kind": "value", - "name": "setUTCMonth", - "docstrings": [ - "Sets the given `Date`’s month to the value in the second argument according to\nUTC. Returns the number of milliseconds since the epoch of the updated `Date`.\n*This function modifies the original `Date`.* See\n[`Date.setUTCMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMonth(date1, 11.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMonth: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMonthD", - "kind": "value", - "name": "setUTCMonthD", - "docstrings": [ - "Sets the given `Date`’s month and day of month to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMonthD(date1, ~month=11.0, ~date=8.0, ())\ndate1 == Js.Date.fromString(\"1973-12-08T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMonthD: (t, ~month: float, ~date: float, unit) => float", - "deprecated": "Use `Date.setUTCMonth` then `Date.setUTCDate`. No direct 1:1 migration available." - }, - { - "id": "Js.Date.setUTCSeconds", - "kind": "value", - "name": "setUTCSeconds", - "docstrings": [ - "Sets the given `Date`’s seconds to the value in the second argument according\nto UTC. Returns the number of milliseconds since the epoch of the updated\n`Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCSeconds(date1, 56.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCSeconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCSecondsMs", - "kind": "value", - "name": "setUTCSecondsMs", - "docstrings": [ - "Sets the given `Date`’s seconds and milliseconds to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCSecondsMs(date1, ~seconds=56.0, ~milliseconds=789.0, ())\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCSecondsMs: (t, ~seconds: float, ~milliseconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCTime", - "kind": "value", - "name": "setUTCTime", - "docstrings": [ - "Same as [`setTime()`](#settime)." - ], - "signature": "let setUTCTime: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setYear", - "kind": "value", - "name": "setYear", - "docstrings": [], - "signature": "let setYear: (t, float) => float", - "deprecated": "Use `setFullYear` instead" - }, - { - "id": "Js.Date.toDateString", - "kind": "value", - "name": "toDateString", - "docstrings": [ - "Returns the date (day of week, year, month, and day of month) portion of a\n`Date` in English. See\n[`Date.toDateString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toDateString(exampleDate) == \"Thu Nov 29 1973\"\n```" - ], - "signature": "let toDateString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toGMTString", - "kind": "value", - "name": "toGMTString", - "docstrings": [], - "signature": "let toGMTString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toISOString", - "kind": "value", - "name": "toISOString", - "docstrings": [ - "Returns a simplified version of the ISO 8601 format for the date. See\n[`Date.toISOString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toISOString(exampleDate) == \"1973-11-29T21:30:54.321Z\"\n```" - ], - "signature": "let toISOString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toJSON", - "kind": "value", - "name": "toJSON", - "docstrings": [], - "signature": "let toJSON: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toJSONUnsafe", - "kind": "value", - "name": "toJSONUnsafe", - "docstrings": [ - "Returns a string representation of the given date. See\n[`Date.toJSON`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON)\non MDN." - ], - "signature": "let toJSONUnsafe: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toLocaleDateString", - "kind": "value", - "name": "toLocaleDateString", - "docstrings": [ - "Returns the year, month, and day for the given `Date` in the current locale\nformat. See\n[`Date.toLocaleDateString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toLocaleDateString(exampleDate) == \"11/29/1973\" // for en_US.utf8\nJs.Date.toLocaleDateString(exampleDate) == \"29.11.73\" // for de_DE.utf8\n```" - ], - "signature": "let toLocaleDateString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Returns the time and date for the given `Date` in the current locale format.\nSee\n[`Date.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toLocaleString(exampleDate) == \"11/29/1973, 10:30:54 PM\" // for en_US.utf8\nJs.Date.toLocaleString(exampleDate) == \"29.11.1973, 22:30:54\" // for de_DE.utf8\n```" - ], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toLocaleTimeString", - "kind": "value", - "name": "toLocaleTimeString", - "docstrings": [ - "Returns the time of day for the given `Date` in the current locale format. See\n[`Date.toLocaleTimeString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toLocaleString(exampleDate) == \"10:30:54 PM\" // for en_US.utf8\nJs.Date.toLocaleString(exampleDate) == \"22:30:54\" // for de_DE.utf8\n```" - ], - "signature": "let toLocaleTimeString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Returns a string representing the date and time of day for the given `Date` in\nthe current locale and time zone. See\n[`Date.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toString(\n exampleDate,\n) == \"Thu Nov 29 1973 22:30:54 GMT+0100 (Central European Standard Time)\"\n```" - ], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toTimeString", - "kind": "value", - "name": "toTimeString", - "docstrings": [ - "Returns a string representing the time of day for the given `Date` in the\ncurrent locale and time zone. See\n[`Date.toTimeString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toTimeString(exampleDate) == \"22:30:54 GMT+0100 (Central European Standard Time)\"\n```" - ], - "signature": "let toTimeString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toUTCString", - "kind": "value", - "name": "toUTCString", - "docstrings": [ - "Returns a string representing the date and time of day for the given `Date` in\nthe current locale and UTC (GMT time zone). See\n[`Date.toUTCString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toUTCString(exampleDate) == \"Thu, 29 Nov 1973 21:30:54 GMT\"\n```" - ], - "signature": "let toUTCString: t => string", - "deprecated": "" - } - ] - }, - "js/promise2": { - "id": "Js.Promise2", - "name": "Promise2", - "docstrings": [ - "Provide bindings to JS Promise" - ], - "items": [ - { - "id": "Js.Promise2.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.error", - "kind": "type", - "name": "error", - "docstrings": [], - "signature": "type error" - }, - { - "id": "Js.Promise2.then", - "kind": "value", - "name": "then", - "docstrings": [ - "Type-safe t-first then" - ], - "signature": "let then: (promise<'a>, 'a => promise<'b>) => promise<'b>", - "deprecated": "" - }, - { - "id": "Js.Promise2.catch", - "kind": "value", - "name": "catch", - "docstrings": [ - "Type-safe t-first catch" - ], - "signature": "let catch: (promise<'a>, error => promise<'a>) => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (\n (~resolve: 'a => unit, ~reject: exn => unit) => unit,\n) => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.resolve", - "kind": "value", - "name": "resolve", - "docstrings": [], - "signature": "let resolve: 'a => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.reject", - "kind": "value", - "name": "reject", - "docstrings": [], - "signature": "let reject: exn => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all", - "kind": "value", - "name": "all", - "docstrings": [], - "signature": "let all: array> => promise>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all2", - "kind": "value", - "name": "all2", - "docstrings": [], - "signature": "let all2: ((promise<'a0>, promise<'a1>)) => promise<('a0, 'a1)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all3", - "kind": "value", - "name": "all3", - "docstrings": [], - "signature": "let all3: (\n (promise<'a0>, promise<'a1>, promise<'a2>),\n) => promise<('a0, 'a1, 'a2)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all4", - "kind": "value", - "name": "all4", - "docstrings": [], - "signature": "let all4: (\n (promise<'a0>, promise<'a1>, promise<'a2>, promise<'a3>),\n) => promise<('a0, 'a1, 'a2, 'a3)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all5", - "kind": "value", - "name": "all5", - "docstrings": [], - "signature": "let all5: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all6", - "kind": "value", - "name": "all6", - "docstrings": [], - "signature": "let all6: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n promise<'a5>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4, 'a5)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.race", - "kind": "value", - "name": "race", - "docstrings": [], - "signature": "let race: array> => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.unsafe_async", - "kind": "value", - "name": "unsafe_async", - "docstrings": [], - "signature": "let unsafe_async: 'a => promise<'a>" - }, - { - "id": "Js.Promise2.unsafe_await", - "kind": "value", - "name": "unsafe_await", - "docstrings": [], - "signature": "let unsafe_await: promise<'a> => 'a" - } - ] - }, - "js/promise": { - "id": "Js.Promise", - "name": "Promise", - "docstrings": [ - "Provide bindings to JS Promise", - "Deprecation note: These bindings are pretty outdated and cannot be used properly\nwith the `->` operator.\n\nMore details on proper Promise usage can be found here:\nhttps://rescript-lang.org/docs/manual/latest/promise#promise-legacy" - ], - "items": [ - { - "id": "Js.Promise.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.error", - "kind": "type", - "name": "error", - "docstrings": [], - "signature": "type error = Js_promise2.error", - "deprecated": "" - }, - { - "id": "Js.Promise.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (\n (~resolve: 'a => unit, ~reject: exn => unit) => unit,\n) => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.resolve", - "kind": "value", - "name": "resolve", - "docstrings": [], - "signature": "let resolve: 'a => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.reject", - "kind": "value", - "name": "reject", - "docstrings": [], - "signature": "let reject: exn => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.all", - "kind": "value", - "name": "all", - "docstrings": [], - "signature": "let all: array> => promise>", - "deprecated": "" - }, - { - "id": "Js.Promise.all2", - "kind": "value", - "name": "all2", - "docstrings": [], - "signature": "let all2: ((promise<'a0>, promise<'a1>)) => promise<('a0, 'a1)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all3", - "kind": "value", - "name": "all3", - "docstrings": [], - "signature": "let all3: (\n (promise<'a0>, promise<'a1>, promise<'a2>),\n) => promise<('a0, 'a1, 'a2)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all4", - "kind": "value", - "name": "all4", - "docstrings": [], - "signature": "let all4: (\n (promise<'a0>, promise<'a1>, promise<'a2>, promise<'a3>),\n) => promise<('a0, 'a1, 'a2, 'a3)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all5", - "kind": "value", - "name": "all5", - "docstrings": [], - "signature": "let all5: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all6", - "kind": "value", - "name": "all6", - "docstrings": [], - "signature": "let all6: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n promise<'a5>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4, 'a5)>", - "deprecated": "" - }, - { - "id": "Js.Promise.race", - "kind": "value", - "name": "race", - "docstrings": [], - "signature": "let race: array> => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.then_", - "kind": "value", - "name": "then_", - "docstrings": [], - "signature": "let then_: ('a => promise<'b>, promise<'a>) => promise<'b>", - "deprecated": "" - }, - { - "id": "Js.Promise.catch", - "kind": "value", - "name": "catch", - "docstrings": [], - "signature": "let catch: (error => promise<'a>, promise<'a>) => promise<'a>", - "deprecated": "" - } - ] - }, - "js/re": { - "id": "Js.Re", - "name": "Re", - "docstrings": [ - "Provide bindings to JS regex expression", - "Provide bindings to JS regular expressions (RegExp).\n\n**Note:** This is not an immutable API. A RegExp object with the `global` (\"g\")\nflag set will modify the [`lastIndex`]() property when the RegExp object is used,\nand subsequent uses will continue the search from the previous [`lastIndex`]()." - ], - "items": [ - { - "id": "Js.Re.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The RegExp object." - ], - "signature": "type t = RegExp.t", - "deprecated": "" - }, - { - "id": "Js.Re.result", - "kind": "type", - "name": "result", - "docstrings": [ - "The result of a executing a RegExp on a string." - ], - "signature": "type result" - }, - { - "id": "Js.Re.captures", - "kind": "value", - "name": "captures", - "docstrings": [ - "An `array` of the match and captures, the first is the full match and the\nremaining are the substring captures." - ], - "signature": "let captures: result => array>", - "deprecated": "" - }, - { - "id": "Js.Re.matches", - "kind": "value", - "name": "matches", - "docstrings": [], - "signature": "let matches: result => array", - "deprecated": "" - }, - { - "id": "Js.Re.index", - "kind": "value", - "name": "index", - "docstrings": [ - "0-based index of the match in the input string." - ], - "signature": "let index: result => int", - "deprecated": "" - }, - { - "id": "Js.Re.input", - "kind": "value", - "name": "input", - "docstrings": [ - "The original input string." - ], - "signature": "let input: result => string", - "deprecated": "" - }, - { - "id": "Js.Re.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Constructs a RegExp object (Js.Re.t) from a `string`.\nRegex literals `/.../` should generally be preferred, but `fromString`\nis useful when you need to dynamically construct a regex using strings,\nexactly like when you do so in JavaScript.\n\n## Examples\n\n```rescript\nlet firstReScriptFileExtension = (filename, content) => {\n let result = Js.Re.fromString(filename ++ \"\\.(res|resi)\")->Js.Re.exec_(content)\n switch result {\n | Some(r) => Js.Nullable.toOption(Js.Re.captures(r)[1])\n | None => None\n }\n}\n\n// outputs \"res\"\nfirstReScriptFileExtension(\"School\", \"School.res School.resi Main.js School.bs.js\")\n```" - ], - "signature": "let fromString: string => t", - "deprecated": "" - }, - { - "id": "Js.Re.fromStringWithFlags", - "kind": "value", - "name": "fromStringWithFlags", - "docstrings": [ - "Constructs a RegExp object (`Js.Re.t`) from a string with the given flags.\nSee `Js.Re.fromString`.\n\nValid flags:\n\n- **g** global\n- **i** ignore case\n- **m** multiline\n- **u** unicode (es2015)\n- **y** sticky (es2015)" - ], - "signature": "let fromStringWithFlags: (string, ~flags: string) => t", - "deprecated": "" - }, - { - "id": "Js.Re.flags", - "kind": "value", - "name": "flags", - "docstrings": [ - "Returns the enabled flags as a string." - ], - "signature": "let flags: t => string", - "deprecated": "" - }, - { - "id": "Js.Re.global", - "kind": "value", - "name": "global", - "docstrings": [ - "Returns a `bool` indicating whether the global flag is set." - ], - "signature": "let global: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.ignoreCase", - "kind": "value", - "name": "ignoreCase", - "docstrings": [ - "Returns a `bool` indicating whether the ignoreCase flag is set." - ], - "signature": "let ignoreCase: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.lastIndex", - "kind": "value", - "name": "lastIndex", - "docstrings": [ - "Returns the index where the next match will start its search. This property\nwill be modified when the RegExp object is used, if the global (\"g\") flag is\nset.\n\n## Examples\n\n```rescript\nlet re = /ab*TODO/g\nlet str = \"abbcdefabh\"\n\nlet break_ = ref(false)\nwhile !break_.contents {\n switch Js.Re.exec_(re, str) {\n | Some(result) =>\n Js.Nullable.iter(Js.Re.captures(result)[0], match_ => {\n let next = Belt.Int.toString(Js.Re.lastIndex(re))\n Js.log(\"Found \" ++ (match_ ++ (\". Next match starts at \" ++ next)))\n })\n | None => break_ := true\n }\n}\n```\n\nSee\n[`RegExp: lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex)\non MDN." - ], - "signature": "let lastIndex: t => int", - "deprecated": "" - }, - { - "id": "Js.Re.setLastIndex", - "kind": "value", - "name": "setLastIndex", - "docstrings": [ - "Sets the index at which the next match will start its search from." - ], - "signature": "let setLastIndex: (t, int) => unit", - "deprecated": "" - }, - { - "id": "Js.Re.multiline", - "kind": "value", - "name": "multiline", - "docstrings": [ - "Returns a `bool` indicating whether the multiline flag is set." - ], - "signature": "let multiline: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.source", - "kind": "value", - "name": "source", - "docstrings": [ - "Returns the pattern as a `string`." - ], - "signature": "let source: t => string", - "deprecated": "" - }, - { - "id": "Js.Re.sticky", - "kind": "value", - "name": "sticky", - "docstrings": [ - "Returns a `bool` indicating whether the sticky flag is set." - ], - "signature": "let sticky: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.unicode", - "kind": "value", - "name": "unicode", - "docstrings": [ - "Returns a `bool` indicating whether the unicode flag is set." - ], - "signature": "let unicode: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.exec_", - "kind": "value", - "name": "exec_", - "docstrings": [ - "Executes a search on a given string using the given RegExp object.\nReturns `Some(Js.Re.result)` if a match is found, `None` otherwise.\n\n## Examples\n\n```rescript\n/* Match \"quick brown\" followed by \"jumps\", ignoring characters in between\n * Remember \"brown\" and \"jumps\"\n * Ignore case\n */\n\nlet re = /quick\\s(brown).+?(jumps)/ig\nlet result = Js.Re.exec_(re, \"The Quick Brown Fox Jumps Over The Lazy Dog\")\n```\n\nSee [`RegExp.prototype.exec()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec)\non MDN." - ], - "signature": "let exec_: (t, string) => option", - "deprecated": "" - }, - { - "id": "Js.Re.test_", - "kind": "value", - "name": "test_", - "docstrings": [ - "Tests whether the given RegExp object will match a given `string`.\nReturns true if a match is found, false otherwise.\n\n## Examples\n\n```rescript\n/* A simple implementation of Js.String.startsWith */\n\nlet str = \"hello world!\"\n\nlet startsWith = (target, substring) => Js.Re.fromString(\"^\" ++ substring)->Js.Re.test_(target)\n\nJs.log(str->startsWith(\"hello\")) /* prints \"true\" */\n```\n\nSee [`RegExp.prototype.test()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test)\non MDN." - ], - "signature": "let test_: (t, string) => bool", - "deprecated": "" - } - ] - }, - "js/string2": { - "id": "Js.String2", - "name": "String2", - "docstrings": [ - "Provide bindings to JS string", - "Provide bindings to JS string. Optimized for pipe-first." - ], - "items": [ - { - "id": "Js.String2.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = string", - "deprecated": "" - }, - { - "id": "Js.String2.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nJs.String2.make(3.5) == \"3.5\"\nJs.String2.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCharCode", - "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to\nthat number; `n` ranges from 0 to 65535.If out of range, the lower 16 bits of\nthe value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as\n`fromCharCode(0xF63A)`.\n\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCharCode(65) == \"A\"\nJs.String2.fromCharCode(0x3c8) == `ψ`\nJs.String2.fromCharCode(0xd55c) == `한`\nJs.String2.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCharCodeMany", - "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`.\n\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)\non MDN." - ], - "signature": "let fromCharCodeMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCodePoint", - "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point. If the number is not a valid code point, it throws\n`RangeError`. Thus, `fromCodePoint(0x1F63A)` will produce a correct value,\nunlike `fromCharCode(0x1F63A)`, and `fromCodePoint(-5)` will throw a\n`RangeError`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePoint(65) == \"A\"\nJs.String2.fromCodePoint(0x3c8) == `ψ`\nJs.String2.fromCodePoint(0xd55c) == `한`\nJs.String2.fromCodePoint(0x1f63a) == `😺`\n```" - ], - "signature": "let fromCodePoint: int => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCodePointMany", - "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```" - ], - "signature": "let fromCodePointMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String2.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(s)` returns the length of the given `string`.\n\nSee [`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.length(\"abcd\") == 4\n```" - ], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.String2.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(s, n)` returns as a `string` the character at the given index number. If\n`n` is out of range, this function returns `undefined`,so at some point this\nfunction may be modified to return `option`.\n\n## Examples\n\n```rescript\nJs.String2.get(\"Reason\", 0) == \"R\"\nJs.String2.get(\"Reason\", 4) == \"o\"\nJs.String2.get(`Rẽasöń`, 5) == `ń`\n```" - ], - "signature": "let get: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.charAt", - "kind": "value", - "name": "charAt", - "docstrings": [ - "`charAt(s, n)` gets the character at index `n` within string `s`. If `n` is\nnegative or greater than the length of `s`, it returns the empty string. If the\nstring contains characters outside the range \\\\u0000-\\\\uffff, it will return the\nfirst 16-bit value at that position in the string.\n\nSee [`String.charAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.charAt(\"Reason\", 0) == \"R\"\nJs.String2.charAt(\"Reason\", 12) == \"\"\nJs.String2.charAt(`Rẽasöń`, 5) == `ń`\n```" - ], - "signature": "let charAt: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.charCodeAt", - "kind": "value", - "name": "charCodeAt", - "docstrings": [ - "`charCodeAt(s, n)` returns the character code at position `n` in string `s`;\nthe result is in the range 0-65535, unlke `codePointAt`, so it will not work\ncorrectly for characters with code points greater than or equal to 0x10000. The\nreturn type is `float` because this function returns NaN if `n` is less than\nzero or greater than the length of the string.\n\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.charCodeAt(`😺`, 0) == 0xd83d->Belt.Int.toFloat\nJs.String2.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" - ], - "signature": "let charCodeAt: (t, int) => float", - "deprecated": "" - }, - { - "id": "Js.String2.codePointAt", - "kind": "value", - "name": "codePointAt", - "docstrings": [ - "`codePointAt(s, n)` returns the code point at position `n` within string `s` as\na `Some(value)`. The return value handles code points greater than or equal to\n0x10000. If there is no code point at the given position, the function returns\n`None`.\n\nSee [`String.codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.codePointAt(`¿😺?`, 1) == Some(0x1f63a)\nJs.String2.codePointAt(\"abc\", 5) == None\n```" - ], - "signature": "let codePointAt: (t, int) => option", - "deprecated": "" - }, - { - "id": "Js.String2.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(original, append)` returns a new `string` with `append` added after\n`original`.\n\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.concat(\"cow\", \"bell\") == \"cowbell\"\n```" - ], - "signature": "let concat: (t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(original, arr)` returns a new `string` consisting of each item of an\narray of strings added to the `original` string.\n\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.concatMany(\"1st\", [\"2nd\", \"3rd\", \"4th\"]) == \"1st2nd3rd4th\"\n```" - ], - "signature": "let concatMany: (t, array) => t", - "deprecated": "" - }, - { - "id": "Js.String2.endsWith", - "kind": "value", - "name": "endsWith", - "docstrings": [ - "ES2015: `endsWith(str, substr)` returns `true` if the `str` ends with `substr`,\n`false` otherwise.\n\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.endsWith(\"ReScript\", \"Script\") == true\nJs.String2.endsWith(\"C++\", \"Script\") == false\n```" - ], - "signature": "let endsWith: (t, t) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.endsWithFrom", - "kind": "value", - "name": "endsWithFrom", - "docstrings": [ - "`endsWithFrom(str, ending, len)` returns `true` if the first len characters of\n`str` end with `ending`, `false` otherwise. If `len` is greater than or equal\nto the length of `str`, then it works like `endsWith`. (Honestly, this should\nhave been named endsWithAt, but oh well).\n\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.endsWithFrom(\"abcd\", \"cd\", 4) == true\nJs.String2.endsWithFrom(\"abcde\", \"cd\", 3) == false\nJs.String2.endsWithFrom(\"abcde\", \"cde\", 99) == true\nJs.String2.endsWithFrom(\"example.dat\", \"ple\", 7) == true\n```" - ], - "signature": "let endsWithFrom: (t, t, int) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "ES2015: `includes(str, searchValue)` returns `true` if `searchValue` is found\nanywhere within `str`, false otherwise.\n\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.includes(\"programmer\", \"gram\") == true\nJs.String2.includes(\"programmer\", \"er\") == true\nJs.String2.includes(\"programmer\", \"pro\") == true\nJs.String2.includes(\"programmer.dat\", \"xyz\") == false\n```" - ], - "signature": "let includes: (t, t) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.includesFrom", - "kind": "value", - "name": "includesFrom", - "docstrings": [ - "ES2015: `includes(str, searchValue start)` returns `true` if `searchValue` is\nfound anywhere within `str` starting at character number `start` (where 0 is\nthe first character), `false` otherwise.\n\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.includesFrom(\"programmer\", \"gram\", 1) == true\nJs.String2.includesFrom(\"programmer\", \"gram\", 4) == false\nJs.String2.includesFrom(`대한민국`, `한`, 1) == true\n```" - ], - "signature": "let includesFrom: (t, t, int) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "ES2015: `indexOf(str, searchValue)` returns the position at which `searchValue`\nwas first found within `str`, or -1 if `searchValue` is not in `str`.\n\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.indexOf(\"bookseller\", \"ok\") == 2\nJs.String2.indexOf(\"bookseller\", \"sell\") == 4\nJs.String2.indexOf(\"beekeeper\", \"ee\") == 1\nJs.String2.indexOf(\"bookseller\", \"xyz\") == -1\n```" - ], - "signature": "let indexOf: (t, t) => int", - "deprecated": "" - }, - { - "id": "Js.String2.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "`indexOfFrom(str, searchValue, start)` returns the position at which\n`searchValue` was found within `str` starting at character position `start`, or\n\\-1 if `searchValue` is not found in that portion of `str`. The return value is\nrelative to the beginning of the string, no matter where the search started\nfrom.\n\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.indexOfFrom(\"bookseller\", \"ok\", 1) == 2\nJs.String2.indexOfFrom(\"bookseller\", \"sell\", 2) == 4\nJs.String2.indexOfFrom(\"bookseller\", \"sell\", 5) == -1\n```" - ], - "signature": "let indexOfFrom: (t, t, int) => int", - "deprecated": "" - }, - { - "id": "Js.String2.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(str, searchValue)` returns the position of the last occurrence of\n`searchValue` within `str`, searching backwards from the end of the string.\nReturns -1 if `searchValue` is not in `str`. The return value is always\nrelative to the beginning of the string.\n\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.lastIndexOf(\"bookseller\", \"ok\") == 2\nJs.String2.lastIndexOf(\"beekeeper\", \"ee\") == 4\nJs.String2.lastIndexOf(\"abcdefg\", \"xyz\") == -1\n```" - ], - "signature": "let lastIndexOf: (t, t) => int", - "deprecated": "" - }, - { - "id": "Js.String2.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "`lastIndexOfFrom(str, searchValue, start)` returns the position of the last\noccurrence of `searchValue` within `str`, searching backwards from the given\nstart position. Returns -1 if `searchValue` is not in `str`. The return value\nis always relative to the beginning of the string.\n\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.lastIndexOfFrom(\"bookseller\", \"ok\", 6) == 2\nJs.String2.lastIndexOfFrom(\"beekeeper\", \"ee\", 8) == 4\nJs.String2.lastIndexOfFrom(\"beekeeper\", \"ee\", 3) == 1\nJs.String2.lastIndexOfFrom(\"abcdefg\", \"xyz\", 4) == -1\n```" - ], - "signature": "let lastIndexOfFrom: (t, t, int) => int", - "deprecated": "" - }, - { - "id": "Js.String2.localeCompare", - "kind": "value", - "name": "localeCompare", - "docstrings": [ - "`localeCompare(reference, comparison)` returns\n- a negative value if reference comes before comparison in sort order\n- zero if reference and comparison have the same sort order\n- a positive value if reference comes after comparison in sort order\n\nSee [`String.localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.localeCompare(\"zebra\", \"ant\") > 0.0\nJs.String2.localeCompare(\"ant\", \"zebra\") < 0.0\nJs.String2.localeCompare(\"cat\", \"cat\") == 0.0\nJs.String2.localeCompare(\"CAT\", \"cat\") > 0.0\n```" - ], - "signature": "let localeCompare: (t, t) => float", - "deprecated": "" - }, - { - "id": "Js.String2.match_", - "kind": "value", - "name": "match_", - "docstrings": [ - "`match(str, regexp)` matches a `string` against the given `regexp`. If there is\nno match, it returns `None`. For regular expressions without the g modifier, if\nthere is a match, the return value is `Some(array)` where the array contains:\n- The entire matched string\n- Any capture groups if the regexp had parentheses\n For regular expressions with the g modifier, a matched expression returns\n `Some(array)` with all the matched substrings and no capture groups.\n\nSee [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.match_(\"The better bats\", /b[aeiou]t/) == Some([\"bet\"])\nJs.String2.match_(\"The better bats\", /b[aeiou]t/g) == Some([\"bet\", \"bat\"])\nJs.String2.match_(\"Today is 2018-04-05.\", /(\\d+)-(\\d+)-(\\d+)/) ==\n Some([\"2018-04-05\", \"2018\", \"04\", \"05\"])\nJs.String2.match_(\"The large container.\", /b[aeiou]g/) == None\n```" - ], - "signature": "let match_: (t, Js_re.t) => option>>", - "deprecated": "" - }, - { - "id": "Js.String2.normalize", - "kind": "value", - "name": "normalize", - "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\u00e3 or the combination of a lower case letter A\n\\u0061 and a combining tilde \\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)\non MDN. See also [Unicode technical report\n#15](https://unicode.org/reports/tr15/) for details." - ], - "signature": "let normalize: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.normalizeByForm", - "kind": "value", - "name": "normalizeByForm", - "docstrings": [ - "ES2015: `normalize(str, form)` returns the normalized Unicode string using the\nspecified form of normalization, which may be one of:\n- \"NFC\" — Normalization Form Canonical Composition.\n- \"NFD\" — Normalization Form Canonical Decomposition.\n- \"NFKC\" — Normalization Form Compatibility Composition.\n- \"NFKD\" — Normalization Form Compatibility Decomposition.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\nSee also [Unicode technical report #15](https://unicode.org/reports/tr15/) for details." - ], - "signature": "let normalizeByForm: (t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.repeat", - "kind": "value", - "name": "repeat", - "docstrings": [ - "`repeat(str, n)` returns a `string` that consists of `n` repetitions of `str`.\nThrows `RangeError` if `n` is negative.\n\nSee [`String.repeat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.repeat(\"ha\", 3) == \"hahaha\"\nJs.String2.repeat(\"empty\", 0) == \"\"\n```" - ], - "signature": "let repeat: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.replace", - "kind": "value", - "name": "replace", - "docstrings": [ - "ES2015: `replace(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with the first matching instance of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.replace(\"old string\", \"old\", \"new\") == \"new string\"\nJs.String2.replace(\"the cat and the dog\", \"the\", \"this\") == \"this cat and the dog\"\n```" - ], - "signature": "let replace: (t, t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.replaceByRe", - "kind": "value", - "name": "replaceByRe", - "docstrings": [ - "`replaceByRe(str, regex, replacement)` returns a new `string` where occurrences\nmatching regex have been replaced by `replacement`.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.replaceByRe(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nJs.String2.replaceByRe(\"Juan Fulano\", /(\\w+) (\\w+)/, \"$2, $1\") == \"Fulano, Juan\"\n```" - ], - "signature": "let replaceByRe: (t, Js_re.t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy0", - "kind": "value", - "name": "unsafeReplaceBy0", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with no capturing\nparentheses replaced by the value returned from the given function. The\nfunction receives as its parameters the matched string, the offset at which the\nmatch begins, and the whole string being matched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (matchPart, _offset, _wholeString) => Js.String2.toUpperCase(matchPart)\n\nJs.String2.unsafeReplaceBy0(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" - ], - "signature": "let unsafeReplaceBy0: (t, Js_re.t, (t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy1", - "kind": "value", - "name": "unsafeReplaceBy1", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with one set of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstring, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (_match, part1, _offset, _wholeString) => {\n part1 ++ \"41\"\n}\n\nJs.String2.unsafeReplaceBy1(str, re, matchFn) == \"Jony is 41\"\n```" - ], - "signature": "let unsafeReplaceBy1: (t, Js_re.t, (t, t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy2", - "kind": "value", - "name": "unsafeReplaceBy2", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with two sets of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstrings, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (_match, p1, p2, _offset, _wholeString) => {\n switch (Belt.Int.fromString(p1), Belt.Int.fromString(p2)) {\n | (Some(x), Some(y)) => Belt.Int.toString(x * y)\n | _ => \"???\"\n }\n}\n\nJs.String2.unsafeReplaceBy2(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let unsafeReplaceBy2: (t, Js_re.t, (t, t, t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy3", - "kind": "value", - "name": "unsafeReplaceBy3", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with three sets of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstrings, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN." - ], - "signature": "let unsafeReplaceBy3: (t, Js_re.t, (t, t, t, t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.search", - "kind": "value", - "name": "search", - "docstrings": [ - "`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\n\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.search(\"testing 1 2 3\", /\\d+/) == 8\nJs.String2.search(\"no numbers\", /\\d+/) == -1\n```" - ], - "signature": "let search: (t, Js_re.t) => int", - "deprecated": "" - }, - { - "id": "Js.String2.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(str, from:n1, to_:n2)` returns the substring of `str` starting at\ncharacter `n1` up to but not including `n2`.\n- If either `n1` or `n2` is negative, then it is evaluated as `length(str - n1)` or `length(str - n2)`.\n- If `n2` is greater than the length of `str`, then it is treated as `length(str)`.\n- If `n1` is greater than `n2`, slice returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=5) == \"cde\"\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=9) == \"cdefg\"\nJs.String2.slice(\"abcdefg\", ~from=-4, ~to_=-2) == \"de\"\nJs.String2.slice(\"abcdefg\", ~from=5, ~to_=1) == \"\"\n```" - ], - "signature": "let slice: (t, ~from: int, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(str, from:n)` returns the substring of `str` starting at character\n`n` to the end of the string.\n- If `n` is negative, then it is evaluated as `length(str - n)`.\n- If `n` is greater than the length of `str`, then sliceToEnd returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.sliceToEnd(\"abcdefg\", ~from=4) == \"efg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=-2) == \"fg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=7) == \"\"\n```" - ], - "signature": "let sliceToEnd: (t, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nJs.String2.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nJs.String2.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nJs.String2.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```" - ], - "signature": "let split: (t, t) => array", - "deprecated": "" - }, - { - "id": "Js.String2.splitAtMost", - "kind": "value", - "name": "splitAtMost", - "docstrings": [ - "`splitAtMost delimiter ~limit: n str` splits the given `str` at every occurrence of `delimiter` and returns an array of the first `n` resulting substrings. If `n` is negative or greater than the number of substrings, the array will contain all the substrings.\n\n```\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 3 = [|\"ant\"; \"bee\"; \"cat\"|];;\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 0 = [| |];;\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 9 = [|\"ant\"; \"bee\"; \"cat\"; \"dog\"; \"elk\"|];;\n```" - ], - "signature": "let splitAtMost: (t, t, ~limit: int) => array", - "deprecated": "" - }, - { - "id": "Js.String2.splitByRe", - "kind": "value", - "name": "splitByRe", - "docstrings": [ - "`splitByRe(str, regex)` splits the given `str` at every occurrence of `regex`\nand returns an array of the resulting substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.splitByRe(\"art; bed , cog ;dad\", /\\s*[,;]\\s*TODO/) == [\n Some(\"art\"),\n Some(\"bed\"),\n Some(\"cog\"),\n Some(\"dad\"),\n ]\n```" - ], - "signature": "let splitByRe: (t, Js_re.t) => array>", - "deprecated": "" - }, - { - "id": "Js.String2.splitByReAtMost", - "kind": "value", - "name": "splitByReAtMost", - "docstrings": [ - "`splitByReAtMost(str, regex, ~limit:n)` splits the given `str` at every\noccurrence of `regex` and returns an array of the first `n` resulting\nsubstrings. If `n` is negative or greater than the number of substrings, the\narray will contain all the substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=3) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n ]\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=0) == []\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=8) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n Some(\"four\"),\n ]\n```" - ], - "signature": "let splitByReAtMost: (t, Js_re.t, ~limit: int) => array>", - "deprecated": "" - }, - { - "id": "Js.String2.startsWith", - "kind": "value", - "name": "startsWith", - "docstrings": [ - "ES2015: `startsWith(str, substr)` returns `true` if the `str` starts with\n`substr`, `false` otherwise.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWith(\"ReScript\", \"Re\") == true\nJs.String2.startsWith(\"ReScript\", \"\") == true\nJs.String2.startsWith(\"JavaScript\", \"Re\") == false\n```" - ], - "signature": "let startsWith: (t, t) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.startsWithFrom", - "kind": "value", - "name": "startsWithFrom", - "docstrings": [ - "ES2015: `startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, false otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWithFrom(\"ReScript\", \"Scri\", 2) == true\nJs.String2.startsWithFrom(\"ReScript\", \"\", 2) == true\nJs.String2.startsWithFrom(\"JavaScript\", \"Scri\", 2) == false\n```" - ], - "signature": "let startsWithFrom: (t, t, int) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.substr", - "kind": "value", - "name": "substr", - "docstrings": [ - "`substr(str, ~from:n)` returns the substring of `str` from position `n` to the\nend of the string.\n- If `n` is less than zero, the starting position is the length of `str - n`.\n- If `n` is greater than or equal to the length of `str`, returns the empty string.\n\nJavaScript’s `String.substr()` is a legacy function. When possible, use\n`substring()` instead.\n\nSee [`String.substr`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.substr(\"abcdefghij\", ~from=3) == \"defghij\"\nJs.String2.substr(\"abcdefghij\", ~from=-3) == \"hij\"\nJs.String2.substr(\"abcdefghij\", ~from=12) == \"\"\n```" - ], - "signature": "let substr: (t, ~from: int) => t", - "deprecated": "Use `String.substring` instead" - }, - { - "id": "Js.String2.substrAtMost", - "kind": "value", - "name": "substrAtMost", - "docstrings": [ - "`substrAtMost(str, ~from: pos, ~length: n)` returns the substring of `str` of\nlength `n` starting at position `pos`.\n- If `pos` is less than zero, the starting position is the length of `str - pos`.\n- If `pos` is greater than or equal to the length of `str`, returns the empty string.\n- If `n` is less than or equal to zero, returns the empty string.\n\nJavaScript’s `String.substr()` is a legacy function. When possible, use\n`substring()` instead.\n\nSee [`String.substr`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.substrAtMost(\"abcdefghij\", ~from=3, ~length=4) == \"defg\"\nJs.String2.substrAtMost(\"abcdefghij\", ~from=-3, ~length=4) == \"hij\"\nJs.String2.substrAtMost(\"abcdefghij\", ~from=12, ~length=2) == \"\"\n```" - ], - "signature": "let substrAtMost: (t, ~from: int, ~length: int) => t", - "deprecated": "Use `String.substringAtMost` instead" - }, - { - "id": "Js.String2.substring", - "kind": "value", - "name": "substring", - "docstrings": [ - "`substring(str, ~from: start, ~to_: finish)` returns characters `start` up to\nbut not including finish from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `finish` is zero or negative, the empty string is returned.\n- If `start` is greater than `finish`, the `start` and `finish` points are swapped.\n\nSee [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.substring(\"playground\", ~from=3, ~to_=6) == \"ygr\"\nJs.String2.substring(\"playground\", ~from=6, ~to_=3) == \"ygr\"\nJs.String2.substring(\"playground\", ~from=4, ~to_=12) == \"ground\"\n```" - ], - "signature": "let substring: (t, ~from: int, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.substringToEnd", - "kind": "value", - "name": "substringToEnd", - "docstrings": [ - "`substringToEnd(str, ~from: start)` returns the substring of `str` from\nposition `start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string is returned.\n\nSee [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.substringToEnd(\"playground\", ~from=4) == \"ground\"\nJs.String2.substringToEnd(\"playground\", ~from=-3) == \"playground\"\nJs.String2.substringToEnd(\"playground\", ~from=12) == \"\"\n```" - ], - "signature": "let substringToEnd: (t, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.toLowerCase", - "kind": "value", - "name": "toLowerCase", - "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms; one when it is the last\ncharacter in a string and another when it is not.\n\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.toLowerCase(\"ABC\") == \"abc\"\nJs.String2.toLowerCase(`ΣΠ`) == `σπ`\nJs.String2.toLowerCase(`ΠΣ`) == `πς`\n```" - ], - "signature": "let toLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.toLocaleLowerCase", - "kind": "value", - "name": "toLocaleLowerCase", - "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase)\non MDN." - ], - "signature": "let toLocaleLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.toUpperCase", - "kind": "value", - "name": "toUpperCase", - "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result; for example the German ß\ncapitalizes to two Ses in a row.\n\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.toUpperCase(\"abc\") == \"ABC\"\nJs.String2.toUpperCase(`Straße`) == `STRASSE`\nJs.String2.toUpperCase(`πς`) == `ΠΣ`\n```" - ], - "signature": "let toUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.toLocaleUpperCase", - "kind": "value", - "name": "toLocaleUpperCase", - "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\nSee [`String.to:LocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\non MDN." - ], - "signature": "let toLocaleUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.trim", - "kind": "value", - "name": "trim", - "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\n\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.trim(\" abc def \") == \"abc def\"\nJs.String2.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" - ], - "signature": "let trim: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.anchor", - "kind": "value", - "name": "anchor", - "docstrings": [ - "`anchor(anchorText, anchorName)` creates a string with an HTML `` element\nwith name attribute of `anchorName` and `anchorText` as its content. Please do\nnot use this method, as it has been removed from the relevant web standards.\n\nSee [`String.anchor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/anchor)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.anchor(\"Page One\", \"page1\") == \"Page One\"\n```" - ], - "signature": "let anchor: (t, t) => t", - "deprecated": "This function has been removed from the relevant web standards." - }, - { - "id": "Js.String2.link", - "kind": "value", - "name": "link", - "docstrings": [ - "ES2015: `link(linkText, urlText)` creates a string with an HTML `` element\nwith href attribute of `urlText` and `linkText` as its content. Please do not\nuse this method, as it has been removed from the relevant web standards. See\n[`String.link`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/link)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.link(\"Go to page two\", \"page2.html\") == \"Go to page two\"\n```" - ], - "signature": "let link: (t, t) => t", - "deprecated": "This function has been removed from the relevant web standards." - }, - { - "id": "Js.String2.castToArrayLike", - "kind": "value", - "name": "castToArrayLike", - "docstrings": [ - "Casts its argument to an `array_like` entity that can be processed by functions\nsuch as `Js.Array2.fromMap()`\n\n## Examples\n\n```rescript\nlet s = \"abcde\"\nlet arr = Js.Array2.fromMap(Js.String2.castToArrayLike(s), x => x)\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let castToArrayLike: t => Js_array2.array_like", - "deprecated": "" - } - ] - }, - "js/string": { - "id": "Js.String", - "name": "String", - "docstrings": [ - "Provide bindings to JS string", - "JavaScript String API" - ], - "items": [ - { - "id": "Js.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = string", - "deprecated": "" - }, - { - "id": "Js.String.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nJs.String2.make(3.5) == \"3.5\"\nJs.String2.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCharCode", - "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to that number; `n` ranges from 0 to 65535.\nIf out of range, the lower 16 bits of the value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as `fromCharCode(0xF63A)`. See [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCharCode(65) == \"A\"\nJs.String2.fromCharCode(0x3c8) == `ψ`\nJs.String2.fromCharCode(0xd55c) == `한`\nJs.String2.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCharCodeMany", - "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`. See\n[`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)\non MDN." - ], - "signature": "let fromCharCodeMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCodePoint", - "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point. If the number is not a valid code point, it throws\n`RangeError`.Thus, `fromCodePoint(0x1F63A)` will produce a correct value,\nunlike `fromCharCode(0x1F63A)`, and `fromCodePoint(-5)` will throw a\n`RangeError`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePoint(65) == \"A\"\nJs.String2.fromCodePoint(0x3c8) == `ψ`\nJs.String2.fromCodePoint(0xd55c) == `한`\nJs.String2.fromCodePoint(0x1f63a) == `😺`\n```" - ], - "signature": "let fromCodePoint: int => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCodePointMany", - "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```" - ], - "signature": "let fromCodePointMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(s)` returns the length of the given `string`. See\n[`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.length(\"abcd\") == 4\n```" - ], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.String.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(s, n)` returns as a `string` the character at the given index number. If\n`n` is out of range, this function returns `undefined`, so at some point this\nfunction may be modified to return `option`.\n\n## Examples\n\n```rescript\nJs.String2.get(\"Reason\", 0) == \"R\"\nJs.String2.get(\"Reason\", 4) == \"o\"\nJs.String2.get(`Rẽasöń`, 5) == `ń`\n```" - ], - "signature": "let get: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String.charAt", - "kind": "value", - "name": "charAt", - "docstrings": [], - "signature": "let charAt: (int, t) => t" - }, - { - "id": "Js.String.charCodeAt", - "kind": "value", - "name": "charCodeAt", - "docstrings": [], - "signature": "let charCodeAt: (int, t) => float" - }, - { - "id": "Js.String.codePointAt", - "kind": "value", - "name": "codePointAt", - "docstrings": [], - "signature": "let codePointAt: (int, t) => option" - }, - { - "id": "Js.String.concat", - "kind": "value", - "name": "concat", - "docstrings": [], - "signature": "let concat: (t, t) => t" - }, - { - "id": "Js.String.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [], - "signature": "let concatMany: (array, t) => t" - }, - { - "id": "Js.String.endsWith", - "kind": "value", - "name": "endsWith", - "docstrings": [], - "signature": "let endsWith: (t, t) => bool" - }, - { - "id": "Js.String.endsWithFrom", - "kind": "value", - "name": "endsWithFrom", - "docstrings": [], - "signature": "let endsWithFrom: (t, int, t) => bool" - }, - { - "id": "Js.String.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, t) => bool" - }, - { - "id": "Js.String.includesFrom", - "kind": "value", - "name": "includesFrom", - "docstrings": [], - "signature": "let includesFrom: (t, int, t) => bool" - }, - { - "id": "Js.String.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, t) => int" - }, - { - "id": "Js.String.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, int, t) => int" - }, - { - "id": "Js.String.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, t) => int" - }, - { - "id": "Js.String.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, int, t) => int" - }, - { - "id": "Js.String.localeCompare", - "kind": "value", - "name": "localeCompare", - "docstrings": [], - "signature": "let localeCompare: (t, t) => float" - }, - { - "id": "Js.String.match_", - "kind": "value", - "name": "match_", - "docstrings": [], - "signature": "let match_: (Js_re.t, t) => option>>" - }, - { - "id": "Js.String.normalize", - "kind": "value", - "name": "normalize", - "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\u00e3 or the combination of a lower case letter A\n\\u0061 and a combining tilde \\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)\non MDN.\n\nSee also [Unicode technical report #15](https://unicode.org/reports/tr15/) for\ndetails." - ], - "signature": "let normalize: t => t", - "deprecated": "" - }, - { - "id": "Js.String.normalizeByForm", - "kind": "value", - "name": "normalizeByForm", - "docstrings": [], - "signature": "let normalizeByForm: (t, t) => t" - }, - { - "id": "Js.String.repeat", - "kind": "value", - "name": "repeat", - "docstrings": [], - "signature": "let repeat: (int, t) => t" - }, - { - "id": "Js.String.replace", - "kind": "value", - "name": "replace", - "docstrings": [], - "signature": "let replace: (t, t, t) => t" - }, - { - "id": "Js.String.replaceByRe", - "kind": "value", - "name": "replaceByRe", - "docstrings": [], - "signature": "let replaceByRe: (Js_re.t, t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy0", - "kind": "value", - "name": "unsafeReplaceBy0", - "docstrings": [], - "signature": "let unsafeReplaceBy0: (Js_re.t, (t, int, t) => t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy1", - "kind": "value", - "name": "unsafeReplaceBy1", - "docstrings": [], - "signature": "let unsafeReplaceBy1: (Js_re.t, (t, t, int, t) => t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy2", - "kind": "value", - "name": "unsafeReplaceBy2", - "docstrings": [], - "signature": "let unsafeReplaceBy2: (Js_re.t, (t, t, t, int, t) => t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy3", - "kind": "value", - "name": "unsafeReplaceBy3", - "docstrings": [], - "signature": "let unsafeReplaceBy3: (Js_re.t, (t, t, t, t, int, t) => t, t) => t" - }, - { - "id": "Js.String.search", - "kind": "value", - "name": "search", - "docstrings": [], - "signature": "let search: (Js_re.t, t) => int" - }, - { - "id": "Js.String.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~from: int, ~to_: int, t) => t" - }, - { - "id": "Js.String.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [], - "signature": "let sliceToEnd: (~from: int, t) => t" - }, - { - "id": "Js.String.split", - "kind": "value", - "name": "split", - "docstrings": [], - "signature": "let split: (t, t) => array" - }, - { - "id": "Js.String.splitAtMost", - "kind": "value", - "name": "splitAtMost", - "docstrings": [], - "signature": "let splitAtMost: (t, ~limit: int, t) => array" - }, - { - "id": "Js.String.splitByRe", - "kind": "value", - "name": "splitByRe", - "docstrings": [], - "signature": "let splitByRe: (Js_re.t, t) => array>" - }, - { - "id": "Js.String.splitByReAtMost", - "kind": "value", - "name": "splitByReAtMost", - "docstrings": [], - "signature": "let splitByReAtMost: (Js_re.t, ~limit: int, t) => array>" - }, - { - "id": "Js.String.startsWith", - "kind": "value", - "name": "startsWith", - "docstrings": [], - "signature": "let startsWith: (t, t) => bool" - }, - { - "id": "Js.String.startsWithFrom", - "kind": "value", - "name": "startsWithFrom", - "docstrings": [], - "signature": "let startsWithFrom: (t, int, t) => bool" - }, - { - "id": "Js.String.substr", - "kind": "value", - "name": "substr", - "docstrings": [], - "signature": "let substr: (~from: int, t) => t" - }, - { - "id": "Js.String.substrAtMost", - "kind": "value", - "name": "substrAtMost", - "docstrings": [], - "signature": "let substrAtMost: (~from: int, ~length: int, t) => t" - }, - { - "id": "Js.String.substring", - "kind": "value", - "name": "substring", - "docstrings": [], - "signature": "let substring: (~from: int, ~to_: int, t) => t" - }, - { - "id": "Js.String.substringToEnd", - "kind": "value", - "name": "substringToEnd", - "docstrings": [], - "signature": "let substringToEnd: (~from: int, t) => t" - }, - { - "id": "Js.String.toLowerCase", - "kind": "value", - "name": "toLowerCase", - "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms; one when it is the last\ncharacter in a string and another when it is not.\n\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.toLowerCase(\"ABC\") == \"abc\"\nJs.String.toLowerCase(`ΣΠ`) == `σπ`\nJs.String.toLowerCase(`ΠΣ`) == `πς`\n```" - ], - "signature": "let toLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.toLocaleLowerCase", - "kind": "value", - "name": "toLocaleLowerCase", - "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\n\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase)\non MDN." - ], - "signature": "let toLocaleLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.toUpperCase", - "kind": "value", - "name": "toUpperCase", - "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result; for example the German ß\ncapitalizes to two Ses in a row.\n\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.toUpperCase(\"abc\") == \"ABC\"\nJs.String.toUpperCase(`Straße`) == `STRASSE`\nJs.String.toUpperCase(`πς`) == `ΠΣ`\n```" - ], - "signature": "let toUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.toLocaleUpperCase", - "kind": "value", - "name": "toLocaleUpperCase", - "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\n\nSee [`String.to:LocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\non MDN." - ], - "signature": "let toLocaleUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.trim", - "kind": "value", - "name": "trim", - "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\n\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.trim(\" abc def \") == \"abc def\"\nJs.String.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" - ], - "signature": "let trim: t => t", - "deprecated": "" - }, - { - "id": "Js.String.anchor", - "kind": "value", - "name": "anchor", - "docstrings": [], - "signature": "let anchor: (t, t) => t" - }, - { - "id": "Js.String.link", - "kind": "value", - "name": "link", - "docstrings": [], - "signature": "let link: (t, t) => t" - }, - { - "id": "Js.String.castToArrayLike", - "kind": "value", - "name": "castToArrayLike", - "docstrings": [ - "Casts its argument to an `array_like` entity that can be processed by functions\nsuch as `Js.Array2.fromMap()`\n\n## Examples\n\n```rescript\nlet s = \"abcde\"\nlet arr = Js.Array2.fromMap(Js.String.castToArrayLike(s), x => x)\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let castToArrayLike: t => Js_array2.array_like", - "deprecated": "This has been deprecated and will be removed in v13. Use functions from the `String` module instead." - } - ] - }, - "js/array2": { - "id": "Js.Array2", - "name": "Array2", - "docstrings": [ - "Provide bindings to JS array", - "Provides bindings to JavaScript’s `Array` functions. These bindings are optimized for pipe-first (`->`), where the array to be processed is the first parameter in the function.\n\nHere is an example to find the sum of squares of all even numbers in an array.\nWithout pipe first, we must call the functions in reverse order:\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nlet square = x => x * x\nlet result = {\n open Js.Array2\n reduce(map(filter([5, 2, 3, 4, 1], isEven), square), \"+\", 0)\n}\n```\n\nWith pipe first, we call the functions in the “natural” order:\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nlet square = x => x * x\nlet result = {\n open Js.Array2\n [5, 2, 3, 4, 1]->filter(isEven)->map(square)->reduce(\"+\", 0)\n}\n```" - ], - "items": [ - { - "id": "Js.Array2.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type used to describe a JavaScript array." - ], - "signature": "type t<'a> = array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [ - "A type used to describe JavaScript objects that are like an array or are iterable." - ], - "signature": "type array_like<'a> = Array.arrayLike<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.from", - "kind": "value", - "name": "from", - "docstrings": [ - "Creates a shallow copy of an array from an array-like object. See\n[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\non MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nJs.Array2.from(strArr) == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let from: array_like<'a> => array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fromMap", - "kind": "value", - "name": "fromMap", - "docstrings": [ - "Creates a new array by applying a function (the second argument) to each item\nin the `array_like` first argument. See\n[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\non MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nlet code = s => Js.String.charCodeAt(0, s)\nJs.Array2.fromMap(strArr, code) == [97.0, 98.0, 99.0, 100.0]\n```" - ], - "signature": "let fromMap: (array_like<'a>, 'a => 'b) => array<'b>", - "deprecated": "" - }, - { - "id": "Js.Array2.isArray", - "kind": "value", - "name": "isArray", - "docstrings": [ - "Returns `true` if its argument is an array; `false` otherwise. This is a runtime check, which is why the second example returns `true`\\---a list is internally represented as a nested JavaScript array.\n\n## Examples\n\n```rescript\nJs.Array2.isArray([5, 2, 3, 1, 4]) == true\nJs.Array2.isArray(list{5, 2, 3, 1, 4}) == true\nJs.Array2.isArray(\"abcd\") == false\n```" - ], - "signature": "let isArray: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Returns the number of elements in the array. See\n[`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length)\non MDN." - ], - "signature": "let length: array<'a> => int", - "deprecated": "" - }, - { - "id": "Js.Array2.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [ - "Copies from the first element in the given array to the designated `~to_`\nposition, returning the resulting array. *This function modifies the original\narray.* See\n[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.copyWithin(arr, ~to_=2) == [100, 101, 100, 101, 102]\narr == [100, 101, 100, 101, 102]\n```" - ], - "signature": "let copyWithin: (t<'a>, ~to_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [ - "Copies starting at element `~from` in the given array to the designated `~to_`\nposition, returning the resulting array. *This function modifies the original\narray.* See\n[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.copyWithinFrom(arr, ~from=2, ~to_=0) == [102, 103, 104, 103, 104]\narr == [102, 103, 104, 103, 104]\n```" - ], - "signature": "let copyWithinFrom: (t<'a>, ~to_: int, ~from: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [ - "Copies starting at element `~start` in the given array up to but not including\n`~end_` to the designated `~to_` position, returning the resulting array. *This\nfunction modifies the original array.* See\n[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105]\nJs.Array2.copyWithinFromRange(arr, ~start=2, ~end_=5, ~to_=1) == [100, 102, 103, 104, 104, 105]\narr == [100, 102, 103, 104, 104, 105]\n```" - ], - "signature": "let copyWithinFromRange: (t<'a>, ~to_: int, ~start: int, ~end_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [ - "Sets all elements of the given array (the first arumgent) to the designated\nvalue (the secon argument), returning the resulting array. *This function\nmodifies the original array.*\n\nSee\n[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.fillInPlace(arr, 99) == [99, 99, 99, 99, 99]\narr == [99, 99, 99, 99, 99]\n```" - ], - "signature": "let fillInPlace: (t<'a>, 'a) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [ - "Sets all elements of the given array (the first arumgent) from position `~from`\nto the end to the designated value (the second argument), returning the\nresulting array. *This function modifies the original array.* See\n[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.fillFromInPlace(arr, 99, ~from=2) == [100, 101, 99, 99, 99]\narr == [100, 101, 99, 99, 99]\n```" - ], - "signature": "let fillFromInPlace: (t<'a>, 'a, ~from: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [ - "Sets the elements of the given array (the first arumgent) from position\n`~start` up to but not including position `~end_` to the designated value (the\nsecond argument), returning the resulting array. *This function modifies the\noriginal array.* See\n[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.fillRangeInPlace(arr, 99, ~start=1, ~end_=4) == [100, 99, 99, 99, 104]\narr == [100, 99, 99, 99, 104]\n```" - ], - "signature": "let fillRangeInPlace: (t<'a>, 'a, ~start: int, ~end_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "If the array is not empty, removes the last element and returns it as\n`Some(value)`; returns `None` if the array is empty. *This function modifies\nthe original array.* See\n[`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.pop(arr) == Some(104)\narr == [100, 101, 102, 103]\n\nlet empty: array = []\nJs.Array2.pop(empty) == None\n```" - ], - "signature": "let pop: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.push", - "kind": "value", - "name": "push", - "docstrings": [ - "Appends the given value to the array, returning the number of elements in the\nupdated array. *This function modifies the original array.* See\n[`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array2.push(arr, \"dog\") == 4\narr == [\"ant\", \"bee\", \"cat\", \"dog\"]\n```" - ], - "signature": "let push: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.pushMany", - "kind": "value", - "name": "pushMany", - "docstrings": [ - "Appends the values from one array (the second argument) to another (the first\nargument), returning the number of elements in the updated array. *This\nfunction modifies the original array.* See\n[`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array2.pushMany(arr, [\"dog\", \"elk\"]) == 5\narr == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```" - ], - "signature": "let pushMany: (t<'a>, array<'a>) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [ - "Returns an array with the elements of the input array in reverse order. *This\nfunction modifies the original array.* See\n[`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array2.reverseInPlace(arr) == [\"cat\", \"bee\", \"ant\"]\narr == [\"cat\", \"bee\", \"ant\"]\n```" - ], - "signature": "let reverseInPlace: t<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.shift", - "kind": "value", - "name": "shift", - "docstrings": [ - "If the array is not empty, removes the first element and returns it as\n`Some(value)`; returns `None` if the array is empty. *This function modifies\nthe original array.* See\n[`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.shift(arr) == Some(100)\narr == [101, 102, 103, 104]\n\nlet empty: array = []\nJs.Array2.shift(empty) == None\n```" - ], - "signature": "let shift: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [ - "Sorts the given array in place and returns the sorted array. JavaScript sorts\nthe array by converting the arguments to UTF-16 strings and sorting them. See\nthe second example with sorting numbers, which does not do a numeric sort.\n*This function modifies the original array.* See\n[`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\non MDN.\n\n## Examples\n\n```rescript\nlet words = [\"bee\", \"dog\", \"ant\", \"cat\"]\nJs.Array2.sortInPlace(words) == [\"ant\", \"bee\", \"cat\", \"dog\"]\nwords == [\"ant\", \"bee\", \"cat\", \"dog\"]\n\nlet numbers = [3, 30, 10, 1, 20, 2]\nJs.Array2.sortInPlace(numbers) == [1, 10, 2, 20, 3, 30]\nnumbers == [1, 10, 2, 20, 3, 30]\n```" - ], - "signature": "let sortInPlace: t<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [ - "Sorts the given array in place and returns the sorted array. *This function\nmodifies the original array.*\n\nThe first argument to `sortInPlaceWith()` is a function that compares two items\nfrom the array and returns:\n\n* an integer less than zero if the first item is less than the second item \\*\n zero if the items are equal \\* an integer greater than zero if the first item is\n greater than the second item\n\nSee\n[`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\non MDN.\n\n## Examples\n\n```rescript\n// sort by word length\nlet words = [\"horse\", \"aardvark\", \"dog\", \"camel\"]\nlet byLength = (s1, s2) => Js.String.length(s1) - Js.String.length(s2)\n\nJs.Array2.sortInPlaceWith(words, byLength) == [\"dog\", \"horse\", \"camel\", \"aardvark\"]\n\n// sort in reverse numeric order\nlet numbers = [3, 30, 10, 1, 20, 2]\nlet reverseNumeric = (n1, n2) => n2 - n1\nJs.Array2.sortInPlaceWith(numbers, reverseNumeric) == [30, 20, 10, 3, 2, 1]\n```" - ], - "signature": "let sortInPlaceWith: (t<'a>, ('a, 'a) => int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.spliceInPlace", - "kind": "value", - "name": "spliceInPlace", - "docstrings": [ - "Starting at position `~pos`, remove `~remove` elements and then add the\nelements from the `~add` array. Returns an array consisting of the removed\nitems. *This function modifies the original array.* See\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.spliceInPlace(arr, ~pos=2, ~remove=2, ~add=[\"x\", \"y\", \"z\"]) == [\"c\", \"d\"]\narr == [\"a\", \"b\", \"x\", \"y\", \"z\", \"e\", \"f\"]\n\nlet arr2 = [\"a\", \"b\", \"c\", \"d\"]\nJs.Array2.spliceInPlace(arr2, ~pos=3, ~remove=0, ~add=[\"x\", \"y\"]) == []\narr2 == [\"a\", \"b\", \"c\", \"x\", \"y\", \"d\"]\n\nlet arr3 = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.spliceInPlace(arr3, ~pos=9, ~remove=2, ~add=[\"x\", \"y\", \"z\"]) == []\narr3 == [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"x\", \"y\", \"z\"]\n```" - ], - "signature": "let spliceInPlace: (t<'a>, ~pos: int, ~remove: int, ~add: array<'a>) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.removeFromInPlace", - "kind": "value", - "name": "removeFromInPlace", - "docstrings": [ - "Removes elements from the given array starting at position `~pos` to the end of\nthe array, returning the removed elements. *This function modifies the original\narray.* See\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.removeFromInPlace(arr, ~pos=4) == [\"e\", \"f\"]\narr == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let removeFromInPlace: (t<'a>, ~pos: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.removeCountInPlace", - "kind": "value", - "name": "removeCountInPlace", - "docstrings": [ - "Removes `~count` elements from the given array starting at position `~pos`,\nreturning the removed elements. *This function modifies the original array.*\nSee\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.removeCountInPlace(arr, ~pos=2, ~count=3) == [\"c\", \"d\", \"e\"]\narr == [\"a\", \"b\", \"f\"]\n```" - ], - "signature": "let removeCountInPlace: (t<'a>, ~pos: int, ~count: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.unshift", - "kind": "value", - "name": "unshift", - "docstrings": [ - "Adds the given element to the array, returning the new number of elements in\nthe array. *This function modifies the original array.* See\n[`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"b\", \"c\", \"d\"]\nJs.Array2.unshift(arr, \"a\") == 4\narr == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let unshift: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.unshiftMany", - "kind": "value", - "name": "unshiftMany", - "docstrings": [ - "Adds the elements in the second array argument at the beginning of the first\narray argument, returning the new number of elements in the array. *This\nfunction modifies the original array.* See\n[`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"d\", \"e\"]\nJs.Array2.unshiftMany(arr, [\"a\", \"b\", \"c\"]) == 5\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let unshiftMany: (t<'a>, array<'a>) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.append", - "kind": "value", - "name": "append", - "docstrings": [], - "signature": "let append: (t<'a>, 'a) => t<'a>", - "deprecated": "`append` is not type-safe. Use `concat` instead." - }, - { - "id": "Js.Array2.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "Concatenates the second array argument to the first array argument, returning a\nnew array. The original arrays are not modified. See\n[`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.concat([\"a\", \"b\"], [\"c\", \"d\", \"e\"]) == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "The second argument to `concatMany()` is an array of arrays; these are added at\nthe end of the first argument, returning a new array. See\n[`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.concatMany([\"a\", \"b\", \"c\"], [[\"d\", \"e\"], [\"f\", \"g\", \"h\"]]) == [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n ]\n```" - ], - "signature": "let concatMany: (t<'a>, array>) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "Returns true if the given value is in the array, `false` otherwise. See\n[`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.includes([\"a\", \"b\", \"c\"], \"b\") == true\nJs.Array2.includes([\"a\", \"b\", \"c\"], \"x\") == false\n```" - ], - "signature": "let includes: (t<'a>, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "Returns the index of the first element in the array that has the given value.\nIf the value is not in the array, returns -1. See\n[`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.indexOf([100, 101, 102, 103], 102) == 2\nJs.Array2.indexOf([100, 101, 102, 103], 999) == -1\n```" - ], - "signature": "let indexOf: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "Returns the index of the first element in the array with the given value. The\nsearch starts at position `~from`. See\n[`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.indexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\"], \"a\", ~from=2) == 2\nJs.Array2.indexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\"], \"a\", ~from=3) == 4\nJs.Array2.indexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\"], \"b\", ~from=2) == -1\n```" - ], - "signature": "let indexOfFrom: (t<'a>, 'a, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "This function converts each element of the array to a string (via JavaScript)\nand concatenates them, separated by the string given in the first argument,\ninto a single string. See\n[`Array.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.joinWith([\"ant\", \"bee\", \"cat\"], \"--\") == \"ant--bee--cat\"\nJs.Array2.joinWith([\"door\", \"bell\"], \"\") == \"doorbell\"\nJs.Array2.joinWith([2020, 9, 4], \"/\") == \"2020/9/4\"\nJs.Array2.joinWith([2.5, 3.6, 3e-2], \";\") == \"2.5;3.6;0.03\"\n```" - ], - "signature": "let joinWith: (t<'a>, string) => string", - "deprecated": "" - }, - { - "id": "Js.Array2.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "Returns the index of the last element in the array that has the given value. If\nthe value is not in the array, returns -1. See\n[`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.lastIndexOf([\"a\", \"b\", \"a\", \"c\"], \"a\") == 2\nJs.Array2.lastIndexOf([\"a\", \"b\", \"a\", \"c\"], \"x\") == -1\n```" - ], - "signature": "let lastIndexOf: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "Returns the index of the last element in the array that has the given value,\nsearching from position `~from` down to the start of the array. If the value is\nnot in the array, returns -1. See\n[`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.lastIndexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\", \"d\"], \"a\", ~from=3) == 2\nJs.Array2.lastIndexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\", \"d\"], \"c\", ~from=2) == -1\n```" - ], - "signature": "let lastIndexOfFrom: (t<'a>, 'a, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "Returns a shallow copy of the given array from the `~start` index up to but not\nincluding the `~end_` position. Negative numbers indicate an offset from the\nend of the array. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105, 106]\nJs.Array2.slice(arr, ~start=2, ~end_=5) == [102, 103, 104]\nJs.Array2.slice(arr, ~start=-3, ~end_=-1) == [104, 105]\nJs.Array2.slice(arr, ~start=9, ~end_=10) == []\n```" - ], - "signature": "let slice: (t<'a>, ~start: int, ~end_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Returns a copy of the entire array. Same as `Js.Array2.Slice(arr, ~start=0,\n~end_=Js.Array2.length(arr))`. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." - ], - "signature": "let copy: t<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [ - "Returns a shallow copy of the given array from the given index to the end. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." - ], - "signature": "let sliceFrom: (t<'a>, int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts the array to a string. Each element is converted to a string using\nJavaScript. Unlike the JavaScript `Array.toString()`, all elements in a\nReasonML array must have the same type. See\n[`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.toString([3.5, 4.6, 7.8]) == \"3.5,4.6,7.8\"\nJs.Array2.toString([\"a\", \"b\", \"c\"]) == \"a,b,c\"\n```" - ], - "signature": "let toString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array2.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Converts the array to a string using the conventions of the current locale.\nEach element is converted to a string using JavaScript. Unlike the JavaScript\n`Array.toLocaleString()`, all elements in a ReasonML array must have the same\ntype. See\n[`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.toLocaleString([Js.Date.make()])\n// returns \"3/19/2020, 10:52:11 AM\" for locale en_US.utf8\n// returns \"2020-3-19 10:52:11\" for locale de_DE.utf8\n```" - ], - "signature": "let toLocaleString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array2.every", - "kind": "value", - "name": "every", - "docstrings": [ - "The first argument to `every()` is an array. The second argument is a predicate\nfunction that returns a boolean. The `every()` function returns `true` if the\npredicate function is true for all items in the given array. If given an empty\narray, returns `true`. See\n[`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every)\non MDN.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nJs.Array2.every([6, 22, 8, 4], isEven) == true\nJs.Array2.every([6, 22, 7, 4], isEven) == false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [ - "The first argument to `everyi()` is an array. The second argument is a\npredicate function with two arguments: an array element and that element’s\nindex; it returns a boolean. The `everyi()` function returns `true` if the\npredicate function is true for all items in the given array. If given an empty\narray, returns `true`. See\n[`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every)\non MDN.\n\n## Examples\n\n```rescript\n// determine if all even-index items are positive\nlet evenIndexPositive = (item, index) => mod(index, 2) == 0 ? item > 0 : true\n\nJs.Array2.everyi([6, -3, 5, 8], evenIndexPositive) == true\nJs.Array2.everyi([6, 3, -5, 8], evenIndexPositive) == false\n```" - ], - "signature": "let everyi: (t<'a>, ('a, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "Applies the given predicate function (the second argument) to each element in\nthe array; the result is an array of those elements for which the predicate\nfunction returned `true`. See\n[`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\non MDN.\n\n## Examples\n\n```rescript\nlet nonEmpty = s => s != \"\"\nJs.Array2.filter([\"abc\", \"\", \"\", \"def\", \"ghi\"], nonEmpty) == [\"abc\", \"def\", \"ghi\"]\n```" - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [ - "Each element of the given array are passed to the predicate function. The\nreturn value is an array of all those elements for which the predicate function\nreturned `true`.\n\nSee\n[`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\non MDN.\n\n## Examples\n\n```rescript\n// keep only positive elements at odd indices\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array2.filteri([6, 3, 5, 8, 7, -4, 1], positiveOddElement) == [3, 8]\n```" - ], - "signature": "let filteri: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.find", - "kind": "value", - "name": "find", - "docstrings": [ - "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find first negative element\nJs.Array2.find([33, 22, -55, 77, -44], x => x < 0) == Some(-55)\nJs.Array2.find([33, 22, 55, 77, 44], x => x < 0) == None\n```" - ], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.findi", - "kind": "value", - "name": "findi", - "docstrings": [ - "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate. The\npredicate function takes an array element and an index as its parameters. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find first positive item at an odd index\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array2.findi([66, -33, 55, 88, 22], positiveOddElement) == Some(88)\nJs.Array2.findi([66, -33, 55, -88, 22], positiveOddElement) == None\n```" - ], - "signature": "let findi: (t<'a>, ('a, int) => bool) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [ - "Returns the index of the first element in the array that satisifies the given\npredicate function, or -1 if no element satisifies the predicate. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.findIndex([33, 22, -55, 77, -44], x => x < 0) == 2\nJs.Array2.findIndex([33, 22, 55, 77, 44], x => x < 0) == -1\n```" - ], - "signature": "let findIndex: (t<'a>, 'a => bool) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [ - "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate. The\npredicate function takes an array element and an index as its parameters. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find index of first positive item at an odd index\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array2.findIndexi([66, -33, 55, 88, 22], positiveOddElement) == 3\nJs.Array2.findIndexi([66, -33, 55, -88, 22], positiveOddElement) == -1\n```" - ], - "signature": "let findIndexi: (t<'a>, ('a, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "The `forEach()` function applies the function given as the second argument to\neach element in the array. The function you provide returns `unit`, and the\n`forEach()` function also returns `unit`. You use `forEach()` when you need to\nprocess each element in the array but not return any new array or value; for\nexample, to print the items in an array. See\n[`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\non MDN.\n\n## Examples\n\n```rescript\n// display all elements in an array\nJs.Array2.forEach([\"a\", \"b\", \"c\"], x => Js.log(x)) == ()\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Array2.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [ - "The `forEachi()` function applies the function given as the second argument to\neach element in the array. The function you provide takes an item in the array\nand its index number, and returns `unit`. The `forEachi()` function also\nreturns `unit`. You use `forEachi()` when you need to process each element in\nthe array but not return any new array or value; for example, to print the\nitems in an array. See\n[`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\non MDN.\n\n## Examples\n\n```rescript\n// display all elements in an array as a numbered list\nJs.Array2.forEachi([\"a\", \"b\", \"c\"], (item, index) => Js.log2(index + 1, item)) == ()\n```" - ], - "signature": "let forEachi: (t<'a>, ('a, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Array2.map", - "kind": "value", - "name": "map", - "docstrings": [ - "Applies the function (the second argument) to each item in the array, returning\na new array. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]\nJs.Array2.map([\"animal\", \"vegetable\", \"mineral\"], Js.String.length) == [6, 9, 7]\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Array2.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [ - "Applies the function (the second argument) to each item in the array, returning\na new array. The function acceps two arguments: an item from the array and its\nindex number. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array2.mapi([10, 11, 12], product) == [0, 11, 24]\n```" - ], - "signature": "let mapi: (t<'a>, ('a, int) => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Array2.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "The `reduce()` function takes three parameters: an array, a *reducer function*,\nand a beginning accumulator value. The reducer function has two parameters: an\naccumulated value and an element of the array.\n\n`reduce()` first calls the reducer function with the beginning value and the\nfirst element in the array. The result becomes the new accumulator value, which\nis passed in to the reducer function along with the second element in the\narray. `reduce()` proceeds through the array, passing in the result of each\nstage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduce()`. See\n[`Array.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\non MDN.\n\n## Examples\n\n```rescript\nlet sumOfSquares = (accumulator, item) => accumulator + item * item\n\nJs.Array2.reduce([10, 2, 4], sumOfSquares, 0) == 120\nJs.Array2.reduce([10, 2, 4], \"*\", 1) == 80\nJs.Array2.reduce(\n [\"animal\", \"vegetable\", \"mineral\"],\n (acc, item) => acc + Js.String.length(item),\n 0,\n) == 22 // 6 + 9 + 7\nJs.Array2.reduce([2.0, 4.0], (acc, item) => item /. acc, 1.0) == 2.0 // 4.0 / (2.0 / 1.0)\n```" - ], - "signature": "let reduce: (t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [ - "The `reducei()` function takes three parameters: an array, a *reducer\nfunction*, and a beginning accumulator value. The reducer function has three\nparameters: an accumulated value, an element of the array, and the index of\nthat element.\n\n`reducei()` first calls the reducer function with the beginning value, the\nfirst element in the array, and zero (its index). The result becomes the new\naccumulator value, which is passed to the reducer function along with the\nsecond element in the array and one (its index). `reducei()` proceeds from left\nto right through the array, passing in the result of each stage as the\naccumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reducei()`. See\n[`Array.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\non MDN.\n\n## Examples\n\n```rescript\n// find sum of even-index elements in array\nlet sumOfEvens = (accumulator, item, index) =>\n if mod(index, 2) == 0 {\n accumulator + item\n } else {\n accumulator\n }\n\nJs.Array2.reducei([2, 5, 1, 4, 3], sumOfEvens, 0) == 6\n```" - ], - "signature": "let reducei: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [ - "The `reduceRight()` function takes three parameters: an array, a *reducer\nfunction*, and a beginning accumulator value. The reducer function has two\nparameters: an accumulated value and an element of the array.\n\n`reduceRight()` first calls the reducer function with the beginning value and\nthe last element in the array. The result becomes the new accumulator value,\nwhich is passed in to the reducer function along with the next-to-last element\nin the array. `reduceRight()` proceeds from right to left through the array,\npassing in the result of each stage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduceRight()`. See\n[`Array.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight)\non MDN.\n\n**NOTE:** In many cases, `reduce()` and `reduceRight()` give the same result.\nHowever, see the last example here and compare it to the example from\n`reduce()`, where order makes a difference.\n\n## Examples\n\n```rescript\nlet sumOfSquares = (accumulator, item) => accumulator + item * item\n\nJs.Array2.reduceRight([10, 2, 4], sumOfSquares, 0) == 120\nJs.Array2.reduceRight([2.0, 4.0], (acc, item) => item /. acc, 1.0) == 0.5 // 2.0 / (4.0 / 1.0)\n```" - ], - "signature": "let reduceRight: (t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [ - "The `reduceRighti()` function takes three parameters: an array, a *reducer\nfunction*, and a beginning accumulator value. The reducer function has three\nparameters: an accumulated value, an element of the array, and the index of\nthat element. `reduceRighti()` first calls the reducer function with the\nbeginning value, the last element in the array, and its index (length of array\nminus one). The result becomes the new accumulator value, which is passed in to\nthe reducer function along with the second element in the array and one (its\nindex). `reduceRighti()` proceeds from right to left through the array, passing\nin the result of each stage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduceRighti()`. See\n[`Array.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight)\non MDN.\n\n**NOTE:** In many cases, `reducei()` and `reduceRighti()` give the same result.\nHowever, there are cases where the order in which items are processed makes a\ndifference.\n\n## Examples\n\n```rescript\n// find sum of even-index elements in array\nlet sumOfEvens = (accumulator, item, index) =>\n if mod(index, 2) == 0 {\n accumulator + item\n } else {\n accumulator\n }\n\nJs.Array2.reduceRighti([2, 5, 1, 4, 3], sumOfEvens, 0) == 6\n```" - ], - "signature": "let reduceRighti: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Returns `true` if the predicate function given as the second argument to\n`some()` returns `true` for any element in the array; `false` otherwise.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nJs.Array2.some([3, 7, 5, 2, 9], isEven) == true\nJs.Array2.some([3, 7, 5, 1, 9], isEven) == false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.somei", - "kind": "value", - "name": "somei", - "docstrings": [ - "Returns `true` if the predicate function given as the second argument to\n`somei()` returns `true` for any element in the array; `false` otherwise. The\npredicate function has two arguments: an item from the array and the index\nvalue\n\n## Examples\n\n```rescript\n// Does any string in the array\n// have the same length as its index?\n\nlet sameLength = (str, index) => Js.String.length(str) == index\n\n// \"ef\" has length 2 and is it at index 2\nJs.Array2.somei([\"ab\", \"cd\", \"ef\", \"gh\"], sameLength) == true\n// no item has the same length as its index\nJs.Array2.somei([\"a\", \"bc\", \"def\", \"gh\"], sameLength) == false\n```" - ], - "signature": "let somei: (t<'a>, ('a, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [ - "Returns the value at the given position in the array if the position is in\nbounds; returns the JavaScript value `undefined` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array2.unsafe_get(arr, 3) == 103\nJs.Array2.unsafe_get(arr, 4) // returns undefined\n```" - ], - "signature": "let unsafe_get: (array<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Js.Array2.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [ - "Sets the value at the given position in the array if the position is in bounds.\nIf the index is out of bounds, well, “here there be dragons.“\n\n*This function modifies the original array.*\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array2.unsafe_set(arr, 3, 99)\n// result is [100, 101, 102, 99];\n\nJs.Array2.unsafe_set(arr, 4, 88)\n// result is [100, 101, 102, 99, 88]\n\nJs.Array2.unsafe_set(arr, 6, 77)\n// result is [100, 101, 102, 99, 88, <1 empty item>, 77]\n\nJs.Array2.unsafe_set(arr, -1, 66)\n// you don't want to know.\n```" - ], - "signature": "let unsafe_set: (array<'a>, int, 'a) => unit", - "deprecated": "" - } - ] - }, - "js/array": { - "id": "Js.Array", - "name": "Array", - "docstrings": [ - "Provide bindings to JS array", - "Provides bindings to JavaScript’s `Array` functions. These bindings are\noptimized for pipe-last (`|>`), where the array to be processed is the last\nparameter in the function." - ], - "items": [ - { - "id": "Js.Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type used to describe a JavaScript array." - ], - "signature": "type t<'a> = array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [ - "A type used to describe JavaScript objects that are like an array or are iterable." - ], - "signature": "type array_like<'a> = Js_array2.array_like<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.from", - "kind": "value", - "name": "from", - "docstrings": [ - "Creates a shallow copy of an array from an array-like object. See [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nJs.Array.from(strArr) == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let from: array_like<'a> => array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.fromMap", - "kind": "value", - "name": "fromMap", - "docstrings": [ - "Creates a new array by applying a function (the second argument) to each item\nin the `array_like` first argument. See\n[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\non MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nlet code = s => Js.String.charCodeAt(0, s)\nJs.Array.fromMap(strArr, code) == [97.0, 98.0, 99.0, 100.0]\n```" - ], - "signature": "let fromMap: (array_like<'a>, 'a => 'b) => array<'b>", - "deprecated": "" - }, - { - "id": "Js.Array.isArray", - "kind": "value", - "name": "isArray", - "docstrings": [], - "signature": "let isArray: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.Array.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Returns the number of elements in the array. See [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN." - ], - "signature": "let length: array<'a> => int", - "deprecated": "" - }, - { - "id": "Js.Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (~to_: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (~to_: int, ~from: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: ('a, t<'a>) => 'b" - }, - { - "id": "Js.Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: ('a, ~from: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: ('a, ~start: int, ~end_: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "If the array is not empty, removes the last element and returns it as `Some(value)`; returns `None` if the array is empty. *This function modifies the original array.* See [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array.pop(arr) == Some(104)\narr == [100, 101, 102, 103]\n\nlet empty: array = []\nJs.Array.pop(empty) == None\n```" - ], - "signature": "let pop: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.push", - "kind": "value", - "name": "push", - "docstrings": [], - "signature": "let push: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.pushMany", - "kind": "value", - "name": "pushMany", - "docstrings": [], - "signature": "let pushMany: (array<'a>, t<'a>) => int" - }, - { - "id": "Js.Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [ - "Returns an array with the elements of the input array in reverse order. *This function modifies the original array.* See [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array.reverseInPlace(arr) == [\"cat\", \"bee\", \"ant\"]\narr == [\"cat\", \"bee\", \"ant\"]\n```" - ], - "signature": "let reverseInPlace: t<'a> => 'this", - "deprecated": "" - }, - { - "id": "Js.Array.shift", - "kind": "value", - "name": "shift", - "docstrings": [ - "If the array is not empty, removes the first element and returns it as `Some(value)`; returns `None` if the array is empty. *This function modifies the original array.* See [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array.shift(arr) == Some(100)\narr == [101, 102, 103, 104]\n\nlet empty: array = []\nJs.Array.shift(empty) == None\n```" - ], - "signature": "let shift: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [ - "Sorts the given array in place and returns the sorted array. JavaScript sorts the array by converting the arguments to UTF-16 strings and sorting them. See the second example with sorting numbers, which does not do a numeric sort. *This function modifies the original array.* See [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet words = [\"bee\", \"dog\", \"ant\", \"cat\"]\nJs.Array.sortInPlace(words) == [\"ant\", \"bee\", \"cat\", \"dog\"]\nwords == [\"ant\", \"bee\", \"cat\", \"dog\"]\n\nlet numbers = [3, 30, 10, 1, 20, 2]\nJs.Array.sortInPlace(numbers) == [1, 10, 2, 20, 3, 30]\nnumbers == [1, 10, 2, 20, 3, 30]\n```" - ], - "signature": "let sortInPlace: t<'a> => 'this", - "deprecated": "This has been deprecated and will be removed in v13. Use functions from the `Array` module instead." - }, - { - "id": "Js.Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (('a, 'a) => int, t<'a>) => 'b" - }, - { - "id": "Js.Array.spliceInPlace", - "kind": "value", - "name": "spliceInPlace", - "docstrings": [], - "signature": "let spliceInPlace: (~pos: int, ~remove: int, ~add: array<'a>, t<'a>) => 'b" - }, - { - "id": "Js.Array.removeFromInPlace", - "kind": "value", - "name": "removeFromInPlace", - "docstrings": [], - "signature": "let removeFromInPlace: (~pos: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.removeCountInPlace", - "kind": "value", - "name": "removeCountInPlace", - "docstrings": [], - "signature": "let removeCountInPlace: (~pos: int, ~count: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.unshift", - "kind": "value", - "name": "unshift", - "docstrings": [], - "signature": "let unshift: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.unshiftMany", - "kind": "value", - "name": "unshiftMany", - "docstrings": [], - "signature": "let unshiftMany: (array<'a>, t<'a>) => int" - }, - { - "id": "Js.Array.concat", - "kind": "value", - "name": "concat", - "docstrings": [], - "signature": "let concat: ('a, t<'b>) => 'a" - }, - { - "id": "Js.Array.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [], - "signature": "let concatMany: (array<'a>, t<'b>) => 'a" - }, - { - "id": "Js.Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: ('a, t<'a>) => bool" - }, - { - "id": "Js.Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: ('a, ~from: int, t<'a>) => int" - }, - { - "id": "Js.Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (string, t<'a>) => string" - }, - { - "id": "Js.Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: ('a, ~from: int, t<'a>) => int" - }, - { - "id": "Js.Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (int, ~end_: int, ~obj: t<'a>) => 'b" - }, - { - "id": "Js.Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Returns a copy of the entire array. Same as `Js.Array.Slice(~start=0,\n~end_=Js.Array.length(arr), arr)`. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." - ], - "signature": "let copy: t<'a> => 'this", - "deprecated": "" - }, - { - "id": "Js.Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (int, t<'a>) => 'b" - }, - { - "id": "Js.Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts the array to a string. Each element is converted to a string using\nJavaScript. Unlike the JavaScript `Array.toString()`, all elements in a\nReasonML array must have the same type. See\n[`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.toString([3.5, 4.6, 7.8]) == \"3.5,4.6,7.8\"\nJs.Array.toString([\"a\", \"b\", \"c\"]) == \"a,b,c\"\n```" - ], - "signature": "let toString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Converts the array to a string using the conventions of the current locale.\nEach element is converted to a string using JavaScript. Unlike the JavaScript\n`Array.toLocaleString()`, all elements in a ReasonML array must have the same\ntype. See\n[`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.toLocaleString([Js.Date.make()])\n// returns \"3/19/2020, 10:52:11 AM\" for locale en_US.utf8\n// returns \"2020-3-19 10:52:11\" for locale de_DE.utf8\n```" - ], - "signature": "let toLocaleString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: ('a => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (('a, int) => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: ('a => bool, t<'a>) => 'b" - }, - { - "id": "Js.Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (('a, int) => bool, t<'a>) => 'b" - }, - { - "id": "Js.Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: ('a => bool, t<'a>) => option<'a>" - }, - { - "id": "Js.Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (('a, int) => bool, t<'a>) => option<'a>" - }, - { - "id": "Js.Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: ('a => bool, t<'a>) => int" - }, - { - "id": "Js.Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (('a, int) => bool, t<'a>) => int" - }, - { - "id": "Js.Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: ('a => unit, t<'a>) => unit" - }, - { - "id": "Js.Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (('a, int) => unit, t<'a>) => unit" - }, - { - "id": "Js.Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: ('a => 'b, t<'a>) => t<'b>" - }, - { - "id": "Js.Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (('a, int) => 'b, t<'a>) => t<'b>" - }, - { - "id": "Js.Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (('a, 'b) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (('a, 'b, int) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (('a, 'b) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (('a, 'b, int) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: ('a => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (('a, int) => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [ - "Returns the value at the given position in the array if the position is in\nbounds; returns the JavaScript value `undefined` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array.unsafe_get(arr, 3) == 103\nJs.Array.unsafe_get(arr, 4) // returns undefined\n```" - ], - "signature": "let unsafe_get: (array<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Js.Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [ - "Sets the value at the given position in the array if the position is in bounds.\nIf the index is out of bounds, well, “here there be dragons.“ *This function\nmodifies the original array.*\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array.unsafe_set(arr, 3, 99)\n// result is [100, 101, 102, 99]\n\nJs.Array.unsafe_set(arr, 4, 88)\n// result is [100, 101, 102, 99, 88]\n\nJs.Array.unsafe_set(arr, 6, 77)\n// result is [100, 101, 102, 99, 88, <1 empty item>, 77]\n\nJs.Array.unsafe_set(arr, -1, 66)\n// you don't want to know.\n```" - ], - "signature": "let unsafe_set: (array<'a>, int, 'a) => unit", - "deprecated": "" - } - ] - }, - "js/exn": { - "id": "Js.Exn", - "name": "Exn", - "docstrings": [ - "Provide utilities for dealing with Js exceptions", - "Provide utilities for dealing with JS exceptions." - ], - "items": [ - { - "id": "Js.Exn.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JS exception" - ], - "signature": "type t", - "deprecated": "" - }, - { - "id": "Js.Exn.asJsExn", - "kind": "value", - "name": "asJsExn", - "docstrings": [], - "signature": "let asJsExn: exn => option", - "deprecated": "" - }, - { - "id": "Js.Exn.stack", - "kind": "value", - "name": "stack", - "docstrings": [], - "signature": "let stack: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.message", - "kind": "value", - "name": "message", - "docstrings": [], - "signature": "let message: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.name", - "kind": "value", - "name": "name", - "docstrings": [], - "signature": "let name: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [], - "signature": "let fileName: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.anyToExnInternal", - "kind": "value", - "name": "anyToExnInternal", - "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a Exn.Error if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." - ], - "signature": "let anyToExnInternal: 'a => exn", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseError", - "kind": "value", - "name": "raiseError", - "docstrings": [ - "Raise Js exception Error object with stacktrace" - ], - "signature": "let raiseError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseEvalError", - "kind": "value", - "name": "raiseEvalError", - "docstrings": [], - "signature": "let raiseEvalError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseRangeError", - "kind": "value", - "name": "raiseRangeError", - "docstrings": [], - "signature": "let raiseRangeError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseReferenceError", - "kind": "value", - "name": "raiseReferenceError", - "docstrings": [], - "signature": "let raiseReferenceError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseSyntaxError", - "kind": "value", - "name": "raiseSyntaxError", - "docstrings": [], - "signature": "let raiseSyntaxError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseTypeError", - "kind": "value", - "name": "raiseTypeError", - "docstrings": [], - "signature": "let raiseTypeError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseUriError", - "kind": "value", - "name": "raiseUriError", - "docstrings": [], - "signature": "let raiseUriError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(exn)` ignores the provided exn and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit", - "deprecated": "" - } - ] - }, - "js/null_undefined": { - "id": "Js.Null_undefined", - "name": "Null_undefined", - "docstrings": [ - "Contains functionality for dealing with values that can be both `null` and `undefined`" - ], - "items": [ - { - "id": "Js.Null_undefined.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.null_undefined<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [ - "Returns `true` if the given value is null or undefined, `false` otherwise." - ], - "signature": "let isNullable: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The null value of type `Js.null_undefined<'a>`." - ], - "signature": "let null: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The undefined value of type `Js.null_undefined<'a>`." - ], - "signature": "let undefined: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\n\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped, mapped to\na `'b` using the given function `a' => 'b`, then wrapped back up and returned\nas `Js.null_undefined<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.null_undefined) =>\n Js.Null_undefined.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function.\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped and applied to the given function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.null_undefined) =>\n Js.Null_undefined.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.null_undefined<'a>`.\n`Some(a)` => `a`\n`None` => `undefined`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.null_undefined<'a>` to `option<'a>`.\n`a` => `Some(a)`\n`undefined` => `None`\n`null` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - }, - "js/nullable": { - "id": "Js.Nullable", - "name": "Nullable", - "docstrings": [ - "Provide utilities for `Js.null_undefined`", - "Contains functionality for dealing with values that can be both `null` and `undefined`" - ], - "items": [ - { - "id": "Js.Nullable.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined", - "deprecated": "" - }, - { - "id": "Js.Nullable.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.null_undefined<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [ - "Returns `true` if the given value is null or undefined, `false` otherwise." - ], - "signature": "let isNullable: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Nullable.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The null value of type `Js.null_undefined<'a>`." - ], - "signature": "let null: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The undefined value of type `Js.null_undefined<'a>`." - ], - "signature": "let undefined: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\n\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped, mapped to\na `'b` using the given function `a' => 'b`, then wrapped back up and returned\nas `Js.null_undefined<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.null_undefined) =>\n Js.Null_undefined.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Nullable.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function.\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped and applied to the given function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.null_undefined) =>\n Js.Null_undefined.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Nullable.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.null_undefined<'a>`.\n`Some(a)` => `a`\n`None` => `undefined`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.null_undefined<'a>` to `option<'a>`.\n`a` => `Some(a)`\n`undefined` => `None`\n`null` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - }, - "js/undefined": { - "id": "Js.Undefined", - "name": "Undefined", - "docstrings": [ - "Provide utilities for `Js.undefined<'a>`", - "Provides functionality for dealing with the `Js.undefined<'a>` type" - ], - "items": [ - { - "id": "Js.Undefined.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Local alias for `Js.undefined<'a>`" - ], - "signature": "type t<'a> = undefined<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.undefined<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.test", - "kind": "value", - "name": "test", - "docstrings": [ - "Returns `true` if the given value is empty (undefined), `false` otherwise." - ], - "signature": "let test: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Undefined.testAny", - "kind": "value", - "name": "testAny", - "docstrings": [ - "Returns `true` if the given value is empty (undefined).\n\n**since 1.6.1**" - ], - "signature": "let testAny: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.Undefined.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "The empty value, `undefined`" - ], - "signature": "let empty: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [], - "signature": "let getUnsafe: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Undefined.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Undefined.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\nIf `Js.undefined<'a>` contains a value, that value is unwrapped, mapped to a\n`'b` using the given function `a' => 'b`, then wrapped back up and returned as\n`Js.undefined<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.undefined) =>\n Js.Undefined.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Undefined.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function. If\n`Js.undefined<'a>` contains a value, that value is unwrapped and applied to the\ngiven function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.undefined) =>\n Js.Undefined.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Undefined.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.undefined<'a>`.\n`Some(a)` => `a`\n`None` => `empty`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.undefined<'a>` to `option<'a>`\n`a` => `Some(a)`\n`empty` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - }, - "js/null": { - "id": "Js.Null", - "name": "Null", - "docstrings": [ - "Provide utilities for `Js.null<'a>`", - "Provides functionality for dealing with the `Js.null<'a>` type" - ], - "items": [ - { - "id": "Js.Null.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "@unboxed\ntype t<'a> = null<'a> =\n | Value('a)\n | @as(null) Null", - "deprecated": "" - }, - { - "id": "Js.Null.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.null<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.test", - "kind": "value", - "name": "test", - "docstrings": [ - "Returns `true` if the given value is empty (`null`), `false` otherwise." - ], - "signature": "let test: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Null.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "The empty value, `null`" - ], - "signature": "let empty: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [], - "signature": "let getUnsafe: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Null.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Null.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\n\nIf `Js.null<'a>` contains a value, that value is unwrapped, mapped to a `'b`\nusing the given function `'a => 'b`, then wrapped back up and returned as\n`Js.null<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.null) =>\n Js.Null.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Null.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function.\nIf `Js.null<'a>` contains a value, that value is unwrapped and applied to the given function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.null) =>\n Js.Null.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Null.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.null<'a>`.\n`Some(a)` => `a`\n`None` => `empty`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.null<'a>` to `option<'a>`.\n`a` => `Some(a)`\n`empty` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v13.0.0/stdlib.json b/apps/docs/data/api/v13.0.0/stdlib.json deleted file mode 100644 index 766111652..000000000 --- a/apps/docs/data/api/v13.0.0/stdlib.json +++ /dev/null @@ -1,13442 +0,0 @@ -{ - "stdlib": { - "id": "Stdlib", - "name": "Stdlib", - "docstrings": [], - "items": [ - { - "id": "Stdlib.timeoutId", - "kind": "type", - "name": "timeoutId", - "docstrings": [ - "An `id` representing a timeout started via `setTimeout`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN." - ], - "signature": "type timeoutId = Global.timeoutId" - }, - { - "id": "Stdlib.setTimeout", - "kind": "value", - "name": "setTimeout", - "docstrings": [ - "`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200)\n```" - ], - "signature": "let setTimeout: (unit => unit, int) => timeoutId" - }, - { - "id": "Stdlib.setTimeoutFloat", - "kind": "value", - "name": "setTimeoutFloat", - "docstrings": [ - "`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200.)\n```" - ], - "signature": "let setTimeoutFloat: (unit => unit, float) => timeoutId" - }, - { - "id": "Stdlib.clearTimeout", - "kind": "value", - "name": "clearTimeout", - "docstrings": [ - "`clearTimeout(timeoutId)` clears a scheduled timeout if it hasn't already executed.\n\nSee [`clearTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout) on MDN.\n\n## Examples\n\n```rescript\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 2 seconds.\")\n}, 2000)\n\n// Clearing the timeout right away, before 2 seconds has passed, means that the above callback logging to the console will never run.\nclearTimeout(timeoutId)\n```" - ], - "signature": "let clearTimeout: timeoutId => unit" - }, - { - "id": "Stdlib.intervalId", - "kind": "type", - "name": "intervalId", - "docstrings": [ - "An `id` representing an interval started via `setInterval`.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN." - ], - "signature": "type intervalId = Global.intervalId" - }, - { - "id": "Stdlib.setInterval", - "kind": "value", - "name": "setInterval", - "docstrings": [ - "`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 200 ms (200 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 200 ms.\")\n}, 200)\n\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```" - ], - "signature": "let setInterval: (unit => unit, int) => intervalId" - }, - { - "id": "Stdlib.setIntervalFloat", - "kind": "value", - "name": "setIntervalFloat", - "docstrings": [ - "`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 2 seconds (200 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 200 ms\")\n}, 200.)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeoutFloat(() => {\n clearInterval(intervalId)\n}, 500.0)\n```" - ], - "signature": "let setIntervalFloat: (unit => unit, float) => intervalId" - }, - { - "id": "Stdlib.clearInterval", - "kind": "value", - "name": "clearInterval", - "docstrings": [ - "`clearInterval(intervalId)` clears a scheduled interval.\n\nSee [`clearInterval`](https://developer.mozilla.org/en-US/docs/Web/API/clearInterval) on MDN.\n\n## Examples\n\n```rescript\nlet intervalId = setInterval(() => {\n Console.log(\"This prints in 100 ms\")\n}, 100)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```" - ], - "signature": "let clearInterval: intervalId => unit" - }, - { - "id": "Stdlib.encodeURI", - "kind": "value", - "name": "encodeURI", - "docstrings": [ - "Encodes a URI by replacing characters in the provided string that aren't valid in a URL.\n\nThis is intended to operate on full URIs, so it encodes fewer characters than what `encodeURIComponent` does.\nIf you're looking to encode just parts of a URI, like a query parameter, prefer `encodeURIComponent`.\n\nSee [`encodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI) on MDN.\n\n## Examples\n```rescript\nConsole.log(encodeURI(\"https://rescript-lang.org?array=[someValue]\"))\n// Logs \"https://rescript-lang.org?array=%5BsomeValue%5D\" to the console.\n```" - ], - "signature": "let encodeURI: string => string" - }, - { - "id": "Stdlib.decodeURI", - "kind": "value", - "name": "decodeURI", - "docstrings": [ - "Decodes a previously encoded URI back to a regular string.\n\nThis is intended to operate on full URIs, so it decodes fewer characters than what `decodeURIComponent` does.\nIf you're looking to decode just parts of a URI, like a query parameter, prefer `decodeURIComponent`.\n\nSee [`decodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI) on MDN.\n\n## Examples\n```rescript\nConsole.log(decodeURI(\"https://rescript-lang.org?array=%5BsomeValue%5D\"))\n// Logs \"https://rescript-lang.org?array=[someValue]\" to the console.\n```" - ], - "signature": "let decodeURI: string => string" - }, - { - "id": "Stdlib.encodeURIComponent", - "kind": "value", - "name": "encodeURIComponent", - "docstrings": [ - "Encodes a string so it can be used as part of a URI.\n\nSee [`encodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) on MDN.\n\n## Examples\n```rescript\nConsole.log(encodeURIComponent(\"array=[someValue]\"))\n// Logs \"array%3D%5BsomeValue%5D\" to the console.\n```" - ], - "signature": "let encodeURIComponent: string => string" - }, - { - "id": "Stdlib.decodeURIComponent", - "kind": "value", - "name": "decodeURIComponent", - "docstrings": [ - "Decodes a previously URI encoded string back to its original form.\n\nSee [`decodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) on MDN.\n\n## Examples\n```rescript\nConsole.log(decodeURIComponent(\"array%3D%5BsomeValue%5D\"))\n// Logs \"array=[someValue]\" to the console.\n```" - ], - "signature": "let decodeURIComponent: string => string" - }, - { - "id": "Stdlib.date", - "kind": "type", - "name": "date", - "docstrings": [], - "signature": "type date = Date.t" - }, - { - "id": "Stdlib.null", - "kind": "type", - "name": "null", - "docstrings": [], - "signature": "type null<'a> = null<'a>" - }, - { - "id": "Stdlib.undefined", - "kind": "type", - "name": "undefined", - "docstrings": [], - "signature": "type undefined<'a> = undefined<'a>" - }, - { - "id": "Stdlib.nullable", - "kind": "type", - "name": "nullable", - "docstrings": [], - "signature": "type nullable<'a> = nullable<'a>" - }, - { - "id": "Stdlib.lazy_t", - "kind": "type", - "name": "lazy_t", - "docstrings": [], - "signature": "type lazy_t<'a> = Lazy.t<'a>", - "deprecated": "Use Lazy.t instead" - }, - { - "id": "Stdlib.window", - "kind": "value", - "name": "window", - "docstrings": [], - "signature": "let window: Dom.window", - "deprecated": "Use rescript-webapi instead" - }, - { - "id": "Stdlib.document", - "kind": "value", - "name": "document", - "docstrings": [], - "signature": "let document: Dom.document", - "deprecated": "Use rescript-webapi instead" - }, - { - "id": "Stdlib.globalThis", - "kind": "value", - "name": "globalThis", - "docstrings": [ - "`globalThis` gives you the host global object (`window` in browsers, `global` in Node, etc.).\nYou can reach shared globals from any runtime without special checks.\n\n## Examples\n\n**Note:** These are demonstrative examples. In real code, prefer writing your own type-safe bindings.\nSee [`Bind to Global JS Values`](https://rescript-lang.org/docs/manual/v12.0.0/bind-to-global-js-values).\n\n\n```rescript\ntypeof(globalThis[\"setTimeout\"]) == #function\n\nglobalThis[\"myAppName\"] = \"SuperApp\";\nglobalThis[\"myAppName\"] == \"SuperApp\"\n```" - ], - "signature": "let globalThis: {..}" - }, - { - "id": "Stdlib.import", - "kind": "value", - "name": "import", - "docstrings": [ - "`import(value)` dynamically import a value or function from a ReScript\nmodule. The import call will return a `promise`, resolving to the dynamically loaded\nvalue.\n\n## Examples\n\n`Array.res` file:\n\n```rescript\n@send external indexOf: (array<'a>, 'a) => int = \"indexOf\"\n\nlet indexOfOpt = (arr, item) =>\n switch arr->indexOf(item) {\n | -1 => None\n | index => Some(index)\n }\n```\nIn other file you can import the `indexOfOpt` value defined in `Array.res`\n\n```rescript\nlet main = async () => {\n let indexOfOpt = await import(Array.indexOfOpt)\n let index = indexOfOpt([1, 2], 2)\n Console.log(index)\n}\n```\n\nCompiles to:\n\n```javascript\nasync function main() {\n var add = await import(\"./Array.mjs\").then(function(m) {\n return m.indexOfOpt;\n });\n var index = indexOfOpt([1, 2], 2);\n console.log(index);\n}\n```" - ], - "signature": "let import: 'a => promise<'a>" - }, - { - "id": "Stdlib.panic", - "kind": "value", - "name": "panic", - "docstrings": [ - "`panic(message)` throws a JavaScript `Error` prefixed with `Panic!`.\nCall it when something went wrong and the program should stop right away.\n\n## Examples\n\n```rescript\nlet caught = try panic(\"Invariant violated\") catch {\n| JsExn(err) => JsExn.message(err)->Option.getOrThrow\n}\n\ncaught == \"Panic! Invariant violated\"\n```" - ], - "signature": "let panic: string => 'a" - }, - { - "id": "Stdlib.assertEqual", - "kind": "value", - "name": "assertEqual", - "docstrings": [ - "`assertEqual(a, b)` check if `a` is equal `b`. If not throw a panic exception\n\n## Examples\n\n```rescript\nlist{1, 2}->List.tailExn == list{2}\n```" - ], - "signature": "let assertEqual: ('a, 'a) => unit" - }, - { - "id": "Stdlib.null", - "kind": "value", - "name": "null", - "docstrings": [ - "`null` returns the JavaScript `null` value as a `nullable<'a>`.\nUse the `Nullable` helpers to convert it into an `option` or to read the value.\n\n## Examples\n\n```rescript\nnull->Nullable.toOption == None\n```" - ], - "signature": "let null: nullable<'a>" - }, - { - "id": "Stdlib.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "`undefined` returns the JavaScript `undefined` value as a `nullable<'a>`.\nUse the `Nullable` helpers to convert it into an `option` or to read the value.\n\n## Examples\n\n```rescript\nundefined->Nullable.toOption == None\n```" - ], - "signature": "let undefined: nullable<'a>" - }, - { - "id": "Stdlib.typeof", - "kind": "value", - "name": "typeof", - "docstrings": [ - "`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```" - ], - "signature": "let typeof: 'a => Type.t" - } - ] - }, - "stdlib/intl/numberformat/grouping": { - "id": "Stdlib.Intl.NumberFormat.Grouping", - "name": "Grouping", - "docstrings": [ - "Represents the `useGrouping` option accepted by `Intl.NumberFormat`.\n\nSee [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) on MDN for full option details." - ], - "items": [ - { - "id": "Stdlib.Intl.NumberFormat.Grouping.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.parsed", - "kind": "type", - "name": "parsed", - "docstrings": [], - "signature": "type parsed = [#always | #auto | #bool(bool) | #min2]" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.fromBool", - "kind": "value", - "name": "fromBool", - "docstrings": [ - "Constructs a grouping setting from a boolean.\n\n## Examples\n\n```rescript\nlet formatter =\n Intl.NumberFormat.make(\n ~locales=[\"en-US\"],\n ~options={useGrouping: Intl.NumberFormat.Grouping.fromBool(false)},\n )\nformatter->Intl.NumberFormat.format(1234.) == \"1234\"\n```" - ], - "signature": "let fromBool: bool => t" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Constructs a grouping setting from a string literal.\n\n## Examples\n\n```rescript\nlet formatter =\n Intl.NumberFormat.make(\n ~locales=[\"en-US\"],\n ~options={useGrouping: Intl.NumberFormat.Grouping.fromString(#always)},\n )\nformatter->Intl.NumberFormat.format(1234.) == \"1,234\"\n```" - ], - "signature": "let fromString: [#always | #auto | #min2] => t" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.parseJsValue", - "kind": "value", - "name": "parseJsValue", - "docstrings": [ - "`parseJsValue(value)` attempts to interpret a JavaScript `value` as a grouping setting.\n\n## Examples\n\n```rescript\nIntl.NumberFormat.Grouping.parseJsValue(Js.Json.string(\"auto\")) == Some(#auto)\n```" - ], - "signature": "let parseJsValue: 'a => option<[> #always | #auto | #bool(bool) | #min2]>" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(grouping)` ignores the provided grouping and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/biguint64array/constants": { - "id": "Stdlib.BigUint64Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigUint64Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/bigint64array/constants": { - "id": "Stdlib.BigInt64Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigInt64Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint8clampedarray/constants": { - "id": "Stdlib.Uint8ClampedArray.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8ClampedArray.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint32array/constants": { - "id": "Stdlib.Uint32Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint32Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint16array/constants": { - "id": "Stdlib.Uint16Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint16Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint8array/constants": { - "id": "Stdlib.Uint8Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/int32array/constants": { - "id": "Stdlib.Int32Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int32Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/int16array/constants": { - "id": "Stdlib.Int16Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int16Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/int8array/constants": { - "id": "Stdlib.Int8Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int8Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/float64array/constants": { - "id": "Stdlib.Float64Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float64Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/float32array/constants": { - "id": "Stdlib.Float32Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float32Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/type/classify": { - "id": "Stdlib.Type.Classify", - "name": "Classify", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Type.Classify.function", - "kind": "type", - "name": "function", - "docstrings": [ - "An abstract type representing a JavaScript function.\n\n See [`function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) on MDN." - ], - "signature": "type function" - }, - { - "id": "Stdlib.Type.Classify.object", - "kind": "type", - "name": "object", - "docstrings": [ - "An abstract type representing a JavaScript object.\n\n See [`object`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) on MDN." - ], - "signature": "type object" - }, - { - "id": "Stdlib.Type.Classify.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type representing a classified JavaScript value." - ], - "signature": "type t =\n | Bool(bool)\n | Null\n | Undefined\n | String(string)\n | Number(float)\n | Object(object)\n | Function(function)\n | Symbol(Symbol.t)\n | BigInt(bigint)" - }, - { - "id": "Stdlib.Type.Classify.classify", - "kind": "value", - "name": "classify", - "docstrings": [ - "`classify(anyValue)`\nClassifies a JavaScript value.\n\n## Examples\n```rescript\nswitch %raw(`null`)->Type.Classify.classify {\n| Null => Console.log(\"Yup, that's null.\")\n| _ => Console.log(\"This doesn't actually appear to be null...\")\n}\n```" - ], - "signature": "let classify: 'a => t" - } - ] - }, - "stdlib/regexp/result": { - "id": "Stdlib.RegExp.Result", - "name": "Result", - "docstrings": [], - "items": [ - { - "id": "Stdlib.RegExp.Result.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing the result of a `RegExp` execution." - ], - "signature": "type t = array>" - }, - { - "id": "Stdlib.RegExp.Result.fullMatch", - "kind": "value", - "name": "fullMatch", - "docstrings": [ - "`fullMatch(regExpResult)` returns the full string that matched in this result.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n \n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints the full string that matched, \"ReScript is\"\n }\n ```" - ], - "signature": "let fullMatch: t => string" - }, - { - "id": "Stdlib.RegExp.Result.matches", - "kind": "value", - "name": "matches", - "docstrings": [ - "`matches(regExpResult)` returns all matches for `regExpResult`.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n \n // This below will log \"ReScript\" and \"is\" to the console.\n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) =>\n switch result->RegExp.Result.matches->Array.keepSome {\n | [firstWord, secondWord] => Console.log2(firstWord, secondWord)\n | _ => Console.log(\"Didn't find exactly two words...\")\n }\n }\n ```" - ], - "signature": "let matches: t => array>" - }, - { - "id": "Stdlib.RegExp.Result.index", - "kind": "value", - "name": "index", - "docstrings": [], - "signature": "let index: t => int" - }, - { - "id": "Stdlib.RegExp.Result.input", - "kind": "value", - "name": "input", - "docstrings": [ - "`input(regExpResult)` returns the full input string that was passed to what produced the `RegExp.Result.t`.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n \n // This below will log the full input string \"ReScript is pretty cool, right?\" to the console.\n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) => Console.log(result->RegExp.Result.input)\n }\n ```" - ], - "signature": "let input: t => string" - } - ] - }, - "stdlib/math/int": { - "id": "Stdlib.Math.Int", - "name": "Int", - "docstrings": [ - "Provide Math utilities for `int`" - ], - "items": [ - { - "id": "Stdlib.Math.Int.abs", - "kind": "value", - "name": "abs", - "docstrings": [ - "`abs(v)` returns absolute value of `v`.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.abs(-2) == 2\n Math.Int.abs(3) == 3\n ```" - ], - "signature": "let abs: int => int" - }, - { - "id": "Stdlib.Math.Int.clz32", - "kind": "value", - "name": "clz32", - "docstrings": [ - "`clz32(v)` returns the number of leading zero bits of the argument's 32 bit\nint representation.\nSee [`Math.clz32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32) on MDN.\n\n ## Examples\n\n ```rescript\n // 00000000000000000000000000000001\n Math.Int.clz32(1) == 31\n // 00000000000000000000000000000100\n Math.Int.clz32(4) == 29\n ```" - ], - "signature": "let clz32: int => int" - }, - { - "id": "Stdlib.Math.Int.imul", - "kind": "value", - "name": "imul", - "docstrings": [ - "`imul(a, b)` returns 32-bit integer multiplication. Use this only when you\nneed to optimize performance of multiplication of numbers stored as 32-bit\nintegers.\nSee [`Math.imul`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.imul(3, 4) == 12\n Math.Int.imul(-5, 12) == -60\n ```" - ], - "signature": "let imul: (int, int) => int" - }, - { - "id": "Stdlib.Math.Int.min", - "kind": "value", - "name": "min", - "docstrings": [ - "`min(a, b)` returns the minimum of its two integer arguments.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.min(1, 2) == 1\n Math.Int.min(-1, -2) == -2\n ```" - ], - "signature": "let min: (int, int) => int" - }, - { - "id": "Stdlib.Math.Int.minMany", - "kind": "value", - "name": "minMany", - "docstrings": [ - "`minMany(arr)` returns the minimum of the integers in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.minMany([1, 2]) == 1\n Math.Int.minMany([-1, -2]) == -2\n Math.Int.minMany([])->Int.toFloat->Float.isFinite == false\n ```" - ], - "signature": "let minMany: array => int" - }, - { - "id": "Stdlib.Math.Int.max", - "kind": "value", - "name": "max", - "docstrings": [ - "`max(a, b)` returns the maximum of its two integer arguments.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.max(1, 2) == 2\n Math.Int.max(-1, -2) == -1\n ```" - ], - "signature": "let max: (int, int) => int" - }, - { - "id": "Stdlib.Math.Int.maxMany", - "kind": "value", - "name": "maxMany", - "docstrings": [ - "`maxMany(arr)` returns the maximum of the integers in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.maxMany([1, 2]) == 2\n Math.Int.maxMany([-1, -2]) == -1\n Math.Int.maxMany([])->Int.toFloat->Float.isFinite == false\n ```" - ], - "signature": "let maxMany: array => int" - }, - { - "id": "Stdlib.Math.Int.pow", - "kind": "value", - "name": "pow", - "docstrings": [ - "`pow(a, ~exp)` throws the given base `a` to the given exponent `exp`.\nSee [`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.pow(2, ~exp=4) == 16\n Math.Int.pow(3, ~exp=4) == 81\n ```" - ], - "signature": "let pow: (int, ~exp: int) => int" - }, - { - "id": "Stdlib.Math.Int.sign", - "kind": "value", - "name": "sign", - "docstrings": [ - "`sign(v)` returns the sign of its integer argument: `-1` if negative, `0` if\nzero, `1` if positive.\nSee [`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.sign(3) == 1\n Math.Int.sign(-3) == -1\n Math.Int.sign(0) == 0\n ```" - ], - "signature": "let sign: int => int" - }, - { - "id": "Stdlib.Math.Int.floor", - "kind": "value", - "name": "floor", - "docstrings": [ - "floor(v) returns the largest `int` less than or equal to the argument;\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.floor(3.7) == 3\n Math.Int.floor(3.0) == 3\n Math.Int.floor(-3.1) == -4\n ```" - ], - "signature": "let floor: float => int" - }, - { - "id": "Stdlib.Math.Int.ceil", - "kind": "value", - "name": "ceil", - "docstrings": [ - "ceil(v) returns the smallest `int` greater than or equal to the argument;\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.ceil(3.7) == 4\n Math.Int.ceil(3.0) == 3\n Math.Int.ceil(-3.1) == -3\n ```" - ], - "signature": "let ceil: float => int" - }, - { - "id": "Stdlib.Math.Int.random", - "kind": "value", - "name": "random", - "docstrings": [ - "`random(minVal, maxVal)` returns a random integer number in the half-closed interval \\[minVal, maxVal).\nSee [`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\non MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.random(2, 5)\n Math.Int.random(505, 2000)\n Math.Int.random(-7, -2)\n ```" - ], - "signature": "let random: (int, int) => int" - } - ] - }, - "stdlib/math/constants": { - "id": "Stdlib.Math.Constants", - "name": "Constants", - "docstrings": [ - "Mathematical Constants" - ], - "items": [ - { - "id": "Stdlib.Math.Constants.e", - "kind": "value", - "name": "e", - "docstrings": [ - "`Math.Constants.e` returns Euler's number, ≈ 2.718281828459045.\nSee [`Math.E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.e\n ```" - ], - "signature": "let e: float" - }, - { - "id": "Stdlib.Math.Constants.ln2", - "kind": "value", - "name": "ln2", - "docstrings": [ - "`Math.Constants.ln2` returns Natural logarithm of 2, ≈ 0.6931471805599453.\nSee [`Math.LN2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN2) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.ln2\n ```" - ], - "signature": "let ln2: float" - }, - { - "id": "Stdlib.Math.Constants.ln10", - "kind": "value", - "name": "ln10", - "docstrings": [ - "`Math.Constants.ln10` returns Natural logarithm of 10, ≈ 2.302585092994046.\nSee [`Math.LN10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN10) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.ln10\n ```" - ], - "signature": "let ln10: float" - }, - { - "id": "Stdlib.Math.Constants.log2e", - "kind": "value", - "name": "log2e", - "docstrings": [ - "`Math.Constants.log2e` returns Base 2 logarithm of E, ≈ 1.4426950408889634.\nSee [`Math.LOG2E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG2E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.log2e\n ```" - ], - "signature": "let log2e: float" - }, - { - "id": "Stdlib.Math.Constants.log10e", - "kind": "value", - "name": "log10e", - "docstrings": [ - "`Math.Constants.log10e` returns Base 10 logarithm of E, ≈ 0.4342944819032518.\nSee [`Math.LOG10E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG10E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.log10e\n ```" - ], - "signature": "let log10e: float" - }, - { - "id": "Stdlib.Math.Constants.pi", - "kind": "value", - "name": "pi", - "docstrings": [ - "`Math.Constants.pi` returns Pi - ratio of the circumference to the diameter\nof a circle, ≈ 3.141592653589793.\nSee [`Math.PI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/PI) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.pi\n ```" - ], - "signature": "let pi: float" - }, - { - "id": "Stdlib.Math.Constants.sqrt1_2", - "kind": "value", - "name": "sqrt1_2", - "docstrings": [ - "`Math.Constants.sqrt1_2` returns Square root of 1/2, ≈ 0.7071067811865476.\nSee [`Math.SQRT1_2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.sqrt1_2\n ```" - ], - "signature": "let sqrt1_2: float" - }, - { - "id": "Stdlib.Math.Constants.sqrt2", - "kind": "value", - "name": "sqrt2", - "docstrings": [ - "`Math.Constants.e` returns Absolute value for integer argument.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.sqrt2\n ```" - ], - "signature": "let sqrt2: float" - } - ] - }, - "stdlib/json/decode": { - "id": "Stdlib.JSON.Decode", - "name": "Decode", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JSON.Decode.bool", - "kind": "value", - "name": "bool", - "docstrings": [ - "Decodes a single JSON value. If the value is a bool, it will return `Some(bool)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`true`)->JSON.Decode.bool\n // Some(true)\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.bool\n // None\n ```" - ], - "signature": "let bool: t => option" - }, - { - "id": "Stdlib.JSON.Decode.null", - "kind": "value", - "name": "null", - "docstrings": [ - "Decodes a single JSON value. If the value is null, it will return `Some(Null.t)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`null`)->JSON.Decode.null\n // Some(null)\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.null\n // None\n ```" - ], - "signature": "let null: t => option>" - }, - { - "id": "Stdlib.JSON.Decode.string", - "kind": "value", - "name": "string", - "docstrings": [ - "Decodes a single JSON value. If the value is a string, it will return `Some(string)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.string\n // Some(\"hello world\")\n \n JSON.parseOrThrow(`42`)->JSON.Decode.string\n // None\n ```" - ], - "signature": "let string: t => option" - }, - { - "id": "Stdlib.JSON.Decode.float", - "kind": "value", - "name": "float", - "docstrings": [ - "Decodes a single JSON value. If the value is a float, it will return `Some(float)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`42.0`)->JSON.Decode.float\n // Some(42.0)\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.float\n // None\n ```" - ], - "signature": "let float: t => option" - }, - { - "id": "Stdlib.JSON.Decode.object", - "kind": "value", - "name": "object", - "docstrings": [ - "Decodes a single JSON value. If the value is an object, it will return `Some(dict)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`{\"foo\":\"bar\"}`)->JSON.Decode.object\n // Some({ foo: 'bar' })\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.object\n // None\n ```" - ], - "signature": "let object: t => option>" - }, - { - "id": "Stdlib.JSON.Decode.array", - "kind": "value", - "name": "array", - "docstrings": [ - "Decodes a single JSON value. If the value is an array, it will return `Some(array)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`[\"foo\", \"bar\"]`)->JSON.Decode.array\n // Some([ 'foo', 'bar' ])\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.array\n // None\n ```" - ], - "signature": "let array: t => option>" - } - ] - }, - "stdlib/json/encode": { - "id": "Stdlib.JSON.Encode", - "name": "Encode", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JSON.Encode.bool", - "kind": "value", - "name": "bool", - "docstrings": [ - "Returns a boolean as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.bool(true)\n ```" - ], - "signature": "let bool: bool => t" - }, - { - "id": "Stdlib.JSON.Encode.null", - "kind": "value", - "name": "null", - "docstrings": [ - "Returns null as a JSON value.\n\n ## Examples\n ```rescript\n JSON.Encode.null\n ```" - ], - "signature": "let null: t" - }, - { - "id": "Stdlib.JSON.Encode.string", - "kind": "value", - "name": "string", - "docstrings": [ - "Returns a string as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.string(\"hello world\")\n ```" - ], - "signature": "let string: string => t" - }, - { - "id": "Stdlib.JSON.Encode.int", - "kind": "value", - "name": "int", - "docstrings": [ - "Returns an int as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.int(42)\n ```" - ], - "signature": "let int: int => t" - }, - { - "id": "Stdlib.JSON.Encode.float", - "kind": "value", - "name": "float", - "docstrings": [ - "Returns a float as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.float(42.0)\n ```" - ], - "signature": "let float: float => t" - }, - { - "id": "Stdlib.JSON.Encode.object", - "kind": "value", - "name": "object", - "docstrings": [ - "Returns a dict as a JSON object.\n\n ## Examples\n ```rescript\n let dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n ])\n \n JSON.Encode.object(dict)\n ```" - ], - "signature": "let object: dict => t" - }, - { - "id": "Stdlib.JSON.Encode.array", - "kind": "value", - "name": "array", - "docstrings": [ - "Returns an array as JSON.\n\n ## Examples\n ```rescript\n let array = [JSON.Encode.string(\"hello world\"), JSON.Encode.int(42)]\n \n JSON.Encode.array(array)\n ```" - ], - "signature": "let array: array => t" - }, - { - "id": "Stdlib.JSON.Encode.stringArray", - "kind": "value", - "name": "stringArray", - "docstrings": [ - "Returns an array of strings as a JSON object." - ], - "signature": "let stringArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.floatArray", - "kind": "value", - "name": "floatArray", - "docstrings": [ - "Returns an array of floats as a JSON object." - ], - "signature": "let floatArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.intArray", - "kind": "value", - "name": "intArray", - "docstrings": [ - "Returns an array of integers as a JSON object." - ], - "signature": "let intArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.boolArray", - "kind": "value", - "name": "boolArray", - "docstrings": [ - "Returns an array of booleans as a JSON object." - ], - "signature": "let boolArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.objectArray", - "kind": "value", - "name": "objectArray", - "docstrings": [ - "Returns an array of objects as a JSON object." - ], - "signature": "let objectArray: array> => t" - } - ] - }, - "stdlib/json/classify": { - "id": "Stdlib.JSON.Classify", - "name": "Classify", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JSON.Classify.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a JavaScript type." - ], - "signature": "type t =\n | Bool(bool)\n | Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)" - }, - { - "id": "Stdlib.JSON.Classify.classify", - "kind": "value", - "name": "classify", - "docstrings": [ - "Returns the JSON type of any value.\n\n ## Examples\n ```rescript\n JSON.Classify.classify(\"hello world\")\n // String(\"hello world\")\n \n JSON.Classify.classify(42)\n // Number(42)\n ```" - ], - "signature": "let classify: 'a => t", - "deprecated": "Directly switch on the JSON object instead" - } - ] - }, - "stdlib/jserror/urierror": { - "id": "Stdlib.JsError.URIError", - "name": "URIError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.URIError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `URIError` with the provided `message`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.URIError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `URIError` with the provided `message` and throws it.\n\n `JsError.URIError.throwWithMessage(\"message\")` is equivalent to `JsError.URIError.make(\"message\")->JsError.throw`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/typeerror": { - "id": "Stdlib.JsError.TypeError", - "name": "TypeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.TypeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `TypeError` with the provided `message`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.TypeError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `TypeError` with the provided `message` and throws it.\n\n `JsError.TypeError.throwWithMessage(\"message\")` is equivalent to `JsError.TypeError.make(\"message\")->JsError.throw`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/syntaxerror": { - "id": "Stdlib.JsError.SyntaxError", - "name": "SyntaxError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.SyntaxError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `SyntaxError` with the provided `message`.\n\n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.SyntaxError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `SyntaxError` with the provided `message` and throws it.\n \n `JsError.SyntaxError.throwWithMessage(\"message\")` is equivalent to `JsError.SyntaxError.make(\"message\")->JsError.throw`.\n \n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/referenceerror": { - "id": "Stdlib.JsError.ReferenceError", - "name": "ReferenceError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.ReferenceError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `ReferenceError` with the provided `message`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.ReferenceError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `ReferenceError` with the provided `message` and throws it.\n\n `JsError.ReferenceError.throwWithMessage(\"message\")` is equivalent to `JsError.ReferenceError.make(\"message\")->JsError.throw`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/rangeerror": { - "id": "Stdlib.JsError.RangeError", - "name": "RangeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.RangeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `RangeError` with the provided `message`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.RangeError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `RangeError` with the provided `message` and throws it.\n \n `JsError.RangeError.throwWithMessage(\"message\")` is equivalent to `JsError.RangeError.make(\"message\")->JsError.throw`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/evalerror": { - "id": "Stdlib.JsError.EvalError", - "name": "EvalError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.EvalError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `EvalError` with the provided `message`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.EvalError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `EvalError` with the provided `message` and throws it.\n\n `JsError.EvalError.throwWithMessage(\"message\")` is equivalent to `JsError.EvalError.make(\"message\")->JsError.throw`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/intl/segments": { - "id": "Stdlib.Intl.Segments", - "name": "Segments", - "docstrings": [ - "Bindings to `Segments` objects produced by `Intl.Segmenter.segment`.\n A Segments instance is an object that represents the segments of a specific string, subject to the locale and options of its constructing Intl.Segmenter instance.\nhttps://tc39.es/ecma402/#sec-segments-objects.\n\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment) for API details and the [ECMA-402 specification](https://tc39.es/ecma402/#sec-segments-objects) for the object shape." - ], - "items": [ - { - "id": "Stdlib.Intl.Segments.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Segments.segmentData", - "kind": "type", - "name": "segmentData", - "docstrings": [], - "signature": "type segmentData = {\n segment: string,\n index: int,\n isWordLike: option,\n input: string,\n}" - }, - { - "id": "Stdlib.Intl.Segments.containing", - "kind": "value", - "name": "containing", - "docstrings": [ - "`containing(segments)` returns the segment data for the index supplied when iterating.\n\nUse this when consuming `Segments` via iteration helpers where the index is already implied." - ], - "signature": "let containing: t => segmentData" - }, - { - "id": "Stdlib.Intl.Segments.containingWithIndex", - "kind": "value", - "name": "containingWithIndex", - "docstrings": [ - "`containingWithIndex(segments, index)` returns the segment that contains `index` within the original string.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #word})\nlet segments = segmenter->Intl.Segmenter.segment(\"Hello world\")\nIntl.Segments.containingWithIndex(segments, 0).segment == \"Hello\"\n```" - ], - "signature": "let containingWithIndex: (t, int) => segmentData" - }, - { - "id": "Stdlib.Intl.Segments.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(segments)` ignores the provided segments and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/segmenter": { - "id": "Stdlib.Intl.Segmenter", - "name": "Segmenter", - "docstrings": [ - "Bindings to JavaScript's `Intl.Segmenter`.\n\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter) for API details." - ], - "items": [ - { - "id": "Stdlib.Intl.Segmenter.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Segmenter.granularity", - "kind": "type", - "name": "granularity", - "docstrings": [], - "signature": "type granularity = [#grapheme | #sentence | #word]" - }, - { - "id": "Stdlib.Intl.Segmenter.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n granularity?: granularity,\n}" - }, - { - "id": "Stdlib.Intl.Segmenter.pluralCategories", - "kind": "type", - "name": "pluralCategories", - "docstrings": [], - "signature": "type pluralCategories = [\n | #few\n | #many\n | #one\n | #other\n | #two\n | #zero\n]" - }, - { - "id": "Stdlib.Intl.Segmenter.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n granularity: granularity,\n}" - }, - { - "id": "Stdlib.Intl.Segmenter.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.Segmenter.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.Segmenter` instance for segmenting strings.\n\nSee [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter) on MDN.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #word})\nIntl.Segmenter.resolvedOptions(segmenter).granularity == #word\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.Segmenter.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for segmentation.\n\nSee [`Intl.Segmenter.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.Segmenter.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.Segmenter.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(segmenter)` returns the locale and granularity currently in use.\n\nSee [`Intl.Segmenter.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #sentence})\nIntl.Segmenter.resolvedOptions(segmenter).granularity == #sentence\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.Segmenter.segment", - "kind": "value", - "name": "segment", - "docstrings": [ - "`segment(segmenter, input)` returns a `Segments` object describing `input`.\n\nSee [`Intl.Segmenter.prototype.segment`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment) on MDN.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #word})\nlet segments = segmenter->Intl.Segmenter.segment(\"Hello world\")\nIntl.Segments.containingWithIndex(segments, 0).segment == \"Hello\"\n```" - ], - "signature": "let segment: (t, string) => Intl_Segments.t" - }, - { - "id": "Stdlib.Intl.Segmenter.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(segmenter)` ignores the provided segmenter and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/relativetimeformat": { - "id": "Stdlib.Intl.RelativeTimeFormat", - "name": "RelativeTimeFormat", - "docstrings": [ - "Bindings to JavaScript's `Intl.RelativeTimeFormat`.\n\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) for API details." - ], - "items": [ - { - "id": "Stdlib.Intl.RelativeTimeFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.numeric", - "kind": "type", - "name": "numeric", - "docstrings": [], - "signature": "type numeric = [#always | #auto]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.style", - "kind": "type", - "name": "style", - "docstrings": [], - "signature": "type style = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.timeUnit", - "kind": "type", - "name": "timeUnit", - "docstrings": [], - "signature": "type timeUnit = [\n | #day\n | #hour\n | #minute\n | #month\n | #quarter\n | #second\n | #week\n | #year\n]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n numeric?: numeric,\n style?: style,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n numeric: numeric,\n style: style,\n numberingSystem: string,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.relativeTimePartComponent", - "kind": "type", - "name": "relativeTimePartComponent", - "docstrings": [], - "signature": "type relativeTimePartComponent = [#integer | #literal]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.relativeTimePart", - "kind": "type", - "name": "relativeTimePart", - "docstrings": [], - "signature": "type relativeTimePart = {\n \\\"type\": relativeTimePartComponent,\n value: string,\n unit?: timeUnit,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.RelativeTimeFormat` instance for formatting relative time strings.\n\nSee [`Intl.RelativeTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en-US\"])\nformatter->Intl.RelativeTimeFormat.format(1, #day)->String.length > 0\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for relative time formatting.\n\nSee [`Intl.RelativeTimeFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.RelativeTimeFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the locale and options currently in use.\n\nSee [`Intl.RelativeTimeFormat.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en-US\"])\nIntl.RelativeTimeFormat.resolvedOptions(formatter).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, value, unit)` returns the formatted string for `value` expressed in `unit`.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en\"])\nformatter->Intl.RelativeTimeFormat.format(-1, #day)->String.length > 0\n```" - ], - "signature": "let format: (t, int, timeUnit) => string" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, value, unit)` returns an array describing how the output string is assembled.\n\nSee [`Intl.RelativeTimeFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en\"])\nformatter->Intl.RelativeTimeFormat.formatToParts(-1, #day)->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, int, timeUnit) => array" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(relativeTimeFormat)` ignores the provided relativeTimeFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/pluralrules": { - "id": "Stdlib.Intl.PluralRules", - "name": "PluralRules", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.PluralRules.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.PluralRules.localeType", - "kind": "type", - "name": "localeType", - "docstrings": [], - "signature": "type localeType = [#cardinal | #ordinal]" - }, - { - "id": "Stdlib.Intl.PluralRules.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n \\\"type\"?: localeType,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" - }, - { - "id": "Stdlib.Intl.PluralRules.pluralCategories", - "kind": "type", - "name": "pluralCategories", - "docstrings": [], - "signature": "type pluralCategories = [\n | #few\n | #many\n | #one\n | #other\n | #two\n | #zero\n]" - }, - { - "id": "Stdlib.Intl.PluralRules.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n pluralCategories: array,\n \\\"type\": localeType,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" - }, - { - "id": "Stdlib.Intl.PluralRules.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.PluralRules.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.PluralRules` instance to determine plural categories.\n\nSee [`Intl.PluralRules`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules) on MDN.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nlet category = rules->Intl.PluralRules.select(1.0)\ncategory == #one\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.PluralRules.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for plural rules.\n\nSee [`Intl.PluralRules.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.PluralRules.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.PluralRules.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(rules)` returns the plural rule configuration in use.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nIntl.PluralRules.resolvedOptions(rules).locale == \"en\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.PluralRules.rule", - "kind": "type", - "name": "rule", - "docstrings": [], - "signature": "type rule = [#few | #many | #one | #other | #two | #zero]" - }, - { - "id": "Stdlib.Intl.PluralRules.select", - "kind": "value", - "name": "select", - "docstrings": [ - "`select(rules, value)` returns the plural category for the given number.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.select(1.) == #one\n```" - ], - "signature": "let select: (t, float) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.selectInt", - "kind": "value", - "name": "selectInt", - "docstrings": [ - "`selectInt(rules, value)` is like `select` but accepts an integer.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.selectInt(2) == #other\n```" - ], - "signature": "let selectInt: (t, int) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.selectRange", - "kind": "value", - "name": "selectRange", - "docstrings": [ - "`selectRange(rules, ~start, ~end)` returns the category for numbers in the range.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.selectRange(~start=1., ~end=2.) == #other\n```" - ], - "signature": "let selectRange: (t, ~start: float, ~end: float) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.selectRangeInt", - "kind": "value", - "name": "selectRangeInt", - "docstrings": [ - "`selectRangeInt(rules, ~start, ~end)` is the integer version of `selectRange`.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.selectRangeInt(~start=1, ~end=1) == #other\n```" - ], - "signature": "let selectRangeInt: (t, ~start: int, ~end: int) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(pluralRules)` ignores the provided pluralRules and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/numberformat": { - "id": "Stdlib.Intl.NumberFormat", - "name": "NumberFormat", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.NumberFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.NumberFormat.currency", - "kind": "type", - "name": "currency", - "docstrings": [ - "An ISO 4217 currency code. e.g. USD, EUR, CNY" - ], - "signature": "type currency = string" - }, - { - "id": "Stdlib.Intl.NumberFormat.currencyDisplay", - "kind": "type", - "name": "currencyDisplay", - "docstrings": [], - "signature": "type currencyDisplay = [\n | #code\n | #name\n | #narrowSymbol\n | #symbol\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.currencySign", - "kind": "type", - "name": "currencySign", - "docstrings": [], - "signature": "type currencySign = [#accounting | #standard]" - }, - { - "id": "Stdlib.Intl.NumberFormat.notation", - "kind": "type", - "name": "notation", - "docstrings": [], - "signature": "type notation = [\n | #compact\n | #engineering\n | #scientific\n | #standard\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.compactDisplay", - "kind": "type", - "name": "compactDisplay", - "docstrings": [ - "Used only when notation is #compact" - ], - "signature": "type compactDisplay = [#long | #short]" - }, - { - "id": "Stdlib.Intl.NumberFormat.signDisplay", - "kind": "type", - "name": "signDisplay", - "docstrings": [], - "signature": "type signDisplay = [\n | #always\n | #auto\n | #exceptZero\n | #negative\n | #never\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.style", - "kind": "type", - "name": "style", - "docstrings": [], - "signature": "type style = [#currency | #decimal | #percent | #unit]" - }, - { - "id": "Stdlib.Intl.NumberFormat.unitSystem", - "kind": "type", - "name": "unitSystem", - "docstrings": [ - "Defined in https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier\nOnly used when style is #unit" - ], - "signature": "type unitSystem = string" - }, - { - "id": "Stdlib.Intl.NumberFormat.unitDisplay", - "kind": "type", - "name": "unitDisplay", - "docstrings": [ - "Only used when style is #unit" - ], - "signature": "type unitDisplay = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.NumberFormat.rounding", - "kind": "type", - "name": "rounding", - "docstrings": [], - "signature": "type rounding = [\n | #ceil\n | #expand\n | #floor\n | #halfCeil\n | #halfEven\n | #halfExpand\n | #halfFloor\n | #halfTrunc\n | #trunc\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.roundingPriority", - "kind": "type", - "name": "roundingPriority", - "docstrings": [], - "signature": "type roundingPriority = [\n | #auto\n | #lessPrecision\n | #morePrecision\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.roundingIncrement", - "kind": "type", - "name": "roundingIncrement", - "docstrings": [], - "signature": "type roundingIncrement = [\n | #1\n | #10\n | #100\n | #1000\n | #2\n | #20\n | #200\n | #2000\n | #25\n | #250\n | #2500\n | #5\n | #50\n | #500\n | #5000\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.trailingZeroDisplay", - "kind": "type", - "name": "trailingZeroDisplay", - "docstrings": [], - "signature": "type trailingZeroDisplay = [\n | #auto\n | #lessPrecision\n | #stripIfInteger\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n compactDisplay?: compactDisplay,\n numberingSystem?: Intl_Common.numberingSystem,\n currency?: currency,\n currencyDisplay?: currencyDisplay,\n currencySign?: currencySign,\n localeMatcher?: Intl_Common.localeMatcher,\n notation?: notation,\n signDisplay?: signDisplay,\n style?: style,\n unit?: unitSystem,\n unitDisplay?: unitDisplay,\n useGrouping?: Grouping.t,\n roundingMode?: rounding,\n roundingPriority?: roundingPriority,\n roundingIncrement?: roundingIncrement,\n trailingZeroDisplay?: trailingZeroDisplay,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n currency?: currency,\n currencyDisplay?: currencyDisplay,\n currencySign?: currencySign,\n compactDisplay?: compactDisplay,\n unit: unitSystem,\n unitDisplay: unitDisplay,\n roundingMode?: rounding,\n roundingPriority?: roundingPriority,\n roundingIncrement?: roundingIncrement,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n locale: string,\n notation: notation,\n numberingSystem: Intl_Common.numberingSystem,\n signDisplay: signDisplay,\n style: style,\n useGrouping: Grouping.t,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.numberFormatPartType", - "kind": "type", - "name": "numberFormatPartType", - "docstrings": [], - "signature": "type numberFormatPartType = [\n | #compact\n | #currency\n | #decimal\n | #exponentInteger\n | #exponentMinusSign\n | #exponentSeparator\n | #fraction\n | #group\n | #infinity\n | #integer\n | #literal\n | #minusSign\n | #nan\n | #percentSign\n | #plusSign\n | #unit\n | #unknown\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.numberFormatPart", - "kind": "type", - "name": "numberFormatPart", - "docstrings": [], - "signature": "type numberFormatPart = {\n \\\"type\": numberFormatPartType,\n value: string,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.rangeSource", - "kind": "type", - "name": "rangeSource", - "docstrings": [], - "signature": "type rangeSource = [#endRange | #shared | #startRange]" - }, - { - "id": "Stdlib.Intl.NumberFormat.numberFormatRangePart", - "kind": "type", - "name": "numberFormatRangePart", - "docstrings": [], - "signature": "type numberFormatRangePart = {\n \\\"type\": numberFormatPartType,\n value: string,\n source: rangeSource,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.NumberFormat` instance for locale-aware number formatting.\n\nSee [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"], ~options={style: #currency, currency: \"USD\"})\nformatter->Intl.NumberFormat.format(1234.5) == \"$1,234.50\"\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.NumberFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for number formatting.\n\nSee [`Intl.NumberFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.NumberFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the actual options being used.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nIntl.NumberFormat.resolvedOptions(formatter).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.NumberFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, value)` returns the formatted representation of `value`.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.format(1234.5) == \"1,234.5\"\n```" - ], - "signature": "let format: (t, float) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatRange", - "kind": "value", - "name": "formatRange", - "docstrings": [ - "`formatRange(formatter, ~start, ~end)` formats numbers representing a range.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.formatRange(~start=1., ~end=2.)->String.length > 0\n```" - ], - "signature": "let formatRange: (t, ~start: float, ~end: float) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, value)` breaks the formatted result into parts.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.formatToParts(123)->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, float) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatRangeToParts", - "kind": "value", - "name": "formatRangeToParts", - "docstrings": [ - "`formatRangeToParts(formatter, ~start, ~end)` returns how the range would be rendered.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.formatRangeToParts(~start=1., ~end=2.)->Array.length > 0\n```" - ], - "signature": "let formatRangeToParts: (\n t,\n ~start: float,\n ~end: float,\n) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatInt", - "kind": "value", - "name": "formatInt", - "docstrings": [ - "`formatInt(formatter, value)` formats integer values.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatInt(42) == \"42\"\n```" - ], - "signature": "let formatInt: (t, int) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatIntRange", - "kind": "value", - "name": "formatIntRange", - "docstrings": [ - "`formatIntRange(formatter, ~start, ~end)` formats integer ranges.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatIntRange(~start=1, ~end=3)->String.length > 0\n```" - ], - "signature": "let formatIntRange: (t, ~start: int, ~end: int) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatIntToParts", - "kind": "value", - "name": "formatIntToParts", - "docstrings": [ - "`formatIntToParts(formatter, value)` returns formatting parts for an integer.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatIntToParts(123)->Array.length > 0\n```" - ], - "signature": "let formatIntToParts: (t, int) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatIntRangeToParts", - "kind": "value", - "name": "formatIntRangeToParts", - "docstrings": [ - "`formatIntRangeToParts(formatter, ~start, ~end)` returns how the integer range would be rendered.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatIntRangeToParts(~start=1, ~end=1)->Array.length > 0\n```" - ], - "signature": "let formatIntRangeToParts: (t, ~start: int, ~end: int) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigInt", - "kind": "value", - "name": "formatBigInt", - "docstrings": [ - "`formatBigInt(formatter, value)` formats bigint values." - ], - "signature": "let formatBigInt: (t, bigint) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigIntRange", - "kind": "value", - "name": "formatBigIntRange", - "docstrings": [ - "`formatBigIntRange(formatter, ~start, ~end)` formats a range of bigint values.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatBigIntRange(~start=1n, ~end=2n) == \"1–2\"\n```" - ], - "signature": "let formatBigIntRange: (t, ~start: bigint, ~end: bigint) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigIntToParts", - "kind": "value", - "name": "formatBigIntToParts", - "docstrings": [ - "`formatBigIntToParts(formatter, value)` returns the bigint formatting broken into parts.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatBigIntToParts(5n)->Array.length > 0\n```" - ], - "signature": "let formatBigIntToParts: (t, bigint) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigIntRangeToParts", - "kind": "value", - "name": "formatBigIntRangeToParts", - "docstrings": [ - "`formatBigIntRangeToParts(formatter, ~start, ~end)` describes how the bigint range would be rendered.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatBigIntRangeToParts(~start=3n, ~end=4n)->Array.length > 0\n```" - ], - "signature": "let formatBigIntRangeToParts: (\n t,\n ~start: bigint,\n ~end: bigint,\n) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatString", - "kind": "value", - "name": "formatString", - "docstrings": [ - "`formatString(formatter, value)` interprets `value` as a number string and formats it.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatString(\"1234\") == \"1,234\"\n```" - ], - "signature": "let formatString: (t, string) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatStringToParts", - "kind": "value", - "name": "formatStringToParts", - "docstrings": [ - "`formatStringToParts(formatter, value)` returns formatting parts for a numeric string.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatStringToParts(\"123\")->Array.length > 0\n```" - ], - "signature": "let formatStringToParts: (t, string) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(numberFormat)` ignores the provided numberFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/locale": { - "id": "Stdlib.Intl.Locale", - "name": "Locale", - "docstrings": [ - "Bindings to JavaScript's `Intl.Locale`." - ], - "items": [ - { - "id": "Stdlib.Intl.Locale.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Locale.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n baseName?: string,\n calendar?: Intl_Common.calendar,\n collation?: Intl_Common.collation,\n hourCycle?: [#h11 | #h12 | #h23 | #h24],\n caseFirst?: [#\"false\" | #lower | #upper],\n numberingSystem?: Intl_Common.numberingSystem,\n numeric?: bool,\n language?: string,\n script?: string,\n region?: string,\n}" - }, - { - "id": "Stdlib.Intl.Locale.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.Locale` object from a locale identifier and optional modifiers.\n\nSee [`Intl.Locale`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en-US\")\nlocale->Intl.Locale.language == \"en\"\n```" - ], - "signature": "let make: (string, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.Locale.baseName", - "kind": "value", - "name": "baseName", - "docstrings": [ - "`baseName(locale)` returns the canonical base name (without Unicode extensions).\n\nSee [`Intl.Locale.prototype.baseName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/baseName) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"fr-CA\")\nlocale->Intl.Locale.baseName == \"fr-CA\"\n```" - ], - "signature": "let baseName: t => string" - }, - { - "id": "Stdlib.Intl.Locale.calendar", - "kind": "value", - "name": "calendar", - "docstrings": [ - "`calendar(locale)` returns the specified calendar, if present.\n\nSee [`Intl.Locale.prototype.calendar`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/calendar) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={calendar: #gregory})\nlocale->Intl.Locale.calendar == Some(\"gregory\")\n```" - ], - "signature": "let calendar: t => option" - }, - { - "id": "Stdlib.Intl.Locale.caseFirst", - "kind": "value", - "name": "caseFirst", - "docstrings": [ - "`caseFirst(locale)` returns the case-first ordering setting, if present.\n\nSee [`Intl.Locale.prototype.caseFirst`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/caseFirst) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={caseFirst: #upper})\nlocale->Intl.Locale.caseFirst == Some(\"upper\")\n```" - ], - "signature": "let caseFirst: t => option" - }, - { - "id": "Stdlib.Intl.Locale.collation", - "kind": "value", - "name": "collation", - "docstrings": [ - "`collation(locale)` returns the collation type, if present.\n\nSee [`Intl.Locale.prototype.collation`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/collation) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={collation: #phonebk})\nlocale->Intl.Locale.collation == Some(\"phonebk\")\n```" - ], - "signature": "let collation: t => option" - }, - { - "id": "Stdlib.Intl.Locale.hourCycle", - "kind": "value", - "name": "hourCycle", - "docstrings": [ - "`hourCycle(locale)` returns the preferred hour cycle, if present.\n\nSee [`Intl.Locale.prototype.hourCycle`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={hourCycle: #h12})\nlocale->Intl.Locale.hourCycle == Some(\"h12\")\n```" - ], - "signature": "let hourCycle: t => option" - }, - { - "id": "Stdlib.Intl.Locale.language", - "kind": "value", - "name": "language", - "docstrings": [ - "`language(locale)` returns the primary language subtag.\n\nSee [`Intl.Locale.prototype.language`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/language) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"pt-BR\")\nlocale->Intl.Locale.language == \"pt\"\n```" - ], - "signature": "let language: t => string" - }, - { - "id": "Stdlib.Intl.Locale.numberingSystem", - "kind": "value", - "name": "numberingSystem", - "docstrings": [ - "`numberingSystem(locale)` returns the numbering system identifier, if present.\n\nSee [`Intl.Locale.prototype.numberingSystem`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/numberingSystem) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={numberingSystem: #latn})\nlocale->Intl.Locale.numberingSystem == Some(\"latn\")\n```" - ], - "signature": "let numberingSystem: t => option" - }, - { - "id": "Stdlib.Intl.Locale.numeric", - "kind": "value", - "name": "numeric", - "docstrings": [ - "`numeric(locale)` indicates whether numeric ordering should be used for region subtags.\n\nSee [`Intl.Locale.prototype.numeric`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/numeric) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={numeric: true})\nlocale->Intl.Locale.numeric == true\n```" - ], - "signature": "let numeric: t => bool" - }, - { - "id": "Stdlib.Intl.Locale.region", - "kind": "value", - "name": "region", - "docstrings": [ - "`region(locale)` returns the region subtag, if present.\n\nSee [`Intl.Locale.prototype.region`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/region) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en-US\")\nlocale->Intl.Locale.region == Some(\"US\")\n```" - ], - "signature": "let region: t => option" - }, - { - "id": "Stdlib.Intl.Locale.script", - "kind": "value", - "name": "script", - "docstrings": [ - "`script(locale)` returns the script subtag, if present.\n\nSee [`Intl.Locale.prototype.script`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/script) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"sr-Cyrl\")\nlocale->Intl.Locale.script == Some(\"Cyrl\")\n```" - ], - "signature": "let script: t => option" - }, - { - "id": "Stdlib.Intl.Locale.maximize", - "kind": "value", - "name": "maximize", - "docstrings": [ - "`maximize(locale)` adds likely subtags to produce the most specific locale.\n\nSee [`Intl.Locale.prototype.maximize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/maximize) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\")\nlocale->Intl.Locale.maximize->Intl.Locale.region == Some(\"US\")\n```" - ], - "signature": "let maximize: t => t" - }, - { - "id": "Stdlib.Intl.Locale.minimize", - "kind": "value", - "name": "minimize", - "docstrings": [ - "`minimize(locale)` removes unnecessary subtags while preserving semantics.\n\nSee [`Intl.Locale.prototype.minimize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/minimize) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en-Latn-US\")\nlocale->Intl.Locale.minimize->Intl.Locale.baseName == \"en\"\n```" - ], - "signature": "let minimize: t => t" - }, - { - "id": "Stdlib.Intl.Locale.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(locale)` ignores the provided locale and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/listformat": { - "id": "Stdlib.Intl.ListFormat", - "name": "ListFormat", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.ListFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.ListFormat.listType", - "kind": "type", - "name": "listType", - "docstrings": [], - "signature": "type listType = [#conjunction | #disjunction | #unit]" - }, - { - "id": "Stdlib.Intl.ListFormat.style", - "kind": "type", - "name": "style", - "docstrings": [], - "signature": "type style = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.ListFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n \\\"type\"?: listType,\n style?: style,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.listPartComponentType", - "kind": "type", - "name": "listPartComponentType", - "docstrings": [], - "signature": "type listPartComponentType = [#element | #literal]" - }, - { - "id": "Stdlib.Intl.ListFormat.listPart", - "kind": "type", - "name": "listPart", - "docstrings": [], - "signature": "type listPart = {\n \\\"type\": listPartComponentType,\n value: string,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n style: style,\n \\\"type\": listType,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.ListFormat` instance for formatting lists.\n\nSee [`Intl.ListFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"], ~options={\\\"type\": #conjunction})\nformatter->Intl.ListFormat.format([\"apples\", \"bananas\", \"cherries\"]) == \"apples, bananas, and cherries\"\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.ListFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for list formatting.\n\nSee [`Intl.ListFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.ListFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.ListFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the actual options being used.\n\nSee [`Intl.ListFormat.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"])\nIntl.ListFormat.resolvedOptions(formatter).locale == \"en\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.ListFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, items)` returns the formatted list string.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"])\nformatter->Intl.ListFormat.format([\"a\", \"b\"]) == \"a and b\"\n```" - ], - "signature": "let format: (t, array) => string" - }, - { - "id": "Stdlib.Intl.ListFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, items)` returns the list as an array of parts describing how it would be rendered.\n\nSee [`Intl.ListFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/formatToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"])\nformatter->Intl.ListFormat.formatToParts([\"a\", \"b\"])->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, array) => array" - }, - { - "id": "Stdlib.Intl.ListFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(listFormat)` ignores the provided listFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/datetimeformat": { - "id": "Stdlib.Intl.DateTimeFormat", - "name": "DateTimeFormat", - "docstrings": [ - "Bindings to JavaScript's `Intl.DateTimeFormat`." - ], - "items": [ - { - "id": "Stdlib.Intl.DateTimeFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateStyle", - "kind": "type", - "name": "dateStyle", - "docstrings": [], - "signature": "type dateStyle = [#full | #long | #medium | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.timeStyle", - "kind": "type", - "name": "timeStyle", - "docstrings": [], - "signature": "type timeStyle = [#full | #long | #medium | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dayPeriod", - "kind": "type", - "name": "dayPeriod", - "docstrings": [], - "signature": "type dayPeriod = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.weekday", - "kind": "type", - "name": "weekday", - "docstrings": [], - "signature": "type weekday = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.era", - "kind": "type", - "name": "era", - "docstrings": [], - "signature": "type era = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.year", - "kind": "type", - "name": "year", - "docstrings": [], - "signature": "type year = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.month", - "kind": "type", - "name": "month", - "docstrings": [], - "signature": "type month = [\n | #\"2-digit\"\n | #long\n | #narrow\n | #numeric\n | #short\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.day", - "kind": "type", - "name": "day", - "docstrings": [], - "signature": "type day = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.hour", - "kind": "type", - "name": "hour", - "docstrings": [], - "signature": "type hour = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.minute", - "kind": "type", - "name": "minute", - "docstrings": [], - "signature": "type minute = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.second", - "kind": "type", - "name": "second", - "docstrings": [], - "signature": "type second = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.timeZoneName", - "kind": "type", - "name": "timeZoneName", - "docstrings": [ - "Firefox also supports IANA time zone names here\nNode v19+ supports \"shortOffset\", \"shortGeneric\", \"longOffset\", and \"longGeneric\"." - ], - "signature": "type timeZoneName = [\n | #long\n | #longGeneric\n | #longOffset\n | #short\n | #shortGeneric\n | #shortOffset\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.hourCycle", - "kind": "type", - "name": "hourCycle", - "docstrings": [], - "signature": "type hourCycle = [#h11 | #h12 | #h23 | #h24]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatMatcher", - "kind": "type", - "name": "formatMatcher", - "docstrings": [], - "signature": "type formatMatcher = [#basic | #\"best fit\"]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.fractionalSecondDigits", - "kind": "type", - "name": "fractionalSecondDigits", - "docstrings": [], - "signature": "type fractionalSecondDigits = [#0 | #1 | #2 | #3]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n dateStyle?: dateStyle,\n timeStyle?: timeStyle,\n calendar?: Intl_Common.calendar,\n dayPeriod?: dayPeriod,\n numberingSystem?: Intl_Common.numberingSystem,\n localeMatcher?: Intl_Common.localeMatcher,\n timeZone?: string,\n hour12?: bool,\n hourCycle?: hourCycle,\n formatMatcher?: formatMatcher,\n weekday?: weekday,\n era?: era,\n year?: year,\n month?: month,\n day?: day,\n hour?: hour,\n minute?: minute,\n second?: second,\n fractionalSecondDigits?: fractionalSecondDigits,\n timeZoneName?: timeZoneName,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n dateStyle?: dateStyle,\n timeStyle?: timeStyle,\n weekday?: weekday,\n era?: era,\n year?: year,\n month?: month,\n day?: day,\n hour?: hour,\n minute?: minute,\n second?: second,\n fractionalSecondDigits?: fractionalSecondDigits,\n timeZoneName?: timeZoneName,\n calendar: Intl_Common.calendar,\n hour12: bool,\n hourCycle: hourCycle,\n locale: string,\n numberingSystem: Intl_Common.numberingSystem,\n timeZone: string,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimeComponent", - "kind": "type", - "name": "dateTimeComponent", - "docstrings": [], - "signature": "type dateTimeComponent = [\n | #day\n | #dayPeriod\n | #era\n | #fractionalSecond\n | #hour\n | #literal\n | #minute\n | #month\n | #relatedYear\n | #second\n | #timeZone\n | #weekday\n | #year\n | #yearName\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimePart", - "kind": "type", - "name": "dateTimePart", - "docstrings": [], - "signature": "type dateTimePart = {\n \\\"type\": dateTimeComponent,\n value: string,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimeRangeSource", - "kind": "type", - "name": "dateTimeRangeSource", - "docstrings": [], - "signature": "type dateTimeRangeSource = [\n | #endRange\n | #shared\n | #startRange\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimeRangePart", - "kind": "type", - "name": "dateTimeRangePart", - "docstrings": [], - "signature": "type dateTimeRangePart = {\n \\\"type\": dateTimeComponent,\n value: string,\n source: dateTimeRangeSource,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.DateTimeFormat` instance for formatting date values.\n\nSee [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"], ~options={timeStyle: #short})\nlet sampleDate = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nformatter->Intl.DateTimeFormat.format(sampleDate)->String.length > 0\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported by the runtime for date/time formatting.\n\nSee [`Intl.DateTimeFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.DateTimeFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the actual locale and formatting options in use.\n\nSee [`Intl.DateTimeFormat.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"])\nIntl.DateTimeFormat.resolvedOptions(formatter).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, date)` returns the formatted string for `date`.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en\"])\nlet date = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nformatter->Intl.DateTimeFormat.format(date)->String.length > 0\n```" - ], - "signature": "let format: (t, Date.t) => string" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, date)` breaks the formatted output into an array of parts.\n\nSee [`Intl.DateTimeFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en\"])\nlet date = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nformatter->Intl.DateTimeFormat.formatToParts(date)->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, Date.t) => array" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatRange", - "kind": "value", - "name": "formatRange", - "docstrings": [ - "`formatRange(formatter, ~startDate, ~endDate)` formats the range between `startDate` and `endDate`.\n\nSee [`Intl.DateTimeFormat.prototype.formatRange`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatRange) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"], ~options={dateStyle: #short})\nlet startDate = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nlet endDate = Js.Date.makeWithYMD(~year=2024, ~month=1, ~date=1)\nformatter->Intl.DateTimeFormat.formatRange(~startDate=startDate, ~endDate=endDate)->String.length > 0\n```" - ], - "signature": "let formatRange: (t, ~startDate: Date.t, ~endDate: Date.t) => string" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatRangeToParts", - "kind": "value", - "name": "formatRangeToParts", - "docstrings": [ - "`formatRangeToParts(formatter, ~startDate, ~endDate)` returns an array describing how the range would be rendered.\n\nSee [`Intl.DateTimeFormat.prototype.formatRangeToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatRangeToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"], ~options={dateStyle: #short})\nlet startDate = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nlet endDate = Js.Date.makeWithYMD(~year=2024, ~month=1, ~date=1)\nformatter->Intl.DateTimeFormat.formatRangeToParts(~startDate=startDate, ~endDate=endDate)->Array.length > 0\n```" - ], - "signature": "let formatRangeToParts: (\n t,\n ~startDate: Date.t,\n ~endDate: Date.t,\n) => array" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(dateTimeFormat)` ignores the provided dateTimeFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/collator": { - "id": "Stdlib.Intl.Collator", - "name": "Collator", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.Collator.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Collator.usage", - "kind": "type", - "name": "usage", - "docstrings": [], - "signature": "type usage = [#search | #sort]" - }, - { - "id": "Stdlib.Intl.Collator.sensitivity", - "kind": "type", - "name": "sensitivity", - "docstrings": [], - "signature": "type sensitivity = [#accent | #base | #case | #variant]" - }, - { - "id": "Stdlib.Intl.Collator.caseFirst", - "kind": "type", - "name": "caseFirst", - "docstrings": [], - "signature": "type caseFirst = [#\"false\" | #lower | #upper]" - }, - { - "id": "Stdlib.Intl.Collator.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n usage?: usage,\n sensitivity?: sensitivity,\n ignorePunctuation?: bool,\n numeric?: bool,\n caseFirst?: caseFirst,\n}" - }, - { - "id": "Stdlib.Intl.Collator.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n usage: usage,\n sensitivity: sensitivity,\n ignorePunctuation: bool,\n collation: [\n | #compat\n | #default\n | #dict\n | #emoji\n | #eor\n | #phonebk\n | #phonetic\n | #pinyin\n | #stroke\n | #trad\n | #unihan\n | #zhuyin\n ],\n numeric?: bool,\n caseFirst?: caseFirst,\n}" - }, - { - "id": "Stdlib.Intl.Collator.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.Collator.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.Collator` instance that can compare strings using locale-aware rules.\n\nSee [`Intl.Collator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) on MDN.\n\n## Examples\n\n```rescript\nlet collator = Intl.Collator.make(~locales=[\"en\"])\ncollator->Intl.Collator.compare(\"apple\", \"banana\") < 0\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.Collator.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported by the runtime for collation.\n\nSee [`Intl.Collator.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.Collator.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.Collator.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(collator)` returns the locale and collation settings in use.\n\nSee [`Intl.Collator.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet collator = Intl.Collator.make(~locales=[\"en-US\"])\nIntl.Collator.resolvedOptions(collator).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.Collator.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(collator, a, b)` compares two strings using the rules of `collator`. Returns a negative number when `a` comes before `b`, `0` when equal, and a positive number otherwise.\n\n## Examples\n\n```rescript\nlet collator = Intl.Collator.make(~locales=[\"en-US\"])\nOrdering.isLess(collator->Intl.Collator.compare(\"apple\", \"banana\"))\n```" - ], - "signature": "let compare: (t, string, string) => Ordering.t" - }, - { - "id": "Stdlib.Intl.Collator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(collator)` ignores the provided collator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/common": { - "id": "Stdlib.Intl.Common", - "name": "Common", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.Common.localeMatcher", - "kind": "type", - "name": "localeMatcher", - "docstrings": [], - "signature": "type localeMatcher = [#\"best fit\" | #lookup]" - }, - { - "id": "Stdlib.Intl.Common.calendar", - "kind": "type", - "name": "calendar", - "docstrings": [], - "signature": "type calendar = [\n | #buddhist\n | #chinese\n | #coptic\n | #dangi\n | #ethioaa\n | #ethiopic\n | #gregory\n | #hebrew\n | #indian\n | #islamic\n | #\"islamic-civil\"\n | #\"islamic-rgsa\"\n | #\"islamic-tbla\"\n | #\"islamic-umalqura\"\n | #iso8601\n | #japanese\n | #persian\n | #roc\n]" - }, - { - "id": "Stdlib.Intl.Common.collation", - "kind": "type", - "name": "collation", - "docstrings": [], - "signature": "type collation = [\n | #compat\n | #dict\n | #emoji\n | #eor\n | #phonebk\n | #phonetic\n | #pinyin\n | #stroke\n | #trad\n | #unihan\n | #zhuyin\n]" - }, - { - "id": "Stdlib.Intl.Common.numberingSystem", - "kind": "type", - "name": "numberingSystem", - "docstrings": [], - "signature": "type numberingSystem = [\n | #adlm\n | #ahom\n | #arab\n | #arabext\n | #bali\n | #beng\n | #bhks\n | #brah\n | #cakm\n | #cham\n | #deva\n | #diak\n | #fullwide\n | #gong\n | #gonm\n | #gujr\n | #guru\n | #hanidec\n | #hmng\n | #hmnp\n | #java\n | #kali\n | #kawi\n | #khmr\n | #knda\n | #lana\n | #lanatham\n | #laoo\n | #latn\n | #lepc\n | #limb\n | #mathbold\n | #mathdbl\n | #mathmono\n | #mathsanb\n | #mathsans\n | #mlym\n | #modi\n | #mong\n | #mroo\n | #mtei\n | #mymr\n | #mymrshan\n | #mymrtlng\n | #nagm\n | #newa\n | #nkoo\n | #olck\n | #orya\n | #osma\n | #rohg\n | #saur\n | #segment\n | #shrd\n | #sind\n | #sinh\n | #sora\n | #sund\n | #takr\n | #talu\n | #tamldec\n | #telu\n | #thai\n | #tibt\n | #tirh\n | #tnsa\n | #vaii\n | #wara\n | #wcho\n]" - }, - { - "id": "Stdlib.Intl.Common.oneTo21", - "kind": "type", - "name": "oneTo21", - "docstrings": [], - "signature": "type oneTo21 = [\n | #1\n | #10\n | #11\n | #12\n | #13\n | #14\n | #15\n | #16\n | #17\n | #18\n | #19\n | #2\n | #20\n | #21\n | #3\n | #4\n | #5\n | #6\n | #7\n | #8\n | #9\n]" - }, - { - "id": "Stdlib.Intl.Common.zeroTo20", - "kind": "type", - "name": "zeroTo20", - "docstrings": [], - "signature": "type zeroTo20 = [\n | #0\n | #1\n | #10\n | #11\n | #12\n | #13\n | #14\n | #15\n | #16\n | #17\n | #18\n | #19\n | #2\n | #20\n | #3\n | #4\n | #5\n | #6\n | #7\n | #8\n | #9\n]" - } - ] - }, - "stdlib/int/ref": { - "id": "Stdlib.Int.Ref", - "name": "Ref", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int.Ref.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = ref" - }, - { - "id": "Stdlib.Int.Ref.increment", - "kind": "value", - "name": "increment", - "docstrings": [ - "`increment(intRef)` increments the value of the provided reference by 1.\n\n ## Examples\n\n ```rescript\n let myRef = ref(4)\n Int.Ref.increment(myRef)\n myRef.contents == 5\n ```" - ], - "signature": "let increment: ref => unit" - }, - { - "id": "Stdlib.Int.Ref.decrement", - "kind": "value", - "name": "decrement", - "docstrings": [ - "`decrement(intRef)` decrements the value of the provided reference by 1.\n\n ## Examples\n\n ```rescript\n let myRef = ref(4)\n Int.Ref.decrement(myRef)\n myRef.contents == 3\n ```" - ], - "signature": "let decrement: ref => unit" - } - ] - }, - "stdlib/int/bitwise": { - "id": "Stdlib.Int.Bitwise", - "name": "Bitwise", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int.Bitwise.land", - "kind": "value", - "name": "land", - "docstrings": [], - "signature": "let land: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lor", - "kind": "value", - "name": "lor", - "docstrings": [], - "signature": "let lor: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lxor", - "kind": "value", - "name": "lxor", - "docstrings": [], - "signature": "let lxor: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lsl", - "kind": "value", - "name": "lsl", - "docstrings": [], - "signature": "let lsl: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lsr", - "kind": "value", - "name": "lsr", - "docstrings": [], - "signature": "let lsr: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.asr", - "kind": "value", - "name": "asr", - "docstrings": [], - "signature": "let asr: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lnot", - "kind": "value", - "name": "lnot", - "docstrings": [], - "signature": "let lnot: int => int", - "deprecated": "" - } - ] - }, - "stdlib/int/constants": { - "id": "Stdlib.Int.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int.Constants.minValue", - "kind": "value", - "name": "minValue", - "docstrings": [ - "The smallest positive number represented in JavaScript.\nSee [`Number.MIN_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE)\non MDN.\n\n ## Examples\n\n ```rescript\n Console.log(Int.Constants.minValue)\n ```" - ], - "signature": "let minValue: int" - }, - { - "id": "Stdlib.Int.Constants.maxValue", - "kind": "value", - "name": "maxValue", - "docstrings": [ - "The largest positive number represented in JavaScript.\nSee [`Number.MAX_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE)\non MDN.\n\n ## Examples\n\n ```rescript\n Console.log(Int.Constants.maxValue)\n ```" - ], - "signature": "let maxValue: int" - } - ] - }, - "stdlib/float/constants": { - "id": "Stdlib.Float.Constants", - "name": "Constants", - "docstrings": [ - "Float constants." - ], - "items": [ - { - "id": "Stdlib.Float.Constants.nan", - "kind": "value", - "name": "nan", - "docstrings": [ - "The special value \"Not a Number\"\nSee [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.nan\n ```" - ], - "signature": "let nan: float" - }, - { - "id": "Stdlib.Float.Constants.epsilon", - "kind": "value", - "name": "epsilon", - "docstrings": [ - "Represents the difference between 1 and the smallest floating point number greater than 1.\nSee [`Number.EPSILON`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.epsilon\n ```" - ], - "signature": "let epsilon: float" - }, - { - "id": "Stdlib.Float.Constants.positiveInfinity", - "kind": "value", - "name": "positiveInfinity", - "docstrings": [ - "The positive Infinity value\nSee [`Number.POSITIVE_INFINITY`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/POSITIVE_INFINITY) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.positiveInfinity\n ```" - ], - "signature": "let positiveInfinity: float" - }, - { - "id": "Stdlib.Float.Constants.negativeInfinity", - "kind": "value", - "name": "negativeInfinity", - "docstrings": [ - "The negative Infinity value\nSee [`Number.NEGATIVE_INFINITY`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.negativeInfinity\n ```" - ], - "signature": "let negativeInfinity: float" - }, - { - "id": "Stdlib.Float.Constants.minValue", - "kind": "value", - "name": "minValue", - "docstrings": [ - "The smallest positive numeric value representable in JavaScript.\nSee [`Number.MIN_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.minValue\n ```" - ], - "signature": "let minValue: float" - }, - { - "id": "Stdlib.Float.Constants.maxValue", - "kind": "value", - "name": "maxValue", - "docstrings": [ - "The maximum positive numeric value representable in JavaScript.\nSee [`Number.MAX_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.minValue\n ```" - ], - "signature": "let maxValue: float" - } - ] - }, - "stdlib/error/urierror": { - "id": "Stdlib.Error.URIError", - "name": "URIError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.URIError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `URIError` with the provided `message`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/typeerror": { - "id": "Stdlib.Error.TypeError", - "name": "TypeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.TypeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `TypeError` with the provided `message`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/syntaxerror": { - "id": "Stdlib.Error.SyntaxError", - "name": "SyntaxError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.SyntaxError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `SyntaxError` with the provided `message`.\n\n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/referenceerror": { - "id": "Stdlib.Error.ReferenceError", - "name": "ReferenceError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.ReferenceError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `ReferenceError` with the provided `message`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/rangeerror": { - "id": "Stdlib.Error.RangeError", - "name": "RangeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.RangeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `RangeError` with the provided `message`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/evalerror": { - "id": "Stdlib.Error.EvalError", - "name": "EvalError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.EvalError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `EvalError` with the provided `message`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/date/utc": { - "id": "Stdlib.Date.UTC", - "name": "UTC", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Date.UTC.makeWithYM", - "kind": "value", - "name": "makeWithYM", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYM(~year=2023, ~month=0)\n // 1672531200000\n \n Date.UTC.makeWithYM(~year=2023, ~month=11)\n // 1701388800000\n \n Date.UTC.makeWithYM(~year=2023, ~month=12)\n // 1704067200000\n \n Date.UTC.makeWithYM(~year=2023, ~month=-1)\n // 1669852800000\n ```" - ], - "signature": "let makeWithYM: (~year: int, ~month: int) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMD", - "kind": "value", - "name": "makeWithYMD", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=20)\n // 1676851200000\n \n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=-1)\n // 1675036800000\n \n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=29)\n // 1677628800000\n ```" - ], - "signature": "let makeWithYMD: (~year: int, ~month: int, ~day: int) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDH", - "kind": "value", - "name": "makeWithYMDH", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=16)\n // 1676908800000\n \n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=24)\n // 1676937600000\n \n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=-1)\n // 1676847600000\n ```" - ], - "signature": "let makeWithYMDH: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDHM", - "kind": "value", - "name": "makeWithYMDHM", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40)\n // 1676911200000\n \n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=60)\n // 1676912400000\n \n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=-1)\n // 1676908740000\n ```" - ], - "signature": "let makeWithYMDHM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDHMS", - "kind": "value", - "name": "makeWithYMDHMS", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0)\n // 1676911200000\n \n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=60)\n // 1676911260000\n \n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=-1)\n // 1676911199000\n ```" - ], - "signature": "let makeWithYMDHMS: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDHMSM", - "kind": "value", - "name": "makeWithYMDHMSM", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=0,\n )->Console.log\n // 1676911200000\n \n Date.UTC.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=1000,\n )->Console.log\n // 1676911201000\n \n Date.UTC.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=-1,\n )->Console.log\n // 1676911199999\n ```" - ], - "signature": "let makeWithYMDHMSM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => msSinceEpoch" - } - ] - }, - "stdlib/biguint64array": { - "id": "Stdlib.BigUint64Array", - "name": "BigUint64Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigUint64Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `BigUint64Array` typed array represents an array of 64-bit unsigned integers in platform byte order. See [BigUint64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.BigUint64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `BigUint64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.BigUint64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `BigUint64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.BigUint64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigUint64Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigUint64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `BigUint64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.BigUint64Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `BigUint64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => bigint=?) => t" - }, - { - "id": "Stdlib.BigUint64Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `BigUint64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigUint64Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bigUintArray)` ignores the provided bigUintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/bigint64array": { - "id": "Stdlib.BigInt64Array", - "name": "BigInt64Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigInt64Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `BigInt64Array` typed array represents an array of 64-bit signed integers in platform byte order. See [BigInt64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.BigInt64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `BigInt64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.BigInt64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `BigInt64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.BigInt64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt64Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `BigInt64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.BigInt64Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `BigInt64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => bigint=?) => t" - }, - { - "id": "Stdlib.BigInt64Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `BigInt64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt64Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bigIntArray)` ignores the provided bigIntArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint8clampedarray": { - "id": "Stdlib.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8ClampedArray.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint8ClampedArray` typed array represents an array of 8-bit unsigned integers clamped to 0-255. See [Uint8ClampedArray on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint8ClampedArray` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint8ClampedArray` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint8ClampedArray` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint8ClampedArray` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8ClampedArray.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint32array": { - "id": "Stdlib.Uint32Array", - "name": "Uint32Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint32Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint32Array` typed array represents an array of 32-bit unsigned integers in platform byte order. See [Uint32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint32Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint32Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint32Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint32Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint32Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint16array": { - "id": "Stdlib.Uint16Array", - "name": "Uint16Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint16Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint16Array` typed array represents an array of 16-bit unsigned integers in platform byte order. See [Uint16Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint16Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint16Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint16Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint16Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint16Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint16Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint16Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint16Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint16Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint16Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint16Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint16Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint8array": { - "id": "Stdlib.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint8Array` typed array represents an array of 8-bit unsigned integers. See [Uint8Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint8Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint8Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint8Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint8Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint8Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint8Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint8Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint8Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint8Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint8Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/int32array": { - "id": "Stdlib.Int32Array", - "name": "Int32Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int32Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Int32Array` typed array represents an array of twos-complemenet 32-bit signed integers in platform byte order. See [Int32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Int32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Int32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Int32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Int32Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Int32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int32Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Int32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Int32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Int32Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Int32Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int32Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/int16array": { - "id": "Stdlib.Int16Array", - "name": "Int16Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int16Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Int16Array` typed array represents an array of twos-complement 16-bit signed integers in platform byte order. See [Int16Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Int16Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int16Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Int16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Int16Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Int16Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int16Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Int16Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Int16Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int16Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Int16Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int16Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int16Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/int8array": { - "id": "Stdlib.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int8Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Int8Array` typed array represents an array of twos-complement 8-bit signed integers. See [Int8Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Int8Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int8Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Int8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Int8Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Int8Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int8Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Int8Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Int8Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int8Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Int8Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int8Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int8Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/float64array": { - "id": "Stdlib.Float64Array", - "name": "Float64Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float64Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Float64Array` typed array represents an array of 64-bit floating point numbers in platform byte order. See [Float64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Float64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Float64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Float64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Float64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Float64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float64Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Float64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Float64Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Float64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => float=?) => t" - }, - { - "id": "Stdlib.Float64Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Float64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float64Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/float32array": { - "id": "Stdlib.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float32Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Float32Array` typed array represents an array of 32-bit floating point numbers in platform byte order. See [Float32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Float32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Float32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Float32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Float32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Float32Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float32Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Float32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Float32Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Float32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => float=?) => t" - }, - { - "id": "Stdlib.Float32Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Float32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float32Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/typedarray": { - "id": "Stdlib.TypedArray", - "name": "TypedArray", - "docstrings": [], - "items": [ - { - "id": "Stdlib.TypedArray.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.TypedArray.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```" - ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```" - ], - "signature": "let set: (t<'a>, int, 'a) => unit" - }, - { - "id": "Stdlib.TypedArray.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [ - "`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN." - ], - "signature": "let buffer: t<'a> => ArrayBuffer.t" - }, - { - "id": "Stdlib.TypedArray.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [ - "`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```" - ], - "signature": "let byteLength: t<'a> => int" - }, - { - "id": "Stdlib.TypedArray.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [ - "`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN." - ], - "signature": "let byteOffset: t<'a> => int" - }, - { - "id": "Stdlib.TypedArray.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [ - "`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```" - ], - "signature": "let setArray: (t<'a>, array<'a>) => unit" - }, - { - "id": "Stdlib.TypedArray.setArrayFrom", - "kind": "value", - "name": "setArrayFrom", - "docstrings": [ - "`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```" - ], - "signature": "let setArrayFrom: (t<'a>, array<'a>, int) => unit" - }, - { - "id": "Stdlib.TypedArray.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```" - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Stdlib.TypedArray.copyAllWithin", - "kind": "value", - "name": "copyAllWithin", - "docstrings": [ - "`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```" - ], - "signature": "let copyAllWithin: (t<'a>, ~target: int) => array<'a>" - }, - { - "id": "Stdlib.TypedArray.copyWithinToEnd", - "kind": "value", - "name": "copyWithinToEnd", - "docstrings": [ - "`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```" - ], - "signature": "let copyWithinToEnd: (t<'a>, ~target: int, ~start: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [ - "`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```" - ], - "signature": "let copyWithin: (t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>" - }, - { - "id": "Stdlib.TypedArray.fillAll", - "kind": "value", - "name": "fillAll", - "docstrings": [ - "`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```" - ], - "signature": "let fillAll: (t<'a>, 'a) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.fillToEnd", - "kind": "value", - "name": "fillToEnd", - "docstrings": [ - "`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array." - ], - "signature": "let fillToEnd: (t<'a>, 'a, ~start: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.fill", - "kind": "value", - "name": "fill", - "docstrings": [ - "`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```" - ], - "signature": "let fill: (t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN." - ], - "signature": "let reverse: t<'a> => unit" - }, - { - "id": "Stdlib.TypedArray.toReversed", - "kind": "value", - "name": "toReversed", - "docstrings": [ - "`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```" - ], - "signature": "let toReversed: t<'a> => t<'a>" - }, - { - "id": "Stdlib.TypedArray.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN." - ], - "signature": "let sort: (t<'a>, ('a, 'a) => Ordering.t) => unit" - }, - { - "id": "Stdlib.TypedArray.toSorted", - "kind": "value", - "name": "toSorted", - "docstrings": [ - "`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```" - ], - "signature": "let toSorted: (t<'a>, ('a, 'a) => Ordering.t) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.with", - "kind": "value", - "name": "with", - "docstrings": [ - "`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```" - ], - "signature": "let with: (t<'a>, int, 'a) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```" - ], - "signature": "let includes: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.TypedArray.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN." - ], - "signature": "let indexOf: (t<'a>, 'a) => int" - }, - { - "id": "Stdlib.TypedArray.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`." - ], - "signature": "let indexOfFrom: (t<'a>, 'a, int) => int" - }, - { - "id": "Stdlib.TypedArray.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```" - ], - "signature": "let joinWith: (t<'a>, string) => string" - }, - { - "id": "Stdlib.TypedArray.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN." - ], - "signature": "let lastIndexOf: (t<'a>, 'a) => int" - }, - { - "id": "Stdlib.TypedArray.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`." - ], - "signature": "let lastIndexOfFrom: (t<'a>, 'a, int) => int" - }, - { - "id": "Stdlib.TypedArray.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN." - ], - "signature": "let slice: (t<'a>, ~start: int, ~end: int=?) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array." - ], - "signature": "let sliceToEnd: (t<'a>, ~start: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(typedArray)` produces a shallow copy of the typed array." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Stdlib.TypedArray.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN." - ], - "signature": "let subarray: (t<'a>, ~start: int, ~end: int=?) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.subarrayToEnd", - "kind": "value", - "name": "subarrayToEnd", - "docstrings": [ - "`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer." - ], - "signature": "let subarrayToEnd: (t<'a>, ~start: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```" - ], - "signature": "let toString: t<'a> => string" - }, - { - "id": "Stdlib.TypedArray.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN." - ], - "signature": "let toLocaleString: t<'a> => string" - }, - { - "id": "Stdlib.TypedArray.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN." - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.everyWithIndex", - "kind": "value", - "name": "everyWithIndex", - "docstrings": [ - "`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`." - ], - "signature": "let everyWithIndex: (t<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN." - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`." - ], - "signature": "let filterWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN." - ], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findWithIndex", - "kind": "value", - "name": "findWithIndex", - "docstrings": [ - "`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index." - ], - "signature": "let findWithIndex: (t<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findLast", - "kind": "value", - "name": "findLast", - "docstrings": [ - "`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN." - ], - "signature": "let findLast: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findLastWithIndex", - "kind": "value", - "name": "findLastWithIndex", - "docstrings": [ - "`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`." - ], - "signature": "let findLastWithIndex: (t<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [ - "`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN." - ], - "signature": "let findIndex: (t<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.TypedArray.findIndexWithIndex", - "kind": "value", - "name": "findIndexWithIndex", - "docstrings": [ - "`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`." - ], - "signature": "let findIndexWithIndex: (t<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.TypedArray.findLastIndex", - "kind": "value", - "name": "findLastIndex", - "docstrings": [ - "`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN." - ], - "signature": "let findLastIndex: (t<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.TypedArray.findLastIndexWithIndex", - "kind": "value", - "name": "findLastIndexWithIndex", - "docstrings": [ - "`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`." - ], - "signature": "let findLastIndexWithIndex: (t<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.TypedArray.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN." - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.TypedArray.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index." - ], - "signature": "let forEachWithIndex: (t<'a>, ('a, int) => unit) => unit" - }, - { - "id": "Stdlib.TypedArray.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.TypedArray.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index." - ], - "signature": "let mapWithIndex: (t<'a>, ('a, int) => 'b) => t<'b>" - }, - { - "id": "Stdlib.TypedArray.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN." - ], - "signature": "let reduce: (t<'a>, ('b, 'a) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`." - ], - "signature": "let reduceWithIndex: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [ - "`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN." - ], - "signature": "let reduceRight: (t<'a>, ('b, 'a) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.reduceRightWithIndex", - "kind": "value", - "name": "reduceRightWithIndex", - "docstrings": [ - "`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`." - ], - "signature": "let reduceRightWithIndex: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN." - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.someWithIndex", - "kind": "value", - "name": "someWithIndex", - "docstrings": [ - "`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index." - ], - "signature": "let someWithIndex: (t<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/arraybuffer": { - "id": "Stdlib.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [ - "Functions for interacting with JavaScript ArrayBuffer.\nSee: [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)." - ], - "items": [ - { - "id": "Stdlib.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an ArrayBuffer object used to represent a generic raw binary data buffer." - ], - "signature": "type t" - }, - { - "id": "Stdlib.ArrayBuffer.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(length)` creates a new ArrayBuffer with the specified length in bytes.\nSee [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/ArrayBuffer) on MDN.\n\n## Examples\n\n```rescript\nlet buffer = ArrayBuffer.make(8)\nArrayBuffer.byteLength(buffer) == 8\n```\n\n## Exceptions\n\n- `RangeError`: If `length` is larger than `Number.MAX_SAFE_INTEGER` or negative." - ], - "signature": "let make: int => t" - }, - { - "id": "Stdlib.ArrayBuffer.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [ - "`byteLength(arrayBuffer)` returns the size, in bytes, of the ArrayBuffer.\nSee [`ArrayBuffer.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet buffer = ArrayBuffer.make(16)\nArrayBuffer.byteLength(buffer) == 16\n```" - ], - "signature": "let byteLength: t => int" - }, - { - "id": "Stdlib.ArrayBuffer.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(arrayBuffer, ~start, ~end)` returns a new ArrayBuffer whose contents are a copy of this ArrayBuffer's bytes from `start`, inclusive, up to `end`, exclusive.\nSee [`ArrayBuffer.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/slice) on MDN.\n\n## Examples\n\n```rescript\nlet buffer = ArrayBuffer.make(16)\nlet sliced = buffer->ArrayBuffer.slice(~start=4, ~end=12)\nArrayBuffer.byteLength(sliced) == 8\n```" - ], - "signature": "let slice: (t, ~start: int=?, ~end: int=?) => t" - }, - { - "id": "Stdlib.ArrayBuffer.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [], - "signature": "let sliceToEnd: (t, ~start: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.ArrayBuffer.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(arrayBuffer)` ignores the provided arrayBuffer and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/weakset": { - "id": "Stdlib.WeakSet", - "name": "WeakSet", - "docstrings": [ - "Bindings to JavaScript's `WeakSet`.\n\nWeak sets store references to objects without preventing those objects from being garbage collected." - ], - "items": [ - { - "id": "Stdlib.WeakSet.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Mutable weak set storing object references of type `'a`." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.WeakSet.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates an empty weak set.\n\nSee [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) on MDN.\n\n## Examples\n\n```rescript\nlet visited = WeakSet.make()\nWeakSet.has(visited, Object.make()) == false\n```" - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Stdlib.WeakSet.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(set, value)` inserts `value` into the weak set and returns the set for chaining.\n\nSee [`WeakSet.prototype.add`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/add) on MDN.\n\n## Examples\n\n```rescript\nlet set = WeakSet.make()\nlet node = Object.make()\nWeakSet.add(set, node)\nWeakSet.has(set, node) == true\n```" - ], - "signature": "let add: (t<'a>, 'a) => t<'a>" - }, - { - "id": "Stdlib.WeakSet.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "`delete(set, value)` removes `value` and returns `true` if an entry existed.\n\nSee [`WeakSet.prototype.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/delete) on MDN.\n\n## Examples\n\n```rescript\nlet set = WeakSet.make()\nlet node = Object.make()\nlet _ = WeakSet.add(set, node)\nWeakSet.delete(set, node) == true\nWeakSet.delete(set, node) == false\n```" - ], - "signature": "let delete: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.WeakSet.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(set, value)` checks whether `value` exists in the weak set.\n\nSee [`WeakSet.prototype.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/has) on MDN.\n\n## Examples\n\n```rescript\nlet set = WeakSet.make()\nlet node = Object.make()\nWeakSet.has(set, node) == false\nlet _ = WeakSet.add(set, node)\nWeakSet.has(set, node) == true\n```" - ], - "signature": "let has: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.WeakSet.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(weakSet)` ignores the provided weakSet and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/set": { - "id": "Stdlib.Set", - "name": "Set", - "docstrings": [ - "Bindings to the mutable JavaScript `Set`.\n\nSee [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) on MDN." - ], - "items": [ - { - "id": "Stdlib.Set.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an instance of `Set`." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.Set.asIterable", - "kind": "value", - "name": "asIterable", - "docstrings": [ - "`asIterable(set)` views `set` as an `Iterable.t`." - ], - "signature": "let asIterable: t<'a> => Iterable.t<'a>" - }, - { - "id": "Stdlib.Set.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new, mutable JavaScript `Set`. A `Set` is a collection of unique values.\n\nSee [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) on MDN.\n\n\n\n## Examples\n```rescript\n// You can annotate the type of your set if you want to\nlet mySet: Set.t = Set.make()\n\n// Or you can let ReScript infer what's in your Set\nlet set = Set.make()\nset->Set.add(\"Fine name\") // Inferred as Set.t\n```\n\n## Alternatives\nA JavaScript `Set` is mutable. If you're looking for an immutable alternative, check out `Belt.Set`." - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Stdlib.Set.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Turns an array of values into a Set. Meaning only unique values are preserved.\n\n## Examples\n```rescript\ntype languages = ReScript | JavaScript | TypeScript\nlet languageRank = [ReScript, JavaScript, TypeScript]\n\nlet set = Set.fromArray(languageRank) // Set.t\n\nswitch set->Set.has(ReScript) {\n| true => Console.log(\"Yay, ReScript is in there!\")\n| false => Console.log(\"Uh-oh, something is _terribly_ wrong with this program... abort.\")\n}\n```" - ], - "signature": "let fromArray: array<'a> => t<'a>" - }, - { - "id": "Stdlib.Set.fromIterable", - "kind": "value", - "name": "fromIterable", - "docstrings": [ - "Turns an iterable into a `Set`.\n\n## Examples\n\n```rescript\nlet iterable: Iterable.t = [\"a\", \"b\", \"c\"]->Array.asIterable\n\niterable\n->Set.fromIterable\n->Set.size == 3\n```" - ], - "signature": "let fromIterable: Iterable.t<'a> => t<'a>" - }, - { - "id": "Stdlib.Set.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns the size, the number of unique values, of the set.\n\nSee [`Set.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/size) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\n\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue2\")\n\nlet size = set->Set.size // 2\n```" - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Stdlib.Set.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(set)` returns `true` if the set has no values, `false` otherwise.\n\n## Examples\n```rescript\nlet emptySet = Set.make()\nemptySet->Set.isEmpty->assertEqual(true)\n\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.isEmpty->assertEqual(false)\n\n// After clearing the set\nset->Set.clear\nset->Set.isEmpty->assertEqual(true)\n```" - ], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Stdlib.Set.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Clears all entries in the set.\n\nSee [`Set.clear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/clear) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\n\nset->Set.add(\"someKey\")\nset->Set.size // 1\n\nset->Set.clear\nset->Set.size // 0\n```" - ], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Stdlib.Set.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds a new value to the set.\n\nSee [`Set.add`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/add) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\n```" - ], - "signature": "let add: (t<'a>, 'a) => unit" - }, - { - "id": "Stdlib.Set.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "Deletes the provided `value` from the set. Returns a `bool` for whether the value existed, and was deleted.\n\nSee [`Set.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nlet didDeleteValue = set->Set.delete(\"someValue\")\nConsole.log(didDeleteValue) // Logs `true` to the console, becuase the set had the value, so it was successfully deleted\n\nlet didDeleteValue = set->Set.delete(\"someNonExistantKey\")\nConsole.log(didDeleteValue) // Logs `false` to the console, becuase the value did not exist in the set\n```" - ], - "signature": "let delete: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.Set.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks whether the set has a specific value.\n\nSee [`Set.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/has) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\n\nswitch set->Set.has(\"someValue\") {\n| false => Console.log(\"Nope, didn't have it.\")\n| true => Console.log(\"Yay, we have the value!\")\n}\n```" - ], - "signature": "let has: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.Set.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Iterates through all values of the set.\n\nSee [`Set.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/forEach) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue2\")\n\nset->Set.forEach(value => {\n Console.log(value)\n})\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Set.values", - "kind": "value", - "name": "values", - "docstrings": [ - "Returns an iterator that holds all values of the set.\n\nSee [`Set.values`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/values) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.add(\"anotherValue\")\n\nlet values = set->Set.values\n\n// Logs the first value\nswitch values->IteratorObject.next {\n| Yield({value}) => Console.log(value)\n| Return(_) => ()\n}\n\n// You can also turn the iterator into an array. Remember that iterators are consumed, so use a fresh one.\nConsole.log(set->Set.values->IteratorObject.toArray)\n```" - ], - "signature": "let values: t<'a> => IteratorObject.t<'a, unit, unknown>" - }, - { - "id": "Stdlib.Set.difference", - "kind": "value", - "name": "difference", - "docstrings": [ - "Returns a new set with the values of the set that are not in the other set.\n\nSee [`Set.difference`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/difference) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.difference(set2) // Set.fromArray([\"orange\"])\n```" - ], - "signature": "let difference: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.symmetricDifference", - "kind": "value", - "name": "symmetricDifference", - "docstrings": [ - "Returns a new set with the values containing the values which are in either the set, but not in both.\n\nSee [`Set.symmetricDifference`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/symmetricDifference) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.symmetricDifference(set2) // Set.fromArray([\"orange\", \"pear\"])\n```" - ], - "signature": "let symmetricDifference: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.intersection", - "kind": "value", - "name": "intersection", - "docstrings": [ - "Returns a new set with the values containing the values which are in both the set and the other set.\n\nSee [`Set.intersection`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/intersection) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.intersection(set2) // Set.fromArray([\"apple\", \"banana\"])\n```" - ], - "signature": "let intersection: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.isDisjointFrom", - "kind": "value", - "name": "isDisjointFrom", - "docstrings": [ - "Returns a bool indicating if this set has no elements in common with the given set.\n\nSee [`Set.isDisjointFrom`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isDisjointFrom) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"kiwi\", \"melon\", \"pear\"])\nset1->Set.isDisjointFrom(set2) // true\n```" - ], - "signature": "let isDisjointFrom: (t<'a>, t<'a>) => bool" - }, - { - "id": "Stdlib.Set.isSubsetOf", - "kind": "value", - "name": "isSubsetOf", - "docstrings": [ - "Returns a bool indicating if the all values in the set are in the given set.\n\nSee [`Set.isSubsetOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isSubsetOf) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.isSubsetOf(set2) // true\n```" - ], - "signature": "let isSubsetOf: (t<'a>, t<'a>) => bool" - }, - { - "id": "Stdlib.Set.isSupersetOf", - "kind": "value", - "name": "isSupersetOf", - "docstrings": [ - "Returns a bool indicating if the all values in the given set are in the set.\n\nSee [`Set.isSupersetOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isSupersetOf) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\"])\nset1->Set.isSupersetOf(set2) // true\n```" - ], - "signature": "let isSupersetOf: (t<'a>, t<'a>) => bool" - }, - { - "id": "Stdlib.Set.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns a new set with the values of the set that are in both the set and the other set.\n\nSee [`Set.union`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/union) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.union(set2) // Set.fromArray([\"apple\", \"orange\", \"banana\", \"pear\"])\n```" - ], - "signature": "let union: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(set)` returns an array of all values of the set.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n```rescript\nlet set = Set.fromArray([\"apple\", \"orange\", \"apple\", \"banana\"])\nset->Set.toArray // [\"apple\", \"orange\", \"banana\"]\n```" - ], - "signature": "let toArray: t<'a> => array<'a>" - }, - { - "id": "Stdlib.Set.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(set)` ignores the provided set and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/weakmap": { - "id": "Stdlib.WeakMap", - "name": "WeakMap", - "docstrings": [ - "Bindings to JavaScript's `WeakMap`.\n\nWeak maps keep key/value pairs where keys must be objects and the references do not prevent garbage collection." - ], - "items": [ - { - "id": "Stdlib.WeakMap.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Mutable weak map storing values of type `'v` with object keys `'k`." - ], - "signature": "type t<'k, 'v>" - }, - { - "id": "Stdlib.WeakMap.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates an empty weak map.\n\nSee [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nWeakMap.get(cache, Object.make()) == None\n```" - ], - "signature": "let make: unit => t<'k, 'v>" - }, - { - "id": "Stdlib.WeakMap.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(map, key)` returns `Some(value)` when `key` exists, otherwise `None`.\n\nSee [`WeakMap.prototype.get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/get) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nWeakMap.get(cache, key) == None\nlet _ = WeakMap.set(cache, key, \"user\")\nWeakMap.get(cache, key) == Some(\"user\")\n```" - ], - "signature": "let get: (t<'k, 'v>, 'k) => option<'v>" - }, - { - "id": "Stdlib.WeakMap.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(map, key)` checks whether `key` exists in the weak map.\n\nSee [`WeakMap.prototype.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/has) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nWeakMap.has(cache, key) == false\nlet _ = WeakMap.set(cache, key, ())\nWeakMap.has(cache, key) == true\n```" - ], - "signature": "let has: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.WeakMap.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(map, key, value)` stores `value` for `key` and returns the map for chaining.\n\nSee [`WeakMap.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/set) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nlet _ = WeakMap.set(cache, key, 42)\nWeakMap.get(cache, key) == Some(42)\n```" - ], - "signature": "let set: (t<'k, 'v>, 'k, 'v) => t<'k, 'v>" - }, - { - "id": "Stdlib.WeakMap.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "`delete(map, key)` removes `key` and returns `true` if an entry existed.\n\nSee [`WeakMap.prototype.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/delete) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nWeakMap.delete(cache, key) == false\nlet _ = WeakMap.set(cache, key, 1)\nWeakMap.delete(cache, key) == true\n```" - ], - "signature": "let delete: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.WeakMap.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(weakMap)` ignores the provided weakMap and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'k, 'v> => unit" - } - ] - }, - "stdlib/map": { - "id": "Stdlib.Map", - "name": "Map", - "docstrings": [ - "Bindings to the mutable JavaScript `Map`.\n\nSee [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) on MDN." - ], - "items": [ - { - "id": "Stdlib.Map.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an instance of `Map`." - ], - "signature": "type t<'k, 'v>" - }, - { - "id": "Stdlib.Map.asIterable", - "kind": "value", - "name": "asIterable", - "docstrings": [ - "`asIterable(map)` views `map` as an `Iterable.t` of key/value pairs." - ], - "signature": "let asIterable: t<'k, 'v> => Iterable.t<('k, 'v)>" - }, - { - "id": "Stdlib.Map.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new, mutable JavaScript `Map`. A `Map` can have any values as both keys and values.\n\nSee [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) on MDN.\n\n\n\n## Examples\n```rescript\n`make()`\n// You can annotate the type of your map if you want to\nlet myMap: Map.t = Map.make()\n\n// Or you can let ReScript infer what's in your map\nlet map = Map.make()\nmap->Map.set(\"lang\", \"ReScript\") // Inferred as Map.t\n```\n\n## Alternatives\nA JavaScript `Map` is mutable. If you're looking for an immutable alternative, check out`Belt.Map`." - ], - "signature": "let make: unit => t<'k, 'v>" - }, - { - "id": "Stdlib.Map.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Turns an array of key/value pairs into a Map.\n\n## Examples\n```rescript\ntype languages = ReScript | JavaScript | TypeScript\nlet languageRank = [(ReScript, 1), (JavaScript, 2), (TypeScript, 3)]\n\nlet map = Map.fromArray(languageRank) // Map.t\n\nswitch map->Map.get(ReScript) {\n| Some(1) => Console.log(\"Yay, ReScript is #1!\")\n| _ => Console.log(\"Uh-oh, something is _terribly_ wrong with this program... abort.\")\n}\n```" - ], - "signature": "let fromArray: array<('k, 'v)> => t<'k, 'v>" - }, - { - "id": "Stdlib.Map.fromIterable", - "kind": "value", - "name": "fromIterable", - "docstrings": [ - "Turns an iterable in the shape of `('key, 'value)` into a `Map`.\n\n## Examples\n\n```rescript\nlet iterable: Iterable.t<(string, string)> = [(\"first\", \"1\"), (\"second\", \"2\")]->Array.asIterable\n\niterable\n->Map.fromIterable\n->Map.size == 2\n```" - ], - "signature": "let fromIterable: Iterable.t<('k, 'v)> => t<'k, 'v>" - }, - { - "id": "Stdlib.Map.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns the size, the number of key/value pairs, of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\n\nmap->Map.set(\"someKey\", \"someValue\")\n\nlet size = map->Map.size // 1\n```" - ], - "signature": "let size: t<'k, 'v> => int" - }, - { - "id": "Stdlib.Map.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(map)` returns `true` if the map has no key/value pairs, `false` otherwise.\n\n## Examples\n```rescript\nlet emptyMap = Map.make()\nemptyMap->Map.isEmpty->assertEqual(true)\n\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.isEmpty->assertEqual(false)\n\n// After clearing the map\nmap->Map.clear\nmap->Map.isEmpty->assertEqual(true)\n```" - ], - "signature": "let isEmpty: t<'k, 'v> => bool" - }, - { - "id": "Stdlib.Map.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Clears all entries in the map.\n\n## Examples\n```rescript\nlet map = Map.make()\n\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.size // 1\n\nmap->Map.clear\nmap->Map.size // 0\n```" - ], - "signature": "let clear: t<'k, 'v> => unit" - }, - { - "id": "Stdlib.Map.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Iterates through all values of the map.\n\n> Please note that this is *without the keys*, just the values. If you need the key as well, use `Map.forEachWithKey`.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\nmap->Map.forEach(value => {\n Console.log(value)\n})\n```" - ], - "signature": "let forEach: (t<'k, 'v>, 'v => unit) => unit" - }, - { - "id": "Stdlib.Map.forEachWithKey", - "kind": "value", - "name": "forEachWithKey", - "docstrings": [ - "Iterates through all values of the map, including the key for each value.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\nmap->Map.forEachWithKey((value, key) => {\n Console.log2(value, key)\n})\n```" - ], - "signature": "let forEachWithKey: (t<'k, 'v>, ('v, 'k) => unit) => unit" - }, - { - "id": "Stdlib.Map.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the value for a key, if a value exists at that key.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n\nswitch map->Map.get(\"someKey\") {\n| None => Console.log(\"Nope, didn't have it.\")\n| Some(value) => Console.log2(\"Yay, had the value, and it's:\", value)\n}\n```" - ], - "signature": "let get: (t<'k, 'v>, 'k) => option<'v>" - }, - { - "id": "Stdlib.Map.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks whether the map has a specific key.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n\nswitch map->Map.has(\"someKey\") {\n| false => Console.log(\"Nope, didn't have it.\")\n| true => Console.log(\"Yay, we have the value!\")\n}\n```" - ], - "signature": "let has: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.Map.set", - "kind": "value", - "name": "set", - "docstrings": [ - "Sets the provided `value` to the provided `key`.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n```" - ], - "signature": "let set: (t<'k, 'v>, 'k, 'v) => unit" - }, - { - "id": "Stdlib.Map.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "Deletes the provided `key` and its value from the map. Returns a `bool` for whether the key existed, and was deleted.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nlet didDeleteKey = map->Map.delete(\"someKey\")\nConsole.log(didDeleteKey) // Logs `true` to the console, becuase the map had the key, so it was successfully deleted\n\nlet didDeleteKey = map->Map.delete(\"someNonExistantKey\")\nConsole.log(didDeleteKey) // Logs `false` to the console, becuase the key did not exist\n```" - ], - "signature": "let delete: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.Map.keys", - "kind": "value", - "name": "keys", - "docstrings": [ - "Returns an iterator that holds all keys of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet keys = map->Map.keys\n\n// Logs the first key\nswitch keys->IteratorObject.next {\n| Yield({value}) => Console.log(value)\n| Return(_) => ()\n}\n\n// You can also turn the iterator into an array. Remember that iterators are consumed, so use a fresh one.\nConsole.log(map->Map.keys->IteratorObject.toArray)\n```" - ], - "signature": "let keys: t<'k, 'v> => IteratorObject.t<'k, unit, unknown>" - }, - { - "id": "Stdlib.Map.values", - "kind": "value", - "name": "values", - "docstrings": [ - "Returns an iterator that holds all values of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet values = map->Map.values\n\n// Logs the first value\nswitch values->IteratorObject.next {\n| Yield({value}) => Console.log(value)\n| Return(_) => ()\n}\n\n// You can also turn the iterator into an array. Remember that iterators are consumed, so use a fresh one.\nConsole.log(map->Map.values->IteratorObject.toArray)\n```" - ], - "signature": "let values: t<'k, 'v> => IteratorObject.t<'v, unit, unknown>" - }, - { - "id": "Stdlib.Map.entries", - "kind": "value", - "name": "entries", - "docstrings": [ - "Returns an iterator that holds all entries of the map.\nAn entry is represented as a tuple of `('key, 'value)`,\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet entries = map->Map.entries\n\n// Logs the first value\nswitch entries->IteratorObject.next {\n| Yield({value}) => Console.log(value)\n| Return(_) => ()\n}\n\n// You can also turn the iterator into an array. Remember that iterators are consumed, so use a fresh one.\nConsole.log(map->Map.entries->IteratorObject.toArray)\n```" - ], - "signature": "let entries: t<'k, 'v> => IteratorObject.t<('k, 'v), unit, unknown>" - }, - { - "id": "Stdlib.Map.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(map)` ignores the provided map and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'k, 'v> => unit" - } - ] - }, - "stdlib/asyncgenerator": { - "id": "Stdlib.AsyncGenerator", - "name": "AsyncGenerator", - "docstrings": [ - "A JavaScript async generator object.\n\nAsync generators are built-in async iterable iterators with additional\n`return()` and `throw()` capabilities.\n\nSee [`AsyncGenerator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncGenerator) on MDN." - ], - "items": [ - { - "id": "Stdlib.AsyncGenerator.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an async generator object." - ], - "signature": "type t<'yield, 'return, 'next> = AsyncIterable.t<'yield>" - }, - { - "id": "Stdlib.AsyncGenerator.asAsyncIterable", - "kind": "value", - "name": "asAsyncIterable", - "docstrings": [ - "`asAsyncIterable(generator)` views `generator` as an `AsyncIterable.t`." - ], - "signature": "let asAsyncIterable: t<'yield, 'return, 'next> => AsyncIterable.t<'yield>" - }, - { - "id": "Stdlib.AsyncGenerator.asAsyncIterableIterator", - "kind": "value", - "name": "asAsyncIterableIterator", - "docstrings": [ - "`asAsyncIterableIterator(generator)` views `generator` as an `AsyncIterableIterator.t`." - ], - "signature": "let asAsyncIterableIterator: t<\n 'yield,\n 'return,\n 'next,\n> => AsyncIterableIterator.t<'yield, 'return, 'next>" - }, - { - "id": "Stdlib.AsyncGenerator.asAsyncIterator", - "kind": "value", - "name": "asAsyncIterator", - "docstrings": [ - "`asAsyncIterator(generator)` views `generator` as an `AsyncIterator.t`." - ], - "signature": "let asAsyncIterator: t<\n 'yield,\n 'return,\n 'next,\n> => AsyncIterator.t<'yield, 'return, 'next>" - }, - { - "id": "Stdlib.AsyncGenerator.next", - "kind": "value", - "name": "next", - "docstrings": [ - "`next(generator)` advances `generator` without sending a value back in." - ], - "signature": "let next: t<\n 'yield,\n 'return,\n 'next,\n> => promise>" - }, - { - "id": "Stdlib.AsyncGenerator.nextValue", - "kind": "value", - "name": "nextValue", - "docstrings": [ - "`nextValue(generator, value)` advances `generator`, sending `value` back into it." - ], - "signature": "let nextValue: (\n t<'yield, 'return, 'next>,\n 'next,\n) => promise>" - }, - { - "id": "Stdlib.AsyncGenerator.returnValue", - "kind": "value", - "name": "returnValue", - "docstrings": [ - "`returnValue(generator, value)` completes `generator` with the final return `value`." - ], - "signature": "let returnValue: (\n t<'yield, 'return, 'next>,\n 'return,\n) => promise>" - }, - { - "id": "Stdlib.AsyncGenerator.throwError", - "kind": "value", - "name": "throwError", - "docstrings": [ - "`throwError(generator, error)` throws `error` into `generator`." - ], - "signature": "let throwError: (\n t<'yield, 'return, 'next>,\n exn,\n) => promise>" - } - ] - }, - "stdlib/asynciterableiterator": { - "id": "Stdlib.AsyncIterableIterator", - "name": "AsyncIterableIterator", - "docstrings": [ - "A JavaScript async iterable iterator.\n\nThis models values that satisfy both the async iterable and async iterator\nprotocols without assuming any additional helper methods are available.\n\nSee [`AsyncIterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncIterator) on MDN." - ], - "items": [ - { - "id": "Stdlib.AsyncIterableIterator.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an async iterable iterator." - ], - "signature": "type t<'yield, 'return, 'next> = AsyncIterable.t<'yield>" - }, - { - "id": "Stdlib.AsyncIterableIterator.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(nextFn)` creates an async iterable iterator from a function returning the next result.\n\nThe returned value is both an async iterator and an async iterable.\n\n## Examples\n\n```rescript\nlet current = ref(0)\n\nlet asyncIterableIterator = AsyncIterableIterator.make(async () => {\n let value = current.contents\n current := value + 1\n\n if value >= 3 {\n AsyncIterator.done()\n } else {\n AsyncIterator.value(value)\n }\n})\n\nlet main = async () =>\n await asyncIterableIterator->AsyncIterableIterator.forEach(value => Console.log(value))\n\nmain()->ignore\n```" - ], - "signature": "let make: (\n unit => promise>,\n) => t<'yield, 'return, unit>" - }, - { - "id": "Stdlib.AsyncIterableIterator.asAsyncIterable", - "kind": "value", - "name": "asAsyncIterable", - "docstrings": [ - "`asAsyncIterable(value)` views `value` as an `AsyncIterable.t`." - ], - "signature": "let asAsyncIterable: t<'yield, 'return, 'next> => AsyncIterable.t<'yield>" - }, - { - "id": "Stdlib.AsyncIterableIterator.asAsyncIterator", - "kind": "value", - "name": "asAsyncIterator", - "docstrings": [ - "`asAsyncIterator(value)` views `value` as an `AsyncIterator.t`." - ], - "signature": "let asAsyncIterator: t<\n 'yield,\n 'return,\n 'next,\n> => AsyncIterator.t<'yield, 'return, 'next>" - }, - { - "id": "Stdlib.AsyncIterableIterator.next", - "kind": "value", - "name": "next", - "docstrings": [ - "`next(iterator)` advances `iterator` without sending a value back in." - ], - "signature": "let next: t<\n 'yield,\n 'return,\n 'next,\n> => promise>" - }, - { - "id": "Stdlib.AsyncIterableIterator.nextValue", - "kind": "value", - "name": "nextValue", - "docstrings": [ - "`nextValue(iterator, value)` advances `iterator`, sending `value` back into it." - ], - "signature": "let nextValue: (\n t<'yield, 'return, 'next>,\n 'next,\n) => promise>" - }, - { - "id": "Stdlib.AsyncIterableIterator.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(iterator, f)` consumes all yielded values in `iterator` and runs `f`\nfor each yielded value.\n\nThe final return value is not passed to `f`." - ], - "signature": "let forEach: (t<'yield, 'return, 'next>, 'yield => unit) => promise" - }, - { - "id": "Stdlib.AsyncIterableIterator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(iterator)` marks `iterator` as intentionally unused." - ], - "signature": "let ignore: t<'yield, 'return, 'next> => unit" - } - ] - }, - "stdlib/asynciterator": { - "id": "Stdlib.AsyncIterator", - "name": "AsyncIterator", - "docstrings": [ - "A JavaScript async iterator protocol object.\n\nThis models the async iterator protocol: an object with a `next()` method that\nreturns a promise resolving to an iterator result.\n\nSee [`AsyncIterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncIterator) on MDN." - ], - "items": [ - { - "id": "Stdlib.AsyncIterator.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an async iterator protocol object.\n\n- `'yield` is the type produced while iterating\n- `'return` is the final completion value once iteration is done\n- `'next` is the type that can be sent back into `next(value)`" - ], - "signature": "type t<'yield, 'return, 'next>" - }, - { - "id": "Stdlib.AsyncIterator.result", - "kind": "type", - "name": "result", - "docstrings": [ - "Result returned by `AsyncIterator.next`." - ], - "signature": "type result<'yield, 'return> = Iterator.result<\n 'yield,\n 'return,\n>" - }, - { - "id": "Stdlib.AsyncIterator.rawResult", - "kind": "type", - "name": "rawResult", - "docstrings": [], - "signature": "type rawResult<'yield, 'return>" - }, - { - "id": "Stdlib.AsyncIterator.normalizeResult", - "kind": "value", - "name": "normalizeResult", - "docstrings": [ - "Low-level raw JavaScript async iterator result shape.\n\nThis is mainly intended for internal use and protocol-level interop. Prefer\n`AsyncIterator.result`, `AsyncIterator.next`, and `AsyncIterator.nextValue` in\nnormal ReScript code." - ], - "signature": "let normalizeResult: rawResult<'yield, 'return> => result<'yield, 'return>" - }, - { - "id": "Stdlib.AsyncIterator.value", - "kind": "value", - "name": "value", - "docstrings": [ - "`value(value)` creates a yielded iterator result.\n\n## Examples\n\n```rescript\nlet current = ref(0)\n\nlet asyncIterableIterator = AsyncIterator.make(async () => {\n let value = current.contents\n current := value + 1\n\n if value >= 3 {\n AsyncIterator.done()\n } else {\n AsyncIterator.value(value)\n }\n})\n```" - ], - "signature": "let value: 'yield => result<'yield, 'return>" - }, - { - "id": "Stdlib.AsyncIterator.done", - "kind": "value", - "name": "done", - "docstrings": [ - "`done()` creates a completed iterator result with `unit` as the final value." - ], - "signature": "let done: unit => result<'yield, unit>" - }, - { - "id": "Stdlib.AsyncIterator.doneWithValue", - "kind": "value", - "name": "doneWithValue", - "docstrings": [ - "`doneWithValue(value)` creates a completed iterator result with the provided final value." - ], - "signature": "let doneWithValue: 'return => result<'yield, 'return>" - }, - { - "id": "Stdlib.AsyncIterator.nextRaw", - "kind": "value", - "name": "nextRaw", - "docstrings": [ - "`nextRaw(asyncIterator)` advances `asyncIterator` and returns a promise for the raw\nJavaScript iterator result object.\n\nThis is mainly intended for internal use and protocol-level interop." - ], - "signature": "let nextRaw: t<\n 'yield,\n 'return,\n 'next,\n> => promise>" - }, - { - "id": "Stdlib.AsyncIterator.next", - "kind": "value", - "name": "next", - "docstrings": [ - "`next(asyncIterator)` advances `asyncIterator` without sending a value back in.\n\n## Examples\n\n```rescript\nlet asyncIterator: AsyncIterator.t = %raw(`({\n current: 0,\n next() {\n if (this.current < 2) {\n return Promise.resolve({done: false, value: this.current++})\n }\n return Promise.resolve({done: true, value: undefined})\n }\n})`)\n\nlet process = async () => {\n switch await asyncIterator->AsyncIterator.next {\n | Yield({value: 0}) => ()\n | _ => ()\n }\n}\n\nprocess()->ignore\n```" - ], - "signature": "let next: t<\n 'yield,\n 'return,\n 'next,\n> => promise>" - }, - { - "id": "Stdlib.AsyncIterator.nextValueRaw", - "kind": "value", - "name": "nextValueRaw", - "docstrings": [ - "`nextValueRaw(asyncIterator, value)` advances `asyncIterator`, sends `value` back\ninto it, and returns a promise for the raw JavaScript iterator result object.\n\nThis is mainly intended for internal use and protocol-level interop." - ], - "signature": "let nextValueRaw: (\n t<'yield, 'return, 'next>,\n 'next,\n) => promise>" - }, - { - "id": "Stdlib.AsyncIterator.nextValue", - "kind": "value", - "name": "nextValue", - "docstrings": [ - "`nextValue(asyncIterator, value)` advances `asyncIterator`, sending `value` back into it." - ], - "signature": "let nextValue: (\n t<'yield, 'return, 'next>,\n 'next,\n) => promise>" - }, - { - "id": "Stdlib.AsyncIterator.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(asyncIterator, f)` consumes all yielded values in `asyncIterator` and runs `f`\nfor each yielded value.\n\nThe final return value is not passed to `f`." - ], - "signature": "let forEach: (t<'yield, 'return, 'next>, 'yield => unit) => promise" - }, - { - "id": "Stdlib.AsyncIterator.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(nextFn)` creates an async iterator protocol object from a function returning\nthe next result.\n\nThe returned value is not automatically async iterable.\n\n## Examples\n\n```rescript\nlet current = ref(0)\n\nlet asyncIterator = AsyncIterator.make(async () => {\n let value = current.contents\n current := value + 1\n\n if value >= 3 {\n AsyncIterator.done()\n } else {\n AsyncIterator.value(value)\n }\n})\n\nlet main = async () =>\n await asyncIterator->AsyncIterator.forEach(value => Console.log(value))\n\nmain()->ignore\n```" - ], - "signature": "let make: (\n unit => promise>,\n) => t<'yield, 'return, unit>" - }, - { - "id": "Stdlib.AsyncIterator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(asyncIterator)` marks `asyncIterator` as intentionally unused." - ], - "signature": "let ignore: t<'yield, 'return, 'next> => unit" - } - ] - }, - "stdlib/asynciterable": { - "id": "Stdlib.AsyncIterable", - "name": "AsyncIterable", - "docstrings": [ - "A JavaScript async iterable.\n\nValues of this type implement the async iterable protocol and can be consumed\nby `for await...of` and other JavaScript APIs that expect async iterables.\n\nSee [`AsyncIterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncIterator) on MDN." - ], - "items": [ - { - "id": "Stdlib.AsyncIterable.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an async iterable that yields values of type `'yield`." - ], - "signature": "type t<'yield> = asyncIterable<'yield>" - }, - { - "id": "Stdlib.AsyncIterable.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(asyncIterable)` marks `asyncIterable` as intentionally unused." - ], - "signature": "let ignore: t<'yield> => unit" - } - ] - }, - "stdlib/generator": { - "id": "Stdlib.Generator", - "name": "Generator", - "docstrings": [ - "A JavaScript generator object.\n\nGenerators are built-in iterable iterators with additional `return()` and\n`throw()` capabilities.\n\nSee [`Generator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator) on MDN." - ], - "items": [ - { - "id": "Stdlib.Generator.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a generator object." - ], - "signature": "type t<'yield, 'return, 'next> = Iterable.t<'yield>" - }, - { - "id": "Stdlib.Generator.asIterator", - "kind": "value", - "name": "asIterator", - "docstrings": [ - "`asIterator(generator)` views `generator` as an `Iterator.t`." - ], - "signature": "let asIterator: t<\n 'yield,\n 'return,\n 'next,\n> => Iterator.t<'yield, 'return, 'next>" - }, - { - "id": "Stdlib.Generator.asIterable", - "kind": "value", - "name": "asIterable", - "docstrings": [ - "`asIterable(generator)` views `generator` as an `Iterable.t`." - ], - "signature": "let asIterable: t<'yield, 'return, 'next> => Iterable.t<'yield>" - }, - { - "id": "Stdlib.Generator.asIteratorObject", - "kind": "value", - "name": "asIteratorObject", - "docstrings": [ - "`asIteratorObject(generator)` views `generator` as an `IteratorObject.t`." - ], - "signature": "let asIteratorObject: t<\n 'yield,\n 'return,\n 'next,\n> => IteratorObject.t<'yield, 'return, 'next>" - }, - { - "id": "Stdlib.Generator.next", - "kind": "value", - "name": "next", - "docstrings": [ - "`next(generator)` advances `generator` without sending a value back in." - ], - "signature": "let next: t<\n 'yield,\n 'return,\n 'next,\n> => Iterator.result<'yield, 'return>" - }, - { - "id": "Stdlib.Generator.nextValue", - "kind": "value", - "name": "nextValue", - "docstrings": [ - "`nextValue(generator, value)` advances `generator`, sending `value` back into it." - ], - "signature": "let nextValue: (\n t<'yield, 'return, 'next>,\n 'next,\n) => Iterator.result<'yield, 'return>" - }, - { - "id": "Stdlib.Generator.returnValue", - "kind": "value", - "name": "returnValue", - "docstrings": [ - "`returnValue(generator, value)` completes `generator` with the final return `value`." - ], - "signature": "let returnValue: (\n t<'yield, 'return, 'next>,\n 'return,\n) => Iterator.result<'yield, 'return>" - }, - { - "id": "Stdlib.Generator.throwError", - "kind": "value", - "name": "throwError", - "docstrings": [ - "`throwError(generator, error)` throws `error` into `generator`." - ], - "signature": "let throwError: (\n t<'yield, 'return, 'next>,\n exn,\n) => Iterator.result<'yield, 'return>" - } - ] - }, - "stdlib/iterableiterator": { - "id": "Stdlib.IterableIterator", - "name": "IterableIterator", - "docstrings": [ - "A JavaScript iterable iterator.\n\nThis models values that satisfy both the iterable and iterator protocols\nwithout assuming iterator helper methods are available.\n\nUnlike `IteratorObject.t`, this is only the iterable iterator protocol shape. It\ndoes not imply that iterator helper methods such as `map`, `filter`, or\n`toArray` are available.\n\nSee [Iteration protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN." - ], - "items": [ - { - "id": "Stdlib.IterableIterator.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an iterable iterator." - ], - "signature": "type t<'yield, 'return, 'next> = Iterable.t<'yield>" - }, - { - "id": "Stdlib.IterableIterator.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(nextFn)` creates an iterable iterator from a function returning the next result.\n\nThe returned value is both an iterator and an iterable.\n\n## Examples\n\n```rescript\nlet current = ref(0)\n\nlet iterableIterator = IterableIterator.make(() => {\n let value = current.contents\n current := value + 1\n\n if value >= 2 {\n Iterator.doneWithValue(\"done\")\n } else {\n Iterator.value(value)\n }\n})\n\niterableIterator->IterableIterator.next == Yield({value: 0})\n```" - ], - "signature": "let make: (\n unit => Iterator.result<'yield, 'return>,\n) => t<'yield, 'return, unit>" - }, - { - "id": "Stdlib.IterableIterator.asIterator", - "kind": "value", - "name": "asIterator", - "docstrings": [ - "`asIterator(value)` views an iterable iterator as an `Iterator.t`." - ], - "signature": "let asIterator: t<\n 'yield,\n 'return,\n 'next,\n> => Iterator.t<'yield, 'return, 'next>" - }, - { - "id": "Stdlib.IterableIterator.asIterable", - "kind": "value", - "name": "asIterable", - "docstrings": [ - "`asIterable(value)` views an iterable iterator as an `Iterable.t`." - ], - "signature": "let asIterable: t<'yield, 'return, 'next> => Iterable.t<'yield>" - }, - { - "id": "Stdlib.IterableIterator.next", - "kind": "value", - "name": "next", - "docstrings": [ - "`next(iterator)` advances `iterator` without sending a value back in." - ], - "signature": "let next: t<\n 'yield,\n 'return,\n 'next,\n> => Iterator.result<'yield, 'return>" - }, - { - "id": "Stdlib.IterableIterator.nextValue", - "kind": "value", - "name": "nextValue", - "docstrings": [ - "`nextValue(iterator, value)` advances `iterator`, sending `value` back into it." - ], - "signature": "let nextValue: (\n t<'yield, 'return, 'next>,\n 'next,\n) => Iterator.result<'yield, 'return>" - }, - { - "id": "Stdlib.IterableIterator.toArrayWithMapper", - "kind": "value", - "name": "toArrayWithMapper", - "docstrings": [ - "`toArrayWithMapper(iterator, mapper)` consumes `iterator`, applies `mapper` to each yielded\nvalue, and returns the mapped values as an array." - ], - "signature": "let toArrayWithMapper: (\n t<'yield, 'return, 'next>,\n 'yield => 'mapped,\n) => array<'mapped>" - }, - { - "id": "Stdlib.IterableIterator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(iterator)` marks `iterator` as intentionally unused." - ], - "signature": "let ignore: t<'yield, 'return, 'next> => unit" - } - ] - }, - "stdlib/iteratorobject": { - "id": "Stdlib.IteratorObject", - "name": "IteratorObject", - "docstrings": [ - "A JavaScript iterator object that inherits from `Iterator.prototype`.\n\nThis models a helper-enabled iterator object that conforms to the iterator\nprotocol and also inherits from `Iterator.prototype`, providing the standard\niterator helper methods. This is stricter than `IterableIterator.t`, which only\nmodels the structural protocol shape.\n\nSee [`Iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) on MDN." - ], - "items": [ - { - "id": "Stdlib.IteratorObject.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an `IteratorObject` instance." - ], - "signature": "type t<'yield, 'return, 'next> = Iterable.t<'yield>" - }, - { - "id": "Stdlib.IteratorObject.result", - "kind": "type", - "name": "result", - "docstrings": [ - "Result returned by `IteratorObject.next`." - ], - "signature": "type result<'yield, 'return> = Iterator.result<\n 'yield,\n 'return,\n>" - }, - { - "id": "Stdlib.IteratorObject.asIterator", - "kind": "value", - "name": "asIterator", - "docstrings": [ - "`asIterator(iteratorObject)` views `iteratorObject` as a bare `Iterator.t`." - ], - "signature": "let asIterator: t<\n 'yield,\n 'return,\n 'next,\n> => Iterator.t<'yield, 'return, 'next>" - }, - { - "id": "Stdlib.IteratorObject.asIterable", - "kind": "value", - "name": "asIterable", - "docstrings": [ - "`asIterable(iteratorObject)` views `iteratorObject` as an `Iterable.t`." - ], - "signature": "let asIterable: t<'yield, 'return, 'next> => Iterable.t<'yield>" - }, - { - "id": "Stdlib.IteratorObject.next", - "kind": "value", - "name": "next", - "docstrings": [ - "`next(iteratorObject)` advances `iteratorObject` without sending a value back in." - ], - "signature": "let next: t<\n 'yield,\n 'return,\n 'next,\n> => Iterator.result<'yield, 'return>" - }, - { - "id": "Stdlib.IteratorObject.nextValue", - "kind": "value", - "name": "nextValue", - "docstrings": [ - "`nextValue(iteratorObject, value)` advances `iteratorObject`, sending `value` back into it." - ], - "signature": "let nextValue: (\n t<'yield, 'return, 'next>,\n 'next,\n) => Iterator.result<'yield, 'return>" - }, - { - "id": "Stdlib.IteratorObject.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(iteratorObject)` consumes `iteratorObject` and returns its yielded values as an array." - ], - "signature": "let toArray: t<'yield, 'return, 'next> => array<'yield>" - }, - { - "id": "Stdlib.IteratorObject.toArrayWithMapper", - "kind": "value", - "name": "toArrayWithMapper", - "docstrings": [ - "`toArrayWithMapper(iteratorObject, mapper)` consumes `iteratorObject`, applies `mapper`\nto each yielded value, and returns the mapped values as an array." - ], - "signature": "let toArrayWithMapper: (\n t<'yield, 'return, 'next>,\n 'yield => 'mapped,\n) => array<'mapped>" - }, - { - "id": "Stdlib.IteratorObject.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(iteratorObject, f)` consumes `iteratorObject` and runs `f` for each yielded value." - ], - "signature": "let forEach: (t<'yield, 'return, 'next>, 'yield => unit) => unit" - }, - { - "id": "Stdlib.IteratorObject.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(iteratorObject)` marks `iteratorObject` as intentionally unused." - ], - "signature": "let ignore: t<'yield, 'return, 'next> => unit" - }, - { - "id": "Stdlib.IteratorObject.drop", - "kind": "value", - "name": "drop", - "docstrings": [ - "`drop(iteratorObject, count)` returns a new iterator helper that skips the first `count`\nyielded values." - ], - "signature": "let drop: (t<'yield, 'return, 'next>, int) => t<'yield, unit, unknown>" - }, - { - "id": "Stdlib.IteratorObject.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(iteratorObject, predicate)` returns `true` if `predicate` is true for every yielded value." - ], - "signature": "let every: (t<'yield, 'return, 'next>, 'yield => bool) => bool" - }, - { - "id": "Stdlib.IteratorObject.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(iteratorObject, predicate)` returns a new iterator helper containing only the\nyielded values that satisfy `predicate`." - ], - "signature": "let filter: (\n t<'yield, 'return, 'next>,\n 'yield => bool,\n) => t<'yield, unit, unknown>" - }, - { - "id": "Stdlib.IteratorObject.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(iteratorObject, predicate)` returns the first yielded value that satisfies\n`predicate`, or `None` if nothing matches." - ], - "signature": "let find: (\n t<'yield, 'return, 'next>,\n 'yield => bool,\n) => option<'yield>" - }, - { - "id": "Stdlib.IteratorObject.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(iteratorObject, f)` maps each yielded value to another iterable and flattens the result." - ], - "signature": "let flatMap: (\n t<'yield, 'return, 'next>,\n 'yield => Iterable.t<'mapped>,\n) => t<'mapped, unit, unknown>" - }, - { - "id": "Stdlib.IteratorObject.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(iteratorObject, f)` returns a new iterator helper whose yielded values are\nproduced by applying `f`." - ], - "signature": "let map: (\n t<'yield, 'return, 'next>,\n 'yield => 'mapped,\n) => t<'mapped, unit, unknown>" - }, - { - "id": "Stdlib.IteratorObject.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(iteratorObject, reducer, ~initialValue)` combines all yielded values using\n`reducer`.\n\nIf `~initialValue` is omitted, the first yielded value becomes the initial accumulator,\nso the accumulator type must match the yielded value type." - ], - "signature": "let reduce: (\n t<'yield, 'return, 'next>,\n ('acc, 'yield) => 'acc,\n ~initialValue: 'acc=?,\n) => 'acc" - }, - { - "id": "Stdlib.IteratorObject.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(iteratorObject, predicate)` returns `true` if at least one yielded value\nsatisfies `predicate`." - ], - "signature": "let some: (t<'yield, 'return, 'next>, 'yield => bool) => bool" - }, - { - "id": "Stdlib.IteratorObject.take", - "kind": "value", - "name": "take", - "docstrings": [ - "`take(iteratorObject, count)` returns a new iterator helper that yields at most `count`\nvalues." - ], - "signature": "let take: (t<'yield, 'return, 'next>, int) => t<'yield, unit, unknown>" - } - ] - }, - "stdlib/iterator": { - "id": "Stdlib.Iterator", - "name": "Iterator", - "docstrings": [ - "A JavaScript iterator protocol object.\n\nThis is the minimal protocol shape: an object with a `next()` method that\nproduces yielded values until it eventually completes with a final return value.\n\nSee [`Iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) on MDN." - ], - "items": [ - { - "id": "Stdlib.Iterator.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an iterator protocol object.\n\n- `'yield` is the type produced while iterating\n- `'return` is the final completion value once iteration is done\n- `'next` is the type that can be sent back into `next(value)`" - ], - "signature": "type t<'yield, 'return, 'next>" - }, - { - "id": "Stdlib.Iterator.result", - "kind": "type", - "name": "result", - "docstrings": [ - "Result returned by `Iterator.next`." - ], - "signature": "type result<'yield, 'return> =\n | Yield({value: 'yield})\n | Return({value: 'return})" - }, - { - "id": "Stdlib.Iterator.rawResult", - "kind": "type", - "name": "rawResult", - "docstrings": [], - "signature": "type rawResult<'yield, 'return>" - }, - { - "id": "Stdlib.Iterator.normalizeResult", - "kind": "value", - "name": "normalizeResult", - "docstrings": [ - "Low-level raw JavaScript iterator result shape.\n\nThis is mainly intended for internal use and protocol-level interop. Prefer\n`Iterator.result`, `Iterator.next`, and `Iterator.nextValue` in normal ReScript code." - ], - "signature": "let normalizeResult: rawResult<'yield, 'return> => result<'yield, 'return>" - }, - { - "id": "Stdlib.Iterator.value", - "kind": "value", - "name": "value", - "docstrings": [ - "`value(value)` creates a yielded iterator result." - ], - "signature": "let value: 'yield => result<'yield, 'return>" - }, - { - "id": "Stdlib.Iterator.done", - "kind": "value", - "name": "done", - "docstrings": [ - "`done()` creates a completed iterator result with `unit` as the final value." - ], - "signature": "let done: unit => result<'yield, unit>" - }, - { - "id": "Stdlib.Iterator.doneWithValue", - "kind": "value", - "name": "doneWithValue", - "docstrings": [ - "`doneWithValue(value)` creates a completed iterator result with the provided final value." - ], - "signature": "let doneWithValue: 'return => result<'yield, 'return>" - }, - { - "id": "Stdlib.Iterator.nextRaw", - "kind": "value", - "name": "nextRaw", - "docstrings": [ - "`nextRaw(iterator)` advances `iterator` and returns the raw JavaScript iterator result object.\n\nThis is mainly intended for internal use and protocol-level interop." - ], - "signature": "let nextRaw: t<'yield, 'return, 'next> => rawResult<'yield, 'return>" - }, - { - "id": "Stdlib.Iterator.next", - "kind": "value", - "name": "next", - "docstrings": [ - "`next(iterator)` advances `iterator` without sending a value back in.\n\n## Examples\n\n```rescript\nlet iterator: Iterator.t = %raw(`({\n current: 0,\n next() {\n if (this.current < 2) {\n return {done: false, value: this.current++}\n }\n return {done: true, value: \"done\"}\n }\n})`)\n\niterator->Iterator.next == Yield({value: 0})\n```" - ], - "signature": "let next: t<'yield, 'return, 'next> => result<'yield, 'return>" - }, - { - "id": "Stdlib.Iterator.nextValueRaw", - "kind": "value", - "name": "nextValueRaw", - "docstrings": [ - "`nextValueRaw(iterator, value)` advances `iterator`, sending `value` back into it,\nand returns the raw JavaScript iterator result object.\n\nThis is mainly intended for internal use and protocol-level interop." - ], - "signature": "let nextValueRaw: (\n t<'yield, 'return, 'next>,\n 'next,\n) => rawResult<'yield, 'return>" - }, - { - "id": "Stdlib.Iterator.nextValue", - "kind": "value", - "name": "nextValue", - "docstrings": [ - "`nextValue(iterator, value)` advances `iterator`, sending `value` back into it." - ], - "signature": "let nextValue: (\n t<'yield, 'return, 'next>,\n 'next,\n) => result<'yield, 'return>" - }, - { - "id": "Stdlib.Iterator.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(nextFn)` creates a bare iterator protocol object from a function returning\nthe next result.\n\nThe returned value is not automatically iterable.\n\n## Examples\n\n```rescript\nlet current = ref(0)\n\nlet iterator = Iterator.make(() => {\n let value = current.contents\n current := value + 1\n\n if value >= 2 {\n Iterator.doneWithValue(\"done\")\n } else {\n Iterator.value(value)\n }\n})\n\niterator->Iterator.next == Yield({value: 0})\n```" - ], - "signature": "let make: (\n unit => result<'yield, 'return>,\n) => t<'yield, 'return, unit>" - }, - { - "id": "Stdlib.Iterator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(iterator)` marks `iterator` as intentionally unused." - ], - "signature": "let ignore: t<'yield, 'return, 'next> => unit" - } - ] - }, - "stdlib/iterable": { - "id": "Stdlib.Iterable", - "name": "Iterable", - "docstrings": [ - "A JavaScript iterable.\n\nValues of this type implement the iterable protocol and can be consumed by\n`for...of`, `Array.from`, and other JavaScript APIs that expect iterables.\n\nSee [Iteration protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN." - ], - "items": [ - { - "id": "Stdlib.Iterable.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an iterable that yields values of type `'a`." - ], - "signature": "type t<'a> = iterable<'a>" - }, - { - "id": "Stdlib.Iterable.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(iterable)` marks `iterable` as intentionally unused." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/type": { - "id": "Stdlib.Type", - "name": "Type", - "docstrings": [ - "Utilities for classifying the type of JavaScript values at runtime." - ], - "items": [ - { - "id": "Stdlib.Type.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The possible types of JavaScript values." - ], - "signature": "type t = [\n | #bigint\n | #boolean\n | #function\n | #number\n | #object\n | #string\n | #symbol\n | #undefined\n]" - }, - { - "id": "Stdlib.Type.typeof", - "kind": "value", - "name": "typeof", - "docstrings": [ - "`typeof(someValue)`\n\nReturns the underlying JavaScript type of any runtime value.\n\nSee [`typeof`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof) on MDN.\n\n## Examples\n```rescript\nConsole.log(Type.typeof(\"Hello\")) // Logs \"string\" to the console.\n\nlet someVariable = true\n\nswitch someVariable->Type.typeof {\n| #boolean => Console.log(\"This is a bool, yay!\")\n| _ => Console.log(\"Oh, not a bool sadly...\")\n}\n```" - ], - "signature": "let typeof: 'a => t" - }, - { - "id": "Stdlib.Type.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(type)` ignores the provided type and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/symbol": { - "id": "Stdlib.Symbol", - "name": "Symbol", - "docstrings": [ - "A built-in object that serves as a namespace for globally-unique identifiers.\n\nCompiles to a regular JavaScript Symbol." - ], - "items": [ - { - "id": "Stdlib.Symbol.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a Symbol." - ], - "signature": "type t" - }, - { - "id": "Stdlib.Symbol.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(key)`\n\nMakes a new unique Symbol value.\n\n## Examples\n\n```rescript\nSymbol.make(\"sym1\")->Symbol.description == Some(\"sym1\")\n```" - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.Symbol.getFor", - "kind": "value", - "name": "getFor", - "docstrings": [ - "`getFor(key)`\n\nSearches for existing registered Symbols in the global Symbol registry with the given key and returns it if found.\nOtherwise a new Symbol gets created and registered with key.\n\n## Examples\n\n```rescript\nSymbol.getFor(\"sym1\") == Symbol.getFor(\"sym1\")\n```" - ], - "signature": "let getFor: string => option" - }, - { - "id": "Stdlib.Symbol.keyFor", - "kind": "value", - "name": "keyFor", - "docstrings": [ - "`keyFor(key)`\n\nRetrieves a shared Symbol key from the global Symbol registry for the given Symbol.\n\n## Examples\n\n```rescript\nlet globalSym = Symbol.getFor(\"sym1\") // Global symbol\n\nglobalSym->Option.flatMap(Symbol.description) == Some(\"sym1\")\n```" - ], - "signature": "let keyFor: t => option" - }, - { - "id": "Stdlib.Symbol.description", - "kind": "value", - "name": "description", - "docstrings": [ - "`description`\n\nReturns `Some(string)` containing the description of this symbol, or `None` if the symbol has no description.\n## Examples\n\n```rescript\nlet sym = Symbol.make(\"sym1\")\nSymbol.description(sym) == Some(\"sym1\")\n```" - ], - "signature": "let description: t => option" - }, - { - "id": "Stdlib.Symbol.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString`\n\n// Returns a string representing this symbol value.\n\n## Examples\n\n```rescript\nlet sym = Symbol.make(\"sym1\")\n\nSymbol.toString(sym) == \"Symbol(sym1)\"\n```" - ], - "signature": "let toString: t => string" - }, - { - "id": "Stdlib.Symbol.asyncIterator", - "kind": "value", - "name": "asyncIterator", - "docstrings": [ - "`asyncIterator` is the well-known symbol used by asynchronous iterables.\n\nSee [`Symbol.asyncIterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator) on MDN." - ], - "signature": "let asyncIterator: t" - }, - { - "id": "Stdlib.Symbol.hasInstance", - "kind": "value", - "name": "hasInstance", - "docstrings": [ - "`hasInstance` is used by custom `instanceof` checks.\n\nSee [`Symbol.hasInstance`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance) on MDN." - ], - "signature": "let hasInstance: t" - }, - { - "id": "Stdlib.Symbol.isConcatSpreadable", - "kind": "value", - "name": "isConcatSpreadable", - "docstrings": [ - "`isConcatSpreadable` controls whether objects are flattened when passed to `Array.concat`.\n\nSee [`Symbol.isConcatSpreadable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/isConcatSpreadable) on MDN." - ], - "signature": "let isConcatSpreadable: t" - }, - { - "id": "Stdlib.Symbol.iterator", - "kind": "value", - "name": "iterator", - "docstrings": [ - "`iterator` is returned by objects that can be iterated with `for..of`.\n\nSee [`Symbol.iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/iterator) on MDN." - ], - "signature": "let iterator: t" - }, - { - "id": "Stdlib.Symbol.match", - "kind": "value", - "name": "match", - "docstrings": [ - "`match` customises how values respond to `String.prototype.match`.\n\nSee [`Symbol.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/match) on MDN." - ], - "signature": "let match: t" - }, - { - "id": "Stdlib.Symbol.matchAll", - "kind": "value", - "name": "matchAll", - "docstrings": [ - "`matchAll` customises how values respond to `String.prototype.matchAll`.\n\nSee [`Symbol.matchAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/matchAll) on MDN." - ], - "signature": "let matchAll: t" - }, - { - "id": "Stdlib.Symbol.replace", - "kind": "value", - "name": "replace", - "docstrings": [ - "`replace` customises how values respond to `String.prototype.replace`.\n\nSee [`Symbol.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/replace) on MDN." - ], - "signature": "let replace: t" - }, - { - "id": "Stdlib.Symbol.search", - "kind": "value", - "name": "search", - "docstrings": [ - "`search` customises how values respond to `String.prototype.search`.\n\nSee [`Symbol.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) on MDN." - ], - "signature": "let search: t" - }, - { - "id": "Stdlib.Symbol.species", - "kind": "value", - "name": "species", - "docstrings": [ - "`species` lets constructors return a different derived constructor when methods create new instances.\n\nSee [`Symbol.species`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/species) on MDN." - ], - "signature": "let species: t" - }, - { - "id": "Stdlib.Symbol.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split` customises how values respond to `String.prototype.split`.\n\nSee [`Symbol.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/split) on MDN." - ], - "signature": "let split: t" - }, - { - "id": "Stdlib.Symbol.toPrimitive", - "kind": "value", - "name": "toPrimitive", - "docstrings": [ - "`toPrimitive` customises how objects convert to primitive values.\n\nSee [`Symbol.toPrimitive`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toPrimitive) on MDN." - ], - "signature": "let toPrimitive: t" - }, - { - "id": "Stdlib.Symbol.toStringTag", - "kind": "value", - "name": "toStringTag", - "docstrings": [ - "`toStringTag` customises the default tag shown by `Object.prototype.toString`.\n\nSee [`Symbol.toStringTag`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag) on MDN." - ], - "signature": "let toStringTag: t" - }, - { - "id": "Stdlib.Symbol.unscopables", - "kind": "value", - "name": "unscopables", - "docstrings": [ - "`unscopables` marks properties that should be skipped by `with`.\n\nSee [`Symbol.unscopables`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/unscopables) on MDN." - ], - "signature": "let unscopables: t" - }, - { - "id": "Stdlib.Symbol.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(symbol)` ignores the provided symbol and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/string": { - "id": "Stdlib.String", - "name": "String", - "docstrings": [ - "Functions for interacting with JavaScript strings.\nSee: [`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)." - ], - "items": [ - { - "id": "Stdlib.String.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a string." - ], - "signature": "type t = string" - }, - { - "id": "Stdlib.String.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nString.make(3.5) == \"3.5\"\nString.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => string" - }, - { - "id": "Stdlib.String.fromCharCode", - "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to\nthat number, `n` ranges from 0 to 65535. If out of range, the lower 16 bits of\nthe value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as\n`fromCharCode(0xF63A)`.\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nString.fromCharCode(65) == \"A\"\nString.fromCharCode(0x3c8) == `ψ`\nString.fromCharCode(0xd55c) == `한`\nString.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => string" - }, - { - "id": "Stdlib.String.fromCharCodeMany", - "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`.\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nString.fromCharCodeMany([189, 43, 190, 61]) == \"½+¾=\"\nString.fromCharCodeMany([65, 66, 67]) == \"ABC\"\n```" - ], - "signature": "let fromCharCodeMany: array => string" - }, - { - "id": "Stdlib.String.fromCodePoint", - "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point.\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint) on MDN.\n\n## Examples\n\n```rescript\nString.fromCodePoint(65) == \"A\"\nString.fromCodePoint(0x3c8) == `ψ`\nString.fromCodePoint(0xd55c) == `한`\nString.fromCodePoint(0x1f63a) == `😺`\n```\n\n## Exceptions\n\n- `RangeError`: If the number is not a valid code point, like `fromCharCode(-5)`." - ], - "signature": "let fromCodePoint: int => string" - }, - { - "id": "Stdlib.String.fromCodePointMany", - "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint) on MDN.\n\n## Examples\n\n```rescript\nString.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```\n\n## Exceptions\n\n- `RangeError`: If one of the number is not a valid code point, like\n `fromCharCode([1, -5])`." - ], - "signature": "let fromCodePointMany: array => string" - }, - { - "id": "Stdlib.String.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(str1, str2)` checks if two strings are equal.\n\n## Examples\n\n```rescript\nString.equal(\"hello\", \"hello\") == true\nString.equal(\"hello\", \"world\") == false\nString.equal(\"\", \"\") == true\n```" - ], - "signature": "let equal: (string, string) => bool" - }, - { - "id": "Stdlib.String.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(str1, str2)` compares two strings, returns an `Ordering.t` value.\n\n## Examples\n\n```rescript\nString.compare(\"hello\", \"hello\") == Ordering.equal\nString.compare(\"apple\", \"banana\") == Ordering.less\nString.compare(\"zebra\", \"apple\") == Ordering.greater\n```" - ], - "signature": "let compare: (string, string) => Ordering.t" - }, - { - "id": "Stdlib.String.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(str)` returns the length of the given `string`.\nSee [`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length) on MDN.\n\n## Examples\n\n```rescript\nString.length(\"abcd\") == 4\n```" - ], - "signature": "let length: string => int" - }, - { - "id": "Stdlib.String.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(str, index)` returns an `option` at the given `index` number. If\n`index` is out of range, this function returns `None`.\n\n## Examples\n\n```rescript\nString.get(\"ReScript\", 0) == Some(\"R\")\nString.get(\"Hello\", 4) == Some(\"o\")\nString.get(`JS`, 4) == None\n```" - ], - "signature": "let get: (string, int) => option" - }, - { - "id": "Stdlib.String.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(str, index)` returns an `string` at the given `index` number.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `string`.\n\nUse `String.getUnsafe` only when you are sure the `index` exists.\n## Examples\n\n```rescript\nString.getUnsafe(\"ReScript\", 0) == \"R\"\nString.getUnsafe(\"Hello\", 4) == \"o\"\n```" - ], - "signature": "let getUnsafe: (string, int) => string" - }, - { - "id": "Stdlib.String.charAt", - "kind": "value", - "name": "charAt", - "docstrings": [ - "`charAt(str, index)` gets the character at `index` within string `str`. If\n`index` is negative or greater than the length of `str`, it returns the empty\nstring. If the string contains characters outside the range \\\\u0000-\\\\uffff, it\nwill return the first 16-bit value at that position in the string.\nSee [`String.charAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt) on MDN.\n\n## Examples\n\n```rescript\nString.charAt(\"ReScript\", 0) == \"R\"\nString.charAt(\"Hello\", 12) == \"\"\nString.charAt(`JS`, 5) == \"\"\n```" - ], - "signature": "let charAt: (string, int) => string" - }, - { - "id": "Stdlib.String.charCodeAt", - "kind": "value", - "name": "charCodeAt", - "docstrings": [ - "`charCodeAt(str, index)` returns the character code at position `index` in\nstring `str` the result is in the range 0-65535, unlike `codePointAt`, so it\nwill not work correctly for characters with code points greater than or equal\nto 0x10000.\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt) on MDN.\n\n## Examples\n\n```rescript\nString.charCodeAt(`😺`, 0) == Some(0xd83d)\nString.charCodeAt(\"\", 0) == None\nString.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" - ], - "signature": "let charCodeAt: (string, int) => option" - }, - { - "id": "Stdlib.String.charCodeAtUnsafe", - "kind": "value", - "name": "charCodeAtUnsafe", - "docstrings": [ - "`charCodeAtUnsafe(str, index)` returns the character code at position `index` in\nstring `str` the result is in the range 0-65535, unlike `codePointAt`, so it\nwill not work correctly for characters with code points greater than or equal\nto 0x10000.\nBeware: If the index is out of range, it will return `NaN` which is not actually a valid int.\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt) on MDN.\n\n## Examples\n\n```rescript\nString.charCodeAtUnsafe(`😺`, 0) == 0xd83d\nString.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" - ], - "signature": "let charCodeAtUnsafe: (string, int) => int" - }, - { - "id": "Stdlib.String.codePointAt", - "kind": "value", - "name": "codePointAt", - "docstrings": [ - "`codePointAt(str, index)` returns the code point at position `index` within\nstring `str` as a `Some(value)`. The return value handles code points greater\nthan or equal to 0x10000. If there is no code point at the given position, the\nfunction returns `None`.\nSee [`String.codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) on MDN.\n\n## Examples\n\n```rescript\nString.codePointAt(`¿😺?`, 1) == Some(0x1f63a)\nString.codePointAt(\"abc\", 5) == None\n```" - ], - "signature": "let codePointAt: (string, int) => option" - }, - { - "id": "Stdlib.String.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(original, append)` returns a new `string` with `append` added after\n`original`.\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat) on MDN.\n\n## Examples\n\n```rescript\nString.concat(\"cow\", \"bell\") == \"cowbell\"\nString.concat(\"Re\", \"Script\") == \"ReScript\"\n```" - ], - "signature": "let concat: (string, string) => string" - }, - { - "id": "Stdlib.String.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(original, arr)` returns a new `string` consisting of each item of an\narray of strings added to the `original` string.\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat) on MDN.\n\n## Examples\n\n```rescript\nString.concatMany(\"1st\", [\"2nd\", \"3rd\", \"4th\"]) == \"1st2nd3rd4th\"\n```" - ], - "signature": "let concatMany: (string, array) => string" - }, - { - "id": "Stdlib.String.endsWith", - "kind": "value", - "name": "endsWith", - "docstrings": [ - "`endsWith(str, substr)` returns `true` if the `str` ends with `substr`, `false`\notherwise.\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith) on MDN.\n\n## Examples\n\n```rescript\nString.endsWith(\"BuckleScript\", \"Script\") == true\nString.endsWith(\"BuckleShoes\", \"Script\") == false\n```" - ], - "signature": "let endsWith: (string, string) => bool" - }, - { - "id": "Stdlib.String.endsWithFrom", - "kind": "value", - "name": "endsWithFrom", - "docstrings": [ - "`endsWithFrom(str, ending, len)` returns `true` if the first len characters of\n`str` end with `ending`, `false` otherwise. If `len` is greater than or equal\nto the length of `str`, then it works like `endsWith`.\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith) on MDN.\n\n## Examples\n\n```rescript\nString.endsWithFrom(\"abcd\", \"cd\", 4) == true\nString.endsWithFrom(\"abcde\", \"cd\", 3) == false\nString.endsWithFrom(\"abcde\", \"cde\", 99) == true\nString.endsWithFrom(\"example.dat\", \"ple\", 7) == true\n```" - ], - "signature": "let endsWithFrom: (string, string, int) => bool" - }, - { - "id": "Stdlib.String.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "`includes(str, searchValue)` returns `true` if `searchValue` is found anywhere\nwithin `str`, `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includes(\"programmer\", \"gram\") == true\nString.includes(\"programmer\", \"er\") == true\nString.includes(\"programmer\", \"pro\") == true\nString.includes(\"programmer.dat\", \"xyz\") == false\n```" - ], - "signature": "let includes: (string, string) => bool" - }, - { - "id": "Stdlib.String.includesFrom", - "kind": "value", - "name": "includesFrom", - "docstrings": [ - "`includesFrom(str, searchValue, start)` returns `true` if `searchValue` is found\nanywhere within `str` starting at character number `start` (where 0 is the\nfirst character), `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includesFrom(\"programmer\", \"gram\", 1) == true\nString.includesFrom(\"programmer\", \"gram\", 4) == false\nString.includesFrom(`대한민국`, `한`, 1) == true\n```" - ], - "signature": "let includesFrom: (string, string, int) => bool" - }, - { - "id": "Stdlib.String.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "`indexOf(str, searchValue)` returns the position at which `searchValue` was\nfirst found within `str`, or `-1` if `searchValue` is not in `str`.\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) on MDN.\n\n## Examples\n\n```rescript\nString.indexOf(\"bookseller\", \"ok\") == 2\nString.indexOf(\"bookseller\", \"sell\") == 4\nString.indexOf(\"beekeeper\", \"ee\") == 1\nString.indexOf(\"bookseller\", \"xyz\") == -1\n```" - ], - "signature": "let indexOf: (string, string) => int" - }, - { - "id": "Stdlib.String.indexOfOpt", - "kind": "value", - "name": "indexOfOpt", - "docstrings": [ - "`indexOfOpt(str, searchValue)`. Like `indexOf`, but return an `option`.\n\n## Examples\n\n```rescript\nString.indexOfOpt(\"bookseller\", \"ok\") == Some(2)\nString.indexOfOpt(\"bookseller\", \"xyz\") == None\n```" - ], - "signature": "let indexOfOpt: (string, string) => option" - }, - { - "id": "Stdlib.String.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "`indexOfFrom(str, searchValue, start)` returns the position at which\n`searchValue` was found within `str` starting at character position `start`, or\n`-1` if `searchValue` is not found in that portion of `str`. The return value is\nrelative to the beginning of the string, no matter where the search started\nfrom.\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) on MDN.\n\n## Examples\n\n```rescript\nString.indexOfFrom(\"bookseller\", \"ok\", 1) == 2\nString.indexOfFrom(\"bookseller\", \"sell\", 2) == 4\nString.indexOfFrom(\"bookseller\", \"sell\", 5) == -1\n```" - ], - "signature": "let indexOfFrom: (string, string, int) => int" - }, - { - "id": "Stdlib.String.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(str, searchValue)` returns the position of the last occurrence of\n`searchValue` within `str`, searching backwards from the end of the string.\nReturns `-1` if `searchValue` is not in `str`. The return value is always\nrelative to the beginning of the string.\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\nString.lastIndexOf(\"bookseller\", \"ok\") == 2\nString.lastIndexOf(\"beekeeper\", \"ee\") == 4\nString.lastIndexOf(\"abcdefg\", \"xyz\") == -1\n```" - ], - "signature": "let lastIndexOf: (string, string) => int" - }, - { - "id": "Stdlib.String.lastIndexOfOpt", - "kind": "value", - "name": "lastIndexOfOpt", - "docstrings": [ - "`lastIndexOfOpt(str, searchValue)`. Like `lastIndexOfOpt`, but return an\n`option`.\n\n## Examples\n\n```rescript\nString.lastIndexOfOpt(\"bookseller\", \"ok\") == Some(2)\nString.lastIndexOfOpt(\"beekeeper\", \"ee\") == Some(4)\nString.lastIndexOfOpt(\"abcdefg\", \"xyz\") == None\n```" - ], - "signature": "let lastIndexOfOpt: (string, string) => option" - }, - { - "id": "Stdlib.String.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "`lastIndexOfFrom(str, searchValue, start)` returns the position of the last\noccurrence of `searchValue` within `str`, searching backwards from the given\nstart position. Returns `-1` if `searchValue` is not in `str`. The return value\nis always relative to the beginning of the string.\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\nString.lastIndexOfFrom(\"bookseller\", \"ok\", 6) == 2\nString.lastIndexOfFrom(\"beekeeper\", \"ee\", 8) == 4\nString.lastIndexOfFrom(\"beekeeper\", \"ee\", 3) == 1\nString.lastIndexOfFrom(\"abcdefg\", \"xyz\", 4) == -1\n```" - ], - "signature": "let lastIndexOfFrom: (string, string, int) => int" - }, - { - "id": "Stdlib.String.match", - "kind": "value", - "name": "match", - "docstrings": [ - "`match(str, regexp)` matches a `string` against the given `regexp`. If there is\nno match, it returns `None`. For regular expressions without the g modifier, if\nthere is a match, the return value is `Some(array)` where the array contains:\n- The entire matched string\n- Any capture groups if the regexp had parentheses\n For regular expressions with the g modifier, a matched expression returns\n `Some(array)` with all the matched substrings and no capture groups.\n See [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match) on MDN.\n\n## Examples\n\n```rescript\nString.match(\"The better bats\", /b[aeiou]t/) == Some([Some(\"bet\")])\nString.match(\"The better bats\", /b[aeiou]t/g) == Some([Some(\"bet\"), Some(\"bat\")])\nString.match(\"Today is 2018-04-05.\", /(\\d+)-(\\d+)-(\\d+)/) ==\n Some([Some(\"2018-04-05\"), Some(\"2018\"), Some(\"04\"), Some(\"05\")])\nString.match(\"The optional example\", /(foo)?(example)/) ==\n Some([Some(\"example\"), None, Some(\"example\")])\nString.match(\"The large container.\", /b[aeiou]g/) == None\n```" - ], - "signature": "let match: (string, RegExp.t) => option<\\\"RegExp.Result\".t>" - }, - { - "id": "Stdlib.String.normalize", - "kind": "value", - "name": "normalize", - "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\\\u00e3 or the combination of a lower case letter A\n\\\\u0061 and a combining tilde \\\\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\nSee also [Unicode technical report \\#15](https://unicode.org/reports/tr15/) for details.\n\n## Examples\n\n```rescript\nlet string1 = \"\\u00F1\"\nlet string2 = \"\\u006E\\u0303\"\n\nassert(string1 != string2) // true\nString.normalize(string1) == String.normalize(string2)\n```" - ], - "signature": "let normalize: string => string" - }, - { - "id": "Stdlib.String.normalizeForm", - "kind": "type", - "name": "normalizeForm", - "docstrings": [ - "`normalizeByForm(str, form)` returns the normalized Unicode string using the\nspecified form of normalization, which may be one of:\n- \"NFC\" — Normalization Form Canonical Composition.\n- \"NFD\" — Normalization Form Canonical Decomposition.\n- \"NFKC\" — Normalization Form Compatibility Composition.\n- \"NFKD\" — Normalization Form Compatibility Decomposition.\n See [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\n See also [Unicode technical report \\#15](https://unicode.org/reports/tr15/) for\n details.\n\n## Examples\n\n```rescript\nlet string1 = \"\\uFB00\"\nlet string2 = \"\\u0066\\u0066\"\nConsole.log(string1 == string2) // false\n\nlet normalizeString1 = String.normalizeByForm(string1, #NFKD)\nlet normalizeString2 = String.normalizeByForm(string2, #NFKD)\nConsole.log(normalizeString1 == normalizeString2) // true\n```" - ], - "signature": "type normalizeForm = [#NFC | #NFD | #NFKC | #NFKD]" - }, - { - "id": "Stdlib.String.normalizeByForm", - "kind": "value", - "name": "normalizeByForm", - "docstrings": [], - "signature": "let normalizeByForm: (string, normalizeForm) => string" - }, - { - "id": "Stdlib.String.repeat", - "kind": "value", - "name": "repeat", - "docstrings": [ - "`repeat(str, n)` returns a `string` that consists of `n` repetitions of `str`.\nSee [`String.repeat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat) on MDN.\n\n## Examples\n\n```rescript\nString.repeat(\"ha\", 3) == \"hahaha\"\nString.repeat(\"empty\", 0) == \"\"\n```\n\n## Exceptions\n\n- `RangeError`: if `n` is negative." - ], - "signature": "let repeat: (string, int) => string" - }, - { - "id": "Stdlib.String.replace", - "kind": "value", - "name": "replace", - "docstrings": [ - "`replace(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with the first matching instance of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nString.replace(\"old string\", \"old\", \"new\") == \"new string\"\nString.replace(\"the cat and the dog\", \"the\", \"this\") == \"this cat and the dog\"\n```" - ], - "signature": "let replace: (string, string, string) => string" - }, - { - "id": "Stdlib.String.replaceRegExp", - "kind": "value", - "name": "replaceRegExp", - "docstrings": [ - "`replaceRegExp(str, regex, replacement)` returns a new `string` where\noccurrences matching regex have been replaced by `replacement`.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nString.replaceRegExp(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nString.replaceRegExp(\"Juan Fulano\", /(\\w+) (\\w+)/, \"$2, $1\") == \"Fulano, Juan\"\n```" - ], - "signature": "let replaceRegExp: (string, RegExp.t, string) => string" - }, - { - "id": "Stdlib.String.replaceAll", - "kind": "value", - "name": "replaceAll", - "docstrings": [ - "`replaceAll(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with all matching instances of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\nSee [`String.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) on MDN.\n\n## Examples\n\n```rescript\nString.replaceAll(\"old old string\", \"old\", \"new\") == \"new new string\"\nString.replaceAll(\"the cat and the dog\", \"the\", \"this\") == \"this cat and this dog\"\n```" - ], - "signature": "let replaceAll: (string, string, string) => string" - }, - { - "id": "Stdlib.String.replaceAllRegExp", - "kind": "value", - "name": "replaceAllRegExp", - "docstrings": [ - "`replaceAllRegExp(str, regex, replacement)` returns a new `string` where\nall occurrences matching regex have been replaced by `replacement`.\nThe pattern must include the global (`g`) flag or a runtime TypeError will be thrown.\nSee [`String.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) on MDN.\n\n## Examples\n\n```rescript\nString.replaceAllRegExp(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nString.replaceAllRegExp(\"aabbcc\", /b/g, \".\") == \"aa..cc\"\n```" - ], - "signature": "let replaceAllRegExp: (string, RegExp.t, string) => string" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy0", - "kind": "value", - "name": "unsafeReplaceRegExpBy0", - "docstrings": [ - "`unsafeReplaceRegExpBy0(str, regex, f)` returns a new `string` with some or all\nmatches of a pattern with no capturing parentheses replaced by the value\nreturned from the given function. The function receives as its parameters the\nmatched string, the offset at which the match begins, and the whole string being\nmatched.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (~match, ~offset as _, ~input as _) => String.toUpperCase(match)\nString.unsafeReplaceRegExpBy0(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy0: (\n string,\n RegExp.t,\n (~match: string, ~offset: int, ~input: string) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy1", - "kind": "value", - "name": "unsafeReplaceRegExpBy1", - "docstrings": [ - "`unsafeReplaceRegExpBy1(str, regexp, f)`. Like `unsafeReplaceRegExpBy0`, but `f`\nhas `group1` parameter.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (~match as _, ~group1, ~offset as _, ~input as _) => {\n group1 ++ \"41\"\n}\nString.unsafeReplaceRegExpBy1(str, re, matchFn) == \"Jony is 41\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy1: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy2", - "kind": "value", - "name": "unsafeReplaceRegExpBy2", - "docstrings": [ - "`unsafeReplaceRegExpBy2(str, regexp, f)`. Like `unsafeReplaceRegExpBy1`, but `f`\nhas two group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (~match as _, ~group1, ~group2, ~offset as _, ~input as _) => {\n switch (Int.fromString(group1), Int.fromString(group2)) {\n | (Some(x), Some(y)) => Int.toString(x * y)\n | _ => \"???\"\n }\n}\nString.unsafeReplaceRegExpBy2(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy2: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy3", - "kind": "value", - "name": "unsafeReplaceRegExpBy3", - "docstrings": [ - "`unsafeReplaceRegExpBy3(str, regexp, f)`. Like `unsafeReplaceRegExpBy2`, but `f`\nhas three group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN." - ], - "signature": "let unsafeReplaceRegExpBy3: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~group3: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.replaceRegExpBy0Unsafe", - "kind": "value", - "name": "replaceRegExpBy0Unsafe", - "docstrings": [ - "`replaceRegExpBy0Unsafe(str, regex, f)` returns a new `string` with some or all\nmatches of a pattern with no capturing parentheses replaced by the value\nreturned from the given function. The function receives as its parameters the\nmatched string, the offset at which the match begins, and the whole string being\nmatched.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (~match, ~offset as _, ~input as _) => String.toUpperCase(match)\nString.replaceRegExpBy0Unsafe(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" - ], - "signature": "let replaceRegExpBy0Unsafe: (\n string,\n RegExp.t,\n (~match: string, ~offset: int, ~input: string) => string,\n) => string" - }, - { - "id": "Stdlib.String.replaceRegExpBy1Unsafe", - "kind": "value", - "name": "replaceRegExpBy1Unsafe", - "docstrings": [ - "`replaceRegExpBy1Unsafe(str, regexp, f)`. Like `replaceRegExpBy0Unsafe`, but `f`\nhas `group1` parameter.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (~match as _, ~group1, ~offset as _, ~input as _) => {\n group1 ++ \"41\"\n}\nString.replaceRegExpBy1Unsafe(str, re, matchFn) == \"Jony is 41\"\n```" - ], - "signature": "let replaceRegExpBy1Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" - }, - { - "id": "Stdlib.String.replaceRegExpBy2Unsafe", - "kind": "value", - "name": "replaceRegExpBy2Unsafe", - "docstrings": [ - "`replaceRegExpBy2Unsafe(str, regexp, f)`. Like `replaceRegExpBy1Unsafe`, but `f`\nhas two group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (~match as _, ~group1, ~group2, ~offset as _, ~input as _) => {\n switch (Int.fromString(group1), Int.fromString(group2)) {\n | (Some(x), Some(y)) => Int.toString(x * y)\n | _ => \"???\"\n }\n}\nString.replaceRegExpBy2Unsafe(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let replaceRegExpBy2Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" - }, - { - "id": "Stdlib.String.replaceRegExpBy3Unsafe", - "kind": "value", - "name": "replaceRegExpBy3Unsafe", - "docstrings": [ - "`replaceRegExpBy3Unsafe(str, regexp, f)`. Like `replaceRegExpBy2Unsafe`, but `f`\nhas three group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN." - ], - "signature": "let replaceRegExpBy3Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~group3: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" - }, - { - "id": "Stdlib.String.search", - "kind": "value", - "name": "search", - "docstrings": [ - "`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search) on MDN.\n\n## Examples\n\n```rescript\nString.search(\"testing 1 2 3\", /\\d+/) == 8\nString.search(\"no numbers\", /\\d+/) == -1\n```" - ], - "signature": "let search: (string, RegExp.t) => int" - }, - { - "id": "Stdlib.String.searchOpt", - "kind": "value", - "name": "searchOpt", - "docstrings": [ - "`searchOpt(str, regexp)`. Like `search`, but return an `option`.\n\n## Examples\n\n```rescript\nString.searchOpt(\"testing 1 2 3\", /\\d+/) == Some(8)\nString.searchOpt(\"no numbers\", /\\d+/) == None\n```" - ], - "signature": "let searchOpt: (string, RegExp.t) => option" - }, - { - "id": "Stdlib.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(str)` returns `true` if the string is empty (has zero length), \n`false` otherwise.\n\n## Examples\n\n```rescript\nString.isEmpty(\"\") == true\nString.isEmpty(\"hello\") == false\nString.isEmpty(\" \") == false\n```" - ], - "signature": "let isEmpty: string => bool" - }, - { - "id": "Stdlib.String.capitalize", - "kind": "value", - "name": "capitalize", - "docstrings": [ - "`capitalize(str)` returns a new string with the first character converted to \nuppercase and the remaining characters unchanged. If the string is empty, \nreturns the empty string.\n\n## Examples\n\n```rescript\nString.capitalize(\"hello\") == \"Hello\"\nString.capitalize(\"HELLO\") == \"HELLO\"\nString.capitalize(\"hello world\") == \"Hello world\"\nString.capitalize(\"\") == \"\"\n```" - ], - "signature": "let capitalize: string => string" - }, - { - "id": "Stdlib.String.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```" - ], - "signature": "let slice: (string, ~start: int, ~end: int=?) => string" - }, - { - "id": "Stdlib.String.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```" - ], - "signature": "let sliceToEnd: (string, ~start: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nString.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nString.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nString.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```" - ], - "signature": "let split: (string, string) => array" - }, - { - "id": "Stdlib.String.splitAtMost", - "kind": "value", - "name": "splitAtMost", - "docstrings": [ - "`splitAtMost(str, delimiter, ~limit)` splits the given `str` at every\noccurrence of `delimiter` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings,\nthe array will contain all the substrings.\n\n## Examples\n\n```rescript\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=3) == [\"ant\", \"bee\", \"cat\"]\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=0) == []\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=9) == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```" - ], - "signature": "let splitAtMost: (string, string, ~limit: int) => array" - }, - { - "id": "Stdlib.String.splitByRegExp", - "kind": "value", - "name": "splitByRegExp", - "docstrings": [ - "`splitByRegExp(str, regexp)` splits the given `str` at every occurrence of\n`regexp` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExp(\"Jan,Feb,Mar\", /,/) == [Some(\"Jan\"), Some(\"Feb\"), Some(\"Mar\")]\n```" - ], - "signature": "let splitByRegExp: (string, RegExp.t) => array>" - }, - { - "id": "Stdlib.String.splitByRegExpAtMost", - "kind": "value", - "name": "splitByRegExpAtMost", - "docstrings": [ - "`splitByRegExpAtMost(str, regexp, ~limit)` splits the given `str` at every\noccurrence of `regexp` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings, the\narray will contain all the substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExpAtMost(\"Hello World. How are you doing?\", / /, ~limit=3) == [\n Some(\"Hello\"),\n Some(\"World.\"),\n Some(\"How\"),\n ]\n```" - ], - "signature": "let splitByRegExpAtMost: (string, RegExp.t, ~limit: int) => array>" - }, - { - "id": "Stdlib.String.startsWith", - "kind": "value", - "name": "startsWith", - "docstrings": [ - "`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```" - ], - "signature": "let startsWith: (string, string) => bool" - }, - { - "id": "Stdlib.String.startsWithFrom", - "kind": "value", - "name": "startsWithFrom", - "docstrings": [ - "`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```" - ], - "signature": "let startsWithFrom: (string, string, int) => bool" - }, - { - "id": "Stdlib.String.substring", - "kind": "value", - "name": "substring", - "docstrings": [ - "`substring(str, ~start, ~end)` returns characters `start` up to but not\nincluding end from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `end` is zero or negative, the empty string is returned.\n- If `start` is greater than `end`, the `start` and `end` points are swapped.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substring(\"playground\", ~start=3, ~end=6) == \"ygr\"\nString.substring(\"playground\", ~start=6, ~end=3) == \"ygr\"\nString.substring(\"playground\", ~start=4, ~end=12) == \"ground\"\nString.substring(\"playground\", ~start=4) == \"ground\"\nString.substring(\"Hello World\", ~start=6) == \"World\"\n```" - ], - "signature": "let substring: (string, ~start: int, ~end: int=?) => string" - }, - { - "id": "Stdlib.String.substringToEnd", - "kind": "value", - "name": "substringToEnd", - "docstrings": [ - "`substringToEnd(str, ~start)` returns the substring of `str` from position\n`start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string\n is returned.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substringToEnd(\"playground\", ~start=4) == \"ground\"\nString.substringToEnd(\"playground\", ~start=-3) == \"playground\"\nString.substringToEnd(\"playground\", ~start=12) == \"\"\n```" - ], - "signature": "let substringToEnd: (string, ~start: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.toLowerCase", - "kind": "value", - "name": "toLowerCase", - "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms, one when it is the last\ncharacter in a string and another when it is not.\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase) on MDN.\n\n## Examples\n\n```rescript\nString.toLowerCase(\"ABC\") == \"abc\"\nString.toLowerCase(`ΣΠ`) == `σπ`\nString.toLowerCase(`ΠΣ`) == `πς`\n```" - ], - "signature": "let toLowerCase: string => string" - }, - { - "id": "Stdlib.String.toLocaleLowerCase", - "kind": "value", - "name": "toLocaleLowerCase", - "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase) on MDN." - ], - "signature": "let toLocaleLowerCase: string => string" - }, - { - "id": "Stdlib.String.toUpperCase", - "kind": "value", - "name": "toUpperCase", - "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result, for example the German ß\ncapitalizes to two Ses in a row.\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) on MDN.\n\n## Examples\n\n```rescript\nString.toUpperCase(\"abc\") == \"ABC\"\nString.toUpperCase(`Straße`) == `STRASSE`\nString.toUpperCase(`πς`) == `ΠΣ`\n```" - ], - "signature": "let toUpperCase: string => string" - }, - { - "id": "Stdlib.String.toLocaleUpperCase", - "kind": "value", - "name": "toLocaleUpperCase", - "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\nSee [`String.toLocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase) on MDN." - ], - "signature": "let toLocaleUpperCase: string => string" - }, - { - "id": "Stdlib.String.trim", - "kind": "value", - "name": "trim", - "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim) on MDN.\n\n## Examples\n\n```rescript\nString.trim(\" abc def \") == \"abc def\"\nString.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" - ], - "signature": "let trim: string => string" - }, - { - "id": "Stdlib.String.trimStart", - "kind": "value", - "name": "trimStart", - "docstrings": [ - "`trimStart(str)` returns a string that is `str` with whitespace stripped from\nthe beginning of a string. Internal whitespace is not removed.\nSee [`String.trimStart`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimStart) on MDN.\n\n## Examples\n\n```rescript\nString.trimStart(\" Hello world! \") == \"Hello world! \"\nString.trimStart(\" Hello world! \") == \"Hello world! \"\n```" - ], - "signature": "let trimStart: string => string" - }, - { - "id": "Stdlib.String.trimEnd", - "kind": "value", - "name": "trimEnd", - "docstrings": [ - "`trimEnd(str)` returns a string that is `str` with whitespace stripped from the\nend of a string. Internal whitespace is not removed.\nSee [`String.trimEnd`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd) on MDN.\n\n## Examples\n\n```rescript\nString.trimEnd(\" Hello world! \") == \" Hello world!\"\nString.trimEnd(\" Hello world! \") == \" Hello world!\"\n```" - ], - "signature": "let trimEnd: string => string" - }, - { - "id": "Stdlib.String.padStart", - "kind": "value", - "name": "padStart", - "docstrings": [ - "`padStart(str, n, padStr)` returns a string that has been padded with `padStr`\n(multiple times, if needed) until the resulting string reaches the given `n`\nlength. The padding is applied from the start of the current string.\nSee [`String.padStart`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart) on MDN.\n\n## Examples\n\n```rescript\nString.padStart(\"abc\", 5, \" \") == \" abc\"\nString.padStart(\"abc\", 6, \"123465\") == \"123abc\"\n```" - ], - "signature": "let padStart: (string, int, string) => string" - }, - { - "id": "Stdlib.String.padEnd", - "kind": "value", - "name": "padEnd", - "docstrings": [ - "`padEnd(str, n, padStr)` returns a string that has been padded with `padStr`\n(multiple times, if needed) until the resulting string reaches the given `n`\nlength. The padding is applied from the end of the current string.\nSee [`String.padEnd`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd) on MDN.\n\n## Examples\n\n```rescript\nString.padEnd(\"Hello\", 10, \".\") == \"Hello.....\"\nString.padEnd(\"abc\", 1, \"\") == \"abc\"\n```" - ], - "signature": "let padEnd: (string, int, string) => string" - }, - { - "id": "Stdlib.String.localeCompare", - "kind": "value", - "name": "localeCompare", - "docstrings": [ - "`localeCompare(referenceStr, compareStr, ~locales=?, ~options=?)` returns a float indicating\nwhether a reference string comes before or after, or is the same as the given\nstring in sort order. Returns a negative value if `referenceStr` occurs before `compareStr`,\npositive if `referenceStr` occurs after `compareStr`, `0` if they are equivalent.\nDo not rely on exact return values of `-1` or `1`.\n\nOptionally takes `~locales` to specify locale(s) and `~options` to customize comparison behavior\n(e.g., sensitivity, case ordering, numeric sorting). These correspond to the `Intl.Collator` options.\nSee [`String.localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare) on MDN.\n\n## Examples\n\n```rescript\nString.localeCompare(\"a\", \"c\") < 0.0 == true\nString.localeCompare(\"a\", \"a\") == 0.0\nString.localeCompare(\"a\", \"b\", ~locales=[\"en-US\"]) < 0.0 == true\nString.localeCompare(\"a\", \"A\", ~locales=[\"en-US\"], ~options={sensitivity: #base}) == 0.0\n```" - ], - "signature": "let localeCompare: (\n string,\n string,\n ~locales: array=?,\n ~options: Intl_Collator.options=?,\n) => float" - }, - { - "id": "Stdlib.String.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(string)` ignores the provided string and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: string => unit" - }, - { - "id": "Stdlib.String.asIterable", - "kind": "value", - "name": "asIterable", - "docstrings": [ - "`asIterable(str)` views `str` as an `Iterable.t` where each yielded\nvalue is one string element." - ], - "signature": "let asIterable: string => Iterable.t" - }, - { - "id": "Stdlib.String.getSymbolUnsafe", - "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [ - "`getSymbolUnsafe(str, symbol)` returns the value of the symbol property of a string.\n\n## Examples\n\n```rescript\nlet it: IteratorObject.t = (\"foo\"->String.getSymbolUnsafe(Symbol.iterator))()\nNullable.make(it)->Nullable.isNullable == false\n```" - ], - "signature": "let getSymbolUnsafe: (string, Symbol.t) => 'a" - } - ] - }, - "stdlib/result": { - "id": "Stdlib.Result", - "name": "Result", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Result.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Result types are really useful to describe the result of a certain operation\n without relying on exceptions or `option` types.\n\n This module gives you useful utilities to create and combine `Result` data." - ], - "signature": "type t<'res, 'err> = result<'res, 'err> =\n | Ok('res)\n | Error('err)" - }, - { - "id": "Stdlib.Result.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getExn(Result.Ok(42)) == 42\n \n switch Result.getExn(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getExn(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```" - ], - "signature": "let getExn: (result<'a, 'b>, ~message: string=?) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Result.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getOrThrow(Result.Ok(42)) == 42\n \n switch Result.getOrThrow(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getOrThrow(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```" - ], - "signature": "let getOrThrow: (result<'a, 'b>, ~message: string=?) => 'a" - }, - { - "id": "Stdlib.Result.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(res, default, f)`: When res is `Ok(n)`, returns `f(n)`, otherwise `default`.\n\n## Examples\n\n```rescript\nlet ok = Ok(42)\nResult.mapOr(ok, 0, x => x / 2) == 21\n\nlet error = Error(\"Invalid data\")\nResult.mapOr(error, 0, x => x / 2) == 0\n```" - ], - "signature": "let mapOr: (result<'a, 'c>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Result.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (result<'a, 'c>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Result.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(res, f)`: When res is `Ok(n)`, returns `Ok(f(n))`. Otherwise returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns an\nordinary value.\n\n## Examples\n\n```rescript\nlet f = x => sqrt(Int.toFloat(x))\n\nResult.map(Ok(64), f) == Ok(8.0)\n\nResult.map(Error(\"Invalid data\"), f) == Error(\"Invalid data\")\n```" - ], - "signature": "let map: (result<'a, 'c>, 'a => 'b) => result<'b, 'c>" - }, - { - "id": "Stdlib.Result.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(res, f)`: When res is `Ok(n)`, returns `f(n)`. Otherwise, returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns a\n`Result`.\n\n## Examples\n\n```rescript\nlet recip = x =>\n if x !== 0.0 {\n Ok(1.0 /. x)\n } else {\n Error(\"Divide by zero\")\n }\n\nResult.flatMap(Ok(2.0), recip) == Ok(0.5)\n\nResult.flatMap(Ok(0.0), recip) == Error(\"Divide by zero\")\n\nResult.flatMap(Error(\"Already bad\"), recip) == Error(\"Already bad\")\n```" - ], - "signature": "let flatMap: (result<'a, 'c>, 'a => result<'b, 'c>) => result<'b, 'c>" - }, - { - "id": "Stdlib.Result.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`, otherwise `default`\n\n## Examples\n\n```rescript\nResult.getOr(Ok(42), 0) == 42\n\nResult.getOr(Error(\"Invalid Data\"), 0) == 0\n```" - ], - "signature": "let getOr: (result<'a, 'b>, 'a) => 'a" - }, - { - "id": "Stdlib.Result.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (result<'a, 'b>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Result.isOk", - "kind": "value", - "name": "isOk", - "docstrings": [ - "`isOk(res)`: Returns `true` if `res` is of the form `Ok(n)`, `false` if it is the `Error(e)` variant." - ], - "signature": "let isOk: result<'a, 'b> => bool" - }, - { - "id": "Stdlib.Result.isError", - "kind": "value", - "name": "isError", - "docstrings": [ - "`isError(res)`: Returns `true` if `res` is of the form `Error(e)`, `false` if it is the `Ok(n)` variant." - ], - "signature": "let isError: result<'a, 'b> => bool" - }, - { - "id": "Stdlib.Result.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(res1, res2, eqOk, eqError)`: Determine if two `Result` variables are equal with\nrespect to equality functions. If `res1` and `res2` are of the form `Ok(n)`\nand `Ok(m)`, return the result of `eqOk(n, m)`. If one of `res1` and `res2` are of\nthe form `Error(e)`, return false If both `res1` and `res2` are of the form\n`Error(e)`, return the result of `eqError(e1, e2)`.\n\n## Examples\n\n```rescript\nlet good1 = Ok(42)\n\nlet good2 = Ok(32)\n\nlet bad1 = Error(\"invalid\")\n\nlet bad2 = Error(\"really invalid\")\n\nlet mod10equal = (a, b) => mod(a, 10) === mod(b, 10)\n\nResult.equal(good1, good2, mod10equal, String.equal) == true\n\nResult.equal(good1, bad1, mod10equal, String.equal) == false\n\nResult.equal(bad2, good2, mod10equal, String.equal) == false\n\nResult.equal(bad1, bad2, mod10equal, String.equal) == false\n```" - ], - "signature": "let equal: (\n result<'a, 'c>,\n result<'b, 'd>,\n ('a, 'b) => bool,\n ('c, 'd) => bool,\n) => bool" - }, - { - "id": "Stdlib.Result.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(res1, res2, cmpOk, cmpError)`: Compare two `Result` variables with respect to a\ncomparison function. The comparison function returns -1. if the first variable\nis \"less than\" the second, 0. if the two variables are equal, and 1. if the first\nis \"greater than\" the second.\n\nIf `res1` and `res2` are of the form `Ok(n)` and `Ok(m)`, return the result of\n`cmpOk(n, m)`. If `res1` is of the form `Error(e)` and `res2` of the form `Ok(n)`,\nreturn -1. (nothing is less than something) If `res1` is of the form `Ok(n)` and\n`res2` is of the form `Error(e)`, return 1. (something is greater than nothing) If\nboth `res1` and `res2` are of the form `Error(e)`, return cmpError(e1, e2).\n\n## Examples\n\n```rescript\nlet good1 = Ok(59)\n\nlet good2 = Ok(37)\n\nlet bad1 = Error(\"invalid\")\n\nlet bad2 = Error(\"really invalid\")\n\nlet mod10cmp = (a, b) => Int.compare(mod(a, 10), mod(b, 10))\n\nResult.compare(Ok(39), Ok(57), mod10cmp, String.compare) == 1.\n\nResult.compare(Ok(57), Ok(39), mod10cmp, String.compare) == -1.\n\nResult.compare(Ok(39), Error(\"y\"), mod10cmp, String.compare) == 1.\n\nResult.compare(Error(\"x\"), Ok(57), mod10cmp, String.compare) == -1.\n\nResult.compare(Error(\"x\"), Error(\"y\"), mod10cmp, String.compare) == -1.\n```" - ], - "signature": "let compare: (\n result<'a, 'c>,\n result<'b, 'd>,\n ('a, 'b) => Ordering.t,\n ('c, 'd) => Ordering.t,\n) => Ordering.t" - }, - { - "id": "Stdlib.Result.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(res, f)` runs the provided function `f` on the `Ok` value. If `res` is `Error`, nothing happens.\n\n## Examples\n\n```rescript\nResult.forEach(Ok(3), Console.log) // Logs \"3\", returns ()\nResult.forEach(Error(\"x\"), Console.log) // Does nothing, returns ()\n```" - ], - "signature": "let forEach: (result<'a, 'b>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Result.mapError", - "kind": "value", - "name": "mapError", - "docstrings": [ - "`mapError(r, f)` generates a new `result` by applying the function `f` to the `Error` value. If the source is `Ok`, return it as-is.\n\n## Examples\n\n```rescript\nlet format = n => `Error code: ${n->Int.toString}`\nResult.mapError(Error(14), format) == Error(\"Error code: 14\")\nResult.mapError(Ok(\"abc\"), format) == Ok(\"abc\")\n```" - ], - "signature": "let mapError: (result<'a, 'b>, 'b => 'c) => result<'a, 'c>" - }, - { - "id": "Stdlib.Result.all", - "kind": "value", - "name": "all", - "docstrings": [ - "`all(results)` returns a result of array if all options are Ok, otherwise returns Error.\n## Examples\n```rescript\nResult.all([Ok(1), Ok(2), Ok(3)]) == Ok([1, 2, 3])\nResult.all([Ok(1), Error(1)]) == Error(1)\n```" - ], - "signature": "let all: array> => result, 'b>" - }, - { - "id": "Stdlib.Result.all2", - "kind": "value", - "name": "all2", - "docstrings": [ - "`all2((r1, r2))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all2: (\n (result<'r1, 'e>, result<'r2, 'e>),\n) => result<('r1, 'r2), 'e>" - }, - { - "id": "Stdlib.Result.all3", - "kind": "value", - "name": "all3", - "docstrings": [ - "`all3((r1, r2, r3))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all3: (\n (result<'r1, 'e>, result<'r2, 'e>, result<'r3, 'e>),\n) => result<('r1, 'r2, 'r3), 'e>" - }, - { - "id": "Stdlib.Result.all4", - "kind": "value", - "name": "all4", - "docstrings": [ - "`all4((r1, r2, r3, r4))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all4: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4), 'e>" - }, - { - "id": "Stdlib.Result.all5", - "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((r1, r2, r3, r4, r5))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all5: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n result<'r5, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4, 'r5), 'e>" - }, - { - "id": "Stdlib.Result.all6", - "kind": "value", - "name": "all6", - "docstrings": [ - "`all6((r1, r2, r3, r4, r5, r6))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all6: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n result<'r5, 'e>,\n result<'r6, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4, 'r5, 'r6), 'e>" - }, - { - "id": "Stdlib.Result.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(result)` ignores the provided result and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: result<'res, 'err> => unit" - }, - { - "id": "Stdlib.Result.mapOkAsync", - "kind": "value", - "name": "mapOkAsync", - "docstrings": [ - "`mapOkAsync(res, f)`: Asynchronously maps over the Ok value of a Result. When `res` is `Ok(n)`, \napplies the async function `f` to `n` and wraps the result in `Ok`. \nWhen `res` is `Error`, returns the error unchanged.\n\n## Examples\n\n```rescript\n let square = x => x * x\n\n let result1 = await Result.mapOkAsync(Promise.resolve(Ok(4)), square)\n result1 == Ok(16)\n\n let result2 = await Result.mapOkAsync(\n Promise.resolve(Error(\"invalid\")),\n square,\n )\n result2 == Error(\"invalid\")\n```" - ], - "signature": "let mapOkAsync: (\n promise>,\n 'ok => 'mappedOk,\n) => promise>" - }, - { - "id": "Stdlib.Result.mapErrorAsync", - "kind": "value", - "name": "mapErrorAsync", - "docstrings": [ - "`mapErrorAsync(res, f)`: Asynchronously maps over the Error value of a Result. When `res` is `Error(e)`, \napplies the async function `f` to `e` and wraps the result in `Error`. \nWhen `res` is `Ok`, returns the ok value unchanged.\n\n## Examples\n\n```rescript\nlet formatError = e => `Error: ${e}`\n\nlet result1 = await Result.mapErrorAsync(Promise.resolve(Ok(42)), formatError)\nresult1 == Ok(42)\n\nlet result2 = await Result.mapErrorAsync(Promise.resolve(Error(\"invalid\")), formatError)\nresult2 == Error(\"Error: invalid\")\n```" - ], - "signature": "let mapErrorAsync: (\n promise>,\n 'error => 'mappedError,\n) => promise>" - }, - { - "id": "Stdlib.Result.flatMapOkAsync", - "kind": "value", - "name": "flatMapOkAsync", - "docstrings": [ - "`flatMapOkAsync(res, f)`: Asynchronously flat-maps over the Ok value of a Result. When `res` is `Ok(n)`, \napplies the async function `f` to `n` which returns a Promise of a Result. \nWhen `res` is `Error`, returns the error unchanged.\n\n## Examples\n\n```rescript\nlet asyncValidate = async x =>\n if x > 0 {\n Ok(x * 2)\n } else {\n Error(\"Must be positive\")\n }\n\nlet result1 = await Result.flatMapOkAsync(Promise.resolve(Ok(5)), asyncValidate)\nresult1 == Ok(10)\n\nlet result2 = await Result.flatMapOkAsync(\n Promise.resolve(Error(\"Already failed\")),\n asyncValidate,\n)\nresult2 == Error(\"Already failed\")\n```" - ], - "signature": "let flatMapOkAsync: (\n promise>,\n 'ok => promise>,\n) => promise>" - }, - { - "id": "Stdlib.Result.flatMapErrorAsync", - "kind": "value", - "name": "flatMapErrorAsync", - "docstrings": [ - "`flatMapErrorAsync(res, f)`: Asynchronously flat-maps over the Error value of a Result. When `res` is `Error(e)`, \napplies the async function `f` to `e` which returns a Promise of a Result. \nWhen `res` is `Ok`, returns the ok value unchanged.\n\n## Examples\n\n```rescript\nlet asyncRecover = async error =>\n if error === \"timeout\" {\n Ok(\"default\")\n } else {\n Error(error)\n }\n\nlet result1 = await Result.flatMapErrorAsync(\n Promise.resolve(Error(\"timeout\")),\n asyncRecover,\n)\nresult1 == Ok(\"default\")\n\nlet result2 = await Result.flatMapErrorAsync(\n Promise.resolve(Ok(\"default\")),\n asyncRecover,\n)\nresult2 == Ok(\"default\")\n```" - ], - "signature": "let flatMapErrorAsync: (\n promise>,\n 'error => promise>,\n) => promise>" - } - ] - }, - "stdlib/regexp": { - "id": "Stdlib.RegExp", - "name": "RegExp", - "docstrings": [ - "Functions for handling RegExp's in ReScript.\n\nSee [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) on MDN." - ], - "items": [ - { - "id": "Stdlib.RegExp.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an instantiated `RegExp`." - ], - "signature": "type t" - }, - { - "id": "Stdlib.RegExp.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(string)` creates a `RegExp.t` from the provided string. This can then be used to match on strings using `RegExp.exec`.\n\nSee [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n\n// Match 'foo' with case insensitive flag\nlet regexp = RegExp.fromString(\"foo\", ~flags=\"i\")\n\nswitch regexp->RegExp.exec(\"FOO\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"FOO\"\n}\n```" - ], - "signature": "let fromString: (string, ~flags: string=?) => t" - }, - { - "id": "Stdlib.RegExp.fromStringWithFlags", - "kind": "value", - "name": "fromStringWithFlags", - "docstrings": [ - "`fromStringWithFlags(string)` creates a `RegExp.t` from the provided string, using the provided `flags`. This can then be used to match on strings using `RegExp.exec`.\n\nSee [`RegExp parameters`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp#parameters) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```" - ], - "signature": "let fromStringWithFlags: (string, ~flags: string) => t", - "deprecated": "" - }, - { - "id": "Stdlib.RegExp.escape", - "kind": "value", - "name": "escape", - "docstrings": [ - "`escape(string)` escapes any potential regex syntax characters in a string.\n\nSee [`RegExp.escape`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/escape) on MDN.\n\n## Examples\n```rescript\nlet literal = \"foo[bar]\"\nlet regexp = literal->RegExp.escape->RegExp.fromString\nregexp->RegExp.test(\"foo[bar]\") == true\n```\n\n## Remark\n\nSince May 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let escape: string => string" - }, - { - "id": "Stdlib.RegExp.test", - "kind": "value", - "name": "test", - "docstrings": [ - "`test(regexp, string)` tests whether the provided `regexp` matches on the provided string.\n\nSee [`RegExp.test`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nif regexp->RegExp.test(\"ReScript is cool!\") {\n Console.log(\"Yay, there's a word in there.\")\n}\n```" - ], - "signature": "let test: (t, string) => bool" - }, - { - "id": "Stdlib.RegExp.exec", - "kind": "value", - "name": "exec", - "docstrings": [ - "`exec(regexp, string)` executes the provided regexp on the provided string, optionally returning a `RegExp.Result.t` if the regexp matches on the string.\n\nSee [`RegExp.exec`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```" - ], - "signature": "let exec: (t, string) => option" - }, - { - "id": "Stdlib.RegExp.lastIndex", - "kind": "value", - "name": "lastIndex", - "docstrings": [ - "`lastIndex(regexp)` returns the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `0` to the console\n\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `4` to the console\n```" - ], - "signature": "let lastIndex: t => int" - }, - { - "id": "Stdlib.RegExp.setLastIndex", - "kind": "value", - "name": "setLastIndex", - "docstrings": [ - "`setLastIndex(regexp, index)` set the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nregexp->RegExp.setLastIndex(4)\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `10` to the console\n```" - ], - "signature": "let setLastIndex: (t, int) => unit" - }, - { - "id": "Stdlib.RegExp.ignoreCase", - "kind": "value", - "name": "ignoreCase", - "docstrings": [ - "`ignoreCase(regexp)` returns whether the ignore case (`i`) flag is set on this `RegExp`.\n\nSee [`RegExp.ignoreCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/ignoreCase) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.ignoreCase) // Logs `false`, since `i` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.ignoreCase) // Logs `true`, since `i` is set\n```" - ], - "signature": "let ignoreCase: t => bool" - }, - { - "id": "Stdlib.RegExp.global", - "kind": "value", - "name": "global", - "docstrings": [ - "`global(regexp)` returns whether the global (`g`) flag is set on this `RegExp`.\n\nSee [`RegExp.global`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/global) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.global) // Logs `true`, since `g` is set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.global) // Logs `false`, since `g` is not set\n```" - ], - "signature": "let global: t => bool" - }, - { - "id": "Stdlib.RegExp.multiline", - "kind": "value", - "name": "multiline", - "docstrings": [ - "`multiline(regexp)` returns whether the multiline (`m`) flag is set on this `RegExp`.\n\nSee [`RegExp.multiline`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/multiline) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.multiline) // Logs `false`, since `m` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mi\")\nConsole.log(regexp2->RegExp.multiline) // Logs `true`, since `m` is set\n```" - ], - "signature": "let multiline: t => bool" - }, - { - "id": "Stdlib.RegExp.source", - "kind": "value", - "name": "source", - "docstrings": [ - "`source(regexp)` returns the source text for this `RegExp`, without the two forward slashes (if present), and without any set flags.\n\nSee [`RegExp.source`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/source) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp->RegExp.source) // Logs `\\w+`, the source text of the `RegExp`\n```" - ], - "signature": "let source: t => string" - }, - { - "id": "Stdlib.RegExp.sticky", - "kind": "value", - "name": "sticky", - "docstrings": [ - "`sticky(regexp)` returns whether the sticky (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.sticky`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `y` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"my\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `y` is set\n```" - ], - "signature": "let sticky: t => bool" - }, - { - "id": "Stdlib.RegExp.unicode", - "kind": "value", - "name": "unicode", - "docstrings": [ - "`unicode(regexp)` returns whether the unicode (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.unicode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `u` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mu\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `u` is set\n```" - ], - "signature": "let unicode: t => bool" - }, - { - "id": "Stdlib.RegExp.flags", - "kind": "value", - "name": "flags", - "docstrings": [ - "`flags(regexp)` returns a string consisting of all the flags set on this `RegExp`.\n\nSee [`RegExp.flags`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromString(\"\\\\w+\", ~flags=\"gi\")\nConsole.log(regexp->RegExp.flags) // Logs \"gi\", all the flags set on the RegExp\n```" - ], - "signature": "let flags: t => string" - }, - { - "id": "Stdlib.RegExp.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(regExp)` ignores the provided regExp and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/promise": { - "id": "Stdlib.Promise", - "name": "Promise", - "docstrings": [ - "Functions for interacting with JavaScript Promise.\nSee: [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)." - ], - "items": [ - { - "id": "Stdlib.Promise.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>" - }, - { - "id": "Stdlib.Promise.resolve", - "kind": "value", - "name": "resolve", - "docstrings": [ - "`resolve(value)` creates a resolved Promise with a given `value`.\nSee [`Promise.resolve`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve) on MDN.\n\n## Examples\n\n```rescript\nlet p = Promise.resolve(5) // promise\n```" - ], - "signature": "let resolve: 'a => t<'a>" - }, - { - "id": "Stdlib.Promise.reject", - "kind": "value", - "name": "reject", - "docstrings": [ - "`reject(exn)` reject a Promise.\nSee [`Promise.reject`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject) on MDN.\n\n## Examples\n\n```rescript\nexception TestError(string)\n\nTestError(\"some rejected value\")\n->Promise.reject\n->Promise.catch(v => {\n switch v {\n | TestError(msg) => msg == \"some rejected value\"\n | _ => assert(false)\n }\n Promise.resolve()\n})\n->ignore\n```" - ], - "signature": "let reject: exn => t<'a>" - }, - { - "id": "Stdlib.Promise.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(callback)` creates a new Promise based on a `callback` that receives two\nuncurried functions `resolve` and `reject` for defining the Promise's result.\n\n## Examples\n\n```rescript\nopen Promise\n\nlet n = 4\nPromise.make((resolve, reject) => {\n if n < 5 {\n resolve(\"success\")\n } else {\n reject(\"failed\")\n }\n})\n->then(str => {\n Console.log(str)->resolve\n})\n->catch(_ => {\n Console.log(\"Error occurred\")\n resolve()\n})\n->ignore\n```" - ], - "signature": "let make: (('a => unit, 'e => unit) => unit) => t<'a>" - }, - { - "id": "Stdlib.Promise.promiseAndResolvers", - "kind": "type", - "name": "promiseAndResolvers", - "docstrings": [], - "signature": "type promiseAndResolvers<'a> = {\n promise: t<'a>,\n resolve: 'a => unit,\n reject: exn => unit,\n}" - }, - { - "id": "Stdlib.Promise.withResolvers", - "kind": "value", - "name": "withResolvers", - "docstrings": [ - "`withResolvers()` returns a object containing a new promise with functions to resolve or reject it. See [`Promise.withResolvers`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\n\nlet {promise, resolve, _} = Promise.withResolvers()\n\nsetTimeout(() => {\n resolve(\"success\")\n}, 1000)->TimeoutId.ignore\n\npromise\n->thenResolve(str => {\n Console.log(str)\n})\n->ignore\n```" - ], - "signature": "let withResolvers: unit => promiseAndResolvers<'a>" - }, - { - "id": "Stdlib.Promise.catch", - "kind": "value", - "name": "catch", - "docstrings": [ - "`catch(promise, errorCallback)` registers an exception handler in a promise chain.\nThe `errorCallback` receives an `exn` value that can later be refined into a JS\nerror or ReScript error. The `errorCallback` needs to return a promise with the\nsame type as the consumed promise. See [`Promise.catch`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\n\nexception SomeError(string)\n\nreject(SomeError(\"this is an error\"))\n->then(_ => {\n Ok(\"This result will never be returned\")->resolve\n})\n->catch(e => {\n let msg = switch e {\n | SomeError(msg) => \"ReScript error occurred: \" ++ msg\n | JsExn(obj) =>\n switch JsExn.message(obj) {\n | Some(msg) => \"JS exception occurred: \" ++ msg\n | None => \"Some other JS value has been thrown\"\n }\n | _ => \"Unexpected error occurred\"\n }\n\n Error(msg)->resolve\n})\n->then(result => {\n switch result {\n | Ok(r) => Console.log2(\"Operation successful: \", r)\n | Error(msg) => Console.log2(\"Operation failed: \", msg)\n }->resolve\n})\n->ignore // Ignore needed for side-effects\n```\n\nIn case you want to return another promise in your `callback`, consider using\n`then` instead." - ], - "signature": "let catch: (t<'a>, exn => t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Promise.then", - "kind": "value", - "name": "then", - "docstrings": [ - "`then(promise, callback)` returns a new promise based on the result of `promise`'s\nvalue. The `callback` needs to explicitly return a new promise via `resolve`.\nIt is **not allowed** to resolve a nested promise (like `resolve(resolve(1))`).\nSee [`Promise.then`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) on MDN.\n## Examples\n\n```rescript\nopen Promise\nresolve(5)\n->then(num => {\n resolve(num + 5)\n})\n->then(num => {\n Console.log2(\"Your lucky number is: \", num)\n resolve()\n})\n->ignore\n```" - ], - "signature": "let then: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Promise.thenResolve", - "kind": "value", - "name": "thenResolve", - "docstrings": [ - "`thenResolve(promise, callback)` converts an encapsulated value of a promise\ninto another promise wrapped value. It is **not allowed** to return a promise\nwithin the provided callback (e.g. `thenResolve(value => resolve(value))`).\n\n## Examples\n\n```rescript\nopen Promise\nresolve(\"Anna\")\n->thenResolve(str => {\n \"Hello \" ++ str\n})\n->thenResolve(str => {\n Console.log(str)\n})\n->ignore // Ignore needed for side-effects\n```\n\nIn case you want to return another promise in your `callback`, consider using\n`then` instead." - ], - "signature": "let thenResolve: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Promise.finally", - "kind": "value", - "name": "finally", - "docstrings": [ - "`finally(promise, callback)` is used to execute a function that is called no\nmatter if a promise was resolved or rejected. It will return the same `promise`\nit originally received. See [`Promise.finally`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/finally) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nexception SomeError(string)\nlet isDone = ref(false)\n\nresolve(5)\n->then(_ => {\n reject(SomeError(\"test\"))\n})\n->then(v => {\n Console.log2(\"final result\", v)\n resolve()\n})\n->catch(_ => {\n Console.log(\"Error handled\")\n resolve()\n})\n->finally(() => {\n Console.log(\"finally\")\n isDone := true\n})\n->then(() => {\n Console.log2(\"isDone:\", isDone.contents)\n resolve()\n})\n->ignore\n```" - ], - "signature": "let finally: (t<'a>, unit => unit) => t<'a>" - }, - { - "id": "Stdlib.Promise.race", - "kind": "value", - "name": "race", - "docstrings": [ - "`race(arr)` runs all promises concurrently and returns promise settles with the eventual state of the first promise that settles. See [`Promise.race`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nlet racer = (ms, name) => {\n Promise.make((resolve, _) => {\n setTimeout(() => {\n resolve(name)\n }, ms)->TimeoutId.ignore\n })\n}\n\nlet promises = [racer(1000, \"Turtle\"), racer(500, \"Hare\"), racer(100, \"Eagle\")]\n\nrace(promises)->then(winner => {\n Console.log(\"The winner is \" ++ winner)\n resolve()\n})\n```" - ], - "signature": "let race: array> => t<'a>" - }, - { - "id": "Stdlib.Promise.any", - "kind": "value", - "name": "any", - "docstrings": [ - "`any(arr)` runs all promises concurrently and returns promise fulfills when any of the input's promises fulfills, with this first fulfillment value. See [`Promise.any`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/any) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nlet racer = (ms, name) => {\n Promise.make((resolve, _) => {\n setTimeout(() => {\n resolve(name)\n }, ms)->TimeoutId.ignore\n })\n}\n\nlet promises = [racer(1000, \"Turtle\"), racer(500, \"Hare\"), racer(100, \"Eagle\")]\n\nany(promises)->then(winner => {\n Console.log(\"The winner is \" ++ winner)\n resolve()\n})\n```" - ], - "signature": "let any: array> => t<'a>" - }, - { - "id": "Stdlib.Promise.all", - "kind": "value", - "name": "all", - "docstrings": [ - "`all(promises)` runs all promises concurrently and returns a promise fulfills when all of the input's promises fulfill, with an array of the fulfillment values. See [`Promise.all`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all) on MDN.\n\n```rescript\nopen Promise\nlet promises = [resolve(1), resolve(2), resolve(3)]\n\nall(promises)\n->then(results => {\n results->Array.forEach(num => {\n Console.log2(\"Number: \", num)\n })\n\n resolve()\n})\n->ignore\n```" - ], - "signature": "let all: array> => t>" - }, - { - "id": "Stdlib.Promise.all2", - "kind": "value", - "name": "all2", - "docstrings": [ - "`all2((p1, p2))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all2: ((t<'a>, t<'b>)) => t<('a, 'b)>" - }, - { - "id": "Stdlib.Promise.all3", - "kind": "value", - "name": "all3", - "docstrings": [ - "`all3((p1, p2, p3))`. Like `all()`, but with a fixed size tuple of 3" - ], - "signature": "let all3: ((t<'a>, t<'b>, t<'c>)) => t<('a, 'b, 'c)>" - }, - { - "id": "Stdlib.Promise.all4", - "kind": "value", - "name": "all4", - "docstrings": [ - "`all4((p1, p2, p3, p4))`. Like `all()`, but with a fixed size tuple of 4" - ], - "signature": "let all4: ((t<'a>, t<'b>, t<'c>, t<'d>)) => t<('a, 'b, 'c, 'd)>" - }, - { - "id": "Stdlib.Promise.all5", - "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((p1, p2, p3, p4, p5))`. Like `all()`, but with a fixed size tuple of 5" - ], - "signature": "let all5: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>),\n) => t<('a, 'b, 'c, 'd, 'e)>" - }, - { - "id": "Stdlib.Promise.all6", - "kind": "value", - "name": "all6", - "docstrings": [ - "`all6((p1, p2, p4, p5, p6))`. Like `all()`, but with a fixed size tuple of 6\n\")" - ], - "signature": "let all6: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>, t<'f>),\n) => t<('a, 'b, 'c, 'd, 'e, 'f)>" - }, - { - "id": "Stdlib.Promise.settledResult", - "kind": "type", - "name": "settledResult", - "docstrings": [], - "signature": "type settledResult<'a> =\n | Fulfilled({value: 'a})\n | Rejected({reason: exn})" - }, - { - "id": "Stdlib.Promise.allSettled", - "kind": "value", - "name": "allSettled", - "docstrings": [ - "`allSettled(promises)` runs all promises concurrently and returns promise fulfills when all of the input's promises settle with an array of objects that describe the outcome of each promise. See [`Promise.allSettled`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled) on MDN.\n\n```rescript\nopen Promise\n\nexception TestError(string)\n\nlet promises = [resolve(1), resolve(2), reject(TestError(\"some rejected promise\"))]\n\nallSettled(promises)\n->then(results => {\n results->Array.forEach(result => {\n switch result {\n | Fulfilled({value: num}) => Console.log2(\"Number: \", num)\n | Rejected({reason}) => Console.log(reason)\n }\n })\n\n resolve()\n})\n->ignore\n```" - ], - "signature": "let allSettled: array> => t>>" - }, - { - "id": "Stdlib.Promise.allSettled2", - "kind": "value", - "name": "allSettled2", - "docstrings": [ - "`allSettled2((p1, p2))`. Like `allSettled()`, but with a fixed size tuple of 2" - ], - "signature": "let allSettled2: (\n (t<'a>, t<'b>),\n) => t<(settledResult<'a>, settledResult<'b>)>" - }, - { - "id": "Stdlib.Promise.allSettled3", - "kind": "value", - "name": "allSettled3", - "docstrings": [ - "`allSettled3((p1, p2, p3))`. Like `allSettled()`, but with a fixed size tuple of 3" - ], - "signature": "let allSettled3: (\n (t<'a>, t<'b>, t<'c>),\n) => t<\n (settledResult<'a>, settledResult<'b>, settledResult<'c>),\n>" - }, - { - "id": "Stdlib.Promise.allSettled4", - "kind": "value", - "name": "allSettled4", - "docstrings": [ - "`allSettled4((p1, p2, p3, p4))`. Like `allSettled()`, but with a fixed size tuple of 4" - ], - "signature": "let allSettled4: (\n (t<'a>, t<'b>, t<'c>, t<'d>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n ),\n>" - }, - { - "id": "Stdlib.Promise.allSettled5", - "kind": "value", - "name": "allSettled5", - "docstrings": [ - "`allSettled5((p1, p2, p3, p4, p5))`. Like `allSettled()`, but with a fixed size tuple of 5" - ], - "signature": "let allSettled5: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n settledResult<'e>,\n ),\n>" - }, - { - "id": "Stdlib.Promise.allSettled6", - "kind": "value", - "name": "allSettled6", - "docstrings": [ - "`allSettled6((p1, p2, p4, p5, p6))`. Like `allSettled()`, but with a fixed size tuple of 6\n\")" - ], - "signature": "let allSettled6: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>, t<'f>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n settledResult<'e>,\n settledResult<'f>,\n ),\n>" - }, - { - "id": "Stdlib.Promise.done", - "kind": "value", - "name": "done", - "docstrings": [ - "`done(p)` is a safe way to ignore a promise. If a value is anything else than a\npromise, it will throw a type error." - ], - "signature": "let done: promise<'a> => unit", - "deprecated": "" - }, - { - "id": "Stdlib.Promise.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(promise)` ignores the provided promise and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: promise<'a> => unit" - } - ] - }, - "stdlib/pair": { - "id": "Stdlib.Pair", - "name": "Pair", - "docstrings": [ - "This module provides functions to work with pairs, which are 2-element tuples." - ], - "items": [ - { - "id": "Stdlib.Pair.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a, 'b> = ('a, 'b)" - }, - { - "id": "Stdlib.Pair.first", - "kind": "value", - "name": "first", - "docstrings": [ - "`first(pair)` returns the first element of a pair.\n\n## Examples\n\n```rescript\nPair.first((1, 2)) == 1\n```" - ], - "signature": "let first: (('a, 'b)) => 'a" - }, - { - "id": "Stdlib.Pair.second", - "kind": "value", - "name": "second", - "docstrings": [ - "`second(pair)` returns the second element of a pair.\n\n## Examples\n\n```rescript\nPair.second((1, 2)) == 2\n```" - ], - "signature": "let second: (('a, 'b)) => 'b" - }, - { - "id": "Stdlib.Pair.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(pair)` ignores the provided pair and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Pair.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(pair1, pair2, f1, f2)` check equality of `pair2` and `pair2` using `f1` for\nequality on the first element and `f2` for equality on the second element.\n\n## Examples\n\n```rescript\nPair.equal((1, \"test\"), (1, \"test\"), Int.equal, String.equal) == true\n\nPair.equal((1, \"test\"), (2, \"test\"), Int.equal, String.equal) == false\n```" - ], - "signature": "let equal: (\n ('a, 'b),\n ('c, 'd),\n ('a, 'c) => bool,\n ('b, 'd) => bool,\n) => bool" - }, - { - "id": "Stdlib.Pair.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(pair1, pair2, f1, f2)` compares two pairs, using `f1` to compare the first element\nand `f2` to compare the second element. Ordering is based on the first element,\nif they are equal, the second element is compared.\n\n## Examples\n\n```rescript\nPair.compare((1, \"a\"), (1, \"a\"), Int.compare, String.compare) == Ordering.equal\nPair.compare((1, \"a\"), (1, \"b\"), Int.compare, String.compare) == Ordering.less\nPair.compare((2, \"a\"), (1, \"b\"), Int.compare, String.compare) == Ordering.greater\n```" - ], - "signature": "let compare: (\n ('a, 'b),\n ('c, 'd),\n ('a, 'c) => float,\n ('b, 'd) => float,\n) => float" - } - ] - }, - "stdlib/ordering": { - "id": "Stdlib.Ordering", - "name": "Ordering", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Ordering.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Ordering values represent the result of a comparison: `less`, `equal`, or `greater`." - ], - "signature": "type t = float" - }, - { - "id": "Stdlib.Ordering.less", - "kind": "value", - "name": "less", - "docstrings": [], - "signature": "let less: float" - }, - { - "id": "Stdlib.Ordering.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: float" - }, - { - "id": "Stdlib.Ordering.greater", - "kind": "value", - "name": "greater", - "docstrings": [], - "signature": "let greater: float" - }, - { - "id": "Stdlib.Ordering.isLess", - "kind": "value", - "name": "isLess", - "docstrings": [ - "`isLess(ordering)` returns `true` when `ordering` equals `Ordering.less`.\n\n## Examples\n\n```rescript\nOrdering.isLess(Ordering.less) == true\nOrdering.isLess(Ordering.equal) == false\n```" - ], - "signature": "let isLess: float => bool" - }, - { - "id": "Stdlib.Ordering.isEqual", - "kind": "value", - "name": "isEqual", - "docstrings": [ - "`isEqual(ordering)` returns `true` when `ordering` equals `Ordering.equal`.\n\n## Examples\n\n```rescript\nOrdering.isEqual(Ordering.equal) == true\nOrdering.isEqual(Ordering.greater) == false\n```" - ], - "signature": "let isEqual: float => bool" - }, - { - "id": "Stdlib.Ordering.isGreater", - "kind": "value", - "name": "isGreater", - "docstrings": [ - "`isGreater(ordering)` returns `true` when `ordering` equals `Ordering.greater`.\n\n## Examples\n\n```rescript\nOrdering.isGreater(Ordering.greater) == true\nOrdering.isGreater(Ordering.less) == false\n```" - ], - "signature": "let isGreater: float => bool" - }, - { - "id": "Stdlib.Ordering.invert", - "kind": "value", - "name": "invert", - "docstrings": [ - "`invert(ordering)` flips the ordering result (less becomes greater and vice versa).\n\n## Examples\n\n```rescript\nOrdering.invert(Ordering.less) == Ordering.greater\nOrdering.invert(Ordering.equal) == Ordering.equal\n```" - ], - "signature": "let invert: float => float" - }, - { - "id": "Stdlib.Ordering.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "`fromInt(n)` converts an integer comparison result into an ordering.\n\n## Examples\n\n```rescript\nOrdering.fromInt(-5) == Ordering.less\nOrdering.fromInt(0) == Ordering.equal\nOrdering.fromInt(3) == Ordering.greater\n```" - ], - "signature": "let fromInt: int => float" - }, - { - "id": "Stdlib.Ordering.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(ordering)` ignores the provided ordering and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/option": { - "id": "Stdlib.Option", - "name": "Option", - "docstrings": [ - "We represent the existence and nonexistence of a value by wrapping it with\nthe `option` type. In order to make it a bit more convenient to work with\noption-types, we provide utility-functions for it.\n\nThe `option` type is a part of the ReScript standard library which is defined\nlike this:\n\n```rescript\ntype option<'a> = None | Some('a)\n```\n\n```rescript\nlet someString: option = Some(\"hello\")\n```" - ], - "items": [ - { - "id": "Stdlib.Option.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an option of type 'a." - ], - "signature": "type t<'a> = option<'a> = None | Some('a)" - }, - { - "id": "Stdlib.Option.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(opt, f)` applies `f` to `opt`, if `f` returns `true`, then it returns `Some(value)`, otherwise returns `None`.\n\n## Examples\n\n```rescript\nOption.filter(Some(10), x => x > 5) // Some(10)\nOption.filter(Some(4), x => x > 5) // None\nOption.filter(None, x => x > 5) // None\n```" - ], - "signature": "let filter: (option<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Option.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(opt, f)` call `f` on `opt`. if `opt` is `Some(value)`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nOption.forEach(Some(\"thing\"), x => Console.log(x)) // logs \"thing\"\nOption.forEach(None, x => Console.log(x)) // returns ()\n```" - ], - "signature": "let forEach: (option<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Option.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(opt, ~message=?)` returns `value` if `opt` is `Some(value)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n```rescript\nOption.getExn(Some(3)) == 3\n\nswitch Option.getExn(None) {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n\nswitch Option.getExn(None, ~message=\"was None!\") {\n| exception _ => assert(true) // Throws a JsError with the message \"was None!\"\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an error if `opt` is `None`" - ], - "signature": "let getExn: (option<'a>, ~message: string=?) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Option.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(opt, ~message=?)` returns `value` if `opt` is `Some(value)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n```rescript\nOption.getOrThrow(Some(3)) == 3\n\nswitch Option.getOrThrow(None) {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n\nswitch Option.getOrThrow(None, ~message=\"was None!\") {\n| exception _ => assert(true) // Throws a JsError with the message \"was None!\"\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an error if `opt` is `None`" - ], - "signature": "let getOrThrow: (option<'a>, ~message: string=?) => 'a" - }, - { - "id": "Stdlib.Option.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(opt)` returns `value` if `opt` is `Some(value)`, otherwise `undefined`.\n\n## Examples\n\n```rescript\nOption.getUnsafe(Some(3)) == 3\nOption.getUnsafe((None: option)) // Returns `undefined`, which is not a valid `int`\n```\n\n## Notes\n\n- This is an unsafe operation. It assumes `value` is not `None`, and may cause undefined behaviour if it is." - ], - "signature": "let getUnsafe: option<'a> => 'a" - }, - { - "id": "Stdlib.Option.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(opt, default, f)` returns `f(value)` if `opt` is `Some(value)`, otherwise `default`.\n\n## Examples\n\n```rescript\nlet someValue = Some(3)\nsomeValue->Option.mapOr(0, x => x + 5) // 8\n\nlet noneValue = None\nnoneValue->Option.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (option<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Option.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (option<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Option.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(opt, f)` returns `Some(f(value))` if `opt` is `Some(value)`, otherwise `None`.\n\n## Examples\n\n```rescript\nOption.map(Some(3), x => x * x) // Some(9)\nOption.map(None, x => x * x) // None\n```" - ], - "signature": "let map: (option<'a>, 'a => 'b) => option<'b>" - }, - { - "id": "Stdlib.Option.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(opt, f)` returns `f(value)` if `opt` is `Some(value)`, otherwise `None`.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Some(value + 1)\n } else {\n None\n }\n\nOption.flatMap(Some(2), addIfAboveOne) // Some(3)\nOption.flatMap(Some(-4), addIfAboveOne) // None\nOption.flatMap(None, addIfAboveOne) // None\n```" - ], - "signature": "let flatMap: (option<'a>, 'a => option<'b>) => option<'b>" - }, - { - "id": "Stdlib.Option.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(opt, default)` returns `value` if `opt` is `Some(value)`, otherwise `default`.\n\n## Examples\n\n```rescript\nOption.getOr(None, \"Banana\") // Banana\nOption.getOr(Some(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nSome(\"Jane\")->greet // \"Greetings Jane\"\nNone->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (option<'a>, 'a) => 'a" - }, - { - "id": "Stdlib.Option.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (option<'a>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Option.orElse", - "kind": "value", - "name": "orElse", - "docstrings": [ - "`orElse(opt1, opt2)` returns `opt2` if `opt1` is `None`, otherwise `opt1`.\n\n## Examples\n\n```rescript\nOption.orElse(Some(1812), Some(1066)) == Some(1812)\nOption.orElse(None, Some(1066)) == Some(1066)\nOption.orElse(None, None) == None\n```" - ], - "signature": "let orElse: (option<'a>, option<'a>) => option<'a>" - }, - { - "id": "Stdlib.Option.isSome", - "kind": "value", - "name": "isSome", - "docstrings": [ - "`isSome(opt)` returns `true` if `opt` is `Some(value)`, otherwise returns `false`.\n\n## Examples\n\n```rescript\nOption.isSome(None) // false\nOption.isSome(Some(1)) // true\n```" - ], - "signature": "let isSome: option<'a> => bool" - }, - { - "id": "Stdlib.Option.isNone", - "kind": "value", - "name": "isNone", - "docstrings": [ - "`isNone(opt)` returns `true` if `opt` is `None`, false otherwise.\n\n## Examples\n\n```rescript\nOption.isNone(None) // true\nOption.isNone(Some(1)) // false\n```" - ], - "signature": "let isNone: option<'a> => bool" - }, - { - "id": "Stdlib.Option.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(opt1, opt2, f)` evaluates two optional values for equality with respect to a predicate function `f`. If both `opt1` and `opt2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, the predicate function `f` must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Option\n\nequal(Some(3), Some(15), clockEqual) // true\nequal(Some(3), None, clockEqual) // false\nequal(None, Some(3), clockEqual) // false\nequal(None, None, clockEqual) // true\n```" - ], - "signature": "let equal: (option<'a>, option<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.Option.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(opt1, opt2, f)` compares two optional values with respect to given `f`.\n\nIf both `opt1` and `opt2` are `None`, it returns `0.`. If the first argument is `Some(value1)` and the second is `None`, returns `1.` (something is greater than nothing).\n\nIf the first argument is `None` and the second is `Some(value2)`, returns `-1.`\n(nothing is less than something).\n\nIf the arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, `f` takes two arguments and returns `-1.` if the first\nargument is less than the second, `0.` if the arguments are equal, and `1.` if\nthe first argument is greater than the second.\n\n## Examples\n\n```rescript\nlet clockCompare = (a, b) => Int.compare(mod(a, 12), mod(b, 12))\n\nOption.compare(Some(3), Some(15), clockCompare) // 0.\nOption.compare(Some(3), Some(14), clockCompare) // 1.\nOption.compare(Some(2), Some(15), clockCompare) // (-1.)\nOption.compare(None, Some(15), clockCompare) // (-1.)\nOption.compare(Some(14), None, clockCompare) // 1.\nOption.compare(None, None, clockCompare) // 0.\n```" - ], - "signature": "let compare: (\n option<'a>,\n option<'b>,\n ('a, 'b) => Ordering.t,\n) => Ordering.t" - }, - { - "id": "Stdlib.Option.all", - "kind": "value", - "name": "all", - "docstrings": [ - "`all(options)` returns an option of array if all options are Some, otherwise returns None.\n\n## Examples\n\n```rescript\nOption.all([Some(1), Some(2), Some(3)]) // Some([1, 2, 3])\nOption.all([Some(1), None]) // None\n```" - ], - "signature": "let all: array> => option>" - }, - { - "id": "Stdlib.Option.all2", - "kind": "value", - "name": "all2", - "docstrings": [ - "`all2((o1, o2))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all2: ((option<'a>, option<'b>)) => option<('a, 'b)>" - }, - { - "id": "Stdlib.Option.all3", - "kind": "value", - "name": "all3", - "docstrings": [ - "`all3((o1, o2, o3))`. Like `all()`, but with a fixed size tuple of 3" - ], - "signature": "let all3: (\n (option<'a>, option<'b>, option<'c>),\n) => option<('a, 'b, 'c)>" - }, - { - "id": "Stdlib.Option.all4", - "kind": "value", - "name": "all4", - "docstrings": [ - "`all4((o1, o2, o3, o4))`. Like `all()`, but with a fixed size tuple of 4" - ], - "signature": "let all4: (\n (option<'a>, option<'b>, option<'c>, option<'d>),\n) => option<('a, 'b, 'c, 'd)>" - }, - { - "id": "Stdlib.Option.all5", - "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((o1, o2, o3, o4, o5))`. Like `all()`, but with a fixed size tuple of 5" - ], - "signature": "let all5: (\n (\n option<'a>,\n option<'b>,\n option<'c>,\n option<'d>,\n option<'e>,\n ),\n) => option<('a, 'b, 'c, 'd, 'e)>" - }, - { - "id": "Stdlib.Option.all6", - "kind": "value", - "name": "all6", - "docstrings": [ - "`all6((o1, o2, o3, o4, o5, o6))`. Like `all()`, but with a fixed size tuple of 6" - ], - "signature": "let all6: (\n (\n option<'a>,\n option<'b>,\n option<'c>,\n option<'d>,\n option<'e>,\n option<'f>,\n ),\n) => option<('a, 'b, 'c, 'd, 'e, 'f)>" - }, - { - "id": "Stdlib.Option.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(option)` ignores the provided option and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: option<'a> => unit" - } - ] - }, - "stdlib/object": { - "id": "Stdlib.Object", - "name": "Object", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Object.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make` create a new object that inherits the properties and methods from the standard built-in Object, such as `toString`. See [Object on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)\n\n## Examples\n\n```rescript\nlet x = Object.make()\nx->Object.keysToArray->Array.length // 0\nx->Object.get(\"toString\")->Option.isSome // true\n```" - ], - "signature": "let make: unit => {..}" - }, - { - "id": "Stdlib.Object.is", - "kind": "value", - "name": "is", - "docstrings": [ - "`is` determines if two objects are identical in all contexts. Objects, arrays, records, and other non-primitives are only identical if they reference the **exact** same object in memory. Primitives like ints, floats, and strings are identical if they have the same value. `+0` and `-0` are distinct. NaN is equal to itself. See [Object.is on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)\n\nIn most scenarios use `==` or `===` or the custom `equals` function (if provided) for the type.\n\n## Examples\n\n```rescript\nObject.is(25, 13) // false\nObject.is(\"abc\", \"abc\") // true\nObject.is(undefined, undefined) // true\nObject.is(undefined, null) // false\nObject.is(-0.0, 0.0) // false\nObject.is(list{1, 2}, list{1, 2}) // false\n\nObject.is([1, 2, 3], [1, 2, 3]) // false\n[1, 2, 3] == [1, 2, 3] // true\n[1, 2, 3] === [1, 2, 3] // false\n\nlet fruit = {\"name\": \"Apple\"}\nObject.is(fruit, fruit) // true\nObject.is(fruit, {\"name\": \"Apple\"}) // false\nfruit == {\"name\": \"Apple\"} // true\nfruit === {\"name\": \"Apple\"} // false\n```" - ], - "signature": "let is: ('a, 'a) => bool" - }, - { - "id": "Stdlib.Object.create", - "kind": "value", - "name": "create", - "docstrings": [ - "`create` creates a new object, using an existing object as the prototype of the new object. See [Object.create on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\n\n**Note:** ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object) and [records](https://rescript-lang.org/docs/manual/latest/record). This is often safer and more convenient than using `create` and other functions in this module.\n\n## Examples\n\n```rescript\nlet x = {\"fruit\": \"banana\"}\nlet y = Object.create(x)\ny->Object.get(\"fruit\") // Some(\"banana\")\n```" - ], - "signature": "let create: {..} => {..}" - }, - { - "id": "Stdlib.Object.createWithProperties", - "kind": "value", - "name": "createWithProperties", - "docstrings": [ - "`createWithProperties(proto, descriptors)` creates a new object that delegates to `proto` and defines additional properties using descriptor objects.\n\nSee [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) on MDN.\n\n## Examples\n\n```rescript\nlet proto = {\"kind\": \"fruit\"}\nlet obj = Object.createWithProperties(proto, {\"name\": {\"value\": \"banana\"}})\nobj->Object.get(\"name\") == Some(\"banana\")\nobj->Object.get(\"kind\") == Some(\"fruit\")\n```" - ], - "signature": "let createWithProperties: ({..}, {..}) => {..}" - }, - { - "id": "Stdlib.Object.createWithNull", - "kind": "value", - "name": "createWithNull", - "docstrings": [ - "`createWithNull()` creates an object with a `null` prototype (no inherited properties).\n\nSee [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) on MDN.\n\n## Examples\n\n```rescript\nlet obj = Object.createWithNull()\nobj->Object.get(\"toString\") == None\n```" - ], - "signature": "let createWithNull: unit => {..}" - }, - { - "id": "Stdlib.Object.createWithNullAndProperties", - "kind": "value", - "name": "createWithNullAndProperties", - "docstrings": [ - "`createWithNullAndProperties(descriptors)` creates an object with a `null` prototype and defines properties using descriptor objects.\n\nSee [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) on MDN.\n\n## Examples\n\n```rescript\nlet obj = Object.createWithNullAndProperties({\"name\": {\"value\": \"banana\"}})\nobj->Object.get(\"name\") == Some(\"banana\")\nobj->Object.get(\"toString\") == None\n```" - ], - "signature": "let createWithNullAndProperties: {..} => {..}" - }, - { - "id": "Stdlib.Object.assign", - "kind": "value", - "name": "assign", - "docstrings": [ - "`assign(target, source)` copies enumerable own properties from the source to the target, overwriting properties with the same name. It returns the modified target object. A deep clone is not created; properties are copied by reference.\n\n**Warning:** ReScript provides compile-time support for type-safe access to JavaScript objects. This eliminates common errors such as accessing properties that do not exist, or using a property of type x as if it were a y. Using `assign` can bypass these safety checks and lead to run-time errors (if you are not careful). ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object) and [records](https://rescript-lang.org/docs/manual/latest/record). This is often safer and more convenient than using `assign` and other functions in this module.\n\nSee [Object.assign on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) or [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign).\n\n## Examples\n\n```rescript\nObject.assign({\"a\": 1}, {\"a\": 2}) // {\"a\": 2}\nObject.assign({\"a\": 1, \"b\": 2}, {\"a\": 0}) // {\"a\": 0, \"b\": 2}\nObject.assign({\"a\": 1}, {\"a\": null}) // {\"a\": null}\n```" - ], - "signature": "let assign: ({..}, {..}) => {..}" - }, - { - "id": "Stdlib.Object.assignMany", - "kind": "value", - "name": "assignMany", - "docstrings": [ - "`assignMany(target, sources)` copies enumerable own properties from each source to the target, overwriting properties with the same name. Later sources' properties overwrite earlier ones. It returns the modified target object. A deep clone is not created; properties are copied by reference.\n\n**Note:** ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object), including spreading one object into another. This is often more convenient than using `assign` or `assignMany`. \n\nSee [Object.assign on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) or [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign)." - ], - "signature": "let assignMany: ({..}, array<{..}>) => {..}" - }, - { - "id": "Stdlib.Object.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(object)` creates a shallow copy of `object`.\n\nSee [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) on MDN.\n\n## Examples\n\n```rescript\nlet original = {\"name\": \"banana\"}\nlet cloned = Object.copy(original)\ncloned->Object.get(\"name\") == Some(\"banana\")\nObject.is(original, cloned) == false\n```" - ], - "signature": "let copy: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get` gets the value of a property by name. Returns `None` if the property does not exist or has the value `undefined`. Otherwise returns `Some`, including if the value is `null`.\n\n## Examples\n\n```rescript\n{\"a\": 1}->Object.get(\"a\") // Some(1)\n{\"a\": 1}->Object.get(\"b\") // None\n{\"a\": undefined}->Object.get(\"a\") // None\n{\"a\": null}->Object.get(\"a\") // Some(null)\n{\"a\": 1}->Object.get(\"toString\")->Option.isSome // true\n```" - ], - "signature": "let get: ({..}, string) => option<'a>" - }, - { - "id": "Stdlib.Object.getSymbol", - "kind": "value", - "name": "getSymbol", - "docstrings": [ - "`getSymbol` gets the value of a property by symbol. Returns `None` if the property does not exist or has the value `undefined`. Otherwise returns `Some`, including if the value is `null`.\n\n## Examples\n\n```rescript\nlet fruit = Symbol.make(\"fruit\")\nlet x = Object.make()\nx->Object.setSymbol(fruit, \"banana\")\nx->Object.getSymbol(fruit) == Some(\"banana\")\n```" - ], - "signature": "let getSymbol: ({..}, Symbol.t) => option<'a>" - }, - { - "id": "Stdlib.Object.getSymbolUnsafe", - "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [ - "`getSymbolUnsafe(object, key)` reads the value stored under the symbol `key` without any optional check.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet obj = Object.make()\nobj->Object.setSymbol(key, \"hello\")\nObject.getSymbolUnsafe(obj, key) == \"hello\"\n```" - ], - "signature": "let getSymbolUnsafe: ({..}, Symbol.t) => 'a" - }, - { - "id": "Stdlib.Object.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(name, value)` assigns a value to the named object property, overwriting the previous value if any. See [Working with Objects on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#objects_and_properties)\n\n## Examples\n\n```rescript\n{\"a\": 1}->Object.set(\"a\", 2) // {\"a\": 2}\n{\"a\": 1}->Object.set(\"a\", None) // {\"a\": None}\n{\"a\": 1}->Object.set(\"b\", 2) // {\"a\": 1, \"b\": 2}\n```" - ], - "signature": "let set: ({..}, string, 'a) => unit" - }, - { - "id": "Stdlib.Object.setSymbol", - "kind": "value", - "name": "setSymbol", - "docstrings": [ - "`setSymbol(object, key, value)` stores `value` under the symbol `key` on `object`.\n\nBeware this will *mutate* the object.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"count\")\nlet obj = Object.make()\nobj->Object.setSymbol(key, 5)\nObject.getSymbol(obj, key) == Some(5)\n```" - ], - "signature": "let setSymbol: ({..}, Symbol.t, 'a) => unit" - }, - { - "id": "Stdlib.Object.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "`keysToArray` returns an array of an object's own enumerable string-keyed property names. See [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.keys)\nor [Object.keys on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys).\n\n## Examples\n\n```rescript\n{\"a\": 1, \"b\": 2}->Object.keysToArray // [\"a\", \"b\"]\n{\"a\": None}->Object.keysToArray // [\"a\"]\nObject.make()->Object.keysToArray // []\n```" - ], - "signature": "let keysToArray: {..} => array" - }, - { - "id": "Stdlib.Object.hasOwnProperty", - "kind": "value", - "name": "hasOwnProperty", - "docstrings": [ - "`hasOwnProperty` determines whether the object has the specified property as its **own** property, as opposed to inheriting it. See [hasOwnProperty on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 2}\n{\"a\": 1}->Object.hasOwnProperty(\"a\") // true\n{\"a\": 1}->Object.hasOwnProperty(\"b\") // false\n{\"a\": 1}->Object.hasOwnProperty(\"toString\") // false\n```" - ], - "signature": "let hasOwnProperty: ({..}, string) => bool" - }, - { - "id": "Stdlib.Object.seal", - "kind": "value", - "name": "seal", - "docstrings": [ - "`seal` seals an object. Sealing an object prevents extensions and makes existing properties non-configurable. A sealed object has a fixed set of properties. Unlike `freeze`, values of existing properties can still be changed as long as they are writable.\n\n**Note:** `seal` returns the same object that was passed in; it does not create a copy. Any attempt to delete or add properties to a sealed object will fail, either silently or by throwing an error.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.seal) and [Object.seal on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 2}\npoint->Object.set(\"x\", -7) // succeeds\npoint->Object.seal->ignore\n\ntry {\n point->Object.set(\"z\", 9) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n\npoint->Object.set(\"x\", 13) // succeeds\n```" - ], - "signature": "let seal: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.preventExtensions", - "kind": "value", - "name": "preventExtensions", - "docstrings": [ - "`preventExtensions` prevents new properties from being added to the object. It modifies the object (rather than creating a copy) and returns it.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.preventextensions) and [Object.preventExtensions on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/preventExtensions)\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.set(\"b\", 2) // succeeds\nobj->Object.preventExtensions->ignore\ntry {\n obj->Object.set(\"c\", 3) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let preventExtensions: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.freeze", - "kind": "value", - "name": "freeze", - "docstrings": [ - "`freeze` freezes an object. Freezing an object makes existing properties non-writable and prevents extensions. Once an object is frozen, new properties cannot be be added, existing properties cannot be removed, and their values cannot be changed.\n\n**Note:** `freeze` returns the same object that was passed in; it does not create a frozen copy. Any attempt to change a frozen object will fail, either silently or by throwing an exception.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isfrozen) and [Object.isFrozen on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen).\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.set(\"a\", 2) // succeeds\nobj->Object.freeze->ignore\n\ntry {\n obj->Object.set(\"a\", 3) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let freeze: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.isSealed", - "kind": "value", - "name": "isSealed", - "docstrings": [ - "`isSealed` determines if an object is sealed. A sealed object has a fixed set of properties.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.issealed) and [Object.isSealed on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 3}->Object.seal\nlet pointIsSealed = point->Object.isSealed // true\nlet fruit = {\"name\": \"Apple\"}\nlet fruitIsSealed = fruit->Object.isSealed // false\n```" - ], - "signature": "let isSealed: 'a => bool" - }, - { - "id": "Stdlib.Object.isFrozen", - "kind": "value", - "name": "isFrozen", - "docstrings": [ - "`isFrozen` determines if an object is frozen. An object is frozen if an only if it is not extensible, all its properties are non-configurable, and all its data properties are non-writable.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isfrozen) and [Object.isFrozen on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen).\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 3}->Object.freeze\nlet pointIsFrozen = point->Object.isFrozen // true\nlet fruit = {\"name\": \"Apple\"}\nlet fruitIsFrozen = fruit->Object.isFrozen // false\n```" - ], - "signature": "let isFrozen: 'a => bool" - }, - { - "id": "Stdlib.Object.isExtensible", - "kind": "value", - "name": "isExtensible", - "docstrings": [ - "`isExtensible` determines if an object is extensible (whether it can have new properties added to it).\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isextensible) and [Object.isExtensible on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible)\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.isExtensible // true\nobj->Object.preventExtensions->ignore\nobj->Object.isExtensible // false\n```" - ], - "signature": "let isExtensible: 'a => bool" - }, - { - "id": "Stdlib.Object.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(object)` ignores the provided object and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: {..} => unit" - } - ] - }, - "stdlib/nullable": { - "id": "Stdlib.Nullable", - "name": "Nullable", - "docstrings": [ - "Functions for handling nullable values.\n\nPrimarily useful when interoping with JavaScript when you don't know whether you'll get a value, `null` or `undefined`." - ], - "items": [ - { - "id": "Stdlib.Nullable.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a nullable value.\nA nullable value can be the value `'a`, `null` or `undefined`." - ], - "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined" - }, - { - "id": "Stdlib.Nullable.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The value `null`.\n\nSee [`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null) on MDN.\n\n## Examples\n```rescript\nConsole.log(Nullable.null) // Logs `null` to the console.\n```" - ], - "signature": "let null: t<'a>" - }, - { - "id": "Stdlib.Nullable.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The value `undefined`.\n\nSee [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/undefined) on MDN.\n\n## Examples\n```rescript\nConsole.log(undefined) // Logs `undefined` to the console.\n```" - ], - "signature": "let undefined: t<'a>" - }, - { - "id": "Stdlib.Nullable.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [ - "`isNullable(a)` returns `true` if `a` is null or undefined, `false` otherwise.\n\n## Examples\n\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Check if asNullable is not null or undefined\nswitch asNullable->Nullable.isNullable {\n| true => assert(false)\n| false => assert(true)\n}\n```" - ], - "signature": "let isNullable: t<'a> => bool" - }, - { - "id": "Stdlib.Nullable.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new nullable value from the provided value.\nThis means the compiler will enforce null checks for the new value.\n\n## Examples\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Need to do this\nswitch asNullable->Nullable.toOption {\n| Some(value) if value == myStr => Console.log(\"Yay, values matched!\")\n| _ => Console.log(\"Values did not match.\")\n}\n```" - ], - "signature": "let make: 'a => t<'a>" - }, - { - "id": "Stdlib.Nullable.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.Nullable.compare", - "kind": "value", - "name": "compare", - "docstrings": [], - "signature": "let compare: (t<'a>, t<'b>, ('a, 'b) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.Nullable.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Converts a nullable value into an option, so it can be pattern matched on.\nWill convert both `null` and `undefined` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullableString = Nullable.make(\"Hello\")\n\nswitch nullableString->Nullable.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```" - ], - "signature": "let toOption: t<'a> => option<'a>" - }, - { - "id": "Stdlib.Nullable.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Turns an `option` into a `Nullable.t`.\n`None` compiles to `undefined` and after running `Nullable.fromOption` on it, it will continue to be `undefined`.\n\n## Examples\n```rescript\nlet optString = Some(\"Hello\")\nlet asNullable = optString->Nullable.fromOption // Nullable.t\n```" - ], - "signature": "let fromOption: option<'a> => t<'a>" - }, - { - "id": "Stdlib.Nullable.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(value, default)` returns `value` if not `null` or `undefined`,\notherwise return `default`.\n\n## Examples\n\n```rescript\nNullable.getOr(Nullable.null, \"Banana\") // Banana\nNullable.getOr(Nullable.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNullable.make(\"Jane\")->Nullable.toOption->greet // \"Greetings Jane\"\nNullable.null->Nullable.toOption->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (t<'a>, 'a) => 'a" - }, - { - "id": "Stdlib.Nullable.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Nullable.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getExn(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getExn(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`" - ], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Nullable.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getOrThrow(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getOrThrow(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`" - ], - "signature": "let getOrThrow: t<'a> => 'a" - }, - { - "id": "Stdlib.Nullable.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNullable.getUnsafe(Nullable.make(3)) == 3\nNullable.getUnsafe(Nullable.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null` or `undefined`." - ], - "signature": "let getUnsafe: t<'a> => 'a" - }, - { - "id": "Stdlib.Nullable.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(value, f)` call `f` on `value`. if `value` is not `null` or `undefined`,\nthen if calls `f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNullable.forEach(Nullable.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNullable.forEach(Nullable.null, x => Console.log(x)) // returns ()\nNullable.forEach(undefined, x => Console.log(x)) // returns ()\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Nullable.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nNullable.map(Nullable.make(3), x => x * x) // Nullable.make(9)\nNullable.map(undefined, x => x * x) // undefined\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Nullable.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`\nor `undefined`, otherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Nullable.make(3)\nsomeValue->Nullable.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Nullable.null\nnoneValue->Nullable.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (t<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Nullable.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (t<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Nullable.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Nullable.make(value + 1)\n } else {\n Nullable.null\n }\n\nNullable.flatMap(Nullable.make(2), addIfAboveOne) // Nullable.make(3)\nNullable.flatMap(Nullable.make(-4), addIfAboveOne) // undefined\nNullable.flatMap(Nullable.null, addIfAboveOne) // undefined\n```" - ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Nullable.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(nullable)` ignores the provided nullable and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/null": { - "id": "Stdlib.Null", - "name": "Null", - "docstrings": [ - "Functions for handling values that could be `null`.\n\nIf you also need to cover `undefined`, check out `Nullable` instead." - ], - "items": [ - { - "id": "Stdlib.Null.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a value that can be either `'a` or `null`." - ], - "signature": "@unboxed\ntype t<'a> = null<'a> =\n | Value('a)\n | @as(null) Null" - }, - { - "id": "Stdlib.Null.asNullable", - "kind": "value", - "name": "asNullable", - "docstrings": [ - "Converts a `Null.t` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet nullValue = Null.make(\"Hello\")\nlet asNullable = nullValue->Null.asNullable // Nullable.t\n```" - ], - "signature": "let asNullable: t<'a> => Nullable.t<'a>" - }, - { - "id": "Stdlib.Null.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The value `null`.\n\nSee [`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null) on MDN.\n\n## Examples\n```rescript\nConsole.log(null) // Logs `null` to the console.\n```" - ], - "signature": "let null: t<'a>" - }, - { - "id": "Stdlib.Null.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Null.t` from the provided value.\nThis means the compiler will enforce null checks for the new value.\n\n## Examples\n```rescript\nlet myStr = \"Hello\"\nlet asNullValue = myStr->Null.make // The compiler now thinks this can be `string` or `null`.\n```" - ], - "signature": "let make: 'a => t<'a>" - }, - { - "id": "Stdlib.Null.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(a, b, eq)` checks if `a` and `b` are equal.\nIf both are `Null.Value`, it will use function `eq` to check if the values are equal.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\nNull.equal(a, b, Int.equal) == false\nNull.equal(a, c, Int.equal) == false\nNull.equal(Null.null, Null.null, Int.equal) == true\n```" - ], - "signature": "let equal: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.Null.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(a, b, cmp)` compares `a` and `b`.\nIf both are `Null.Value`, it will use function `cmp` to compare the values.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\n// A value is greater than null\nNull.compare(a, b, Int.compare) == Ordering.greater\n// A value is less than null\nNull.compare(b, a, Int.compare) == Ordering.less\n// A null is equal to null\nNull.compare(Null.null, Null.null, Int.compare) == Ordering.equal\n// The compare function is used if both are `Null.Value`\nNull.compare(a, c, Int.compare) == Ordering.less\n```" - ], - "signature": "let compare: (t<'a>, t<'b>, ('a, 'b) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.Null.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Converts a nullable value into an option, so it can be pattern matched on.\nWill convert `null` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullStr = Null.make(\"Hello\")\n\nswitch nullStr->Null.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```" - ], - "signature": "let toOption: t<'a> => option<'a>" - }, - { - "id": "Stdlib.Null.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Turns an `option` into a `Null.t`. `None` will be converted to `null`.\n`None` compiles to `undefined`, but after calling `Null.fromOption`, the result will be `null` instead of `undefined`.\n\n## Examples\n```rescript\nlet optString: option = None\nlet asNull = optString->Null.fromOption // Null.t, will compile to 'null'\nConsole.log(asNull == Null.null) // Logs `true` to the console.\n```" - ], - "signature": "let fromOption: option<'a> => t<'a>" - }, - { - "id": "Stdlib.Null.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(value, default)` returns `value` if not `null`, otherwise return\n`default`.\n\n## Examples\n\n```rescript\nNull.getOr(Null.null, \"Banana\") // Banana\nNull.getOr(Null.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNull.make(\"Jane\")->Null.toOption->greet // \"Greetings Jane\"\nNull.null->Null.toOption->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (t<'a>, 'a) => 'a" - }, - { - "id": "Stdlib.Null.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Null.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getExn(Null.make(3)) == 3\n\nswitch Null.getExn(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`" - ], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Null.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getOrThrow(Null.make(3)) == 3\n\nswitch Null.getOrThrow(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`" - ], - "signature": "let getOrThrow: t<'a> => 'a" - }, - { - "id": "Stdlib.Null.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNull.getUnsafe(Null.make(3)) == 3\nNull.getUnsafe(Null.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null`." - ], - "signature": "let getUnsafe: t<'a> => 'a" - }, - { - "id": "Stdlib.Null.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(value, f)` call `f` on `value`. if `value` is not `null`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNull.forEach(Null.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNull.forEach(Null.null, x => Console.log(x)) // logs nothing\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Null.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(value, f)` returns `f(value)` if `value` is not `null`, otherwise returns\n`value` unchanged.\n\n## Examples\n\n```rescript\nNull.map(Null.make(3), x => x * x) // Null.make(9)\nNull.map(Null.null, x => x * x) // null\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Null.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`,\notherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Null.make(3)\nsomeValue->Null.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Null.null\nnoneValue->Null.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (t<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Null.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (t<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Null.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(value, f)` returns `f(value)` if `value` is not `null`, otherwise\nreturns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Null.make(value + 1)\n } else {\n Null.null\n }\n\nNull.flatMap(Null.make(2), addIfAboveOne) // Null.make(3)\nNull.flatMap(Null.make(-4), addIfAboveOne) // null\nNull.flatMap(Null.null, addIfAboveOne) // null\n```" - ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Null.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(null)` ignores the provided null and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/math": { - "id": "Stdlib.Math", - "name": "Math", - "docstrings": [ - "Functions for interacting with JavaScript Math.\nSee: [`Math`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math)." - ], - "items": [ - { - "id": "Stdlib.Math.abs", - "kind": "value", - "name": "abs", - "docstrings": [ - "`abs(v)` returns absolute value of `v`.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n## Examples\n\n```rescript\nMath.abs(-2.0) == 2.0\nMath.abs(3.0) == 3.0\n```" - ], - "signature": "let abs: float => float" - }, - { - "id": "Stdlib.Math.acos", - "kind": "value", - "name": "acos", - "docstrings": [ - "`acos(v)` returns arccosine (in radians) of argument `v`, returns `NaN` if the\nargument is outside the range \\[-1.0, 1.0\\].\nSee [`Math.acos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acos) on MDN.\n\n## Examples\n\n```rescript\nMath.acos(-1.0) == 3.141592653589793\nMath.acos(-3.0)->Float.isNaN == true\n```" - ], - "signature": "let acos: float => float" - }, - { - "id": "Stdlib.Math.acosh", - "kind": "value", - "name": "acosh", - "docstrings": [ - "`acosh(v)` returns the inverse hyperbolic arccosine (in radians) of argument `v`,\nreturns `NaN` if the argument is less than `1.0`.\nSee [`Math.acosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acosh) on MDN.\n\n## Examples\n\n```rescript\nMath.acosh(1.0) == 0.0\nMath.acosh(0.5)->Float.isNaN == true\n```" - ], - "signature": "let acosh: float => float" - }, - { - "id": "Stdlib.Math.asin", - "kind": "value", - "name": "asin", - "docstrings": [ - "`asin(v)` returns the inverse sine (in radians) of argument `v`, returns `NaN`\nif the argument `v` is outside the range \\[-1.0, 1.0\\].\nSee [`Math.asin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asin) on MDN.\n\n## Examples\n\n```rescript\nMath.asin(-1.0) == -1.5707963267948966\nMath.asin(-2.0)->Float.isNaN == true\n```" - ], - "signature": "let asin: float => float" - }, - { - "id": "Stdlib.Math.asinh", - "kind": "value", - "name": "asinh", - "docstrings": [ - "`asinh(v)` returns the inverse hyperbolic sine of argument `v`.\nSee [`Math.asinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh) on MDN.\n\n## Examples\n\n```rescript\nMath.asinh(-1.0) == -0.881373587019543\nMath.asinh(-0.0) == -0.0\n```" - ], - "signature": "let asinh: float => float" - }, - { - "id": "Stdlib.Math.atan", - "kind": "value", - "name": "atan", - "docstrings": [ - "`atan(v)` returns the inverse tangent (in radians) of argument `v`.\nSee [`Math.atan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan) on MDN.\n\n## Examples\n\n```rescript\nMath.atan(-0.0) == -0.0\nMath.atan(0.0) == 0.0\nMath.atan(1.0) == 0.7853981633974483\n```" - ], - "signature": "let atan: float => float" - }, - { - "id": "Stdlib.Math.atanh", - "kind": "value", - "name": "atanh", - "docstrings": [ - "`atanh(v)` returns the invert hyperbolic tangent of argument `v`. Returns `NaN`\nif the argument `v` is is outside the range \\[-1.0, 1.0\\] and `Infinity` if `v`\nis `-1.0` or `1.0`.\nSee [`Math.atanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh) on MDN.\n\n## Examples\n\n```rescript\nMath.atanh(-2.0)->Float.isNaN == true\nMath.atanh(-1.0)->Float.isFinite == false\nMath.atanh(-0.0) == -0.0\nMath.atanh(0.0) == 0.0\nMath.atanh(0.5) == 0.5493061443340548\n```" - ], - "signature": "let atanh: float => float" - }, - { - "id": "Stdlib.Math.atan2", - "kind": "value", - "name": "atan2", - "docstrings": [ - "`atan2(~y, ~x)` returns the angle (in radians) of the quotient `y /. x`. It is\nalso the angle between the *x*\\-axis and point (*x*, *y*).\nSee [`Math.atan2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2) on MDN.\n\n## Examples\n\n```rescript\nMath.atan2(~y=0.0, ~x=10.0) == 0.0\nMath.atan2(~x=5.0, ~y=5.0) == Math.Constants.pi /. 4.0\nMath.atan2(~x=90.0, ~y=15.0) == 0.16514867741462683\nMath.atan2(~x=15.0, ~y=90.0) == 1.4056476493802699\n```" - ], - "signature": "let atan2: (~y: float, ~x: float) => float" - }, - { - "id": "Stdlib.Math.cbrt", - "kind": "value", - "name": "cbrt", - "docstrings": [ - "`cbrt(v)` returns the cube root of argument `v`.\nSee [`Math.cbrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt) on MDN.\n\n## Examples\n\n```rescript\nMath.cbrt(-1.0) == -1.0\nMath.cbrt(-0.0) == -0.0\nMath.cbrt(0.0) == 0.0\n```" - ], - "signature": "let cbrt: float => float" - }, - { - "id": "Stdlib.Math.ceil", - "kind": "value", - "name": "ceil", - "docstrings": [ - "`ceil(v)` returns the smallest integral value greater than or equal to the\nargument `v`. The result is a `float` and is not restricted to the `int` data\ntype range.\nSee [`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil) on MDN.\n\n## Examples\n\n```rescript\nMath.ceil(3.1) == 4.0\nMath.ceil(3.0) == 3.0\nMath.ceil(-3.1) == -3.0\nMath.ceil(2_150_000_000.3) == 2_150_000_001.0\n```" - ], - "signature": "let ceil: float => float" - }, - { - "id": "Stdlib.Math.cos", - "kind": "value", - "name": "cos", - "docstrings": [ - "`cos(v)` returns the cosine of argument `v`, which must be specified in radians.\nSee [`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos) on MDN.\n\n## Examples\n\n```rescript\nMath.cos(-0.0) == 1.0\nMath.cos(0.0) == 1.0\nMath.cos(1.0) == 0.5403023058681398\n```" - ], - "signature": "let cos: float => float" - }, - { - "id": "Stdlib.Math.cosh", - "kind": "value", - "name": "cosh", - "docstrings": [ - "`cosh(v)` returns the hyperbolic cosine of argument `v`, which must be specified\nin radians.\nSee [`Math.cosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh) on MDN.\n\n## Examples\n\n```rescript\nMath.cosh(-1.0) == 1.5430806348152437\nMath.cosh(-0.0) == 1.0\nMath.cosh(0.0) == 1.0\n```" - ], - "signature": "let cosh: float => float" - }, - { - "id": "Stdlib.Math.exp", - "kind": "value", - "name": "exp", - "docstrings": [ - "`exp(v)` returns natural exponentional, returns *e* (the base of natural logarithms)\nto the power of the given argument `v`.\nSee [`Math.exp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/exp) on MDN.\n\n## Examples\n\n```rescript\nMath.exp(-1.0) == 0.36787944117144233\nMath.exp(0.0) == 1.0\n```" - ], - "signature": "let exp: float => float" - }, - { - "id": "Stdlib.Math.expm1", - "kind": "value", - "name": "expm1", - "docstrings": [ - "`expm1(v)` returns *e* (the base of natural logarithms) to the power of the given\nargument `v` minus 1.\nSee [`Math.expm1`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1) on MDN.\n\n## Examples\n\n```rescript\nMath.expm1(-1.0) == -0.6321205588285577\nMath.expm1(-0.0) == -0.0\n```" - ], - "signature": "let expm1: float => float" - }, - { - "id": "Stdlib.Math.floor", - "kind": "value", - "name": "floor", - "docstrings": [ - "`floor(v)` returns the largest integral value less than or equal to the argument\n`v`. The result is a `float` and is not restricted to the `int` data type range.\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor) on MDN.\n\n## Examples\n\n```rescript\nMath.floor(-45.95) == -46.0\nMath.floor(-45.05) == -46.0\nMath.floor(-0.0) == -0.0\n```" - ], - "signature": "let floor: float => float" - }, - { - "id": "Stdlib.Math.fround", - "kind": "value", - "name": "fround", - "docstrings": [ - "`fround(v)` returns the nearest single precision float.\nSee [`Math.fround`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround) on MDN.\n\n## Examples\n\n```rescript\nMath.fround(5.5) == 5.5\nMath.fround(5.05) == 5.050000190734863\n```" - ], - "signature": "let fround: float => float" - }, - { - "id": "Stdlib.Math.hypot", - "kind": "value", - "name": "hypot", - "docstrings": [ - "`hypot(a, b)` returns the square root of the sum of squares of its two arguments\n(the Pythagorean formula).\nSee [`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot) on MDN.\n\n## Examples\n\n```rescript\nMath.hypot(3.0, 4.0) == 5.0\nMath.hypot(3.0, 5.0) == 5.8309518948453\n```" - ], - "signature": "let hypot: (float, float) => float" - }, - { - "id": "Stdlib.Math.hypotMany", - "kind": "value", - "name": "hypotMany", - "docstrings": [ - "`hypotMany(arr)` returns the square root of the sum of squares of the numbers in\nthe array argument (generalized Pythagorean equation). Using an array allows you\nto have more than two items. If `arr` is an empty array then returns `0.0`.\nSee [`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot) on MDN.\n\n## Examples\n\n```rescript\nMath.hypotMany([3.0, 4.0, 5.0]) == 7.0710678118654755\nMath.hypotMany([]) == 0.0\n```" - ], - "signature": "let hypotMany: array => float" - }, - { - "id": "Stdlib.Math.log", - "kind": "value", - "name": "log", - "docstrings": [ - "`log(v)` returns the natural logarithm of argument `v`, this is the number *x*\nsuch that `e^x` equals the argument. Returns `NaN` for negative arguments and\n`Infinity` for `0.0` or `-0.0`.\nSee [`Math.log`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log) on MDN.\n\n## Examples\n\n```rescript\nMath.log(-1.0)->Float.isNaN == true\nMath.log(-0.0)->Float.isFinite == false\nMath.log(0.0)->Float.isFinite == false\nMath.log(1.0) == 0.0\n```" - ], - "signature": "let log: float => float" - }, - { - "id": "Stdlib.Math.log1p", - "kind": "value", - "name": "log1p", - "docstrings": [ - "`log1p(v)` returns the natural logarithm of one plus the argument `v`.\nReturns `NaN` for arguments less than `-1` and `Infinity` if `v` is `-1.0`.\nSee [`Math.log1p`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log1p) on MDN.\n\n## Examples\n\n```rescript\nMath.log1p(-2.0)->Float.isNaN == true\nMath.log1p(-1.0)->Float.isFinite == false\nMath.log1p(-0.0) == -0.0\n```" - ], - "signature": "let log1p: float => float" - }, - { - "id": "Stdlib.Math.log10", - "kind": "value", - "name": "log10", - "docstrings": [ - "`log10(v)` returns the base 10 logarithm of argument `v`. Returns `NaN` for\nnegative `v`. If `v` is `-0.0` or `0.0` returns `Infinity`.\nSee [`Math.log10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log10) on MDN.\n\n## Examples\n\n```rescript\nMath.log10(-2.0)->Float.isNaN == true\nMath.log10(-0.0)->Float.isFinite == false\nMath.log10(0.0)->Float.isFinite == false\nMath.log10(1.0) == 0.0\n```" - ], - "signature": "let log10: float => float" - }, - { - "id": "Stdlib.Math.log2", - "kind": "value", - "name": "log2", - "docstrings": [ - "`log2(v)` returns the base 2 logarithm of argument `v`. Returns `NaN` for\nnegative `v` and `Infinity` if `v` is `-0.0` or `0.0`.\nSee [`Math.log2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2) on MDN.\n\n## Examples\n\n```rescript\nMath.log2(-2.0)->Float.isNaN == true\nMath.log2(-0.0)->Float.isFinite == false\nMath.log2(0.0)->Float.isFinite == false\nMath.log2(1.0) == 0.0\n```" - ], - "signature": "let log2: float => float" - }, - { - "id": "Stdlib.Math.min", - "kind": "value", - "name": "min", - "docstrings": [ - "`min(a, b)` returns the minimum of its two float arguments.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n## Examples\n\n```rescript\nMath.min(1.0, 2.0) == 1.0\nMath.min(-1.0, -2.0) == -2.0\n```" - ], - "signature": "let min: (float, float) => float" - }, - { - "id": "Stdlib.Math.minMany", - "kind": "value", - "name": "minMany", - "docstrings": [ - "`minMany(arr)` returns the minimum of the float in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n## Examples\n\n```rescript\nMath.minMany([1.0, 2.0]) == 1.0\nMath.minMany([-1.0, -2.0]) == -2.0\nMath.minMany([])->Float.isFinite == false\n```" - ], - "signature": "let minMany: array => float" - }, - { - "id": "Stdlib.Math.max", - "kind": "value", - "name": "max", - "docstrings": [ - "`max(a, b)` returns the maximum of its two float arguments.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n## Examples\n\n```rescript\nMath.max(1.0, 2.0) == 2.0\nMath.max(-1.0, -2.0) == -1.0\n```" - ], - "signature": "let max: (float, float) => float" - }, - { - "id": "Stdlib.Math.maxMany", - "kind": "value", - "name": "maxMany", - "docstrings": [ - "`maxMany(arr)` returns the maximum of the float in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n## Examples\n\n```rescript\nMath.maxMany([1.0, 2.0]) == 2.0\nMath.maxMany([-1.0, -2.0]) == -1.0\nMath.maxMany([])->Float.isFinite == false\n```" - ], - "signature": "let maxMany: array => float" - }, - { - "id": "Stdlib.Math.pow", - "kind": "value", - "name": "pow", - "docstrings": [ - "`pow(a, ~exp)` throws the given base `a` to the given exponent `exp`.\nSee [`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow) on MDN.\n\n## Examples\n\n```rescript\nMath.pow(2.0, ~exp=4.0) == 16.0\nMath.pow(3.0, ~exp=4.0) == 81.0\n```" - ], - "signature": "let pow: (float, ~exp: float) => float" - }, - { - "id": "Stdlib.Math.random", - "kind": "value", - "name": "random", - "docstrings": [ - "`random()` returns a random number in the half-closed interval \\[0,1\\].\nSee [`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random) on MDN.\n\n## Examples\n\n```rescript\nMath.random()\n```" - ], - "signature": "let random: unit => float" - }, - { - "id": "Stdlib.Math.round", - "kind": "value", - "name": "round", - "docstrings": [ - "`round(v)` returns then value of `v` rounded to nearest integral value\n(expressed as a float). If the fractional portion of the argument `v` is greater\nthan `0.5`, the argument `v` is rounded to the float with the next higher\nabsolute value.\nSee [`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round) on MDN.\n\n## Examples\n\n```rescript\nMath.round(-20.5) == -20.0\nMath.round(-0.1) == -0.0\nMath.round(0.0) == 0.0\nMath.round(-0.0) == -0.0\n```" - ], - "signature": "let round: float => float" - }, - { - "id": "Stdlib.Math.sign", - "kind": "value", - "name": "sign", - "docstrings": [ - "`sign(v)` returns the sign of its foat argument: `-1` if negative, `0` if\nzero, `1` if positive.\nSee [`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign) on MDN.\n\n## Examples\n\n```rescript\nMath.sign(3.0) == 1.0\nMath.sign(-3.0) == -1.0\nMath.sign(0.0) == 0.0\n```" - ], - "signature": "let sign: float => float" - }, - { - "id": "Stdlib.Math.sin", - "kind": "value", - "name": "sin", - "docstrings": [ - "`sin(v)` returns the sine of argument `v`, which must be specified in radians.\nSee [`Math.sin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin) on MDN.\n\n## Examples\n\n```rescript\nMath.sin(-0.0) == -0.0\nMath.sin(0.0) == 0.0\nMath.sin(1.0) == 0.8414709848078965\n```" - ], - "signature": "let sin: float => float" - }, - { - "id": "Stdlib.Math.sinh", - "kind": "value", - "name": "sinh", - "docstrings": [ - "`sinh(v)` returns then hyperbolic sine of argument `v`, which must be specified\nin radians.\nSee [`Math.sinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sinh) on MDN.\n\n## Examples\n\n```rescript\nMath.sinh(-0.0) == -0.0\nMath.sinh(0.0) == 0.0\nMath.sinh(1.0) == 1.1752011936438014\n```" - ], - "signature": "let sinh: float => float" - }, - { - "id": "Stdlib.Math.sqrt", - "kind": "value", - "name": "sqrt", - "docstrings": [ - "`sqrt(v)` returns the square root of `v`. If `v` is negative returns `NaN`.\nSee [`Math.sqrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt) on MDN.\n\n## Examples\n\n```rescript\nMath.sqrt(-1.0)->Float.isNaN == true\nMath.sqrt(-0.0) == -0.0\nMath.sqrt(0.0) == 0.0\nMath.sqrt(1.0) == 1.0\nMath.sqrt(9.0) == 3.0\n```" - ], - "signature": "let sqrt: float => float" - }, - { - "id": "Stdlib.Math.tan", - "kind": "value", - "name": "tan", - "docstrings": [ - "`tan(v)` returns the tangent of argument `v`, which must be specified in\nradians. Returns `NaN` if `v` is positive `Infinity` or negative `Infinity`.\nSee [`Math.tan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tan) on MDN.\n\n## Examples\n\n```rescript\nMath.tan(-0.0) == -0.0\nMath.tan(0.0) == 0.0\nMath.tan(1.0) == 1.5574077246549023\n```" - ], - "signature": "let tan: float => float" - }, - { - "id": "Stdlib.Math.tanh", - "kind": "value", - "name": "tanh", - "docstrings": [ - "`tanh(v)` returns the hyperbolic tangent of argument `v`, which must be\nspecified in radians.\nSee [`Math.tanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tanh) on MDN.\n\n## Examples\n\n```rescript\nMath.tanh(-0.0) == -0.0\nMath.tanh(0.0) == 0.0\nMath.tanh(1.0) == 0.7615941559557649\n```" - ], - "signature": "let tanh: float => float" - }, - { - "id": "Stdlib.Math.trunc", - "kind": "value", - "name": "trunc", - "docstrings": [ - "`trunc(v)` truncates the argument `v`, i.e., removes fractional digits.\nSee [`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc) on MDN.\n\n## Examples\n\n```rescript\nMath.trunc(0.123) == 0.0\nMath.trunc(1.999) == 1.0\nMath.trunc(13.37) == 13.0\nMath.trunc(42.84) == 42.0\n```" - ], - "signature": "let trunc: float => float" - } - ] - }, - "stdlib/list": { - "id": "Stdlib.List", - "name": "List", - "docstrings": [], - "items": [ - { - "id": "Stdlib.List.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Collection functions for manipulating the `list` data structures, a singly-linked list.\n\n**Prefer Array** if you need any of the following:\n\n- Random access of element\n- Better interop with JavaScript\n- Better memory usage & performance." - ], - "signature": "type t<'a> = list<'a>" - }, - { - "id": "Stdlib.List.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(list)` returns the length of `list`.\n\n## Examples\n\n```rescript\nList.length(list{1, 2, 3}) == 3\n```" - ], - "signature": "let length: list<'a> => int" - }, - { - "id": "Stdlib.List.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(list)`. See [`length`](#length)\n\n## Examples\n\n```rescript\nList.size(list{1, 2, 3}) == 3\n```" - ], - "signature": "let size: list<'a> => int" - }, - { - "id": "Stdlib.List.head", - "kind": "value", - "name": "head", - "docstrings": [ - "`head(list)` returns `Some(value)` where `value` is the first element in the\nlist, or `None` if `list` is an empty list.\n\n## Examples\n\n```rescript\nList.head(list{}) == None\nList.head(list{1, 2, 3}) == Some(1)\n```" - ], - "signature": "let head: list<'a> => option<'a>" - }, - { - "id": "Stdlib.List.headExn", - "kind": "value", - "name": "headExn", - "docstrings": [ - "`headExn(list)` same as [`head`](#head).\n\n## Examples\n\n```rescript\nList.headExn(list{1, 2, 3}) == 1\n\nswitch List.headExn(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let headExn: list<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.List.headOrThrow", - "kind": "value", - "name": "headOrThrow", - "docstrings": [ - "`headOrThrow(list)` same as [`head`](#head).\n\n## Examples\n\n```rescript\nList.headOrThrow(list{1, 2, 3}) == 1\n\nswitch List.headOrThrow(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let headOrThrow: list<'a> => 'a" - }, - { - "id": "Stdlib.List.tail", - "kind": "value", - "name": "tail", - "docstrings": [ - "`tail(list)` returns `None` if `list` is empty, otherwise it returns `Some(tail)`\nwhere `tail` is everything except the first element of `list`.\n\n## Examples\n\n```rescript\nList.tail(list{1, 2, 3}) == Some(list{2, 3})\n\nList.tail(list{}) == None\n```" - ], - "signature": "let tail: list<'a> => option>" - }, - { - "id": "Stdlib.List.tailExn", - "kind": "value", - "name": "tailExn", - "docstrings": [ - "`tailExn(list)` same as [`tail`](#tail).\n\n## Examples\n\n```rescript\nList.tailExn(list{1, 2, 3}) == list{2, 3}\n\nswitch List.tailExn(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let tailExn: list<'a> => list<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.List.tailOrThrow", - "kind": "value", - "name": "tailOrThrow", - "docstrings": [ - "`tailOrThrow(list)` same as [`tail`](#tail).\n\n## Examples\n\n```rescript\nList.tailOrThrow(list{1, 2, 3}) == list{2, 3}\n\nswitch List.tailOrThrow(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let tailOrThrow: list<'a> => list<'a>" - }, - { - "id": "Stdlib.List.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(list, value)` adds a `value` to the beginning of list `list`.\n\n## Examples\n\n```rescript\nList.add(list{2, 3}, 1) == list{1, 2, 3}\n\nList.add(list{\"World\", \"!\"}, \"Hello\") == list{\"Hello\", \"World\", \"!\"}\n```" - ], - "signature": "let add: (list<'a>, 'a) => list<'a>" - }, - { - "id": "Stdlib.List.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(list, index)` return the `index` element in `list`, or `None` if `index`\nis larger than the length of list `list`.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.get(1) == Some(\"B\")\n\nabc->List.get(4) == None\n```" - ], - "signature": "let get: (list<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.List.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(list, index)` same as [`get`](#get).\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.getExn(1) == \"B\"\n\nswitch abc->List.getExn(4) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if `index` is larger than the length of list." - ], - "signature": "let getExn: (list<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.List.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(list, index)` same as [`get`](#get).\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.getOrThrow(1) == \"B\"\n\nswitch abc->List.getOrThrow(4) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if `index` is larger than the length of list." - ], - "signature": "let getOrThrow: (list<'a>, int) => 'a" - }, - { - "id": "Stdlib.List.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(length, value)` returns a list of length `length` with each element filled\nwith `value`. Returns an empty list if `value` is negative.\n\n## Examples\n\n```rescript\nList.make(~length=3, 1) == list{1, 1, 1}\n```" - ], - "signature": "let make: (~length: int, 'a) => list<'a>" - }, - { - "id": "Stdlib.List.fromInitializer", - "kind": "value", - "name": "fromInitializer", - "docstrings": [ - "`fromInitializer(length, f)` return a list of length `length` with element initialized\nwith `f`. Returns an empty list if `length` is negative.\n\n## Examples\n\n```rescript\nList.fromInitializer(~length=5, i => i) == list{0, 1, 2, 3, 4}\n\nList.fromInitializer(~length=5, i => i * i) == list{0, 1, 4, 9, 16}\n```" - ], - "signature": "let fromInitializer: (~length: int, int => 'a) => list<'a>" - }, - { - "id": "Stdlib.List.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "`shuffle(list)` returns a new list in random order.\n\n## Examples\n\n```rescript\nList.shuffle(list{1, 2, 3}) // list{2, 1, 3}\n```" - ], - "signature": "let shuffle: list<'a> => list<'a>" - }, - { - "id": "Stdlib.List.toShuffled", - "kind": "value", - "name": "toShuffled", - "docstrings": [ - "`toShuffled(list)` returns a new list in random order.\n\n## Examples\n\n```rescript\nList.toShuffled(list{1, 2, 3}) // list{2, 1, 3}\n```" - ], - "signature": "let toShuffled: list<'a> => list<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.List.drop", - "kind": "value", - "name": "drop", - "docstrings": [ - "`drop(list, value)` return a new list, dropping the first `value` element.\nReturns `None` if `list` has fewer than `value` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.drop(2) == Some(list{3})\n\nlist{1, 2, 3}->List.drop(3) == Some(list{})\n\nlist{1, 2, 3}->List.drop(4) == None\n```" - ], - "signature": "let drop: (list<'a>, int) => option>" - }, - { - "id": "Stdlib.List.take", - "kind": "value", - "name": "take", - "docstrings": [ - "`take(list, value)` returns a list with the first `value` elements from `list`,\nor `None` if `list` has fewer than `value` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.take(1) == Some(list{1})\n\nlist{1, 2, 3}->List.take(2) == Some(list{1, 2})\n\nlist{1, 2, 3}->List.take(4) == None\n```" - ], - "signature": "let take: (list<'a>, int) => option>" - }, - { - "id": "Stdlib.List.splitAt", - "kind": "value", - "name": "splitAt", - "docstrings": [ - "`splitAt(list, n)` split the list `list` at `n`. Returns `None` when the length\nof `list` is less than `n`.\n\n## Examples\n\n```rescript\nlist{\"Hello\", \"World\"}->List.splitAt(1) == Some((list{\"Hello\"}, list{\"World\"}))\n\nlist{0, 1, 2, 3, 4}->List.splitAt(2) == Some((list{0, 1}, list{2, 3, 4}))\n```" - ], - "signature": "let splitAt: (list<'a>, int) => option<(list<'a>, list<'a>)>" - }, - { - "id": "Stdlib.List.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(list1, list2)` returns the list obtained by adding `list2` after `list1`.\n\n## Examples\n\n```rescript\nList.concat(list{1, 2, 3}, list{4, 5}) == list{1, 2, 3, 4, 5}\n```" - ], - "signature": "let concat: (list<'a>, list<'a>) => list<'a>" - }, - { - "id": "Stdlib.List.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(arr)` returns the list obtained by concatenating all the lists in\narray `arr`, in order.\n\n## Examples\n\n```rescript\nList.concatMany([list{1, 2, 3}, list{}, list{3}]) == list{1, 2, 3, 3}\n```" - ], - "signature": "let concatMany: array> => list<'a>" - }, - { - "id": "Stdlib.List.reverseConcat", - "kind": "value", - "name": "reverseConcat", - "docstrings": [ - "`reverseConcat(list1, list2)` is equivalent to writing: `concat(reverse(list1, list2)`\n\n## Examples\n\n```rescript\nList.reverseConcat(list{1, 2}, list{3, 4}) == list{2, 1, 3, 4}\n```" - ], - "signature": "let reverseConcat: (list<'a>, list<'a>) => list<'a>" - }, - { - "id": "Stdlib.List.flat", - "kind": "value", - "name": "flat", - "docstrings": [ - "`flat(list)` return the list obtained by concatenating all the lists in\n`list`, in order.\n\n## Examples\n\n```rescript\nList.flat(list{list{1, 2, 3}, list{}, list{3}}) == list{1, 2, 3, 3}\n```" - ], - "signature": "let flat: list> => list<'a>" - }, - { - "id": "Stdlib.List.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nlist{1, 2}->List.map(x => x + 1) == list{2, 3}\n```" - ], - "signature": "let map: (list<'a>, 'a => 'b) => list<'b>" - }, - { - "id": "Stdlib.List.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "`zip(list1, list2)` returns a list of pairs from the two lists with the length\nof the shorter list.\n\n## Examples\n\n```rescript\nList.zip(list{1, 2}, list{3, 4, 5}) == list{(1, 3), (2, 4)}\n```" - ], - "signature": "let zip: (list<'a>, list<'b>) => list<('a, 'b)>" - }, - { - "id": "Stdlib.List.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "`zipBy(list1, list2, f)`. See [`zip`](#zip)\n\n## Examples\n\n```rescript\nList.zipBy(list{1, 2, 3}, list{4, 5}, (a, b) => 2 * a + b) == list{6, 9}\n```" - ], - "signature": "let zipBy: (list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>" - }, - { - "id": "Stdlib.List.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(list, f)` applies `f` to each element of `list`. Function `f`\ntakes two arguments: the index starting from 0 and the element from `list`, in\nthat order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.mapWithIndex((x, index) => index + x) == list{1, 3, 5}\n```" - ], - "signature": "let mapWithIndex: (list<'a>, ('a, int) => 'b) => list<'b>" - }, - { - "id": "Stdlib.List.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(arr)` converts the given array `arr` to a list.\n\n## Examples\n\n```rescript\nList.fromArray([1, 2, 3]) == list{1, 2, 3}\n```" - ], - "signature": "let fromArray: array<'a> => list<'a>" - }, - { - "id": "Stdlib.List.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(list)` converts the given list `list` to an array.\n\n## Examples\n\n```rescript\nList.toArray(list{1, 2, 3}) == [1, 2, 3]\n```" - ], - "signature": "let toArray: list<'a> => array<'a>" - }, - { - "id": "Stdlib.List.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(list)` returns a new list whose elements are those of `list` in\nreversed order.\n\n## Examples\n\n```rescript\nList.reverse(list{1, 2, 3}) == list{3, 2, 1}\n```" - ], - "signature": "let reverse: list<'a> => list<'a>" - }, - { - "id": "Stdlib.List.mapReverse", - "kind": "value", - "name": "mapReverse", - "docstrings": [ - "`mapReverse(list, f)` is equivalent to `map` function.\n\n## Examples\n\n```rescript\nlet f = x => x * x\nlet l = list{3, 4, 5}\n\nlet withMap = List.map(l, f)->List.reverse\nlet withMapReverse = l->List.mapReverse(f)\n\nConsole.log(withMap == withMapReverse) // true\n```" - ], - "signature": "let mapReverse: (list<'a>, 'a => 'b) => list<'b>" - }, - { - "id": "Stdlib.List.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(list, f)` call `f` on each element of `list` from the beginning to end.\n`f` returns `unit`, so no new array is created. Use `forEach` when you are primarily\nconcerned with repetitively creating side effects.\n\n## Examples\n\n```rescript\nList.forEach(list{\"a\", \"b\", \"c\"}, x => Console.log(\"Item: \" ++ x))\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\n```" - ], - "signature": "let forEach: (list<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.List.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(list, f, index)` call `f` on each element of `list` from beginning\nto end. Function `f` takes two arguments: the `index` starting from 0 and the\nelement from `list`. `f` returns `unit`.\n\n## Examples\n\n```rescript\nList.forEachWithIndex(list{\"a\", \"b\", \"c\"}, (x, index) => {\n Console.log(\"Item \" ++ Int.toString(index) ++ \" is \" ++ x)\n})\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\n```" - ], - "signature": "let forEachWithIndex: (list<'a>, ('a, int) => unit) => unit" - }, - { - "id": "Stdlib.List.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(list, initialValue, f)` applies `f` to each element of `list` from\nbeginning to end. Function `f` has two parameters: the item from the list and\nan \"accumulator\", which starts with a value of `initialValue`. `reduce` returns\nthe final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduce(0, (a, b) => a + b) == 10\n\n// same as\n\nlist{1, 2, 3, 4}->List.reduce(0, (acc, item) => acc + item) == 10\n```" - ], - "signature": "let reduce: (list<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.List.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(list, initialValue, f)` applies `f` to each element of `list`\nfrom beginning to end. Function `f` has three parameters: the item from the list\nand an \"accumulator\", which starts with a value of `initialValue` and the index\nof each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduceWithIndex(0, (acc, item, index) => acc + item + index) == 16\n```" - ], - "signature": "let reduceWithIndex: (list<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Stdlib.List.reduceReverse", - "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "`reduceReverse(list, initialValue, f)` works like `reduce`, except that\nfunction `f` is applied to each item of `list` from the last back to the first.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduceReverse(0, (a, b) => a + b) == 10\n\nlist{1, 2, 3, 4}->List.reduceReverse(10, (a, b) => a - b) == 0\n\nlist{1, 2, 3, 4}->List.reduceReverse(list{}, List.add) == list{1, 2, 3, 4}\n```" - ], - "signature": "let reduceReverse: (list<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.List.mapReverse2", - "kind": "value", - "name": "mapReverse2", - "docstrings": [ - "`mapReverse2(list1, list2, f)` is equivalent to `List.zipBy(list1, list2, f)->List.reverse`.\n\n## Examples\n\n```rescript\nList.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) == list{4, 2}\n```" - ], - "signature": "let mapReverse2: (list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>" - }, - { - "id": "Stdlib.List.forEach2", - "kind": "value", - "name": "forEach2", - "docstrings": [ - "`forEach2(list1, list2, f)` is similar to `forEach`, but accepts two lists and\nstops at the length of the shorter list.\n\n## Examples\n\n```rescript\nList.forEach2(list{\"Z\", \"Y\"}, list{\"A\", \"B\", \"C\"}, (x, y) => Console.log2(x, y))\n\n/*\n prints:\n \"Z\" \"A\"\n \"Y\" \"B\"\n*/\n```" - ], - "signature": "let forEach2: (list<'a>, list<'b>, ('a, 'b) => 'c) => unit" - }, - { - "id": "Stdlib.List.reduce2", - "kind": "value", - "name": "reduce2", - "docstrings": [ - "`reduce2(list1, list2, initialValue, f)` applies `f` to each element of `list1`\nand `list2` from beginning to end. Stops with the shorter list. Function `f` has\nthree parameters: an accumulator which starts with a value of `initialValue`, an\nitem from `l1`, and an item from `l2`. `reduce2` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nList.reduce2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduce2: (list<'b>, list<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a" - }, - { - "id": "Stdlib.List.reduceReverse2", - "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "`reduceReverse2(list1, list2, initialValue, f)` applies `f` to each element of\n`list1` and `list2`from end to beginning. Stops with the shorter list. Function\n`f` has three parameters: an accumulator which starts with a value of\n`initialValue`, an item from `l1`, and an item from `l2`. `reduce2` returns the\nfinal value of the accumulator.\n\n## Examples\n\n```rescript\nList.reduceReverse2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduceReverse2: (list<'a>, list<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" - }, - { - "id": "Stdlib.List.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(list, f)` returns `true` if all elements in `list` satisfy `f`, where `f`\nis a predicate: a function taking an element and returning a bool.\n\n## Examples\n\n```rescript\nlet isBelow10 = value => value < 10\n\nlist{1, 9, 8, 2}->List.every(isBelow10) == true\n\nlist{1, 99, 8, 2}->List.every(isBelow10) == false\n```" - ], - "signature": "let every: (list<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.List.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(list, f)` returns `true` if at least _one_ of the elements in `list`\nsatisfies `f`, where `f` is a predicate: a function taking an element and\nreturning a bool.\n\n## Examples\n\n```rescript\nlet isAbove100 = value => value > 100\n\nlist{101, 1, 2, 3}->List.some(isAbove100) == true\n\nlist{1, 2, 3, 4}->List.some(isAbove100) == false\n```" - ], - "signature": "let some: (list<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.List.every2", - "kind": "value", - "name": "every2", - "docstrings": [ - "`every2(list1, list2, f)` returns `true` if predicate `f` is `true` for all\npairs of elements up to the shorter length (i.e. `min(length(list1), length(list2))`)\n\n## Examples\n\n```rescript\nList.every2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nList.every2(list{}, list{1}, (a, b) => a > b) == true\n\nList.every2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nList.every2(list{0, 1}, list{5, 0}, (a, b) => a > b) == false\n```" - ], - "signature": "let every2: (list<'a>, list<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.List.some2", - "kind": "value", - "name": "some2", - "docstrings": [ - "`some2(list1, list2, f)` returns `true` if predicate `f` is `true` for any pair\nof elements up to the shorter length (i.e. `min(length(list1), length(list2))`)\n\n## Examples\n\n```rescript\nList.some2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nList.some2(list{}, list{1}, (a, b) => a > b) == false\n\nList.some2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nList.some2(list{0, 1}, list{5, 0}, (a, b) => a > b) == true\n```" - ], - "signature": "let some2: (list<'a>, list<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.List.compareLength", - "kind": "value", - "name": "compareLength", - "docstrings": [ - "`compareLength(list1, list2)` compare two lists solely by length. Returns `-1.` if\n`length(list1)` is less than `length(list2)`, `0.` if `length(list1)` equals\n`length(list2)`, and `1.` if `length(list1)` is greater than `length(list2)`.\n\n## Examples\n\n```rescript\nList.compareLength(list{1, 2}, list{3, 4, 5, 6}) == -1.\n\nList.compareLength(list{1, 2, 3}, list{4, 5, 6}) == 0.\n\nList.compareLength(list{1, 2, 3, 4}, list{5, 6}) == 1.\n```" - ], - "signature": "let compareLength: (list<'a>, list<'a>) => Ordering.t" - }, - { - "id": "Stdlib.List.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(list1, list2, f)` compare elements one by one `f`. `f` returns a negative\nnumber if `list1` is \"less than\" `list2`, zero if `list1` is \"equal to\" `list2`,\na positive number if `list1` is \"greater than\" `list2`.\n\nThe comparison returns the first non-zero result of `f`, or zero if `f` returns\nzero for all `list1` and `list2`.\n\n- If all items have compared equal, but `list1` is exhausted first, return `-1.`. (`list1` is shorter).\n- If all items have compared equal, but `list2` is exhausted first, return `1.` (`list1` is longer).\n\n## Examples\n\n```rescript\nList.compare(list{3}, list{3, 7}, (a, b) => Int.compare(a, b)) == -1.\nList.compare(list{5, 3}, list{5}, (a, b) => Int.compare(a, b)) == 1.\nList.compare(list{1, 3, 5}, list{1, 4, 2}, (a, b) => Int.compare(a, b)) == -1.\nList.compare(list{1, 3, 5}, list{1, 2, 3}, (a, b) => Int.compare(a, b)) == 1.\nList.compare(list{1, 3, 5}, list{1, 3, 5}, (a, b) => Int.compare(a, b)) == 0.\n```\n\n**Please note:** The total ordering of List is different from Array,\nfor Array, we compare the length first and, only if the lengths are equal, elements one by one.\nFor lists, we just compare elements one by one." - ], - "signature": "let compare: (list<'a>, list<'a>, ('a, 'a) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.List.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(list1, list2, f)` check equality of `list2` and `list2` using `f` for\nequality on elements, where `f` is a function that returns `true` if items `x` and\n`y` meet some criterion for equality, `false` otherwise. equal `false` if length\nof `list1` and `list2` are not the same.\n\n## Examples\n\n```rescript\nList.equal(list{1, 2, 3}, list{1, 2}, (a, b) => a == b) == false\n\nList.equal(list{1, 2}, list{1, 2}, (a, b) => a == b) == true\n\nList.equal(list{1, 2, 3}, list{-1, -2, -3}, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let equal: (list<'a>, list<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Stdlib.List.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(list, element, f)` returns `true` if the list contains at least one\n`element` for which `f` returns \\`true'.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.has(2, (a, b) => a == b) == true\n\nlist{1, 2, 3}->List.has(4, (a, b) => a == b) == false\n\nlist{-1, -2, -3}->List.has(2, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let has: (list<'a>, 'b, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.List.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(list, f)` returns `Some(value)` for the first value in `list` that\nsatisfies the predicate function `f`. Returns `None` if no element satisfies\nthe function.\n\n## Examples\n\n```rescript\nList.find(list{1, 4, 3, 2}, x => x > 3) == Some(4)\n\nList.find(list{1, 4, 3, 2}, x => x > 4) == None\n```" - ], - "signature": "let find: (list<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.List.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(list, f)` returns a list of all elements in `list` which satisfy the\npredicate function `f`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nList.filter(list{1, 2, 3, 4}, isEven) == list{2, 4}\n\nList.filter(list{None, Some(2), Some(3), None}, Option.isSome) == list{Some(2), Some(3)}\n```" - ], - "signature": "let filter: (list<'a>, 'a => bool) => list<'a>" - }, - { - "id": "Stdlib.List.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(list, f)` returns a list of all elements in `list` which\nsatisfy the predicate function `f`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nList.filterWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) == list{1, 3}\n```" - ], - "signature": "let filterWithIndex: (list<'a>, ('a, int) => bool) => list<'a>" - }, - { - "id": "Stdlib.List.filterMap", - "kind": "value", - "name": "filterMap", - "docstrings": [ - "`filterMap(list, f)` applies `f` to each element of `list`. If `f` returns\n`Some(value)`, then `value` is _kept_ in the resulting list. If `f` returns\n`None`, the element is _not_ retained in the result.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nlist{1, 2, 3, 4}->List.filterMap(x =>\n if isEven(x) {\n Some(x)\n } else {\n None\n }\n) // list{2, 4}\n\nlist{Some(1), Some(2), None}->List.filterMap(x => x) == list{1, 2}\n```" - ], - "signature": "let filterMap: (list<'a>, 'a => option<'b>) => list<'b>" - }, - { - "id": "Stdlib.List.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(list, f)` creates a pair of lists; the first list consists of all\nelements of `list` that satisfy the predicate function `f`, the second list\nconsists of all elements of `list` that _do not_ satisfy `f`.\n\n## Examples\n\n```rescript\n// (elementsThatSatisfies, elementsThatDoesNotSatisfy)\n\nList.partition(list{1, 2, 3, 4}, x => x > 2) == (list{3, 4}, list{1, 2})\n```" - ], - "signature": "let partition: (list<'a>, 'a => bool) => (list<'a>, list<'a>)" - }, - { - "id": "Stdlib.List.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "`unzip(list)` takes a list of pairs and creates a pair of lists. The first list\ncontains all the first items of the pairs, the second list contains all the\nsecond items.\n\n## Examples\n\n```rescript\nList.unzip(list{(1, 2), (3, 4)}) // (list{1, 3}, list{2, 4})\n\nList.unzip(list{(\"H\", \"W\"), (\"e\", \"o\"), (\"l\", \"r\"), (\"l\", \"l\"), (\"o\", \"d\"), (\" \", \"!\")}) ==\n (list{\"H\", \"e\", \"l\", \"l\", \"o\", \" \"}, list{\"W\", \"o\", \"r\", \"l\", \"d\", \"!\"})\n```" - ], - "signature": "let unzip: list<('a, 'b)> => (list<'a>, list<'b>)" - }, - { - "id": "Stdlib.List.getAssoc", - "kind": "value", - "name": "getAssoc", - "docstrings": [ - "`getAssoc(list, k, f)` return the second element of a pair in `list` where\nthe first element equals `k` as per the predicate function `f`, or `None` if\nnot found.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.getAssoc(3, (a, b) => a == b) // Some(\"c\")\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->List.getAssoc(15, (k, item) =>\n k /* 15 */ == item\n) == Some(\"afternoon\")\n/* 9, 5, 22 */\n```" - ], - "signature": "let getAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.hasAssoc", - "kind": "value", - "name": "hasAssoc", - "docstrings": [ - "`hasAssoc(list, k, f)` returns `true` if there is a pair in `list` where the\nfirst element equals `k` as per the predicate function `f`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.hasAssoc(1, (a, b) => a == b) // true\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->List.hasAssoc(25, (k, item) =>\n k /* 25 */ == item\n) == false\n/* 9, 5, 22 */\n```" - ], - "signature": "let hasAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => bool", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.removeAssoc", - "kind": "value", - "name": "removeAssoc", - "docstrings": [ - "`removeAssoc(list, k, f)` return a list after removing the first pair whose\nfirst value is `k` per the equality predicate `f`, if not found, return a new\nlist identical to `list`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.removeAssoc(1, (a, b) => a == b) // list{(2, \"b\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->List.removeAssoc(9, (k, item) =>\n k /* 9 */ == item\n) == list{(15, \"afternoon\"), (22, \"night\")}\n/* 9, 5, 22 */\n```" - ], - "signature": "let removeAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => list<('a, 'c)>", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.setAssoc", - "kind": "value", - "name": "setAssoc", - "docstrings": [ - "`setAssoc(list, k, v, f)`. If `k` exists in `list` by satisfying the `f`\npredicate, return a new list with the key and value replaced by the new `k` and\n`v`, otherwise, return a new list with the pair `k`, `v` added to the head of\n`list`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.setAssoc(2, \"x\", (a, b) => a == b) ==\n list{(1, \"a\"), (2, \"x\"), (3, \"c\")}\n\nlist{(1, \"a\"), (3, \"c\")}->List.setAssoc(2, \"b\", (a, b) => a == b) ==\n list{(2, \"b\"), (1, \"a\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (3, \"morning?!\"), (22, \"night\")}->List.setAssoc(15, \"afternoon\", (a, b) =>\n mod(a, 12) == mod(b, 12)\n) == list{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n```\n\n**Please note**: In the last example, since: `15 mod 12` equals `3 mod 12`. Both\nthe key _and_ the value are replaced in the list." - ], - "signature": "let setAssoc: (list<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => list<('a, 'c)>", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(list, f)` returns a sorted list.\n\n## Examples\n\n```rescript\nList.sort(list{5, 4, 9, 3, 7}, Int.compare) == list{3, 4, 5, 7, 9}\n```" - ], - "signature": "let sort: (list<'a>, ('a, 'a) => Ordering.t) => list<'a>" - }, - { - "id": "Stdlib.List.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(list)` ignores the provided list and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: list<'a> => unit" - } - ] - }, - "stdlib/lazy": { - "id": "Stdlib.Lazy", - "name": "Lazy", - "docstrings": [ - "This module provides a type `Lazy.t` and functions to create and\n manipulate lazy values. A lazy value is a value that is not\n computed until it is needed. This is useful for deferring\n computations that may be expensive or unnecessary." - ], - "items": [ - { - "id": "Stdlib.Lazy.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of a lazy value. `Lazy.t<'a>` represents a lazy value\n that will eventually yield a value of type `'a` when accessed.\n The value is computed only once, and the result is cached for\n subsequent accesses. If the computation throws an exception,\n the same exception is thrown again on subsequent accesses." - ], - "signature": "type t<+'a>" - }, - { - "id": "Stdlib.Lazy.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`Lazy.make(f)` creates a lazy value from `f` which is the\n computation to be deferred of type `unit => 'a`. \n The function returns a lazy value of type `Lazy.t<'a>`. \n The computation is not executed until the lazy value is accessed.\n\n ## Examples \n ```rescript \n let lazyValue = Lazy.make(() => {\n // Some expensive computation\n Console.log(\"Computing...\")\n 42\n });\n lazyValue->Lazy.get->assertEqual(42)\n ```" - ], - "signature": "let make: (unit => 'a) => t<'a>" - }, - { - "id": "Stdlib.Lazy.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`Lazy.get(x)` forces the suspension `x` and returns its result.\n If `x` has already been forced, `Lazy.get(x)` returns the\n same value again without recomputing it. If it threw an\n exception, the same exception is thrown again.\n Throw `Undefined` if the forcing of `x` tries to force `x` itself\n recursively. This is a runtime error." - ], - "signature": "let get: t<'a> => 'a" - }, - { - "id": "Stdlib.Lazy.isEvaluated", - "kind": "value", - "name": "isEvaluated", - "docstrings": [ - "`Lazy.isEvaluated(x)` returns `true` if the suspension `x` has\n already been forced and did not throw an exception. Otherwise, \n it returns `false`. This is useful for checking if a lazy value\n has been computed before accessing it.\n\n ## Examples\n ```rescript \n let lazyValue = Lazy.make(() => {\n // Some expensive computation\n Console.log(\"Computing...\")\n 42\n })\n Lazy.isEvaluated(lazyValue)->assertEqual(false)\n lazyValue->Lazy.get->assertEqual(42)\n lazyValue->Lazy.isEvaluated->assertEqual(true)\n ```" - ], - "signature": "let isEvaluated: t<'a> => bool" - }, - { - "id": "Stdlib.Lazy.force", - "kind": "value", - "name": "force", - "docstrings": [ - "`force(x)` forces the suspension `x` and returns its result.\n If `x` has already been forced, `Lazy.force(x)` returns the\n same value again without recomputing it. If it threw an exception,\n the same exception is thrown again.\n Throw `Undefined` if the forcing of `x` tries to force `x` itself\n recursively." - ], - "signature": "let force: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.force_val", - "kind": "value", - "name": "force_val", - "docstrings": [ - "`force_val(x)` forces the suspension `x` and returns its\n result. If `x` has already been forced, `force_val(x)`\n returns the same value again without recomputing it.\n Throw `Undefined` if the forcing of `x` tries to force `x` itself\n recursively.\n If the computation of `x` throws an exception, it is unspecified\n whether `force_val(x)` throws the same exception or `Undefined`." - ], - "signature": "let force_val: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.from_fun", - "kind": "value", - "name": "from_fun", - "docstrings": [ - "`Lazy.from_fun(f)` creates a lazy value from `f` which is the\n computation to be deferred of type `unit => 'a`. \n The function returns a lazy value of type `Lazy.t<'a>`. \n The computation is not executed until the lazy value is accessed." - ], - "signature": "let from_fun: (unit => 'a) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.from_val", - "kind": "value", - "name": "from_val", - "docstrings": [ - "`from_val(v)` returns an already-forced suspension of `v`.\n This is for special purposes only." - ], - "signature": "let from_val: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.is_val", - "kind": "value", - "name": "is_val", - "docstrings": [ - "`is_val(x)` returns `true` if `x has already been forced and\n did not throw an exception." - ], - "signature": "let is_val: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(lazyValue)` ignores the provided lazy value and returns unit.\n\n This helper is useful when you want to discard a lazy value (for example, when only its side effects matter)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/json": { - "id": "Stdlib.JSON", - "name": "JSON", - "docstrings": [ - "Functions for interacting with JSON." - ], - "items": [ - { - "id": "Stdlib.JSON.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a JSON object." - ], - "signature": "@unboxed\ntype t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)" - }, - { - "id": "Stdlib.JSON.replacer", - "kind": "type", - "name": "replacer", - "docstrings": [], - "signature": "@unboxed\ntype replacer =\n | Keys(array)\n | Replacer((string, t) => t)" - }, - { - "id": "Stdlib.JSON.parseOrThrow", - "kind": "value", - "name": "parseOrThrow", - "docstrings": [ - "`parseOrThrow(string, ~reviver=?)`\n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\ntry {\n let _ = JSON.parseOrThrow(`{\"foo\":\"bar\",\"hello\":\"world\"}`)\n // { foo: 'bar', hello: 'world' }\n\n let _ = JSON.parseOrThrow(\"\")\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\ntry {\n JSON.parseOrThrow(jsonString, ~reviver)->Console.log\n // { hello: 'WORLD', someNumber: 42 }\n\n JSON.parseOrThrow(\"\", ~reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions\n\n- Throws a SyntaxError (Exn.t) if the string isn't valid JSON." - ], - "signature": "let parseOrThrow: (string, ~reviver: (string, t) => t=?) => t" - }, - { - "id": "Stdlib.JSON.parseExn", - "kind": "value", - "name": "parseExn", - "docstrings": [ - "`parseExn(string, ~reviver=?)`\n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\ntry {\n let _ = JSON.parseExn(`{\"foo\":\"bar\",\"hello\":\"world\"}`)\n // { foo: 'bar', hello: 'world' }\n\n let _ = JSON.parseExn(\"\")\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\ntry {\n JSON.parseExn(jsonString, ~reviver)->Console.log\n // { hello: 'WORLD', someNumber: 42 }\n\n JSON.parseExn(\"\", ~reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions\n\n- Throws a SyntaxError (Exn.t) if the string isn't valid JSON." - ], - "signature": "let parseExn: (string, ~reviver: (string, t) => t=?) => t", - "deprecated": "Use `parseOrThrow` instead" - }, - { - "id": "Stdlib.JSON.parseExnWithReviver", - "kind": "value", - "name": "parseExnWithReviver", - "docstrings": [ - "`parseExnWithReviver(string, reviver)`\n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\nJSON.parseExnWithReviver(jsonString, reviver)->Console.log\n// { hello: 'WORLD', someNumber: 42 }\n\ntry {\n JSON.parseExnWithReviver(\"\", reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions\n\n- Throws a SyntaxError if the string is not a valid JSON." - ], - "signature": "let parseExnWithReviver: (string, (string, t) => t) => t", - "deprecated": "Use `parseOrThrow` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringify", - "kind": "value", - "name": "stringify", - "docstrings": [ - "`stringify(json, ~replacer=?, ~space=?)`\n\nConverts a JSON object to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value,\nor an array of keys which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAny` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringify(json)\n// {\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}\n\nJSON.stringify(json, ~space=2)\n// {\n// \"foo\": \"bar\",\n// \"hello\": \"world\",\n// \"someNumber\": 42\n// }\n\nJSON.stringify(json, ~replacer=Keys([\"foo\", \"someNumber\"]))\n// {\"foo\":\"bar\",\"someNumber\":42}\n\nlet replacer = JSON.Replacer(\n (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n },\n)\n\nJSON.stringify(json, ~replacer)\n// {\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}\n```" - ], - "signature": "let stringify: (t, ~replacer: replacer=?, ~space: int=?) => string" - }, - { - "id": "Stdlib.JSON.stringifyWithIndent", - "kind": "value", - "name": "stringifyWithIndent", - "docstrings": [ - "`stringifyWithIndent(json, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nIf you want to stringify any type, use `JSON.stringifyAnyWithIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithIndent(json, 2)\n// {\n// \"foo\": \"bar\",\n// \"hello\": \"world\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithIndent: (t, int) => string", - "deprecated": "Use `stringify` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyWithReplacer", - "kind": "value", - "name": "stringifyWithReplacer", - "docstrings": [ - "`stringifyWithReplacer(json, replacer)`\n\nConverts a JSON object to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nIf you want to stringify any type, use `JSON.stringifyAnyWithReplacer` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\nJSON.stringifyWithReplacer(json, replacer)\n// {\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}\n```" - ], - "signature": "let stringifyWithReplacer: (t, (string, t) => t) => string", - "deprecated": "Use `stringify` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyWithReplacerAndIndent", - "kind": "value", - "name": "stringifyWithReplacerAndIndent", - "docstrings": [ - "`stringifyWithReplacerAndIndent(json, replacer, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nIf you want to stringify any type, use `JSON.stringifyAnyWithReplacerAndIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\nJSON.stringifyWithReplacerAndIndent(json, replacer, 2)\n// {\n// \"foo\": \"BAR\",\n// \"hello\": \"WORLD\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithReplacerAndIndent: (t, (string, t) => t, int) => string", - "deprecated": "Use `stringify` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.stringifyWithFilter", - "kind": "value", - "name": "stringifyWithFilter", - "docstrings": [ - "`stringifyWithFilter(json, filter)`\n\nConverts a JSON object to a JSON string.\nThe filter is an array of keys, which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAnyWithFilter` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithFilter(json, [\"foo\", \"someNumber\"])\n// {\"foo\":\"bar\",\"someNumber\":42}\n```" - ], - "signature": "let stringifyWithFilter: (t, array) => string", - "deprecated": "Use `stringify` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyWithFilterAndIndent", - "kind": "value", - "name": "stringifyWithFilterAndIndent", - "docstrings": [ - "`stringifyWithFilterAndIndent(json, filter, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nThe filter is an array of keys, which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAnyWithFilterAndIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithFilterAndIndent(json, [\"foo\", \"someNumber\"], 2)\n// {\n// \"foo\": \"bar\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithFilterAndIndent: (t, array, int) => string", - "deprecated": "Use `stringify` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.stringifyAny", - "kind": "value", - "name": "stringifyAny", - "docstrings": [ - "`stringifyAny(any, ~replacer=?, ~space=?)`\n\nConverts any type to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringify` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAny\n->Option.getUnsafe == `{\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}`\n\ndict\n->JSON.stringifyAny(~space=2)\n->Option.getUnsafe == `{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`\n\ndict\n->JSON.stringifyAny(~replacer=Keys([\"foo\", \"someNumber\"]))\n->Option.getUnsafe == `{\"foo\":\"bar\",\"someNumber\":42}`\n\nlet replacer = JSON.Replacer(\n (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n },\n)\n\ndict\n->JSON.stringifyAny(~replacer)\n->Option.getUnsafe == `{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\n// Throw a exception\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAny: ('a, ~replacer: replacer=?, ~space: int=?) => option" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithIndent", - "kind": "value", - "name": "stringifyAnyWithIndent", - "docstrings": [ - "`stringifyAnyWithIndent(any, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAnyWithIndent(2)\n->Option.getUnsafe == `{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithIndent: ('a, int) => option", - "deprecated": "Use `stringifyAny` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithReplacer", - "kind": "value", - "name": "stringifyAnyWithReplacer", - "docstrings": [ - "`stringifyAnyWithReplacer(json, replacer)`\n\nConverts any type to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithReplacer` instead.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\ndict\n->JSON.stringifyAnyWithReplacer(replacer)\n->Option.getUnsafe == `{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithReplacer: ('a, (string, t) => t) => option", - "deprecated": "Use `stringifyAny` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithReplacerAndIndent", - "kind": "value", - "name": "stringifyAnyWithReplacerAndIndent", - "docstrings": [ - "`stringifyAnyWithReplacerAndIndent(json, replacer, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithReplacerAndIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\ndict\n->JSON.stringifyAnyWithReplacer(replacer)\n->Option.getUnsafe == `{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithReplacerAndIndent: ('a, (string, t) => t, int) => option", - "deprecated": "Use `stringifyAny` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithFilter", - "kind": "value", - "name": "stringifyAnyWithFilter", - "docstrings": [ - "`stringifyAnyWithFilter(json, filter)`\n\nConverts any type to a JSON string.\nThe filter is an array of keys, which should be included in the output.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithFilter` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict->JSON.stringifyAnyWithFilter([\"foo\", \"someNumber\"]) == `{\"foo\":\"bar\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithFilter: ('a, array) => string", - "deprecated": "Use `stringifyAny` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithFilterAndIndent", - "kind": "value", - "name": "stringifyAnyWithFilterAndIndent", - "docstrings": [ - "`stringifyAnyWithFilterAndIndent(json, filter, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nThe filter is an array of keys, which should be included in the output.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithFilterAndIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAny\n->Option.getUnsafe == `{\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}`\n\ndict\n->JSON.stringifyAny(~space=2)\n->Option.getUnsafe == `{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`\n\ndict\n->JSON.stringifyAny(~replacer=Keys([\"foo\", \"someNumber\"]))\n->Option.getUnsafe == `{\"foo\":\"bar\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithFilterAndIndent: ('a, array, int) => string", - "deprecated": "Use `stringifyAny` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(json)` ignores the provided json and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/jsexn": { - "id": "Stdlib.JsExn", - "name": "JsExn", - "docstrings": [ - "Provide utilities for dealing with JS exceptions.\n\nJS exceptions can be of any type, even though they *should* be of type `Error` of one of its subclasses.\n\nSee [`throw`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/throw) on MDN." - ], - "items": [ - { - "id": "Stdlib.JsExn.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JS exception" - ], - "signature": "type t = unknown" - }, - { - "id": "Stdlib.JsExn.fromException", - "kind": "value", - "name": "fromException", - "docstrings": [], - "signature": "let fromException: exn => option" - }, - { - "id": "Stdlib.JsExn.anyToExnInternal", - "kind": "value", - "name": "anyToExnInternal", - "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a JsExn if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." - ], - "signature": "let anyToExnInternal: 'a => exn" - }, - { - "id": "Stdlib.JsExn.stack", - "kind": "value", - "name": "stack", - "docstrings": [ - "`stack(jsExn)` retrieves the `stack` property of the exception, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\ntry {JsError.make(\"error\")->JsError.throw} catch {\n| JsExn(e) => Console.log(JsExn.stack(e)) // Logs `stack`\n| _ => assert(false)\n}\n```" - ], - "signature": "let stack: t => option" - }, - { - "id": "Stdlib.JsExn.message", - "kind": "value", - "name": "message", - "docstrings": [ - "`message(error)` retrieves the `message` property of the error, if it exists.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\ntry {JsError.SyntaxError.throwWithMessage(\"Some message here\")} catch {\n| JsExn(e) => e->JsExn.message->Option.getExn == \"Some message here\"\n| _ => assert(false)\n}\n```" - ], - "signature": "let message: t => option" - }, - { - "id": "Stdlib.JsExn.name", - "kind": "value", - "name": "name", - "docstrings": [ - "`name(error)` retrieves the `name` property of the error, if it exists.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\ntry {JsError.SyntaxError.throwWithMessage(\"Some message here\")} catch {\n| JsExn(e) => e->JsExn.name->Option.getExn == \"SyntaxError\"\n| _ => assert(false)\n}\n```" - ], - "signature": "let name: t => option" - }, - { - "id": "Stdlib.JsExn.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [ - "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." - ], - "signature": "let fileName: t => option" - }, - { - "id": "Stdlib.JsExn.throw", - "kind": "value", - "name": "throw", - "docstrings": [ - "Throws the given value, terminating execution unless caught by a surrounding try/catch block.\n\nThis is meant to be used when a JS API is based on throwing values that are not of type `Error` or its subclasses." - ], - "signature": "let throw: 'a => 'b" - }, - { - "id": "Stdlib.JsExn.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(jsExn)` ignores the provided JS exception and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/jserror": { - "id": "Stdlib.JsError", - "name": "JsError", - "docstrings": [ - "Functions for working with JavaScript errors.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) on MDN." - ], - "items": [ - { - "id": "Stdlib.JsError.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JavaScript error." - ], - "signature": "type t" - }, - { - "id": "Stdlib.JsError.stack", - "kind": "value", - "name": "stack", - "docstrings": [ - "`stack(error)` retrieves the `stack` property of the error, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\nlet error = JsError.make(\"error\")\nConsole.log(error->JsError.stack) // Logs `stack` if it exists on `someError`\n```" - ], - "signature": "let stack: t => option" - }, - { - "id": "Stdlib.JsError.message", - "kind": "value", - "name": "message", - "docstrings": [ - "`message(error)` retrieves the `message` property of the error.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\nlet error = JsError.SyntaxError.make(\"Some message here\")\nerror->JsError.message == \"Some message here\"\n```" - ], - "signature": "let message: t => string" - }, - { - "id": "Stdlib.JsError.name", - "kind": "value", - "name": "name", - "docstrings": [ - "`name(error)` retrieves the `name` property of the error.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\nlet error = JsError.SyntaxError.make(\"Some message here\")\nerror->JsError.name == \"SyntaxError\"\n```" - ], - "signature": "let name: t => string" - }, - { - "id": "Stdlib.JsError.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [ - "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." - ], - "signature": "let fileName: t => option" - }, - { - "id": "Stdlib.JsError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(message)` creates a new error, setting its `message` to the provided value.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error) on MDN.\n\n## Example\n```rescript\nlet error = JsError.make(\"Some message here\")\nerror->JsError.message == \"Some message here\"\nerror->JsError.name == \"Error\"\n```" - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.throw", - "kind": "value", - "name": "throw", - "docstrings": [ - "Throws the given error, terminating execution unless caught by a surrounding try/catch block.\n\n## Examples\n\n```rescript\nlet error = JsError.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n JsError.throw(error)\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" - ], - "signature": "let throw: t => 'a" - }, - { - "id": "Stdlib.JsError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `Error` with the provided `message` and throws it.\n\n`JsError.throwWithMessage(\"message\")` is equivalent to `JsError.make(\"message\")->JsError.throw`." - ], - "signature": "let throwWithMessage: string => 'a" - }, - { - "id": "Stdlib.JsError.panic", - "kind": "value", - "name": "panic", - "docstrings": [ - "Throws a panic exception with the given message.\n\nA panic exception is a native JavaScript exception that is not intended to be caught and\nhandled. Compared to a ReScript exception this will give a better stack trace and\ndebugging experience.\n\n## Examples\n\n```rescript\ntry {\n JsError.panic(\"Uh oh. This was unexpected!\")\n} catch {\n| JsExn(obj) =>\n switch JsExn.message(obj) {\n | Some(m) => assert(m == \"Panic! Uh oh. This was unexpected!\")\n | None => assert(false)\n }\n| _ => assert(false)\n}\n```" - ], - "signature": "let panic: string => 'a" - }, - { - "id": "Stdlib.JsError.toJsExn", - "kind": "value", - "name": "toJsExn", - "docstrings": [ - "Casts a `JsError.t` to a `JsExn.t`. \n\nThis is useful when you want to compare a JS exception and a JS error." - ], - "signature": "let toJsExn: t => JsExn.t" - }, - { - "id": "Stdlib.JsError.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(error)` ignores the provided error and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl": { - "id": "Stdlib.Intl", - "name": "Intl", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.getCanonicalLocalesExn", - "kind": "value", - "name": "getCanonicalLocalesExn", - "docstrings": [ - "`getCanonicalLocalesExn(locale)` returns the canonical form of `locale`.\n\nThrows `RangeError` when the locale string is malformed.\n\nSee [`Intl.getCanonicalLocales`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales) on MDN.\n\n## Examples\n\n```rescript\nIntl.getCanonicalLocalesExn(\"EN-US\") == [\"en-US\"]\n```" - ], - "signature": "let getCanonicalLocalesExn: string => array" - }, - { - "id": "Stdlib.Intl.getCanonicalLocalesManyExn", - "kind": "value", - "name": "getCanonicalLocalesManyExn", - "docstrings": [ - "`getCanonicalLocalesManyExn(locales)` canonicalises every locale in `locales`.\n\nThrows `RangeError` when any locale string is malformed.\n\nSee [`Intl.getCanonicalLocales`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales) on MDN.\n\n## Examples\n\n```rescript\nIntl.getCanonicalLocalesManyExn([\"EN-US\", \"fr\"]) == [\"en-US\", \"fr\"]\n```" - ], - "signature": "let getCanonicalLocalesManyExn: array => array" - }, - { - "id": "Stdlib.Intl.supportedValuesOfExn", - "kind": "value", - "name": "supportedValuesOfExn", - "docstrings": [ - "`supportedValuesOfExn(key)` returns the list of values supported by the runtime for the feature identified by `key`.\n\nThrows `RangeError` when `key` is unsupported.\n\nSee [`Intl.supportedValuesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.supportedValuesOfExn(\"calendar\")->Array.includes(\"gregory\") == true\n```" - ], - "signature": "let supportedValuesOfExn: string => array" - } - ] - }, - "stdlib/int": { - "id": "Stdlib.Int", - "name": "Int", - "docstrings": [ - "Functions for interacting with JavaScript Number.\nSee: [`Number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)." - ], - "items": [ - { - "id": "Stdlib.Int.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an int." - ], - "signature": "type t = int" - }, - { - "id": "Stdlib.Int.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (int, int) => bool" - }, - { - "id": "Stdlib.Int.compare", - "kind": "value", - "name": "compare", - "docstrings": [], - "signature": "let compare: (int, int) => Ordering.t" - }, - { - "id": "Stdlib.Int.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponential: (int, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Int.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponentialWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toFixed", - "kind": "value", - "name": "toFixed", - "docstrings": [ - "`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixed: (int, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Int.toFixedWithPrecision", - "kind": "value", - "name": "toFixedWithPrecision", - "docstrings": [ - "`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixedWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecision: (int, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Int.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecisionWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." - ], - "signature": "let toString: (int, ~radix: int=?) => string" - }, - { - "id": "Stdlib.Int.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." - ], - "signature": "let toStringWithRadix: (int, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```" - ], - "signature": "let toLocaleString: int => string" - }, - { - "id": "Stdlib.Int.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [ - "`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```" - ], - "signature": "let toFloat: int => float" - }, - { - "id": "Stdlib.Int.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "`fromFloat(n)` return an `int` representing the given value. The conversion is\ndone by truncating the decimal part.\n\n## Examples\n\n```rescript\nInt.fromFloat(2.0) == 2\nInt.fromFloat(1.999) == 1\nInt.fromFloat(1.5) == 1\nInt.fromFloat(0.9999) == 0\n```" - ], - "signature": "let fromFloat: float => int" - }, - { - "id": "Stdlib.Int.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(str)` return an `option` representing the given value\n`str`. Hexadecimal, binary and exponential notation is supported.\n\n## Examples\n\n```rescript\nInt.fromString(\"0\") == Some(0)\nInt.fromString(\"0x6\") == Some(6)\nInt.fromString(\"2.5e2\") == Some(250)\nInt.fromString(\"NaN\") == None\nInt.fromString(\"0b6\") == None\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.Int.mod", - "kind": "value", - "name": "mod", - "docstrings": [ - "`mod(n1, n2)` calculates the modulo (remainder after division) of two integers.\n\n## Examples\n\n```rescript\nInt.mod(7, 4) == 3\n```" - ], - "signature": "let mod: (int, int) => int" - }, - { - "id": "Stdlib.Int.rangeOptions", - "kind": "type", - "name": "rangeOptions", - "docstrings": [ - "The options for `range`." - ], - "signature": "type rangeOptions = {step?: int, inclusive?: bool}" - }, - { - "id": "Stdlib.Int.range", - "kind": "value", - "name": "range", - "docstrings": [ - "`range(start, end, ~options=?)` returns an int array of the sequence of integers in the\nrange `[start, end)`. That is, including `start` but excluding `end`.\n\nIf `step` is not set and `start < end`, the sequence will be increasing in steps of 1.\n\nIf `step` is not set and `start > end`, the sequence will be decreasing in steps of -1.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nthrown as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.range(3, 6) == [3, 4, 5]\nInt.range(-3, -1) == [-3, -2]\nInt.range(3, 1) == [3, 2]\nInt.range(3, 7, ~options={step: 2}) == [3, 5]\nInt.range(3, 7, ~options={step: 2, inclusive: true}) == [3, 5, 7]\nInt.range(3, 6, ~options={step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`." - ], - "signature": "let range: (int, int, ~options: rangeOptions=?) => array" - }, - { - "id": "Stdlib.Int.rangeWithOptions", - "kind": "value", - "name": "rangeWithOptions", - "docstrings": [ - "`rangeWithOptions(start, end, options)` is like `range`, but with `step` and\n`inclusive` options configurable.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nraised as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.rangeWithOptions(3, 7, {step: 2}) == [3, 5]\nInt.rangeWithOptions(3, 7, {step: 2, inclusive: true}) == [3, 5, 7]\nInt.rangeWithOptions(3, 6, {step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`." - ], - "signature": "let rangeWithOptions: (int, int, rangeOptions) => array", - "deprecated": "" - }, - { - "id": "Stdlib.Int.clamp", - "kind": "value", - "name": "clamp", - "docstrings": [ - "`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nInt.clamp(42) == 42\nInt.clamp(42, ~min=50) == 50\nInt.clamp(42, ~max=40) == 40\nInt.clamp(42, ~min=50, ~max=40) == 50\n```" - ], - "signature": "let clamp: (~min: int=?, ~max: int=?, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseAnd", - "kind": "value", - "name": "bitwiseAnd", - "docstrings": [ - "`bitwiseAnd(n1, n2)` calculates the bitwise AND of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseAnd(7, 4) == 4\n```" - ], - "signature": "let bitwiseAnd: (int, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseOr", - "kind": "value", - "name": "bitwiseOr", - "docstrings": [ - "`bitwiseOr(n1, n2)` calculates the bitwise OR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseOr(7, 4) == 7\n```" - ], - "signature": "let bitwiseOr: (int, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseXor", - "kind": "value", - "name": "bitwiseXor", - "docstrings": [ - "`bigwiseXor(n1, n2)` calculates the bitwise XOR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseXor(7, 4) == 3\n```" - ], - "signature": "let bitwiseXor: (int, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseNot", - "kind": "value", - "name": "bitwiseNot", - "docstrings": [ - "`bitwiseNot(n)` calculates the bitwise NOT of an integer.\n\n## Examples\n\n```rescript\nInt.bitwiseNot(2) == -3\n```" - ], - "signature": "let bitwiseNot: int => int" - }, - { - "id": "Stdlib.Int.shiftLeft", - "kind": "value", - "name": "shiftLeft", - "docstrings": [ - "`shiftLeft(n, length)` calculates the shifted value of an integer `n` by `length` bits to the left.\n\n## Examples\n\n```rescript\nInt.shiftLeft(4, 1) == 8\n```" - ], - "signature": "let shiftLeft: (int, int) => int" - }, - { - "id": "Stdlib.Int.shiftRight", - "kind": "value", - "name": "shiftRight", - "docstrings": [ - "`shiftRight(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\n\nAlso known as \"arithmetic right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRight(8, 1) == 4\n```" - ], - "signature": "let shiftRight: (int, int) => int" - }, - { - "id": "Stdlib.Int.shiftRightUnsigned", - "kind": "value", - "name": "shiftRightUnsigned", - "docstrings": [ - "`shiftRightUnsigned(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\nExcess bits shifted off to the right are discarded, and zero bits are shifted in from the left.\n\nAlso known as \"zero-filling right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRightUnsigned(4, 1) == 2\n```" - ], - "signature": "let shiftRightUnsigned: (int, int) => int" - }, - { - "id": "Stdlib.Int.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(int)` ignores the provided int and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: int => unit" - } - ] - }, - "stdlib/float": { - "id": "Stdlib.Float", - "name": "Float", - "docstrings": [ - "Functions for interacting with float." - ], - "items": [ - { - "id": "Stdlib.Float.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a float." - ], - "signature": "type t = float" - }, - { - "id": "Stdlib.Float.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "Checks if two floating point numbers are equal.\n\n## Examples\n```rescript\nFloat.equal(1.0, 1.0) == true\nFloat.equal(1.0, 2.0) == false\n```" - ], - "signature": "let equal: (float, float) => bool" - }, - { - "id": "Stdlib.Float.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "Compares two floating point numbers, returns an `Ordering.t` value.\n\n## Examples\n```rescript\nFloat.compare(1.0, 1.0) == Ordering.equal\nFloat.compare(1.0, 2.0) == Ordering.less\nFloat.compare(2.0, 1.0) == Ordering.greater\n```" - ], - "signature": "let compare: (float, float) => Ordering.t" - }, - { - "id": "Stdlib.Float.isNaN", - "kind": "value", - "name": "isNaN", - "docstrings": [ - "`isNaN(v)` tests if the given `v` is `NaN`.\nSee [`isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) on MDN.\n\n## Examples\n\n```rescript\nFloat.isNaN(3.0) // false\nFloat.isNaN(Float.Constants.nan) // true\n```" - ], - "signature": "let isNaN: float => bool" - }, - { - "id": "Stdlib.Float.isFinite", - "kind": "value", - "name": "isFinite", - "docstrings": [ - "`isFinite(v)` tests if the given `v` is finite.\nSee [`isFinite`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite) on MDN.\n\n## Examples\n\n```rescript\nFloat.isFinite(1.0) == true\nFloat.isFinite(Float.Constants.nan) == false\nFloat.isFinite(Float.Constants.positiveInfinity) == false\n```" - ], - "signature": "let isFinite: float => bool" - }, - { - "id": "Stdlib.Float.parseFloat", - "kind": "value", - "name": "parseFloat", - "docstrings": [ - "`parseFloat(v)` parse the given `v` and returns a float. Leading whitespace in\n`v` is ignored. Returns `NaN` if `v` can't be parsed. Use \\[`fromString`\\] to\nensure it returns a valid float and not `NaN`.\nSee [`parseFloat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseFloat(\"1.0\") == 1.0\nFloat.parseFloat(\" 3.14 \") == 3.14\nFloat.parseFloat(\"3.0\") == 3.0\nFloat.parseFloat(\"3.14some non-digit characters\") == 3.14\nFloat.parseFloat(\"error\")->Float.isNaN == true\n```" - ], - "signature": "let parseFloat: string => float" - }, - { - "id": "Stdlib.Float.parseInt", - "kind": "value", - "name": "parseInt", - "docstrings": [ - "`parseInt(v, ~radix=?)` parse the given `v` and returns a float. Leading\nwhitespace in this argument `v`is ignored. `radix` specifies the radix base to\nuse for the formatted number. The value must be in the range \\[2, 36\\] (inclusive).\nReturns `NaN` if `v` can't be parsed and `radix` is smaller than 2 or bigger\nthan 36.\nSee [`parseInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseInt(\"1.0\") == 1.0\nFloat.parseInt(\" 3.14 \") == 3.0\nFloat.parseInt(3) == 3.0\nFloat.parseInt(\"3.14some non-digit characters\") == 3.0\nFloat.parseInt(\"error\")->Float.isNaN == true\nFloat.parseInt(\"10.0\", ~radix=2) == 2.0\nFloat.parseInt(\"15 * 3\", ~radix=10) == 15.0\nFloat.parseInt(\"12\", ~radix=13) == 15.0\nFloat.parseInt(\"17\", ~radix=40)->Float.isNaN == true\n```" - ], - "signature": "let parseInt: ('a, ~radix: int=?) => float" - }, - { - "id": "Stdlib.Float.parseIntWithRadix", - "kind": "value", - "name": "parseIntWithRadix", - "docstrings": [ - "`parseIntWithRadix(v, ~radix)` parse the given `v` and returns a float. Leading\nwhitespace in this argument `v`is ignored. `radix` specifies the radix base to\nuse for the formatted number. The value must be in the range \\[2, 36\\] (inclusive).\nReturns `NaN` if `v` can't be parsed and `radix` is smaller than 2 or bigger\nthan 36.\nSee [`parseInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseIntWithRadix(\"10.0\", ~radix=2) == 2.0\nFloat.parseIntWithRadix(\"15 * 3\", ~radix=10) == 15.0\nFloat.parseIntWithRadix(\"12\", ~radix=13) == 15.0\nFloat.parseIntWithRadix(\"17\", ~radix=40)->Float.isNaN == true\n```" - ], - "signature": "let parseIntWithRadix: ('a, ~radix: int) => float", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "`toExponential(v, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponential(1000.0) == \"1e+3\"\nFloat.toExponential(-1000.0) == \"-1e+3\"\nFloat.toExponential(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponential(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponential: (float, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Float.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "`toExponential(v, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponentialWithPrecision(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponentialWithPrecision(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponentialWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toFixed", - "kind": "value", - "name": "toFixed", - "docstrings": [ - "`toFixed(v, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixed(123456.0) == \"123456\"\nFloat.toFixed(10.0) == \"10\"\nFloat.toFixed(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixed(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixed: (float, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Float.toFixedWithPrecision", - "kind": "value", - "name": "toFixedWithPrecision", - "docstrings": [ - "`toFixedWithPrecision(v, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixedWithPrecision(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixedWithPrecision(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixedWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "`toPrecision(v, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecision(100.0) == \"100\"\nFloat.toPrecision(1.0) == \"1\"\nFloat.toPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecision: (float, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Float.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "`toPrecisionWithPrecision(v, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecisionWithPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecisionWithPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecisionWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(v)` return a `string` representing the given value.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toString(1000.0) == \"1000\"\nFloat.toString(-1000.0) == \"-1000\"\n```" - ], - "signature": "let toString: (float, ~radix: int=?) => string" - }, - { - "id": "Stdlib.Float.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "`toStringWithRadix(v, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toStringWithRadix(6.0, ~radix=2) == \"110\"\nFloat.toStringWithRadix(3735928559.0, ~radix=16) == \"deadbeef\"\nFloat.toStringWithRadix(123456.0, ~radix=36) == \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." - ], - "signature": "let toStringWithRadix: (float, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(v)` return a `string` with language-sensitive representing the\ngiven value.\nSee [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nFloat.toLocaleString(1000.0) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nFloat.toLocaleString(1000.0) // \"1.000\"\n```" - ], - "signature": "let toLocaleString: float => string" - }, - { - "id": "Stdlib.Float.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(str)` return an `option` representing the given value `str`.\n\n## Examples\n\n```rescript\nFloat.fromString(\"0\") == Some(0.0)\nFloat.fromString(\"NaN\") == None\nFloat.fromString(\"6\") == Some(6.0)\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.Float.toInt", - "kind": "value", - "name": "toInt", - "docstrings": [ - "`toInt(v)` returns an int to given float `v`.\n\n## Examples\n\n```rescript\nFloat.toInt(2.0) == 2\nFloat.toInt(1.0) == 1\nFloat.toInt(1.1) == 1\nFloat.toInt(1.6) == 1\n```" - ], - "signature": "let toInt: float => int" - }, - { - "id": "Stdlib.Float.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "`fromInt(v)` returns a float to given int `v`.\n\n## Examples\n\n```rescript\nFloat.fromInt(2) == 2.0\nFloat.fromInt(1) == 1.0\n```" - ], - "signature": "let fromInt: int => float" - }, - { - "id": "Stdlib.Float.mod", - "kind": "value", - "name": "mod", - "docstrings": [ - "`mod(n1, n2)` calculates the modulo (remainder after division) of two floats.\n\n## Examples\n\n```rescript\nFloat.mod(7.0, 4.0) == 3.0\n```" - ], - "signature": "let mod: (float, float) => float" - }, - { - "id": "Stdlib.Float.clamp", - "kind": "value", - "name": "clamp", - "docstrings": [ - "`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nFloat.clamp(4.2) == 4.2\nFloat.clamp(4.2, ~min=4.3) == 4.3\nFloat.clamp(4.2, ~max=4.1) == 4.1\nFloat.clamp(4.2, ~min=4.3, ~max=4.1) == 4.3\n```" - ], - "signature": "let clamp: (~min: float=?, ~max: float=?, float) => float" - }, - { - "id": "Stdlib.Float.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(float)` ignores the provided float and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: float => unit" - } - ] - }, - "stdlib/error": { - "id": "Stdlib.Error", - "name": "Error", - "docstrings": [ - "Functions for working with JavaScript exceptions.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) on MDN." - ], - "items": [ - { - "id": "Stdlib.Error.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JavaScript exception." - ], - "signature": "type t = Exn.t", - "deprecated": "" - }, - { - "id": "Stdlib.Error.fromException", - "kind": "value", - "name": "fromException", - "docstrings": [], - "signature": "let fromException: exn => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.toException", - "kind": "value", - "name": "toException", - "docstrings": [ - "Turns an `Error.t` into an `exn`.\n\n## Examples\n```rescript\nlet error = Error.make(\"Something went wrong.\")\n\nlet asExn = error->Error.toException // `asExn` is now type `exn`\n```" - ], - "signature": "let toException: t => exn", - "deprecated": "Use functions from `JsExn` instead" - }, - { - "id": "Stdlib.Error.stack", - "kind": "value", - "name": "stack", - "docstrings": [ - "`stack(error)` retrieves the `stack` property of the error, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\nlet error = Error.make(\"error\")\nConsole.log(error->Error.stack) // Logs `stack` if it exists on `someError`\n```" - ], - "signature": "let stack: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.message", - "kind": "value", - "name": "message", - "docstrings": [ - "`message(error)` retrieves the `message` property of the error, if it exists.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\nlet error = Error.SyntaxError.make(\"Some message here\")\nConsole.log(error->Error.message) // Logs \"Some message here\" to the console\n```" - ], - "signature": "let message: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.name", - "kind": "value", - "name": "name", - "docstrings": [ - "`name(error)` retrieves the `name` property of the error, if it exists.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\nlet error = Error.SyntaxError.make(\"Some message here\")\nConsole.log(error->Error.name) // Logs \"SyntaxError\" to the console\n```" - ], - "signature": "let name: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [ - "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." - ], - "signature": "let fileName: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(message)` creates a new error, setting its `message` to the provided value.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error) on MDN.\n\n## Example\n```rescript\nlet error = Error.make(\"Some message here\")\nConsole.log(error->Error.message) // Logs \"Some message here\" to the console\nConsole.log(error->Error.name) // Logs \"Error\" to the console, because this is a regular error\n```" - ], - "signature": "let make: string => t", - "deprecated": "" - }, - { - "id": "Stdlib.Error.raise", - "kind": "value", - "name": "raise", - "docstrings": [ - "Raises (throws in JavaScript language) the provided `Error.t`, which will stop execution.\n\n## Examples\n```rescript\nlet error = Error.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n error->Error.raise\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" - ], - "signature": "let raise: t => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Error.throw", - "kind": "value", - "name": "throw", - "docstrings": [ - "Throws the given exception, terminating execution unless caught by a surrounding try/catch block.\n\n## Examples\n\n```rescript\nlet error = Error.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n Error.throw(error)\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" - ], - "signature": "let throw: t => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Error.panic", - "kind": "value", - "name": "panic", - "docstrings": [ - "Throws a panic exception with the given message.\n\nA panic exception is a native JavaScript exception that is not intended to be caught and\nhandled. Compared to a ReScript exception this will give a better stack trace and\ndebugging experience.\n\n## Examples\n\n```rescript\ntry {\n Error.panic(\"Uh oh. This was unexpected!\")\n} catch {\n| Exn.Error(obj) =>\n switch Exn.message(obj) {\n | Some(m) => assert(m == \"Panic! Uh oh. This was unexpected!\")\n | None => assert(false)\n }\n| _ => assert(false)\n}\n```" - ], - "signature": "let panic: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Error.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(error)` ignores the provided error and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit", - "deprecated": "" - } - ] - }, - "stdlib/exn": { - "id": "Stdlib.Exn", - "name": "Exn", - "docstrings": [ - "Provide utilities for dealing with JS exceptions." - ], - "items": [ - { - "id": "Stdlib.Exn.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Represents a JS exception" - ], - "signature": "type t", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.asJsExn", - "kind": "value", - "name": "asJsExn", - "docstrings": [], - "signature": "let asJsExn: exn => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.stack", - "kind": "value", - "name": "stack", - "docstrings": [], - "signature": "let stack: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.message", - "kind": "value", - "name": "message", - "docstrings": [], - "signature": "let message: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.name", - "kind": "value", - "name": "name", - "docstrings": [], - "signature": "let name: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [], - "signature": "let fileName: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.anyToExnInternal", - "kind": "value", - "name": "anyToExnInternal", - "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a Exn.Error if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." - ], - "signature": "let anyToExnInternal: 'a => exn", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseError", - "kind": "value", - "name": "raiseError", - "docstrings": [ - "Raise Js exception Error object with stacktrace" - ], - "signature": "let raiseError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseEvalError", - "kind": "value", - "name": "raiseEvalError", - "docstrings": [], - "signature": "let raiseEvalError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseRangeError", - "kind": "value", - "name": "raiseRangeError", - "docstrings": [], - "signature": "let raiseRangeError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseReferenceError", - "kind": "value", - "name": "raiseReferenceError", - "docstrings": [], - "signature": "let raiseReferenceError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseSyntaxError", - "kind": "value", - "name": "raiseSyntaxError", - "docstrings": [], - "signature": "let raiseSyntaxError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseTypeError", - "kind": "value", - "name": "raiseTypeError", - "docstrings": [], - "signature": "let raiseTypeError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseUriError", - "kind": "value", - "name": "raiseUriError", - "docstrings": [], - "signature": "let raiseUriError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(exn)` ignores the provided exn and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit", - "deprecated": "" - } - ] - }, - "stdlib/dict": { - "id": "Stdlib.Dict", - "name": "Dict", - "docstrings": [ - "A mutable dictionary with string keys.\n\nCompiles to a regular JavaScript object." - ], - "items": [ - { - "id": "Stdlib.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a dictionary of value `'a`." - ], - "signature": "type t<'a> = dict<'a>" - }, - { - "id": "Stdlib.Dict.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(dict, key)` Returns the `value` at the provided `key`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `key` does not exist in `dict`.\n\nUse `Dict.getUnsafe` only when you are sure the key exists (i.e. when iterating `Dict.keys` result).\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\nlet value = dict->Dict.getUnsafe(\"key1\")\nConsole.log(value) // value1\n```" - ], - "signature": "let getUnsafe: (dict<'a>, string) => 'a" - }, - { - "id": "Stdlib.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the value at the provided key, if it exists. Returns an option.\n\n## Examples\n```rescript\nlet dict = dict{\"someKey\": \"someValue\"}\n\nswitch dict->Dict.get(\"someKey\") {\n| None => Console.log(\"Nope, didn't have the key.\")\n| Some(value) => Console.log(value)\n}\n```\n\n## Alternative: Pattern Matching with `dict{}`\n\nFor nested dictionary access, consider using the more concise `dict{}` pattern matching syntax:\n\n```rescript\n// More concise approach using pattern matching\nlet decodeImageUrl = (json: JSON.t) => {\n switch json {\n | JSON.Object(dict{\"data\": JSON.Object(dict{\"image_url\": JSON.String(url)})}) => Some(url)\n | _ => None\n }\n}\n\n// Alternative using Dict.get\nlet decodeImageUrl = (json: JSON.t) => {\n switch json {\n | JSON.Object(obj) =>\n switch Dict.get(obj, \"data\") {\n | Some(JSON.Object(data)) =>\n switch Dict.get(data, \"image_url\") {\n | Some(JSON.String(url)) => Some(url)\n | _ => None\n }\n | _ => None\n }\n | _ => None\n }\n}\n```" - ], - "signature": "let get: (dict<'a>, string) => option<'a>" - }, - { - "id": "Stdlib.Dict.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(dictionary, key, value)` sets the value at the provided key to the provided value.\n\n## Examples\n```rescript\nlet dict = Dict.make()\n\ndict->Dict.set(\"someKey\", \"someValue\")\n```" - ], - "signature": "let set: (dict<'a>, string, 'a) => unit" - }, - { - "id": "Stdlib.Dict.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "`delete(dictionary, key)` deletes the value at `key`, if it exists.\n\n## Examples\n```rescript\nlet dict = dict{\"someKey\": \"someValue\"}\n\ndict->Dict.delete(\"someKey\")\n```" - ], - "signature": "let delete: (dict<'a>, string) => unit" - }, - { - "id": "Stdlib.Dict.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make()` creates a new, empty dictionary.\n\n## Examples\n```rescript\nlet dict1: dict = Dict.make() // You can annotate the type of the values of your dict yourself if you want\n\nlet dict2 = Dict.make() // Or you can let ReScript infer it via usage.\ndict2->Dict.set(\"someKey\", 12)\n```" - ], - "signature": "let make: unit => dict<'a>" - }, - { - "id": "Stdlib.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(entries)` creates a new dictionary from the provided array of key/value pairs.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([(\"key1\", \"value1\"), (\"key2\", \"value2\")])\n```" - ], - "signature": "let fromArray: array<(string, 'a)> => dict<'a>" - }, - { - "id": "Stdlib.Dict.fromIterable", - "kind": "value", - "name": "fromIterable", - "docstrings": [ - "`fromIterable(entries)` creates a new dictionary from the provided iterable of key/value pairs.\n\n## Examples\n\n```rescript\nlet iterable: Iterable.t<(string, int)> = [(\"first\", 1), (\"second\", 2)]->Array.asIterable\niterable\n->Dict.fromIterable\n->Dict.valuesToArray == [1, 2]\n```" - ], - "signature": "let fromIterable: Iterable.t<(string, 'a)> => dict<'a>" - }, - { - "id": "Stdlib.Dict.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(dictionary)` returns an array of all the key/value pairs of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet asArray = dict->Dict.toArray\nConsole.log(asArray) // Logs `[[\"someKey\", 1], [\"someKey2\", 2]]` to the console\n```" - ], - "signature": "let toArray: dict<'a> => array<(string, 'a)>" - }, - { - "id": "Stdlib.Dict.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "`keysToArray(dictionary)` returns an array of all the keys of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet keys = dict->Dict.keysToArray\nConsole.log(keys) // Logs `[\"someKey\", \"someKey2\"]` to the console\n```" - ], - "signature": "let keysToArray: dict<'a> => array" - }, - { - "id": "Stdlib.Dict.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(dictionary)` returns the number of key/value pairs in the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.size->assertEqual(0)\n\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\ndict->Dict.size->assertEqual(2)\n\n// After deleting a key\ndict->Dict.delete(\"someKey\")\ndict->Dict.size->assertEqual(1)\n```" - ], - "signature": "let size: dict<'a> => int" - }, - { - "id": "Stdlib.Dict.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(dictionary)` returns `true` if the dictionary is empty (has no key/value pairs), `false` otherwise.\n\n## Examples\n```rescript\nlet emptyDict = Dict.make()\nemptyDict->Dict.isEmpty->assertEqual(true)\n\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.isEmpty->assertEqual(false)\n\n// After clearing all keys\ndict->Dict.delete(\"someKey\")\ndict->Dict.isEmpty->assertEqual(true)\n```" - ], - "signature": "let isEmpty: dict<'a> => bool" - }, - { - "id": "Stdlib.Dict.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [ - "`valuesToArray(dictionary)` returns an array of all the values of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet values = dict->Dict.valuesToArray\nConsole.log(values) // Logs `[1, 2]` to the console\n```" - ], - "signature": "let valuesToArray: dict<'a> => array<'a>" - }, - { - "id": "Stdlib.Dict.assign", - "kind": "value", - "name": "assign", - "docstrings": [ - "`assign(dictionary1, dictionary2)` [shallowly](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) merges dictionary2 into dictionary1, and returns dictionary1.\n\nBeware this will *mutate* dictionary1. If you're looking for a fresh merged dictionary instead, check out `Dict.concat`.\n\n## Examples\n```rescript\nlet dict1 = Dict.make()\ndict1->Dict.set(\"firstKey\", 1)\nConsole.log(dict1->Dict.keysToArray) // Logs `[\"firstKey\"]`\n\nlet dict2 = Dict.make()\ndict2->Dict.set(\"someKey\", 2)\ndict2->Dict.set(\"someKey2\", 3)\n\nlet dict1 = dict1->Dict.assign(dict2)\n\nConsole.log(dict1->Dict.keysToArray) // Logs `[\"firstKey\", \"someKey\", \"someKey2\"]`\n```" - ], - "signature": "let assign: (dict<'a>, dict<'a>) => dict<'a>" - }, - { - "id": "Stdlib.Dict.assignMany", - "kind": "value", - "name": "assignMany", - "docstrings": [ - "`assignMany(target, sources)` [shallowly](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) merges each dictionary in `sources` into `target`, and returns `target`.\n\nBeware this will *mutate* `target`. Later dictionaries overwrite earlier ones. If you're looking for a fresh merged dictionary instead, check out `Dict.concatMany`.\n\n## Examples\n```rescript\nlet target = dict{\"firstKey\": 1}\nlet result = target->Dict.assignMany([\n dict{\"someKey\": 2},\n dict{\"someKey\": 3, \"someKey2\": 4},\n])\n\nresult == dict{\"firstKey\": 1, \"someKey\": 3, \"someKey2\": 4}\n(result === target) == true\n```" - ], - "signature": "let assignMany: (dict<'a>, array>) => dict<'a>" - }, - { - "id": "Stdlib.Dict.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(dictionary1, dictionary2)` [shallowly](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) merges `dictionary1` and `dictionary2` into a fresh dictionary, and returns the new dictionary.\n\nNeither input dictionary is mutated. If both dictionaries contain the same key, the value from `dictionary2` overwrites the one from `dictionary1`.\n\n## Examples\n```rescript\nlet dict1 = dict{\"firstKey\": 1}\nlet dict2 = dict{\"firstKey\": 2, \"someKey\": 3}\n\nlet merged = dict1->Dict.concat(dict2)\n\ndict1 == dict{\"firstKey\": 1}\nmerged == dict{\"firstKey\": 2, \"someKey\": 3}\n(merged === dict1) == false\n```" - ], - "signature": "let concat: (dict<'a>, dict<'a>) => dict<'a>" - }, - { - "id": "Stdlib.Dict.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(target, sources)` [shallowly](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) merges `target` and each dictionary in `sources` into a fresh dictionary, and returns the new dictionary.\n\nNeither `target` nor any dictionary in `sources` is mutated. Later dictionaries overwrite earlier ones when they contain the same key.\n\n## Examples\n```rescript\nlet target = dict{\"firstKey\": 1}\nlet merged = target->Dict.concatMany([\n dict{\"someKey\": 2},\n dict{\"someKey\": 3, \"someKey2\": 4},\n])\n\ntarget == dict{\"firstKey\": 1}\nmerged == dict{\"firstKey\": 1, \"someKey\": 3, \"someKey2\": 4}\n(merged === target) == false\n```" - ], - "signature": "let concatMany: (dict<'a>, array>) => dict<'a>" - }, - { - "id": "Stdlib.Dict.concatAll", - "kind": "value", - "name": "concatAll", - "docstrings": [ - "`concatAll(dictionaries)` [shallowly](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) merges all dictionaries in `dictionaries` into a fresh dictionary, and returns the new dictionary.\n\nNone of the input dictionaries are mutated. Later dictionaries overwrite earlier ones when they contain the same key. If `dictionaries` is empty, an empty dictionary is returned.\n\n## Examples\n```rescript\nlet dict1 = dict{\"firstKey\": 1}\nlet dict2 = dict{\"someKey\": 2}\nlet dict3 = dict{\"someKey\": 3, \"someKey2\": 4}\n\nlet merged = Dict.concatAll([dict1, dict2, dict3])\n\ndict1 == dict{\"firstKey\": 1}\nmerged == dict{\"firstKey\": 1, \"someKey\": 3, \"someKey2\": 4}\n(merged === dict1) == false\n```" - ], - "signature": "let concatAll: array> => dict<'a>" - }, - { - "id": "Stdlib.Dict.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(dictionary)` [shallowly copies](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) the provided dictionary to a new dictionary.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\nlet dict2 = dict->Dict.copy\n\n// Both log `[\"key1\", \"key2\"]` here.\nConsole.log2(dict->Dict.keysToArray, dict2->Dict.keysToArray)\n```" - ], - "signature": "let copy: dict<'a> => dict<'a>" - }, - { - "id": "Stdlib.Dict.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(dictionary, f)` iterates through all values of the dict.\n\n> Please note that this is *without the keys*, just the values. If you need the key as well, use `Dict.forEachWithKey`.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\n\ndict->Dict.forEach(value => {\n Console.log(value)\n})\n```" - ], - "signature": "let forEach: (dict<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Dict.forEachWithKey", - "kind": "value", - "name": "forEachWithKey", - "docstrings": [ - "`forEachWithKey(dictionary, f)` iterates through all values of the dict, including the key for each value.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\n\ndict->Dict.forEachWithKey((value, key) => {\n Console.log2(value, key)\n})\n```" - ], - "signature": "let forEachWithKey: (dict<'a>, ('a, string) => unit) => unit" - }, - { - "id": "Stdlib.Dict.mapValues", - "kind": "value", - "name": "mapValues", - "docstrings": [ - "`mapValues(dictionary, f)` returns a new dictionary with the same keys, and `f` applied to each value in the original dictionary.\n\n## Examples\n\n```rescript\nlet dict = dict{\"key1\": 1, \"key2\": 2}\n\ndict->Dict.mapValues(v => v + 10)->Dict.toArray // [(\"key1\", 11), (\"key2\", 12)]\ndict->Dict.mapValues(v => Int.toString(v))->Dict.toArray // [(\"key1\", \"1\"), (\"key2\", \"2\")]\n```" - ], - "signature": "let mapValues: (dict<'a>, 'a => 'b) => dict<'b>" - }, - { - "id": "Stdlib.Dict.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(dictionary, \"key\")` returns true if the \"key\" is present in the dictionary.\n\nBe aware that it uses the JavaScript `in` operator under the hood.\n\n## Examples\n\n```rescript\nlet dict = dict{\"key1\": Some(1), \"key2\": None}\n\ndict->Dict.has(\"key1\") == true\ndict->Dict.has(\"key2\") == true\ndict->Dict.has(\"key3\") == false\ndict->Dict.has(\"toString\") == true\n```" - ], - "signature": "let has: (dict<'a>, string) => bool" - }, - { - "id": "Stdlib.Dict.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(dict)` ignores the provided dict and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: dict<'a> => unit" - } - ] - }, - "stdlib/date": { - "id": "Stdlib.Date", - "name": "Date", - "docstrings": [ - "Functions for interacting with JavaScript Dates." - ], - "items": [ - { - "id": "Stdlib.Date.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a JavaScript date." - ], - "signature": "type t" - }, - { - "id": "Stdlib.Date.msSinceEpoch", - "kind": "type", - "name": "msSinceEpoch", - "docstrings": [ - "Time, in milliseconds, since / until the UNIX epoch (January 1, 1970 00:00:00 UTC).\nPositive numbers represent dates after, negative numbers dates before epoch." - ], - "signature": "type msSinceEpoch = float" - }, - { - "id": "Stdlib.Date.localeOptions", - "kind": "type", - "name": "localeOptions", - "docstrings": [ - "A type representing date time format options.\n\nNote: There are some properties missing:\n- fractionalSecondDigits\n- dayPeriod\n- calendar\n- numberingSystem\n- localeMatcher\n- timeZone\n- hour12\n- hourCycle\n- formatMatcher\n\nSee full spec at https://tc39.es/ecma402/#datetimeformat-objects" - ], - "signature": "type localeOptions = {\n dateStyle?: [#full | #long | #medium | #short],\n timeStyle?: [#full | #long | #medium | #short],\n weekday?: [#long | #narrow | #short],\n era?: [#long | #narrow | #short],\n year?: [#\"2-digit\" | #numeric],\n month?: [\n | #\"2-digit\"\n | #long\n | #narrow\n | #numeric\n | #short\n ],\n day?: [#\"2-digit\" | #numeric],\n hour?: [#\"2-digit\" | #numeric],\n minute?: [#\"2-digit\" | #numeric],\n second?: [#\"2-digit\" | #numeric],\n timeZoneName?: [#long | #short],\n}" - }, - { - "id": "Stdlib.Date.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make()`\n\nCreates a date object with the current date time as value.\n\n## Examples\n```rescript\nDate.make()\n```" - ], - "signature": "let make: unit => t" - }, - { - "id": "Stdlib.Date.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(dateTimeString)`\n\nCreates a date object from given date time string.\nThe string has to be in the ISO 8601 format YYYY-MM-DDTHH:mm:ss.sssZ (https://tc39.es/ecma262/\\#sec-date-time-string-format).\n\nInvalid date time strings will create invalid dates.\nYou can use the result like any valid date, but many functions like `toString` will return \"Invalid Date\" or functions like `Date.getTime` will return NaN.\n\n## Examples\n```rescript\nDate.fromString(\"2023\") // 2023-01-01T00:00:00.000Z\n\nDate.fromString(\"2023-02-20\") // 2023-02-20T00:00:00.000Z\n\nDate.fromString(\"2023-02-20T16:40:00.00Z\") // 2023-02-20T16:40:00.000Z\n\nDate.fromString(\"\") // Invalid Date\n\nDate.fromString(\"\")->Date.getTime // NaN\n```" - ], - "signature": "let fromString: string => t" - }, - { - "id": "Stdlib.Date.fromTime", - "kind": "value", - "name": "fromTime", - "docstrings": [ - "`fromTime(msSinceEpoch)`\n\nCreates a date object from the given time in milliseconds since / until UNIX epoch (January 1, 1970 00:00:00 UTC).\nPositive numbers create dates after epoch, negative numbers create dates before epoch.\n\n## Examples\n```rescript\nDate.fromTime(0.0)\n// 1970-01-01T00:00:00.000Z\n\nDate.fromTime(-86_400_000.0)\n// 1969-12-31T00:00:00.000Z\n\nDate.fromTime(86_400_000.0)\n// 1970-01-02T00:00:00.000Z\n```" - ], - "signature": "let fromTime: msSinceEpoch => t" - }, - { - "id": "Stdlib.Date.makeWithYM", - "kind": "value", - "name": "makeWithYM", - "docstrings": [ - "Creates a date object with the given year and month.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYM(~year=2023, ~month=0)\n// 2023-01-01T00:00:00.000Z\n\nDate.makeWithYM(~year=2023, ~month=11)\n// 2023-12-01T00:00:00.000Z\n\nDate.makeWithYM(~year=2023, ~month=12)\n// 2024-01-01T00:00:00.000Z\n\nDate.makeWithYM(~year=2023, ~month=-1)\n// 2022-12-01T00:00:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYM: (~year: int, ~month: int) => t" - }, - { - "id": "Stdlib.Date.makeWithYMD", - "kind": "value", - "name": "makeWithYMD", - "docstrings": [ - "Creates a date object with the given year, month and date (day of month).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMD(~year=2023, ~month=1, ~day=20)\n// 2023-02-20T00:00:00.000Z\n\nDate.makeWithYMD(~year=2023, ~month=1, ~day=-1)\n// 2022-11-29T00:00:00.000Z\n\nDate.makeWithYMD(~year=2023, ~month=1, ~day=29)\n// 2023-03-01T00:00:00.000Z\n```" - ], - "signature": "let makeWithYMD: (~year: int, ~month: int, ~day: int) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDH", - "kind": "value", - "name": "makeWithYMDH", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month) and hours.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=16)\n// 2023-02-20T16:00:00.000Z\n\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=24)\n// 2023-02-21T00:00:00.000Z\n\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=-1)\n// 2023-02-19T23:00:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDH: (~year: int, ~month: int, ~day: int, ~hours: int) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDHM", - "kind": "value", - "name": "makeWithYMDHM", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours and minutes.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=60)\n// 2023-02-20T17:00:00.000Z\n\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=-1)\n// 2023-02-20T15:59:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDHM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDHMS", - "kind": "value", - "name": "makeWithYMDHMS", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours, minutes and seconds.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=60)\n// 2023-02-20T16:41:00.000Z\n\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=-1)\n// 2023-02-20T16:39:59.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDHMS: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDHMSM", - "kind": "value", - "name": "makeWithYMDHMSM", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours, minutes, seconds and milliseconds.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=0,\n)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=1000,\n)\n// 2023-02-20T16:40:01.000Z\n\nDate.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=-1,\n)\n// 2023-02-20T16:39:59.999Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDHMSM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => t" - }, - { - "id": "Stdlib.Date.now", - "kind": "value", - "name": "now", - "docstrings": [ - "`now()`\n\nReturns the time, in milliseconds, between UNIX epoch (January 1, 1970 00:00:00 UTC) and the current date time." - ], - "signature": "let now: unit => msSinceEpoch" - }, - { - "id": "Stdlib.Date.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(date1, date2)` checks if two dates represent the same point in time.\n\n## Examples\n```rescript\nDate.equal(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-01\")) == true\nDate.equal(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-02\")) == false\n```" - ], - "signature": "let equal: (t, t) => bool" - }, - { - "id": "Stdlib.Date.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(date1, date2)` compares two dates chronologically, returns an `Ordering.t` value.\n\n## Examples\n```rescript\nDate.compare(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-01\")) == Ordering.equal\nDate.compare(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-02\")) == Ordering.less\nDate.compare(Date.fromString(\"2023-01-02\"), Date.fromString(\"2023-01-01\")) == Ordering.greater\n```" - ], - "signature": "let compare: (t, t) => Ordering.t" - }, - { - "id": "Stdlib.Date.getTime", - "kind": "value", - "name": "getTime", - "docstrings": [ - "`getTime(date)`\n\nReturns the time, in milliseconds, between UNIX epoch (January 1, 1970 00:00:00 UTC) and the current date time.\nInvalid dates will return NaN.\nDates before epoch will return negative numbers.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20\")->Date.getTime\n// 1676851200000\n```" - ], - "signature": "let getTime: t => msSinceEpoch" - }, - { - "id": "Stdlib.Date.getTimezoneOffset", - "kind": "value", - "name": "getTimezoneOffset", - "docstrings": [ - "`getTimezoneOffset(date)`\n\nReturns the time in minutes between the UTC time and the locale time.\nThe timezone of the given date doesn't matter.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01\")->Date.getTimezoneOffset\n// -60 with local time zone = Europe/Berlin\n\nDate.fromString(\"2023-06-01\")->Date.getTimezoneOffset\n// -120 with local time zone = Europe/Berlin\n```" - ], - "signature": "let getTimezoneOffset: t => int" - }, - { - "id": "Stdlib.Date.getFullYear", - "kind": "value", - "name": "getFullYear", - "docstrings": [ - "`getFullYear(date)`\n\nReturns the year of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20\")->Date.getFullYear\n// 2023\n```" - ], - "signature": "let getFullYear: t => int" - }, - { - "id": "Stdlib.Date.getMonth", - "kind": "value", - "name": "getMonth", - "docstrings": [ - "`getMonth(date)`\n\nReturns the month (0-indexed) of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01\")->Date.getMonth\n// 0\n```" - ], - "signature": "let getMonth: t => int" - }, - { - "id": "Stdlib.Date.getDate", - "kind": "value", - "name": "getDate", - "docstrings": [ - "`getDate(date)`\n\nReturns the date (day of month) of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getDate\n// 20\n```" - ], - "signature": "let getDate: t => int" - }, - { - "id": "Stdlib.Date.getHours", - "kind": "value", - "name": "getHours", - "docstrings": [ - "`getHours(date)`\n\nReturns the hours of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getHours\n// 16\n```" - ], - "signature": "let getHours: t => int" - }, - { - "id": "Stdlib.Date.getMinutes", - "kind": "value", - "name": "getMinutes", - "docstrings": [ - "`getMinutes(date)`\n\nReturns the minutes of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getMinutes\n// 40\n```" - ], - "signature": "let getMinutes: t => int" - }, - { - "id": "Stdlib.Date.getSeconds", - "kind": "value", - "name": "getSeconds", - "docstrings": [ - "`getSeconds(date)`\n\nReturns the seconds of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getSeconds\n// 0\n```" - ], - "signature": "let getSeconds: t => int" - }, - { - "id": "Stdlib.Date.getMilliseconds", - "kind": "value", - "name": "getMilliseconds", - "docstrings": [ - "`getMilliseconds(date)`\n\nReturns the milliseconds of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getMilliseconds\n// 0\n```" - ], - "signature": "let getMilliseconds: t => int" - }, - { - "id": "Stdlib.Date.getDay", - "kind": "value", - "name": "getDay", - "docstrings": [ - "`getDay(date)`\n\nReturns the day of week of a given date (according to local time).\n0 = Sunday, 1 = Monday, ... 6 = Saturday\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getDay\n// 1\n```" - ], - "signature": "let getDay: t => int" - }, - { - "id": "Stdlib.Date.setFullYear", - "kind": "value", - "name": "setFullYear", - "docstrings": [ - "`setFullYear(date, year)`\n\nSets the year of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYear(2024)\n```" - ], - "signature": "let setFullYear: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setFullYearM", - "kind": "value", - "name": "setFullYearM", - "docstrings": [ - "`setFullYearM(date, ~year, ~month)`\n\nSets the year and month of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYearM(~year=2024, ~month=0)\n```" - ], - "signature": "let setFullYearM: (t, ~year: int, ~month: int) => unit" - }, - { - "id": "Stdlib.Date.setFullYearMD", - "kind": "value", - "name": "setFullYearMD", - "docstrings": [ - "`setFullYearMD(date, ~year, ~month, ~day)`\n\nSets the year, month and date (day of month) of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYearMD(~year=2024, ~month=0, ~day=1)\n```" - ], - "signature": "let setFullYearMD: (t, ~year: int, ~month: int, ~day: int) => unit" - }, - { - "id": "Stdlib.Date.setMonth", - "kind": "value", - "name": "setMonth", - "docstrings": [ - "`setMonth(date, month)`\n\nSets the month of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMonth(0)\n```" - ], - "signature": "let setMonth: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setDate", - "kind": "value", - "name": "setDate", - "docstrings": [ - "`setDate(date, day)`\n\nSets the date (day of month) of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setDate(1)\n```" - ], - "signature": "let setDate: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setHours", - "kind": "value", - "name": "setHours", - "docstrings": [ - "`setHours(date, hours)`\n\nSets the hours of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHours(0)\n```" - ], - "signature": "let setHours: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setHoursM", - "kind": "value", - "name": "setHoursM", - "docstrings": [ - "`setHoursM(date, ~hours, ~minutes)`\n\nSets the hours and minutes of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHoursM(~hours=0, ~minutes=0)\n```" - ], - "signature": "let setHoursM: (t, ~hours: int, ~minutes: int) => unit" - }, - { - "id": "Stdlib.Date.setHoursMS", - "kind": "value", - "name": "setHoursMS", - "docstrings": [ - "`setHoursMS(date, ~hours, ~minutes, ~seconds)`\n\nSets the hours, minutes and seconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHoursMS(~hours=0, ~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setHoursMS: (t, ~hours: int, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setHoursMSMs", - "kind": "value", - "name": "setHoursMSMs", - "docstrings": [ - "`setHoursMSMs(date, ~hours, ~minutes, ~seconds, ~milliseconds)`\n\nSets the hours, minutes, seconds and milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHoursMSMs(\n ~hours=0,\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setHoursMSMs: (\n t,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setMinutes", - "kind": "value", - "name": "setMinutes", - "docstrings": [ - "`setMinutes(date, minutes)`\n\nSets the minutes of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMinutes(0)\n```" - ], - "signature": "let setMinutes: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setMinutesS", - "kind": "value", - "name": "setMinutesS", - "docstrings": [ - "`setMinutesS(date, ~minutes, ~seconds)`\n\nSets the minutes and seconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMinutesS(~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setMinutesS: (t, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setMinutesSMs", - "kind": "value", - "name": "setMinutesSMs", - "docstrings": [ - "`setMinutesSMs(date, ~minutes, ~seconds, ~milliseconds)`\n\nSets the minutes, seconds and milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMinutesSMs(\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setMinutesSMs: (\n t,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setSeconds", - "kind": "value", - "name": "setSeconds", - "docstrings": [ - "`setSeconds(date, seconds)`\n\nSets the seconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setSeconds(0)\n```" - ], - "signature": "let setSeconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setSecondsMs", - "kind": "value", - "name": "setSecondsMs", - "docstrings": [ - "`setSecondsMs(date, ~seconds, ~milliseconds)`\n\nSets the seconds and milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setSecondsMs(~seconds=0, ~milliseconds=0)\n```" - ], - "signature": "let setSecondsMs: (t, ~seconds: int, ~milliseconds: int) => unit" - }, - { - "id": "Stdlib.Date.setMilliseconds", - "kind": "value", - "name": "setMilliseconds", - "docstrings": [ - "`setMilliseconds(date, milliseconds)`\n\nSets the milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMilliseconds(0)\n```" - ], - "signature": "let setMilliseconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.getUTCFullYear", - "kind": "value", - "name": "getUTCFullYear", - "docstrings": [ - "`getUTCFullYear(date)`\n\nReturns the year of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCFullYear // 2022\n```" - ], - "signature": "let getUTCFullYear: t => int" - }, - { - "id": "Stdlib.Date.getUTCMonth", - "kind": "value", - "name": "getUTCMonth", - "docstrings": [ - "`getUTCMonth(date)`\n\nReturns the month of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCMonth // 11\n```" - ], - "signature": "let getUTCMonth: t => int" - }, - { - "id": "Stdlib.Date.getUTCDate", - "kind": "value", - "name": "getUTCDate", - "docstrings": [ - "`getUTCDate(date)`\n\nReturns the date (day of month) of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCDate // 31\n```" - ], - "signature": "let getUTCDate: t => int" - }, - { - "id": "Stdlib.Date.getUTCHours", - "kind": "value", - "name": "getUTCHours", - "docstrings": [ - "`getUTCHours(date)`\n\nReturns the hours of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCHours // 23\n```" - ], - "signature": "let getUTCHours: t => int" - }, - { - "id": "Stdlib.Date.getUTCMinutes", - "kind": "value", - "name": "getUTCMinutes", - "docstrings": [ - "`getUTCMinutes(date)`\n\nReturns the minutes of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCMinutes // 0\n```" - ], - "signature": "let getUTCMinutes: t => int" - }, - { - "id": "Stdlib.Date.getUTCSeconds", - "kind": "value", - "name": "getUTCSeconds", - "docstrings": [ - "`getUTCSeconds(date)`\n\nReturns the seconds of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCSeconds // 0\n```" - ], - "signature": "let getUTCSeconds: t => int" - }, - { - "id": "Stdlib.Date.getUTCMilliseconds", - "kind": "value", - "name": "getUTCMilliseconds", - "docstrings": [ - "`getUTCMilliseconds(date)`\n\nReturns the milliseconds of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCMilliseconds // 0\n```" - ], - "signature": "let getUTCMilliseconds: t => int" - }, - { - "id": "Stdlib.Date.getUTCDay", - "kind": "value", - "name": "getUTCDay", - "docstrings": [ - "`getUTCDay(date)`\n\nReturns the day (day of week) of a given date (according to UTC time).\n0 = Sunday, 1 = Monday, ... 6 = Saturday\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCDay // 6\n```" - ], - "signature": "let getUTCDay: t => int" - }, - { - "id": "Stdlib.Date.setUTCFullYear", - "kind": "value", - "name": "setUTCFullYear", - "docstrings": [ - "`setUTCFullYear(date, year)`\n\nSets the year of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYear(2024)\n```" - ], - "signature": "let setUTCFullYear: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCFullYearM", - "kind": "value", - "name": "setUTCFullYearM", - "docstrings": [ - "`setUTCFullYearM(date, ~year, ~month)`\n\nSets the year and month of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYearM(~year=2024, ~month=0)\n```" - ], - "signature": "let setUTCFullYearM: (t, ~year: int, ~month: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCFullYearMD", - "kind": "value", - "name": "setUTCFullYearMD", - "docstrings": [ - "`setUTCFullYearMD(date, ~year, ~month, ~day)`\n\nSets the year, month and date (day of month) of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYearMD(~year=2024, ~month=0, ~day=1)\n```" - ], - "signature": "let setUTCFullYearMD: (t, ~year: int, ~month: int, ~day: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMonth", - "kind": "value", - "name": "setUTCMonth", - "docstrings": [ - "`setUTCMonth(date, month)`\n\nSets the month of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMonth(0)\n```" - ], - "signature": "let setUTCMonth: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCDate", - "kind": "value", - "name": "setUTCDate", - "docstrings": [ - "`setDate(date, day)`\n\nSets the date (day of month) of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCDate(1)\n```" - ], - "signature": "let setUTCDate: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHours", - "kind": "value", - "name": "setUTCHours", - "docstrings": [ - "`setUTCHours(date, hours)`\n\nSets the hours of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHours(0)\n```" - ], - "signature": "let setUTCHours: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHoursM", - "kind": "value", - "name": "setUTCHoursM", - "docstrings": [ - "`setHoursM(date, ~hours, ~minutes)`\n\nSets the hours and minutes of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHoursM(~hours=0, ~minutes=0)\n```" - ], - "signature": "let setUTCHoursM: (t, ~hours: int, ~minutes: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHoursMS", - "kind": "value", - "name": "setUTCHoursMS", - "docstrings": [ - "`setUTCHoursMS(date, ~hours, ~minutes, ~seconds)`\n\nSets the hours, minutes and seconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHoursMS(~hours=0, ~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setUTCHoursMS: (t, ~hours: int, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHoursMSMs", - "kind": "value", - "name": "setUTCHoursMSMs", - "docstrings": [ - "`setUTCHoursMSMs(date, ~hours, ~minutes, ~seconds, ~milliseconds)`\n\nSets the hours, minutes, seconds and milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHoursMSMs(\n ~hours=0,\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setUTCHoursMSMs: (\n t,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setUTCMinutes", - "kind": "value", - "name": "setUTCMinutes", - "docstrings": [ - "`setUTCMinutes(date, minutes)`\n\nSets the minutes of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMinutes(0)\n```" - ], - "signature": "let setUTCMinutes: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMinutesS", - "kind": "value", - "name": "setUTCMinutesS", - "docstrings": [ - "`setUTCMinutesS(date, ~minutes, ~seconds)`\n\nSets the minutes and seconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMinutesS(~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setUTCMinutesS: (t, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMinutesSMs", - "kind": "value", - "name": "setUTCMinutesSMs", - "docstrings": [ - "`setUTCMinutesSMs(date, ~minutes, ~seconds, ~milliseconds)`\n\nSets the minutes, seconds and milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMinutesSMs(\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setUTCMinutesSMs: (\n t,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setUTCSeconds", - "kind": "value", - "name": "setUTCSeconds", - "docstrings": [ - "`setUTCSeconds(date, seconds)`\n\nSets the seconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCSeconds(0)\n```" - ], - "signature": "let setUTCSeconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCSecondsMs", - "kind": "value", - "name": "setUTCSecondsMs", - "docstrings": [ - "`setUTCSecondsMs(date, ~seconds, ~milliseconds)`\n\nSets the seconds and milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCSecondsMs(~seconds=0, ~milliseconds=0)\n```" - ], - "signature": "let setUTCSecondsMs: (t, ~seconds: int, ~milliseconds: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMilliseconds", - "kind": "value", - "name": "setUTCMilliseconds", - "docstrings": [ - "`setUTCMilliseconds(date, milliseconds)`\n\nSets the milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMilliseconds(0)\n```" - ], - "signature": "let setUTCMilliseconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.toDateString", - "kind": "value", - "name": "toDateString", - "docstrings": [ - "`toDateString(date)`\n\nConverts a JavaScript date to a standard date string. The date will be mapped to the current time zone.\nIf you want to convert it to a localized string, use `Date.toLocaleDateString` instead.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.toDateString->Console.log\n// Sun Jan 01 2023\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toDateString->Console.log\n// Sat Dec 31 2022\n```" - ], - "signature": "let toDateString: t => string" - }, - { - "id": "Stdlib.Date.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(date)`\n\nConverts a JavaScript date to a standard date time string. The date will be mapped to the current time zone.\nIf you want to convert it to a localized string, use `Date.toLocaleString` instead.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.toString->Console.log\n// Sun Jan 01 2023 00:00:00 GMT+0100 (Central European Standard Time)\n\nDate.fromString(\"2023-06-01T00:00:00.00+01:00\")->Date.toString->Console.log\n// Thu Jun 01 2023 01:00:00 GMT+0200 (Central European Summer Time)\n```" - ], - "signature": "let toString: t => string" - }, - { - "id": "Stdlib.Date.toTimeString", - "kind": "value", - "name": "toTimeString", - "docstrings": [ - "`toTimeString(date)`\n\nConverts a JavaScript date to a standard time string. The date will be mapped to the current time zone.\nIf you want to convert it to a localized string, use `Date.toLocaleStimeString` instead.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.toTimeString->Console.log\n// 00:00:00 GMT+0100 (Central European Standard Time)\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toTimeString->Console.log\n// 17:00:00 GMT+0100 (Central European Standard Time)\n```" - ], - "signature": "let toTimeString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleDateString", - "kind": "value", - "name": "toLocaleDateString", - "docstrings": [ - "`toLocaleDateString(date)`\n\nConverts a JavaScript date to a localized date string. It will use the current locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleDateString->Console.log\n// 2/19/2023\n```" - ], - "signature": "let toLocaleDateString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleDateStringWithLocale", - "kind": "value", - "name": "toLocaleDateStringWithLocale", - "docstrings": [ - "`toLocaleDateStringWithLocale(date, locale)`\n\nConverts a JavaScript date to a localized date string. It will use the specified locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleDateStringWithLocale(\"en-US\")->Console.log\n// 2/19/2023\n```" - ], - "signature": "let toLocaleDateStringWithLocale: (t, string) => string" - }, - { - "id": "Stdlib.Date.toLocaleDateStringWithLocaleAndOptions", - "kind": "value", - "name": "toLocaleDateStringWithLocaleAndOptions", - "docstrings": [ - "`toLocaleDateStringWithLocaleAndOptions(date, locale, options)`\n\nConverts a JavaScript date to a localized date string. It will use the specified locale and formatting options.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleDateStringWithLocaleAndOptions(\"en-US\", {dateStyle: #long})->Console.log\n// February 19, 2023\n\nDate.make()\n->Date.toLocaleDateStringWithLocaleAndOptions(\"de\", {hour: #\"2-digit\", minute: #\"2-digit\"})\n->Console.log\n// 19.2.2023, 15:40\n\nDate.make()->Date.toLocaleDateStringWithLocaleAndOptions(\"de\", {year: #numeric})->Console.log\n// 2023\n```" - ], - "signature": "let toLocaleDateStringWithLocaleAndOptions: (t, string, localeOptions) => string" - }, - { - "id": "Stdlib.Date.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(date)`\n\nConverts a JavaScript date to a localized date-time string. It will use the current locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleString->Console.log\n// 2/19/2023, 3:40:00 PM\n```" - ], - "signature": "let toLocaleString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleStringWithLocale", - "kind": "value", - "name": "toLocaleStringWithLocale", - "docstrings": [ - "`toLocaleStringWithLocale(date, locale)`\n\nConverts a JavaScript date to a localized date-time string. It will use the specified locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleStringWithLocale(\"en-US\")->Console.log\n// 2/19/2023, 3:40:00 PM\n```" - ], - "signature": "let toLocaleStringWithLocale: (t, string) => string" - }, - { - "id": "Stdlib.Date.toLocaleStringWithLocaleAndOptions", - "kind": "value", - "name": "toLocaleStringWithLocaleAndOptions", - "docstrings": [ - "`toLocaleStringWithLocaleAndOptions(date, locale, options)`\n\nConverts a JavaScript date to a localized date-time string. It will use the specified locale and formatting options.\n\n## Examples\n```rescript\nDate.make()\n->Date.toLocaleStringWithLocaleAndOptions(\"en\", {dateStyle: #short, timeStyle: #short})\n->Console.log\n// 2/19/23, 3:40 PM\n\nDate.make()\n->Date.toLocaleStringWithLocaleAndOptions(\n \"en\",\n {\n era: #long,\n year: #numeric,\n month: #\"2-digit\",\n day: #\"2-digit\",\n hour: #numeric,\n timeZoneName: #short,\n },\n)\n->Console.log\n// 02/19/2023 Anno Domini, 3 PM GMT+1\n```" - ], - "signature": "let toLocaleStringWithLocaleAndOptions: (t, string, localeOptions) => string" - }, - { - "id": "Stdlib.Date.toLocaleTimeString", - "kind": "value", - "name": "toLocaleTimeString", - "docstrings": [ - "`toLocaleTimeString(date)`\n\nConverts a JavaScript date to a localized time string. It will use the current locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleTimeString->Console.log\n// 3:40:00 PM\n```" - ], - "signature": "let toLocaleTimeString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleTimeStringWithLocale", - "kind": "value", - "name": "toLocaleTimeStringWithLocale", - "docstrings": [ - "`toLocaleTimeStringWithLocale(date, locale)`\n\nConverts a JavaScript date to a localized time string. It will use the specified locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleTimeStringWithLocale(\"en-US\")->Console.log\n// 3:40:00 PM\n```" - ], - "signature": "let toLocaleTimeStringWithLocale: (t, string) => string" - }, - { - "id": "Stdlib.Date.toLocaleTimeStringWithLocaleAndOptions", - "kind": "value", - "name": "toLocaleTimeStringWithLocaleAndOptions", - "docstrings": [ - "`toLocaleTimeStringWithLocaleAndOptions(date, locale, options)`\n\nConverts a JavaScript date to a localized time string. It will use the specified locale and formatting options.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleTimeStringWithLocaleAndOptions(\"en-US\", {timeStyle: #long})->Console.log\n// 3:40:00 PM GMT+1\n\nDate.make()\n->Date.toLocaleTimeStringWithLocaleAndOptions(\"de\", {hour: #\"2-digit\", minute: #\"2-digit\"})\n->Console.log\n// 15:40\n```" - ], - "signature": "let toLocaleTimeStringWithLocaleAndOptions: (t, string, localeOptions) => string" - }, - { - "id": "Stdlib.Date.toISOString", - "kind": "value", - "name": "toISOString", - "docstrings": [ - "`toISOString(date)`\n\nConverts a JavaScript date to a ISO 8601 string (YYYY-MM-DDTHH:mm:ss.sssZ). The date will be mapped to the UTC time.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toISOString->Console.log\n// 2023-01-01T00:00:00.000Z\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toISOString->Console.log\n// 2022-12-31T16:00:00.000Z\n```" - ], - "signature": "let toISOString: t => string" - }, - { - "id": "Stdlib.Date.toUTCString", - "kind": "value", - "name": "toUTCString", - "docstrings": [ - "`toUTCString(date)`\n\nConverts a JavaScript date to date time string. The date will be mapped to the UTC time.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toUTCString->Console.log\n// Sun, 01 Jan 2023 00:00:00 GMT\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toUTCString->Console.log\n// Sat, 31 Dec 2022 16:00:00 GMT\n```" - ], - "signature": "let toUTCString: t => string" - }, - { - "id": "Stdlib.Date.toJSON", - "kind": "value", - "name": "toJSON", - "docstrings": [ - "`toJSON(date)`\n\nConverts a JavaScript date to a string.\nIf the date is valid, the function will return the same result as `Date.toISOString`.\nInvalid dates will return `None`.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toJSON\n// Some(\"2023-01-01T00:00:00.000Z\")\n\nDate.fromString(\"\")->Date.toJSON\n// None\n```" - ], - "signature": "let toJSON: t => option" - }, - { - "id": "Stdlib.Date.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(date)` ignores the provided date and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/dataview": { - "id": "Stdlib.DataView", - "name": "DataView", - "docstrings": [ - "Functions for interacting with DataView.\n\nSee [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN." - ], - "items": [ - { - "id": "Stdlib.DataView.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a DataView." - ], - "signature": "type t" - }, - { - "id": "Stdlib.DataView.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer(buffer)` creates a DataView for the entire ArrayBuffer.\n\nSee [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN.\n\n## Examples\n\n```rescript\nDataView.fromBuffer(ArrayBuffer.make(16))\nDataView.fromBuffer(ArrayBuffer.make(16), ~byteOffset=4)\nDataView.fromBuffer(ArrayBuffer.make(16), ~byteOffset=4, ~length=8)\n```" - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.DataView.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd(buffer, ~byteOffset)` creates a DataView starting at a given byte offset. See [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN.\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.\n\n## Examples\n\n```rescript\nDataView.fromBufferToEnd(buffer, ~byteOffset=4)\n```" - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.DataView.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange(buffer, ~byteOffset, ~length)` creates a DataView for a specific byte range.\n\nSee [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN.\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.\n\n## Examples\n\n```rescript\nDataView.fromBufferWithRange(ArrayBuffer.make(16), ~byteOffset=2, ~length=8)\n```" - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.DataView.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [ - "`buffer(dataView)` returns the underlying ArrayBuffer referenced by this DataView.\n\nSee [`DataView.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/buffer) on MDN.\n\n## Examples\n\n```rescript\nlet array_buffer = ArrayBuffer.make(16)\nlet dv = DataView.fromBuffer(array_buffer)\nDataView.buffer(dv) == array_buffer\n```" - ], - "signature": "let buffer: t => ArrayBuffer.t" - }, - { - "id": "Stdlib.DataView.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [ - "`byteLength(dataView)` returns the length (in bytes) of this DataView.\n\nSee [`DataView.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet array_buffer = ArrayBuffer.make(16)\nlet dv = DataView.fromBuffer(array_buffer)\nDataView.byteLength(dv) == 16\n```" - ], - "signature": "let byteLength: t => int" - }, - { - "id": "Stdlib.DataView.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [ - "`byteOffset(dataView)` returns the byte offset of this DataView from the start of its ArrayBuffer.\n\nSee [`DataView.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/byteOffset) on MDN.\n\n## Examples\n\n```rescript\nlet array_buffer = ArrayBuffer.make(16)\nlet dv = DataView.fromBuffer(array_buffer, ~byteOffset=4)\nDataView.byteOffset(dv) == 4\n```" - ], - "signature": "let byteOffset: t => int" - }, - { - "id": "Stdlib.DataView.getInt8", - "kind": "value", - "name": "getInt8", - "docstrings": [ - "`getInt8(dataView, offset)` reads an 8-bit signed integer at the specified byte offset.\n\nSee [`DataView.getInt8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setInt8(0, -12)\nDataView.getInt8(dv, 0) == -12\n```" - ], - "signature": "let getInt8: (t, int) => int" - }, - { - "id": "Stdlib.DataView.getUint8", - "kind": "value", - "name": "getUint8", - "docstrings": [ - "`getUint8(dataView, offset)` reads an 8-bit unsigned integer at the specified byte offset.\n\nSee [`DataView.getUint8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setUint8(1, 255)\nDataView.getUint8(dv, 1) == 255\n```" - ], - "signature": "let getUint8: (t, int) => int" - }, - { - "id": "Stdlib.DataView.getInt16", - "kind": "value", - "name": "getInt16", - "docstrings": [ - "`getInt16(dataView, offset, ~littleEndian=?)` reads a 16-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getInt16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setInt16(0, -1234)\ndv->DataView.setInt16(2, -1234, ~littleEndian=true)\nDataView.getInt16(dv, 0) == -1234\nDataView.getInt16(dv, 2, ~littleEndian=true) == -1234\n```" - ], - "signature": "let getInt16: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getUint16", - "kind": "value", - "name": "getUint16", - "docstrings": [ - "`getUint16(dataView, offset, ~littleEndian=?)` reads a 16-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getUint16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setUint16(0, 1234)\ndv->DataView.setUint16(2, 1234, ~littleEndian=true)\nDataView.getUint16(dv, 0) == 1234\nDataView.getUint16(dv, 2, ~littleEndian=true) == 1234\n```" - ], - "signature": "let getUint16: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getInt32", - "kind": "value", - "name": "getInt32", - "docstrings": [ - "`getInt32(dataView, offset, ~littleEndian=?)` reads a 32-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getInt32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setInt32(0, -123456)\ndv->DataView.setInt32(4, -123456, ~littleEndian=true)\nDataView.getInt32(dv, 0) == -123456\nDataView.getInt32(dv, 4, ~littleEndian=true) == -123456\n```" - ], - "signature": "let getInt32: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getUint32", - "kind": "value", - "name": "getUint32", - "docstrings": [ - "`getUint32(dataView, offset, ~littleEndian=?)` reads a 32-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getUint32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setUint32(0, 123456)\ndv->DataView.setUint32(4, 123456, ~littleEndian=true)\nDataView.getUint32(dv, 0) == 123456\nDataView.getUint32(dv, 4, ~littleEndian=true) == 123456\n```" - ], - "signature": "let getUint32: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getFloat16", - "kind": "value", - "name": "getFloat16", - "docstrings": [ - "`getFloat16(dataView, offset, ~littleEndian=?)` reads a 16-bit floating point number (if supported) at the specified byte offset, with optional endianness.\n\nSee [`DataView.getFloat16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat16) on MDN.\n\n## Examples\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setFloat16(0, 1.5)\ndv->DataView.setFloat16(2, 1.5, ~littleEndian=true)\nDataView.getFloat16(dv, 0) == 1.5\nDataView.getFloat16(dv, 2, ~littleEndian=true) == 1.5\n```" - ], - "signature": "let getFloat16: (t, int, ~littleEndian: bool=?) => float" - }, - { - "id": "Stdlib.DataView.getFloat32", - "kind": "value", - "name": "getFloat32", - "docstrings": [ - "`getFloat32(dataView, offset, ~littleEndian=?)` reads a 32-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.getFloat32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setFloat32(0, 3.14)\ndv->DataView.setFloat32(4, 3.14, ~littleEndian=true)\n// DataView.getFloat32(dv, 0) == 3.14\n// DataView.getFloat32(dv, 4, ~littleEndian=true) == 3.14\n```" - ], - "signature": "let getFloat32: (t, int, ~littleEndian: bool=?) => float" - }, - { - "id": "Stdlib.DataView.getFloat64", - "kind": "value", - "name": "getFloat64", - "docstrings": [ - "`getFloat64(dataView, offset, ~littleEndian=?)` reads a 64-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.getFloat64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setFloat64(0, 6.28)\ndv->DataView.setFloat64(8, 6.28, ~littleEndian=true)\nDataView.getFloat64(dv, 0) == 6.28\nDataView.getFloat64(dv, 8, ~littleEndian=true) == 6.28\n```" - ], - "signature": "let getFloat64: (t, int, ~littleEndian: bool=?) => float" - }, - { - "id": "Stdlib.DataView.getBigInt64", - "kind": "value", - "name": "getBigInt64", - "docstrings": [ - "`getBigInt64(dataView, offset, ~littleEndian=?)` reads a 64-bit signed integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.getBigInt64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getBigInt64) on MDN.\n\n## Examples\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setBigInt64(0, -123456789n)\ndv->DataView.setBigInt64(8, -123456789n, ~littleEndian=true)\nDataView.getBigInt64(dv, 0) == -123456789n\nDataView.getBigInt64(dv, 8, ~littleEndian=true) == -123456789n\n```" - ], - "signature": "let getBigInt64: (t, int, ~littleEndian: bool=?) => bigint" - }, - { - "id": "Stdlib.DataView.getBigUint64", - "kind": "value", - "name": "getBigUint64", - "docstrings": [ - "`getBigUint64(dataView, offset, ~littleEndian=?)` reads a 64-bit unsigned integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.getBigUint64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getBigUint64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setBigUint64(0, 123456789n)\ndv->DataView.setBigUint64(8, 123456789n, ~littleEndian=true)\nDataView.getBigUint64(dv, 0) == 123456789n\nDataView.getBigUint64(dv, 8, ~littleEndian=true) == 123456789n\n```" - ], - "signature": "let getBigUint64: (t, int, ~littleEndian: bool=?) => bigint" - }, - { - "id": "Stdlib.DataView.setInt8", - "kind": "value", - "name": "setInt8", - "docstrings": [ - "`setInt8(dataView, offset, value)` writes an 8-bit signed integer at the specified byte offset.\n\nSee [`DataView.setInt8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setInt8(dv, 0, -12)\ndv->DataView.getInt8(0) == -12\n```" - ], - "signature": "let setInt8: (t, int, int) => unit" - }, - { - "id": "Stdlib.DataView.setUint8", - "kind": "value", - "name": "setUint8", - "docstrings": [ - "`setUint8(dataView, offset, value)` writes an 8-bit unsigned integer at the specified byte offset.\n\nSee [`DataView.setUint8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setUint8(dv, 0, 255)\ndv->DataView.getUint8(0) == 255\n```" - ], - "signature": "let setUint8: (t, int, int) => unit" - }, - { - "id": "Stdlib.DataView.setInt16", - "kind": "value", - "name": "setInt16", - "docstrings": [ - "`setInt16(dataView, offset, value, ~littleEndian=?)` writes a 16-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setInt16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setInt16(dv, 0, -1234)\nDataView.setInt16(dv, 2, -1234, ~littleEndian=true)\ndv->DataView.getInt16(0) == -1234\ndv->DataView.getInt16(2, ~littleEndian=true) == -1234\n```" - ], - "signature": "let setInt16: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setUint16", - "kind": "value", - "name": "setUint16", - "docstrings": [ - "`setUint16(dataView, offset, value, ~littleEndian=?)` writes a 16-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setUint16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setUint16(dv, 0, 1234)\nDataView.setUint16(dv, 2, 1234, ~littleEndian=true)\ndv->DataView.getUint16(0) == 1234\ndv->DataView.getUint16(2, ~littleEndian=true) == 1234\n```" - ], - "signature": "let setUint16: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setInt32", - "kind": "value", - "name": "setInt32", - "docstrings": [ - "`setInt32(dataView, offset, value, ~littleEndian=?)` writes a 32-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setInt32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setInt32(dv, 0, -123456)\nDataView.setInt32(dv, 4, -123456, ~littleEndian=true)\ndv->DataView.getInt32(0) == -123456\ndv->DataView.getInt32(4, ~littleEndian=true) == -123456\n```" - ], - "signature": "let setInt32: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setUint32", - "kind": "value", - "name": "setUint32", - "docstrings": [ - "`setUint32(dataView, offset, value, ~littleEndian=?)` writes a 32-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setUint32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setUint32(dv, 0, 123456)\nDataView.setUint32(dv, 4, 123456, ~littleEndian=true)\ndv->DataView.getUint32(0) == 123456\ndv->DataView.getUint32(4, ~littleEndian=true) == 123456\n```" - ], - "signature": "let setUint32: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setFloat16", - "kind": "value", - "name": "setFloat16", - "docstrings": [ - "`setFloat16(dataView, offset, value, ~littleEndian=?)` writes a 16-bit floating point number (if supported) at the specified byte offset, with optional endianness.\n\nSee [`DataView.setFloat16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setFloat16(dv, 0, 1.5)\nDataView.setFloat16(dv, 2, 1.5, ~littleEndian=true)\ndv->DataView.getFloat16(0) == 1.5\ndv->DataView.getFloat16(2, ~littleEndian=true) == 1.5\n```" - ], - "signature": "let setFloat16: (t, int, float, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setFloat32", - "kind": "value", - "name": "setFloat32", - "docstrings": [ - "`setFloat32(dataView, offset, value, ~littleEndian=?)` writes a 32-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.setFloat32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setFloat32(dv, 0, 3.14)\nDataView.setFloat32(dv, 4, 3.14, ~littleEndian=true)\n// dv->DataView.getFloat32(0) == 3.14\n// dv->DataView.getFloat32(4, ~littleEndian=true) == 3.14\n```" - ], - "signature": "let setFloat32: (t, int, float, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setFloat64", - "kind": "value", - "name": "setFloat64", - "docstrings": [ - "`setFloat64(dataView, offset, value, ~littleEndian=?)` writes a 64-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.setFloat64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setFloat64(dv, 0, 6.28)\nDataView.setFloat64(dv, 8, 6.28, ~littleEndian=true)\ndv->DataView.getFloat64(0) == 6.28\ndv->DataView.getFloat64(8, ~littleEndian=true) == 6.28\n```" - ], - "signature": "let setFloat64: (t, int, float, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setBigInt64", - "kind": "value", - "name": "setBigInt64", - "docstrings": [ - "`setBigInt64(dataView, offset, value, ~littleEndian=?)` writes a 64-bit signed integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.setBigInt64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setBigInt64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setBigInt64(dv, 0, -123456789n)\nDataView.setBigInt64(dv, 8, -123456789n, ~littleEndian=true)\ndv->DataView.getBigInt64(0) == -123456789n\ndv->DataView.getBigInt64(8, ~littleEndian=true) == -123456789n\n```" - ], - "signature": "let setBigInt64: (t, int, bigint, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setBigUint64", - "kind": "value", - "name": "setBigUint64", - "docstrings": [ - "`setBigUint64(dataView, offset, value, ~littleEndian=?)` writes a 64-bit unsigned integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.setBigUint64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setBigUint64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setBigUint64(dv, 0, 123456789n)\nDataView.setBigUint64(dv, 8, 123456789n, ~littleEndian=true)\ndv->DataView.getBigUint64(0) == 123456789n\ndv->DataView.getBigUint64(8, ~littleEndian=true) == 123456789n\n```" - ], - "signature": "let setBigUint64: (t, int, bigint, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(dataView)` ignores the provided DataView and returns unit.\n\nThis helper is useful when you want to discard a value (for example, the result of an operation with side effects) without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/console": { - "id": "Stdlib.Console", - "name": "Console", - "docstrings": [ - "Functions for interacting with JavaScript console.\n\nSee: [`console`](https://developer.mozilla.org/en-US/docs/Web/API/Console)." - ], - "items": [ - { - "id": "Stdlib.Console.assert_", - "kind": "value", - "name": "assert_", - "docstrings": [ - "`assert_(assertion, value)` print a message to console if `assertion` evaluates `false`. Does nothing if it's `true`.\n\nSee [`console.assert`](https://developer.mozilla.org/en-US/docs/Web/API/console/assert)\non MDN.\n\n## Examples\n\n```rescript\nConsole.assert_(false, \"Hello World!\")\nConsole.assert_(42 === 42, \"The answer\")\n```" - ], - "signature": "let assert_: (bool, 'a) => unit" - }, - { - "id": "Stdlib.Console.assert2", - "kind": "value", - "name": "assert2", - "docstrings": [ - "`assert2(v1, v2)`. Like `assert_`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.assert2(false, \"Hello\", \"World\")\nConsole.assert2(42 === 42, [1, 2, 3], '4')\n```" - ], - "signature": "let assert2: (bool, 'a, 'b) => unit" - }, - { - "id": "Stdlib.Console.assert3", - "kind": "value", - "name": "assert3", - "docstrings": [ - "`assert3(v1, v2, v3)`. Like `assert_`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.assert3(false, \"Hello\", \"World\", \"ReScript\")\nConsole.assert3(42 === 42, \"One\", 2, #3)\n```" - ], - "signature": "let assert3: (bool, 'a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.assert4", - "kind": "value", - "name": "assert4", - "docstrings": [ - "`assert4(v1, v2, v3, v4)`. Like `assert_`, but with four arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert4(false, \"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.assert4(value === 42, [1, 2], (3, 4), [#5, #6], #polyvar)\n```" - ], - "signature": "let assert4: (bool, 'a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.assert5", - "kind": "value", - "name": "assert5", - "docstrings": [ - "`assert5(v1, v2, v3, v4, v5)`. Like `assert_`, but with five arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert5(false, \"Hello\", \"World\", \"JS\", '!', '!')\nConsole.assert5(value === 42, [1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let assert5: (bool, 'a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.assert6", - "kind": "value", - "name": "assert6", - "docstrings": [ - "`assert6(v1, v2)`. Like `assert_`, but with six arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert6(false, \"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.assert6(value === 42, [1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let assert6: (bool, 'a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.assertMany", - "kind": "value", - "name": "assertMany", - "docstrings": [ - "`assertMany(assertion, arr)`. Like `assert_`, but variadic.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assertMany(false, [\"Hello\", \"World\"])\nConsole.assertMany(value === 42, [1, 2, 3])\n```" - ], - "signature": "let assertMany: (bool, array<'a>) => unit" - }, - { - "id": "Stdlib.Console.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "`clear()` clears the console, if allowed.\n\nSee [`console.clear`](https://developer.mozilla.org/en-US/docs/Web/API/console/clear)\non MDN.\n\n## Examples\n\n```rescript\nConsole.clear()\n```" - ], - "signature": "let clear: unit => unit" - }, - { - "id": "Stdlib.Console.count", - "kind": "value", - "name": "count", - "docstrings": [ - "`count(label)` prints to the console the number of times it's been called with the given label.\n\nSee [`console.count`](https://developer.mozilla.org/en-US/docs/Web/API/console/count)\non MDN.\n\n## Examples\n\n```rescript\nConsole.count(\"rescript\")\n```" - ], - "signature": "let count: string => unit" - }, - { - "id": "Stdlib.Console.countReset", - "kind": "value", - "name": "countReset", - "docstrings": [ - "`countReset(label)` resets the count for the given label to 0.\n\nSee [`console.countReset`](https://developer.mozilla.org/en-US/docs/Web/API/console/countReset)\non MDN.\n\n## Examples\n\n```rescript\nConsole.countReset(\"rescript\")\n```" - ], - "signature": "let countReset: string => unit" - }, - { - "id": "Stdlib.Console.debug", - "kind": "value", - "name": "debug", - "docstrings": [ - "`debug(value)` print a debug message to console.\n\nSee [`console.debug`](https://developer.mozilla.org/en-US/docs/Web/API/console/debug)\non MDN.\n\n## Examples\n\n```rescript\nConsole.debug(\"Hello\")\nlet obj = {\"name\": \"ReScript\", \"version\": 10}\nConsole.debug(obj)\n```" - ], - "signature": "let debug: 'a => unit" - }, - { - "id": "Stdlib.Console.debug2", - "kind": "value", - "name": "debug2", - "docstrings": [ - "`debug2(v1, v2)`. Like `debug`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.debug2(\"Hello\", \"World\")\nConsole.debug2([1, 2, 3], '4')\n```" - ], - "signature": "let debug2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.debug3", - "kind": "value", - "name": "debug3", - "docstrings": [ - "`debug3(v1, v2, v3)`. Like `debug`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.debug3(\"Hello\", \"World\", \"ReScript\")\nConsole.debug3(\"One\", 2, #3)\n```" - ], - "signature": "let debug3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.debug4", - "kind": "value", - "name": "debug4", - "docstrings": [ - "`debug4(v1, v2, v3, v4)`. Like `debug`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.debug4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.debug4([1, 2], (3, 4), [#5, #6], #polyvar)\n```" - ], - "signature": "let debug4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.debug5", - "kind": "value", - "name": "debug5", - "docstrings": [ - "`debug5(v1, v2, v3, v4, v5)`. Like `debug`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.debug5(\"Hello\", \"World\", \"JS\", '!', '!')\nConsole.debug5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let debug5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.debug6", - "kind": "value", - "name": "debug6", - "docstrings": [ - "`debug6(v1, v2, v3, v4, v5, v6)`. Like `debug`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.debug6(\"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.debug6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let debug6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.debugMany", - "kind": "value", - "name": "debugMany", - "docstrings": [ - "`debugMany(arr)`. Like `debug`, but variadic.\n\n## Examples\n\n```rescript\nConsole.debugMany([\"Hello\", \"World\"])\nConsole.debugMany([1, 2, 3])\n```" - ], - "signature": "let debugMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.dirOptions", - "kind": "type", - "name": "dirOptions", - "docstrings": [], - "signature": "type dirOptions = {\n colors?: bool,\n depth?: Nullable.t,\n showHidden?: bool,\n}" - }, - { - "id": "Stdlib.Console.dir", - "kind": "value", - "name": "dir", - "docstrings": [ - "`dir(object, options)` displays an interactive view of the object in the console.\n\nSee [`console.dir`](https://developer.mozilla.org/en-US/docs/Web/API/console/dir)\non MDN.\n\n## Examples\n\n```rescript\nConsole.dir({\"language\": \"rescript\", \"version\": \"10.1.2\"})\nConsole.dir(\n {\"language\": \"rescript\", \"version\": {\"major\": \"10\", \"minor\": \"1\", \"patch\": \"2\"}},\n ~options={depth: null},\n)\n```" - ], - "signature": "let dir: ('a, ~options: dirOptions=?) => unit" - }, - { - "id": "Stdlib.Console.dirxml", - "kind": "value", - "name": "dirxml", - "docstrings": [ - "`dirxml(object)` displays an interactive tree view of an XML/HTML element in the console.\n\nSee [`console.dirxml`](https://developer.mozilla.org/en-US/docs/Web/API/console/dirxml)\non MDN." - ], - "signature": "let dirxml: 'a => unit" - }, - { - "id": "Stdlib.Console.error", - "kind": "value", - "name": "error", - "docstrings": [ - "`error(value)` prints an error message to console.\n\nSee [`console.error`](https://developer.mozilla.org/en-US/docs/Web/API/console/error)\non MDN.\n\n## Examples\n\n```rescript\nConsole.error(\"error message\")\nConsole.error((\"error\", \"invalid value\"))\n```" - ], - "signature": "let error: 'a => unit" - }, - { - "id": "Stdlib.Console.error2", - "kind": "value", - "name": "error2", - "docstrings": [ - "`error(v1, v2)`. Like `error`, but two arguments.\n\n## Examples\n\n```rescript\nConsole.error2(\"Error\", \"here\")\nConsole.error2((\"log\", \"error\"), \"message\")\n```" - ], - "signature": "let error2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.error3", - "kind": "value", - "name": "error3", - "docstrings": [ - "`error3(v1, v2, v3)`. Like `error`, but three arguments.\n\n## Examples\n\n```rescript\nConsole.error3(\"Hello\", \"World\", \"!!!\")\nConsole.error3(#first, #second, #third)\n```" - ], - "signature": "let error3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.error4", - "kind": "value", - "name": "error4", - "docstrings": [ - "`error4(v1, v2, v3, v4)`. Like `error`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.error4(\"Hello\", \"World\", \"ReScript\", '!')\nConsole.error4(#first, #second, #third, \"fourth\")\n```" - ], - "signature": "let error4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.error5", - "kind": "value", - "name": "error5", - "docstrings": [ - "`error5(v1, v2, v3, v4, v5)`. Like `error`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.error5('e', 'r', 'r', 'o', 'r')\nConsole.error5(1, #second, #third, \"fourth\", 'c')\n```" - ], - "signature": "let error5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.error6", - "kind": "value", - "name": "error6", - "docstrings": [ - "`error6(v1, v2, v3, v4, v5, v6)`. Like `error`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.error6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.error6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let error6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.group", - "kind": "value", - "name": "group", - "docstrings": [ - "`group(label)` creates a new \"group\" level with the given label.\n\nSee [`console.group`](https://developer.mozilla.org/en-US/docs/Web/API/console/group)\non MDN.\n\n## Example\n\n```rescript\nConsole.group(\"first group\")\nConsole.group(\"second group\")\nConsole.log(\"a message on the second level\")\nConsole.groupEnd()\nConsole.log(\"a message message on the first level\")\nConsole.groupEnd()\n```" - ], - "signature": "let group: string => unit" - }, - { - "id": "Stdlib.Console.groupCollapsed", - "kind": "value", - "name": "groupCollapsed", - "docstrings": [ - "`groupCollapsed(label)`. Like `group` but collapses the group initially.\n\nSee [`console.groupCollapsed`](https://developer.mozilla.org/en-US/docs/Web/API/console/groupCollapsed)\non MDN." - ], - "signature": "let groupCollapsed: string => unit" - }, - { - "id": "Stdlib.Console.groupEnd", - "kind": "value", - "name": "groupEnd", - "docstrings": [ - "`groupEnd()` ends the current group.\n\nSee [`console.groupEnd`](https://developer.mozilla.org/en-US/docs/Web/API/console/groupEnd)\non MDN." - ], - "signature": "let groupEnd: unit => unit" - }, - { - "id": "Stdlib.Console.errorMany", - "kind": "value", - "name": "errorMany", - "docstrings": [ - "`errorMany(arr)`. Like `error`, but variadic.\n\n## Examples\n\n```rescript\nConsole.errorMany([\"Hello\", \"World\"])\nConsole.errorMany([1, 2, 3])\n```" - ], - "signature": "let errorMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.info", - "kind": "value", - "name": "info", - "docstrings": [ - "`info(value)` print an informational message to console.\n\nSee [`console.info`](https://developer.mozilla.org/en-US/docs/Web/API/console/info)\non MDN.\n\n## Examples\n\n```rescript\nConsole.info(\"Information\")\nConsole.info((\"Hello\", \"JS\"))\n```" - ], - "signature": "let info: 'a => unit" - }, - { - "id": "Stdlib.Console.info2", - "kind": "value", - "name": "info2", - "docstrings": [ - "`info2(v1, v2)`. Like `info`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.info2(\"Info\", \"failed to download\")\nConsole.info2(#info, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let info2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.info3", - "kind": "value", - "name": "info3", - "docstrings": [ - "`info3(v1, v2, v3)`. Like `info`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.info3(\"Hello\", \"World\", \"ReScript\")\nConsole.info3([1, 2, 3], #4, #5)\n```" - ], - "signature": "let info3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.info4", - "kind": "value", - "name": "info4", - "docstrings": [ - "`info4(v1, v2, v3, v4)`. Like `info`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.info4(\"Hello\", \"World\", \"ReScript\", '!')\nConsole.info4([1, 2, 3], #4, #5, #lastinfo)\n```" - ], - "signature": "let info4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.info5", - "kind": "value", - "name": "info5", - "docstrings": [ - "`info5(v1, v2, v3, v4, v5)`. Like `info`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.info5(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\")\nConsole.info5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let info5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.info6", - "kind": "value", - "name": "info6", - "docstrings": [ - "`info6(v1, v2, v3, v4, v5, v6)`. Like `info`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.info6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.info6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let info6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.infoMany", - "kind": "value", - "name": "infoMany", - "docstrings": [ - "`infoMany(arr)`. Like `info`, but variadic.\n\n## Examples\n\n```rescript\nConsole.infoMany([\"Hello\", \"World\"])\nConsole.infoMany([1, 2, 3])\n```" - ], - "signature": "let infoMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.log", - "kind": "value", - "name": "log", - "docstrings": [ - "`log(value)` print a message to console.\n\nSee [`console.log`](https://developer.mozilla.org/en-US/docs/Web/API/console/log)\non MDN.\n\n## Examples\n\n```rescript\nConsole.log(\"Hello\")\nlet obj = {\"name\": \"ReScript\", \"version\": 10}\nConsole.log(obj)\n```" - ], - "signature": "let log: 'a => unit" - }, - { - "id": "Stdlib.Console.log2", - "kind": "value", - "name": "log2", - "docstrings": [ - "`log2(v1, v2)`. Like `log`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.log2(\"Hello\", \"World\")\nConsole.log2([1, 2, 3], '4')\n```" - ], - "signature": "let log2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.log3", - "kind": "value", - "name": "log3", - "docstrings": [ - "`log3(v1, v2, v3)`. Like `log`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.log3(\"Hello\", \"World\", \"ReScript\")\nConsole.log3(\"One\", 2, #3)\n```" - ], - "signature": "let log3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.log4", - "kind": "value", - "name": "log4", - "docstrings": [ - "`log4(v1, v2, v3, v4)`. Like `log`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.log4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.log4([1, 2], (3, 4), [#5, #6], #polyvar)\n```" - ], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.log5", - "kind": "value", - "name": "log5", - "docstrings": [ - "`log5(v1, v2, v3, v4, v5)`. Like `log`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.log5(\"Hello\", \"World\", \"JS\", '!', '!')\nConsole.log5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let log5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.log6", - "kind": "value", - "name": "log6", - "docstrings": [ - "`log6(v1, v2, v3, v4, v5, v6)`. Like `log`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.log6(\"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.log6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let log6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.logMany", - "kind": "value", - "name": "logMany", - "docstrings": [ - "`logMany(arr)`. Like `log`, but variadic.\n\n## Examples\n\n```rescript\nConsole.logMany([\"Hello\", \"World\"])\nConsole.logMany([1, 2, 3])\n```" - ], - "signature": "let logMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.table", - "kind": "value", - "name": "table", - "docstrings": [ - "`table(object)` displays an tabular view of the object in the console.\n\nSee [`console.table`](https://developer.mozilla.org/en-US/docs/Web/API/console/table)\non MDN.\n\n## Examples\n\n```rescript\nConsole.table({\"language\": \"rescript\", \"version\": \"10.1.2\"})\n```" - ], - "signature": "let table: 'a => unit" - }, - { - "id": "Stdlib.Console.time", - "kind": "value", - "name": "time", - "docstrings": [ - "`time(label)` creates a timer to measure how long an operation takes. `label`\nmust be a unique name. Call `console.timeEnd` with the same `label` to print\noutput time.\n\nSee [`console.time`](https://developer.mozilla.org/en-US/docs/Web/API/console/time)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let time: string => unit" - }, - { - "id": "Stdlib.Console.timeEnd", - "kind": "value", - "name": "timeEnd", - "docstrings": [ - "`timeEnd(label)` stops a timer created by `time`.\n\nSee [`console.timeEnd`](https://developer.mozilla.org/en-US/docs/Web/API/console/timeEnd)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let timeEnd: string => unit" - }, - { - "id": "Stdlib.Console.timeLog", - "kind": "value", - "name": "timeLog", - "docstrings": [ - "`timeLog(label)` prints the current elapsed time of the given timer to the console.\n\nSee [`console.timeLog`](https://developer.mozilla.org/en-US/docs/Web/API/console/timeLog)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let timeLog: string => unit" - }, - { - "id": "Stdlib.Console.trace", - "kind": "value", - "name": "trace", - "docstrings": [ - "`trace()` print a stack trace to console.\n\nSee [`console.trace`](https://developer.mozilla.org/en-US/docs/Web/API/console/trace)\non MDN.\n\n## Examples\n\n```rescript\nlet main = () => {\n Console.trace()\n}\nmain()\n// In the console, the following trace will be displayed:\n// main\n// \n```" - ], - "signature": "let trace: unit => unit" - }, - { - "id": "Stdlib.Console.warn", - "kind": "value", - "name": "warn", - "docstrings": [ - "`warn(value)` print a warning message to console.\n\nSee [`console.warn`](https://developer.mozilla.org/en-US/docs/Web/API/console/warn)\non MDN.\n\n## Examples\n\n```rescript\nConsole.warn(\"Warning\")\nConsole.warn((\"Warning\", \"invalid number\"))\n```" - ], - "signature": "let warn: 'a => unit" - }, - { - "id": "Stdlib.Console.warn2", - "kind": "value", - "name": "warn2", - "docstrings": [ - "`warn2(v1, v2)`. Like `warn`, but two arguments.\n\n## Examples\n\n```rescript\nConsole.warn2(\"Hello\", \"World\")\nConsole.warn2([1, 2, 3], 4)\n```" - ], - "signature": "let warn2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.warn3", - "kind": "value", - "name": "warn3", - "docstrings": [ - "`warn3(v1, v2, v3)`. Like `warn`, but three arguments.\n\n## Examples\n\n```rescript\nConsole.warn3(\"Hello\", \"World\", \"ReScript\")\nConsole.warn3([1, 2, 3], #4, #5)\n```" - ], - "signature": "let warn3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.warn4", - "kind": "value", - "name": "warn4", - "docstrings": [ - "`warn4(v1, v2, v3, v4)`. Like `warn`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.warn4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.warn4(#first, #second, #third, \"fourth\")\n```" - ], - "signature": "let warn4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.warn5", - "kind": "value", - "name": "warn5", - "docstrings": [ - "`warn5(v1, v2, v3, v4, v5)`. Like `warn`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.warn5(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\")\nConsole.warn5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let warn5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.warn6", - "kind": "value", - "name": "warn6", - "docstrings": [ - "`warn6(v1, v2, v3, v4, v5, v6)`. Like `warn`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.warn6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.warn6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let warn6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.warnMany", - "kind": "value", - "name": "warnMany", - "docstrings": [ - "`warnMany(arr)`. Like `warn`, but variadic.\n\n## Examples\n\n```rescript\nConsole.warnMany([\"Hello\", \"World\"])\nConsole.warnMany([1, 2, 3])\n```" - ], - "signature": "let warnMany: array<'a> => unit" - } - ] - }, - "stdlib/bool": { - "id": "Stdlib.Bool", - "name": "Bool", - "docstrings": [ - "Functions for interacting with JavaScript booleans.\nSee: [`Boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)" - ], - "items": [ - { - "id": "Stdlib.Bool.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a boolean." - ], - "signature": "type t = bool" - }, - { - "id": "Stdlib.Bool.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts a boolean to a string.\n\n## Examples\n```rescript\nBool.toString(true) == \"true\"\nBool.toString(false) == \"false\"\n```" - ], - "signature": "let toString: bool => string" - }, - { - "id": "Stdlib.Bool.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Converts a string to a boolean.\n\n## Examples\n```rescript\nBool.fromString(\"true\") == Some(true)\nBool.fromString(\"false\") == Some(false)\nBool.fromString(\"notAValidBoolean\") == None\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.Bool.fromStringOrThrow", - "kind": "value", - "name": "fromStringOrThrow", - "docstrings": [ - "Converts a string to a boolean.\nThrows an `Invalid_argument` exception if the string is not a valid boolean.\n\n## Examples\n```rescript\nBool.fromStringOrThrow(\"true\") == true\nBool.fromStringOrThrow(\"false\") == false\nswitch Bool.fromStringOrThrow(\"notAValidBoolean\") {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let fromStringOrThrow: string => bool" - }, - { - "id": "Stdlib.Bool.fromStringExn", - "kind": "value", - "name": "fromStringExn", - "docstrings": [ - "Converts a string to a boolean.\nBeware, this function will throw an `Invalid_argument` exception\nif the string is not a valid boolean.\n\n## Examples\n```rescript\nBool.fromStringExn(\"true\") == true\nBool.fromStringExn(\"false\") == false\nswitch Bool.fromStringExn(\"notAValidBoolean\") {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let fromStringExn: string => bool", - "deprecated": "" - }, - { - "id": "Stdlib.Bool.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "Compares two booleans, returns an `Ordering.t` value.\n\n## Examples\n```rescript\nBool.compare(true, true) == Ordering.equal\nBool.compare(false, false) == Ordering.equal\nBool.compare(true, false) == Ordering.greater\nBool.compare(false, true) == Ordering.less\n```" - ], - "signature": "let compare: (bool, bool) => Ordering.t" - }, - { - "id": "Stdlib.Bool.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "Checks if two booleans are equal and have the same value.\n\n## Examples\n```rescript\nBool.equal(true, true) == true\nBool.equal(false, false) == true\nBool.equal(true, false) == false\nBool.equal(false, true) == false\n```" - ], - "signature": "let equal: (bool, bool) => bool" - }, - { - "id": "Stdlib.Bool.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bool)` ignores the provided boolean and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: bool => unit" - } - ] - }, - "stdlib/bigint": { - "id": "Stdlib.BigInt", - "name": "BigInt", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigInt.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a bigint." - ], - "signature": "type t = bigint" - }, - { - "id": "Stdlib.BigInt.asIntN", - "kind": "value", - "name": "asIntN", - "docstrings": [ - "`asIntN(~width, bigint)` returns a bigint value truncated to the given number of bits as a signed integer.\n\nSee [`BigInt.asIntN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/asIntN) on MDN.\n\n## Examples\n\n```rescript\nBigInt.asIntN(~width=4, 25n) == -7n\nBigInt.asIntN(~width=4, 3n) == 3n\n```" - ], - "signature": "let asIntN: (~width: int, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.asUintN", - "kind": "value", - "name": "asUintN", - "docstrings": [ - "`asUintN(~width, bigint)` returns a bigint value truncated to the given number of bits as an unsigned integer.\n\nSee [`BigInt.asUintN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/asUintN) on MDN.\n\n## Examples\n\n```rescript\nBigInt.asUintN(~width=4, 25n) == 9n\nBigInt.asUintN(~width=4, 3n) == 3n\n```" - ], - "signature": "let asUintN: (~width: int, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.fromStringOrThrow", - "kind": "value", - "name": "fromStringOrThrow", - "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Return the\nnumber as a `bigint` if successfully parsed. Throws a syntax exception otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromStringOrThrow(\"123\") == 123n\n\nBigInt.fromStringOrThrow(\"\") == 0n\n\nBigInt.fromStringOrThrow(\"0x11\") == 17n\n\nBigInt.fromStringOrThrow(\"0b11\") == 3n\n\nBigInt.fromStringOrThrow(\"0o11\") == 9n\n\n/* catch exception */\nswitch BigInt.fromStringOrThrow(\"a\") {\n| exception JsExn(_error) => assert(true)\n| _bigInt => assert(false)\n}\n```" - ], - "signature": "let fromStringOrThrow: string => bigint" - }, - { - "id": "Stdlib.BigInt.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Returns\n`Some(bigint)` if the string can be parsed, `None` otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromString(\"123\") == Some(123n)\n\nBigInt.fromString(\"\") == Some(0n)\n\nBigInt.fromString(\"0x11\") == Some(17n)\n\nBigInt.fromString(\"0b11\") == Some(3n)\n\nBigInt.fromString(\"0o11\") == Some(9n)\n\nBigInt.fromString(\"invalid\") == None\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.BigInt.fromStringExn", - "kind": "value", - "name": "fromStringExn", - "docstrings": [], - "signature": "let fromStringExn: string => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "`fromInt(int)` converts an `int` to a `bigint`.\n\n## Examples\n\n```rescript\nBigInt.fromInt(123) == 123n\nBigInt.fromInt(0) == 0n\nBigInt.fromInt(-456) == -456n\n```" - ], - "signature": "let fromInt: int => bigint" - }, - { - "id": "Stdlib.BigInt.fromFloatOrThrow", - "kind": "value", - "name": "fromFloatOrThrow", - "docstrings": [ - "Converts a `float` to a `bigint` using JavaScript semantics.\nThrows an exception if the float is not an integer or is infinite/NaN.\n\n## Examples\n\n```rescript\nBigInt.fromFloatOrThrow(123.0) == 123n\n\nBigInt.fromFloatOrThrow(0.0) == 0n\n\nBigInt.fromFloatOrThrow(-456.0) == -456n\n\n/* This will throw an exception */\nswitch BigInt.fromFloatOrThrow(123.5) {\n| exception JsExn(_error) => assert(true)\n| _bigInt => assert(false)\n}\n```" - ], - "signature": "let fromFloatOrThrow: float => bigint" - }, - { - "id": "Stdlib.BigInt.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "`fromFloat(float)` converts a `float` to a `bigint` using JavaScript semantics.\nReturns `Some(bigint)` if the float is a valid `bigint`, `None` otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromFloat(123.0) == Some(123n)\nBigInt.fromFloat(0.0) == Some(0n)\nBigInt.fromFloat(-456.0) == Some(-456n)\nBigInt.fromFloat(123.5) == None\n```" - ], - "signature": "let fromFloat: float => option" - }, - { - "id": "Stdlib.BigInt.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats a `bigint` as a string. Return a `string` representing the given value.\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nBigInt.toString(123n) == \"123\"\n```" - ], - "signature": "let toString: (bigint, ~radix: int=?) => string" - }, - { - "id": "Stdlib.BigInt.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [], - "signature": "let toStringWithRadix: (bigint, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Returns a string with a language-sensitive representation of this BigInt value.\n\n## Examples\n\n```rescript\nBigInt.toString(123n) == \"123\"\n```" - ], - "signature": "let toLocaleString: bigint => string" - }, - { - "id": "Stdlib.BigInt.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [ - "`toFloat(bigint)` converts a `bigint` to a `float`.\n\n## Examples\n\n```rescript\nBigInt.toFloat(123n) == 123.0\nBigInt.toFloat(0n) == 0.0\nBigInt.toFloat(-456n) == -456.0\n```" - ], - "signature": "let toFloat: bigint => float" - }, - { - "id": "Stdlib.BigInt.toInt", - "kind": "value", - "name": "toInt", - "docstrings": [ - "`toInt(bigint)` converts a `bigint` to an `int`.\n\n## Examples\n\n```rescript\nBigInt.toInt(123n) == 123\nBigInt.toInt(0n) == 0\nBigInt.toInt(-456n) == -456\n```" - ], - "signature": "let toInt: bigint => int" - }, - { - "id": "Stdlib.BigInt.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(a, b)` calculates the sum of two bigints.\n\n## Examples\n\n```rescript\nBigInt.add(5n, 3n) == 8n\nBigInt.add(-2n, 7n) == 5n\n```" - ], - "signature": "let add: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.sub", - "kind": "value", - "name": "sub", - "docstrings": [ - "`sub(a, b)` calculates the difference of two bigints.\n\n## Examples\n\n```rescript\nBigInt.sub(8n, 3n) == 5n\nBigInt.sub(2n, 7n) == -5n\n```" - ], - "signature": "let sub: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.mul", - "kind": "value", - "name": "mul", - "docstrings": [ - "`mul(a, b)` calculates the product of two bigints.\n\n## Examples\n\n```rescript\nBigInt.mul(5n, 3n) == 15n\nBigInt.mul(-2n, 7n) == -14n\n```" - ], - "signature": "let mul: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.div", - "kind": "value", - "name": "div", - "docstrings": [ - "`div(a, b)` calculates the quotient of two bigints.\n\n## Examples\n\n```rescript\nBigInt.div(15n, 3n) == 5n\nBigInt.div(14n, 3n) == 4n\n```" - ], - "signature": "let div: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.mod", - "kind": "value", - "name": "mod", - "docstrings": [ - "`mod(a, b)` calculates the remainder of dividing two bigints.\n\n## Examples\n\n```rescript\nBigInt.mod(15n, 4n) == 3n\nBigInt.mod(14n, 3n) == 2n\n```" - ], - "signature": "let mod: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseAnd", - "kind": "value", - "name": "bitwiseAnd", - "docstrings": [ - "`bitwiseAnd(a, b)` calculates the bitwise AND of two bigints.\n\n## Examples\n\n```rescript\nBigInt.bitwiseAnd(7n, 4n) == 4n\nBigInt.bitwiseAnd(15n, 8n) == 8n\n```" - ], - "signature": "let bitwiseAnd: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseOr", - "kind": "value", - "name": "bitwiseOr", - "docstrings": [ - "`bitwiseOr(a, b)` calculates the bitwise OR of two bigints.\n\n## Examples\n\n```rescript\nBigInt.bitwiseOr(7n, 4n) == 7n\nBigInt.bitwiseOr(8n, 4n) == 12n\n```" - ], - "signature": "let bitwiseOr: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseXor", - "kind": "value", - "name": "bitwiseXor", - "docstrings": [ - "`bitwiseXor(a, b)` calculates the bitwise XOR of two bigints.\n\n## Examples\n\n```rescript\nBigInt.bitwiseXor(7n, 4n) == 3n\nBigInt.bitwiseXor(15n, 8n) == 7n\n```" - ], - "signature": "let bitwiseXor: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseNot", - "kind": "value", - "name": "bitwiseNot", - "docstrings": [ - "`bitwiseNot(bigint)` calculates the bitwise NOT of a bigint.\n\n## Examples\n\n```rescript\nBigInt.bitwiseNot(2n) == -3n\nBigInt.bitwiseNot(-1n) == 0n\n```" - ], - "signature": "let bitwiseNot: bigint => bigint" - }, - { - "id": "Stdlib.BigInt.shiftLeft", - "kind": "value", - "name": "shiftLeft", - "docstrings": [ - "`shiftLeft(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the left.\n\n## Examples\n\n```rescript\nBigInt.shiftLeft(4n, 1n) == 8n\nBigInt.shiftLeft(1n, 3n) == 8n\n```" - ], - "signature": "let shiftLeft: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.shiftRight", - "kind": "value", - "name": "shiftRight", - "docstrings": [ - "`shiftRight(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the right.\n\n## Examples\n\n```rescript\nBigInt.shiftRight(8n, 1n) == 4n\nBigInt.shiftRight(16n, 2n) == 4n\n```" - ], - "signature": "let shiftRight: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bigint)` ignores the provided bigint and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: bigint => unit" - }, - { - "id": "Stdlib.BigInt.land", - "kind": "value", - "name": "land", - "docstrings": [ - "`land(a, b)` calculates the bitwise AND of two bigints.\n\n**Deprecated:** Use `&&&` operator or `bitwiseAnd` instead.\n\n## Examples\n\n```rescript\nBigInt.land(7n, 4n) == 4n\n```" - ], - "signature": "let land: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lor", - "kind": "value", - "name": "lor", - "docstrings": [ - "`lor(a, b)` calculates the bitwise OR of two bigints.\n\n**Deprecated:** Use `|||` operator or `bitwiseOr` instead.\n\n## Examples\n\n```rescript\nBigInt.lor(7n, 4n) == 7n\n```" - ], - "signature": "let lor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lxor", - "kind": "value", - "name": "lxor", - "docstrings": [ - "`lxor(a, b)` calculates the bitwise XOR of two bigints.\n\n**Deprecated:** Use `^^^` operator or `bitwiseXor` instead.\n\n## Examples\n\n```rescript\nBigInt.lxor(7n, 4n) == 3n\n```" - ], - "signature": "let lxor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lnot", - "kind": "value", - "name": "lnot", - "docstrings": [ - "`lnot(bigint)` calculates the bitwise NOT of a bigint.\n\n**Deprecated:** Use `~~~` operator or `bitwiseNot` instead.\n\n## Examples\n\n```rescript\nBigInt.lnot(2n) == -3n\n```" - ], - "signature": "let lnot: bigint => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lsl", - "kind": "value", - "name": "lsl", - "docstrings": [ - "`lsl(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the left.\n\n**Deprecated:** Use `<<` operator or `shiftLeft` instead.\n\n## Examples\n\n```rescript\nBigInt.lsl(4n, 1n) == 8n\n```" - ], - "signature": "let lsl: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.asr", - "kind": "value", - "name": "asr", - "docstrings": [ - "`asr(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the right.\n\n**Deprecated:** Use `>>` operator or `shiftRight` instead.\n\n## Examples\n\n```rescript\nBigInt.asr(8n, 1n) == 4n\n```" - ], - "signature": "let asr: (bigint, bigint) => bigint", - "deprecated": "" - } - ] - }, - "stdlib/array": { - "id": "Stdlib.Array", - "name": "Array", - "docstrings": [ - "A mutable array.\n\nCompiles to a regular JavaScript array." - ], - "items": [ - { - "id": "Stdlib.Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an array of value `'a`." - ], - "signature": "type t<'a> = array<'a>" - }, - { - "id": "Stdlib.Array.arrayLike", - "kind": "type", - "name": "arrayLike", - "docstrings": [], - "signature": "type arrayLike<'a>" - }, - { - "id": "Stdlib.Array.asIterable", - "kind": "value", - "name": "asIterable", - "docstrings": [ - "`asIterable(array)` views `array` as an `Iterable.t`.\n\nThis is useful when passing an array to APIs that consume iterables, such as\n`Array.from` or `for...of` in JavaScript." - ], - "signature": "let asIterable: array<'a> => Iterable.t<'a>" - }, - { - "id": "Stdlib.Array.fromIterable", - "kind": "value", - "name": "fromIterable", - "docstrings": [ - "`fromIterable(iterable)` creates an array from the provided `iterable`\n\n## Examples\n\n```rescript\nMap.fromArray([(\"foo\", 1), (\"bar\", 2)])\n->Map.values\n->IteratorObject.asIterable\n->Array.fromIterable == [1, 2]\n```" - ], - "signature": "let fromIterable: Iterable.t<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.fromArrayLike", - "kind": "value", - "name": "fromArrayLike", - "docstrings": [ - "`fromArrayLike(source)` converts an array-like value (anything with indexed items and a `length`) into a regular array.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 10, 1: 20, length: 2}`)\nArray.fromArrayLike(source) == [10, 20]\n```" - ], - "signature": "let fromArrayLike: arrayLike<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.fromArrayLikeWithMap", - "kind": "value", - "name": "fromArrayLikeWithMap", - "docstrings": [ - "`fromArrayLikeWithMap(source, map)` converts an array-like value into an array and applies `map` to every element.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 1, 1: 2, length: 2}`)\nArray.fromArrayLikeWithMap(source, x => x * 10) == [10, 20]\n```" - ], - "signature": "let fromArrayLikeWithMap: (arrayLike<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Stdlib.Array.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(str)` creates an array of each character as a separate string from the provided `str`.\n\n## Examples\n\n```rescript\nArray.fromString(\"abcde\") == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let fromString: string => array" - }, - { - "id": "Stdlib.Array.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(~length, init)` creates an array of length `length` initialized with the value of `init`.\n\n## Examples\n\n```rescript\nArray.make(~length=3, #apple) == [#apple, #apple, #apple]\nArray.make(~length=6, 7) == [7, 7, 7, 7, 7, 7]\n```" - ], - "signature": "let make: (~length: int, 'a) => array<'a>" - }, - { - "id": "Stdlib.Array.fromInitializer", - "kind": "value", - "name": "fromInitializer", - "docstrings": [ - "`fromInitializer(~length, f)`\n\nCreates an array of length `length` initialized with the value returned from `f ` for each index.\n\n## Examples\n\n```rescript\nArray.fromInitializer(~length=3, i => i + 3) == [3, 4, 5]\n\nArray.fromInitializer(~length=7, i => i + 3) == [3, 4, 5, 6, 7, 8, 9]\n```" - ], - "signature": "let fromInitializer: (~length: int, int => 'a) => array<'a>" - }, - { - "id": "Stdlib.Array.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(left, right, predicate)` checks if the two arrays contain the same elements according to the equality `predicate`.\n\n## Examples\n\n```rescript\nArray.equal([1, 2, 3], [1, 2, 3], Int.equal) == true\nArray.equal([1, 2, 3], [1, 3, 2], Int.equal) == false\n```" - ], - "signature": "let equal: (array<'a>, array<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Stdlib.Array.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(left, right, comparator)` compares two arrays element by element using `comparator` and returns an `Ordering`.\n\n## Examples\n\n```rescript\nArray.compare([1, 3], [1, 2], Int.compare) == Ordering.greater\nArray.compare([1, 2], [1, 2], Int.compare) == Ordering.equal\n```" - ], - "signature": "let compare: (array<'a>, array<'a>, ('a, 'a) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.Array.isArray", - "kind": "value", - "name": "isArray", - "docstrings": [ - "`isArray(value)` returns `true` when `value` is a JavaScript array and `false` otherwise.\n\nSee [`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) on MDN.\n\n## Examples\n\n```rescript\nArray.isArray([1, 2, 3]) == true\nArray.isArray(\"not an array\") == false\n```" - ], - "signature": "let isArray: 'a => bool" - }, - { - "id": "Stdlib.Array.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(array)` returns the length of (i.e. number of items in) the array.\n\nSee [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.length == 2\n```" - ], - "signature": "let length: array<'a> => int" - }, - { - "id": "Stdlib.Array.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\n[]->Array.isEmpty->assertEqual(true)\n[1, 2, 3]->Array.isEmpty->assertEqual(false)\n\nlet emptyArray = []\nemptyArray->Array.isEmpty->assertEqual(true)\n\nlet nonEmptyArray = [\"hello\"]\nnonEmptyArray->Array.isEmpty->assertEqual(false)\n```" - ], - "signature": "let isEmpty: array<'a> => bool" - }, - { - "id": "Stdlib.Array.copyAllWithin", - "kind": "value", - "name": "copyAllWithin", - "docstrings": [ - "`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyAllWithin(~target=2) == [100, 101, 100, 101, 102]\narr == [100, 101, 100, 101, 102]\n```" - ], - "signature": "let copyAllWithin: (array<'a>, ~target: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Array.copyWithinToEnd", - "kind": "value", - "name": "copyWithinToEnd", - "docstrings": [ - "`copyWithinToEnd(array, ~target, ~start)` copies starting at element `start` in the given array to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyWithinToEnd(~target=0, ~start=2) == [102, 103, 104, 103, 104]\narr == [102, 103, 104, 103, 104]\n```" - ], - "signature": "let copyWithinToEnd: (array<'a>, ~target: int, ~start: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [ - "`copyWithin(array, ~target, ~start, ~end)` copies starting at element `start` in the given array up to but not including `end` to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105]\narr->Array.copyWithin(~target=1, ~start=2, ~end=5) == [100, 102, 103, 104, 104, 105]\narr == [100, 102, 103, 104, 104, 105]\n```" - ], - "signature": "let copyWithin: (\n array<'a>,\n ~target: int,\n ~start: int,\n ~end: int=?,\n) => array<'a>" - }, - { - "id": "Stdlib.Array.fillAll", - "kind": "value", - "name": "fillAll", - "docstrings": [ - "`fillAll(array, value)` fills the entire `array` with `value`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillAll(9)\nmyArray == [9, 9, 9, 9]\n```" - ], - "signature": "let fillAll: (array<'a>, 'a) => unit", - "deprecated": "" - }, - { - "id": "Stdlib.Array.fillToEnd", - "kind": "value", - "name": "fillToEnd", - "docstrings": [ - "`fillToEnd(array, value, ~start)` fills `array` with `value` from the `start` index.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillToEnd(9, ~start=1)\nmyArray == [1, 9, 9, 9]\n```" - ], - "signature": "let fillToEnd: (array<'a>, 'a, ~start: int) => unit", - "deprecated": "" - }, - { - "id": "Stdlib.Array.fill", - "kind": "value", - "name": "fill", - "docstrings": [ - "`fill(array, value, ~start, ~end)` fills `array` with `value` from `start` to `end`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\n\nmyArray->Array.fill(9)\nmyArray == [9, 9, 9, 9]\n\nmyArray->Array.fill(0, ~start=1)\nmyArray == [9, 0, 0, 0]\n\nmyArray->Array.fill(5, ~start=1, ~end=3)\nmyArray == [9, 5, 5, 0]\n```" - ], - "signature": "let fill: (array<'a>, 'a, ~start: int=?, ~end: int=?) => unit" - }, - { - "id": "Stdlib.Array.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "`pop(array)` removes the last item from `array` and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pop == Some(\"hello\")\n\nsomeArray == [\"hi\"] // Notice last item is gone.\n```" - ], - "signature": "let pop: array<'a> => option<'a>" - }, - { - "id": "Stdlib.Array.push", - "kind": "value", - "name": "push", - "docstrings": [ - "`push(array, item)` appends `item` to the end of `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.push(\"yay\")\n\nsomeArray == [\"hi\", \"hello\", \"yay\"]\n```" - ], - "signature": "let push: (array<'a>, 'a) => unit" - }, - { - "id": "Stdlib.Array.pushMany", - "kind": "value", - "name": "pushMany", - "docstrings": [ - "`pushMany(array, itemsArray)` appends many new items to the end of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pushMany([\"yay\", \"wehoo\"])\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let pushMany: (array<'a>, array<'a>) => unit" - }, - { - "id": "Stdlib.Array.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(array)` reverses the order of the items in `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.reverse\n\nsomeArray == [\"hello\", \"hi\"]\n```" - ], - "signature": "let reverse: array<'a> => unit" - }, - { - "id": "Stdlib.Array.shift", - "kind": "value", - "name": "shift", - "docstrings": [ - "`shift(array)` removes the first item in the array, and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.shift == Some(\"hi\")\n\nsomeArray == [\"hello\"] // Notice first item is gone.\n```" - ], - "signature": "let shift: array<'a> => option<'a>" - }, - { - "id": "Stdlib.Array.toSorted", - "kind": "value", - "name": "toSorted", - "docstrings": [ - "`toSorted(array, comparator)` returns a new, sorted array from `array`, using the `comparator` function.\n\nSee [`Array.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [3, 2, 1]\n\nsomeArray->Array.toSorted(Int.compare) == [1, 2, 3]\n\nsomeArray == [3, 2, 1] // Original unchanged\n```" - ], - "signature": "let toSorted: (array<'a>, ('a, 'a) => Ordering.t) => array<'a>" - }, - { - "id": "Stdlib.Array.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(array, comparator)` sorts `array` in-place using the `comparator` function.\n\nBeware this will *mutate* the array.\n\nSee [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet array = [3, 2, 1]\narray->Array.sort((a, b) => float(a - b))\narray == [1, 2, 3]\n```" - ], - "signature": "let sort: (array<'a>, ('a, 'a) => Ordering.t) => unit" - }, - { - "id": "Stdlib.Array.splice", - "kind": "value", - "name": "splice", - "docstrings": [ - "`splice(array, ~start, ~remove, ~insert)` removes `remove` items starting at `start` and inserts the values from `insert`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) on MDN.\n\n## Examples\n\n```rescript\nlet items = [\"a\", \"b\", \"c\"]\nitems->Array.splice(~start=1, ~remove=1, ~insert=[\"x\"])\nitems == [\"a\", \"x\", \"c\"]\n```" - ], - "signature": "let splice: (\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => unit" - }, - { - "id": "Stdlib.Array.toSpliced", - "kind": "value", - "name": "toSpliced", - "docstrings": [ - "`toSpliced(array, ~start, ~remove, ~insert)` returns a new array with the same edits that `splice` would perform, leaving the original unchanged.\n\nSee [`Array.toSpliced`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced) on MDN.\n\n## Examples\n\n```rescript\nlet original = [1, 2, 3]\nlet updated = original->Array.toSpliced(~start=1, ~remove=1, ~insert=[10])\nupdated == [1, 10, 3]\noriginal == [1, 2, 3]\n```" - ], - "signature": "let toSpliced: (\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => array<'a>" - }, - { - "id": "Stdlib.Array.removeInPlace", - "kind": "value", - "name": "removeInPlace", - "docstrings": [ - "`removeInPlace(array, index)` removes the item at the specified `index` from `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = []\narray->Array.removeInPlace(0)\narray == [] // Removing from an empty array does nothing\n\nlet array2 = [\"Hello\", \"Hi\", \"Good bye\"]\narray2->Array.removeInPlace(1)\narray2 == [\"Hello\", \"Good bye\"] // Removes the item at index 1\n```" - ], - "signature": "let removeInPlace: (array<'a>, int) => unit" - }, - { - "id": "Stdlib.Array.with", - "kind": "value", - "name": "with", - "docstrings": [ - "`with(array, index, value)` returns a copy of `array` where the element at `index` is replaced with `value`.\n\nSee [`Array.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/with) on MDN.\n\n## Examples\n\n```rescript\nlet original = [\"a\", \"b\", \"c\"]\nlet replaced = original->Array.with(1, \"x\")\nreplaced == [\"a\", \"x\", \"c\"]\noriginal == [\"a\", \"b\", \"c\"]\n```" - ], - "signature": "let with: (array<'a>, int, 'a) => array<'a>" - }, - { - "id": "Stdlib.Array.unshift", - "kind": "value", - "name": "unshift", - "docstrings": [ - "`unshift(array, item)` inserts a new item at the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshift(\"yay\")\nsomeArray == [\"yay\", \"hi\", \"hello\"]\n```" - ], - "signature": "let unshift: (array<'a>, 'a) => unit" - }, - { - "id": "Stdlib.Array.unshiftMany", - "kind": "value", - "name": "unshiftMany", - "docstrings": [ - "`unshiftMany(array, itemsArray)` inserts many new items to the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshiftMany([\"yay\", \"wehoo\"])\nsomeArray == [\"yay\", \"wehoo\", \"hi\", \"hello\"]\n```" - ], - "signature": "let unshiftMany: (array<'a>, array<'a>) => unit" - }, - { - "id": "Stdlib.Array.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(array1, array2)` concatenates the two arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\", \"wehoo\"]\n\nlet someArray = array1->Array.concat(array2)\n\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let concat: (array<'a>, array<'a>) => array<'a>" - }, - { - "id": "Stdlib.Array.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(array1, arrays)` concatenates array1 with several other arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\"]\nlet array3 = [\"wehoo\"]\n\nlet someArray = array1->Array.concatMany([array2, array3])\n\nConsole.log(someArray) // [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let concatMany: (array<'a>, array>) => array<'a>" - }, - { - "id": "Stdlib.Array.concatAll", - "kind": "value", - "name": "concatAll", - "docstrings": [ - "`concatAll(arrays)` concatenates all arrays in `arrays`, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n```rescript\nlet arrays = [[\"hi\", \"hello\"], [\"yay\"], [\"wehoo\"]]\n\nlet result = Array.concatAll(arrays)\n\narrays == [[\"hi\", \"hello\"], [\"yay\"], [\"wehoo\"]]\nresult == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let concatAll: array> => array<'a>" - }, - { - "id": "Stdlib.Array.flat", - "kind": "value", - "name": "flat", - "docstrings": [ - "`flat(arrays)` concatenates an array of arrays into a single array.\n\nSee [`Array.flat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) on MDN.\n\n## Examples\n\n```rescript\n[[1], [2], [3, 4]]->Array.flat == [1, 2, 3, 4]\n```" - ], - "signature": "let flat: array> => array<'a>" - }, - { - "id": "Stdlib.Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "`includes(array, item)` checks whether `array` includes `item`, by doing a [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality).\n\nSee [`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.includes(1) == true\n[1, 2]->Array.includes(3) == false\n\n[{\"language\": \"ReScript\"}]->Array.includes({\"language\": \"ReScript\"}) == false // false, because of strict equality\n```" - ], - "signature": "let includes: (array<'a>, 'a) => bool" - }, - { - "id": "Stdlib.Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "`indexOf(array, item, ~from)` returns the index of the provided `item` in `array`, starting the search at `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.indexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOf(2) == 1\n[1, 2]->Array.indexOf(3) == -1\n[1, 2, 1, 2]->Array.indexOf(2, ~from=2) == 3\n\n[{\"language\": \"ReScript\"}]->Array.indexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```" - ], - "signature": "let indexOf: (array<'a>, 'a, ~from: int=?) => int" - }, - { - "id": "Stdlib.Array.indexOfOpt", - "kind": "value", - "name": "indexOfOpt", - "docstrings": [ - "`indexOfOpt(array, item)` returns an option of the index of the provided `item` in `array`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOfOpt(2) == Some(1)\n[1, 2]->Array.indexOfOpt(3) == None\n[{\"language\": \"ReScript\"}]->Array.indexOfOpt({\"language\": \"ReScript\"}) == None // None, because of strict equality\n```" - ], - "signature": "let indexOfOpt: (array<'a>, 'a) => option" - }, - { - "id": "Stdlib.Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (array<'a>, 'a, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Array.join", - "kind": "value", - "name": "join", - "docstrings": [ - "`join(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.join(\" -- \") == \"One -- Two -- Three\"\n```" - ], - "signature": "let join: (array, string) => string" - }, - { - "id": "Stdlib.Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "`joinWith(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinWithUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.joinWith(\" -- \") == \"One -- Two -- Three\"\n```" - ], - "signature": "let joinWith: (array, string) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Array.joinUnsafe", - "kind": "value", - "name": "joinUnsafe", - "docstrings": [ - "`joinUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```" - ], - "signature": "let joinUnsafe: (array<'a>, string) => string" - }, - { - "id": "Stdlib.Array.joinWithUnsafe", - "kind": "value", - "name": "joinWithUnsafe", - "docstrings": [ - "`joinWithUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinWithUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```" - ], - "signature": "let joinWithUnsafe: (array<'a>, string) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(array, item, ~from)` returns the last index of the provided `item` in `array`, searching backwards from `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.lastIndexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 1, 2]->Array.lastIndexOf(2) == 3\n[1, 2]->Array.lastIndexOf(3) == -1\n[1, 2, 1, 2]->Array.lastIndexOf(2, ~from=2) == 1\n\n[{\"language\": \"ReScript\"}]->Array.lastIndexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```" - ], - "signature": "let lastIndexOf: (array<'a>, 'a, ~from: int=?) => int" - }, - { - "id": "Stdlib.Array.lastIndexOfOpt", - "kind": "value", - "name": "lastIndexOfOpt", - "docstrings": [], - "signature": "let lastIndexOfOpt: (array<'a>, 'a) => option" - }, - { - "id": "Stdlib.Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (array<'a>, 'a, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(array, ~start, ~end)` creates a new array of items copied from `array` from `start` until (but not including) `end`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.slice(~start=1, ~end=3) == [2, 3]\n[1, 2, 3, 4]->Array.slice(~start=1) == [2, 3, 4]\n[1, 2, 3, 4]->Array.slice == [1, 2, 3, 4]\n```" - ], - "signature": "let slice: (array<'a>, ~start: int=?, ~end: int=?) => array<'a>" - }, - { - "id": "Stdlib.Array.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(array, start)` creates a new array from `array`, with all items from `array` starting from `start`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.sliceToEnd(~start=1) == [2, 3, 4]\n```" - ], - "signature": "let sliceToEnd: (array<'a>, ~start: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(array)` makes a copy of the array with the items in it, but does not make copies of the items themselves.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3]\nlet copyOfMyArray = myArray->Array.copy\n\ncopyOfMyArray == [1, 2, 3]\n(myArray === copyOfMyArray) == false\n```" - ], - "signature": "let copy: array<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(array)` stringifies `array` by running `toString` on all of the array elements and joining them with \",\".\n\nSee [`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.toString == \"1,2,3,4\"\n```" - ], - "signature": "let toString: array<'a> => string" - }, - { - "id": "Stdlib.Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(array)` converts each element to a locale-aware string and joins them with commas.\n\nSee [`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n[\"apple\", \"banana\"]->Array.toLocaleString == \"apple,banana\"\n```" - ], - "signature": "let toLocaleString: array<'a> => string" - }, - { - "id": "Stdlib.Array.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(array, predicate)` returns true if `predicate` returns true for all items in `array`.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.every(num => num <= 4) == true\n\narray->Array.every(num => num === 1) == false\n```" - ], - "signature": "let every: (array<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Array.everyWithIndex", - "kind": "value", - "name": "everyWithIndex", - "docstrings": [ - "`everyWithIndex(array, checker)` returns true if all items in `array` returns true when running the provided `checker` function.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.everyWithIndex((num, index) => index < 5 && num <= 4) == true\n\narray->Array.everyWithIndex((num, index) => index < 2 && num >= 2) == false\n```" - ], - "signature": "let everyWithIndex: (array<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filter(num => num > 2) == [3, 4]\n```" - ], - "signature": "let filter: (array<'a>, 'a => bool) => array<'a>" - }, - { - "id": "Stdlib.Array.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filterWithIndex((num, index) => index === 0 || num === 2) == [1, 2]\n```" - ], - "signature": "let filterWithIndex: (array<'a>, ('a, int) => bool) => array<'a>" - }, - { - "id": "Stdlib.Array.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.find(item => item == ReScript) == Some(ReScript)\n```" - ], - "signature": "let find: (array<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findWithIndex", - "kind": "value", - "name": "findWithIndex", - "docstrings": [ - "`findWithIndex(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [TypeScript, JavaScript, ReScript]\n\narray->Array.findWithIndex((item, index) => index > 1 && item == ReScript) == Some(ReScript)\n```" - ], - "signature": "let findWithIndex: (array<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findLast", - "kind": "value", - "name": "findLast", - "docstrings": [ - "`findLast(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLast(item => item > 0) == Some(3)\n```" - ], - "signature": "let findLast: (array<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findLastWithIndex", - "kind": "value", - "name": "findLastWithIndex", - "docstrings": [ - "`findLastWithIndex(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLastWithIndex((item, index) => index < 2 && item > 0) == Some(2)\n```" - ], - "signature": "let findLastWithIndex: (array<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [ - "`findIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\narray->Array.findIndex(item => item == ReScript) == 0\n\narray->Array.findIndex(item => item == TypeScript) == -1\n```" - ], - "signature": "let findIndex: (array<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.Array.findIndexWithIndex", - "kind": "value", - "name": "findIndexWithIndex", - "docstrings": [ - "`findIndexWithIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\nlet isReScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == ReScript)\nlet isTypeScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == TypeScript)\n\nisReScriptFirst == 0\nisTypeScriptFirst == -1\n```" - ], - "signature": "let findIndexWithIndex: (array<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.Array.findLastIndex", - "kind": "value", - "name": "findLastIndex", - "docstrings": [ - "`findLastIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, ReScript]\n\narray->Array.findLastIndex(item => item == ReScript) == 2\n\narray->Array.findLastIndex(item => item == TypeScript) == -1\n```" - ], - "signature": "let findLastIndex: (array<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.Array.findLastIndexWithIndex", - "kind": "value", - "name": "findLastIndexWithIndex", - "docstrings": [ - "`findLastIndexWithIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, JavaScript, ReScript]\n\nlet isReScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == ReScript)\nlet isTypeScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == TypeScript)\n\nisReScriptLast == 3\nisTypeScriptLast == -1\n```" - ], - "signature": "let findLastIndexWithIndex: (array<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEach(item => {\n Console.log(item)\n})\n```" - ], - "signature": "let forEach: (array<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Array.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEachWithIndex((item, index) => {\n Console.log(\"At item \" ++ Int.toString(index) ++ \": \" ++ item)\n})\n```" - ], - "signature": "let forEachWithIndex: (array<'a>, ('a, int) => unit) => unit" - }, - { - "id": "Stdlib.Array.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```" - ], - "signature": "let map: (array<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Stdlib.Array.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```" - ], - "signature": "let mapWithIndex: (array<'a>, ('a, int) => 'b) => array<'b>" - }, - { - "id": "Stdlib.Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(xs, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has two parameters: the item from the list and an \"accumulator\"; which starts with a value of `init`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\nArray.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n\n[1, 2, 3]->Array.reduce(list{}, List.add) == list{3, 2, 1}\n\nArray.reduce([], list{}, List.add) == list{}\n```" - ], - "signature": "let reduce: (array<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(x, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has three parameters: the item from the array and an \"accumulator\", which starts with a value of `init` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceWithIndex([1, 2, 3], list{}, (acc, v, i) => list{v + i, ...acc}) == list{5, 3, 1}\n\nArray.reduceWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```" - ], - "signature": "let reduceWithIndex: (array<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [ - "`reduceRight(xs, init, fn)`\n\nWorks like `Array.reduce`; except that function `fn` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nArray.reduceRight([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n\nArray.reduceRight([1, 2, 3], list{}, List.add) == list{1, 2, 3}\n\nArray.reduceRight([], list{}, List.add) == list{}\n```" - ], - "signature": "let reduceRight: (array<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.reduceRightWithIndex", - "kind": "value", - "name": "reduceRightWithIndex", - "docstrings": [ - "`reduceRightWithIndex(xs, init, fn)`\n\nLike `reduceRight`, but with an additional index argument on the callback function.\n\n## Examples\n\n```rescript\nArray.reduceRightWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceRightWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```" - ], - "signature": "let reduceRightWithIndex: (array<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(array, predicate)` returns true if `predicate` returns true for any element in `array`.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.some(greeting => greeting === \"Hello\") == true\n```" - ], - "signature": "let some: (array<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Array.someWithIndex", - "kind": "value", - "name": "someWithIndex", - "docstrings": [ - "`someWithIndex(array, checker)` returns true if running the provided `checker` function on any element in `array` returns true.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.someWithIndex((greeting, index) => greeting === \"Hello\" && index === 0) == true\n```" - ], - "signature": "let someWithIndex: (array<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.Array.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(array, index)` returns the element at `index` of `array`.\n\nReturns `None` if the index does not exist in the array. Equivalent to doing `array[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.get(0) == Some(\"Hello\")\n\narray->Array.get(3) == None\n```" - ], - "signature": "let get: (array<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.Array.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.set(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```" - ], - "signature": "let set: (array<'a>, int, 'a) => unit" - }, - { - "id": "Stdlib.Array.getSymbol", - "kind": "value", - "name": "getSymbol", - "docstrings": [ - "`getSymbol(array, key)` retrieves the value stored under the symbol `key`, if present.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN for more details about symbol keys.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbol(items, key) == Some(\"hello\")\n```" - ], - "signature": "let getSymbol: (array<'a>, Symbol.t) => option<'b>" - }, - { - "id": "Stdlib.Array.getSymbolUnsafe", - "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [ - "`getSymbolUnsafe(array, key)` retrieves the value stored under the symbol `key` without any safety checks.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbolUnsafe(items, key) == \"hello\"\n```" - ], - "signature": "let getSymbolUnsafe: (array<'a>, Symbol.t) => 'b" - }, - { - "id": "Stdlib.Array.setSymbol", - "kind": "value", - "name": "setSymbol", - "docstrings": [ - "`setSymbol(array, key, value)` stores `value` under the symbol `key` on `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"count\")\nlet items = []\nitems->Array.setSymbol(key, 5)\nArray.getSymbol(items, key) == Some(5)\n```" - ], - "signature": "let setSymbol: (array<'a>, Symbol.t, 'b) => unit" - }, - { - "id": "Stdlib.Array.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.getUnsafe` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.getUnsafe(index)\n Console.log(value)\n}\n```" - ], - "signature": "let getUnsafe: (array<'a>, int) => 'a" - }, - { - "id": "Stdlib.Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [ - "`unsafe_get(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.unsafe_get` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.unsafe_get(index)\n Console.log(value)\n}\n```" - ], - "signature": "let unsafe_get: (array<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Array.setUnsafe", - "kind": "value", - "name": "setUnsafe", - "docstrings": [ - "`setUnsafe(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array, and is *unsafe*.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.setUnsafe(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```" - ], - "signature": "let setUnsafe: (array<'a>, int, 'a) => unit" - }, - { - "id": "Stdlib.Array.findIndexOpt", - "kind": "value", - "name": "findIndexOpt", - "docstrings": [ - "`findIndexOpt(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.findIndexOpt(item => item == ReScript) == Some(0)\n```" - ], - "signature": "let findIndexOpt: (array<'a>, 'a => bool) => option" - }, - { - "id": "Stdlib.Array.findLastIndexOpt", - "kind": "value", - "name": "findLastIndexOpt", - "docstrings": [ - "`findIndexOpt(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"hello\", \"world\", \"!\"]\n\narray->Array.findLastIndexOpt(item => item->String.includes(\"o\")) == Some(1)\n```" - ], - "signature": "let findLastIndexOpt: (array<'a>, 'a => bool) => option" - }, - { - "id": "Stdlib.Array.toReversed", - "kind": "value", - "name": "toReversed", - "docstrings": [ - "`toReversed(array)` creates a new array with all items from `array` in reversed order.\n\nSee [`Array.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nlet reversed = someArray->Array.toReversed\n\nreversed == [\"hello\", \"hi\"]\nsomeArray == [\"hi\", \"hello\"] // Original unchanged\n```" - ], - "signature": "let toReversed: array<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.filterMap", - "kind": "value", - "name": "filterMap", - "docstrings": [ - "`filterMap(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMap(item =>\n switch item {\n | \"Hello\" => Some(item->String.length)\n | _ => None\n }\n) == [5]\n\n[1, 2, 3, 4, 5, 6]->Array.filterMap(n => mod(n, 2) == 0 ? Some(n * n) : None) == [4, 16, 36]\n\nArray.filterMap([1, 2, 3, 4, 5, 6], _ => None) == []\n\nArray.filterMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == []\n```" - ], - "signature": "let filterMap: (array<'a>, 'a => option<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.filterMapWithIndex", - "kind": "value", - "name": "filterMapWithIndex", - "docstrings": [ - "`filterMapWithIndex(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMapWithIndex((item, index) =>\n switch item {\n | \"Hello\" => Some(index)\n | _ => None\n }\n) == [0]\n```" - ], - "signature": "let filterMapWithIndex: (array<'a>, ('a, int) => option<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.keepSome", - "kind": "value", - "name": "keepSome", - "docstrings": [ - "`keepSome(arr)`\n\nReturns a new array containing `value` for all elements that are `Some(value)`\nand ignoring every value that is `None`\n\n## Examples\n\n```rescript\nArray.keepSome([Some(1), None, Some(3)]) == [1, 3]\n\nArray.keepSome([Some(1), Some(2), Some(3)]) == [1, 2, 3]\n\nArray.keepSome([None, None, None]) == []\n\nArray.keepSome([]) == []\n```" - ], - "signature": "let keepSome: array> => array<'a>" - }, - { - "id": "Stdlib.Array.toShuffled", - "kind": "value", - "name": "toShuffled", - "docstrings": [ - "`toShuffled(array)` returns a new array with all items in `array` in a random order.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet shuffledArray = array->Array.toShuffled\nConsole.log(shuffledArray)\n\nArray.toShuffled([1, 2, 3])->Array.length == 3\n```" - ], - "signature": "let toShuffled: array<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "`shuffle(array)` randomizes the position of all items in `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.shuffle\nConsole.log(array)\n\nlet array2 = [1, 2, 3]\narray2->Array.shuffle\n\narray2->Array.length == 3\n```" - ], - "signature": "let shuffle: array<'a> => unit" - }, - { - "id": "Stdlib.Array.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMap(item =>\n switch item {\n | ReScript => [1, 2, 3]\n | TypeScript => [4, 5, 6]\n | JavaScript => [7, 8, 9]\n }\n) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\n```" - ], - "signature": "let flatMap: (array<'a>, 'a => array<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.flatMapWithIndex", - "kind": "value", - "name": "flatMapWithIndex", - "docstrings": [ - "`flatMapWithIndex(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMapWithIndex((item, index) =>\n switch item {\n | ReScript => [index]\n | TypeScript => [index, index + 1]\n | JavaScript => [index, index + 1, index + 2]\n }\n) == [0, 1, 2, 2, 3, 4]\n```" - ], - "signature": "let flatMapWithIndex: (array<'a>, ('a, int) => array<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.findMap", - "kind": "value", - "name": "findMap", - "docstrings": [ - "`findMap(arr, fn)`\n\nCalls `fn` for each element and returns the first value from `fn` that is `Some(_)`.\nOtherwise returns `None`\n\n## Examples\n\n```rescript\nArray.findMap([1, 2, 3], n => mod(n, 2) == 0 ? Some(n - 2) : None) == Some(0)\n\nArray.findMap([1, 2, 3, 4, 5, 6], n => mod(n, 2) == 0 ? Some(n - 8) : None) == Some(-6)\n\nArray.findMap([1, 2, 3, 4, 5, 6], _ => None) == None\n\nArray.findMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == None\n```" - ], - "signature": "let findMap: (array<'a>, 'a => option<'b>) => option<'b>" - }, - { - "id": "Stdlib.Array.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "`zip(a, b)` create an array of pairs from corresponding elements of a and b.\nStop with the shorter array.\n\n## Examples\n\n```rescript\nArray.zip([1, 2], [3, 4, 5]) == [(1, 3), (2, 4)]\n```" - ], - "signature": "let zip: (t<'a>, array<'b>) => array<('a, 'b)>" - }, - { - "id": "Stdlib.Array.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "`zipBy(xs, ys, f)` create an array by applying `f` to corresponding elements of\n`xs` and `ys`. Stops with shorter array.\n\nEquivalent to `map(zip(xs, ys), ((a, b)) => f(a, b))`\n\n## Examples\n\n```rescript\nArray.zipBy([1, 2, 3], [4, 5], (a, b) => 2 * a + b) == [6, 9]\n```" - ], - "signature": "let zipBy: (t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>" - }, - { - "id": "Stdlib.Array.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(f, a)` split array into tuple of two arrays based on predicate `f`;\nfirst of tuple where predicate cause true, second where predicate cause false\n\n## Examples\n\n```rescript\nArray.partition([1, 2, 3, 4, 5], x => mod(x, 2) == 0) == ([2, 4], [1, 3, 5])\n\nArray.partition([1, 2, 3, 4, 5], x => mod(x, 2) != 0) == ([1, 3, 5], [2, 4])\n```" - ], - "signature": "let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)" - }, - { - "id": "Stdlib.Array.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "`unzip(a)` takes an array of pairs and creates a pair of arrays. The first array\ncontains all the first items of the pairs; the second array contains all the\nsecond items.\n\n## Examples\n\n```rescript\nArray.unzip([(1, 2), (3, 4)]) == ([1, 3], [2, 4])\n\nArray.unzip([(1, 2), (3, 4), (5, 6), (7, 8)]) == ([1, 3, 5, 7], [2, 4, 6, 8])\n```" - ], - "signature": "let unzip: array<('a, 'b)> => (t<'a>, array<'b>)" - }, - { - "id": "Stdlib.Array.at", - "kind": "value", - "name": "at", - "docstrings": [ - "`at(array, index)`\n\nGet an element by its index. Negative indices count backwards from the last item.\n\n## Examples\n\n```rescript\n[\"a\", \"b\", \"c\"]->Array.at(0) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(2) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(3) == None\n[\"a\", \"b\", \"c\"]->Array.at(-1) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(-3) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(-4) == None\n```" - ], - "signature": "let at: (array<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.Array.last", - "kind": "value", - "name": "last", - "docstrings": [ - "`last(array)` returns the last element of `array`.\n\nReturns `None` if the array is empty.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.last == Some(\"Good bye\")\n\n[]->Array.last == None\n```" - ], - "signature": "let last: array<'a> => option<'a>" - }, - { - "id": "Stdlib.Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(array)` ignores the provided array and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: array<'a> => unit" - }, - { - "id": "Stdlib.Array.entries", - "kind": "value", - "name": "entries", - "docstrings": [ - "`entries(array)` returns a new array iterator object that contains the key/value pairs for each index in the array.\n\nSee [Array.prototype.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: IteratorObject.t<(int, int), unit, unknown> = array->Array.entries\niterator->IteratorObject.toArray == [(0, 5), (1, 6), (2, 7)]\n```" - ], - "signature": "let entries: array<'a> => IteratorObject.t<(int, 'a), unit, unknown>" - }, - { - "id": "Stdlib.Array.values", - "kind": "value", - "name": "values", - "docstrings": [ - "`values(array)` returns a new array iterator object that contains the values for each index in the array.\n\nSee [Array.prototype.values](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: IteratorObject.t = array->Array.values\niterator->IteratorObject.toArray == [5, 6, 7]\n```" - ], - "signature": "let values: array<'a> => IteratorObject.t<'a, unit, unknown>" - } - ] - }, - "stdlib/intervalid": { - "id": "Stdlib.IntervalId", - "name": "IntervalId", - "docstrings": [], - "items": [] - }, - "stdlib/timeoutid": { - "id": "Stdlib.TimeoutId", - "name": "TimeoutId", - "docstrings": [], - "items": [] - } -} \ No newline at end of file diff --git a/apps/docs/data/api/v13.0.0/toc_tree.json b/apps/docs/data/api/v13.0.0/toc_tree.json deleted file mode 100644 index d5c7d052f..000000000 --- a/apps/docs/data/api/v13.0.0/toc_tree.json +++ /dev/null @@ -1 +0,0 @@ -{"belt":{"name":"Belt","path":["belt"],"children":[{"name":"Float","path":["belt","float"],"children":[]},{"name":"Int","path":["belt","int"],"children":[]},{"name":"Result","path":["belt","result"],"children":[]},{"name":"Option","path":["belt","option"],"children":[]},{"name":"HashMap","path":["belt","hashmap"],"children":[{"name":"String","path":["belt","hashmap","string"],"children":[]},{"name":"Int","path":["belt","hashmap","int"],"children":[]}]},{"name":"HashSet","path":["belt","hashset"],"children":[{"name":"String","path":["belt","hashset","string"],"children":[]},{"name":"Int","path":["belt","hashset","int"],"children":[]}]},{"name":"MutableMap","path":["belt","mutablemap"],"children":[{"name":"String","path":["belt","mutablemap","string"],"children":[]},{"name":"Int","path":["belt","mutablemap","int"],"children":[]}]},{"name":"MutableSet","path":["belt","mutableset"],"children":[{"name":"String","path":["belt","mutableset","string"],"children":[]},{"name":"Int","path":["belt","mutableset","int"],"children":[]}]},{"name":"Map","path":["belt","map"],"children":[{"name":"Dict","path":["belt","map","dict"],"children":[]},{"name":"String","path":["belt","map","string"],"children":[]},{"name":"Int","path":["belt","map","int"],"children":[]}]},{"name":"Set","path":["belt","set"],"children":[{"name":"Dict","path":["belt","set","dict"],"children":[]},{"name":"String","path":["belt","set","string"],"children":[]},{"name":"Int","path":["belt","set","int"],"children":[]}]},{"name":"Range","path":["belt","range"],"children":[]},{"name":"List","path":["belt","list"],"children":[]},{"name":"MutableStack","path":["belt","mutablestack"],"children":[]},{"name":"MutableQueue","path":["belt","mutablequeue"],"children":[]},{"name":"SortArray","path":["belt","sortarray"],"children":[{"name":"String","path":["belt","sortarray","string"],"children":[]},{"name":"Int","path":["belt","sortarray","int"],"children":[]}]},{"name":"Array","path":["belt","array"],"children":[]},{"name":"Id","path":["belt","id"],"children":[{"name":"MakeHashable","path":["belt","id","makehashable"],"children":[]},{"name":"MakeHashableU","path":["belt","id","makehashableu"],"children":[]},{"name":"MakeComparable","path":["belt","id","makecomparable"],"children":[]},{"name":"MakeComparableU","path":["belt","id","makecomparableu"],"children":[]}]}]},"dom":{"name":"Dom","path":["dom"],"children":[{"name":"Storage2","path":["dom","storage2"],"children":[]},{"name":"Storage","path":["dom","storage"],"children":[]}]},"js":{"name":"Js","path":["js"],"children":[{"name":"WeakMap","path":["js","weakmap"],"children":[]},{"name":"Map","path":["js","map"],"children":[]},{"name":"WeakSet","path":["js","weakset"],"children":[]},{"name":"Set","path":["js","set"],"children":[]},{"name":"Console","path":["js","console"],"children":[]},{"name":"Result","path":["js","result"],"children":[]},{"name":"Option","path":["js","option"],"children":[]},{"name":"Blob","path":["js","blob"],"children":[]},{"name":"File","path":["js","file"],"children":[]},{"name":"BigInt","path":["js","bigint"],"children":[]},{"name":"Int","path":["js","int"],"children":[]},{"name":"Float","path":["js","float"],"children":[]},{"name":"Types","path":["js","types"],"children":[]},{"name":"TypedArray2","path":["js","typedarray2"],"children":[{"name":"DataView","path":["js","typedarray2","dataview"],"children":[]},{"name":"Float64Array","path":["js","typedarray2","float64array"],"children":[]},{"name":"Float32Array","path":["js","typedarray2","float32array"],"children":[]},{"name":"Uint32Array","path":["js","typedarray2","uint32array"],"children":[]},{"name":"Int32Array","path":["js","typedarray2","int32array"],"children":[]},{"name":"Uint16Array","path":["js","typedarray2","uint16array"],"children":[]},{"name":"Int16Array","path":["js","typedarray2","int16array"],"children":[]},{"name":"Uint8ClampedArray","path":["js","typedarray2","uint8clampedarray"],"children":[]},{"name":"Uint8Array","path":["js","typedarray2","uint8array"],"children":[]},{"name":"Int8Array","path":["js","typedarray2","int8array"],"children":[]},{"name":"ArrayBuffer","path":["js","typedarray2","arraybuffer"],"children":[]}]},{"name":"Typed_array","path":["js","typed_array"],"children":[{"name":"DataView","path":["js","typed_array","dataview"],"children":[]},{"name":"Float64_array","path":["js","typed_array","float64_array"],"children":[]},{"name":"Float64Array","path":["js","typed_array","float64array"],"children":[]},{"name":"Float32_array","path":["js","typed_array","float32_array"],"children":[]},{"name":"Float32Array","path":["js","typed_array","float32array"],"children":[]},{"name":"Uint32Array","path":["js","typed_array","uint32array"],"children":[]},{"name":"Int32_array","path":["js","typed_array","int32_array"],"children":[]},{"name":"Int32Array","path":["js","typed_array","int32array"],"children":[]},{"name":"Uint16Array","path":["js","typed_array","uint16array"],"children":[]},{"name":"Int16Array","path":["js","typed_array","int16array"],"children":[]},{"name":"Uint8ClampedArray","path":["js","typed_array","uint8clampedarray"],"children":[]},{"name":"Uint8Array","path":["js","typed_array","uint8array"],"children":[]},{"name":"Int8Array","path":["js","typed_array","int8array"],"children":[]},{"name":"S","path":["js","typed_array","s"],"children":[]},{"name":"ArrayBuffer","path":["js","typed_array","arraybuffer"],"children":[]},{"name":"Type","path":["js","typed_array","type"],"children":[]}]},{"name":"Obj","path":["js","obj"],"children":[]},{"name":"Math","path":["js","math"],"children":[]},{"name":"Json","path":["js","json"],"children":[{"name":"Kind","path":["js","json","kind"],"children":[]}]},{"name":"Global","path":["js","global"],"children":[]},{"name":"Dict","path":["js","dict"],"children":[]},{"name":"Date","path":["js","date"],"children":[]},{"name":"Promise2","path":["js","promise2"],"children":[]},{"name":"Promise","path":["js","promise"],"children":[]},{"name":"Re","path":["js","re"],"children":[]},{"name":"String2","path":["js","string2"],"children":[]},{"name":"String","path":["js","string"],"children":[]},{"name":"Array2","path":["js","array2"],"children":[]},{"name":"Array","path":["js","array"],"children":[]},{"name":"Exn","path":["js","exn"],"children":[]},{"name":"Null_undefined","path":["js","null_undefined"],"children":[]},{"name":"Nullable","path":["js","nullable"],"children":[]},{"name":"Undefined","path":["js","undefined"],"children":[]},{"name":"Null","path":["js","null"],"children":[]}]},"stdlib":{"name":"Stdlib","path":["stdlib"],"children":[{"name":"BigUint64Array","path":["stdlib","biguint64array"],"children":[{"name":"Constants","path":["stdlib","biguint64array","constants"],"children":[]}]},{"name":"BigInt64Array","path":["stdlib","bigint64array"],"children":[{"name":"Constants","path":["stdlib","bigint64array","constants"],"children":[]}]},{"name":"Uint8ClampedArray","path":["stdlib","uint8clampedarray"],"children":[{"name":"Constants","path":["stdlib","uint8clampedarray","constants"],"children":[]}]},{"name":"Uint32Array","path":["stdlib","uint32array"],"children":[{"name":"Constants","path":["stdlib","uint32array","constants"],"children":[]}]},{"name":"Uint16Array","path":["stdlib","uint16array"],"children":[{"name":"Constants","path":["stdlib","uint16array","constants"],"children":[]}]},{"name":"Uint8Array","path":["stdlib","uint8array"],"children":[{"name":"Constants","path":["stdlib","uint8array","constants"],"children":[]}]},{"name":"Int32Array","path":["stdlib","int32array"],"children":[{"name":"Constants","path":["stdlib","int32array","constants"],"children":[]}]},{"name":"Int16Array","path":["stdlib","int16array"],"children":[{"name":"Constants","path":["stdlib","int16array","constants"],"children":[]}]},{"name":"Int8Array","path":["stdlib","int8array"],"children":[{"name":"Constants","path":["stdlib","int8array","constants"],"children":[]}]},{"name":"Float64Array","path":["stdlib","float64array"],"children":[{"name":"Constants","path":["stdlib","float64array","constants"],"children":[]}]},{"name":"Float32Array","path":["stdlib","float32array"],"children":[{"name":"Constants","path":["stdlib","float32array","constants"],"children":[]}]},{"name":"TypedArray","path":["stdlib","typedarray"],"children":[]},{"name":"ArrayBuffer","path":["stdlib","arraybuffer"],"children":[]},{"name":"WeakSet","path":["stdlib","weakset"],"children":[]},{"name":"Set","path":["stdlib","set"],"children":[]},{"name":"WeakMap","path":["stdlib","weakmap"],"children":[]},{"name":"Map","path":["stdlib","map"],"children":[]},{"name":"AsyncGenerator","path":["stdlib","asyncgenerator"],"children":[]},{"name":"AsyncIterableIterator","path":["stdlib","asynciterableiterator"],"children":[]},{"name":"AsyncIterator","path":["stdlib","asynciterator"],"children":[]},{"name":"AsyncIterable","path":["stdlib","asynciterable"],"children":[]},{"name":"Generator","path":["stdlib","generator"],"children":[]},{"name":"IterableIterator","path":["stdlib","iterableiterator"],"children":[]},{"name":"IteratorObject","path":["stdlib","iteratorobject"],"children":[]},{"name":"Iterator","path":["stdlib","iterator"],"children":[]},{"name":"Iterable","path":["stdlib","iterable"],"children":[]},{"name":"Type","path":["stdlib","type"],"children":[{"name":"Classify","path":["stdlib","type","classify"],"children":[]}]},{"name":"Symbol","path":["stdlib","symbol"],"children":[]},{"name":"String","path":["stdlib","string"],"children":[]},{"name":"Result","path":["stdlib","result"],"children":[]},{"name":"RegExp","path":["stdlib","regexp"],"children":[{"name":"Result","path":["stdlib","regexp","result"],"children":[]}]},{"name":"Promise","path":["stdlib","promise"],"children":[]},{"name":"Pair","path":["stdlib","pair"],"children":[]},{"name":"Ordering","path":["stdlib","ordering"],"children":[]},{"name":"Option","path":["stdlib","option"],"children":[]},{"name":"Object","path":["stdlib","object"],"children":[]},{"name":"Nullable","path":["stdlib","nullable"],"children":[]},{"name":"Null","path":["stdlib","null"],"children":[]},{"name":"Math","path":["stdlib","math"],"children":[{"name":"Int","path":["stdlib","math","int"],"children":[]},{"name":"Constants","path":["stdlib","math","constants"],"children":[]}]},{"name":"List","path":["stdlib","list"],"children":[]},{"name":"Lazy","path":["stdlib","lazy"],"children":[]},{"name":"JSON","path":["stdlib","json"],"children":[{"name":"Decode","path":["stdlib","json","decode"],"children":[]},{"name":"Encode","path":["stdlib","json","encode"],"children":[]},{"name":"Classify","path":["stdlib","json","classify"],"children":[]}]},{"name":"JsExn","path":["stdlib","jsexn"],"children":[]},{"name":"JsError","path":["stdlib","jserror"],"children":[{"name":"URIError","path":["stdlib","jserror","urierror"],"children":[]},{"name":"TypeError","path":["stdlib","jserror","typeerror"],"children":[]},{"name":"SyntaxError","path":["stdlib","jserror","syntaxerror"],"children":[]},{"name":"ReferenceError","path":["stdlib","jserror","referenceerror"],"children":[]},{"name":"RangeError","path":["stdlib","jserror","rangeerror"],"children":[]},{"name":"EvalError","path":["stdlib","jserror","evalerror"],"children":[]}]},{"name":"Intl","path":["stdlib","intl"],"children":[{"name":"Segments","path":["stdlib","intl","segments"],"children":[]},{"name":"Segmenter","path":["stdlib","intl","segmenter"],"children":[]},{"name":"RelativeTimeFormat","path":["stdlib","intl","relativetimeformat"],"children":[]},{"name":"PluralRules","path":["stdlib","intl","pluralrules"],"children":[]},{"name":"NumberFormat","path":["stdlib","intl","numberformat"],"children":[{"name":"Grouping","path":["stdlib","intl","numberformat","grouping"],"children":[]}]},{"name":"Locale","path":["stdlib","intl","locale"],"children":[]},{"name":"ListFormat","path":["stdlib","intl","listformat"],"children":[]},{"name":"DateTimeFormat","path":["stdlib","intl","datetimeformat"],"children":[]},{"name":"Collator","path":["stdlib","intl","collator"],"children":[]},{"name":"Common","path":["stdlib","intl","common"],"children":[]}]},{"name":"Int","path":["stdlib","int"],"children":[{"name":"Ref","path":["stdlib","int","ref"],"children":[]},{"name":"Bitwise","path":["stdlib","int","bitwise"],"children":[]},{"name":"Constants","path":["stdlib","int","constants"],"children":[]}]},{"name":"Float","path":["stdlib","float"],"children":[{"name":"Constants","path":["stdlib","float","constants"],"children":[]}]},{"name":"Error","path":["stdlib","error"],"children":[{"name":"URIError","path":["stdlib","error","urierror"],"children":[]},{"name":"TypeError","path":["stdlib","error","typeerror"],"children":[]},{"name":"SyntaxError","path":["stdlib","error","syntaxerror"],"children":[]},{"name":"ReferenceError","path":["stdlib","error","referenceerror"],"children":[]},{"name":"RangeError","path":["stdlib","error","rangeerror"],"children":[]},{"name":"EvalError","path":["stdlib","error","evalerror"],"children":[]}]},{"name":"Exn","path":["stdlib","exn"],"children":[]},{"name":"Dict","path":["stdlib","dict"],"children":[]},{"name":"Date","path":["stdlib","date"],"children":[{"name":"UTC","path":["stdlib","date","utc"],"children":[]}]},{"name":"DataView","path":["stdlib","dataview"],"children":[]},{"name":"Console","path":["stdlib","console"],"children":[]},{"name":"Bool","path":["stdlib","bool"],"children":[]},{"name":"BigInt","path":["stdlib","bigint"],"children":[]},{"name":"Array","path":["stdlib","array"],"children":[]},{"name":"IntervalId","path":["stdlib","intervalid"],"children":[]},{"name":"TimeoutId","path":["stdlib","timeoutid"],"children":[]}]}} \ No newline at end of file diff --git a/apps/docs/docs-version.json b/apps/docs/docs-version.json new file mode 100644 index 000000000..4543ea595 --- /dev/null +++ b/apps/docs/docs-version.json @@ -0,0 +1,3 @@ +{ + "current": "v12" +} diff --git a/apps/docs/e2e/Breadcrumbs.cy.res b/apps/docs/e2e/Breadcrumbs.cy.res index 25d6ad419..ba30797bc 100644 --- a/apps/docs/e2e/Breadcrumbs.cy.res +++ b/apps/docs/e2e/Breadcrumbs.cy.res @@ -1,15 +1,15 @@ -open Cy +open Cypress let waitForPage = () => { - getByTestId("navbar-primary")->shouldBeVisible->ignore - getByTestId("navbar-tertiary")->shouldBeVisible->ignore - cyWindow()->its("document.readyState")->shouldWithValue("eq", "complete")->ignore + getByTestId("navbar-primary")->should("be.visible")->ignore + getByTestId("navbar-tertiary")->should("be.visible")->ignore + cyWindow()->propertyString("document.readyState")->shouldEqual("complete")->ignore } let expectBreadcrumbsText = text => { getByTestId("breadcrumbs") ->should("be.visible") - ->shouldWithValue("have.text", text) + ->shouldText(text) ->ignore } diff --git a/apps/docs/e2e/Navigation.cy.res b/apps/docs/e2e/Navigation.cy.res index e046d26a3..c123961f9 100644 --- a/apps/docs/e2e/Navigation.cy.res +++ b/apps/docs/e2e/Navigation.cy.res @@ -1,12 +1,12 @@ -open Cy +open Cypress // Wait for the app to fully hydrate before interacting with links. // The production build is pre-rendered so React must attach event // handlers before client-side navigation works. let waitForHydration = () => { - getByTestId("navbar-primary")->shouldBeVisible->ignore - cyWindow()->its("document.readyState")->shouldWithValue("eq", "complete")->ignore - wait(2000) + getByTestId("navbar-primary")->should("be.visible")->ignore + cyWindow()->propertyString("document.readyState")->shouldEqual("complete")->ignore + pause(2000) } // Use short, re-queryable selectors to avoid detached DOM issues. @@ -17,7 +17,7 @@ let waitForHydration = () => { let clickNavLink = (~testId, ~text) => { getByTestId(testId) ->should("be.visible") - ->containsSelectorChainable("a", text) + ->containsChildIn("a", text) ->scrollIntoView ->should("be.visible") ->click @@ -27,7 +27,7 @@ let clickNavLink = (~testId, ~text) => { let clickMobileNavLink = text => { getByTestId("mobile-nav") ->should("be.visible") - ->containsSelectorChainable("a", text) + ->containsChildIn("a", text) ->scrollIntoView ->should("be.visible") ->click @@ -53,8 +53,8 @@ describe("Desktop Navigation", () => { "should navigate to Docs via navbar link", () => { clickNavLink(~testId="navbar-primary-left-content", ~text="Docs") - url()->shouldInclude("/docs/manual/introduction")->ignore - get("h1")->shouldBeVisible->ignore + currentUrl()->shouldInclude("/docs/manual/introduction")->ignore + get("h1")->should("be.visible")->ignore }, ) @@ -62,7 +62,7 @@ describe("Desktop Navigation", () => { "should navigate to Playground via navbar link", () => { clickNavLink(~testId="navbar-primary-left-content", ~text="Playground") - url()->shouldInclude("/try")->ignore + currentUrl()->shouldInclude("/try")->ignore }, ) @@ -70,7 +70,7 @@ describe("Desktop Navigation", () => { "should navigate to Blog via navbar link", () => { clickNavLink(~testId="navbar-primary-left-content", ~text="Blog") - url()->shouldInclude("/blog")->ignore + currentUrl()->shouldInclude("/blog")->ignore }, ) @@ -78,8 +78,8 @@ describe("Desktop Navigation", () => { "should navigate to Community via navbar link", () => { clickNavLink(~testId="navbar-primary-left-content", ~text="Community") - url()->shouldInclude("/community")->ignore - get("h1")->shouldBeVisible->ignore + currentUrl()->shouldInclude("/community")->ignore + get("h1")->should("be.visible")->ignore }, ) @@ -87,10 +87,10 @@ describe("Desktop Navigation", () => { "should navigate home via logo after clicking away", () => { clickNavLink(~testId="navbar-primary-left-content", ~text="Blog") - url()->shouldInclude("/blog")->ignore + currentUrl()->shouldInclude("/blog")->ignore get("a[aria-label='homepage']")->should("be.visible")->first->click->ignore - cyLocation("pathname")->shouldWithValue("eq", "/")->ignore + cyLocation("pathname")->shouldEqual("/")->ignore }, ) }) @@ -101,28 +101,28 @@ describe("Desktop Navigation", () => { () => { // Click Docs in primary nav to reveal the secondary nav clickNavLink(~testId="navbar-primary-left-content", ~text="Docs") - url()->shouldInclude("/docs/manual/introduction")->ignore + currentUrl()->shouldInclude("/docs/manual/introduction")->ignore // Language Manual clickNavLink(~testId="navbar-secondary", ~text="Language Manual") - url()->shouldInclude("/docs/manual/introduction")->ignore + currentUrl()->shouldInclude("/docs/manual/introduction")->ignore // API clickNavLink(~testId="navbar-secondary", ~text="API") - url()->shouldInclude("/docs/manual/api")->ignore + currentUrl()->shouldInclude("/docs/manual/api")->ignore // Guides clickNavLink(~testId="navbar-secondary", ~text="Guides") - url()->shouldInclude("/docs/guides/overview")->ignore + currentUrl()->shouldInclude("/docs/guides/overview")->ignore get("h1")->shouldContainText("Guides")->ignore // Syntax Lookup clickNavLink(~testId="navbar-secondary", ~text="Syntax Lookup") - url()->shouldInclude("/syntax-lookup")->ignore + currentUrl()->shouldInclude("/syntax-lookup")->ignore // React clickNavLink(~testId="navbar-secondary", ~text="React") - url()->shouldInclude("/docs/react/introduction")->ignore + currentUrl()->shouldInclude("/docs/react/introduction")->ignore }, ) }) @@ -142,8 +142,8 @@ describe("Mobile Navigation", () => { "should navigate to Docs via navbar link", () => { clickNavLink(~testId="navbar-primary-left-content", ~text="Docs") - url()->shouldInclude("/docs/manual/introduction")->ignore - get("h1")->shouldBeVisible->ignore + currentUrl()->shouldInclude("/docs/manual/introduction")->ignore + get("h1")->should("be.visible")->ignore }, ) @@ -151,10 +151,10 @@ describe("Mobile Navigation", () => { "should navigate home via logo after clicking away", () => { clickNavLink(~testId="navbar-primary-left-content", ~text="Docs") - url()->shouldInclude("/docs/manual/introduction")->ignore + currentUrl()->shouldInclude("/docs/manual/introduction")->ignore get("a[aria-label='homepage']")->should("be.visible")->first->click->ignore - cyLocation("pathname")->shouldWithValue("eq", "/")->ignore + cyLocation("pathname")->shouldEqual("/")->ignore }, ) }) @@ -165,7 +165,7 @@ describe("Mobile Navigation", () => { () => { openMobileMenu() clickMobileNavLink("Playground") - url()->shouldInclude("/try")->ignore + currentUrl()->shouldInclude("/try")->ignore }, ) @@ -174,7 +174,7 @@ describe("Mobile Navigation", () => { () => { openMobileMenu() clickMobileNavLink("Blog") - url()->shouldInclude("/blog")->ignore + currentUrl()->shouldInclude("/blog")->ignore }, ) @@ -183,8 +183,8 @@ describe("Mobile Navigation", () => { () => { openMobileMenu() clickMobileNavLink("Community") - url()->shouldInclude("/community")->ignore - get("h1")->shouldBeVisible->ignore + currentUrl()->shouldInclude("/community")->ignore + get("h1")->should("be.visible")->ignore }, ) }) @@ -195,35 +195,35 @@ describe("Mobile Navigation", () => { () => { // Click Docs in primary nav to reveal the secondary nav clickNavLink(~testId="navbar-primary-left-content", ~text="Docs") - url()->shouldInclude("/docs/manual/introduction")->ignore + currentUrl()->shouldInclude("/docs/manual/introduction")->ignore // Scroll to top so the secondary nav is visible cyScrollTo("top") // Language Manual clickNavLink(~testId="navbar-secondary", ~text="Language Manual") - url()->shouldInclude("/docs/manual/introduction")->ignore + currentUrl()->shouldInclude("/docs/manual/introduction")->ignore // API cyScrollTo("top") clickNavLink(~testId="navbar-secondary", ~text="API") - url()->shouldInclude("/docs/manual/api")->ignore + currentUrl()->shouldInclude("/docs/manual/api")->ignore // Guides cyScrollTo("top") clickNavLink(~testId="navbar-secondary", ~text="Guides") - url()->shouldInclude("/docs/guides/overview")->ignore + currentUrl()->shouldInclude("/docs/guides/overview")->ignore get("h1")->shouldContainText("Guides")->ignore // Syntax Lookup cyScrollTo("top") clickNavLink(~testId="navbar-secondary", ~text="Syntax Lookup") - url()->shouldInclude("/syntax-lookup")->ignore + currentUrl()->shouldInclude("/syntax-lookup")->ignore // React cyScrollTo("top") clickNavLink(~testId="navbar-secondary", ~text="React") - url()->shouldInclude("/docs/react/introduction")->ignore + currentUrl()->shouldInclude("/docs/react/introduction")->ignore }, ) }) diff --git a/apps/docs/e2e/OgImage.cy.res b/apps/docs/e2e/OgImage.cy.res new file mode 100644 index 000000000..927315bf6 --- /dev/null +++ b/apps/docs/e2e/OgImage.cy.res @@ -0,0 +1,19 @@ +open Cypress + +describe("Open Graph images", () => { + it("renders a PNG for a same-origin documentation page", () => { + let pageUrl = WebAPI.URL.make(~url="/docs/manual/introduction", ~base=baseUrl()) + let url = `/ogimage/index.png?url=${encodeURIComponent(pageUrl.href)}` + + requestWithOptions({url, encoding: "binary"}) + ->then( + response => { + expect(response.status)->equal(200) + expect(response.headers->Dict.get("content-type")->Option.getOr(""))->include_("image/png") + // The PNG signature verifies that the response is an image rather than an HTML error page. + expect(response.body->String.slice(~start=0, ~end=8))->equal("\x89PNG\r\n\x1a\n") + }, + ) + ->ignore + }) +}) diff --git a/apps/docs/e2e/Playground.cy.res b/apps/docs/e2e/Playground.cy.res index 0cc0d4a8d..165510c1e 100644 --- a/apps/docs/e2e/Playground.cy.res +++ b/apps/docs/e2e/Playground.cy.res @@ -1,20 +1,20 @@ -open Cy +open Cypress let waitForHydration = () => { - getByTestId("navbar-primary")->shouldBeVisible->ignore - cyWindow()->its("document.readyState")->shouldWithValue("eq", "complete")->ignore - wait(2000) + getByTestId("navbar-primary")->should("be.visible")->ignore + cyWindow()->propertyString("document.readyState")->shouldEqual("complete")->ignore + pause(2000) } let waitForPlayground = () => { get(".cm-editor")->should("be.visible")->ignore getByTestId("control-panel")->should("be.visible")->ignore - wait(2000) + pause(2000) } let clickNavLink = (~testId, ~text) => { get(`[data-testid="${testId}"] a:visible`) - ->containsChainable(text) + ->containsChild(text) ->click ->ignore } @@ -29,7 +29,7 @@ let compileAndRunImportedCode = () => { ) ->ignore - wait(3000) + pause(3000) contains("JavaScript")->click->ignore get("pre.whitespace-pre-wrap") @@ -39,7 +39,7 @@ let compileAndRunImportedCode = () => { getByTestId("control-panel") ->find("button") - ->containsChainable("Run") + ->containsChild("Run") ->click ->ignore @@ -54,6 +54,7 @@ let v13Versions = [ "v13.0.0-alpha.3", "v13.0.0-alpha.4", "v13.0.0-alpha.5", + "v13.0.0-alpha.6", ] describe("Playground", () => { @@ -63,10 +64,19 @@ describe("Playground", () => { waitForHydration() }) + it("should highlight JavaScript after a direct playground load", () => { + visit("/try") + get(".cm-editor")->should("be.visible")->ignore + get("main")->shouldCss("background-color", "rgb(11, 13, 34)")->ignore + get(".cm-editor")->shouldCss("background-color", "rgb(11, 13, 34)")->ignore + get("pre.whitespace-pre-wrap")->shouldContainText("react/jsx-runtime")->ignore + get("pre code.lang-js span[class^='hljs-']")->should("exist")->ignore + }) + it("should compile and run imported code in the playground", () => { // Navigate to the playground from the homepage clickNavLink(~testId="navbar-primary-left-content", ~text="Playground") - url()->shouldInclude("/try")->ignore + currentUrl()->shouldInclude("/try")->ignore compileAndRunImportedCode() }) @@ -81,7 +91,7 @@ describe("Playground", () => { contains("Settings")->click->ignore get(`select[name="compilerVersions"]`) ->select(version) - ->shouldWithValue("have.value", version) + ->shouldValue(version) ->ignore compileAndRunImportedCode() @@ -89,14 +99,38 @@ describe("Playground", () => { ) }) + it("should run exception code with v13.0.0-alpha.6", () => { + let code = `exception HttpError({status: int}) + +let isRetriable: exn => bool = error => + switch error { + | HttpError({status: 502 | 503 | 504}) => true + | _ => false + } + +Console.log(isRetriable(HttpError({status: 500})))` + let compressedCode = LzString.lzString.compressToEncodedURIComponent(code) + visit(`/try?version=v13.0.0-alpha.6&code=${compressedCode}`) + waitForPlayground() + + get("pre.whitespace-pre-wrap")->shouldContainText("Primitive_exceptions.mjs")->ignore + getByTestId("control-panel") + ->find("button") + ->containsChild("Run") + ->click + ->ignore + + get("div.whitespace-pre-wrap pre")->shouldContainText("false")->ignore + }) + it("should open the landing page example in the playground with code and compiled output", () => { - containsSelector("a", "Edit this example in Playground") + containsIn("a", "Edit this example in Playground") ->scrollIntoView ->should("be.visible") ->click ->ignore - url()->shouldInclude("/try?code=")->ignore + currentUrl()->shouldInclude("/try?code=")->ignore waitForPlayground() get(".cm-content") @@ -114,39 +148,43 @@ describe("Playground", () => { it("should switch to light mode from toast and back to dark mode in settings", () => { // Navigate to playground and wait for initial render clickNavLink(~testId="navbar-primary-left-content", ~text="Playground") - url()->shouldInclude("/try")->ignore + currentUrl()->shouldInclude("/try")->ignore waitForPlayground() // Switch to light mode through the onboarding toast getByTestId("playground-lightmode-toast") ->should("be.visible") ->find("button") - ->containsChainable("Try it now") + ->containsChild("Try it now") ->click ->ignore // Verify playground shell is in light mode - get("main")->shouldWithValue("have.class", "playground-theme-light")->ignore + get("main")->shouldClass("playground-theme-light")->ignore + get("main")->shouldCss("background-color", "rgb(250, 251, 252)")->ignore + get(".cm-editor") + ->shouldCss("background-color", "rgb(255, 255, 255)") + ->ignore cyWindow() - ->its("localStorage") - ->invokeWithArg("getItem", "playgroundTheme") - ->shouldWithValue("eq", "light") + ->thenMap(window => window.localStorage->WebAPI.Storage.getItem("playgroundTheme")) + ->shouldEqual(Null.make("light")) ->ignore // Switch back to dark mode from Settings contains("Settings")->click->ignore get("main") ->find("button") - ->containsChainable("Dark") + ->containsChild("Dark") ->click ->ignore // Verify playground shell is back to dark mode - get("main")->shouldWithValue("have.class", "playground-theme-dark")->ignore + get("main")->shouldClass("playground-theme-dark")->ignore + get("main")->shouldCss("background-color", "rgb(11, 13, 34)")->ignore + get(".cm-editor")->shouldCss("background-color", "rgb(11, 13, 34)")->ignore cyWindow() - ->its("localStorage") - ->invokeWithArg("getItem", "playgroundTheme") - ->shouldWithValue("eq", "dark") + ->thenMap(window => window.localStorage->WebAPI.Storage.getItem("playgroundTheme")) + ->shouldEqual(Null.make("dark")) ->ignore }) }) diff --git a/apps/docs/e2e/WarningFlags.cy.res b/apps/docs/e2e/WarningFlags.cy.res new file mode 100644 index 000000000..62f789c1f --- /dev/null +++ b/apps/docs/e2e/WarningFlags.cy.res @@ -0,0 +1,40 @@ +open Cypress + +let expectSelectedSuggestionInView = (~scrolled, elements) => { + let selected = elements->item(0)->Option.getOrThrow->HtmlRef.fromDom + let parent = selected.parentElement->Null.getOrThrow + let selectedRect = selected->WebAPI.HTMLElement.getBoundingClientRect + let parentRect = parent->WebAPI.HTMLElement.getBoundingClientRect + expect(selectedRect.top)->atLeast(parentRect.top -. 1.0) + expect(parentRect.bottom +. 1.0)->atLeast(selectedRect.bottom) + if scrolled { + expect(parent.scrollTop)->greaterThanFloat(0.0) + } else { + expect(parent.scrollTop)->closeTo(0.0, 1.0) + } +} + +describe("Warning flag suggestions", () => { + it("scrolls the selected suggestion into view in both keyboard directions", () => { + viewport(1280, 720) + visit("/try") + get(".cm-editor")->should("be.visible")->ignore + get("pre.whitespace-pre-wrap")->shouldContainText("react/jsx-runtime")->ignore + containsIn("button", "Settings")->click->ignore + let input = "input[placeholder='Flags']" + get(input)->typeText("+")->ignore + for _ in 1 to 15 { + get(input)->typeText("{downarrow}")->ignore + } + get(".playground-suggestion-active") + ->shouldSatisfy(elements => expectSelectedSuggestionInView(~scrolled=true, elements)) + ->ignore + + for _ in 1 to 15 { + get(input)->typeText("{uparrow}")->ignore + } + get(".playground-suggestion-active") + ->shouldSatisfy(elements => expectSelectedSuggestionInView(~scrolled=false, elements)) + ->ignore + }) +}) diff --git a/apps/docs/e2e/bindings/Cy.res b/apps/docs/e2e/bindings/Cy.res deleted file mode 100644 index d34ef610d..000000000 --- a/apps/docs/e2e/bindings/Cy.res +++ /dev/null @@ -1,141 +0,0 @@ -// -- Chainable type ----------------------------------------------------------- - -type t - -// -- Cypress global commands -------------------------------------------------- - -@val @scope("cy") -external visit: string => unit = "visit" - -@val @scope("cy") -external visitWithOptions: (string, {..}) => unit = "visit" - -@val @scope("cy") -external get: string => t = "get" - -@val @scope("cy") -external contains: string => t = "contains" - -@val @scope("cy") -external containsSelector: (string, string) => t = "contains" - -@val @scope("cy") -external title: unit => t = "title" - -@val @scope("cy") -external url: unit => t = "url" - -@val @scope("cy") -external cyLocation: string => t = "location" - -@val @scope("cy") -external wait: int => unit = "wait" - -@val @scope("cy") -external reload: unit => unit = "reload" - -@val @scope("cy") -external go: string => unit = "go" - -@val @scope("cy") -external viewport: (int, int) => unit = "viewport" - -@val @scope("cy") -external cyScrollTo: string => unit = "scrollTo" - -@val @scope("cy") -external log: string => unit = "log" - -// -- Chainable commands ------------------------------------------------------- - -// Contains (chainable versions) -@send external containsChainable: (t, string) => t = "contains" -@send external containsSelectorChainable: (t, string, string) => t = "contains" - -// Queries -@send external find: (t, string) => t = "find" -@send external first: t => t = "first" -@send external last: t => t = "last" -@send external eq: (t, int) => t = "eq" -@send external children: t => t = "children" -@send external parent: t => t = "parent" -@send external parents: (t, string) => t = "parents" -@send external closest: (t, string) => t = "closest" -@send external next: t => t = "next" -@send external prev: t => t = "prev" -@send external siblings: t => t = "siblings" -@send external filter: (t, string) => t = "filter" -@send external not_: (t, string) => t = "not" - -// Actions -@send external click: t => t = "click" -@send external clickWithOptions: (t, {..}) => t = "click" -@send external dblclick: t => t = "dblclick" -@send external type_: (t, string) => t = "type" -@send external typeWithOptions: (t, string, {..}) => t = "type" -@send external clear: t => t = "clear" -@send external check: t => t = "check" -@send external uncheck: t => t = "uncheck" -@send external select: (t, string) => t = "select" -@send external trigger: (t, string) => t = "trigger" -@send external scrollIntoView: t => t = "scrollIntoView" -@send external focus: t => t = "focus" -@send external blur: t => t = "blur" - -// Assertions -@send external should: (t, string) => t = "should" -@send external shouldWithValue: (t, string, string) => t = "should" -@send external shouldWithKeyValue: (t, string, string, string) => t = "should" -@send external and_: (t, string) => t = "and" -@send external andWithValue: (t, string, string) => t = "and" - -// Traversal -@send external each: (t, t => unit) => t = "each" -@send external then: (t, t => unit) => t = "then" -@send external its: (t, string) => t = "its" - -// Attributes -@send external invoke: (t, string) => t = "invoke" -@send external invokeWithArg: (t, string, string) => t = "invoke" -@send external attr: (t, string) => t = "attr" - -// Visibility & state -@send external asChainable: (t, string) => t = "as" - -// Yielding -@send external within: (t, unit => unit) => t = "within" - -// -- Describe / It (Mocha globals) -------------------------------------------- - -@val external describe: (string, unit => unit) => unit = "describe" -@val external it: (string, unit => unit) => unit = "it" -@val external before: (unit => unit) => unit = "before" -@val external beforeEach: (unit => unit) => unit = "beforeEach" -@val external after: (unit => unit) => unit = "after" -@val external afterEach: (unit => unit) => unit = "afterEach" -@val external context: (string, unit => unit) => unit = "context" - -// -- Window ------------------------------------------------------------------- - -@val @scope("cy") -external cyWindow: unit => t = "window" - -// -- Convenience helpers ------------------------------------------------------ - -let getByTestId = testId => get(`[data-testid="${testId}"]`) - -let getByRole = role => get(`[role="${role}"]`) - -let getByHref = href => get(`a[href="${href}"]`) - -let shouldBeVisible = chain => chain->should("be.visible") - -let shouldBeVisibleAndClick = chain => chain->should("be.visible")->click - -let shouldExist = chain => chain->should("exist") - -let shouldContainText = (chain, text) => chain->shouldWithValue("contain.text", text) - -let shouldHaveAttr = (chain, attr, value) => chain->shouldWithKeyValue("have.attr", attr, value) - -let shouldInclude = (chain, value) => chain->shouldWithValue("include", value) diff --git a/apps/docs/e2e/bindings/Cypress.res b/apps/docs/e2e/bindings/Cypress.res new file mode 100644 index 000000000..02c77791d --- /dev/null +++ b/apps/docs/e2e/bindings/Cypress.res @@ -0,0 +1,242 @@ +type chain<'a> +type elements +type assertion +type spy +type consoleArgument +type consoleCall = {args: array} +@send external getCalls: spy => array = "getCalls" +@val external consoleArgumentString: option => string = "String" +type console +type history +type rec window = { + document: Dom.document, + console: console, + navigator: {clipboard: clipboard}, + scrollY: float, + localStorage: WebAPI.WebStorageAPI.storage, +} +and clipboard +@get external windowHistory: window => history = "history" +@send external replaceState: (history, JSON.t, string, string) => unit = "replaceState" +type response = {status: int, body: string, headers: Dict.t} +type replyResponse = {statusCode: int, headers: Dict.t, body: string} +type networkError = {forceNetworkError: bool} +type fetchResponse +type automation = {command: string, params?: {permissions: array, origin: string}} +type request = {url: string, resourceType: string} +type routeMatcher = {resourceType?: string, pathname?: string} +type searchRouteMatcher = {hostname: RegExp.t, pathname: RegExp.t} +type staticResponse = {statusCode: int, body: JSON.t} +type wrapOptions = {log: bool} +type requestOptions = {url: string, encoding: string} +type visitOptions = {onBeforeLoad: window => unit} +type listenerOptions = {once: bool} +type bounds = {width: float, height: float, top: float} +type url +type elementList +type fontFaceSet +type fontFace +type styleSheetList +type styleSheet +type cssRuleList +type cssRule +type cssStyle + +@val external it: (string, unit => unit) => unit = "it" +@val external beforeEach: (unit => unit) => unit = "beforeEach" +@val external afterEach: (unit => unit) => unit = "afterEach" +@val @scope("cy") external visit: string => unit = "visit" +@val @scope("cy") external visitWithOptions: (string, visitOptions) => unit = "visit" +@val @scope("cy") external viewport: (int, int) => unit = "viewport" +@val @scope("cy") external get: string => chain = "get" +@val @scope("cy") external alias: string => chain<'a> = "get" +@val @scope("cy") external contains: string => chain = "contains" +@val @scope("cy") external containsIn: (string, string) => chain = "contains" +@val @scope("cy") external containsInRegex: (string, RegExp.t) => chain = "contains" +@val @scope("cy") external cyLocation: string => chain = "location" +@val @scope("cy") external cyWindow: unit => chain = "window" +@val @scope("cy") external cyDocument: unit => chain = "document" +@val @scope("cy") external request: string => chain = "request" +@val @scope("cy") external requestWithOptions: requestOptions => chain = "request" +@val @scope("cy") external intercept: (routeMatcher, request => unit) => chain = "intercept" +@val @scope("cy") external interceptAll: (string, request => unit) => chain = "intercept" +@val @scope("cy") external interceptRoute: routeMatcher => chain = "intercept" +@val @scope("cy") +external interceptStatic: (searchRouteMatcher, staticResponse) => chain = "intercept" +@val @scope("cy") +external interceptPattern: (RegExp.t, request => unit) => chain = "intercept" +@val @scope("cy") +external interceptFailurePattern: (RegExp.t, networkError) => chain = "intercept" +@val @scope("cy") +external interceptFailureString: (string, networkError) => chain = "intercept" +@val @scope("cy") +external interceptDeferred: (RegExp.t, unit => promise) => chain = "intercept" +@val @scope("cy") +external interceptDeferredRequest: (routeMatcher, request => promise) => chain = + "intercept" +@val @scope("cy") external wait: string => chain = "wait" +@val @scope("cy") external wrap: 'a => chain<'a> = "wrap" +@val @scope("cy") external wrapWithOptions: ('a, wrapOptions) => chain<'a> = "wrap" +@val @scope("cy") external run: (unit => promise) => chain = "then" +@val @scope("cy") external runPromise: (unit => promise<'a>) => chain<'a> = "then" +@val @scope("cy") external do_: (unit => unit) => chain = "then" +@val @scope("cy") external realPressKey: string => chain = "realPress" +@val @scope("cy") external realPressKeys: array => chain = "realPress" +@val @scope("cy") external reload: unit => unit = "reload" +@val @scope("cy") +external onBeforeLoad: (@as("window:before:load") _, window => unit) => unit = "on" +@val @scope("cy") external spy: (console, @as("error") _) => spy = "spy" +@val @scope("Cypress") +external automate: (@as("remote:debugger:protocol") _, automation) => promise = "automation" +@val @scope("Cypress") external baseUrl: @as("baseUrl") _ => string = "config" +@val @scope("Cypress") external isInteractive: @as("isInteractive") _ => bool = "config" +@val @scope("mocha") external forbidOnly: bool => unit = "forbidOnly" +@module("cypress-real-events/support.js") external realEvents: unit = "default" + +@send external then: (chain<'a>, 'a => unit) => chain = "then" +@send external thenMap: (chain<'a>, 'a => 'b) => chain<'b> = "then" +@send external thenPromise: (chain<'a>, 'a => promise<'b>) => chain<'b> = "then" +@send external should: (chain<'a>, string) => chain<'a> = "should" +@send +external shouldCss: (chain, @as("have.css") _, string, string) => chain = + "should" +@send +external shouldCssProperty: (chain, @as("have.css") _, string) => chain = "should" +@send external shouldInt: (chain<'a>, string, int) => chain<'a> = "should" +@send +external shouldValue: (chain, @as("have.value") _, string) => chain = "should" +@send +external shouldText: (chain, @as("have.text") _, string) => chain = "should" +@send external shouldEqual: (chain<'a>, @as("equal") _, 'a) => chain<'a> = "should" +@send external shouldDeepEqual: (chain<'a>, @as("deep.equal") _, 'a) => chain<'a> = "should" +@send external shouldMatch: (chain<'a>, @as("match") _, RegExp.t) => chain<'a> = "should" +@send external andMatch: (chain, @as("match") _, RegExp.t) => chain = "and" +@send external shouldWithin: (chain, @as("be.within") _, int, int) => chain = "should" +@send +external shouldAttribute: (chain, @as("have.attr") _, string, string) => chain = + "should" +@send +external shouldProperty: (chain, @as("have.prop") _, string, string) => chain = + "should" +@send external attribute: (chain, @as("attr") _, string) => chain = "invoke" +@send external propertyInt: (chain<'a>, string) => chain = "its" +@send external propertyString: (chain<'a>, string) => chain = "its" +@send +external shouldPropertyExist: (chain<'a>, @as("have.property") _, string) => chain<'a> = "should" +@send external shouldSatisfy: (chain<'a>, 'a => unit) => chain<'a> = "should" +@send external click: chain => chain = "click" +@send external first: chain => chain = "first" +@send external typeText: (chain, string) => chain = "type" +@send +external containsChildRegex: (chain, string, RegExp.t) => chain = "contains" +@send external focusElement: chain => chain = "focus" +@send external realClick: chain => chain = "realClick" +@send external realPress: (chain, string) => chain = "realPress" +@send external scrollIntoView: chain => chain = "scrollIntoView" +@send external each: (chain, elements => unit) => chain = "each" +@send external as_: (chain<'a>, string) => chain<'a> = "as" +@send external item: (elements, int) => option = "get" +@get external complete: Dom.element => bool = "complete" +@get external naturalWidth: Dom.element => int = "naturalWidth" +@send external readText: clipboard => promise = "readText" +@send external destroy: request => unit = "destroy" +@set external setRequestAlias: (request, string) => unit = "alias" +@send external reply: (request, replyResponse) => unit = "reply" + +@val external expect: ('a, ~message: string=?) => assertion = "expect" +@send @scope("to") external equal: (assertion, 'a) => unit = "equal" +@send @scope("to") external include_: (assertion, string) => unit = "include" +@send @scope(("to", "not")) external notInclude: (assertion, string) => unit = "include" +@send @scope(("to", "deep")) external deepEqual: (assertion, 'a) => unit = "equal" +@send @scope(("to", "include")) external includeMembers: (assertion, array<'a>) => unit = "members" +@send @scope(("to", "be")) external greaterThan: (assertion, int) => unit = "greaterThan" +@send @scope(("to", "be")) external greaterThanFloat: (assertion, float) => unit = "greaterThan" +@send @scope(("to", "be", "at")) external atLeast: (assertion, float) => unit = "least" +@send @scope(("to", "be")) external closeTo: (assertion, float, float) => unit = "closeTo" +@send @scope("to") external match_: (assertion, RegExp.t) => unit = "match" + +type parser +@new external parser: unit => parser = "DOMParser" +@send external parseHtml: (parser, string, @as("text/html") _) => Dom.document = "parseFromString" +@send external querySelector: (Dom.document, string) => Null.t = "querySelector" +@send external querySelectorAll: (Dom.document, string) => elementList = "querySelectorAll" +@send +external querySelectorFromElement: (Dom.element, string) => Null.t = "querySelector" +@send +external querySelectorAllFromElement: (Dom.element, string) => elementList = "querySelectorAll" +@send +external addEventListenerOnce: (Dom.document, string, unit => unit, listenerOptions) => unit = + "addEventListener" +@get external body: Dom.document => Dom.element = "body" +@get external documentElement: Dom.document => Dom.element = "documentElement" +@get external currentScript: Dom.document => Null.t = "currentScript" +@get external textContent: Dom.element => Null.t = "textContent" +@get external innerHTML: Dom.element => string = "innerHTML" +@get external outerHTML: Dom.element => string = "outerHTML" +@send external getAttribute: (Dom.element, string) => Null.t = "getAttribute" +@send external boundingRect: Dom.element => bounds = "getBoundingClientRect" +@get external alt: Dom.element => string = "alt" +@get external baseURI: Dom.element => string = "baseURI" +@get external currentSrc: Dom.element => string = "currentSrc" +@get external parentElement: Dom.element => Nullable.t = "parentElement" +@get external elementHref: Dom.element => string = "href" +@send external decode: Dom.element => promise = "decode" + +@val @scope("Array") external elementsFrom: elementList => array = "from" +@new external url: string => url = "URL" +@new external urlWithBase: (string, string) => url = "URL" +@get external pathname: url => string = "pathname" +@get external hostname: url => string = "hostname" +@get external urlOrigin: url => string = "origin" +@get external href: url => string = "href" + +@get external fonts: Dom.document => fontFaceSet = "fonts" +@get external fontsReady: fontFaceSet => promise = "ready" +@send external loadFont: (fontFaceSet, string) => promise> = "load" +@send external checkFont: (fontFaceSet, string) => bool = "check" +@val @scope("Array") external fontFacesFrom: fontFaceSet => array = "from" +@get external fontStatus: fontFace => string = "status" +@get external fontLoaded: fontFace => promise = "loaded" + +@send external windowRequestAnimationFrame: (window, float => unit) => int = "requestAnimationFrame" +@send external windowFetch: (window, string) => promise = "fetch" +@get external fetchStatus: fetchResponse => int = "status" +@send external responseText: fetchResponse => promise = "text" + +@get external styleSheets: Dom.document => styleSheetList = "styleSheets" +@val @scope("Array") external styleSheetsFrom: styleSheetList => array = "from" +@get external sheetRules: styleSheet => cssRuleList = "cssRules" +@val @scope("Array") external rulesFrom: cssRuleList => array = "from" +@get external ruleType: cssRule => int = "type" +@get external nestedRules: cssRule => Nullable.t = "cssRules" +@get external cssText: cssRule => string = "cssText" +@get external selectorText: cssRule => string = "selectorText" +@get external ruleStyle: cssRule => cssStyle = "style" +@get external boxSizing: cssStyle => string = "boxSizing" +@get external fontFamily: cssStyle => string = "fontFamily" +@get external fontWeight: cssStyle => string = "fontWeight" +@get external fontStyle: cssStyle => string = "fontStyle" +@send external propertyValue: (cssStyle, string) => string = "getPropertyValue" + +@val external describe: (string, unit => unit) => unit = "describe" +@val @scope("cy") external currentUrl: unit => chain = "url" +@val @scope("cy") external pause: int => unit = "wait" +@val @scope("cy") external cyScrollTo: string => unit = "scrollTo" +@send external find: (chain, string) => chain = "find" +@send external containsChild: (chain, string) => chain = "contains" +@send external containsChildIn: (chain, string, string) => chain = "contains" +@send external select: (chain, string) => chain = "select" +@send +external typeWithOptions: ( + chain, + string, + {"force": bool, "delay": int}, +) => chain = "type" +@send +external shouldContainText: (chain, @as("contain.text") _, string) => chain = + "should" +@send external shouldInclude: (chain, @as("include") _, string) => chain = "should" +@send +external shouldClass: (chain, @as("have.class") _, string) => chain = "should" + +let getByTestId = testId => get(`[data-testid="${testId}"]`) diff --git a/apps/docs/e2e/homepage/Homepage.cy.res b/apps/docs/e2e/homepage/Homepage.cy.res new file mode 100644 index 000000000..b283c84d1 --- /dev/null +++ b/apps/docs/e2e/homepage/Homepage.cy.res @@ -0,0 +1,50 @@ +open Cypress +open HomepageHelpers + +it("homepage hydrates with working links and images", () => { + visit("/") + containsIn("h1", headline)->should("be.visible")->ignore + containsIn("a", "Get started")->shouldAttribute("href", "/docs/manual/installation")->ignore + containsIn("a", "Edit this example in Playground") + ->attribute("href") + ->shouldMatch(/\/try\?code=.+/) + ->ignore + get("img") + ->each(image => { + wrap(image) + ->scrollIntoView + ->shouldSatisfy( + images => { + let image = images->item(0) + expect(image->Option.isSome)->equal(true) + image->Option.forEach( + image => { + expect(image->complete)->equal(true) + expect(image->naturalWidth)->greaterThan(0) + }, + ) + }, + ) + ->ignore + }) + ->ignore +}) + +it("homepage and documentation navigation works in both directions", () => { + visit("/") + containsIn("a", "Docs")->click->ignore + cyLocation("pathname")->shouldEqual("/docs/manual/introduction")->ignore + containsIn("h1", "ReScript")->should("be.visible")->ignore + get(`a[aria-label="homepage"]`)->click->ignore + cyLocation("pathname")->shouldEqual("/")->ignore + containsIn("h1", headline)->should("be.visible")->ignore +}) + +it("mobile navigation opens the packages route", () => { + viewport(375, 812) + visit("/") + get(`button[aria-label="Toggle additional menu"]`)->click->ignore + containsIn("a", "Packages")->should("be.visible")->click->ignore + cyLocation("pathname")->shouldEqual("/packages")->ignore + containsIn("h1", "Libraries & Bindings")->should("be.visible")->ignore +}) diff --git a/apps/docs/e2e/homepage/HomepageFontBreakpoints.cy.res b/apps/docs/e2e/homepage/HomepageFontBreakpoints.cy.res new file mode 100644 index 000000000..f91f0e426 --- /dev/null +++ b/apps/docs/e2e/homepage/HomepageFontBreakpoints.cy.res @@ -0,0 +1,38 @@ +open Cypress +open HomepageHelpers + +let boldFont = "/fonts/subset-Inter-Bold.woff2" + +[375, 1023]->Array.forEach(width => { + it(`homepage at ${width->Int.toString}px does not request the desktop headline font`, () => { + let fontRequests = ref([]) + intercept( + {resourceType: "font"}, + request => { + fontRequests := fontRequests.contents->Array.concat([request.url->url->pathname]) + }, + )->ignore + viewport(width, 900) + visit("/") + containsIn("h1", headline)->shouldCss("font-weight", "600")->ignore + cyDocument() + ->thenPromise(document => document->fonts->fontsReady) + ->then( + _ => { + expect(fontRequests.contents->Array.includes("/fonts/subset-Inter-SemiBold.woff2"))->equal( + true, + ) + expect(fontRequests.contents->Array.includes(boldFont))->equal(false) + }, + ) + ->ignore + }) +}) + +it("the desktop headline font loads at the 1024px breakpoint", () => { + viewport(1024, 900) + interceptRoute({pathname: boldFont})->as_("desktopHeadlineFont")->ignore + visit("/") + containsIn("h1", headline)->shouldCss("font-weight", "700")->ignore + wait("@desktopHeadlineFont")->propertyInt("response.statusCode")->shouldWithin(200, 299)->ignore +}) diff --git a/apps/docs/e2e/homepage/HomepageFontLoading.cy.res b/apps/docs/e2e/homepage/HomepageFontLoading.cy.res new file mode 100644 index 000000000..f204b109e --- /dev/null +++ b/apps/docs/e2e/homepage/HomepageFontLoading.cy.res @@ -0,0 +1,84 @@ +open Cypress +open HomepageHelpers + +let fontFiles = [ + "/fonts/subset-Inter-Regular.woff2", + "/fonts/subset-Inter-SemiBold.woff2", + "/fonts/subset-Inter-Bold.woff2", + "/fonts/red-hat-mono-700.woff2", +] + +let fontDescriptions = [ + `400 1rem "Homepage Inter"`, + `600 1rem "Homepage Inter"`, + `700 1rem "Homepage Inter"`, + `700 1rem "Red Hat Mono"`, +] + +let expectPreload = (link, href) => { + expect(link->getAttribute("href")->Null.toOption)->equal(Some(href)) + expect(link->getAttribute("type")->Null.toOption)->equal(Some("font/woff2")) + expect(link->getAttribute("crossorigin")->Null.toOption)->equal(Some("anonymous")) + expect(link->getAttribute("media")->Null.toOption)->equal( + href === "/fonts/subset-Inter-Bold.woff2" ? Some("(min-width: 1024px)") : None, + ) +} + +it("homepage prerender includes exactly its four local font preloads", () => { + homepageDocument(document => { + let preloads = document->querySelectorAll(`head link[rel="preload"][as="font"]`)->elementsFrom + expect(preloads->Array.length)->equal(fontFiles->Array.length) + preloads->Array.forEachWithIndex( + (link, index) => + fontFiles->Array.get(index)->Option.forEach(href => expectPreload(link, href)), + ) + let html = document->documentElement->outerHTML + expect(html)->notInclude("fonts.googleapis.com") + expect(html)->notInclude("fonts.gstatic.com") + }) +}) + +it("homepage loads all four font faces using only local requests", () => { + let requests = ref([]) + interceptAll("**", request => { + let requestUrl = request.url->url + if ( + request.resourceType === "font" || + requestUrl->hostname === "fonts.googleapis.com" || + requestUrl->hostname === "fonts.gstatic.com" + ) { + requests := requests.contents->Array.concat([requestUrl]) + } + })->ignore + visit("/") + containsIn("h1", headline)->shouldCss("font-weight", "700")->ignore + cyDocument() + ->thenPromise(async document => { + let fontSet = document->Cypress.fonts + let loaded = await fontDescriptions + ->Array.map( + async font => { + let _ = await fontSet->loadFont(font) + (font, true) + }, + ) + ->Promise.all + expect(loaded)->deepEqual(fontDescriptions->Array.map(font => (font, true))) + fontDescriptions->Array.map(font => fontSet->checkFont(font)) + }) + ->shouldDeepEqual([true, true, true, true]) + ->ignore + get("main section")->each(section => wrap(section)->scrollIntoView->ignore)->ignore + cyDocument() + ->thenPromise(document => document->fonts->fontsReady) + ->then(_ => { + expect(requests.contents->Array.map(requestUrl => requestUrl->pathname))->includeMembers( + fontFiles, + ) + let expectedOrigin = baseUrl()->url->urlOrigin + expect( + requests.contents->Array.every(requestUrl => requestUrl->urlOrigin === expectedOrigin), + )->equal(true) + }) + ->ignore +}) diff --git a/apps/docs/e2e/homepage/HomepageFontSources.cy.res b/apps/docs/e2e/homepage/HomepageFontSources.cy.res new file mode 100644 index 000000000..c0b7b7b8d --- /dev/null +++ b/apps/docs/e2e/homepage/HomepageFontSources.cy.res @@ -0,0 +1,117 @@ +open Cypress +open HomepageHelpers + +type fontFace = { + family: string, + weight: string, + style_: string, + source: string, + display: string, + unicodeRange: string, +} + +let rec collectFontFaces = rules => + rules->Array.flatMap(rule => { + if rule->ruleType === 5 { + let style = rule->ruleStyle + [ + { + family: style->fontFamily->String.replaceAll("\"", ""), + weight: style->fontWeight, + style_: style->fontStyle, + source: style->propertyValue("src"), + display: style->propertyValue("font-display"), + unicodeRange: style->propertyValue("unicode-range"), + }, + ] + } else { + switch rule->nestedRules->Nullable.toOption { + | Some(rules) => rules->rulesFrom->collectFontFaces + | None => [] + } + } + }) + +let readFontFaces = () => + cyWindow()->thenMap(window => { + window.document + ->styleSheets + ->styleSheetsFrom + ->Array.flatMap(sheet => sheet->sheetRules->rulesFrom->collectFontFaces) + }) + +let findFontFace = (faces, family, weight, ~style="normal") => + faces->Array.find(face => + face.family === family && face.weight === weight && face.style_ === style + ) + +let requireFontFace = (face, message) => { + expect(face->Option.isSome, ~message)->equal(true) + face->Option.getOrThrow +} + +it("homepage consumes its preloaded Inter faces without bypassing them for local fonts", () => { + visit("/") + containsIn("h1", headline) + ->shouldCssProperty("font-family") + ->andMatch(/^"Homepage Inter", Inter,/) + ->ignore + readFontFaces() + ->then(faces => { + [("400", "Regular"), ("600", "SemiBold"), ("700", "Bold")]->Array.forEach( + ((weight, file)) => { + let homepageFace = + findFontFace(faces, "Homepage Inter", weight)->requireFontFace(`Homepage Inter ${weight}`) + let sharedFace = findFontFace(faces, "Inter", weight)->requireFontFace(`Inter ${weight}`) + expect(homepageFace.source)->match_(/^url\(/) + expect(homepageFace.source)->include_(`/fonts/subset-Inter-${file}.woff2`) + expect(homepageFace.source)->notInclude("local(") + expect(homepageFace.display)->equal("swap") + expect(homepageFace.unicodeRange)->equal(sharedFace.unicodeRange) + expect(sharedFace.source)->match_(/^local\(/) + }, + ) + }) + ->ignore +}) + +it("homepage preserves the existing Medium and Italic font faces", () => { + visit("/") + readFontFaces() + ->then(faces => { + [("500", "normal"), ("400", "italic")]->Array.forEach( + ((weight, style_)) => { + let homepageFace = + findFontFace(faces, "Homepage Inter", weight, ~style=style_)->requireFontFace( + `Homepage Inter ${weight} ${style_}`, + ) + let sharedFace = + findFontFace(faces, "Inter", weight, ~style=style_)->requireFontFace( + `Inter ${weight} ${style_}`, + ) + expect(homepageFace)->deepEqual({...sharedFace, family: "Homepage Inter"}) + }, + ) + }) + ->ignore +}) + +it("documentation keeps its local-first Inter family across homepage navigation", () => { + visit("/") + containsInRegex("a", /^Docs$/)->click->ignore + containsInRegex("h1", /^ReScript$/)->shouldCssProperty("font-family")->andMatch(/^Inter,/)->ignore + readFontFaces() + ->then(faces => { + let sharedFaces = faces->Array.filter(face => face.family === "Inter") + expect(sharedFaces->Array.length)->equal(5) + sharedFaces->Array.forEach(face => expect(face.source)->match_(/^local\(/)) + }) + ->ignore + get(`a[aria-label="homepage"]`)->click->ignore + containsIn("h1", headline) + ->shouldCssProperty("font-family") + ->andMatch(/^"Homepage Inter", Inter,/) + ->ignore + containsInRegex("a", /^Docs$/)->click->ignore + containsInRegex("h1", /^ReScript$/)->shouldCssProperty("font-family")->andMatch(/^Inter,/)->ignore +}) diff --git a/apps/docs/e2e/homepage/HomepageHelpers.res b/apps/docs/e2e/homepage/HomepageHelpers.res new file mode 100644 index 000000000..54bf4f450 --- /dev/null +++ b/apps/docs/e2e/homepage/HomepageHelpers.res @@ -0,0 +1,52 @@ +open Cypress + +let headline = "JavaScript Made Simple for Humans and AI" + +let grantClipboardPermissions = () => { + run(() => + automate({ + command: "Browser.grantPermissions", + params: { + permissions: ["clipboardReadWrite", "clipboardSanitizedWrite"], + origin: baseUrl(), + }, + }) + )->ignore +} + +let denyClipboardPermissions = () => { + run(() => + automate({ + command: "Browser.grantPermissions", + params: {permissions: [], origin: baseUrl()}, + }) + )->ignore +} + +let readClipboard = () => cyWindow()->thenPromise(window => window.navigator.clipboard->readText) + +let homepageDocument = callback => { + request("/") + ->then(response => { + expect(response.status)->equal(200) + callback(parser()->parseHtml(response.body)) + }) + ->ignore +} + +let initialScriptUrls = document => + document + ->querySelectorAll(`link[rel="modulepreload"][href], script[src]`) + ->elementsFrom + ->Array.filterMap(element => + element + ->getAttribute("href") + ->Null.toOption + ->Option.orElse(element->getAttribute("src")->Null.toOption) + ) + +let expectElement = (document, selector) => { + let element = document->querySelector(selector)->Null.toOption + expect(element->Option.isSome, ~message=selector)->equal(true) + element +} diff --git a/apps/docs/e2e/homepage/HomepageHighlighting.cy.res b/apps/docs/e2e/homepage/HomepageHighlighting.cy.res new file mode 100644 index 000000000..e16db0687 --- /dev/null +++ b/apps/docs/e2e/homepage/HomepageHighlighting.cy.res @@ -0,0 +1,92 @@ +open Cypress +open HomepageHelpers + +it("initial homepage scripts exclude example preparation and the syntax runtime", () => { + homepageDocument(document => { + let scripts = document->initialScriptUrls + expect(scripts->Array.length)->greaterThan(0) + scripts->Array.forEach( + asset => + request(asset) + ->then( + response => { + expect(response.status, ~message=asset)->equal(200) + expect(response.body, ~message=asset)->notInclude("compressToEncodedURIComponent") + expect(response.body, ~message=asset)->notInclude("registerLanguage") + expect(response.body, ~message=asset)->notInclude("function Playground$Button(props)") + }, + ) + ->ignore, + ) + }) +}) + +it("content routes highlight JSON on direct loads and cold homepage navigation", () => { + let path = "/docs/manual/build-configuration" + request(`${path}/`) + ->then(response => { + expect(response.status)->equal(200) + let document = parser()->parseHtml(response.body) + let text = + document + ->querySelector("code.lang-json .hljs-attr") + ->Null.toOption + ->Option.flatMap(element => element->textContent->Null.toOption) + expect(text)->equal(Some(`"sources"`)) + }) + ->ignore + visit(`${path}/`) + get("code.lang-json .hljs-attr")->first->shouldText(`"sources"`)->ignore + visit("/") + cyLocation("pathname")->shouldEqual("/")->ignore + containsIn("h1", headline)->should("be.visible")->ignore + containsInRegex("a", /^Docs$/)->click->ignore + containsInRegex("h1", /^ReScript$/)->should("be.visible")->ignore + get("aside:visible") + ->containsChildRegex("a", /^Configuration$/) + ->scrollIntoView + ->click + ->ignore + cyLocation("pathname")->shouldEqual(path)->ignore + get("code.lang-json .hljs-attr")->first->shouldText(`"sources"`)->ignore +}) + +it("prepared examples survive hydration and navigation back from documentation", () => { + homepageDocument(document => { + let examples = ["res", "js"]->Array.map( + language => { + let selector = `code.lang-${language}` + let html = + document + ->querySelector(selector) + ->Null.toOption + ->Option.map(element => element->innerHTML) + ->Option.getOrThrow + (selector, html) + }, + ) + let playgroundHref = + document + ->querySelector(`a[href^="/try?code="]`) + ->Null.toOption + ->Option.flatMap(element => element->getAttribute("href")->Null.toOption) + ->Option.getOrThrow + expect(playgroundHref)->match_(/^\/try\?code=.+/) + examples->Array.forEach(((_, html)) => expect(html)->include_(`Array.forEach( + ((selector, html)) => get(selector)->shouldProperty("innerHTML", html)->ignore, + ) + containsInRegex("a", /^Docs$/)->click->ignore + cyLocation("pathname")->shouldEqual("/docs/manual/introduction")->ignore + get(`a[aria-label="homepage"]`)->click->ignore + cyLocation("pathname")->shouldEqual("/")->ignore + examples->Array.forEach( + ((selector, html)) => + get(selector)->should("be.visible")->shouldProperty("innerHTML", html)->ignore, + ) + containsIn("a", "Edit this example in Playground") + ->shouldAttribute("href", playgroundHref) + ->ignore + }) +}) diff --git a/apps/docs/e2e/homepage/HomepageInitialContent.cy.res b/apps/docs/e2e/homepage/HomepageInitialContent.cy.res new file mode 100644 index 000000000..9116e5dd9 --- /dev/null +++ b/apps/docs/e2e/homepage/HomepageInitialContent.cy.res @@ -0,0 +1,45 @@ +open Cypress +open HomepageHelpers + +let visitWithoutHydration = path => { + // Cypress needs JavaScript itself; empty application modules keep the AUT prerender-only. + interceptPattern(/\/assets\/[^/]+\.js(?:\?.*)?$/, request => { + if /\/entry\.client-[^/]+\.js/->RegExp.test(request.url) { + request->setRequestAlias("clientEntry") + } + request->reply({ + statusCode: 200, + headers: Dict.fromArray([("content-type", "text/javascript")]), + body: "", + }) + })->ignore + visit(path) + wait("@clientEntry")->propertyString("response.body")->shouldEqual("")->ignore +} + +it("homepage paragraphs render without hydration or downloaded fonts", () => { + interceptFailurePattern(/\.(?:woff2?|ttf|otf)(?:\?|$)/, {forceNetworkError: true})->ignore + visitWithoutHydration("/") + get("html")->shouldCss("opacity", "1")->ignore + containsIn("p", "ReScript is a strongly typed language that compiles to clean,") + ->should("be.visible") + ->shouldCss("color", "rgb(105, 107, 125)") + ->ignore + containsIn("p", "Its fast compiler and static type system")->should("be.visible")->ignore +}) + +["/", "/docs/manual/introduction/"]->Array.forEach(path => { + it(`${path} remains readable when the shared stylesheet fails`, () => { + interceptFailureString("**/assets/main-*.css", {forceNetworkError: true}) + ->as_("sharedStylesheet") + ->ignore + visitWithoutHydration(path) + wait("@sharedStylesheet")->shouldPropertyExist("error")->ignore + get("html")->shouldCss("opacity", "1")->ignore + if path === "/" { + containsIn("h1", headline)->should("be.visible")->ignore + } else { + containsInRegex("h1", /^ReScript$/)->should("be.visible")->ignore + } + }) +}) diff --git a/apps/docs/e2e/homepage/HomepageInteractions.cy.res b/apps/docs/e2e/homepage/HomepageInteractions.cy.res new file mode 100644 index 000000000..5243097eb --- /dev/null +++ b/apps/docs/e2e/homepage/HomepageInteractions.cy.res @@ -0,0 +1,83 @@ +open Cypress +open HomepageHelpers + +type clipboardDescriptor = {value: Nullable.t, configurable: bool} + +@val @scope("Object") +external hideClipboardAPI: ('navigator, @as("clipboard") _, clipboardDescriptor) => unit = + "defineProperty" + +@val @scope("cy") +external stubCopyCommand: (Dom.document, @as("execCommand") _) => spy = "stub" +@send external returns: (spy, bool) => spy = "returns" + +it("community gallery supports keyboard selection and wraps to the first photo", () => { + visit("/") + containsIn("h1", headline)->realClick->ignore + let first = `button[aria-label="Show community photo 1"]` + let third = `button[aria-label="Show community photo 3"]` + let next = `button[aria-label="Next community photo"]` + + get(first)->shouldAttribute("aria-pressed", "true")->ignore + get(third)->scrollIntoView->focusElement->realPress("Enter")->ignore + get(third)->shouldAttribute("aria-pressed", "true")->should("be.focused")->ignore + get(`img[alt="ReScript community photo 3"]`)->should("be.visible")->ignore + get(next)->focusElement->realPress("Space")->ignore + get(first)->shouldAttribute("aria-pressed", "true")->ignore + get(next)->should("be.focused")->ignore + get(`img[alt="ReScript community photo 1"]`)->should("be.visible")->ignore +}) + +it("clipboard failure can recover and both install commands can be copied repeatedly", () => { + denyClipboardPermissions() + visitWithOptions( + "/", + { + onBeforeLoad: window => { + // Denying the native API still allows the legacy copy command, so fail it too. + window.document->stubCopyCommand->returns(false)->ignore + }, + }, + ) + let first = `button[aria-label="Copy npm install rescript command"]` + get(`[role="status"]`)->shouldInt("have.length", 2)->ignore + get(`button [role="status"]`)->should("not.exist")->ignore + get(first)->realClick->ignore + containsIn(`[role="status"]`, "Could not copy. Try again.")->should("be.visible")->ignore + get(first)->should("be.enabled")->ignore + get("textarea")->should("not.exist")->ignore + grantClipboardPermissions() + + ["npm install rescript", "npx create-rescript-app"]->Array.forEach(command => { + let button = `button[aria-label="Copy ${command} command"]` + get(button)->realClick->ignore + containsIn(`[role="status"]`, "Copied!")->should("be.visible")->ignore + get(button)->should("be.disabled")->ignore + readClipboard()->shouldEqual(command)->ignore + get(button)->should("be.enabled")->ignore + contains("Copied!")->should("not.exist")->ignore + get(button)->realClick->ignore + contains("Copied!")->should("be.visible")->ignore + get(button)->should("be.enabled")->ignore + }) +}) + +it("copying falls back when the Clipboard API is unavailable", () => { + grantClipboardPermissions() + let nativeClipboard = ref(None) + visitWithOptions( + "/", + { + onBeforeLoad: window => { + nativeClipboard := Some(window.navigator.clipboard) + hideClipboardAPI(window.navigator, {value: Nullable.undefined, configurable: true}) + }, + }, + ) + get(`button[aria-label="Copy npm install rescript command"]`)->realClick->ignore + containsIn(`[role="status"]`, "Copied!")->should("be.visible")->ignore + runPromise(() => nativeClipboard.contents->Option.getOrThrow->readText) + ->shouldEqual("npm install rescript") + ->ignore + get("textarea")->should("not.exist")->ignore +}) diff --git a/apps/docs/e2e/homepage/HomepageMedia.cy.res b/apps/docs/e2e/homepage/HomepageMedia.cy.res new file mode 100644 index 000000000..da99a441a --- /dev/null +++ b/apps/docs/e2e/homepage/HomepageMedia.cy.res @@ -0,0 +1,292 @@ +open Cypress +open HomepageHelpers + +type candidate = {url: string, width: int} + +let responsiveNames = [ + "ReScript community photo 1", + "ReScript editor tooling", + "ReScript JavaScript output", +] + +let candidates = sourceSet => + sourceSet + ->String.split(",") + ->Array.map(candidate => { + let parts = candidate->String.trim->String.split(" ")->Array.filter(part => part !== "") + { + url: parts->Array.get(0)->Option.getOrThrow, + width: parts + ->Array.get(1) + ->Option.flatMap(part => part->String.replace("w", "")->Int.fromString) + ->Option.getOrThrow, + } + }) + +let imagePreloadUrls = document => + document + ->querySelectorAll(`link[rel="preload"][as="image"]`) + ->elementsFrom + ->Array.flatMap(link => { + let sourceUrls = + link + ->getAttribute("imagesrcset") + ->Null.toOption + ->Option.map(sourceSet => sourceSet->candidates->Array.map(entry => entry.url)) + ->Option.getOr([]) + link + ->getAttribute("href") + ->Null.toOption + ->Option.map(href => [href, ...sourceUrls]) + ->Option.getOr(sourceUrls) + }) + +let expectAvailableImage = (url, format) => + requestWithOptions({url, encoding: "binary"})->then(response => { + expect(response.status, ~message=url)->equal(200) + expect(response.headers->Dict.get("content-type")->Option.getOr(""), ~message=url)->include_( + `image/${format}`, + ) + expect(response.body->String.length, ~message=url)->greaterThan(0) + }) + +let requireElement = (element, message) => { + expect(element->Option.isSome, ~message)->equal(true) + element->Option.getOrThrow +} + +let expectAvailableCandidates = (element, format, preloadedImages) => { + let entries = element->getAttribute("srcset")->Null.toOption->Option.getOr("")->candidates + expect(entries->Array.map(entry => entry.width))->deepEqual([360, 640, 1000]) + entries->Array.forEach(entry => { + expect(preloadedImages->Array.includes(entry.url))->equal(false) + expectAvailableImage(entry.url, format)->ignore + }) +} + +let expectResponsivePicture = (picture, preloadedImages) => { + let sources = picture->querySelectorAllFromElement("source")->elementsFrom + expect(sources->Array.length)->equal(1) + let source = sources->Array.get(0)->requireElement("responsive picture source") + let image = + picture + ->querySelectorFromElement("img") + ->Null.toOption + ->requireElement("responsive picture image") + expect(source->getAttribute("type")->Null.toOption)->equal(Some("image/avif")) + expect(image->getAttribute("loading")->Null.toOption)->equal(Some("lazy")) + expect(image->getAttribute("decoding")->Null.toOption)->equal(Some("async")) + let sizes = image->getAttribute("sizes")->Null.toOption->Option.getOrThrow + expect(sizes === "")->equal(false) + expect(source->getAttribute("sizes")->Null.toOption)->equal(Some(sizes)) + expectAvailableCandidates(source, "avif", preloadedImages) + expectAvailableCandidates(image, "webp", preloadedImages) + expectAvailableImage(image->getAttribute("src")->Null.toOption->Option.getOr(""), "webp")->ignore +} + +let mediaBounds = window => + window.document + ->querySelectorAll("main img, main video") + ->elementsFrom + ->Array.map(element => { + let bounds = element->boundingRect + let hasBox = bounds.width !== 0.0 || bounds.height !== 0.0 + { + width: bounds.width, + height: bounds.height, + top: hasBox ? bounds.top +. window.scrollY : 0.0, + } + }) + +let captureReservedLayout = async window => { + window.document->body->boundingRect->ignore + let loadingFonts = + window.document + ->fonts + ->fontFacesFrom + ->Array.filter(font => font->fontStatus === "loading") + ->Array.map(font => font->fontLoaded) + let _ = await loadingFonts->Promise.all + await Promise.make((resolve, _) => + window->windowRequestAnimationFrame(_ => resolve(window->mediaBounds))->ignore + ) +} + +let visitBeforeImageResponses = () => { + let snapshot = Promise.withResolvers() + let release = snapshot.promise->Promise.then(_ => Promise.resolve()) + interceptDeferredRequest({resourceType: "image"}, _ => release)->ignore + visitWithOptions( + "/", + { + onBeforeLoad: window => + window.document->addEventListenerOnce( + "DOMContentLoaded", + () => { + let capture = async () => { + let reserved = await window->captureReservedLayout + snapshot.resolve(reserved) + } + capture()->ignore + }, + {once: true}, + ), + }, + ) + runPromise(() => snapshot.promise) +} + +let decodeHomepageImages = () => { + get("main section")->each(section => wrap(section)->scrollIntoView->ignore)->ignore + get("img") + ->each(image => + wrap(image) + ->scrollIntoView + ->shouldSatisfy(images => { + let image = images->item(0)->requireElement("homepage image") + expect(image->complete, ~message=image->alt)->equal(true) + expect(image->naturalWidth, ~message=image->alt)->greaterThan(0) + }) + ->thenPromise(images => images->item(0)->requireElement("homepage image")->decode) + ->ignore + ) + ->ignore + cyWindow()->thenPromise(window => window.document->fonts->fontsReady)->ignore +} + +let expectSelectedCandidate = (name, expectedWidth) => + get(`img[alt="${name}"]`) + ->scrollIntoView + ->thenPromise(async images => { + let image = images->item(0)->requireElement(name) + await image->decode + let source = + image + ->parentElement + ->Nullable.toOption + ->Option.flatMap(parent => parent->querySelectorFromElement("source")->Null.toOption) + ->requireElement(`${name} source`) + let selected = + source + ->getAttribute("srcset") + ->Null.toOption + ->Option.getOr("") + ->candidates + ->Array.find(entry => entry.url->urlWithBase(image->baseURI)->href === image->currentSrc) + ->requireElement(`${name} selected AVIF candidate`) + expect(selected.width)->equal(expectedWidth) + let imageBounds = image->boundingRect + expect(selected.width->Float.fromInt)->atLeast(imageBounds.width) + }) + +it("prerendered homepage reserves dimensions for every image and video", () => { + homepageDocument(document => { + let images = document->querySelectorAll("img")->elementsFrom + let videos = document->querySelectorAll("video")->elementsFrom + expect(images->Array.length)->equal(63) + expect(videos->Array.length)->equal(3) + images + ->Array.concat(videos) + ->Array.forEach( + element => { + let source = + element + ->getAttribute("src") + ->Null.toOption + ->Option.orElse(element->getAttribute("poster")->Null.toOption) + ->Option.getOr("") + expect( + element + ->getAttribute("width") + ->Null.toOption + ->Option.flatMap(Float.fromString) + ->Option.getOr(0.0), + ~message=source, + )->greaterThanFloat(0.0) + expect( + element + ->getAttribute("height") + ->Null.toOption + ->Option.flatMap(Float.fromString) + ->Option.getOr(0.0), + ~message=source, + )->greaterThanFloat(0.0) + }, + ) + videos->Array.forEach( + video => expect(video->getAttribute("preload")->Null.toOption)->equal(Some("none")), + ) + }) +}) + +it("prerendered responsive media exposes valid AVIF and WebP candidates", () => { + homepageDocument(document => { + let pictures = document->querySelectorAll("picture")->elementsFrom + expect(pictures->Array.length)->equal(3) + let preloadedImages = document->imagePreloadUrls + pictures->Array.forEach(picture => expectResponsivePicture(picture, preloadedImages)) + }) +}) + +[375, 1440]->Array.forEach(width => { + it(`responsive images select appropriately sized files at ${width->Int.toString}px`, () => { + viewport(width, 900) + visit("/") + responsiveNames->Array.forEach( + name => { + let expectedWidth = width === 375 && name !== "ReScript community photo 1" ? 360 : 640 + expectSelectedCandidate(name, expectedWidth)->ignore + }, + ) + [2, 3]->Array.forEach( + index => { + get(`button[aria-label="Show community photo ${index->Int.toString}"]`)->click->ignore + expectSelectedCandidate(`ReScript community photo ${index->Int.toString}`, 640)->ignore + get(`img[alt="ReScript community photo ${index->Int.toString}"]`) + ->should("be.visible") + ->shouldAttribute("width", index === 2 ? "1355" : "1000") + ->shouldAttribute("height", index === 2 ? "904" : "667") + ->ignore + }, + ) + }) + + it( + `homepage media reserves its loaded layout before image responses at ${width->Int.toString}px`, + () => { + viewport(width, 900) + visitBeforeImageResponses() + ->then( + reserved => { + decodeHomepageImages() + cyWindow() + ->then( + window => { + let loaded = window->mediaBounds + expect(loaded->Array.length)->equal(reserved->Array.length) + loaded->Array.forEachWithIndex( + (bounds, index) => { + let expected = reserved->Array.get(index)->Option.getOrThrow + expect(bounds.width, ~message=`media ${index->Int.toString} width`)->closeTo( + expected.width, + 0.5, + ) + expect(bounds.height, ~message=`media ${index->Int.toString} height`)->closeTo( + expected.height, + 0.5, + ) + expect(bounds.top, ~message=`media ${index->Int.toString} top`)->closeTo( + expected.top, + 0.5, + ) + }, + ) + }, + ) + ->ignore + }, + ) + ->ignore + }, + ) +}) diff --git a/apps/docs/e2e/homepage/HomepagePrerender.cy.res b/apps/docs/e2e/homepage/HomepagePrerender.cy.res new file mode 100644 index 000000000..d87622f44 --- /dev/null +++ b/apps/docs/e2e/homepage/HomepagePrerender.cy.res @@ -0,0 +1,18 @@ +open Cypress +open HomepageHelpers + +it("homepage response contains prerendered content and highlighted examples", () => { + homepageDocument(document => { + let text = document->body->textContent->Null.getOr("") + expect(text)->include_(headline) + expect(text)->include_("Write in ReScript") + expectElement(document, "code.lang-res span")->ignore + expectElement(document, "code.lang-js span")->ignore + expectElement(document, `a[href="/docs/manual/installation"]`)->ignore + expectElement(document, `a[href^="/try?code="]`)->Option.forEach( + link => { + expect(link->getAttribute("href")->Null.getOr(""))->match_(/\/try\?code=.+/) + }, + ) + }) +}) diff --git a/apps/docs/e2e/homepage/HomepageRouteCss.cy.res b/apps/docs/e2e/homepage/HomepageRouteCss.cy.res new file mode 100644 index 000000000..222cdc73d --- /dev/null +++ b/apps/docs/e2e/homepage/HomepageRouteCss.cy.res @@ -0,0 +1,190 @@ +open Cypress +open HomepageHelpers + +type foundationCounts = { + fonts: int, + uniqueFonts: int, + tokens: array, + resets: int, +} + +let homepageLayoutSelectors = [ + ".max-w-1060", + ".md\\:grid-cols-10", + ".md\\:col-span-6", + ".min-h-148", +] + +let expectDesktopLogo = () => { + get(`a[aria-label="homepage"]`) + ->shouldCss("width", "128px") + ->shouldCss("height", "40px") + ->ignore + get(`a[aria-label="homepage"] img[alt="ReScript Home"]`)->should("be.visible")->ignore +} + +let loadedStyles = () => + cyWindow()->thenPromise(async window => { + let styles = await window.document + ->querySelectorAll(`link[rel="stylesheet"]`) + ->elementsFrom + ->Array.map(async link => { + let response = await window->windowFetch(link->elementHref) + expect(response->fetchStatus, ~message=link->elementHref)->equal(200) + await response->responseText + }) + ->Promise.all + styles->Array.join("\n") + }) + +let rec flattenRules = rules => + rules->Array.flatMap(rule => + switch rule->nestedRules->Nullable.toOption { + | Some(nested) => [rule]->Array.concat(nested->rulesFrom->flattenRules) + | None => [rule] + } + ) + +let foundationCounts = window => { + let rules = + window.document + ->styleSheets + ->styleSheetsFrom + ->Array.flatMap(sheet => sheet->sheetRules->rulesFrom->flattenRules) + let fonts = rules->Array.filter(rule => rule->ruleType === 5)->Array.map(rule => rule->cssText) + let styles = rules->Array.filter(rule => rule->ruleType === 1) + let tokens = + ["--font-sans", "--color-gray-90", "--color-fire", "--text-48"]->Array.map(token => + styles->Array.filter(rule => rule->ruleStyle->propertyValue(token) !== "")->Array.length + ) + let uniqueFonts = + fonts->Array.reduce([], (unique, font) => + unique->Array.includes(font) ? unique : unique->Array.concat([font]) + ) + let resets = styles->Array.filter(rule => + rule + ->selectorText + ->String.split(",") + ->Array.some(selector => selector->String.trim === "*") && + rule->ruleStyle->boxSizing === "border-box" + ) + { + fonts: fonts->Array.length, + uniqueFonts: uniqueFonts->Array.length, + tokens, + resets: resets->Array.length, + } +} + +let expectContentStyles = () => + loadedStyles()->then(styles => { + expect(styles)->include_(".markdown-body") + expect(styles)->notInclude(".playground-theme") + homepageLayoutSelectors->Array.forEach(selector => expect(styles)->notInclude(selector)) + }) + +it("homepage styles exclude content, search, and playground rules", () => { + visit("/") + containsIn("h1", headline)->should("be.visible")->ignore + loadedStyles() + ->then(styles => { + expect(styles)->include_(".gallery-selector") + homepageLayoutSelectors->Array.forEach(selector => expect(styles)->include_(selector)) + [".markdown-body", ".playground-theme", ".DocSearch-Modal"]->Array.forEach( + selector => expect(styles)->notInclude(selector), + ) + }) + ->ignore +}) + +it("shared foundations are emitted once across route navigation", () => { + visit("/") + cyWindow() + ->thenMap(foundationCounts) + ->then(initial => { + expect(initial.fonts)->greaterThan(0) + expect(initial.uniqueFonts)->equal(initial.fonts) + expect(initial.tokens)->deepEqual([1, 1, 1, 1]) + expect(initial.resets)->equal(1) + containsInRegex("a", /^Docs$/)->click->ignore + containsInRegex("h1", /^ReScript$/)->should("be.visible")->ignore + cyWindow()->thenMap(foundationCounts)->shouldDeepEqual(initial)->ignore + get(`a[aria-label="homepage"]`)->click->ignore + containsIn("h1", headline)->shouldCss("font-size", "68px")->ignore + cyWindow()->thenMap(foundationCounts)->shouldDeepEqual(initial)->ignore + }) + ->ignore +}) + +it("desktop navigation keeps its responsive logo across route stylesheets", () => { + visit("/") + expectDesktopLogo() + containsInRegex("a", /^Docs$/)->click->ignore + containsInRegex("h1", /^ReScript$/)->should("be.visible")->ignore + expectDesktopLogo() + get(`a[aria-label="homepage"]`)->click->ignore + containsIn("h1", headline)->should("be.visible")->ignore + expectDesktopLogo() +}) + +it("documentation styles are prefetched only after navigation intent", () => { + visit("/") + // The prerendered link is visible before its focus handler is attached. Wait + // for the client router and a React state update before focusing it. + cyWindow()->shouldPropertyExist("__reactRouterDataRouter")->ignore + get(`button[aria-label="Show community photo 2"]`) + ->click + ->shouldAttribute("aria-pressed", "true") + ->ignore + let prefetch = `link[rel="prefetch"][as="style"][href*="/content-"]` + get(prefetch)->should("not.exist")->ignore + containsInRegex("a", /^Get started$/)->focusElement->ignore + get(prefetch)->shouldInt("have.length", 1)->ignore + containsInRegex("a", /^Docs$/)->focusElement->ignore + get(prefetch)->should("not.exist")->ignore +}) + +[ + ("/docs/manual/introduction/", "ReScript"), + ("/brand/", "Brand Assets"), + ("/packages/", "Libraries & Bindings"), +]->Array.forEach(((path, title)) => { + it(`cold ${path} loads its content styles`, () => { + visit(path) + containsIn("h1", title) + ->should("be.visible") + ->shouldCss("font-weight", "600") + ->shouldCss("font-size", "48px") + ->ignore + expectContentStyles()->ignore + }) +}) + +it("cold blog styles preserve article typography", () => { + visit("/blog/") + get("h2") + ->first + ->should("be.visible") + ->shouldCss("font-size", "48px") + ->shouldCss("font-weight", "600") + ->ignore + expectContentStyles()->ignore +}) + +it("mobile documentation drawer retains its layout after navigation", () => { + viewport(375, 812) + visit("/") + containsInRegex("a", /^Docs$/)->click->ignore + containsInRegex("h1", /^ReScript$/)->should("be.visible")->ignore + get(`button[aria-label="Toggle navigation menu"]`)->click->ignore + get("dialog#mobile-tertiary-drawer") + ->as_("drawer") + ->should("be.visible") + ->shouldCss("background-color", "rgb(255, 255, 255)") + ->shouldCss("margin-left", "0px") + ->ignore + alias("@drawer")->containsChildRegex("a", /^Installation$/)->click->ignore + containsInRegex("h1", /^Installation$/)->should("be.visible")->ignore + realPressKey("Escape")->ignore + alias("@drawer")->should("not.be.visible")->ignore +}) diff --git a/apps/docs/e2e/homepage/HomepageSearch.cy.res b/apps/docs/e2e/homepage/HomepageSearch.cy.res new file mode 100644 index 000000000..b93df7a6e --- /dev/null +++ b/apps/docs/e2e/homepage/HomepageSearch.cy.res @@ -0,0 +1,179 @@ +open Cypress +open HomepageHelpers + +let searchChunk = /\/assets\/SearchModal-[^/]+\.js$/ +let search = `button[aria-label="Search"]` +let input = `input[placeholder="Search docs"]` +let close = `button[aria-label="Close search"]` +let searchRoute = {hostname: /\.(algolia\.net|algolianet\.com)$/, pathname: /\/queries$/} + +let emptyResults = JSON.parseOrThrow(`{ + "results": [{ + "hits": [], + "nbHits": 0, + "page": 0, + "nbPages": 0, + "hitsPerPage": 20, + "processingTimeMS": 1, + "query": "/", + "index": "test-index" + }] + }`) + +let installationResults = JSON.parseOrThrow(`{ + "results": [{ + "hits": [{ + "objectID": "installation", + "url": "https://rescript-lang.org/docs/manual/installation", + "url_without_anchor": "https://rescript-lang.org/docs/manual/installation", + "type": "lvl1", + "anchor": null, + "content": null, + "hierarchy": { + "lvl0": "ReScript", + "lvl1": "Installation", + "lvl2": null, + "lvl3": null, + "lvl4": null, + "lvl5": null, + "lvl6": null + } + }], + "nbHits": 1, + "page": 0, + "nbPages": 1, + "hitsPerPage": 20, + "processingTimeMS": 1, + "query": "installation", + "index": "test-index", + "queryID": "homepage-search-test" + }] + }`) + +it("initial homepage assets exclude the search implementation and styles", () => { + homepageDocument(document => { + let scripts = document->initialScriptUrls + let styles = + document + ->querySelectorAll(`link[rel="stylesheet"][href]`) + ->elementsFrom + ->Array.filterMap(element => element->getAttribute("href")->Null.toOption) + expect(scripts->Array.length)->greaterThan(0) + expect(styles->Array.length)->greaterThan(0) + scripts->Array.forEach( + asset => + request(asset) + ->then( + response => { + expect(response.status, ~message=asset)->equal(200) + expect(response.body, ~message=asset)->notInclude("search-insights") + expect(response.body, ~message=asset)->notInclude("DocSearch-Modal") + }, + ) + ->ignore, + ) + styles->Array.forEach( + asset => + request(asset) + ->then( + response => { + expect(response.status, ~message=asset)->equal(200) + expect(response.body, ~message=asset)->notInclude(".DocSearch-Modal") + }, + ) + ->ignore, + ) + }) +}) + +it("search loads on activation, stays styled, and supports keyboard reopening", () => { + interceptStatic(searchRoute, {statusCode: 200, body: emptyResults}) + ->as_("keyboardSearch") + ->ignore + let requests = ref([]) + interceptAll("**", request => { + if request.url->String.includes("search-insights") || searchChunk->RegExp.test(request.url) { + requests := requests.contents->Array.concat([request.url]) + } + })->ignore + visit("/") + get(search)->should("be.visible")->ignore + get(input)->should("not.exist")->ignore + do_(() => expect(requests.contents)->deepEqual([]))->ignore + get(search)->click->ignore + get(input)->should("be.focused")->ignore + do_(() => + expect(requests.contents->Array.some(url => searchChunk->RegExp.test(url)))->equal(true) + )->ignore + get(".DocSearch-Container")->shouldCss("position", "fixed")->ignore + get(".DocSearch-Modal")->shouldCss("opacity", "1")->shouldCss("max-width", "768px")->ignore + realPressKey("Escape")->ignore + get(input)->should("not.exist")->ignore + realPressKey("/")->ignore + get(input)->should("be.focused")->ignore + realPressKey("/")->ignore + get(input)->shouldValue("/")->ignore + wait("@keyboardSearch")->propertyInt("response.statusCode")->shouldEqual(200)->ignore + realPressKey("Escape")->ignore + get(input)->shouldValue("")->should("be.focused")->ignore + realPressKey("Escape")->ignore + get(input)->should("not.exist")->ignore + realPressKeys(["Control", "k"])->ignore + get(input)->should("be.focused")->ignore + realPressKey("Escape")->ignore + get(input)->should("not.exist")->ignore +}) + +it("lazy search results navigate into documentation", () => { + interceptStatic(searchRoute, {statusCode: 200, body: installationResults})->ignore + visit("/") + get(search)->click->ignore + get(input)->typeText("installation")->ignore + get(".DocSearch-Modal")->containsChildRegex("a", /^Installation$/)->click->ignore + cyLocation("pathname")->shouldEqual("/docs/manual/installation")->ignore + containsInRegex("h1", /^Installation$/)->should("be.visible")->ignore + get(input)->should("not.exist")->ignore +}) + +it("a pending search load can be closed without opening the modal afterward", () => { + let download = Promise.withResolvers() + interceptDeferred(searchChunk, () => download.promise)->as_("searchChunk")->ignore + visit("/") + get(search)->click->ignore + get(close)->should("be.visible")->ignore + realPressKey("Escape")->ignore + get(close)->should("not.exist")->ignore + get(search)->should("be.focused")->ignore + do_(() => download.resolve())->ignore + wait("@searchChunk")->ignore + get(search)->should("be.focused")->ignore + get(input)->should("not.exist")->ignore + get(search)->click->ignore + get(input)->should("be.focused")->ignore +}) + +it("a failed search chunk leaves the page usable and recovers after a reload", () => { + let blockChunk = ref(true) + interceptPattern(searchChunk, request => { + if blockChunk.contents { + request->destroy + } + })->ignore + wrapWithOptions( + [/Failed to fetch dynamically imported module: .*\/assets\/SearchModal-[^/]+\.js/], + {log: false}, + ) + ->as_("expectedConsoleErrors") + ->ignore + visit("/") + get(search)->click->ignore + containsIn(`[role="alert"]`, "Search unavailable")->should("be.visible")->ignore + get(close)->click->ignore + get(`[role="alert"]`)->should("not.exist")->ignore + get(search)->should("be.focused")->ignore + containsIn("h1", headline)->should("be.visible")->ignore + do_(() => blockChunk := false)->ignore + reload() + get(search)->click->ignore + get(input)->should("be.focused")->ignore +}) diff --git a/apps/docs/e2e/homepage/HomepageSupport.res b/apps/docs/e2e/homepage/HomepageSupport.res new file mode 100644 index 000000000..cb1678953 --- /dev/null +++ b/apps/docs/e2e/homepage/HomepageSupport.res @@ -0,0 +1,50 @@ +open Cypress + +let _ = realEvents +forbidOnly(!isInteractive()) + +beforeEach(() => { + run(() => automate({command: "Network.clearBrowserCache"}))->ignore + let spies = ref([]) + wrap(spies)->as_("consoleSpies")->ignore + wrap([])->as_("expectedConsoleErrors")->ignore + onBeforeLoad(window => { + let script = window.document->currentScript->Null.toOption + let marker = + script->Option.flatMap(script => script->getAttribute("data-cy-bootstrap")->Null.toOption) + expect(marker, ~message="Cypress uses the stable bootstrap slot")->equal(Some("")) + spies := [...spies.contents, spy(window.console)] + }) +}) + +afterEach(() => { + alias("@consoleSpies") + ->then(spies => { + let errors = + spies.contents + ->Array.flatMap(getCalls) + ->Array.map(call => call.args->Array.get(0)->consoleArgumentString) + alias("@expectedConsoleErrors") + ->then( + expected => { + let unexpected = + errors->Array.filter( + error => !(expected->Array.some(pattern => pattern->RegExp.test(error))), + ) + expect( + unexpected->Array.length, + ~message=`unexpected console errors: ${unexpected->Array.join("; ")}`, + )->equal(0) + expected->Array.forEach( + pattern => + expect( + errors->Array.some(error => pattern->RegExp.test(error)), + ~message="expected console error occurred", + )->equal(true), + ) + }, + ) + ->ignore + }) + ->ignore +}) diff --git a/apps/docs/e2e/homepage/NotFound.cy.res b/apps/docs/e2e/homepage/NotFound.cy.res new file mode 100644 index 000000000..dff158672 --- /dev/null +++ b/apps/docs/e2e/homepage/NotFound.cy.res @@ -0,0 +1,18 @@ +open Cypress + +it("the static 404 document renders at the requested URL without hydration errors", () => { + let path = "/docs/react/does-not-exist" + // The homepage suite uses a static server. Load Pages' error document and + // give it the unknown URL before React starts, as Pages does in production. + visitWithOptions( + "/404.html", + { + onBeforeLoad: window => window->windowHistory->replaceState(JSON.Null, "", path), + }, + ) + containsIn("h2", "Page Not Found")->should("be.visible")->ignore + cyLocation("pathname")->shouldEqual(path)->ignore + get(`nav a.text-fire-30[href="/docs/manual/introduction"]`)->should("be.visible")->ignore + containsIn("a", "Return home")->click->ignore + containsIn("h1", HomepageHelpers.headline)->should("be.visible")->ignore +}) diff --git a/apps/docs/e2e/homepage/README.md b/apps/docs/e2e/homepage/README.md new file mode 100644 index 000000000..28c16a6d3 --- /dev/null +++ b/apps/docs/e2e/homepage/README.md @@ -0,0 +1,19 @@ +# Homepage E2E Tests + +The `.res` specs compile to `.cy.jsx` and run against the production build with +`cypress.homepage.config.mjs`. From `apps/docs`, run `yarn test:e2e` to build the +site and start the temporary test server. Chrome must be installed. + +These tests cover prerendered content, hydration, navigation, clipboard feedback +and contents, and image loading. Their support module fails on console errors +and does not suppress React hydration exceptions. + +`DocsRoot` includes Cypress's supported `data-cy-bootstrap` script slot through +`CypressBootstrap.res`. Cypress replaces the slot's contents instead of inserting +extra nodes into the document React hydrates. The comment placeholder makes +React expect a text child; `suppressHydrationWarning` applies only to this script, +whose contents intentionally differ under Cypress. The support module asserts +that Cypress actually uses the slot. + +This replaces the custom script-and-whitespace removal workaround. See +[Cypress's React hydration guidance](https://docs.cypress.io/app/references/error-messages#react-hydration-errors). diff --git a/apps/docs/functions/ogimage/[[path]]/index.png.res b/apps/docs/functions/ogimage/[[path]]/index.png.res index e3526a3f3..8191170d8 100644 --- a/apps/docs/functions/ogimage/[[path]]/index.png.res +++ b/apps/docs/functions/ogimage/[[path]]/index.png.res @@ -1,7 +1,5 @@ open WebAPI -%%raw("import React from 'react'") - let loadGoogleFont = async (family: string) => { let url = `https://fonts.googleapis.com/css2?family=${family}` let css = await (await fetch(url))->Response.text @@ -254,6 +252,7 @@ let renderImage = async (~assets, ~requestUrl: URLAPI.url, ~targetUrl: URLAPI.ur } } +@live let onRequest = async ({request, params, env}: context) => { let requestUrl = URL.make(~url=request.url) diff --git a/apps/docs/functions/try.data.js b/apps/docs/functions/try.data.js new file mode 100644 index 000000000..cdd6cbf71 --- /dev/null +++ b/apps/docs/functions/try.data.js @@ -0,0 +1 @@ +export { onRequest } from "../server/react-router-handler.js"; diff --git a/apps/docs/functions/try.js b/apps/docs/functions/try.js new file mode 100644 index 000000000..cdd6cbf71 --- /dev/null +++ b/apps/docs/functions/try.js @@ -0,0 +1 @@ +export { onRequest } from "../server/react-router-handler.js"; diff --git a/apps/docs/functions/tsconfig.json b/apps/docs/functions/tsconfig.json new file mode 100644 index 000000000..a224293f4 --- /dev/null +++ b/apps/docs/functions/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "jsx": "react-jsx" + } +} diff --git a/apps/docs/generate-route-types.mjs b/apps/docs/generate-route-types.mjs index 9d9d80e02..2491418b8 100644 --- a/apps/docs/generate-route-types.mjs +++ b/apps/docs/generate-route-types.mjs @@ -1,14 +1,75 @@ -import fs from "fs/promises"; +import { readFileSync, writeFileSync } from "node:fs"; +import { resolve } from "node:path"; +import { fileURLToPath } from "node:url"; +import { loadRoutes } from "./route-config.mjs"; -const { default: routes } = await import("./app/routes.mjs"); +export const outputPath = fileURLToPath( + new URL("../../packages/shared/src/Path.res", import.meta.url), +); -const paths = routes.map((route) => `#"/${route.path}"`).join(" |\n"); +export function concretePaths(routes) { + const paths = new Set(); + function visit(routes, parent = "") { + for (const route of routes) { + const path = route.path?.startsWith("/") + ? route.path + : `${parent}/${route.path ?? ""}`; + const pathname = `/${path.split("/").filter(Boolean).join("/")}`; + // Layouts have no URL of their own. Route patterns aren't link destinations. + if ( + (route.index || route.path !== undefined) && + !/[:*?]/.test(pathname) + ) { + paths.add(pathname); + } + if (route.children) visit(route.children, pathname); + } + } + visit(routes); + return [...paths].sort(); +} -await fs.writeFile( - "src/Path.res", - `type t = [ -#"/" | -${paths} +export function renderPathType(routes) { + const paths = concretePaths(routes); + if (paths.length === 0) throw new Error("No concrete routes found."); + return `// Generated by apps/docs/generate-route-types.mjs. Do not edit. +// Run yarn build:routes after changing routes, MDX pages, or API data. +type t = [ +${paths.map((path) => ` | #${JSON.stringify(path)}`).join("\n")} ] -`, -); +`; +} + +export function generateRouteTypes({ + routes = loadRoutes().routes, + destination = outputPath, + check = false, +} = {}) { + const source = renderPathType(routes); + let current; + try { + current = readFileSync(destination, "utf8"); + } catch (error) { + if (error.code !== "ENOENT") throw error; + } + if (current === source) return true; + if (check) return false; + writeFileSync(destination, source); + return true; +} + +if ( + process.argv[1] && + resolve(process.argv[1]) === fileURLToPath(import.meta.url) +) { + const args = process.argv.slice(2); + if (args.some((arg) => arg !== "--check")) { + throw new Error("Usage: node generate-route-types.mjs [--check]"); + } + if (!generateRouteTypes({ check: args.includes("--check") })) { + console.error( + "Route types are stale. Run yarn build:routes and commit packages/shared/src/Path.res.", + ); + process.exitCode = 1; + } +} diff --git a/apps/docs/lighthouserc.json b/apps/docs/lighthouserc.json new file mode 100644 index 000000000..ec2c98a83 --- /dev/null +++ b/apps/docs/lighthouserc.json @@ -0,0 +1,11 @@ +{ + "ci": { + "collect": { + "numberOfRuns": 3, + "settings": { + "chromeFlags": "--no-sandbox --disable-dev-shm-usage", + "maxWaitForLoad": 45000 + } + } + } +} diff --git a/apps/docs/markdown-pages/blog/archived/bucklescript-release-3-1-0.mdx b/apps/docs/markdown-pages/blog/archived/bucklescript-release-3-1-0.mdx index 417c242f6..95657bfca 100644 --- a/apps/docs/markdown-pages/blog/archived/bucklescript-release-3-1-0.mdx +++ b/apps/docs/markdown-pages/blog/archived/bucklescript-release-3-1-0.mdx @@ -19,17 +19,11 @@ A picture's worth a thousand words: **Before:** -debugger before +debugger before **After:** -debugger after +debugger after Please see for usage. diff --git a/apps/docs/markdown-pages/docs/api/belt.json b/apps/docs/markdown-pages/docs/api/belt.json deleted file mode 100644 index 12d87f39a..000000000 --- a/apps/docs/markdown-pages/docs/api/belt.json +++ /dev/null @@ -1,9488 +0,0 @@ -{ - "belt": { - "id": "Belt", - "name": "Belt", - "docstrings": [ - "The ReScript standard library.\n\nBelt is currently mostly covering collection types. It has no string or date functions yet, although Belt.String is in the works. In the meantime, use [Js.String](js/string) for string functions and [Js.Date](js/date) for date functions.\n\n## Motivation\n\nBelt provides:\n\n- The **highest quality** immutable data structures in JavaScript.\n- Safety by default: A Belt function will never throw exceptions, unless it is\n indicated explicitly in the function name (suffix \"Exn\").\n- Better performance and smaller code size running on the JS platform.\n- Ready for [Tree Shaking](https://webpack.js.org/guides/tree-shaking/).\n\n## Usage\n\nTo use modules from Belt, either refer to them by their fully qualified name (`Belt.List`, `Belt.Array` etc.) or open the `Belt` module by putting\n\n## Examples\n\n```rescript\nopen Belt\n```\n\nat the top of your source files. After opening Belt this way, `Array` will refer to `Belt.Array`, `List` will refer to `Belt.List` etc. in the subsequent code.\n\nIf you want to open Belt globally for all files in your project instead, you can put\n\n```json\n{\n \"compiler-flags\": [\"-open Belt\"]\n}\n```\n\ninto your `rescript.json`.\n\n**Note**: this is the **only** `open` we encourage.\n\nExample usage:\n\n## Examples\n\n```rescript\nlet someNumbers = [1, 1, 4, 2, 3, 6, 3, 4, 2]\n\nlet greaterThan2UniqueAndSorted =\n someNumbers\n ->Belt.Array.keep(x => x > 2)\n // convert to and from set to make values unique\n ->Belt.Set.Int.fromArray\n ->Belt.Set.Int.toArray // output is already sorted\n\nJs.log2(\"result\", greaterThan2UniqueAndSorted)\n```\n\n## Specialized Collections\n\nFor collections types like set or map, Belt provides both a generic module as well as specialized, more efficient implementations for string and int keys.\n\nFor example, Belt has the following set modules:\n\n- [Belt.Set](belt/set)\n- [Belt.Set.Int](belt/set/int)\n- [Belt.Set.String](belt/set/string)\n\n## Implementation Details\n\n### Array access runtime safety\n\nOne common confusion comes from the way Belt handles array access. It differs from than the default standard library's.\n\n## Examples\n\n```rescript\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0] // a == \"a\"\nlet capitalA = Js.String.toUpperCase(a)\nlet k = letters[10] // Throws an exception! The 10th index doesn't exist.\n```\n\nBecause Belt avoids exceptions and returns `options` instead, this code behaves differently:\n\n## Examples\n\n```rescript\nopen Belt\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0] // a == Some(\"a\")\nlet captialA = Js.String.toUpperCase(a) // Type error! This code will not compile.\nlet k = letters[10] // k == None\n```\n\nAlthough we've fixed the problem where `k` throws an exception, we now have a type error when trying to capitalize `a`. There are a few things going on here:\n\n- Reason transforms array index access to the function `Array.get`. So `letters[0]` is the same as `Array.get(letters, 0)`.\n- The compiler uses whichever `Array` module is in scope. If you `open Belt`, then it uses `Belt.Array`.\n- `Belt.Array.get` returns values wrapped in options, so `letters[0] == Some(\"a\")`.\n\nFortunately, this is easy to fix:\n\n## Examples\n\n```rescript\nopen Belt\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0]\n\n// Use a switch statement:\nlet capitalA = switch a {\n| Some(a) => Some(Js.String.toUpperCase(a))\n| None => None\n}\n\nlet k = letters[10] // k == None\n```\n\nWith that little bit of tweaking, our code now compiles successfully and is 100% free of runtime errors\\!\n\n### A Special Encoding for Collection Safety\n\nWhen we create a collection library for a custom data type we need a way to provide a comparator function. Take Set for example, suppose its element type is a pair of ints, it needs a custom compare function that takes two tuples and returns their order. The Set could not just be typed as Set.t (int \\* int) , its customized compare function needs to manifest itself in the signature, otherwise, if the user creates another customized compare function, the two collection could mix which would result in runtime error.\n\nWe use a phantom type to solve the problem:\n\n## Examples\n\n```rescript\nmodule Comparable1 = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet1 = Belt.Set.make(~id=module(Comparable1))\n\nmodule Comparable2 = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet2 = Belt.Set.make(~id=module(Comparable2))\n```\n\nHere, the compiler would infer `mySet1` and `mySet2` having different type, so e.g. a `merge` operation that tries to merge these two sets will correctly fail.\n\n## Examples\n\n```rescript\nlet mySet1: t<(int, int), Comparable1.identity> = %todo\nlet mySet2: t<(int, int), Comparable2.identity> = %todo\n```\n\n`Comparable1.identity` and `Comparable2.identity` are not the same using our encoding scheme." - ], - "items": [] - }, - "belt/hashmap/string": { - "id": "Belt.HashMap.String", - "name": "String", - "docstrings": [ - "Specalized when key type is `string`, more efficient than the generic type" - ], - "items": [ - { - "id": "Belt.HashMap.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.HashMap.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'b>" - }, - { - "id": "Belt.HashMap.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t<'b>" - }, - { - "id": "Belt.HashMap.String.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'b> => unit" - }, - { - "id": "Belt.HashMap.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.HashMap.String.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`setDone(tbl, k, v)` if `k` does not exist, add the binding `k,v`, otherwise,\nupdate the old value with the new `v`" - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.HashMap.String.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.HashMap.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.HashMap.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'b>, key) => bool" - }, - { - "id": "Belt.HashMap.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.HashMap.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'b>, (key, 'b) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashMap.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'b>, (key, 'b) => unit) => unit" - }, - { - "id": "Belt.HashMap.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashMap.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c" - }, - { - "id": "Belt.HashMap.String.keepMapInPlaceU", - "kind": "value", - "name": "keepMapInPlaceU", - "docstrings": [], - "signature": "let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit", - "deprecated": "Use `keepMapInPlace` instead" - }, - { - "id": "Belt.HashMap.String.keepMapInPlace", - "kind": "value", - "name": "keepMapInPlace", - "docstrings": [], - "signature": "let keepMapInPlace: (t<'a>, (key, 'a) => option<'a>) => unit" - }, - { - "id": "Belt.HashMap.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.HashMap.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.HashMap.String.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.HashMap.String.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.HashMap.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.HashMap.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'a>, array<(key, 'a)>) => unit" - }, - { - "id": "Belt.HashMap.String.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t<'a> => array" - }, - { - "id": "Belt.HashMap.String.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t<'a> => unit" - } - ] - }, - "belt/hashmap/int": { - "id": "Belt.HashMap.Int", - "name": "Int", - "docstrings": [ - "Specalized when key type is `int`, more efficient than the generic type" - ], - "items": [ - { - "id": "Belt.HashMap.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.HashMap.Int.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'b>" - }, - { - "id": "Belt.HashMap.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t<'b>" - }, - { - "id": "Belt.HashMap.Int.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'b> => unit" - }, - { - "id": "Belt.HashMap.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.HashMap.Int.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`setDone(tbl, k, v)` if `k` does not exist, add the binding `k,v`, otherwise,\nupdate the old value with the new `v`" - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.HashMap.Int.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.HashMap.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.HashMap.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'b>, key) => bool" - }, - { - "id": "Belt.HashMap.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.HashMap.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'b>, (key, 'b) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashMap.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'b>, (key, 'b) => unit) => unit" - }, - { - "id": "Belt.HashMap.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashMap.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c" - }, - { - "id": "Belt.HashMap.Int.keepMapInPlaceU", - "kind": "value", - "name": "keepMapInPlaceU", - "docstrings": [], - "signature": "let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit", - "deprecated": "Use `keepMapInPlace` instead" - }, - { - "id": "Belt.HashMap.Int.keepMapInPlace", - "kind": "value", - "name": "keepMapInPlace", - "docstrings": [], - "signature": "let keepMapInPlace: (t<'a>, (key, 'a) => option<'a>) => unit" - }, - { - "id": "Belt.HashMap.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.HashMap.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.HashMap.Int.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.HashMap.Int.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.HashMap.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.HashMap.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'a>, array<(key, 'a)>) => unit" - }, - { - "id": "Belt.HashMap.Int.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t<'a> => array" - }, - { - "id": "Belt.HashMap.Int.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t<'a> => unit" - } - ] - }, - "belt/hashset/string": { - "id": "Belt.HashSet.String", - "name": "String", - "docstrings": [ - "Specalized when key type is `string`, more efficient than the generic type", - "This module is [`Belt.HashSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.HashSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.HashSet`]()" - ], - "items": [ - { - "id": "Belt.HashSet.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.HashSet.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Belt.HashSet.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t" - }, - { - "id": "Belt.HashSet.String.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Belt.HashSet.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.HashSet.String.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, key) => unit" - }, - { - "id": "Belt.HashSet.String.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.HashSet.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, key) => bool" - }, - { - "id": "Belt.HashSet.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, key) => unit" - }, - { - "id": "Belt.HashSet.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, key => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashSet.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, key => unit) => unit" - }, - { - "id": "Belt.HashSet.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'c, ('c, key) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashSet.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, 'c, ('c, key) => 'c) => 'c" - }, - { - "id": "Belt.HashSet.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.HashSet.String.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t => unit" - }, - { - "id": "Belt.HashSet.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.HashSet.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.HashSet.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.HashSet.String.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t => array" - } - ] - }, - "belt/hashset/int": { - "id": "Belt.HashSet.Int", - "name": "Int", - "docstrings": [ - "Specalized when key type is `int`, more efficient than the generic type", - "This module is [`Belt.HashSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.HashSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.HashSet`]()" - ], - "items": [ - { - "id": "Belt.HashSet.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.HashSet.Int.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Belt.HashSet.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int) => t" - }, - { - "id": "Belt.HashSet.Int.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Belt.HashSet.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.HashSet.Int.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, key) => unit" - }, - { - "id": "Belt.HashSet.Int.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.HashSet.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, key) => bool" - }, - { - "id": "Belt.HashSet.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, key) => unit" - }, - { - "id": "Belt.HashSet.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, key => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashSet.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, key => unit) => unit" - }, - { - "id": "Belt.HashSet.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'c, ('c, key) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashSet.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, 'c, ('c, key) => 'c) => 'c" - }, - { - "id": "Belt.HashSet.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.HashSet.Int.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t => unit" - }, - { - "id": "Belt.HashSet.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.HashSet.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.HashSet.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.HashSet.Int.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t => array" - } - ] - }, - "belt/mutablemap/string": { - "id": "Belt.MutableMap.String", - "name": "String", - "docstrings": [], - "items": [ - { - "id": "Belt.MutableMap.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.MutableMap.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableMap.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableMap.String.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableMap.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a>, key) => bool" - }, - { - "id": "Belt.MutableMap.String.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.MutableMap.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m1, m2, cmp)`. First compare by size, if size is the same, compare by key,\nvalue pair" - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.MutableMap.String.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.MutableMap.String.eq", - "kind": "value", - "name": "eq", - "docstrings": ["`eq(m1, m2, cmp)`"], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, (key, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableMap.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the key as\nfirst argument, and the associated value as second argument. The application \norder of `f` is in increasing order." - ], - "signature": "let forEach: (t<'a>, (key, 'a) => unit) => unit" - }, - { - "id": "Belt.MutableMap.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableMap.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`, where `k1 ... kN` are\nthe keys of all bindings in `m` (in increasing order), and `d1 ... dN` are the\nassociated data." - ], - "signature": "let reduce: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableMap.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableMap.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let every: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableMap.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let some: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableMap.String.toList", - "kind": "value", - "name": "toList", - "docstrings": ["In increasing order"], - "signature": "let toList: t<'a> => list<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": ["In increasing order"], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.MutableMap.String.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.MutableMap.String.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.MutableMap.String.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.String.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.String.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.String.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.MutableMap.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'a>, key) => Js.undefined<'a>" - }, - { - "id": "Belt.MutableMap.String.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, key, 'a) => 'a" - }, - { - "id": "Belt.MutableMap.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": ["**throw** when invariant is not held"], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.String.remove", - "kind": "value", - "name": "remove", - "docstrings": ["`remove(m, x)` do the in-place modification"], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.MutableMap.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'a>, array) => unit" - }, - { - "id": "Belt.MutableMap.String.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` do the in-place modification, return `m` for chaining. If `x` was\nalready bound in `m`, its previous binding disappears." - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.MutableMap.String.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'a>, key, option<'a> => option<'a>) => unit", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.MutableMap.String.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'a>, key, option<'a> => option<'a>) => unit" - }, - { - "id": "Belt.MutableMap.String.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableMap.String.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.MutableMap.String.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'a>, (key, 'a) => 'b) => t<'b>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.MutableMap.String.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'a>, (key, 'a) => 'b) => t<'b>" - } - ] - }, - "belt/mutablemap/int": { - "id": "Belt.MutableMap.Int", - "name": "Int", - "docstrings": [], - "items": [ - { - "id": "Belt.MutableMap.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.MutableMap.Int.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableMap.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableMap.Int.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableMap.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a>, key) => bool" - }, - { - "id": "Belt.MutableMap.Int.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.MutableMap.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m1, m2, cmp)`. First compare by size, if size is the same, compare by key,\nvalue pair" - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.MutableMap.Int.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.MutableMap.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": ["`eq(m1, m2, cmp)`"], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, (key, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableMap.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the key as\nfirst argument, and the associated value as second argument. The application \norder of `f` is in increasing order." - ], - "signature": "let forEach: (t<'a>, (key, 'a) => unit) => unit" - }, - { - "id": "Belt.MutableMap.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableMap.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`, where `k1 ... kN` are\nthe keys of all bindings in `m` (in increasing order), and `d1 ... dN` are the\nassociated data." - ], - "signature": "let reduce: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableMap.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableMap.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let every: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'a>, (key, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableMap.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified." - ], - "signature": "let some: (t<'a>, (key, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableMap.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": ["In increasing order"], - "signature": "let toList: t<'a> => list<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": ["In increasing order"], - "signature": "let toArray: t<'a> => array<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'a)> => t<'a>" - }, - { - "id": "Belt.MutableMap.Int.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'a> => array" - }, - { - "id": "Belt.MutableMap.Int.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'a> => array<'a>" - }, - { - "id": "Belt.MutableMap.Int.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.Int.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.Int.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.MutableMap.Int.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.MutableMap.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'a> => option<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'a> => Js.undefined<(key, 'a)>" - }, - { - "id": "Belt.MutableMap.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, key) => option<'a>" - }, - { - "id": "Belt.MutableMap.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'a>, key) => Js.undefined<'a>" - }, - { - "id": "Belt.MutableMap.Int.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, key, 'a) => 'a" - }, - { - "id": "Belt.MutableMap.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'a>, key) => 'a" - }, - { - "id": "Belt.MutableMap.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": ["**Throw** when invariant is not held"], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.MutableMap.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": ["`remove(m, x)` do the in-place modification"], - "signature": "let remove: (t<'a>, key) => unit" - }, - { - "id": "Belt.MutableMap.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'a>, array) => unit" - }, - { - "id": "Belt.MutableMap.Int.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` do the in-place modification, return `m` for chaining. If `x` was\nalready bound in `m`, its previous binding disappears." - ], - "signature": "let set: (t<'a>, key, 'a) => unit" - }, - { - "id": "Belt.MutableMap.Int.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'a>, key, option<'a> => option<'a>) => unit", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.MutableMap.Int.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'a>, key, option<'a> => option<'a>) => unit" - }, - { - "id": "Belt.MutableMap.Int.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableMap.Int.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.MutableMap.Int.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'a>, (key, 'a) => 'b) => t<'b>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.MutableMap.Int.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'a>, (key, 'a) => 'b) => t<'b>" - } - ] - }, - "belt/mutableset/string": { - "id": "Belt.MutableSet.String", - "name": "String", - "docstrings": [ - "Specialized when key type is `string`, more efficient than the generic type", - "This module is [`Belt.MutableSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.MutableSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.MutableSet`]()" - ], - "items": [ - { - "id": "Belt.MutableSet.String.value", - "kind": "type", - "name": "value", - "docstrings": ["The type of the set elements."], - "signature": "type value = string" - }, - { - "id": "Belt.MutableSet.String.t", - "kind": "type", - "name": "t", - "docstrings": ["The type of sets."], - "signature": "type t" - }, - { - "id": "Belt.MutableSet.String.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t" - }, - { - "id": "Belt.MutableSet.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.MutableSet.String.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.MutableSet.String.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.MutableSet.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.MutableSet.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.String.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.String.addCheck", - "kind": "value", - "name": "addCheck", - "docstrings": [], - "signature": "let addCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.String.removeCheck", - "kind": "value", - "name": "removeCheck", - "docstrings": [], - "signature": "let removeCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.String.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.MutableSet.String.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.MutableSet.String.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.MutableSet.String.subset", - "kind": "value", - "name": "subset", - "docstrings": [], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.MutableSet.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableSet.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": ["In increasing order"], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.MutableSet.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableSet.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": ["Iterate in increasing order."], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.MutableSet.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableSet.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`.\nOrder unspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableSet.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.String.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.MutableSet.String.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(s, p)` returns a fresh copy of the set of all elements in `s` that satisfy\npredicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.MutableSet.String.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.MutableSet.String.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(s, p)` returns a fresh copy pair of sets `(s1, s2)`, where `s1` is\nthe set of all the elements of `s` that satisfy the predicate `p`, and `s2` is\nthe set of all the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.MutableSet.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.MutableSet.String.toList", - "kind": "value", - "name": "toList", - "docstrings": ["In increasing order with respect"], - "signature": "let toList: t => list" - }, - { - "id": "Belt.MutableSet.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": ["In increasing order with respect"], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.MutableSet.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.MutableSet.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.MutableSet.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.MutableSet.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.MutableSet.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.MutableSet.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.MutableSet.String.split", - "kind": "value", - "name": "split", - "docstrings": ["`split(s, key)` return a fresh copy of each"], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.MutableSet.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": ["**throw** when invariant is not held"], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/mutableset/int": { - "id": "Belt.MutableSet.Int", - "name": "Int", - "docstrings": [ - "Specialized when key type is `int`, more efficient than the generic type", - "This module is [`Belt.MutableSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.MutableSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.MutableSet`]()" - ], - "items": [ - { - "id": "Belt.MutableSet.Int.value", - "kind": "type", - "name": "value", - "docstrings": ["The type of the set elements."], - "signature": "type value = int" - }, - { - "id": "Belt.MutableSet.Int.t", - "kind": "type", - "name": "t", - "docstrings": ["The type of sets."], - "signature": "type t" - }, - { - "id": "Belt.MutableSet.Int.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t" - }, - { - "id": "Belt.MutableSet.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.MutableSet.Int.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.MutableSet.Int.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Belt.MutableSet.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.MutableSet.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.Int.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.Int.addCheck", - "kind": "value", - "name": "addCheck", - "docstrings": [], - "signature": "let addCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t, value) => unit" - }, - { - "id": "Belt.MutableSet.Int.removeCheck", - "kind": "value", - "name": "removeCheck", - "docstrings": [], - "signature": "let removeCheck: (t, value) => bool" - }, - { - "id": "Belt.MutableSet.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => unit" - }, - { - "id": "Belt.MutableSet.Int.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.MutableSet.Int.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.MutableSet.Int.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.MutableSet.Int.subset", - "kind": "value", - "name": "subset", - "docstrings": [], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.MutableSet.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.MutableSet.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableSet.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": ["In increasing order"], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.MutableSet.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableSet.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": ["Iterate in increasing order."], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.MutableSet.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableSet.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`.\nOrder unspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableSet.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.MutableSet.Int.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.MutableSet.Int.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(s, p)` returns a fresh copy of the set of all elements in `s` that satisfy\npredicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.MutableSet.Int.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.MutableSet.Int.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(s, p)` returns a fresh copy pair of sets `(s1, s2)`, where `s1` is\nthe set of all the elements of `s` that satisfy the predicate `p`, and `s2` is\nthe set of all the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.MutableSet.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.MutableSet.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": ["In increasing order with respect"], - "signature": "let toList: t => list" - }, - { - "id": "Belt.MutableSet.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": ["In increasing order with respect"], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.MutableSet.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.MutableSet.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.MutableSet.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.MutableSet.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.MutableSet.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.MutableSet.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.MutableSet.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.MutableSet.Int.split", - "kind": "value", - "name": "split", - "docstrings": ["`split(s, key)` return a fresh copy of each"], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.MutableSet.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": ["**throw** when invariant is not held"], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/map/dict": { - "id": "Belt.Map.Dict", - "name": "Dict", - "docstrings": [ - "This module separates identity from data, it is a bit more verbose but\nslightly more efficient due to the fact that there is no need to pack\nidentity and data back after each operation.\n\n**_Advanced usage only_**" - ], - "items": [ - { - "id": "Belt.Map.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'key, 'value, 'id>" - }, - { - "id": "Belt.Map.Dict.cmp", - "kind": "type", - "name": "cmp", - "docstrings": [], - "signature": "type cmp<'key, 'id> = Belt_Id.cmp<'key, 'id>" - }, - { - "id": "Belt.Map.Dict.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.Dict.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'k, 'v, 'id> => bool" - }, - { - "id": "Belt.Map.Dict.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => bool" - }, - { - "id": "Belt.Map.Dict.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (\n t<'k, 'v, 'id>,\n t<'k, 'v, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~vcmp: ('v, 'v) => int,\n) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.Dict.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (\n t<'k, 'v, 'id>,\n t<'k, 'v, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~vcmp: ('v, 'v) => int,\n) => int" - }, - { - "id": "Belt.Map.Dict.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (\n t<'k, 'a, 'id>,\n t<'k, 'a, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~veq: ('a, 'a) => bool,\n) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.Dict.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, cmp)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `cmp` is the\nequality predicate used to compare the data associated with the keys." - ], - "signature": "let eq: (\n t<'k, 'a, 'id>,\n t<'k, 'a, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~veq: ('a, 'a) => bool,\n) => bool" - }, - { - "id": "Belt.Map.Dict.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.Dict.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`findFirstBy(m, p)` uses function `f` to find the first key value pair to\nmatch predicate `p`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Map.Dict.fromArray([(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")], ~cmp=IntCmp.cmp)\n\nBelt.Map.Dict.findFirstBy(s0, (k, _) => k == 4) == Some((4, \"4\"))\n```" - ], - "signature": "let findFirstBy: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>" - }, - { - "id": "Belt.Map.Dict.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.Dict.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the\nkey as first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys." - ], - "signature": "let forEach: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit" - }, - { - "id": "Belt.Map.Dict.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.Dict.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `f(kN, dN ... f(k1, d1, a)...)`, where `k1 ... kN` \nare the keys of all bindings in `m` (in increasing order), and `d1 ... dN` \nare the associated data." - ], - "signature": "let reduce: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b" - }, - { - "id": "Belt.Map.Dict.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.Dict.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let every: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.Map.Dict.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.Dict.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the\npredicate `p`. Order unspecified" - ], - "signature": "let some: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.Map.Dict.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'k, 'a, 'id> => int" - }, - { - "id": "Belt.Map.Dict.toList", - "kind": "value", - "name": "toList", - "docstrings": ["In increasing order."], - "signature": "let toList: t<'k, 'a, 'id> => list<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'k, 'a, 'id> => array<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: (array<('k, 'a)>, ~cmp: cmp<'k, 'id>) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.Map.Dict.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'k, 'a, 'id> => array<'k>" - }, - { - "id": "Belt.Map.Dict.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'k, 'a, 'id> => array<'a>" - }, - { - "id": "Belt.Map.Dict.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.Dict.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.Dict.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.Dict.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.Dict.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.Map.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => option<'a>" - }, - { - "id": "Belt.Map.Dict.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => Js.undefined<'a>" - }, - { - "id": "Belt.Map.Dict.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'k, 'a, 'id>, 'k, 'a, ~cmp: cmp<'k, 'id>) => 'a" - }, - { - "id": "Belt.Map.Dict.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => 'a" - }, - { - "id": "Belt.Map.Dict.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => 'a" - }, - { - "id": "Belt.Map.Dict.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": [], - "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit" - }, - { - "id": "Belt.Map.Dict.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` returns a map containing the same bindings as `m`, except\nfor `x` which is unbound in the returned map." - ], - "signature": "let remove: (t<'a, 'b, 'id>, 'a, ~cmp: cmp<'a, 'id>) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (\n t<'a, 'b, 'id>,\n array<'a>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as `m`, plus a\nbinding of `x` to `y`. If `x` was already bound in `m`, its previous\nbinding disappears." - ], - "signature": "let set: (\n t<'a, 'b, 'id>,\n 'a,\n 'b,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (\n t<'a, 'b, 'id>,\n 'a,\n option<'b> => option<'b>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.Dict.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (\n t<'a, 'b, 'id>,\n 'a,\n option<'b> => option<'b>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'a, 'b, 'id>,\n t<'a, 'c, 'id>,\n ('a, option<'b>, option<'c>) => option<'d>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'd, 'id>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.Dict.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'a, 'b, 'id>,\n t<'a, 'c, 'id>,\n ('a, option<'b>, option<'c>) => option<'d>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'd, 'id>" - }, - { - "id": "Belt.Map.Dict.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (\n t<'a, 'b, 'id>,\n array<('a, 'b)>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => t<'k, 'a, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.Dict.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in `m` that satisfy\npredicate `p`." - ], - "signature": "let keep: (t<'k, 'a, 'id>, ('k, 'a) => bool) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.Map.Dict.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'k, 'a, 'id>,\n ('k, 'a) => bool,\n) => (t<'k, 'a, 'id>, t<'k, 'a, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.Dict.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains\nall the bindings of `s` that satisfy the predicate `p`, and `m2` is the map\nwith all the bindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (\n t<'k, 'a, 'id>,\n ('k, 'a) => bool,\n) => (t<'k, 'a, 'id>, t<'k, 'a, 'id>)" - }, - { - "id": "Belt.Map.Dict.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with\nall the bindings of `m` whose key is strictly less than `x`; `r` is the map\nwith all the bindings of `m` whose key is strictly greater than `x`; `data`\nis `None` if `m` contains no binding for `x`, or `Some(v)` if `m` binds `v`\nto `x`." - ], - "signature": "let split: (\n t<'a, 'b, 'id>,\n 'a,\n ~cmp: cmp<'a, 'id>,\n) => ((t<'a, 'b, 'id>, t<'a, 'b, 'id>), option<'b>)" - }, - { - "id": "Belt.Map.Dict.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.Dict.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated\nvalue `a` of all bindings of `m` has been replaced by the result of the\napplication of `f` to `a`. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let map: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>" - }, - { - "id": "Belt.Map.Dict.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.Dict.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>" - } - ] - }, - "belt/map/string": { - "id": "Belt.Map.String", - "name": "String", - "docstrings": [], - "items": [ - { - "id": "Belt.Map.String.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = string" - }, - { - "id": "Belt.Map.String.t", - "kind": "type", - "name": "t", - "docstrings": ["The type of maps from type `key` to type `'value`."], - "signature": "type t<'value>" - }, - { - "id": "Belt.Map.String.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t<'v>" - }, - { - "id": "Belt.Map.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'v> => bool" - }, - { - "id": "Belt.Map.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'v>, key) => bool" - }, - { - "id": "Belt.Map.String.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'v>, t<'v>, ('v, 'v) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t<'v>, t<'v>, ('v, 'v) => int) => int" - }, - { - "id": "Belt.Map.String.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'v>, t<'v>, ('v, 'v) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2)` tests whether the maps `m1` and `m2` are\nequal, that is, contain equal keys and associate them with\nequal data." - ], - "signature": "let eq: (t<'v>, t<'v>, ('v, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.String.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.String.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`findFirstBy(m, p)` uses funcion `f` to find the first key value pair\nto match predicate `p`.\n\n## Examples\n\n```rescript\nlet mapString = Belt.Map.String.fromArray([(\"1\", \"one\"), (\"2\", \"two\"), (\"3\", \"three\")])\n\nmapString->Belt.Map.String.findFirstBy((k, v) => k == \"1\" && v == \"one\") == Some(\"1\", \"one\")\n```" - ], - "signature": "let findFirstBy: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>" - }, - { - "id": "Belt.Map.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'v>, (key, 'v) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`.\n`f` receives the key as first argument, and the associated value\nas second argument. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let forEach: (t<'v>, (key, 'v) => unit) => unit" - }, - { - "id": "Belt.Map.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`,\nwhere `k1 ... kN` are the keys of all bindings in `m`\n(in increasing order), and `d1 ... dN` are the associated data." - ], - "signature": "let reduce: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2" - }, - { - "id": "Belt.Map.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nOrder unspecified" - ], - "signature": "let every: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let some: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'v> => int" - }, - { - "id": "Belt.Map.String.toList", - "kind": "value", - "name": "toList", - "docstrings": ["In increasing order."], - "signature": "let toList: t<'v> => list<(key, 'v)>" - }, - { - "id": "Belt.Map.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'v> => array<(key, 'v)>" - }, - { - "id": "Belt.Map.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'v)> => t<'v>" - }, - { - "id": "Belt.Map.String.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'v> => array" - }, - { - "id": "Belt.Map.String.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'v> => array<'v>" - }, - { - "id": "Belt.Map.String.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.Map.String.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.String.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.Map.String.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'v>, key) => option<'v>" - }, - { - "id": "Belt.Map.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'v>, key) => Js.undefined<'v>" - }, - { - "id": "Belt.Map.String.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'v>, key, 'v) => 'v" - }, - { - "id": "Belt.Map.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": ["**throw** when invariant is not held"], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.Map.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove m x` returns a map containing the same bindings as\n `m`, except for `x` which is unbound in the returned map." - ], - "signature": "let remove: (t<'v>, key) => t<'v>" - }, - { - "id": "Belt.Map.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'v>, array) => t<'v>" - }, - { - "id": "Belt.Map.String.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as\n`m`, plus a binding of `x` to `y`. If `x` was already bound\nin `m`, its previous binding disappears." - ], - "signature": "let set: (t<'v>, key, 'v) => t<'v>" - }, - { - "id": "Belt.Map.String.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'v>, key, option<'v> => option<'v>) => t<'v>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.String.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'v>, key, option<'v> => option<'v>) => t<'v>" - }, - { - "id": "Belt.Map.String.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.String.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>" - }, - { - "id": "Belt.Map.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'v>, array<(key, 'v)>) => t<'v>" - }, - { - "id": "Belt.Map.String.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'v>, (key, 'v) => bool) => t<'v>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.String.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in `m` that satisfy predicate\n`p`." - ], - "signature": "let keep: (t<'v>, (key, 'v) => bool) => t<'v>" - }, - { - "id": "Belt.Map.String.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.String.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains all the\nbindings of `s` that satisfy the predicate `p`, and `m2` is the map with all the\nbindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)" - }, - { - "id": "Belt.Map.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with all the\nbindings of `m` whose key is strictly less than `x`; `r` is the map with all the\nbindings of `m` whose key is strictly greater than `x`; `data` is `None` if `m`\ncontains no binding for `x`, or `Some(v)` if `m` binds `v` to `x`." - ], - "signature": "let split: (key, t<'v>) => (t<'v>, option<'v>, t<'v>)" - }, - { - "id": "Belt.Map.String.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'v>, 'v => 'v2) => t<'v2>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.String.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'v>, 'v => 'v2) => t<'v2>" - }, - { - "id": "Belt.Map.String.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'v>, (key, 'v) => 'v2) => t<'v2>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.String.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'v>, (key, 'v) => 'v2) => t<'v2>" - } - ] - }, - "belt/map/int": { - "id": "Belt.Map.Int", - "name": "Int", - "docstrings": [ - "## Examples\n\n```rescript\ntype t<'key, 'value, 'identity>\ntype id<'key, 'id> = Belt_Id.comparable<'key, 'id>\n```" - ], - "items": [ - { - "id": "Belt.Map.Int.key", - "kind": "type", - "name": "key", - "docstrings": [], - "signature": "type key = int" - }, - { - "id": "Belt.Map.Int.t", - "kind": "type", - "name": "t", - "docstrings": ["The type of maps from type `key` to type `'value`."], - "signature": "type t<'value>" - }, - { - "id": "Belt.Map.Int.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t<'v>" - }, - { - "id": "Belt.Map.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'v> => bool" - }, - { - "id": "Belt.Map.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'v>, key) => bool" - }, - { - "id": "Belt.Map.Int.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'v>, t<'v>, ('v, 'v) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: (t<'v>, t<'v>, ('v, 'v) => int) => int" - }, - { - "id": "Belt.Map.Int.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'v>, t<'v>, ('v, 'v) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2)` tests whether the maps `m1` and `m2` are\nequal, that is, contain equal keys and associate them with\nequal data." - ], - "signature": "let eq: (t<'v>, t<'v>, ('v, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.Int.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.Int.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`findFirstBy(m, p)` uses funcion `f` to find the first key value pair\nto match predicate `p`.\n\n## Examples\n\n```rescript\nlet mapInt = Belt.Map.Int.fromArray([(1, \"one\"), (2, \"two\"), (3, \"three\")])\n\nmapInt->Belt.Map.Int.findFirstBy((k, v) => k == 1 && v == \"one\") == Some(1, \"one\")\n```" - ], - "signature": "let findFirstBy: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'v>, (key, 'v) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`.\n`f` receives the key as first argument, and the associated value\nas second argument. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let forEach: (t<'v>, (key, 'v) => unit) => unit" - }, - { - "id": "Belt.Map.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`,\nwhere `k1 ... kN` are the keys of all bindings in `m`\n(in increasing order), and `d1 ... dN` are the associated data." - ], - "signature": "let reduce: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2" - }, - { - "id": "Belt.Map.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nOrder unspecified" - ], - "signature": "let every: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'v>, (key, 'v) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let some: (t<'v>, (key, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'v> => int" - }, - { - "id": "Belt.Map.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": ["In increasing order."], - "signature": "let toList: t<'v> => list<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'v> => array<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array<(key, 'v)> => t<'v>" - }, - { - "id": "Belt.Map.Int.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'v> => array" - }, - { - "id": "Belt.Map.Int.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'v> => array<'v>" - }, - { - "id": "Belt.Map.Int.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'a> => option" - }, - { - "id": "Belt.Map.Int.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.Int.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'a> => option" - }, - { - "id": "Belt.Map.Int.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'a> => Js.undefined" - }, - { - "id": "Belt.Map.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'v> => option<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'v> => Js.undefined<(key, 'v)>" - }, - { - "id": "Belt.Map.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'v>, key) => option<'v>" - }, - { - "id": "Belt.Map.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'v>, key) => Js.undefined<'v>" - }, - { - "id": "Belt.Map.Int.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'v>, key, 'v) => 'v" - }, - { - "id": "Belt.Map.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'v>, key) => 'v" - }, - { - "id": "Belt.Map.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": ["**throw** when invariant is not held"], - "signature": "let checkInvariantInternal: t<'a> => unit" - }, - { - "id": "Belt.Map.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove m x` returns a map containing the same bindings as\n `m`, except for `x` which is unbound in the returned map." - ], - "signature": "let remove: (t<'v>, key) => t<'v>" - }, - { - "id": "Belt.Map.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'v>, array) => t<'v>" - }, - { - "id": "Belt.Map.Int.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as\n`m`, plus a binding of `x` to `y`. If `x` was already bound\nin `m`, its previous binding disappears." - ], - "signature": "let set: (t<'v>, key, 'v) => t<'v>" - }, - { - "id": "Belt.Map.Int.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'v>, key, option<'v> => option<'v>) => t<'v>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.Int.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'v>, key, option<'v> => option<'v>) => t<'v>" - }, - { - "id": "Belt.Map.Int.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.Int.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>" - }, - { - "id": "Belt.Map.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'v>, array<(key, 'v)>) => t<'v>" - }, - { - "id": "Belt.Map.Int.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'v>, (key, 'v) => bool) => t<'v>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.Int.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in `m` that satisfy predicate\n`p`." - ], - "signature": "let keep: (t<'v>, (key, 'v) => bool) => t<'v>" - }, - { - "id": "Belt.Map.Int.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.Int.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains all the\nbindings of `s` that satisfy the predicate `p`, and `m2` is the map with all the\nbindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)" - }, - { - "id": "Belt.Map.Int.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with all the\nbindings of `m` whose key is strictly less than `x`; `r` is the map with all the\nbindings of `m` whose key is strictly greater than `x`; `data` is `None` if `m`\ncontains no binding for `x`, or `Some(v)` if `m` binds `v` to `x`." - ], - "signature": "let split: (key, t<'v>) => (t<'v>, option<'v>, t<'v>)" - }, - { - "id": "Belt.Map.Int.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'v>, 'v => 'v2) => t<'v2>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.Int.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'v>, 'v => 'v2) => t<'v2>" - }, - { - "id": "Belt.Map.Int.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'v>, (key, 'v) => 'v2) => t<'v2>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.Int.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'v>, (key, 'v) => 'v2) => t<'v2>" - } - ] - }, - "belt/set/dict": { - "id": "Belt.Set.Dict", - "name": "Dict", - "docstrings": [ - "This module separates identity from data, it is a bit more verbose but slightly\nmore efficient due to the fact that there is no need to pack identity and data back\nafter each operation", - "This module separates identity from data. It is a bit more verbose but slightly\nmore efficient due to the fact that there is no need to pack identity and data\nback after each operation." - ], - "items": [ - { - "id": "Belt.Set.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'value, 'identity>" - }, - { - "id": "Belt.Set.Dict.cmp", - "kind": "type", - "name": "cmp", - "docstrings": ["Type of compare function."], - "signature": "type cmp<'value, 'id> = Belt_Id.cmp<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.empty", - "kind": "value", - "name": "empty", - "docstrings": [ - "## Examples\n\n```rescript\nlet s0 = Belt.Set.Dict.empty\n```" - ], - "signature": "let empty: t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 3, 2, 4], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let fromArray: (array<'value>, ~cmp: cmp<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [ - "The same as [fromArray][#fromarray] except it is after assuming the input array\nis already sorted." - ], - "signature": "let fromSortedArrayUnsafe: array<'value> => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.Set.Dict.fromArray([], ~cmp=IntCmp.cmp)\nlet notEmpty = Belt.Set.Dict.fromArray([1], ~cmp=IntCmp.cmp)\n\nBelt.Set.Dict.isEmpty(empty) == true\nBelt.Set.Dict.isEmpty(notEmpty) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.Set.Dict.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if an element exists in the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.fromArray([1, 4, 2, 5], ~cmp=IntCmp.cmp)\n\nset->Belt.Set.Dict.has(3, ~cmp=IntCmp.cmp) == false\nset->Belt.Set.Dict.has(1, ~cmp=IntCmp.cmp) == true\n```" - ], - "signature": "let has: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => bool" - }, - { - "id": "Belt.Set.Dict.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = s0->Belt.Set.Dict.add(1, ~cmp=IntCmp.cmp)\nlet s2 = s1->Belt.Set.Dict.add(2, ~cmp=IntCmp.cmp)\nlet s3 = s2->Belt.Set.Dict.add(2, ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.toArray == []\ns1->Belt.Set.Dict.toArray == [1]\ns2->Belt.Set.Dict.toArray == [1, 2]\ns3->Belt.Set.Dict.toArray == [1, 2]\ns2 == s3\n```" - ], - "signature": "let add: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "Adds each element of array to set. Unlike [add](#add), the reference of return value might be changed even if all values in array already exist in set\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.empty\n\nlet newSet = set->Belt.Set.Dict.mergeMany([5, 4, 3, 2, 1], ~cmp=IntCmp.cmp)\nnewSet->Belt.Set.Dict.toArray == [1, 2, 3, 4, 5]\n```" - ], - "signature": "let mergeMany: (\n t<'value, 'id>,\n array<'value>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([2, 3, 1, 4, 5], ~cmp=IntCmp.cmp)\nlet s1 = s0->Belt.Set.Dict.remove(1, ~cmp=IntCmp.cmp)\nlet s2 = s1->Belt.Set.Dict.remove(3, ~cmp=IntCmp.cmp)\nlet s3 = s2->Belt.Set.Dict.remove(3, ~cmp=IntCmp.cmp)\n\ns1->Belt.Set.Dict.toArray == [2, 3, 4, 5]\ns2->Belt.Set.Dict.toArray == [2, 4, 5]\ns2 == s3\n```" - ], - "signature": "let remove: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "Removes each element of array from set. Unlike [remove](#remove), the reference of return value might be changed even if any values in array not existed in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.fromArray([1, 2, 3, 4], ~cmp=IntCmp.cmp)\n\nlet newSet = set->Belt.Set.Dict.removeMany([5, 4, 3, 2, 1], ~cmp=IntCmp.cmp)\nnewSet->Belt.Set.Dict.toArray == []\n```" - ], - "signature": "let removeMany: (\n t<'value, 'id>,\n array<'value>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet union = Belt.Set.Dict.union(s0, s1, ~cmp=IntCmp.cmp)\nunion->Belt.Set.Dict.toArray == [1, 2, 3, 4, 5, 6]\n```" - ], - "signature": "let union: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet intersect = Belt.Set.Dict.intersect(s0, s1, ~cmp=IntCmp.cmp)\nintersect->Belt.Set.Dict.toArray == [2, 3, 5]\n```" - ], - "signature": "let intersect: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.diff", - "kind": "value", - "name": "diff", - "docstrings": [ - "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\n\nlet diff1 = Belt.Set.Dict.diff(s0, s1, ~cmp=IntCmp.cmp)\nlet diff2 = Belt.Set.Dict.diff(s1, s0, ~cmp=IntCmp.cmp)\n\ndiff1->Belt.Set.Dict.toArray == [6]\ndiff2->Belt.Set.Dict.toArray == [1, 4]\n```" - ], - "signature": "let diff: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet s2 = Belt.Set.Dict.intersect(s0, s1, ~cmp=IntCmp.cmp)\nBelt.Set.Dict.subset(s2, s0, ~cmp=IntCmp.cmp) == true\nBelt.Set.Dict.subset(s2, s1, ~cmp=IntCmp.cmp) == true\nBelt.Set.Dict.subset(s1, s0, ~cmp=IntCmp.cmp) == false\n```" - ], - "signature": "let subset: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => bool" - }, - { - "id": "Belt.Set.Dict.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets. It compares size first and then iterates over each element following the\norder of elements." - ], - "signature": "let cmp: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => int" - }, - { - "id": "Belt.Set.Dict.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 5], ~cmp=IntCmp.cmp)\n\nBelt.Set.Dict.eq(s0, s1, ~cmp=IntCmp.cmp) == true\n```" - ], - "signature": "let eq: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => bool" - }, - { - "id": "Belt.Set.Dict.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as [forEach](##forEach) but takes uncurried functon." - ], - "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.Dict.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet acc = ref(list{})\ns0->Belt.Set.Dict.forEach(x => acc := Belt.List.add(acc.contents, x))\nacc.contents == list{6, 5, 3, 2}\n```" - ], - "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit" - }, - { - "id": "Belt.Set.Dict.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.Dict.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) == list{6, 5, 3, 2}\n```" - ], - "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a" - }, - { - "id": "Belt.Set.Dict.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.Dict.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.Dict.fromArray([2, 4, 6, 8], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.every(isEven) == true\n```" - ], - "signature": "let every: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.Dict.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.Dict.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 4, 6, 8], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.some(isOdd) == true\n```" - ], - "signature": "let some: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.Dict.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.Dict.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\nlet s1 = s0->Belt.Set.Dict.keep(isEven)\n\ns1->Belt.Set.Dict.toArray == [2, 4]\n```" - ], - "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>" - }, - { - "id": "Belt.Set.Dict.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.Dict.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "Returns a pair of sets, where first is the set of all the elements of set that satisfy the predicate, and second is the set of all the elements of set that do not satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\nlet (s1, s2) = s0->Belt.Set.Dict.partition(isOdd)\n\ns1->Belt.Set.Dict.toArray == [1, 3, 5]\ns2->Belt.Set.Dict.toArray == [2, 4]\n```" - ], - "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)" - }, - { - "id": "Belt.Set.Dict.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.size == 4\n```" - ], - "signature": "let size: t<'value, 'id> => int" - }, - { - "id": "Belt.Set.Dict.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toList == list{1, 2, 3, 5}\n```" - ], - "signature": "let toList: t<'value, 'id> => list<'value>" - }, - { - "id": "Belt.Set.Dict.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toArray == [1, 2, 3, 5]\n```" - ], - "signature": "let toArray: t<'value, 'id> => array<'value>" - }, - { - "id": "Belt.Set.Dict.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.minimum == None\ns1->Belt.Set.Dict.minimum == Some(1)\n```" - ], - "signature": "let minimum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.Dict.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "Returns minimum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.minUndefined == Js.undefined\ns1->Belt.Set.Dict.minUndefined == Js.Undefined.return(1)\n```" - ], - "signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.Dict.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.maximum == None\ns1->Belt.Set.Dict.maximum == Some(5)\n```" - ], - "signature": "let maximum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.Dict.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "Returns maximum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.maxUndefined == Js.undefined\ns1->Belt.Set.Dict.maxUndefined == Js.Undefined.return(5)\n```" - ], - "signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the reference of the value which is equivalent to value using the comparator\nspecifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.get(3, ~cmp=IntCmp.cmp) == Some(3)\ns0->Belt.Set.Dict.get(20, ~cmp=IntCmp.cmp) == None\n```" - ], - "signature": "let get: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => option<'value>" - }, - { - "id": "Belt.Set.Dict.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "Same as [get](#get) but returns `undefined` when element does not exist." - ], - "signature": "let getUndefined: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => Js.undefined<'value>" - }, - { - "id": "Belt.Set.Dict.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getExn: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => 'value" - }, - { - "id": "Belt.Set.Dict.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getOrThrow: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => 'value" - }, - { - "id": "Belt.Set.Dict.split", - "kind": "value", - "name": "split", - "docstrings": [ - "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\n\nlet ((smaller, larger), present) = s0->Belt.Set.Dict.split(3, ~cmp=IntCmp.cmp)\n\npresent == true\nsmaller->Belt.Set.Dict.toArray == [1, 2]\nlarger->Belt.Set.Dict.toArray == [4, 5]\n```" - ], - "signature": "let split: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)" - }, - { - "id": "Belt.Set.Dict.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": ["**throw** when invariant is not held"], - "signature": "let checkInvariantInternal: t<'a, 'b> => unit" - } - ] - }, - "belt/set/string": { - "id": "Belt.Set.String", - "name": "String", - "docstrings": [ - "Specialized when value type is `string`, more efficient than the generic type,\nits compare behavior is fixed using the built-in comparison", - "This module is [`Belt.Set`]() specialized with value type to be a primitive type.\nIt is more efficient in general, the API is the same with [`Belt_Set`]() except its value type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.Set`]()" - ], - "items": [ - { - "id": "Belt.Set.String.value", - "kind": "type", - "name": "value", - "docstrings": ["The type of the set elements."], - "signature": "type value = string" - }, - { - "id": "Belt.Set.String.t", - "kind": "type", - "name": "t", - "docstrings": ["The type of sets."], - "signature": "type t" - }, - { - "id": "Belt.Set.String.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t" - }, - { - "id": "Belt.Set.String.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.Set.String.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.Set.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.Set.String.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.Set.String.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(s, x)` If `x` was already in `s`, `s` is returned unchanged." - ], - "signature": "let add: (t, value) => t" - }, - { - "id": "Belt.Set.String.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => t" - }, - { - "id": "Belt.Set.String.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` If `x` was not in `m`, `m` is returned reference unchanged." - ], - "signature": "let remove: (t, value) => t" - }, - { - "id": "Belt.Set.String.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => t" - }, - { - "id": "Belt.Set.String.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.Set.String.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.Set.String.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.Set.String.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "`subset(s1, s2)` tests whether the set `s1` is a subset of the set `s2`." - ], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.Set.String.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets." - ], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.Set.String.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(s1, s2)` tests whether the sets `s1` and `s2` are equal, that is, contain\nequal elements." - ], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.Set.String.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.String.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(s, f)` applies `f` in turn to all elements of `s`. In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.Set.String.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.String.reduce", - "kind": "value", - "name": "reduce", - "docstrings": ["Iterate in increasing order."], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.Set.String.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.String.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`. Order\nunspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.String.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.String.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.String.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.String.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(p, s)` returns the set of all elements in `s` that satisfy predicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.Set.String.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.String.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(p, s)` returns a pair of sets `(s1, s2)`, where `s1` is the set of\nall the elements of `s` that satisfy the predicate `p`, and `s2` is the set of\nall the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.Set.String.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.Set.String.toList", - "kind": "value", - "name": "toList", - "docstrings": ["In increasing order"], - "signature": "let toList: t => list" - }, - { - "id": "Belt.Set.String.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.Set.String.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.Set.String.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.String.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.Set.String.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.String.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.Set.String.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.Set.String.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.Set.String.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.Set.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, s)` returns a triple `(l, present, r)`, where `l` is the set of\nelements of `s` that are strictly less than `x`;`r` is the set of elements of\n`s` that are strictly greater than `x`; `present` is `false` if `s` contains no\nelement equal to `x`, or `true` if `s` contains an element equal to `x`." - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.Set.String.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": ["**throw** when invariant is not held"], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/set/int": { - "id": "Belt.Set.Int", - "name": "Int", - "docstrings": [ - "Specialized when value type is `int`, more efficient than the generic type, its\ncompare behavior is fixed using the built-in comparison", - "This module is [`Belt.Set`]() specialized with value type to be a primitive type.\nIt is more efficient in general, the API is the same with [`Belt_Set`]() except its value type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.Set`]()" - ], - "items": [ - { - "id": "Belt.Set.Int.value", - "kind": "type", - "name": "value", - "docstrings": ["The type of the set elements."], - "signature": "type value = int" - }, - { - "id": "Belt.Set.Int.t", - "kind": "type", - "name": "t", - "docstrings": ["The type of sets."], - "signature": "type t" - }, - { - "id": "Belt.Set.Int.empty", - "kind": "value", - "name": "empty", - "docstrings": [], - "signature": "let empty: t" - }, - { - "id": "Belt.Set.Int.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: array => t" - }, - { - "id": "Belt.Set.Int.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [], - "signature": "let fromSortedArrayUnsafe: array => t" - }, - { - "id": "Belt.Set.Int.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t => bool" - }, - { - "id": "Belt.Set.Int.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t, value) => bool" - }, - { - "id": "Belt.Set.Int.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(s, x)` If `x` was already in `s`, `s` is returned unchanged." - ], - "signature": "let add: (t, value) => t" - }, - { - "id": "Belt.Set.Int.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t, array) => t" - }, - { - "id": "Belt.Set.Int.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` If `x` was not in `m`, `m` is returned reference unchanged." - ], - "signature": "let remove: (t, value) => t" - }, - { - "id": "Belt.Set.Int.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t, array) => t" - }, - { - "id": "Belt.Set.Int.union", - "kind": "value", - "name": "union", - "docstrings": [], - "signature": "let union: (t, t) => t" - }, - { - "id": "Belt.Set.Int.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (t, t) => t" - }, - { - "id": "Belt.Set.Int.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (t, t) => t" - }, - { - "id": "Belt.Set.Int.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "`subset(s1, s2)` tests whether the set `s1` is a subset of the set `s2`." - ], - "signature": "let subset: (t, t) => bool" - }, - { - "id": "Belt.Set.Int.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets." - ], - "signature": "let cmp: (t, t) => int" - }, - { - "id": "Belt.Set.Int.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(s1, s2)` tests whether the sets `s1` and `s2` are equal, that is, contain\nequal elements." - ], - "signature": "let eq: (t, t) => bool" - }, - { - "id": "Belt.Set.Int.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t, value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.Int.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(s, f)` applies `f` in turn to all elements of `s`. In increasing order" - ], - "signature": "let forEach: (t, value => unit) => unit" - }, - { - "id": "Belt.Set.Int.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.Int.reduce", - "kind": "value", - "name": "reduce", - "docstrings": ["Iterate in increasing order."], - "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a" - }, - { - "id": "Belt.Set.Int.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t, value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.Int.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(p, s)` checks if all elements of the set satisfy the predicate `p`. Order\nunspecified." - ], - "signature": "let every: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.Int.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t, value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.Int.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified." - ], - "signature": "let some: (t, value => bool) => bool" - }, - { - "id": "Belt.Set.Int.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t, value => bool) => t", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.Int.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(p, s)` returns the set of all elements in `s` that satisfy predicate `p`." - ], - "signature": "let keep: (t, value => bool) => t" - }, - { - "id": "Belt.Set.Int.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t, value => bool) => (t, t)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.Int.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(p, s)` returns a pair of sets `(s1, s2)`, where `s1` is the set of\nall the elements of `s` that satisfy the predicate `p`, and `s2` is the set of\nall the elements of `s` that do not satisfy `p`." - ], - "signature": "let partition: (t, value => bool) => (t, t)" - }, - { - "id": "Belt.Set.Int.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t => int" - }, - { - "id": "Belt.Set.Int.toList", - "kind": "value", - "name": "toList", - "docstrings": ["In increasing order"], - "signature": "let toList: t => list" - }, - { - "id": "Belt.Set.Int.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t => array" - }, - { - "id": "Belt.Set.Int.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t => option" - }, - { - "id": "Belt.Set.Int.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.Int.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t => option" - }, - { - "id": "Belt.Set.Int.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t => Js.undefined" - }, - { - "id": "Belt.Set.Int.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t, value) => option" - }, - { - "id": "Belt.Set.Int.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t, value) => Js.undefined" - }, - { - "id": "Belt.Set.Int.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t, value) => value" - }, - { - "id": "Belt.Set.Int.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t, value) => value" - }, - { - "id": "Belt.Set.Int.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, s)` returns a triple `(l, present, r)`, where `l` is the set of\nelements of `s` that are strictly less than `x`;`r` is the set of elements of\n`s` that are strictly greater than `x`; `present` is `false` if `s` contains no\nelement equal to `x`, or `true` if `s` contains an element equal to `x`." - ], - "signature": "let split: (t, value) => ((t, t), bool)" - }, - { - "id": "Belt.Set.Int.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": ["**throw** when invariant is not held"], - "signature": "let checkInvariantInternal: t => unit" - } - ] - }, - "belt/sortarray/string": { - "id": "Belt.SortArray.String", - "name": "String", - "docstrings": [ - "Specalized when key type is `string`, more efficient than the generic type", - "This is a specialized module for [`Belt_SortArray`](), the docs in that module also\napplies here, except the comparator is fixed and inlined" - ], - "items": [ - { - "id": "Belt.SortArray.String.element", - "kind": "type", - "name": "element", - "docstrings": [], - "signature": "type element = string" - }, - { - "id": "Belt.SortArray.String.strictlySortedLength", - "kind": "value", - "name": "strictlySortedLength", - "docstrings": [ - "The same as [`Belt_SortArray.strictlySortedLength`]() except the comparator is fixed\n\n**return** `+n` means increasing order `-n` means negative order" - ], - "signature": "let strictlySortedLength: array => int" - }, - { - "id": "Belt.SortArray.String.isSorted", - "kind": "value", - "name": "isSorted", - "docstrings": [ - "`sorted(xs)` return true if `xs` is in non strict increasing order" - ], - "signature": "let isSorted: array => bool" - }, - { - "id": "Belt.SortArray.String.stableSortInPlace", - "kind": "value", - "name": "stableSortInPlace", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortInPlaceBy`]() except the comparator is fixed" - ], - "signature": "let stableSortInPlace: array => unit" - }, - { - "id": "Belt.SortArray.String.stableSort", - "kind": "value", - "name": "stableSort", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortBy`]() except the comparator is fixed" - ], - "signature": "let stableSort: array => array" - }, - { - "id": "Belt.SortArray.String.binarySearch", - "kind": "value", - "name": "binarySearch", - "docstrings": [ - "If value is not found and value is less than one or more elements in array,\nthe negative number returned is the bitwise complement of the index of the first element\nthat is larger than value.\n\nIf value is not found and value is greater than all elements in array,\nthe negative number returned is the bitwise complement of\n(the index of the last element plus 1)\n\nfor example, if `key` is smaller than all elements return `-1` since `lnot (-1) = 0`\nif `key` is larger than all elements return `- (len + 1)` since `lnot (-(len+1)) = len`" - ], - "signature": "let binarySearch: (array, element) => int" - }, - { - "id": "Belt.SortArray.String.union", - "kind": "value", - "name": "union", - "docstrings": [ - "`union(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp)` assume\n`src` and `src2` is strictly sorted. for equivalent elements, it is picked from\n`src` also assume that `dst` is large enough to store all elements" - ], - "signature": "let union: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.String.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.String.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - } - ] - }, - "belt/sortarray/int": { - "id": "Belt.SortArray.Int", - "name": "Int", - "docstrings": [ - "Specalized when key type is `int`, more efficient than the generic type", - "This is a specialized module for [`Belt_SortArray`](), the docs in that module also\napplies here, except the comparator is fixed and inlined" - ], - "items": [ - { - "id": "Belt.SortArray.Int.element", - "kind": "type", - "name": "element", - "docstrings": [], - "signature": "type element = int" - }, - { - "id": "Belt.SortArray.Int.strictlySortedLength", - "kind": "value", - "name": "strictlySortedLength", - "docstrings": [ - "The same as [`Belt_SortArray.strictlySortedLength`]() except the comparator is fixed\n\n**return** `+n` means increasing order `-n` means negative order" - ], - "signature": "let strictlySortedLength: array => int" - }, - { - "id": "Belt.SortArray.Int.isSorted", - "kind": "value", - "name": "isSorted", - "docstrings": [ - "`sorted(xs)` return true if `xs` is in non strict increasing order" - ], - "signature": "let isSorted: array => bool" - }, - { - "id": "Belt.SortArray.Int.stableSortInPlace", - "kind": "value", - "name": "stableSortInPlace", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortInPlaceBy`]() except the comparator is fixed" - ], - "signature": "let stableSortInPlace: array => unit" - }, - { - "id": "Belt.SortArray.Int.stableSort", - "kind": "value", - "name": "stableSort", - "docstrings": [ - "The same as [`Belt_SortArray.stableSortBy`]() except the comparator is fixed" - ], - "signature": "let stableSort: array => array" - }, - { - "id": "Belt.SortArray.Int.binarySearch", - "kind": "value", - "name": "binarySearch", - "docstrings": [ - "If value is not found and value is less than one or more elements in array,\nthe negative number returned is the bitwise complement of the index of the first element\nthat is larger than value.\n\nIf value is not found and value is greater than all elements in array,\nthe negative number returned is the bitwise complement of\n(the index of the last element plus 1)\n\nfor example, if `key` is smaller than all elements return `-1` since `lnot (-1) = 0`\nif `key` is larger than all elements return `- (len + 1)` since `lnot (-(len+1)) = len`" - ], - "signature": "let binarySearch: (array, element) => int" - }, - { - "id": "Belt.SortArray.Int.union", - "kind": "value", - "name": "union", - "docstrings": [ - "`union(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp)` assume\n`src` and `src2` is strictly sorted. for equivalent elements, it is picked from\n`src` also assume that `dst` is large enough to store all elements" - ], - "signature": "let union: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.Int.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [], - "signature": "let intersect: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - }, - { - "id": "Belt.SortArray.Int.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int" - } - ] - }, - "belt/id/makehashable": { - "id": "Belt.Id.MakeHashable", - "name": "MakeHashable", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeHashable.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeHashable.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeHashable.hash", - "kind": "value", - "name": "hash", - "docstrings": [], - "signature": "let hash: hash" - }, - { - "id": "Belt.Id.MakeHashable.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: eq" - } - ] - }, - "belt/id/makehashableu": { - "id": "Belt.Id.MakeHashableU", - "name": "MakeHashableU", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeHashableU.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeHashableU.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeHashableU.hash", - "kind": "value", - "name": "hash", - "docstrings": [], - "signature": "let hash: hash" - }, - { - "id": "Belt.Id.MakeHashableU.eq", - "kind": "value", - "name": "eq", - "docstrings": [], - "signature": "let eq: eq" - } - ] - }, - "belt/id/makecomparable": { - "id": "Belt.Id.MakeComparable", - "name": "MakeComparable", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeComparable.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeComparable.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeComparable.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: cmp" - } - ] - }, - "belt/id/makecomparableu": { - "id": "Belt.Id.MakeComparableU", - "name": "MakeComparableU", - "docstrings": [], - "items": [ - { - "id": "Belt.Id.MakeComparableU.identity", - "kind": "type", - "name": "identity", - "docstrings": [], - "signature": "type identity" - }, - { - "id": "Belt.Id.MakeComparableU.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = M.t" - }, - { - "id": "Belt.Id.MakeComparableU.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [], - "signature": "let cmp: cmp" - } - ] - }, - "belt/float": { - "id": "Belt.Float", - "name": "Float", - "docstrings": [ - "[`Belt.Float`]()\n\n Utilities for Float.", - "This module includes convenience methods for handling `float` types." - ], - "items": [ - { - "id": "Belt.Float.toInt", - "kind": "value", - "name": "toInt", - "docstrings": [ - "Converts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nBelt.Float.toInt(1.0) == 1\n```" - ], - "signature": "let toInt: float => int" - }, - { - "id": "Belt.Float.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "Converts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nBelt.Float.fromInt(1) == 1.0\n```" - ], - "signature": "let fromInt: int => float" - }, - { - "id": "Belt.Float.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Converts a given `string` to a `float`. Returns `Some(float)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nBelt.Float.fromString(\"1.0\") == Some(1.0)\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Belt.Float.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts a given `float` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nBelt.Float.toString(1.0) == \"1\"\n```" - ], - "signature": "let toString: float => string" - }, - { - "id": "Belt.Float.+", - "kind": "value", - "name": "+", - "docstrings": [ - "Addition of two `float` values.\nCan be opened in a module to avoid dot-notation (`+.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n2.0 + 2.0 == 4.0\n```" - ], - "signature": "let +: (float, float) => float" - }, - { - "id": "Belt.Float.-", - "kind": "value", - "name": "-", - "docstrings": [ - "Subtraction of two `float` values.\nCan be opened in a module to avoid dot-notation (`-.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n2.0 - 1.0 == 1.0\n```" - ], - "signature": "let -: (float, float) => float" - }, - { - "id": "Belt.Float.*", - "kind": "value", - "name": "*", - "docstrings": [ - "Multiplication of two `float` values.\nCan be opened in a module to avoid dot-notation (`*.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n2.0 * 2.0 == 4.0\n```" - ], - "signature": "let *: (float, float) => float" - }, - { - "id": "Belt.Float./", - "kind": "value", - "name": "/", - "docstrings": [ - "Division of two `float` values.\nCan be opened in a module to avoid dot-notation (`/.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\n4.0 / 2.0 == 2.0\n```" - ], - "signature": "let /: (float, float) => float" - } - ] - }, - "belt/int": { - "id": "Belt.Int", - "name": "Int", - "docstrings": [ - "[`Belt.Int`]()\n\n Utilities for Int.", - "This module includes convenience methods for handling `int` types." - ], - "items": [ - { - "id": "Belt.Int.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [ - "Converts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nBelt.Int.toFloat(1) == 1.0\n```" - ], - "signature": "let toFloat: int => float" - }, - { - "id": "Belt.Int.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "Converts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nBelt.Int.fromFloat(1.0) == 1\n```" - ], - "signature": "let fromFloat: float => int" - }, - { - "id": "Belt.Int.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Converts a given `string` to an `int`. Returns `Some(int)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nBelt.Int.fromString(\"1\") == Some(1)\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Belt.Int.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nBelt.Int.toString(1) == \"1\"\n```" - ], - "signature": "let toString: int => string" - }, - { - "id": "Belt.Int.+", - "kind": "value", - "name": "+", - "docstrings": [ - "Addition of two `int` values. Same as the addition from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n2 + 2 == 4\n```" - ], - "signature": "let +: (int, int) => int" - }, - { - "id": "Belt.Int.-", - "kind": "value", - "name": "-", - "docstrings": [ - "Subtraction of two `int` values. Same as the subtraction from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n2 - 1 == 1\n```" - ], - "signature": "let -: (int, int) => int" - }, - { - "id": "Belt.Int.*", - "kind": "value", - "name": "*", - "docstrings": [ - "Multiplication of two `int` values. Same as the multiplication from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n2 * 2 == 4\n```" - ], - "signature": "let *: (int, int) => int" - }, - { - "id": "Belt.Int./", - "kind": "value", - "name": "/", - "docstrings": [ - "Division of two `int` values. Same as the division from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\n4 / 2 == 2\n```" - ], - "signature": "let /: (int, int) => int" - } - ] - }, - "belt/result": { - "id": "Belt.Result", - "name": "Result", - "docstrings": [ - "[`Belt.Result`]()\n\n Utilities for result data type.", - "Result types are really useful to describe the result of a certain operation\nwithout relying on exceptions or `option` types.\n\nThis module gives you useful utilities to create and combine `Result` data." - ], - "items": [ - { - "id": "Belt.Result.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a, 'b> = result<'a, 'b> = Ok('a) | Error('b)" - }, - { - "id": "Belt.Result.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(res)`: when `res` is `Ok(n)`, returns `n` when `res` is `Error(m)`, throw an exception\n\n## Examples\n\n```rescript\nBelt.Result.Ok(42)->Belt.Result.getExn == 42\n\nswitch Belt.Result.getExn(Belt.Result.Error(\"Invalid data\")) {\n// throw a exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getExn: t<'a, 'b> => 'a" - }, - { - "id": "Belt.Result.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(res)`: when `res` is `Ok(n)`, returns `n` when `res` is `Error(m)`, throw an exception\n\n## Examples\n\n```rescript\nBelt.Result.Ok(42)->Belt.Result.getOrThrow == 42\n\nswitch Belt.Result.getOrThrow(Belt.Result.Error(\"Invalid data\")) {\n// throw a exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getOrThrow: t<'a, 'b> => 'a" - }, - { - "id": "Belt.Result.mapWithDefaultU", - "kind": "value", - "name": "mapWithDefaultU", - "docstrings": [], - "signature": "let mapWithDefaultU: (t<'a, 'c>, 'b, 'a => 'b) => 'b", - "deprecated": "Use `mapWithDefault` instead" - }, - { - "id": "Belt.Result.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [ - "`mapWithDefault(res, default, f)`: When res is `Ok(n)`, returns `f(n)`,\notherwise `default`.\n\n## Examples\n\n```rescript\nlet ok = Belt.Result.Ok(42)\nBelt.Result.mapWithDefault(ok, 0, x => x / 2) == 21\n\nlet error = Belt.Result.Error(\"Invalid data\")\nBelt.Result.mapWithDefault(error, 0, x => x / 2) == 0\n```" - ], - "signature": "let mapWithDefault: (t<'a, 'c>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Belt.Result.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a, 'c>, 'a => 'b) => t<'b, 'c>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Result.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(res, f)`: When res is `Ok(n)`, returns `Ok(f(n))`. Otherwise returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns an\nordinary value.\n\n## Examples\n\n```rescript\nlet f = x => sqrt(Belt.Int.toFloat(x))\n\nBelt.Result.map(Ok(64), f) == Ok(8.0)\n\nBelt.Result.map(Error(\"Invalid data\"), f) == Error(\"Invalid data\")\n```" - ], - "signature": "let map: (t<'a, 'c>, 'a => 'b) => t<'b, 'c>" - }, - { - "id": "Belt.Result.flatMapU", - "kind": "value", - "name": "flatMapU", - "docstrings": [], - "signature": "let flatMapU: (t<'a, 'c>, 'a => t<'b, 'c>) => t<'b, 'c>", - "deprecated": "Use `flatMap` instead" - }, - { - "id": "Belt.Result.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(res, f)`: When res is `Ok(n)`, returns `f(n)`. Otherwise, returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns a\n`Belt.Result`.\n\n## Examples\n\n```rescript\nlet recip = x =>\n if x !== 0.0 {\n Belt.Result.Ok(1.0 /. x)\n } else {\n Belt.Result.Error(\"Divide by zero\")\n }\n\nBelt.Result.flatMap(Ok(2.0), recip) == Ok(0.5)\n\nBelt.Result.flatMap(Ok(0.0), recip) == Error(\"Divide by zero\")\n\nBelt.Result.flatMap(Error(\"Already bad\"), recip) == Error(\"Already bad\")\n```" - ], - "signature": "let flatMap: (t<'a, 'c>, 'a => t<'b, 'c>) => t<'b, 'c>" - }, - { - "id": "Belt.Result.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [ - "`getWithDefault(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`,\notherwise `default`\n\n## Examples\n\n```rescript\nBelt.Result.getWithDefault(Ok(42), 0) == 42\n\nBelt.Result.getWithDefault(Error(\"Invalid Data\"), 0) == 0\n```" - ], - "signature": "let getWithDefault: (t<'a, 'b>, 'a) => 'a" - }, - { - "id": "Belt.Result.isOk", - "kind": "value", - "name": "isOk", - "docstrings": [ - "`isOk(res)`: Returns `true` if `res` is of the form `Ok(n)`, `false` if it is\nthe `Error(e)` variant." - ], - "signature": "let isOk: t<'a, 'b> => bool" - }, - { - "id": "Belt.Result.isError", - "kind": "value", - "name": "isError", - "docstrings": [ - "`isError(res)`: Returns `true` if `res` is of the form `Error(e)`, `false` if\nit is the `Ok(n)` variant." - ], - "signature": "let isError: t<'a, 'b> => bool" - }, - { - "id": "Belt.Result.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Result.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(res1, res2, f)`: Determine if two `Belt.Result` variables are equal with\nrespect to an equality function. If `res1` and `res2` are of the form `Ok(n)`\nand `Ok(m)`, return the result of `f(n, m)`. If one of `res1` and `res2` are of\nthe form `Error(e)`, return false If both `res1` and `res2` are of the form\n`Error(e)`, return true\n\n## Examples\n\n```rescript\nlet good1 = Belt.Result.Ok(42)\n\nlet good2 = Belt.Result.Ok(32)\n\nlet bad1 = Belt.Result.Error(\"invalid\")\n\nlet bad2 = Belt.Result.Error(\"really invalid\")\n\nlet mod10equal = (a, b) => mod(a, 10) === mod(b, 10)\n\nBelt.Result.eq(good1, good2, mod10equal) == true\n\nBelt.Result.eq(good1, bad1, mod10equal) == false\n\nBelt.Result.eq(bad2, good2, mod10equal) == false\n\nBelt.Result.eq(bad1, bad2, mod10equal) == true\n```" - ], - "signature": "let eq: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Result.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Result.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(res1, res2, f)`: Compare two `Belt.Result` variables with respect to a\ncomparison function. The comparison function returns -1 if the first variable\nis \"less than\" the second, 0 if the two variables are equal, and 1 if the first\nis \"greater than\" the second.\n\nIf `res1` and `res2` are of the form `Ok(n)` and `Ok(m)`, return the result of\n`f(n, m)`. If `res1` is of the form `Error(e)` and `res2` of the form `Ok(n)`,\nreturn -1 (nothing is less than something) If `res1` is of the form `Ok(n)` and\n`res2` of the form `Error(e)`, return 1 (something is greater than nothing) If\nboth `res1` and `res2` are of the form `Error(e)`, return 0 (equal)\n\n## Examples\n\n```rescript\nlet good1 = Belt.Result.Ok(59)\n\nlet good2 = Belt.Result.Ok(37)\n\nlet bad1 = Belt.Result.Error(\"invalid\")\n\nlet bad2 = Belt.Result.Error(\"really invalid\")\n\nlet mod10cmp = (a, b) => Pervasives.compare(mod(a, 10), mod(b, 10))\n\nBelt.Result.cmp(Ok(39), Ok(57), mod10cmp) == 1\n\nBelt.Result.cmp(Ok(57), Ok(39), mod10cmp) == -1\n\nBelt.Result.cmp(Ok(39), Error(\"y\"), mod10cmp) == 1\n\nBelt.Result.cmp(Error(\"x\"), Ok(57), mod10cmp) == -1\n\nBelt.Result.cmp(Error(\"x\"), Error(\"y\"), mod10cmp) == 0\n```" - ], - "signature": "let cmp: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => int) => int" - } - ] - }, - "belt/option": { - "id": "Belt.Option", - "name": "Option", - "docstrings": [ - "[`Belt.Option`]()\n\n Utilities for option data type.", - "In Belt we represent the existence and nonexistence of a value by wrapping it\nwith the `option` type. In order to make it a bit more convenient to work with\noption-types, Belt provides utility-functions for it.\n\nThe `option` type is a part of the ReScript standard library which is defined like this:\n\n## Examples\n\n```rescript\ntype option<'a> = None | Some('a)\n```\n\n```rescript\nlet someString: option = Some(\"hello\")\n```" - ], - "items": [ - { - "id": "Belt.Option.keepU", - "kind": "value", - "name": "keepU", - "docstrings": ["Uncurried version of `keep`"], - "signature": "let keepU: (option<'a>, 'a => bool) => option<'a>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Option.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "If `optionValue` is `Some(value)` and `p(value) = true`, it returns `Some(value)`; otherwise returns `None`\n\n## Examples\n\n```rescript\nBelt.Option.keep(Some(10), x => x > 5) == Some(10)\nBelt.Option.keep(Some(4), x => x > 5) == None\nBelt.Option.keep(None, x => x > 5) == None\n```" - ], - "signature": "let keep: (option<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Belt.Option.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": ["Uncurried version of `forEach`"], - "signature": "let forEachU: (option<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Option.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "If `optionValue` is `Some(value`), it calls `f(value)`; otherwise returns `()`\n\n## Examples\n\n```rescript\nBelt.Option.forEach(Some(\"thing\"), x => Js.log(x)) /* logs \"thing\" */\nBelt.Option.forEach(None, x => Js.log(x)) /* returns () */\n```" - ], - "signature": "let forEach: (option<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.Option.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Throws an Error in case `None` is provided. Use with care.\n\n## Examples\n\n```rescript\nSome(3)->Belt.Option.getExn == 3\n\nswitch Belt.Option.getExn(None) {\n// Throws an exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getExn: option<'a> => 'a" - }, - { - "id": "Belt.Option.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Throws an Error in case `None` is provided. Use with care.\n\n## Examples\n\n```rescript\nSome(3)->Belt.Option.getOrThrow == 3\n\nswitch Belt.Option.getOrThrow(None) {\n// Throws an exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getOrThrow: option<'a> => 'a" - }, - { - "id": "Belt.Option.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(x)` returns `x`\n\nThis is an unsafe operation, it assumes `x` is neither `None`\nnor `Some(None(...)))`" - ], - "signature": "let getUnsafe: option<'a> => 'a" - }, - { - "id": "Belt.Option.mapWithDefaultU", - "kind": "value", - "name": "mapWithDefaultU", - "docstrings": ["Uncurried version of `mapWithDefault`"], - "signature": "let mapWithDefaultU: (option<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "Use `mapWithDefault` instead" - }, - { - "id": "Belt.Option.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [ - "If `optionValue` is of `Some(value)`,\nthis function returns that value applied with `f`, in other words `f(value)`.\n\nIf `optionValue` is `None`, the default is returned.\n\n## Examples\n\n```rescript\nlet someValue = Some(3)\nsomeValue->Belt.Option.mapWithDefault(0, x => x + 5) == 8\n\nlet noneValue = None\nnoneValue->Belt.Option.mapWithDefault(0, x => x + 5) == 0\n```" - ], - "signature": "let mapWithDefault: (option<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Belt.Option.mapU", - "kind": "value", - "name": "mapU", - "docstrings": ["Uncurried version of `map`"], - "signature": "let mapU: (option<'a>, 'a => 'b) => option<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Option.map", - "kind": "value", - "name": "map", - "docstrings": [ - "If `optionValue` is `Some(value)` this returns `f(value)`, otherwise it returns `None`.\n\n## Examples\n\n```rescript\nBelt.Option.map(Some(3), x => x * x) == Some(9)\n\nBelt.Option.map(None, x => x * x) == None\n```" - ], - "signature": "let map: (option<'a>, 'a => 'b) => option<'b>" - }, - { - "id": "Belt.Option.flatMapU", - "kind": "value", - "name": "flatMapU", - "docstrings": ["Uncurried version of `flatMap`"], - "signature": "let flatMapU: (option<'a>, 'a => option<'b>) => option<'b>", - "deprecated": "Use `flatMap` instead" - }, - { - "id": "Belt.Option.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "If `optionValue` is `Some(value)`, returns `f(value)`, otherwise returns\n`None`.
\nThe function `f` must have a return type of `option<'b>`.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Some(value + 1)\n } else {\n None\n }\n\nBelt.Option.flatMap(Some(2), addIfAboveOne) == Some(3)\n\nBelt.Option.flatMap(Some(-4), addIfAboveOne) == None\n\nBelt.Option.flatMap(None, addIfAboveOne) == None\n```" - ], - "signature": "let flatMap: (option<'a>, 'a => option<'b>) => option<'b>" - }, - { - "id": "Belt.Option.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [ - "If `optionalValue` is `Some(value)`, returns `value`, otherwise default.\n\n## Examples\n\n```rescript\nBelt.Option.getWithDefault(None, \"Banana\") == \"Banana\"\n\nBelt.Option.getWithDefault(Some(\"Apple\"), \"Banana\") == \"Apple\"\n```\n\n```rescript\nlet greet = (firstName: option) =>\n \"Greetings \" ++ firstName->Belt.Option.getWithDefault(\"Anonymous\")\n\nSome(\"Jane\")->greet == \"Greetings Jane\"\n\nNone->greet == \"Greetings Anonymous\"\n```" - ], - "signature": "let getWithDefault: (option<'a>, 'a) => 'a" - }, - { - "id": "Belt.Option.orElse", - "kind": "value", - "name": "orElse", - "docstrings": [ - "`orElse(optionalValue, otherOptional)` if `optionalValue` is `Some(value)`,\nreturns `Some(value)`, otherwise `otherOptional`\n\n## Examples\n\n```rescript\nBelt.Option.orElse(Some(1812), Some(1066)) == Some(1812)\nBelt.Option.orElse(None, Some(1066)) == Some(1066)\nBelt.Option.orElse(None, None) == None\n```" - ], - "signature": "let orElse: (option<'a>, option<'a>) => option<'a>" - }, - { - "id": "Belt.Option.isSome", - "kind": "value", - "name": "isSome", - "docstrings": [ - "Returns `true` if the argument is `Some(value)`, `false` otherwise.\n\n## Examples\n\n```rescript\nBelt.Option.isSome(None) == false\n\nBelt.Option.isSome(Some(1)) == true\n```" - ], - "signature": "let isSome: option<'a> => bool" - }, - { - "id": "Belt.Option.isNone", - "kind": "value", - "name": "isNone", - "docstrings": [ - "Returns `true` if the argument is `None`, `false` otherwise.\n\n## Examples\n\n```rescript\nBelt.Option.isNone(None) == true\n\nBelt.Option.isNone(Some(1)) == false\n```" - ], - "signature": "let isNone: option<'a> => bool" - }, - { - "id": "Belt.Option.eqU", - "kind": "value", - "name": "eqU", - "docstrings": ["Uncurried version of `eq`"], - "signature": "let eqU: (option<'a>, option<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Option.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Evaluates two optional values for equality with respect to a predicate\nfunction. If both `optValue1` and `optValue2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\n\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`predicate(value1, value2)`; the predicate function must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Belt.Option\n\neq(Some(3), Some(15), clockEqual) == true\n\neq(Some(3), None, clockEqual) == false\n\neq(None, Some(3), clockEqual) == false\n\neq(None, None, clockEqual) == true\n```" - ], - "signature": "let eq: (option<'a>, option<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Option.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": ["Uncurried version of `cmp`"], - "signature": "let cmpU: (option<'a>, option<'b>, ('a, 'b) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Option.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(optValue1, optValue2, comparisonFunction)` compares two optional values\nwith respect to given `comparisonFunction`.\n\nIf both `optValue1` and `optValue2` are `None`, it returns `0`.\n\nIf the first argument is `Some(value1)` and the second is `None`, returns `1`\n(something is greater than nothing).\n\nIf the first argument is `None` and the second is `Some(value2)`, returns `-1`\n(nothing is less than something).\n\nIf the arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`comparisonFunction(value1, value2)`; comparisonFunction takes two arguments\nand returns `-1` if the first argument is less than the second, `0` if the\narguments are equal, and `1` if the first argument is greater than the second.\n\n## Examples\n\n```rescript\nlet clockCompare = (a, b) => compare(mod(a, 12), mod(b, 12))\n\nopen Belt.Option\n\ncmp(Some(3), Some(15), clockCompare) == 0\n\ncmp(Some(3), Some(14), clockCompare) == 1\n\ncmp(Some(2), Some(15), clockCompare) == -1\n\ncmp(None, Some(15), clockCompare) == -1\n\ncmp(Some(14), None, clockCompare) == 1\n\ncmp(None, None, clockCompare) == 0\n```" - ], - "signature": "let cmp: (option<'a>, option<'b>, ('a, 'b) => int) => int" - } - ] - }, - "belt/hashmap": { - "id": "Belt.HashMap", - "name": "HashMap", - "docstrings": [ - "[`Belt.HashMap`]()\n\n The top level provides generic **mutable** hash map operations.\n\n It also has two specialized inner modules\n [`Belt.HashMap.Int`]() and [`Belt.HashMap.String`]()", - "A **mutable** Hash map which allows customized [`hash`]() behavior.\n\nAll data are parameterized by not its only type but also a unique identity in\nthe time of initialization, so that two _HashMaps of ints_ initialized with different\n_hash_ functions will have different type.\n\n## Examples\n\n```rescript\ntype t = int\nmodule I0 = unpack(Belt.Id.hashable(~hash=(_: t) => 0xff_ff, ~eq=(a, b) => a == b))\nlet s0: Belt.HashMap.t = Belt.HashMap.make(~hintSize=40, ~id=module(I0))\n\nmodule I1 = unpack(Belt.Id.hashable(~hash=(_: t) => 0xff, ~eq=(a, b) => a == b))\nlet s1: Belt.HashMap.t = Belt.HashMap.make(~hintSize=40, ~id=module(I1))\n```\n\nThe invariant must be held: for two elements who are _equal_,\ntheir hashed value should be the same\n\nHere the compiler would infer `s0` and `s1` having different type so that\nit would not mix.\n\n## Examples\n\n```\nlet s0: t\nlet s1: t\n```\n\nWe can add elements to the collection:\n\n## Examples\n\n```rescript\nlet () = {\n Belt.HashMap.set(s0, 0, 3)\n Belt.HashMap.set(s1, 1, \"3\")\n}\n```\n\nSince this is an mutable data strucure, `s1` will contain two pairs." - ], - "items": [ - { - "id": "Belt.HashMap.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of hash tables from type `'key` to type `'value`." - ], - "signature": "type t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.id", - "kind": "type", - "name": "id", - "docstrings": ["The identity needed for making an empty hash map."], - "signature": "type id<'a, 'id> = Belt_Id.hashable<'a, 'id>" - }, - { - "id": "Belt.HashMap.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(~hintSize=10, ~id)` creates a new map by taking in the comparator and `hintSize`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\n\nBelt.HashMap.set(hMap, 0, \"a\")\n```" - ], - "signature": "let make: (~hintSize: int, ~id: id<'key, 'id>) => t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Clears a hash table.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.fromArray([(1, \"1\")], ~id=module(IntHash))\nBelt.HashMap.clear(hMap)\nBelt.HashMap.isEmpty(hMap) == true\n```" - ], - "signature": "let clear: t<'key, 'value, 'id> => unit" - }, - { - "id": "Belt.HashMap.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(m)` checks whether a hash map is empty.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nBelt.HashMap.isEmpty(Belt.HashMap.fromArray([(1, \"1\")], ~id=module(IntHash))) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b, 'c> => bool" - }, - { - "id": "Belt.HashMap.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(hMap, k, v)` if `k` does not exist, add the binding `k,v`, otherwise, update the old value with the new `v`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntHash))\n\nBelt.HashMap.set(s0, 2, \"3\")\n\nBelt.HashMap.valuesToArray(s0) == [\"1\", \"3\", \"3\"]\n```" - ], - "signature": "let set: (t<'key, 'value, 'id>, 'key, 'value) => unit" - }, - { - "id": "Belt.HashMap.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Creates copy of a hash map.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntHash))\nlet s1 = Belt.HashMap.copy(s0)\n\nBelt.HashMap.set(s0, 2, \"3\")\n\n(Belt.HashMap.get(s0, 2) != Belt.HashMap.get(s1, 2)) == true\n```" - ], - "signature": "let copy: t<'key, 'value, 'id> => t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns value bound under specific key. If values not exist returns `None`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\n\nBelt.HashMap.get(s0, 1) == Some(\"value1\")\nBelt.HashMap.get(s0, 2) == None\n```" - ], - "signature": "let get: (t<'key, 'value, 'id>, 'key) => option<'value>" - }, - { - "id": "Belt.HashMap.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if `x` is bound in `tbl`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\n\nBelt.HashMap.has(s0, 1) == true\nBelt.HashMap.has(s0, 2) == false\n```" - ], - "signature": "let has: (t<'key, 'value, 'id>, 'key) => bool" - }, - { - "id": "Belt.HashMap.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "If bound exists, removes it from the hash map.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.remove(s0, 1)\nBelt.HashMap.has(s0, 1) == false\n```" - ], - "signature": "let remove: (t<'key, 'value, 'id>, 'key) => unit" - }, - { - "id": "Belt.HashMap.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as [forEach](#forEach) but takes uncurried function." - ], - "signature": "let forEachU: (t<'key, 'value, 'id>, ('key, 'value) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashMap.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(tbl, f)` applies `f` to all bindings in table `tbl`. `f` receives the key as first argument, and the associated value as second argument. Each binding is presented exactly once to `f`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.forEach(s0, (key, value) => Js.log2(key, value))\n// prints (1, \"value1\")\n```" - ], - "signature": "let forEach: (t<'key, 'value, 'id>, ('key, 'value) => unit) => unit" - }, - { - "id": "Belt.HashMap.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashMap.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(tbl, init, f)` computes `(f(kN, dN) ... (f(k1, d1, init))...)`, where `k1 ... kN` are the keys of all bindings in `tbl`, and `d1 ... dN` are the associated values. Each binding is presented exactly once to `f`.\n\nThe order in which the bindings are passed to `f` is unspecified. However, if the table contains several bindings for the same key, they are passed to `f` in reverse order of introduction, that is, the most recent binding is passed first.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\n\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\ns0->Belt.HashMap.reduce(\"\", (acc, _, value) => acc ++ (\", \" ++ value)) == \", value1, value2\"\n```\n\n## More Examples\n\n```rescript\nConsole.log(\"lol\")\n```" - ], - "signature": "let reduce: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c" - }, - { - "id": "Belt.HashMap.keepMapInPlaceU", - "kind": "value", - "name": "keepMapInPlaceU", - "docstrings": [ - "Same as [keepMapInPlace](#keepMapInPlace) but takes uncurried function." - ], - "signature": "let keepMapInPlaceU: (\n t<'key, 'value, 'id>,\n ('key, 'value) => option<'value>,\n) => unit", - "deprecated": "Use `keepMapInPlace` instead" - }, - { - "id": "Belt.HashMap.keepMapInPlace", - "kind": "value", - "name": "keepMapInPlace", - "docstrings": [ - "Filters out values for which function `f` returned `None`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.keepMapInPlace(s0, (key, value) => key == 1 ? None : Some(value))\n```" - ], - "signature": "let keepMapInPlace: (\n t<'key, 'value, 'id>,\n ('key, 'value) => option<'value>,\n) => unit" - }, - { - "id": "Belt.HashMap.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(tbl)` returns the number of bindings in `tbl`. It takes constant time.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.size(s0) == 2\n```" - ], - "signature": "let size: t<'a, 'b, 'c> => int" - }, - { - "id": "Belt.HashMap.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of key value pairs.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.toArray(s0) == [(1, \"value1\"), (2, \"value2\")]\n```" - ], - "signature": "let toArray: t<'key, 'value, 'id> => array<('key, 'value)>" - }, - { - "id": "Belt.HashMap.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "Returns array of keys.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.keysToArray(s0) == [1, 2]\n```" - ], - "signature": "let keysToArray: t<'key, 'a, 'b> => array<'key>" - }, - { - "id": "Belt.HashMap.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [ - "Returns array of values.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.valuesToArray(s0) == [\"value1\", \"value2\"]\n```" - ], - "signature": "let valuesToArray: t<'a, 'value, 'b> => array<'value>" - }, - { - "id": "Belt.HashMap.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new hash map from array of pairs.\n\nReturns array of values.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(1, \"value1\"), (2, \"value2\")], ~id=module(IntHash))\nBelt.HashMap.toArray(s0) == [(1, \"value1\"), (2, \"value2\")]\n```" - ], - "signature": "let fromArray: (\n array<('key, 'value)>,\n ~id: id<'key, 'id>,\n) => t<'key, 'value, 'id>" - }, - { - "id": "Belt.HashMap.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.mergeMany(hMap, [(1, \"1\"), (2, \"2\")])\n```" - ], - "signature": "let mergeMany: (t<'key, 'value, 'id>, array<('key, 'value)>) => unit" - }, - { - "id": "Belt.HashMap.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(hMap, 1, \"1\")\n\nBelt.HashMap.getBucketHistogram(hMap)\n```" - ], - "signature": "let getBucketHistogram: t<'a, 'b, 'c> => array" - }, - { - "id": "Belt.HashMap.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(hMap, 1, \"1\")\n\nBelt.HashMap.logStats(hMap)\n```" - ], - "signature": "let logStats: t<'a, 'b, 'c> => unit" - } - ] - }, - "belt/hashset": { - "id": "Belt.HashSet", - "name": "HashSet", - "docstrings": [ - "[`Belt.HashSet`]()\n\n The top level provides generic **mutable** hash set operations.\n\n It also has two specialized inner modules\n [`Belt.HashSet.Int`]() and [`Belt.HashSet.String`]()", - "A **mutable** Hash set which allows customized `hash` behavior.\n\nAll data are parameterized by not its only type but also a unique identity in\nthe time of initialization, so that two _HashSets of ints_ initialized with\ndifferent _hash_ functions will have different type.\n\n## Examples\n\n```rescript\nmodule I0 = unpack(Belt.Id.hashable(~hash=(a: int) => land(a, 65535), ~eq=(a, b) => a == b))\n\nlet s0 = Belt.HashSet.make(~id=module(I0), ~hintSize=40)\n\nmodule I1 = unpack(Belt.Id.hashable(~hash=(a: int) => land(a, 255), ~eq=(a, b) => a == b))\n\nlet s1 = Belt.HashSet.make(~id=module(I1), ~hintSize=40)\n\nBelt.HashSet.add(s1, 0)\nBelt.HashSet.add(s1, 1)\n```\n\nThe invariant must be held: for two elements who are equal, their hashed\nvalue should be the same.\n\nHere the compiler would infer `s0` and `s1` having different type so that it\nwould not mix.\n\nSignatures:\n\n```\nlet s0: Belt.HashSet.t\nlet s1: Belt.HashSet.t\n```\n\nWe can add elements to the collection (see last two lines in the example\nabove). Since this is an mutable data structure, `s1` will contain two pairs." - ], - "items": [ - { - "id": "Belt.HashSet.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a, 'id>" - }, - { - "id": "Belt.HashSet.id", - "kind": "type", - "name": "id", - "docstrings": ["The type of hash tables from type `'a` to type `'b`."], - "signature": "type id<'a, 'id> = Belt_Id.hashable<'a, 'id>" - }, - { - "id": "Belt.HashSet.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~hintSize: int, ~id: id<'a, 'id>) => t<'a, 'id>" - }, - { - "id": "Belt.HashSet.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a, 'id> => unit" - }, - { - "id": "Belt.HashSet.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.HashSet.add", - "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t<'a, 'id>, 'a) => unit" - }, - { - "id": "Belt.HashSet.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a, 'id> => t<'a, 'id>" - }, - { - "id": "Belt.HashSet.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a, 'id>, 'a) => bool" - }, - { - "id": "Belt.HashSet.remove", - "kind": "value", - "name": "remove", - "docstrings": [], - "signature": "let remove: (t<'a, 'id>, 'a) => unit" - }, - { - "id": "Belt.HashSet.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a, 'id>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.HashSet.forEach", - "kind": "value", - "name": "forEach", - "docstrings": ["Order unspecified."], - "signature": "let forEach: (t<'a, 'id>, 'a => unit) => unit" - }, - { - "id": "Belt.HashSet.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a, 'id>, 'c, ('c, 'a) => 'c) => 'c", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.HashSet.reduce", - "kind": "value", - "name": "reduce", - "docstrings": ["Order unspecified."], - "signature": "let reduce: (t<'a, 'id>, 'c, ('c, 'a) => 'c) => 'c" - }, - { - "id": "Belt.HashSet.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a, 'id> => int" - }, - { - "id": "Belt.HashSet.logStats", - "kind": "value", - "name": "logStats", - "docstrings": [], - "signature": "let logStats: t<'a, 'b> => unit" - }, - { - "id": "Belt.HashSet.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'a, 'id> => array<'a>" - }, - { - "id": "Belt.HashSet.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: (array<'a>, ~id: id<'a, 'id>) => t<'a, 'id>" - }, - { - "id": "Belt.HashSet.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'a, 'id>, array<'a>) => unit" - }, - { - "id": "Belt.HashSet.getBucketHistogram", - "kind": "value", - "name": "getBucketHistogram", - "docstrings": [], - "signature": "let getBucketHistogram: t<'a, 'b> => array" - } - ] - }, - "belt/mutablemap": { - "id": "Belt.MutableMap", - "name": "MutableMap", - "docstrings": [ - "[`Belt.MutableMap`]()\n\n The top level provides generic **mutable** map operations.\n\n It also has two specialized inner modules\n [`Belt.MutableMap.Int`]() and [`Belt.MutableMap.String`]()" - ], - "items": [ - { - "id": "Belt.MutableMap.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v, 'id>" - }, - { - "id": "Belt.MutableMap.id", - "kind": "type", - "name": "id", - "docstrings": [], - "signature": "type id<'key, 'id> = Belt_Id.comparable<'key, 'id>" - }, - { - "id": "Belt.MutableMap.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~id: id<'k, 'id>) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.MutableMap.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t<'a, 'b, 'c> => unit" - }, - { - "id": "Belt.MutableMap.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a, 'b, 'c> => bool" - }, - { - "id": "Belt.MutableMap.has", - "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'k, 'a, 'b>, 'k) => bool" - }, - { - "id": "Belt.MutableMap.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.MutableMap.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m1, m2, cmp)` First compare by size, if size is the same, compare by\nkey, value pair." - ], - "signature": "let cmp: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.MutableMap.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.MutableMap.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(m1, m2, eqf)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `eqf` is the\nequality predicate used to compare the data associated with the keys." - ], - "signature": "let eq: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableMap.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies f to all bindings in map `m`. `f` receives the `'k`\nas first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys." - ], - "signature": "let forEach: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit" - }, - { - "id": "Belt.MutableMap.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableMap.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f), computes`(f(kN, dN) ... (f(k1, d1, a))...)`, where`k1 ...\nkN`are the keys of all bindings in`m`(in increasing order), and`d1 ... dN`\nare the associated data." - ], - "signature": "let reduce: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableMap.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableMap.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`." - ], - "signature": "let every: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableMap.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`." - ], - "signature": "let some: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool" - }, - { - "id": "Belt.MutableMap.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'k, 'a, 'id> => int" - }, - { - "id": "Belt.MutableMap.toList", - "kind": "value", - "name": "toList", - "docstrings": ["In increasing order."], - "signature": "let toList: t<'k, 'a, 'id> => list<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [], - "signature": "let toArray: t<'k, 'a, 'id> => array<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [], - "signature": "let fromArray: (array<('k, 'a)>, ~id: id<'k, 'id>) => t<'k, 'a, 'id>" - }, - { - "id": "Belt.MutableMap.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [], - "signature": "let keysToArray: t<'k, 'a, 'b> => array<'k>" - }, - { - "id": "Belt.MutableMap.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [], - "signature": "let valuesToArray: t<'b, 'a, 'c> => array<'a>" - }, - { - "id": "Belt.MutableMap.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [], - "signature": "let minKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.MutableMap.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": [], - "signature": "let minKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.MutableMap.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [], - "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.MutableMap.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": [], - "signature": "let maxKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.MutableMap.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [], - "signature": "let minimum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [], - "signature": "let minUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [], - "signature": "let maximum: t<'k, 'a, 'b> => option<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [], - "signature": "let maxUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>" - }, - { - "id": "Belt.MutableMap.get", - "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'k, 'a, 'id>, 'k) => option<'a>" - }, - { - "id": "Belt.MutableMap.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [], - "signature": "let getUndefined: (t<'k, 'a, 'id>, 'k) => Js.undefined<'a>" - }, - { - "id": "Belt.MutableMap.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'k, 'a, 'id>, 'k, 'a) => 'a" - }, - { - "id": "Belt.MutableMap.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: (t<'k, 'a, 'id>, 'k) => 'a" - }, - { - "id": "Belt.MutableMap.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [], - "signature": "let getOrThrow: (t<'k, 'a, 'id>, 'k) => 'a" - }, - { - "id": "Belt.MutableMap.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": ["Throw when invariant is not held."], - "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit" - }, - { - "id": "Belt.MutableMap.remove", - "kind": "value", - "name": "remove", - "docstrings": ["`remove(m, x)` do the in-place modification."], - "signature": "let remove: (t<'k, 'a, 'id>, 'k) => unit" - }, - { - "id": "Belt.MutableMap.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [], - "signature": "let removeMany: (t<'k, 'a, 'id>, array<'k>) => unit" - }, - { - "id": "Belt.MutableMap.set", - "kind": "value", - "name": "set", - "docstrings": ["`set(m, x, y)` do the in-place modification"], - "signature": "let set: (t<'k, 'a, 'id>, 'k, 'a) => unit" - }, - { - "id": "Belt.MutableMap.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (t<'k, 'a, 'id>, 'k, option<'a> => option<'a>) => unit", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.MutableMap.update", - "kind": "value", - "name": "update", - "docstrings": [], - "signature": "let update: (t<'k, 'a, 'id>, 'k, option<'a> => option<'a>) => unit" - }, - { - "id": "Belt.MutableMap.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [], - "signature": "let mergeMany: (t<'k, 'a, 'id>, array<('k, 'a)>) => unit" - }, - { - "id": "Belt.MutableMap.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableMap.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated\nvalue a of all bindings of `m` has been replaced by the result of the\napplication of `f` to `a`. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys." - ], - "signature": "let map: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>" - }, - { - "id": "Belt.MutableMap.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.MutableMap.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [], - "signature": "let mapWithKey: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>" - } - ] - }, - "belt/mutableset": { - "id": "Belt.MutableSet", - "name": "MutableSet", - "docstrings": [ - "[`Belt.MutableSet`]()\n\n The top level provides generic **mutable** set operations.\n\n It also has two specialized inner modules\n [`Belt.MutableSet.Int`]() and [`Belt.MutableSet.String`]()", - "A **mutable** sorted set module which allows customized compare behavior.\nThe implementation uses balanced binary trees, and therefore searching and insertion take time logarithmic in the size of the map.\n\nIt also has two specialized inner modules [Belt.MutableSet.Int](mutable-set-int) and [Belt.MutableSet.String](mutable-set-string) - This module separates data from function which is more verbose but slightly more efficient\n\n## Examples\n\n```rescript\nmodule PairComparator = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet = Belt.MutableSet.make(~id=module(PairComparator))\nmySet->Belt.MutableSet.add((1, 2))\n```" - ], - "items": [ - { - "id": "Belt.MutableSet.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'value, 'identity>" - }, - { - "id": "Belt.MutableSet.id", - "kind": "type", - "name": "id", - "docstrings": ["The identity needed for making a set from scratch"], - "signature": "type id<'value, 'id> = Belt_Id.comparable<'value, 'id>" - }, - { - "id": "Belt.MutableSet.make", - "kind": "value", - "name": "make", - "docstrings": ["Creates a new set by taking in the comparator"], - "signature": "let make: (~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let fromArray: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [ - "The same as [fromArray][#fromarray] except it is after assuming the input array is already sorted." - ], - "signature": "let fromSortedArrayUnsafe: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Returns copy of a set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\nlet copied = s0->Belt.MutableSet.copy\ncopied->Belt.MutableSet.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let copy: t<'value, 'id> => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.MutableSet.fromArray([], ~id=module(IntCmp))\nlet notEmpty = Belt.MutableSet.fromArray([1], ~id=module(IntCmp))\n\nBelt.MutableSet.isEmpty(empty) == true\nBelt.MutableSet.isEmpty(notEmpty) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.MutableSet.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if element exists in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.fromArray([1, 4, 2, 5], ~id=module(IntCmp))\n\nset->Belt.MutableSet.has(3) == false\nset->Belt.MutableSet.has(1) == true\n```" - ], - "signature": "let has: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.MutableSet.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\ns0->Belt.MutableSet.add(1)\ns0->Belt.MutableSet.add(2)\ns0->Belt.MutableSet.add(2)\n\ns0->Belt.MutableSet.toArray == [1, 2]\n```" - ], - "signature": "let add: (t<'value, 'id>, 'value) => unit" - }, - { - "id": "Belt.MutableSet.addCheck", - "kind": "value", - "name": "addCheck", - "docstrings": [], - "signature": "let addCheck: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.MutableSet.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "Adds each element of array to set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.make(~id=module(IntCmp))\n\nset->Belt.MutableSet.mergeMany([5, 4, 3, 2, 1])\nset->Belt.MutableSet.toArray == [1, 2, 3, 4, 5]\n```" - ], - "signature": "let mergeMany: (t<'value, 'id>, array<'value>) => unit" - }, - { - "id": "Belt.MutableSet.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([2, 3, 1, 4, 5], ~id=module(IntCmp))\ns0->Belt.MutableSet.remove(1)\ns0->Belt.MutableSet.remove(3)\ns0->Belt.MutableSet.remove(3)\n\ns0->Belt.MutableSet.toArray == [2, 4, 5]\n```" - ], - "signature": "let remove: (t<'value, 'id>, 'value) => unit" - }, - { - "id": "Belt.MutableSet.removeCheck", - "kind": "value", - "name": "removeCheck", - "docstrings": [], - "signature": "let removeCheck: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.MutableSet.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "Removes each element of array from set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\nset->Belt.MutableSet.removeMany([5, 4, 3, 2, 1])\nset->Belt.MutableSet.toArray == []\n```" - ], - "signature": "let removeMany: (t<'value, 'id>, array<'value>) => unit" - }, - { - "id": "Belt.MutableSet.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet union = Belt.MutableSet.union(s0, s1)\nunion->Belt.MutableSet.toArray == [1, 2, 3, 4, 5, 6]\n```" - ], - "signature": "let union: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet intersect = Belt.MutableSet.intersect(s0, s1)\nintersect->Belt.MutableSet.toArray == [2, 3, 5]\n```" - ], - "signature": "let intersect: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.diff", - "kind": "value", - "name": "diff", - "docstrings": [ - "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nBelt.MutableSet.toArray(Belt.MutableSet.diff(s0, s1)) == [6]\nBelt.MutableSet.toArray(Belt.MutableSet.diff(s1, s0)) == [1, 4]\n```" - ], - "signature": "let diff: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet s2 = Belt.MutableSet.intersect(s0, s1)\nBelt.MutableSet.subset(s2, s0) == true\nBelt.MutableSet.subset(s2, s1) == true\nBelt.MutableSet.subset(s1, s0) == false\n```" - ], - "signature": "let subset: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.MutableSet.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets of sets.\nIt compares size first and then iterates over each element following the order of elements." - ], - "signature": "let cmp: (t<'value, 'id>, t<'value, 'id>) => int" - }, - { - "id": "Belt.MutableSet.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 5], ~id=module(IntCmp))\n\nBelt.MutableSet.eq(s0, s1) == true\n```" - ], - "signature": "let eq: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.MutableSet.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as `Belt.MutableSet.forEach` but takes uncurried functon." - ], - "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableSet.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet acc = ref(list{})\ns0->Belt.MutableSet.forEach(x => acc := Belt.List.add(acc.contents, x))\nacc.contents == list{6, 5, 3, 2}\n```" - ], - "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit" - }, - { - "id": "Belt.MutableSet.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableSet.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\ns0->Belt.MutableSet.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) ==\n list{6, 5, 3, 2}\n```" - ], - "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a" - }, - { - "id": "Belt.MutableSet.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.MutableSet.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.MutableSet.fromArray([2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.MutableSet.every(isEven) == true\n```" - ], - "signature": "let every: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.MutableSet.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.MutableSet.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.MutableSet.some(isOdd) == true\n```" - ], - "signature": "let some: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.MutableSet.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.MutableSet.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.MutableSet.keep(isEven)\n\ns1->Belt.MutableSet.toArray == [2, 4]\n```" - ], - "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>" - }, - { - "id": "Belt.MutableSet.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.MutableSet.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet (s1, s2) = s0->Belt.MutableSet.partition(isOdd)\n\ns1->Belt.MutableSet.toArray == [1, 3, 5]\ns2->Belt.MutableSet.toArray == [2, 4]\n```" - ], - "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)" - }, - { - "id": "Belt.MutableSet.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.size == 4\n```" - ], - "signature": "let size: t<'value, 'id> => int" - }, - { - "id": "Belt.MutableSet.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toList == list{1, 2, 3, 5}\n```" - ], - "signature": "let toList: t<'value, 'id> => list<'value>" - }, - { - "id": "Belt.MutableSet.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toArray == [1, 2, 3, 5]\n```" - ], - "signature": "let toArray: t<'value, 'id> => array<'value>" - }, - { - "id": "Belt.MutableSet.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.minimum == None\ns1->Belt.MutableSet.minimum == Some(1)\n```" - ], - "signature": "let minimum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.MutableSet.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "Returns minimum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.minUndefined == Js.undefined\ns1->Belt.MutableSet.minUndefined == Js.Undefined.return(1)\n```" - ], - "signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.MutableSet.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.maximum == None\ns1->Belt.MutableSet.maximum == Some(5)\n```" - ], - "signature": "let maximum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.MutableSet.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "Returns maximum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.maxUndefined == Js.undefined\ns1->Belt.MutableSet.maxUndefined == Js.Undefined.return(5)\n```" - ], - "signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.MutableSet.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the reference of the value which is equivalent to value using the comparator specifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.get(3) == Some(3)\ns0->Belt.MutableSet.get(20) == None\n```" - ], - "signature": "let get: (t<'value, 'id>, 'value) => option<'value>" - }, - { - "id": "Belt.MutableSet.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "Same as `Belt.MutableSet.get` but returns `undefined` when element does not exist." - ], - "signature": "let getUndefined: (t<'value, 'id>, 'value) => Js.undefined<'value>" - }, - { - "id": "Belt.MutableSet.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as `Belt.MutableSet.get` but throw when element does not exist." - ], - "signature": "let getExn: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.MutableSet.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as `Belt.MutableSet.get` but throw when element does not exist." - ], - "signature": "let getOrThrow: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.MutableSet.split", - "kind": "value", - "name": "split", - "docstrings": [ - "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\nlet ((smaller, larger), present) = s0->Belt.MutableSet.split(3)\n\npresent == true\nsmaller->Belt.MutableSet.toArray == [1, 2]\nlarger->Belt.MutableSet.toArray == [4, 5]\n```" - ], - "signature": "let split: (\n t<'value, 'id>,\n 'value,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)" - }, - { - "id": "Belt.MutableSet.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": ["**throw** when invariant is not held"], - "signature": "let checkInvariantInternal: t<'a, 'b> => unit" - } - ] - }, - "belt/map": { - "id": "Belt.Map", - "name": "Map", - "docstrings": [ - "[`Belt.Map`](),\n\n The top level provides generic **immutable** map operations.\n\n It also has three specialized inner modules\n [`Belt.Map.Int`](), [`Belt.Map.String`]() and\n\n [`Belt.Map.Dict`](): This module separates data from function\n which is more verbose but slightly more efficient", - "The top level provides generic immutable map operations.\n\nIt also has three specialized inner modules `Belt.Map.Int`, `Belt.Map.String`\nand `Belt.Map.Dict`." - ], - "items": [ - { - "id": "Belt.Map.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'key` is the field type\n\n`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'key, 'value, 'identity>" - }, - { - "id": "Belt.Map.id", - "kind": "type", - "name": "id", - "docstrings": ["The identity needed for making an empty map."], - "signature": "type id<'key, 'id> = Belt_Id.comparable<'key, 'id>" - }, - { - "id": "Belt.Map.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(~id)` creates a new map by taking in the comparator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet m = Belt.Map.make(~id=module(IntCmp))\n\nBelt.Map.set(m, 0, \"a\")\n```" - ], - "signature": "let make: (~id: id<'k, 'id>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(m)` checks whether a map m is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.isEmpty(Belt.Map.fromArray([(1, \"1\")], ~id=module(IntCmp))) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b, 'c> => bool" - }, - { - "id": "Belt.Map.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(m, k)` checks whether `m` has the key `k`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.has(Belt.Map.fromArray([(1, \"1\")], ~id=module(IntCmp)), 1) == true\n```" - ], - "signature": "let has: (t<'k, 'v, 'id>, 'k) => bool" - }, - { - "id": "Belt.Map.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Map.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(m0, m1, vcmp);`\n\nTotal ordering of map given total ordering of value function.\n\nIt will compare size first and each element following the order one by one." - ], - "signature": "let cmp: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => int) => int" - }, - { - "id": "Belt.Map.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Map.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "eq(m1, m2, veq)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `veq` is the\nequality predicate used to compare the data associated with the keys." - ], - "signature": "let eq: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.findFirstByU", - "kind": "value", - "name": "findFirstByU", - "docstrings": [], - "signature": "let findFirstByU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>", - "deprecated": "Use `findFirstBy` instead" - }, - { - "id": "Belt.Map.findFirstBy", - "kind": "value", - "name": "findFirstBy", - "docstrings": [ - "`\nfindFirstBy(m, p)` uses function `f` to find the first key value pair to match predicate `p`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"\")])\n\ns0->Belt.Map.findFirstBy((k, _) => k == 4) == Some(4, \"4\")\n```" - ], - "signature": "let findFirstBy: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>" - }, - { - "id": "Belt.Map.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'k, 'v, 'id>, ('k, 'v) => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Map.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the\n`'k` as first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")])\n\nlet acc = ref(list{})\n\nBelt.Map.forEach(s0, (k, v) => acc := list{(k, v), ...acc.contents})\n\nacc.contents == list{(4, \"4\"), (3, \"3\"), (2, \"2\"), (1, \"1\")}\n```" - ], - "signature": "let forEach: (t<'k, 'v, 'id>, ('k, 'v) => unit) => unit" - }, - { - "id": "Belt.Map.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'k, 'v, 'id>, 'acc, ('acc, 'k, 'v) => 'acc) => 'acc", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Map.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(m, a, f)` computes `(f(kN, dN) ... (f(k1, d1, a))...)`, where `k1\n... kN` are the keys of all bindings in m (in increasing order), and `d1\n... dN` are the associated data.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")])\n\nBelt.Map.reduce(s0, list{}, (acc, k, v) => list{(k, v), ...acc}) ==\n list{(4, \"4\"), (3, \"3\"), (2, \"2\"), (1, \"1\")}\n```" - ], - "signature": "let reduce: (t<'k, 'v, 'id>, 'acc, ('acc, 'k, 'v) => 'acc) => 'acc" - }, - { - "id": "Belt.Map.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Map.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(m, p)` checks if all the bindings of the map satisfy the predicate\n`p`. Order unspecified" - ], - "signature": "let every: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Map.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(m, p)` checks if at least one binding of the map satisfy the predicate \n`p`. Order unspecified" - ], - "signature": "let some: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool" - }, - { - "id": "Belt.Map.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(s)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.size(Belt.Map.fromArray([(2, \"2\"), (2, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == 2\n```" - ], - "signature": "let size: t<'k, 'v, 'id> => int" - }, - { - "id": "Belt.Map.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(s)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.toArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n (1, \"1\"),\n (2, \"2\"),\n (3, \"3\"),\n ]\n```" - ], - "signature": "let toArray: t<'k, 'v, 'id> => array<('k, 'v)>" - }, - { - "id": "Belt.Map.toList", - "kind": "value", - "name": "toList", - "docstrings": ["In increasing order. See `Belt.Map.toArray`"], - "signature": "let toList: t<'k, 'v, 'id> => list<('k, 'v)>" - }, - { - "id": "Belt.Map.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(kvs, ~id);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.toArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n (1, \"1\"),\n (2, \"2\"),\n (3, \"3\"),\n ]\n```" - ], - "signature": "let fromArray: (array<('k, 'v)>, ~id: id<'k, 'id>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "`keysToArray(s);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.keysToArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n 1,\n 2,\n 3,\n ]\n```" - ], - "signature": "let keysToArray: t<'k, 'v, 'id> => array<'k>" - }, - { - "id": "Belt.Map.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [ - "`valuesToArray(s);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.valuesToArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n \"1\",\n \"2\",\n \"3\",\n ]\n```" - ], - "signature": "let valuesToArray: t<'k, 'v, 'id> => array<'v>" - }, - { - "id": "Belt.Map.minKey", - "kind": "value", - "name": "minKey", - "docstrings": [ - "`minKey(s)` returns the minimum key, None if not exist." - ], - "signature": "let minKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.minKeyUndefined", - "kind": "value", - "name": "minKeyUndefined", - "docstrings": ["See `Belt.Map.minKey`"], - "signature": "let minKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.maxKey", - "kind": "value", - "name": "maxKey", - "docstrings": [ - "`maxKey(s)` returns the maximum key, None if not exist." - ], - "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>" - }, - { - "id": "Belt.Map.maxKeyUndefined", - "kind": "value", - "name": "maxKeyUndefined", - "docstrings": ["See `Belt.Map.maxKey`"], - "signature": "let maxKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>" - }, - { - "id": "Belt.Map.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "`minimum(s)` returns the minimum key value pair, None if not exist." - ], - "signature": "let minimum: t<'k, 'v, 'a> => option<('k, 'v)>" - }, - { - "id": "Belt.Map.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": ["See `Belt.Map.minimum`"], - "signature": "let minUndefined: t<'k, 'v, 'a> => Js.undefined<('k, 'v)>" - }, - { - "id": "Belt.Map.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "`maximum(s)` returns the maximum key value pair, None if not exist." - ], - "signature": "let maximum: t<'k, 'v, 'a> => option<('k, 'v)>" - }, - { - "id": "Belt.Map.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": ["See `Belt.Map.maximum`"], - "signature": "let maxUndefined: t<'k, 'v, 'a> => Js.undefined<('k, 'v)>" - }, - { - "id": "Belt.Map.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(s, k)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.get(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp)), 2) == Some(\"2\")\n\nBelt.Map.get(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp)), 4) == None\n```" - ], - "signature": "let get: (t<'k, 'v, 'id>, 'k) => option<'v>" - }, - { - "id": "Belt.Map.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "See `Belt.Map.get`. Returns `undefined` when not found" - ], - "signature": "let getUndefined: (t<'k, 'v, 'id>, 'k) => Js.undefined<'v>" - }, - { - "id": "Belt.Map.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [ - "`getWithDefault(s, k, default)`\n\nSee `Belt.Map.get`\n\nReturns default when `k` is not found." - ], - "signature": "let getWithDefault: (t<'k, 'v, 'id>, 'k, 'v) => 'v" - }, - { - "id": "Belt.Map.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(s, k)`\n\nSee `Belt.Map.get`\n\nthrow when `k` not exist" - ], - "signature": "let getExn: (t<'k, 'v, 'id>, 'k) => 'v" - }, - { - "id": "Belt.Map.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(s, k)`\n\nSee `Belt.Map.get`\n\nthrow when `k` not exist" - ], - "signature": "let getOrThrow: (t<'k, 'v, 'id>, 'k) => 'v" - }, - { - "id": "Belt.Map.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "`remove(m, x)` when `x` is not in `m`, `m` is returned reference unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))\n\nlet s1 = Belt.Map.remove(s0, 1)\n\nlet s2 = Belt.Map.remove(s1, 1)\n\ns1 == s2\n\nBelt.Map.keysToArray(s1) == [2, 3]\n```" - ], - "signature": "let remove: (t<'k, 'v, 'id>, 'k) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "`removeMany(s, xs)`\n\nRemoving each of `xs` to `s`, note unlike `Belt.Map.remove`, the reference\nof return value might be changed even if none in `xs` exists `s`." - ], - "signature": "let removeMany: (t<'k, 'v, 'id>, array<'k>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(m, x, y)` returns a map containing the same bindings as `m`, with a\nnew binding of `x` to `y`. If `x` was already bound in `m`, its previous\nbinding disappears.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))\n\nlet s1 = Belt.Map.set(s0, 2, \"3\")\n\nBelt.Map.valuesToArray(s1) == [\"1\", \"3\", \"3\"]\n```" - ], - "signature": "let set: (t<'k, 'v, 'id>, 'k, 'v) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.updateU", - "kind": "value", - "name": "updateU", - "docstrings": [], - "signature": "let updateU: (\n t<'k, 'v, 'id>,\n 'k,\n option<'v> => option<'v>,\n) => t<'k, 'v, 'id>", - "deprecated": "Use `update` instead" - }, - { - "id": "Belt.Map.update", - "kind": "value", - "name": "update", - "docstrings": [ - "`update(m, x, f)` returns a map containing the same bindings as `m`, except\nfor the binding of `x`. Depending on the value of `y` where `y` is\n`f(get(m, x))`, the binding of `x` is added, removed or updated. If `y` is\n`None`, the binding is removed if it exists; otherwise, if `y` is `Some(z)`\nthen `x` is associated to `z` in the resulting map." - ], - "signature": "let update: (\n t<'k, 'v, 'id>,\n 'k,\n option<'v> => option<'v>,\n) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "`mergeMany(s, xs)`\n\nAdding each of `xs` to `s`, note unlike `add`, the reference of return\nvalue might be changed even if all values in `xs` exist `s`." - ], - "signature": "let mergeMany: (t<'k, 'v, 'id>, array<('k, 'v)>) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.mergeU", - "kind": "value", - "name": "mergeU", - "docstrings": [], - "signature": "let mergeU: (\n t<'k, 'v, 'id>,\n t<'k, 'v2, 'id>,\n ('k, option<'v>, option<'v2>) => option<'v3>,\n) => t<'k, 'v3, 'id>", - "deprecated": "Use `merge` instead" - }, - { - "id": "Belt.Map.merge", - "kind": "value", - "name": "merge", - "docstrings": [ - "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`." - ], - "signature": "let merge: (\n t<'k, 'v, 'id>,\n t<'k, 'v2, 'id>,\n ('k, option<'v>, option<'v2>) => option<'v3>,\n) => t<'k, 'v3, 'id>" - }, - { - "id": "Belt.Map.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => t<'k, 'v, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Map.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(m, p)` returns the map with all the bindings in m that satisfy\npredicate `p`." - ], - "signature": "let keep: (t<'k, 'v, 'id>, ('k, 'v) => bool) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'k, 'v, 'id>,\n ('k, 'v) => bool,\n) => (t<'k, 'v, 'id>, t<'k, 'v, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Map.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains\nall the bindings of `s` that satisfy the predicate `p`, and `m2` is the map\nwith all the bindings of `s` that do not satisfy `p`." - ], - "signature": "let partition: (\n t<'k, 'v, 'id>,\n ('k, 'v) => bool,\n) => (t<'k, 'v, 'id>, t<'k, 'v, 'id>)" - }, - { - "id": "Belt.Map.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(x, m)` returns a tuple `(l, r)`, data, where `l` is the map with all\nthe bindings of `m` whose 'k is strictly less than `x`; `r` is the map with\nall the bindings of m whose 'k is strictly greater than `x`; `data` is\n`None` if `m` contains no binding for `x`, or `Some(v)` if `m` binds `v` to\n`x`." - ], - "signature": "let split: (\n t<'k, 'v, 'id>,\n 'k,\n) => ((t<'k, 'v, 'id>, t<'k, 'v, 'id>), option<'v>)" - }, - { - "id": "Belt.Map.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'k, 'v, 'id>, 'v => 'v2) => t<'k, 'v2, 'id>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Map.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys." - ], - "signature": "let map: (t<'k, 'v, 'id>, 'v => 'v2) => t<'k, 'v2, 'id>" - }, - { - "id": "Belt.Map.mapWithKeyU", - "kind": "value", - "name": "mapWithKeyU", - "docstrings": [], - "signature": "let mapWithKeyU: (t<'k, 'v, 'id>, ('k, 'v) => 'v2) => t<'k, 'v2, 'id>", - "deprecated": "Use `mapWithKey` instead" - }, - { - "id": "Belt.Map.mapWithKey", - "kind": "value", - "name": "mapWithKey", - "docstrings": [ - "`mapWithKey(m, f)`\n\nThe same as `Belt.Map.map` except that `f` is supplied with one more\nargument: the key." - ], - "signature": "let mapWithKey: (t<'k, 'v, 'id>, ('k, 'v) => 'v2) => t<'k, 'v2, 'id>" - }, - { - "id": "Belt.Map.getData", - "kind": "value", - "name": "getData", - "docstrings": [ - "`getData(s0)`\n\nAdvanced usage only\n\nReturns the raw data (detached from comparator), but its type is still\nmanifested, so that user can pass identity directly without boxing." - ], - "signature": "let getData: t<'k, 'v, 'id> => Belt_MapDict.t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.getId", - "kind": "value", - "name": "getId", - "docstrings": ["Advanced usage only. Returns the identity of s0."], - "signature": "let getId: t<'k, 'v, 'id> => id<'k, 'id>" - }, - { - "id": "Belt.Map.packIdData", - "kind": "value", - "name": "packIdData", - "docstrings": [ - "`packIdData(~id, ~data)`\n\nAdvanced usage only\n\nReturns the packed collection." - ], - "signature": "let packIdData: (\n ~id: id<'k, 'id>,\n ~data: Belt_MapDict.t<'k, 'v, 'id>,\n) => t<'k, 'v, 'id>" - }, - { - "id": "Belt.Map.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": ["**throw** when invariant is not held"], - "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit" - } - ] - }, - "belt/set": { - "id": "Belt.Set", - "name": "Set", - "docstrings": [ - "[`Belt.Set`]()\n\n The top level provides generic **immutable** set operations.\n\n It also has three specialized inner modules\n [`Belt.Set.Int`](), [`Belt.Set.String`]() and\n\n [`Belt.Set.Dict`](): This module separates data from function\n which is more verbose but slightly more efficient", - "An _immutable_ sorted set module which allows customized _compare_ behavior.\n\nThe implementation uses balanced binary trees, and therefore searching\nand insertion take time logarithmic in the size of the map.\n\nFor more info on this module's usage of identity, `make` and others, please see\nthe top level documentation of Belt, **A special encoding for collection safety**.\n\n## Examples\n\n```rescript\nmodule PairComparator = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet = Belt.Set.make(~id=module(PairComparator))\nlet mySet2 = Belt.Set.add(mySet, (1, 2))\n```\n\n**Note:** This module's examples will assume a predeclared module for integers\ncalled `IntCmp`. It is declared like this:\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n```" - ], - "items": [ - { - "id": "Belt.Set.t", - "kind": "type", - "name": "t", - "docstrings": [ - "`'value` is the element type\n\n`'identity` the identity of the collection" - ], - "signature": "type t<'value, 'identity>" - }, - { - "id": "Belt.Set.id", - "kind": "type", - "name": "id", - "docstrings": ["The identity needed for making a set from scratch"], - "signature": "type id<'value, 'id> = Belt_Id.comparable<'value, 'id>" - }, - { - "id": "Belt.Set.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new set by taking in the comparator\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.make(~id=module(IntCmp))\n\nBelt.Set.isEmpty(set) == true\n```" - ], - "signature": "let make: (~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\ns0->Belt.Set.toArray == [1, 2, 3, 4]\n```" - ], - "signature": "let fromArray: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.fromSortedArrayUnsafe", - "kind": "value", - "name": "fromSortedArrayUnsafe", - "docstrings": [ - "The same as [fromArray][#fromarray] except it is after assuming the input array\nis already sorted." - ], - "signature": "let fromSortedArrayUnsafe: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.Set.fromArray([], ~id=module(IntCmp))\nlet notEmpty = Belt.Set.fromArray([1], ~id=module(IntCmp))\n\nBelt.Set.isEmpty(empty) == true\nBelt.Set.isEmpty(notEmpty) == false\n```" - ], - "signature": "let isEmpty: t<'a, 'b> => bool" - }, - { - "id": "Belt.Set.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks if element exists in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.fromArray([1, 4, 2, 5], ~id=module(IntCmp))\n\nset->Belt.Set.has(3) == false\nset->Belt.Set.has(1) == true\n```" - ], - "signature": "let has: (t<'value, 'id>, 'value) => bool" - }, - { - "id": "Belt.Set.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\n\nlet s1 = s0->Belt.Set.add(1)\nlet s2 = s1->Belt.Set.add(2)\nlet s3 = s2->Belt.Set.add(2)\n\ns0->Belt.Set.toArray == []\ns1->Belt.Set.toArray == [1]\ns2->Belt.Set.toArray == [1, 2]\ns3->Belt.Set.toArray == [1, 2]\ns2 == s3\n```" - ], - "signature": "let add: (t<'value, 'id>, 'value) => t<'value, 'id>" - }, - { - "id": "Belt.Set.mergeMany", - "kind": "value", - "name": "mergeMany", - "docstrings": [ - "Adds each element of array to set. Unlike `Belt.Set.add`\\](\\#add), the reference of return value might be changed even if all values in array already exist in set\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.make(~id=module(IntCmp))\n\nlet newSet = set->Belt.Set.mergeMany([5, 4, 3, 2, 1])\n\nnewSet->Belt.Set.toArray == [1, 2, 3, 4, 5]\n```" - ], - "signature": "let mergeMany: (t<'value, 'id>, array<'value>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.remove", - "kind": "value", - "name": "remove", - "docstrings": [ - "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([2, 3, 1, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.Set.remove(1)\nlet s2 = s1->Belt.Set.remove(3)\nlet s3 = s2->Belt.Set.remove(3)\n\ns1->Belt.Set.toArray == [2, 3, 4, 5]\ns2->Belt.Set.toArray == [2, 4, 5]\ns2 == s3\n```" - ], - "signature": "let remove: (t<'value, 'id>, 'value) => t<'value, 'id>" - }, - { - "id": "Belt.Set.removeMany", - "kind": "value", - "name": "removeMany", - "docstrings": [ - "Removes each element of array from set. Unlike [remove](#remove), the reference of return value might be changed even if none of values in array existed in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\nlet newSet = set->Belt.Set.removeMany([5, 4, 3, 2, 1])\n\nnewSet->Belt.Set.toArray == []\n```" - ], - "signature": "let removeMany: (t<'value, 'id>, array<'value>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet union = Belt.Set.union(s0, s1)\n\nunion->Belt.Set.toArray == [1, 2, 3, 4, 5, 6]\n```" - ], - "signature": "let union: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\n\nlet intersect = Belt.Set.intersect(s0, s1)\n\nintersect->Belt.Set.toArray == [2, 3, 5]\n```" - ], - "signature": "let intersect: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.diff", - "kind": "value", - "name": "diff", - "docstrings": [ - "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\n\nBelt.Set.diff(s0, s1)->Belt.Set.toArray == [6]\n\nBelt.Set.diff(s1, s0)->Belt.Set.toArray == [1, 4]\n```" - ], - "signature": "let diff: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>" - }, - { - "id": "Belt.Set.subset", - "kind": "value", - "name": "subset", - "docstrings": [ - "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet s2 = Belt.Set.intersect(s0, s1)\n\nBelt.Set.subset(s2, s0) == true\nBelt.Set.subset(s2, s1) == true\nBelt.Set.subset(s1, s0) == false\n```" - ], - "signature": "let subset: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.Set.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets. It compares size first and then iterates over each element following\nthe order of elements." - ], - "signature": "let cmp: (t<'value, 'id>, t<'value, 'id>) => int" - }, - { - "id": "Belt.Set.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 5], ~id=module(IntCmp))\n\nBelt.Set.eq(s0, s1) == true\n```" - ], - "signature": "let eq: (t<'value, 'id>, t<'value, 'id>) => bool" - }, - { - "id": "Belt.Set.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [ - "Same as [forEach](#forEach) but takes uncurried functon." - ], - "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Set.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\n\nlet acc = ref(list{})\n\ns0->Belt.Set.forEach(x => {\n acc := Belt.List.add(acc.contents, x)\n})\n\nacc.contents == list{6, 5, 3, 2}\n```" - ], - "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit" - }, - { - "id": "Belt.Set.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Set.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\ns0->Belt.Set.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) == list{6, 5, 3, 2}\n```" - ], - "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a" - }, - { - "id": "Belt.Set.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Set.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.fromArray([2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.Set.every(isEven) == true\n```" - ], - "signature": "let every: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Set.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.fromArray([1, 2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.Set.some(isOdd) == true\n```" - ], - "signature": "let some: (t<'value, 'id>, 'value => bool) => bool" - }, - { - "id": "Belt.Set.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Set.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.Set.keep(isEven)\n\ns1->Belt.Set.toArray == [2, 4]\n```" - ], - "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>" - }, - { - "id": "Belt.Set.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Set.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "Returns a pair of sets, where first is the set of all the elements of set that satisfy the predicate, and second is the set of all the elements of set that do not satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet (s1, s2) = s0->Belt.Set.partition(isOdd)\n\ns1->Belt.Set.toArray == [1, 3, 5]\ns2->Belt.Set.toArray == [2, 4]\n```" - ], - "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)" - }, - { - "id": "Belt.Set.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\ns0->Belt.Set.size == 4\n```" - ], - "signature": "let size: t<'value, 'id> => int" - }, - { - "id": "Belt.Set.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.toArray == [1, 2, 3, 5]\n```" - ], - "signature": "let toArray: t<'value, 'id> => array<'value>" - }, - { - "id": "Belt.Set.toList", - "kind": "value", - "name": "toList", - "docstrings": [ - "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.toList == list{1, 2, 3, 5}\n```" - ], - "signature": "let toList: t<'value, 'id> => list<'value>" - }, - { - "id": "Belt.Set.minimum", - "kind": "value", - "name": "minimum", - "docstrings": [ - "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.minimum == None\ns1->Belt.Set.minimum == Some(1)\n```" - ], - "signature": "let minimum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.minUndefined", - "kind": "value", - "name": "minUndefined", - "docstrings": [ - "Returns minimum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.minUndefined->Js.Undefined.toOption == None\ns1->Belt.Set.minUndefined->Js.Undefined.toOption == Some(1)\n```" - ], - "signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.maximum", - "kind": "value", - "name": "maximum", - "docstrings": [ - "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.maximum == None\ns1->Belt.Set.maximum == Some(5)\n```" - ], - "signature": "let maximum: t<'value, 'id> => option<'value>" - }, - { - "id": "Belt.Set.maxUndefined", - "kind": "value", - "name": "maxUndefined", - "docstrings": [ - "Returns maximum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0\n->Belt.Set.maxUndefined\n->Js.Undefined.toOption == None\n\ns1\n->Belt.Set.maxUndefined\n->Js.Undefined.toOption == Some(5)\n```" - ], - "signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>" - }, - { - "id": "Belt.Set.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the reference of the value which is equivalent to value using the comparator specifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\ns0->Belt.Set.get(3) == Some(3)\ns0->Belt.Set.get(20) == None\n```" - ], - "signature": "let get: (t<'value, 'id>, 'value) => option<'value>" - }, - { - "id": "Belt.Set.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "Same as [get](#get) but returns `undefined` when element does not exist." - ], - "signature": "let getUndefined: (t<'value, 'id>, 'value) => Js.undefined<'value>" - }, - { - "id": "Belt.Set.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getExn: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.Set.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as [get](#get) but throw when element does not exist." - ], - "signature": "let getOrThrow: (t<'value, 'id>, 'value) => 'value" - }, - { - "id": "Belt.Set.split", - "kind": "value", - "name": "split", - "docstrings": [ - "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\nlet ((smaller, larger), present) = s0->Belt.Set.split(3)\n\npresent == true\nsmaller->Belt.Set.toArray == [1, 2]\nlarger->Belt.Set.toArray == [4, 5]\n```" - ], - "signature": "let split: (\n t<'value, 'id>,\n 'value,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)" - }, - { - "id": "Belt.Set.checkInvariantInternal", - "kind": "value", - "name": "checkInvariantInternal", - "docstrings": ["**throw** when invariant is not held"], - "signature": "let checkInvariantInternal: t<'a, 'b> => unit" - }, - { - "id": "Belt.Set.getData", - "kind": "value", - "name": "getData", - "docstrings": [ - "**Advanced usage only**\n\nReturns the raw data (detached from comparator), but its type is still manifested,\nso that user can pass identity directly without boxing." - ], - "signature": "let getData: t<'value, 'id> => Belt_SetDict.t<'value, 'id>" - }, - { - "id": "Belt.Set.getId", - "kind": "value", - "name": "getId", - "docstrings": [ - "**Advanced usage only**\n\nReturns the identity of set." - ], - "signature": "let getId: t<'value, 'id> => id<'value, 'id>" - }, - { - "id": "Belt.Set.packIdData", - "kind": "value", - "name": "packIdData", - "docstrings": [ - "**Advanced usage only**\n\nReturns the packed collection." - ], - "signature": "let packIdData: (\n ~id: id<'value, 'id>,\n ~data: Belt_SetDict.t<'value, 'id>,\n) => t<'value, 'id>" - } - ] - }, - "belt/range": { - "id": "Belt.Range", - "name": "Range", - "docstrings": [ - "[`Belt.Range`]()\n\n Utilities for a closed range `(from, start)`", - "A small utility module to provide inclusive range operations for `[start, finish]`.\nInternally it is relying on loops instead of creating new arrays, which makes it\npretty performant and memory friendly." - ], - "items": [ - { - "id": "Belt.Range.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (int, int, int => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Range.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(start, finish, action)` equivalent to `Belt.Array.forEach(Belt.Array.range(start, finish), action))`\n\n## Examples\n\n```rescript\nBelt.Range.forEach(0, 4, i => Js.log(i))\n\n// Prints:\n// 0\n// 1\n// 2\n// 3\n// 4\n```" - ], - "signature": "let forEach: (int, int, int => unit) => unit" - }, - { - "id": "Belt.Range.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (int, int, int => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Range.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(start, finish, p)` equivalent to `Belt.Array.every(Belt.Array.range(start, finish), p)`\n## Examples\n\n```rescript\nBelt.Range.every(0, 4, i => i < 5) == true\n\nBelt.Range.every(0, 4, i => i < 4) == false\n```" - ], - "signature": "let every: (int, int, int => bool) => bool" - }, - { - "id": "Belt.Range.everyByU", - "kind": "value", - "name": "everyByU", - "docstrings": [], - "signature": "let everyByU: (int, int, ~step: int, int => bool) => bool", - "deprecated": "Use `everyBy` instead" - }, - { - "id": "Belt.Range.everyBy", - "kind": "value", - "name": "everyBy", - "docstrings": [ - "`everyBy(start, finish, ~step, p)`. See `Belt.Array.rangeBy`, equivalent to\n`Belt.Array.every(Belt.Array.rangeBy(start, finish, ~step), p)`\n\n## Examples\n\n```rescript\nBelt.Range.everyBy(0, 4, ~step=1, i => mod(i, 2) === 0) == false\n\nBelt.Range.everyBy(0, 4, ~step=2, i => mod(i, 2) === 0) == true\n```" - ], - "signature": "let everyBy: (int, int, ~step: int, int => bool) => bool" - }, - { - "id": "Belt.Range.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (int, int, int => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Range.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(start, finish, p)` equivalent to `Belt.Array.some(Belt.Array.range(start, finish), p)`\n\n## Examples\n\n```rescript\nBelt.Range.some(0, 4, i => i > 5) == false\n\nBelt.Range.some(0, 4, i => i > 2) == true\n```" - ], - "signature": "let some: (int, int, int => bool) => bool" - }, - { - "id": "Belt.Range.someByU", - "kind": "value", - "name": "someByU", - "docstrings": [], - "signature": "let someByU: (int, int, ~step: int, int => bool) => bool", - "deprecated": "Use `someBy` instead" - }, - { - "id": "Belt.Range.someBy", - "kind": "value", - "name": "someBy", - "docstrings": [ - "`someBy(start, finish, ~step, p)` See `Belt.Array.rangeBy`, equivalent to\n`Belt.Array.some(Belt.Array.rangeBy(start, finish, ~step), p)`\n\n## Examples\n\n```rescript\nBelt.Range.someBy(1, 5, ~step=2, i => mod(i, 2) === 0) == false\nBelt.Range.someBy(0, 4, ~step=2, i => mod(i, 2) === 0) == true\n```" - ], - "signature": "let someBy: (int, int, ~step: int, int => bool) => bool" - } - ] - }, - "belt/list": { - "id": "Belt.List", - "name": "List", - "docstrings": [ - "[`Belt.List`]()\n\n Utilities for List data type", - "Collection functions for manipulating the `list` data structures, a singly-linked list.\n\n**Prefer Array** if you need any of the following:\n\n- Random access of element\n- Better interop with JavaScript\n- Better memory usage & performance." - ], - "items": [ - { - "id": "Belt.List.t", - "kind": "type", - "name": "t", - "docstrings": ["`'a t` is compatible with built-in `list` type"], - "signature": "type t<'a> = list<'a>" - }, - { - "id": "Belt.List.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Returns the length of a list.\n\n## Examples\n\n```rescript\nBelt.List.length(list{1, 2, 3}) == 3\n```" - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Belt.List.size", - "kind": "value", - "name": "size", - "docstrings": ["See `Belt.List.length`"], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.List.head", - "kind": "value", - "name": "head", - "docstrings": [ - "Returns `Some(value)` where `value` is the first element in the list, or\n`None` if `someList` is an empty list.\n\n## Examples\n\n```rescript\nBelt.List.head(list{}) == None\nBelt.List.head(list{1, 2, 3}) == Some(1)\n```" - ], - "signature": "let head: t<'a> => option<'a>" - }, - { - "id": "Belt.List.headExn", - "kind": "value", - "name": "headExn", - "docstrings": [ - "Same as `Belt.List.head` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.headExn(list{1, 2, 3}) == 1\n\nswitch Belt.List.headExn(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let headExn: t<'a> => 'a" - }, - { - "id": "Belt.List.headOrThrow", - "kind": "value", - "name": "headOrThrow", - "docstrings": [ - "Same as `Belt.List.head` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.headOrThrow(list{1, 2, 3}) == 1\n\nswitch Belt.List.headOrThrow(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let headOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.List.tail", - "kind": "value", - "name": "tail", - "docstrings": [ - "Returns `None` if `someList` is empty, otherwise it returns `Some(tail)`\nwhere `tail` is everything except the first element of `someList`.\n\n## Examples\n\n```rescript\nBelt.List.tail(list{1, 2, 3}) == Some(list{2, 3})\n\nBelt.List.tail(list{}) == None\n```" - ], - "signature": "let tail: t<'a> => option>" - }, - { - "id": "Belt.List.tailExn", - "kind": "value", - "name": "tailExn", - "docstrings": [ - "Same as `Belt.List.tail` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.tailExn(list{1, 2, 3}) == list{2, 3}\n\nswitch Belt.List.tailExn(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let tailExn: t<'a> => t<'a>" - }, - { - "id": "Belt.List.tailOrThrow", - "kind": "value", - "name": "tailOrThrow", - "docstrings": [ - "Same as `Belt.List.tail` but throws an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.tailOrThrow(list{1, 2, 3}) == list{2, 3}\n\nswitch Belt.List.tailOrThrow(list{}) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let tailOrThrow: t<'a> => t<'a>" - }, - { - "id": "Belt.List.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds `value` to the beginning of `someList`.\n\n## Examples\n\n```rescript\nBelt.List.add(list{2, 3}, 1) // list{1, 2, 3}\n\nBelt.List.add(list{\"World\", \"!\"}, \"Hello\") == list{\"Hello\", \"World\", \"!\"}\n```" - ], - "signature": "let add: (t<'a>, 'a) => t<'a>" - }, - { - "id": "Belt.List.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Return the nth element in `someList`, or `None` if `index` is larger than the\nlength.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.get(1) == Some(\"B\")\n\nabc->Belt.List.get(4) == None\n```" - ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, - { - "id": "Belt.List.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Same as `Belt.List.get` but throws an exception if `index` is larger than the\nlength. Use with care.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.getExn(1) == \"B\"\n\nswitch abc->Belt.List.getExn(4) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getExn: (t<'a>, int) => 'a" - }, - { - "id": "Belt.List.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Same as `Belt.List.get` but throws an exception if `index` is larger than the\nlength. Use with care.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.getOrThrow(1) == \"B\"\n\nswitch abc->Belt.List.getOrThrow(4) {\n// Throws an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let getOrThrow: (t<'a>, int) => 'a" - }, - { - "id": "Belt.List.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a list of length `numItems` with each element filled with value `v`. Returns an empty list if `numItems` is negative.\n\n## Examples\n\n```rescript\nBelt.List.make(3, 1) == list{1, 1, 1}\n```" - ], - "signature": "let make: (int, 'a) => t<'a>" - }, - { - "id": "Belt.List.makeByU", - "kind": "value", - "name": "makeByU", - "docstrings": ["Uncurried version of [makeBy](#makeBy)"], - "signature": "let makeByU: (int, int => 'a) => t<'a>", - "deprecated": "Use `makeBy` instead" - }, - { - "id": "Belt.List.makeBy", - "kind": "value", - "name": "makeBy", - "docstrings": [ - "Return a list of length `numItems` with element `i` initialized with `f(i)`.\nReturns an empty list if `numItems` is negative.\n\n## Examples\n\n```rescript\nBelt.List.makeBy(5, i => i) == list{0, 1, 2, 3, 4}\n\nBelt.List.makeBy(5, i => i * i) == list{0, 1, 4, 9, 16}\n```" - ], - "signature": "let makeBy: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.List.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "Returns a new list in random order.\n\n## Examples\n\n```rescript\nBelt.List.shuffle(list{1, 2, 3}) // list{2, 1, 3}\n```" - ], - "signature": "let shuffle: t<'a> => t<'a>" - }, - { - "id": "Belt.List.drop", - "kind": "value", - "name": "drop", - "docstrings": [ - "Return a new list, dropping the first `n` elements. Returns `None` if `someList` has fewer than `n` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.drop(2) == Some(list{3})\n\nlist{1, 2, 3}->Belt.List.drop(3) == Some(list{})\n\nlist{1, 2, 3}->Belt.List.drop(4) == None\n```" - ], - "signature": "let drop: (t<'a>, int) => option>" - }, - { - "id": "Belt.List.take", - "kind": "value", - "name": "take", - "docstrings": [ - "Returns a list with the first `n` elements from `someList`, or `None` if `someList` has fewer than `n` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.take(1) == Some(list{1})\n\nlist{1, 2, 3}->Belt.List.take(2) == Some(list{1, 2})\n\nlist{1, 2, 3}->Belt.List.take(4) == None\n```" - ], - "signature": "let take: (t<'a>, int) => option>" - }, - { - "id": "Belt.List.splitAt", - "kind": "value", - "name": "splitAt", - "docstrings": [ - "Split the list `someList` at `index`. Returns `None` when the length of `someList` is less than `index`.\n\n## Examples\n\n```rescript\nlist{\"Hello\", \"World\"}->Belt.List.splitAt(1) == Some((list{\"Hello\"}, list{\"World\"}))\n\nlist{0, 1, 2, 3, 4}->Belt.List.splitAt(2) == Some((list{0, 1}, list{2, 3, 4}))\n```" - ], - "signature": "let splitAt: (t<'a>, int) => option<(list<'a>, list<'a>)>" - }, - { - "id": "Belt.List.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "Returns the list obtained by adding `secondList` after `firstList`.\n\n## Examples\n\n```rescript\nBelt.List.concat(list{1, 2, 3}, list{4, 5}) == list{1, 2, 3, 4, 5}\n```" - ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Belt.List.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "Returns the list obtained by concatenating all the lists in array `a`, in\norder.\n\n## Examples\n\n```rescript\nBelt.List.concatMany([list{1, 2, 3}, list{}, list{3}]) == list{1, 2, 3, 3}\n```" - ], - "signature": "let concatMany: array> => t<'a>" - }, - { - "id": "Belt.List.reverseConcat", - "kind": "value", - "name": "reverseConcat", - "docstrings": [ - "Equivalent to writing: `concat(reverse(firstList, secondList)`\n\n## Examples\n\n```rescript\nBelt.List.reverseConcat(list{1, 2}, list{3, 4}) == list{2, 1, 3, 4}\n```" - ], - "signature": "let reverseConcat: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Belt.List.flatten", - "kind": "value", - "name": "flatten", - "docstrings": [ - "Return the list obtained by concatenating all the lists in list `ls`, in order.\n\n## Examples\n\n```rescript\nBelt.List.flatten(list{list{1, 2, 3}, list{}, list{3}}) == list{1, 2, 3, 3}\n```" - ], - "signature": "let flatten: t> => t<'a>" - }, - { - "id": "Belt.List.mapU", - "kind": "value", - "name": "mapU", - "docstrings": ["Uncurried version of [map](#map)."], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.List.map", - "kind": "value", - "name": "map", - "docstrings": [ - "Returns a new list with `f` applied to each element of `someList`.\n\n## Examples\n\n```rescript\nlist{1, 2}->Belt.List.map(x => x + 1) == list{2, 3}\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.List.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "Returns a list of pairs from the two lists with the length of the shorter list.\n\n## Examples\n\n```rescript\nBelt.List.zip(list{1, 2}, list{3, 4, 5}) == list{(1, 3), (2, 4)}\n```" - ], - "signature": "let zip: (t<'a>, t<'b>) => t<('a, 'b)>" - }, - { - "id": "Belt.List.zipByU", - "kind": "value", - "name": "zipByU", - "docstrings": ["Uncurried version of [zipBy](#zipBy)."], - "signature": "let zipByU: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>", - "deprecated": "Use `zipBy` instead" - }, - { - "id": "Belt.List.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "See [Belt.List.zip](#zip)\n\n## Examples\n\n```rescript\nBelt.List.zipBy(list{1, 2, 3}, list{4, 5}, (a, b) => 2 * a + b) == list{6, 9}\n```" - ], - "signature": "let zipBy: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>" - }, - { - "id": "Belt.List.mapWithIndexU", - "kind": "value", - "name": "mapWithIndexU", - "docstrings": ["Uncurried version of [mapWithIndex](#mapWithIndex)."], - "signature": "let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => t<'b>", - "deprecated": "Use `mapWithIndex` instead" - }, - { - "id": "Belt.List.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "Applies `f` to each element of `someList`.\nFunction `f` takes two arguments: the index starting from 0 and the element from `someList`, in that order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.mapWithIndex((index, x) => index + x) == list{1, 3, 5}\n```" - ], - "signature": "let mapWithIndex: (t<'a>, (int, 'a) => 'b) => t<'b>" - }, - { - "id": "Belt.List.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Converts the given array to a list.\n\n## Examples\n\n```rescript\nBelt.List.fromArray([1, 2, 3]) == list{1, 2, 3}\n```" - ], - "signature": "let fromArray: array<'a> => t<'a>" - }, - { - "id": "Belt.List.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Converts the given list to an array.\n\n## Examples\n\n```rescript\nBelt.List.toArray(list{1, 2, 3}) == [1, 2, 3]\n```" - ], - "signature": "let toArray: t<'a> => array<'a>" - }, - { - "id": "Belt.List.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "Returns a new list whose elements are those of `someList` in reversed order.\n\n## Examples\n\n```rescript\nBelt.List.reverse(list{1, 2, 3}) == list{3, 2, 1}\n```" - ], - "signature": "let reverse: t<'a> => t<'a>" - }, - { - "id": "Belt.List.mapReverseU", - "kind": "value", - "name": "mapReverseU", - "docstrings": ["Uncurried version of [mapReverse](#mapReverse)."], - "signature": "let mapReverseU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `mapReverse` instead" - }, - { - "id": "Belt.List.mapReverse", - "kind": "value", - "name": "mapReverse", - "docstrings": [ - "Equivalent to `Belt.List.map(someList, f)->Belt.List.reverse`\n\n## Examples\n\n```rescript\nlist{3, 4, 5}->Belt.List.mapReverse(x => x * x) == list{25, 16, 9}\n```" - ], - "signature": "let mapReverse: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.List.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": ["Uncurried version of [forEach](#forEach)."], - "signature": "let forEachU: (t<'a>, 'a => 'b) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.List.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Call `f` on each element of `someList` from the beginning to end.\n`f` returns `unit`, so no new array is created. Use `forEach` when you are primarily concerned with repetitively creating side effects.\n\n## Examples\n\n```rescript\nBelt.List.forEach(list{\"a\", \"b\", \"c\"}, x => Js.log(\"Item: \" ++ x))\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\n```" - ], - "signature": "let forEach: (t<'a>, 'a => 'b) => unit" - }, - { - "id": "Belt.List.forEachWithIndexU", - "kind": "value", - "name": "forEachWithIndexU", - "docstrings": [ - "Uncurried version of [forEachWithIndex](#forEachWithIndex)." - ], - "signature": "let forEachWithIndexU: (t<'a>, (int, 'a) => 'b) => unit", - "deprecated": "Use `forEachWithIndex` instead" - }, - { - "id": "Belt.List.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "Call `f` on each element of `someList` from beginning to end.\nFunction `f` takes two arguments: the index starting from 0 and the element from `someList`. `f` returns `unit`.\n\n## Examples\n\n```rescript\nBelt.List.forEachWithIndex(list{\"a\", \"b\", \"c\"}, (index, x) => {\n Js.log(\"Item \" ++ Belt.Int.toString(index) ++ \" is \" ++ x)\n})\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\n```" - ], - "signature": "let forEachWithIndex: (t<'a>, (int, 'a) => 'b) => unit" - }, - { - "id": "Belt.List.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": ["Uncurried version of [reduce](#reduce)."], - "signature": "let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.List.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "Applies `f` to each element of `someList` from beginning to end. Function `f` has two parameters: the item from the list and an “accumulator”, which starts with a value of `initialValue`. reduce returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduce(0, (a, b) => a + b) == 10\n\n/* same as */\n\nlist{1, 2, 3, 4}->Belt.List.reduce(0, (acc, item) => acc + item) == 10\n```" - ], - "signature": "let reduce: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Belt.List.reduceWithIndexU", - "kind": "value", - "name": "reduceWithIndexU", - "docstrings": [ - "Uncurried version of [reduceWithIndex](#reduceWithIndex)." - ], - "signature": "let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b", - "deprecated": "Use `reduceWithIndex` instead" - }, - { - "id": "Belt.List.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "Applies `f` to each element of `someList` from beginning to end. Function `f` has three parameters: the item from the list and an “accumulator”, which starts with a value of `initialValue` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduceWithIndex(0, (acc, item, index) => acc + item + index) == 16\n```" - ], - "signature": "let reduceWithIndex: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Belt.List.reduceReverseU", - "kind": "value", - "name": "reduceReverseU", - "docstrings": ["Uncurried version of [reduceReverse](#reduceReverse)."], - "signature": "let reduceReverseU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b", - "deprecated": "Use `reduceReverse` instead" - }, - { - "id": "Belt.List.reduceReverse", - "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "Works like [reduce](#reduce), except that function `f` is applied to each\nitem of `someList` from the last back to the first.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(0, (a, b) => a + b) == 10\n\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(10, (a, b) => a - b) == 0\n\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(list{}, Belt.List.add) == list{1, 2, 3, 4}\n```" - ], - "signature": "let reduceReverse: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Belt.List.mapReverse2U", - "kind": "value", - "name": "mapReverse2U", - "docstrings": ["Uncurried version of [mapReverse2](#mapReverse2)."], - "signature": "let mapReverse2U: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>", - "deprecated": "Use `mapReverse2` instead" - }, - { - "id": "Belt.List.mapReverse2", - "kind": "value", - "name": "mapReverse2", - "docstrings": [ - "Equivalent to: `zipBy(xs, ys, f)->reverse`\n\n## Examples\n\n```rescript\nBelt.List.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) == list{4, 2}\n```" - ], - "signature": "let mapReverse2: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>" - }, - { - "id": "Belt.List.forEach2U", - "kind": "value", - "name": "forEach2U", - "docstrings": ["Uncurried version of [forEach2](#forEach2)."], - "signature": "let forEach2U: (t<'a>, t<'b>, ('a, 'b) => 'c) => unit", - "deprecated": "Use `forEach2` instead" - }, - { - "id": "Belt.List.forEach2", - "kind": "value", - "name": "forEach2", - "docstrings": [ - "Stops at the length of the shorter list.\n\n## Examples\n\n```rescript\nBelt.List.forEach2(list{\"Z\", \"Y\"}, list{\"A\", \"B\", \"C\"}, (x, y) => Js.log2(x, y))\n\n/*\n prints:\n \"Z\" \"A\"\n \"Y\" \"B\"\n*/\n```" - ], - "signature": "let forEach2: (t<'a>, t<'b>, ('a, 'b) => 'c) => unit" - }, - { - "id": "Belt.List.reduce2U", - "kind": "value", - "name": "reduce2U", - "docstrings": ["Uncurried version of [reduce2](#reduce2)."], - "signature": "let reduce2U: (t<'b>, t<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a", - "deprecated": "Use `reduce2` instead" - }, - { - "id": "Belt.List.reduce2", - "kind": "value", - "name": "reduce2", - "docstrings": [ - "Applies `f` to each element of `firstList` and `secondList` from beginning to end. Stops with the shorter list. Function `f` has three parameters: an “accumulator” which starts with a value of `initialValue`, an item from `firstList`, and an item from `secondList`. `reduce2` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nBelt.List.reduce2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduce2: (t<'b>, t<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a" - }, - { - "id": "Belt.List.reduceReverse2U", - "kind": "value", - "name": "reduceReverse2U", - "docstrings": [ - "Uncurried version of [reduceReverse2](#reduceReverse2)." - ], - "signature": "let reduceReverse2U: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c", - "deprecated": "Use `reduceReverse2` instead" - }, - { - "id": "Belt.List.reduceReverse2", - "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "Applies `f` to each element of `firstList` and `secondList` from end to\nbeginning. Stops with the shorter list. Function `f` has three parameters: an\n“accumulator” which starts with a value of init, an item from `firstList`,\nand an item from `secondList`. `reduce2` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nBelt.List.reduceReverse2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduceReverse2: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" - }, - { - "id": "Belt.List.everyU", - "kind": "value", - "name": "everyU", - "docstrings": ["Uncurried version of [every](#every)."], - "signature": "let everyU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.List.every", - "kind": "value", - "name": "every", - "docstrings": [ - "Returns `true` if all elements satisfy `pred`, where `pred` is a predicate: a function taking an element and returning a bool.\n\n## Examples\n\n```rescript\nlet isBelow10 = value => value < 10\n\nlist{1, 9, 8, 2}->Belt.List.every(isBelow10) == true\n\nlist{1, 99, 8, 2}->Belt.List.every(isBelow10) == false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.List.someU", - "kind": "value", - "name": "someU", - "docstrings": ["Uncurried version of [some](#some)."], - "signature": "let someU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.List.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Returns `true` if at least _one_ of the elements in `someList` satisfies\n`pred`, where `pred` is a predicate: a function taking an element and\nreturning a bool.\n\n## Examples\n\n```rescript\nlet isAbove100 = value => value > 100\n\nlist{101, 1, 2, 3}->Belt.List.some(isAbove100) == true\n\nlist{1, 2, 3, 4}->Belt.List.some(isAbove100) == false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.List.every2U", - "kind": "value", - "name": "every2U", - "docstrings": ["Uncurried version of [every2](#every2)."], - "signature": "let every2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `every2` instead" - }, - { - "id": "Belt.List.every2", - "kind": "value", - "name": "every2", - "docstrings": [ - "Returns `true` if predicate `pred(a, b)` is `true` for all pairs of elements\nup to the shorter length (i.e. `min(length(firstList), length(secondList))`)\n\n## Examples\n\n```rescript\nBelt.List.every2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nBelt.List.every2(list{}, list{1}, (a, b) => a > b) == true\n\nBelt.List.every2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nBelt.List.every2(list{0, 1}, list{5, 0}, (a, b) => a > b) == false\n```" - ], - "signature": "let every2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.some2U", - "kind": "value", - "name": "some2U", - "docstrings": ["Uncurried version of [some2](#some2)."], - "signature": "let some2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `some2` instead" - }, - { - "id": "Belt.List.some2", - "kind": "value", - "name": "some2", - "docstrings": [ - "Returns `true` if predicate `pred(a, b)` is true for any pair of elements up\nto the shorter length (i.e. `min(length(firstList), length(secondList))`)\n\n## Examples\n\n```rescript\nBelt.List.some2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nBelt.List.some2(list{}, list{1}, (a, b) => a > b) == false\n\nBelt.List.some2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nBelt.List.some2(list{0, 1}, list{5, 0}, (a, b) => a > b) == true\n```" - ], - "signature": "let some2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.cmpByLength", - "kind": "value", - "name": "cmpByLength", - "docstrings": [ - "Compare two lists solely by length. Returns `-1` if `length(firstList)` is\nless than `length(secondList)`, `0` if `length(firstList)` equals\n`length(secondList)`, and `1` if `length(firstList)` is greater than\n`length(secondList)`.\n\n## Examples\n\n```rescript\nBelt.List.cmpByLength(list{1, 2}, list{3, 4, 5, 6}) == -1\n\nBelt.List.cmpByLength(list{1, 2, 3}, list{4, 5, 6}) == 0\n\nBelt.List.cmpByLength(list{1, 2, 3, 4}, list{5, 6}) == 1\n```" - ], - "signature": "let cmpByLength: (t<'a>, t<'a>) => int" - }, - { - "id": "Belt.List.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": ["Uncurried version of [cmp](#cmp)."], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.List.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "Compare elements one by one `compareFn(a, b)`. `compareFn` returns a negative number if `a` is \"less than\" `b`, zero if `a` is \"equal to\" `b`, a positive number if `a` is \"greater than\" `b`.\n\nThe comparison returns the first non-zero result of `compareFn`, or zero if `compareFn` returns zero for all `a` and `b`.\n\nIf all items have compared equal, but `firstList` is exhausted first, return `-1`. (`firstList` is shorter).\nIf all items have compared equal, but `secondList` is exhausted first, return `1` (`firstList` is longer).\n\n## Examples\n\n```rescript\nBelt.List.cmp(list{3}, list{3, 7}, (a, b) => compare(a, b)) == -1\n\nBelt.List.cmp(list{5, 3}, list{5}, (a, b) => compare(a, b)) == 1\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 4, 2}, (a, b) => compare(a, b)) == -1\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 2, 3}, (a, b) => compare(a, b)) == 1\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 3, 5}, (a, b) => compare(a, b)) == 0\n```\n\n**Please note:** The total ordering of List is different from Array,\nfor Array, we compare the length first and, only if the lengths are equal, elements one by one.\nFor lists, we just compare elements one by one." - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.List.eqU", - "kind": "value", - "name": "eqU", - "docstrings": ["Uncurried version of [eq](#eq)."], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.List.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "Check equality of `firstList` and `secondList` using `eqElem` for equality on\nelements, where `eqElem` is a function that returns `true` if items `x` and\n`y` meet some criterion for equality, `false` otherwise. eq `false` if length\nof `firstList` and `secondList` are not the same.\n\n## Examples\n\n```rescript\nBelt.List.eq(list{1, 2, 3}, list{1, 2}, (a, b) => a == b) == false\n\nBelt.List.eq(list{1, 2}, list{1, 2}, (a, b) => a == b) == true\n\nBelt.List.eq(list{1, 2, 3}, list{-1, -2, -3}, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.List.hasU", - "kind": "value", - "name": "hasU", - "docstrings": ["Uncurried version of [has](#has)."], - "signature": "let hasU: (t<'a>, 'b, ('a, 'b) => bool) => bool", - "deprecated": "Use `has` instead" - }, - { - "id": "Belt.List.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Returns `true` if the list contains at least one element for which\n`eqFunction(x)` returns true.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.has(2, (a, b) => a == b) == true\n\nlist{1, 2, 3}->Belt.List.has(4, (a, b) => a == b) == false\n\nlist{-1, -2, -3}->Belt.List.has(2, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let has: (t<'a>, 'b, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.getByU", - "kind": "value", - "name": "getByU", - "docstrings": ["Uncurried version of [getBy](#getBy)."], - "signature": "let getByU: (t<'a>, 'a => bool) => option<'a>", - "deprecated": "Use `getBy` instead" - }, - { - "id": "Belt.List.getBy", - "kind": "value", - "name": "getBy", - "docstrings": [ - "Returns `Some(value)` for the first value in `someList` that satisfies the\npredicate function `pred`. Returns `None` if no element satisfies the function.\n\n## Examples\n\n```rescript\nBelt.List.getBy(list{1, 4, 3, 2}, x => x > 3) == Some(4)\n\nBelt.List.getBy(list{1, 4, 3, 2}, x => x > 4) == None\n```" - ], - "signature": "let getBy: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Belt.List.keepU", - "kind": "value", - "name": "keepU", - "docstrings": ["Uncurried version of [keep](#keep)."], - "signature": "let keepU: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.List.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.keep(list{1, 2, 3, 4}, isEven) == list{2, 4}\n\nBelt.List.keep(list{None, Some(2), Some(3), None}, Belt.Option.isSome) == list{Some(2), Some(3)}\n```" - ], - "signature": "let keep: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Belt.List.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.filter(list{1, 2, 3, 4}, isEven) == list{2, 4}\n\nBelt.List.filter(list{None, Some(2), Some(3), None}, Belt.Option.isSome) == list{Some(2), Some(3)}\n```" - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "This function will soon be deprecated. Please, use `List.keep` instead." - }, - { - "id": "Belt.List.keepWithIndexU", - "kind": "value", - "name": "keepWithIndexU", - "docstrings": ["Uncurried version of [keepWithIndex](#keepWithIndex)."], - "signature": "let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "Use `keepWithIndex` instead" - }, - { - "id": "Belt.List.keepWithIndex", - "kind": "value", - "name": "keepWithIndex", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.keepWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) == list{1, 3}\n```" - ], - "signature": "let keepWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" - }, - { - "id": "Belt.List.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.filterWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) == list{1, 3}\n```" - ], - "signature": "let filterWithIndex: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "This function will soon be deprecated. Please, use `List.keepWithIndex` \\\n instead." - }, - { - "id": "Belt.List.keepMapU", - "kind": "value", - "name": "keepMapU", - "docstrings": ["Uncurried version of [keepMap](#keepMap)."], - "signature": "let keepMapU: (t<'a>, 'a => option<'b>) => t<'b>", - "deprecated": "Use `keepMap` instead" - }, - { - "id": "Belt.List.keepMap", - "kind": "value", - "name": "keepMap", - "docstrings": [ - "Applies `f` to each element of `someList`. If `f(x)` returns `Some(value)`, then `value` is _kept_ in the resulting list.\nIf `f(x)` returns `None`, the element is _not_ retained in the result.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nlist{1, 2, 3, 4}->Belt.List.keepMap(x =>\n if isEven(x) {\n Some(x)\n } else {\n None\n }\n) /* list{2, 4} */\n\nlist{Some(1), Some(2), None}->Belt.List.keepMap(x => x) == list{1, 2}\n```" - ], - "signature": "let keepMap: (t<'a>, 'a => option<'b>) => t<'b>" - }, - { - "id": "Belt.List.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": ["Uncurried version of [partition](#partition)."], - "signature": "let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.List.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "Creates a pair of lists; the first list consists of all elements of `someList` that satisfy the predicate function `pred`; the second list consists of all elements of `someList` that _do not_ satisfy \\`pred.\n\nIn other words:\n\n```\n(elementsThatSatisfies, elementsThatDoesNotSatisfy)\n```\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.partition(x => x > 2) == (list{3, 4}, list{1, 2})\n```" - ], - "signature": "let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)" - }, - { - "id": "Belt.List.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "Takes a list of pairs and creates a pair of lists. The first list contains all the first items of the pairs; the second list contains all the second items.\n\n## Examples\n\n```rescript\nBelt.List.unzip(list{(1, 2), (3, 4)}) == (list{1, 3}, list{2, 4})\n\nBelt.List.unzip(list{(\"H\", \"W\"), (\"e\", \"o\"), (\"l\", \"r\"), (\"l\", \"l\"), (\"o\", \"d\"), (\" \", \"!\")}) ==\n (list{\"H\", \"e\", \"l\", \"l\", \"o\", \" \"}, list{\"W\", \"o\", \"r\", \"l\", \"d\", \"!\"})\n```" - ], - "signature": "let unzip: t<('a, 'b)> => (t<'a>, t<'b>)" - }, - { - "id": "Belt.List.getAssocU", - "kind": "value", - "name": "getAssocU", - "docstrings": ["Uncurried version of [getAssoc](#getAssoc)."], - "signature": "let getAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>", - "deprecated": "Use `getAssoc` instead" - }, - { - "id": "Belt.List.getAssoc", - "kind": "value", - "name": "getAssoc", - "docstrings": [ - "Return the second element of a pair in `someList` where the first element equals `k` as per the predicate function `eqFunction`, or `None` if not found.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.getAssoc(3, (a, b) => a == b) /* Some(\"c\") */\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.getAssoc(15, (k, item) =>\n k /* 15 */ == item\n) == Some(\"afternoon\")\n/* 9, 5, 22 */\n```" - ], - "signature": "let getAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>" - }, - { - "id": "Belt.List.hasAssocU", - "kind": "value", - "name": "hasAssocU", - "docstrings": ["Uncurried version of [hasAssoc](#hasAssoc)."], - "signature": "let hasAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => bool", - "deprecated": "Use `hasAssoc` instead" - }, - { - "id": "Belt.List.hasAssoc", - "kind": "value", - "name": "hasAssoc", - "docstrings": [ - "Returns `true` if there is a pair in `someList` where the first element equals `k` as per the predicate function `eqFunction`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.hasAssoc(1, (a, b) => a == b) == true\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.hasAssoc(25, (k, item) =>\n k /* 25 */ == item\n) == false\n/* 9, 5, 22 */\n```" - ], - "signature": "let hasAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.List.removeAssocU", - "kind": "value", - "name": "removeAssocU", - "docstrings": ["Uncurried version of [removeAssoc](#removeAssoc)."], - "signature": "let removeAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => t<('a, 'c)>", - "deprecated": "Use `removeAssoc` instead" - }, - { - "id": "Belt.List.removeAssoc", - "kind": "value", - "name": "removeAssoc", - "docstrings": [ - "Return a list after removing the first pair whose first value is `k` per the equality predicate `eqFunction`; if not found, return a new list identical to `someList`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.removeAssoc(1, (a, b) => a == b) ==\n list{(2, \"b\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.removeAssoc(9, (k, item) =>\n k /* 9 */ == item\n) == list{(15, \"afternoon\"), (22, \"night\")}\n/* 9, 5, 22 */\n```" - ], - "signature": "let removeAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => t<('a, 'c)>" - }, - { - "id": "Belt.List.setAssocU", - "kind": "value", - "name": "setAssocU", - "docstrings": ["Uncurried version of [setAssoc](#setAssoc)."], - "signature": "let setAssocU: (t<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => t<('a, 'c)>", - "deprecated": "Use `setAssoc` instead" - }, - { - "id": "Belt.List.setAssoc", - "kind": "value", - "name": "setAssoc", - "docstrings": [ - "If `k` exists in `someList` by satisfying the `eqFunction` predicate, return a new list with the key and value replaced by the new `k` and `v`; otherwise, return a new list with the pair `k`, `v` added to the head of `someList`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.setAssoc(2, \"x\", (a, b) => a == b) ==\n list{(1, \"a\"), (2, \"x\"), (3, \"c\")}\n\nlist{(1, \"a\"), (3, \"c\")}->Belt.List.setAssoc(2, \"b\", (a, b) => a == b) ==\n list{(2, \"b\"), (1, \"a\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (3, \"morning?!\"), (22, \"night\")}->Belt.List.setAssoc(15, \"afternoon\", (a, b) =>\n mod(a, 12) == mod(b, 12)\n) == list{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n```\n\n**Please note**\n\nIn the last example, since: `15 mod 12` equals `3 mod 12`\n\nBoth the key _and_ the value are replaced in the list." - ], - "signature": "let setAssoc: (t<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => t<('a, 'c)>" - }, - { - "id": "Belt.List.sortU", - "kind": "value", - "name": "sortU", - "docstrings": ["Uncurried version of [sort](#sort)."], - "signature": "let sortU: (t<'a>, ('a, 'a) => int) => t<'a>", - "deprecated": "Use `sort` instead" - }, - { - "id": "Belt.List.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "Returns a sorted list.\n\n## Examples\n\n```rescript\nBelt.List.sort(list{5, 4, 9, 3, 7}, (a, b) => a - b) == list{3, 4, 5, 7, 9}\n```" - ], - "signature": "let sort: (t<'a>, ('a, 'a) => int) => t<'a>" - } - ] - }, - "belt/mutablestack": { - "id": "Belt.MutableStack", - "name": "MutableStack", - "docstrings": [ - "[`Belt.MutableStack`]()\n\n An FILO(first in last out) stack data structure", - "First in last out stack. This module implements stacks, with in-place\nmodification." - ], - "items": [ - { - "id": "Belt.MutableStack.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableStack.make", - "kind": "value", - "name": "make", - "docstrings": ["Returns a new stack, initially empty."], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableStack.clear", - "kind": "value", - "name": "clear", - "docstrings": ["Discard all elements from the stack."], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableStack.copy", - "kind": "value", - "name": "copy", - "docstrings": ["`copy(x)` O(1) operation, return a new stack."], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.MutableStack.push", - "kind": "value", - "name": "push", - "docstrings": [], - "signature": "let push: (t<'a>, 'a) => unit" - }, - { - "id": "Belt.MutableStack.popUndefined", - "kind": "value", - "name": "popUndefined", - "docstrings": [], - "signature": "let popUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableStack.pop", - "kind": "value", - "name": "pop", - "docstrings": [], - "signature": "let pop: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableStack.topUndefined", - "kind": "value", - "name": "topUndefined", - "docstrings": [], - "signature": "let topUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableStack.top", - "kind": "value", - "name": "top", - "docstrings": [], - "signature": "let top: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableStack.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableStack.size", - "kind": "value", - "name": "size", - "docstrings": [], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableStack.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableStack.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.MutableStack.dynamicPopIterU", - "kind": "value", - "name": "dynamicPopIterU", - "docstrings": [], - "signature": "let dynamicPopIterU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `dynamicPopIter` instead" - }, - { - "id": "Belt.MutableStack.dynamicPopIter", - "kind": "value", - "name": "dynamicPopIter", - "docstrings": [ - "`dynamicPopIter(s, f)` apply `f` to each element of `s`. The item is poped\nbefore applying `f`, `s` will be empty after this opeartion. This function is\nuseful for worklist algorithm." - ], - "signature": "let dynamicPopIter: (t<'a>, 'a => unit) => unit" - } - ] - }, - "belt/mutablequeue": { - "id": "Belt.MutableQueue", - "name": "MutableQueue", - "docstrings": [ - "[`Belt.MutableQueue`]()\n\n An FIFO(first in first out) queue data structure", - "A FIFO (first in first out) queue data structure." - ], - "items": [ - { - "id": "Belt.MutableQueue.t", - "kind": "type", - "name": "t", - "docstrings": ["The type of queues containing elements of `type('a)`."], - "signature": "type t<'a>" - }, - { - "id": "Belt.MutableQueue.make", - "kind": "value", - "name": "make", - "docstrings": ["Returns a new queue, initially empty."], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Belt.MutableQueue.clear", - "kind": "value", - "name": "clear", - "docstrings": ["Discard all elements from the queue."], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Belt.MutableQueue.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "Returns `true` if the given queue is empty, `false` otherwise." - ], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Belt.MutableQueue.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` a is equivalent to `Array.forEach(a, add(q, a));`" - ], - "signature": "let fromArray: array<'a> => t<'a>" - }, - { - "id": "Belt.MutableQueue.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(q, x)` adds the element `x` at the end of the queue `q`." - ], - "signature": "let add: (t<'a>, 'a) => unit" - }, - { - "id": "Belt.MutableQueue.peek", - "kind": "value", - "name": "peek", - "docstrings": [ - "`peekOpt(q)` returns the first element in queue `q`, without removing it from the queue." - ], - "signature": "let peek: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableQueue.peekUndefined", - "kind": "value", - "name": "peekUndefined", - "docstrings": ["`peekUndefined(q)` returns `undefined` if not found."], - "signature": "let peekUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableQueue.peekExn", - "kind": "value", - "name": "peekExn", - "docstrings": ["`peekExn(q)` throws an exception if `q` is empty."], - "signature": "let peekExn: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.peekOrThrow", - "kind": "value", - "name": "peekOrThrow", - "docstrings": ["`peekOrThrow(q)` throws an exception if `q` is empty."], - "signature": "let peekOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "`pop(q)` removes and returns the first element in queue `q`." - ], - "signature": "let pop: t<'a> => option<'a>" - }, - { - "id": "Belt.MutableQueue.popUndefined", - "kind": "value", - "name": "popUndefined", - "docstrings": [ - "`popUndefined(q)` removes and returns the first element in queue `q`. it will\nreturn `undefined` if it is already empty." - ], - "signature": "let popUndefined: t<'a> => Js.undefined<'a>" - }, - { - "id": "Belt.MutableQueue.popExn", - "kind": "value", - "name": "popExn", - "docstrings": ["`popExn(q)` throw an exception if q is empty."], - "signature": "let popExn: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.popOrThrow", - "kind": "value", - "name": "popOrThrow", - "docstrings": ["`popOrThrow(q)` throw an exception if q is empty."], - "signature": "let popOrThrow: t<'a> => 'a" - }, - { - "id": "Belt.MutableQueue.copy", - "kind": "value", - "name": "copy", - "docstrings": ["`copy(q)` returns a fresh queue."], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.MutableQueue.size", - "kind": "value", - "name": "size", - "docstrings": ["Returns the number of elements in a queue."], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.MutableQueue.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.MutableQueue.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Belt.MutableQueue.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.MutableQueue.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(q, f) applies`f`in turn to all elements of`q`, from the least\nrecently entered to the most recently entered. The queue itself is unchanged." - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.MutableQueue.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.MutableQueue.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(q, accu, f)` is equivalent to `List.reduce(l, accu, f)`, where `l` is the\nlist of `q`'s elements. The queue remains unchanged." - ], - "signature": "let reduce: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Belt.MutableQueue.transfer", - "kind": "value", - "name": "transfer", - "docstrings": [ - "`transfer(q1, q2)` adds all of `q1`'s elements at the end of the queue `q2`,\nthen clears `q1`. It is equivalent to the sequence `forEach((x) => add(x, q2), q1)`;\nclear `q1`, but runs in constant time." - ], - "signature": "let transfer: (t<'a>, t<'a>) => unit" - }, - { - "id": "Belt.MutableQueue.toArray", - "kind": "value", - "name": "toArray", - "docstrings": ["First added will be in the beginning of the array."], - "signature": "let toArray: t<'a> => array<'a>" - } - ] - }, - "belt/sortarray": { - "id": "Belt.SortArray", - "name": "SortArray", - "docstrings": [ - "[`Belt.SortArray`]()\n\n The top level provides some generic sort related utilities.\n\n It also has two specialized inner modules\n [`Belt.SortArray.Int`]() and [`Belt.SortArray.String`]()", - "A module for Array sort relevant utiliites" - ], - "items": [ - { - "id": "Belt.SortArray.strictlySortedLengthU", - "kind": "value", - "name": "strictlySortedLengthU", - "docstrings": [], - "signature": "let strictlySortedLengthU: (array<'a>, ('a, 'a) => bool) => int", - "deprecated": "Use `strictlySortedLength` instead" - }, - { - "id": "Belt.SortArray.strictlySortedLength", - "kind": "value", - "name": "strictlySortedLength", - "docstrings": [ - "`strictlySortedLenght(xs, cmp);` return `+n` means increasing order `-n` means negative order\n\n## Examples\n\n```rescript\nBelt.SortArray.strictlySortedLength([1, 2, 3, 4, 3], (x, y) => x < y) == 4\n\nBelt.SortArray.strictlySortedLength([], (x, y) => x < y) == 0\n\nBelt.SortArray.strictlySortedLength([1], (x, y) => x < y) == 1\n\nBelt.SortArray.strictlySortedLength([4, 3, 2, 1], (x, y) => x < y) == -4\n```" - ], - "signature": "let strictlySortedLength: (array<'a>, ('a, 'a) => bool) => int" - }, - { - "id": "Belt.SortArray.isSortedU", - "kind": "value", - "name": "isSortedU", - "docstrings": [], - "signature": "let isSortedU: (array<'a>, ('a, 'a) => int) => bool", - "deprecated": "Use `isSorted` instead" - }, - { - "id": "Belt.SortArray.isSorted", - "kind": "value", - "name": "isSorted", - "docstrings": [ - "`isSorted(arr, cmp)`: Returns true if array is increasingly sorted (equal is okay)" - ], - "signature": "let isSorted: (array<'a>, ('a, 'a) => int) => bool" - }, - { - "id": "Belt.SortArray.stableSortInPlaceByU", - "kind": "value", - "name": "stableSortInPlaceByU", - "docstrings": [], - "signature": "let stableSortInPlaceByU: (array<'a>, ('a, 'a) => int) => unit", - "deprecated": "Use `stableSortInPlaceBy` instead" - }, - { - "id": "Belt.SortArray.stableSortInPlaceBy", - "kind": "value", - "name": "stableSortInPlaceBy", - "docstrings": [], - "signature": "let stableSortInPlaceBy: (array<'a>, ('a, 'a) => int) => unit" - }, - { - "id": "Belt.SortArray.stableSortByU", - "kind": "value", - "name": "stableSortByU", - "docstrings": [], - "signature": "let stableSortByU: (array<'a>, ('a, 'a) => int) => array<'a>", - "deprecated": "Use `stableSortBy` instead" - }, - { - "id": "Belt.SortArray.stableSortBy", - "kind": "value", - "name": "stableSortBy", - "docstrings": [ - "`stableSortBy(xs, cmp)`: Returns a fresh array Sort `xs` in place using\ncomparator `cmp`, the stable means if the elements are equal, their order will\nbe preserved" - ], - "signature": "let stableSortBy: (array<'a>, ('a, 'a) => int) => array<'a>" - }, - { - "id": "Belt.SortArray.binarySearchByU", - "kind": "value", - "name": "binarySearchByU", - "docstrings": [], - "signature": "let binarySearchByU: (array<'a>, 'a, ('a, 'a) => int) => int", - "deprecated": "Use `binarySearchBy` instead" - }, - { - "id": "Belt.SortArray.binarySearchBy", - "kind": "value", - "name": "binarySearchBy", - "docstrings": [ - "If value is not found and value is less than one or more elements in array, the\nnegative number returned is the bitwise complement of the index of the first\nelement that is larger than value.\n\nIf value is not found and value is greater\nthan all elements in array, the negative number returned is the bitwise\ncomplement of (the index of the last element plus 1)for example, if `key` is\nsmaller than all elements return `-1` since `lnot(-1) == 0` if `key` is larger\nthan all elements return `lnot(-1) == 0` since `lnot(- (len + 1)) == len`\n\n## Examples\n\n```rescript\nBelt.SortArray.binarySearchBy([1, 2, 3, 4, 33, 35, 36], 33, Pervasives.compare) == 4\n\nlnot(Belt.SortArray.binarySearchBy([1, 3, 5, 7], 4, Pervasives.compare)) == 2\n```" - ], - "signature": "let binarySearchBy: (array<'a>, 'a, ('a, 'a) => int) => int" - }, - { - "id": "Belt.SortArray.unionU", - "kind": "value", - "name": "unionU", - "docstrings": [], - "signature": "let unionU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int", - "deprecated": "Use `union` instead" - }, - { - "id": "Belt.SortArray.union", - "kind": "value", - "name": "union", - "docstrings": [ - "`union src src1ofs src1len src2 src2ofs src2len dst dstofs cmp` assume `src` and\n`src2` is strictly sorted. for equivalent elements, it is picked from `src`\nalso assume that `dst` is large enough to store all elements" - ], - "signature": "let union: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int" - }, - { - "id": "Belt.SortArray.intersectU", - "kind": "value", - "name": "intersectU", - "docstrings": [], - "signature": "let intersectU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int", - "deprecated": "Use `intersect` instead" - }, - { - "id": "Belt.SortArray.intersect", - "kind": "value", - "name": "intersect", - "docstrings": [ - "`union src src1ofs src1len src2 src2ofs src2len dst dstofs cmp`\n\n**return** the `offset` in the output array" - ], - "signature": "let intersect: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int" - }, - { - "id": "Belt.SortArray.diffU", - "kind": "value", - "name": "diffU", - "docstrings": [], - "signature": "let diffU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int", - "deprecated": "Use `diff` instead" - }, - { - "id": "Belt.SortArray.diff", - "kind": "value", - "name": "diff", - "docstrings": [], - "signature": "let diff: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int" - } - ] - }, - "belt/array": { - "id": "Belt.Array", - "name": "Array", - "docstrings": [ - "[`Belt.Array`]()\n\n **mutable array**: Utilities functions", - "Utilities for `Array` functions." - ], - "items": [ - { - "id": "Belt.Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = array<'a>" - }, - { - "id": "Belt.Array.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Return the size of the array\n\n## Examples\n\n```rescript\nBelt.Array.length([\"test\"]) == 1\n```" - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Belt.Array.size", - "kind": "value", - "name": "size", - "docstrings": ["See [`Belt.Array.length`]()"], - "signature": "let size: t<'a> => int" - }, - { - "id": "Belt.Array.get", - "kind": "value", - "name": "get", - "docstrings": [ - "If `i <= 0 <= length(arr)` returns `Some(value)` where `value` is the item at index `i`.\nIf `i` is out of range returns `None`.\n\n## Examples\n\n```rescript\nBelt.Array.get([\"a\", \"b\", \"c\"], 0) == Some(\"a\")\nBelt.Array.get([\"a\", \"b\", \"c\"], 3) == None\nBelt.Array.get([\"a\", \"b\", \"c\"], -1) == None\n```" - ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, - { - "id": "Belt.Array.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Throw an exception if `i` is out of range.\nOtherwise return the value at index `i` in `arr`." - ], - "signature": "let getExn: (t<'a>, int) => 'a" - }, - { - "id": "Belt.Array.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "Throw an exception if `i` is out of range.\nOtherwise return the value at index `i` in `arr`." - ], - "signature": "let getOrThrow: (t<'a>, int) => 'a" - }, - { - "id": "Belt.Array.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(arr, i)`\n\n**Unsafe**\n\nno bounds checking; this would cause type error if `i` does not stay within range" - ], - "signature": "let getUnsafe: (t<'a>, int) => 'a" - }, - { - "id": "Belt.Array.getUndefined", - "kind": "value", - "name": "getUndefined", - "docstrings": [ - "`getUndefined(arr, i)`\n\nIt does the samething in the runtime as [`getUnsafe`]();\nit is _type safe_ since the return type still track whether it is\nin range or not" - ], - "signature": "let getUndefined: (t<'a>, int) => Js.undefined<'a>" - }, - { - "id": "Belt.Array.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(arr, n, x)` modifies `arr` in place; it replaces the nth element of `arr`\nwith `x`. Returning `false` means not updated due to out of range." - ], - "signature": "let set: (t<'a>, int, 'a) => bool" - }, - { - "id": "Belt.Array.setExn", - "kind": "value", - "name": "setExn", - "docstrings": [ - "`setExn(arr, i, x)` throw an exception if `i` is out of range." - ], - "signature": "let setExn: (t<'a>, int, 'a) => unit" - }, - { - "id": "Belt.Array.setOrThrow", - "kind": "value", - "name": "setOrThrow", - "docstrings": [ - "`setOrThrow(arr, i, x)` throw an exception if `i` is out of range." - ], - "signature": "let setOrThrow: (t<'a>, int, 'a) => unit" - }, - { - "id": "Belt.Array.setUnsafe", - "kind": "value", - "name": "setUnsafe", - "docstrings": [], - "signature": "let setUnsafe: (t<'a>, int, 'a) => unit" - }, - { - "id": "Belt.Array.shuffleInPlace", - "kind": "value", - "name": "shuffleInPlace", - "docstrings": [ - "`shuffleInPlace(arr)` randomly re-orders the items in `arr`" - ], - "signature": "let shuffleInPlace: t<'a> => unit" - }, - { - "id": "Belt.Array.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "Returns a fresh array with items in original array randomly shuffled." - ], - "signature": "let shuffle: t<'a> => t<'a>" - }, - { - "id": "Belt.Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [ - "`reverseInPlace(arr)` reverses items in `arr` in place.\n\n## Examples\n\n```rescript\nlet arr = [10, 11, 12, 13, 14]\n\nlet () = Belt.Array.reverseInPlace(arr)\n\narr == [14, 13, 12, 11, 10]\n```" - ], - "signature": "let reverseInPlace: t<'a> => unit" - }, - { - "id": "Belt.Array.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(arr)` returns a fresh array with items in arr in reverse order.\n\n## Examples\n\n```rescript\nBelt.Array.reverse([10, 11, 12, 13, 14]) == [14, 13, 12, 11, 10]\n```" - ], - "signature": "let reverse: t<'a> => t<'a>" - }, - { - "id": "Belt.Array.makeUninitialized", - "kind": "value", - "name": "makeUninitialized", - "docstrings": [ - "`makeUninitialized(n)` creates an array of length `n` filled with the undefined\nvalue. You must specify the type of data that will eventually fill the array.\n\n## Examples\n\n```rescript\nlet arr: array> = Belt.Array.makeUninitialized(5)\n\nBelt.Array.getExn(arr, 0) == Js.undefined\n```" - ], - "signature": "let makeUninitialized: int => array>" - }, - { - "id": "Belt.Array.makeUninitializedUnsafe", - "kind": "value", - "name": "makeUninitializedUnsafe", - "docstrings": [ - "**Unsafe**\n\n## Examples\n\n```rescript\nlet arr = Belt.Array.makeUninitializedUnsafe(5)\n\nJs.log(Belt.Array.getExn(arr, 0)) // undefined\n\nBelt.Array.setExn(arr, 0, \"example\")\n\nBelt.Array.getExn(arr, 0) == \"example\"\n```" - ], - "signature": "let makeUninitializedUnsafe: int => t<'a>" - }, - { - "id": "Belt.Array.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(n, e)` return an array of size `n` filled with value `e`.\nReturns an empty array when `n` is negative." - ], - "signature": "let make: (int, 'a) => t<'a>" - }, - { - "id": "Belt.Array.range", - "kind": "value", - "name": "range", - "docstrings": [ - "`range(start, finish)` create an inclusive array.\n\n## Examples\n\n```rescript\nBelt.Array.range(0, 3) == [0, 1, 2, 3]\n\nBelt.Array.range(3, 0) == []\n\nBelt.Array.range(3, 3) == [3]\n```" - ], - "signature": "let range: (int, int) => array" - }, - { - "id": "Belt.Array.rangeBy", - "kind": "value", - "name": "rangeBy", - "docstrings": [ - "`rangeBy(start, finish, ~step)` returns empty array when step is 0 or negative.\nIt also return an empty array when `start > finish`.\n\n## Examples\n\n```rescript\nBelt.Array.rangeBy(0, 10, ~step=3) == [0, 3, 6, 9]\n\nBelt.Array.rangeBy(0, 12, ~step=3) == [0, 3, 6, 9, 12]\n\nBelt.Array.rangeBy(33, 0, ~step=1) == []\n\nBelt.Array.rangeBy(33, 0, ~step=-1) == []\n\nBelt.Array.rangeBy(3, 12, ~step=-1) == []\n\nBelt.Array.rangeBy(3, 3, ~step=0) == []\n\nBelt.Array.rangeBy(3, 3, ~step=1) == [3]\n```" - ], - "signature": "let rangeBy: (int, int, ~step: int) => array" - }, - { - "id": "Belt.Array.makeByU", - "kind": "value", - "name": "makeByU", - "docstrings": [], - "signature": "let makeByU: (int, int => 'a) => t<'a>", - "deprecated": "Use `makeBy` instead" - }, - { - "id": "Belt.Array.makeBy", - "kind": "value", - "name": "makeBy", - "docstrings": [ - "`makeBy(n, f)` return an empty array when n is negative return an array of size\nn populated by `f(i)` start from `0` to `n - 1`.\n\n## Examples\n\n```rescript\nBelt.Array.makeBy(5, i => i) == [0, 1, 2, 3, 4]\n\nBelt.Array.makeBy(5, i => i * i) == [0, 1, 4, 9, 16]\n```" - ], - "signature": "let makeBy: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.Array.makeByAndShuffleU", - "kind": "value", - "name": "makeByAndShuffleU", - "docstrings": [], - "signature": "let makeByAndShuffleU: (int, int => 'a) => t<'a>", - "deprecated": "Use `makeByAndShuffle` instead" - }, - { - "id": "Belt.Array.makeByAndShuffle", - "kind": "value", - "name": "makeByAndShuffle", - "docstrings": ["Equivalent to `shuffle(makeBy(n, f))`"], - "signature": "let makeByAndShuffle: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.Array.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "`zip(a, b)` create an array of pairs from corresponding elements of a and b.\nStop with the shorter array.\n\n## Examples\n\n```rescript\nBelt.Array.zip([1, 2], [3, 4, 5]) == [(1, 3), (2, 4)]\n```" - ], - "signature": "let zip: (t<'a>, array<'b>) => array<('a, 'b)>" - }, - { - "id": "Belt.Array.zipByU", - "kind": "value", - "name": "zipByU", - "docstrings": [], - "signature": "let zipByU: (t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>", - "deprecated": "Use `zipBy` instead" - }, - { - "id": "Belt.Array.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "`zipBy(xs, ys, f)` create an array by applying `f` to corresponding elements of\n`xs` and `ys`. Stops with shorter array.\n\nEquivalent to `map(zip(xs, ys), ((a, b)) => f(a, b))`\n\n## Examples\n\n```rescript\nBelt.Array.zipBy([1, 2, 3], [4, 5], (a, b) => 2 * a + b) == [6, 9]\n```" - ], - "signature": "let zipBy: (t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>" - }, - { - "id": "Belt.Array.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "`unzip(a)` takes an array of pairs and creates a pair of arrays. The first array\ncontains all the first items of the pairs; the second array contains all the\nsecond items.\n\n## Examples\n\n```rescript\nBelt.Array.unzip([(1, 2), (3, 4)]) == ([1, 3], [2, 4])\n\nBelt.Array.unzip([(1, 2), (3, 4), (5, 6), (7, 8)]) == ([1, 3, 5, 7], [2, 4, 6, 8])\n```" - ], - "signature": "let unzip: array<('a, 'b)> => (t<'a>, array<'b>)" - }, - { - "id": "Belt.Array.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(xs, ys)` returns a fresh array containing the concatenation of the arrays\n`v1` and `v2`, so even if `v1` or `v2` is empty; it can not be shared.\n\n## Examples\n\n```rescript\nBelt.Array.concat([1, 2, 3], [4, 5]) == [1, 2, 3, 4, 5]\n\nBelt.Array.concat([], [\"a\", \"b\", \"c\"]) == [\"a\", \"b\", \"c\"]\n```" - ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Belt.Array.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(xss)` returns a fresh array as the concatenation of `xss` (an array of arrays)\n\n## Examples\n\n```rescript\nBelt.Array.concatMany([[1, 2, 3], [4, 5, 6], [7, 8]]) == [1, 2, 3, 4, 5, 6, 7, 8]\n```" - ], - "signature": "let concatMany: array> => t<'a>" - }, - { - "id": "Belt.Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(xs, offset, len)` creates a new array with the len elements of `xs`\nstarting at `offset` for `offset` can be negative;and is evaluated as\n`length(xs) - offset(slice, xs) - 1(1)` means get the last element as a\nsingleton array `slice(xs, ~-len, len)` will return a copy of the array if the\narray does not have enough data; `slice` extracts through the end of sequence.\n\nif `len` is negative; returns the empty array.\n\n## Examples\n\n```rescript\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=2, ~len=3) == [12, 13, 14]\n\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=-4, ~len=3) == [13, 14, 15]\n\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=4, ~len=9) == [14, 15, 16]\n```" - ], - "signature": "let slice: (t<'a>, ~offset: int, ~len: int) => t<'a>" - }, - { - "id": "Belt.Array.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(xs, offset)` creates a new array with the elements of `xs` starting\nat `offset`\n\n`offset` can be negative; and is evaluated as `length(xs) - offset(sliceToEnd, xs) - 1`\nmeans get the last element as a singleton array\n\n`sliceToEnd(xs, 0)` will return a copy of the array\n\n## Examples\n\n```rescript\nBelt.Array.sliceToEnd([10, 11, 12, 13, 14, 15, 16], 2) == [12, 13, 14, 15, 16]\n\nBelt.Array.sliceToEnd([10, 11, 12, 13, 14, 15, 16], -4) == [13, 14, 15, 16]\n```" - ], - "signature": "let sliceToEnd: (t<'a>, int) => t<'a>" - }, - { - "id": "Belt.Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(a)` returns a copy of `a`; that is; a fresh array containing the same\nelements as `a`." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Belt.Array.fill", - "kind": "value", - "name": "fill", - "docstrings": [ - "`fill(arr, ~offset, ~len, x)` modifies `arr` in place, storing `x` in elements\nnumber `offset` to `offset + len - 1`. `offset` can be negative; and is evaluated\nas `length(arr - offset)`.\n\n`fill(arr, ~offset=-1, ~len=1)` means fill the last element, if the array does not have enough data; `fill` will ignore it\n\n## Examples\n\n```rescript\nlet arr = Belt.Array.makeBy(5, i => i)\n\nBelt.Array.fill(arr, ~offset=2, ~len=2, 9)\n\narr == [0, 1, 9, 9, 4]\n\nBelt.Array.fill(arr, ~offset=7, ~len=2, 8)\n\narr == [0, 1, 9, 9, 4]\n```" - ], - "signature": "let fill: (t<'a>, ~offset: int, ~len: int, 'a) => unit" - }, - { - "id": "Belt.Array.blit", - "kind": "value", - "name": "blit", - "docstrings": [ - "`blit(~src=v1, ~srcOffset=o1, ~dst=v2, ~dstOffset=o2, ~len)` copies `len` elements\nfrom array `v1`;starting at element number `o1`;to array `v2`, starting at element\nnumber `o2`. It works correctly even if `v1` and `v2` are the same array and the\nsource and destination chunks overlap.\n\n`offset` can be negative; `-1` means `len - 1`; if `len + offset` is still negative;it will be set as 0\n\nFor each of the examples;presume that `v1 == [10, 11, 12, 13, 14, 15, 16, 17]` and `v2 == [20, 21, 22, 23, 24, 25, 26, 27]`. The result shown is the content of the destination array.\n\n## Examples\n\n```rescript\nlet v1 = [10, 11, 12, 13, 14, 15, 16, 17]\nlet v2 = [20, 21, 22, 23, 24, 25, 26, 27]\n\nBelt.Array.blit(~src=v1, ~srcOffset=4, ~dst=v2, ~dstOffset=2, ~len=3)\nv2 == [20, 21, 14, 15, 16, 25, 26, 27]\n\nBelt.Array.blit(~src=v1, ~srcOffset=4, ~dst=v1, ~dstOffset=2, ~len=3)\nv1 == [10, 11, 14, 15, 16, 15, 16, 17]\n```" - ], - "signature": "let blit: (\n ~src: t<'a>,\n ~srcOffset: int,\n ~dst: t<'a>,\n ~dstOffset: int,\n ~len: int,\n) => unit" - }, - { - "id": "Belt.Array.blitUnsafe", - "kind": "value", - "name": "blitUnsafe", - "docstrings": ["Unsafe blit without bounds checking."], - "signature": "let blitUnsafe: (\n ~src: t<'a>,\n ~srcOffset: int,\n ~dst: t<'a>,\n ~dstOffset: int,\n ~len: int,\n) => unit" - }, - { - "id": "Belt.Array.forEachU", - "kind": "value", - "name": "forEachU", - "docstrings": [], - "signature": "let forEachU: (t<'a>, 'a => unit) => unit", - "deprecated": "Use `forEach` instead" - }, - { - "id": "Belt.Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(xs, f)`\n\nCall `f` on each element of `xs` from the beginning to end. `f` returns `unit`\nso no new array is created. Use `forEach` when you are primarily concerned with\nrepetitively creating side effects.\n\n## Examples\n\n```rescript\nBelt.Array.forEach([\"a\", \"b\", \"c\"], x => Js.log(\"Item: \" ++ x))\n\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\nlet total = ref(0)\n\nBelt.Array.forEach([1, 2, 3, 4], x => total := total.contents + x)\n\ntotal.contents == 1 + 2 + 3 + 4\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Belt.Array.mapU", - "kind": "value", - "name": "mapU", - "docstrings": [], - "signature": "let mapU: (t<'a>, 'a => 'b) => array<'b>", - "deprecated": "Use `map` instead" - }, - { - "id": "Belt.Array.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(xs, f)` returns a new array by calling `f` for each element of `xs` from\nthe beginning to end.\n\n## Examples\n\n```rescript\nBelt.Array.map([1, 2], x => x + 1) == [2, 3]\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Belt.Array.flatMapU", - "kind": "value", - "name": "flatMapU", - "docstrings": [], - "signature": "let flatMapU: (t<'a>, 'a => array<'b>) => array<'b>", - "deprecated": "Use `flatMap` instead" - }, - { - "id": "Belt.Array.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(xs, f)` returns a new array by calling `f` for each element of `xs` from\nthe beginning to end, concatenating the results.\n\n## Examples\n\n```rescript\nBelt.Array.flatMap([1, 2], x => [x + 10, x + 20]) == [11, 21, 12, 22]\n```" - ], - "signature": "let flatMap: (t<'a>, 'a => array<'b>) => array<'b>" - }, - { - "id": "Belt.Array.getByU", - "kind": "value", - "name": "getByU", - "docstrings": [], - "signature": "let getByU: (t<'a>, 'a => bool) => option<'a>", - "deprecated": "Use `getBy` instead" - }, - { - "id": "Belt.Array.getBy", - "kind": "value", - "name": "getBy", - "docstrings": [ - "`getBy(xs, p)` returns `Some(value)` for the first value in `xs` that satisifies\nthe predicate function `p`; returns `None` if no element satisifies the function.\n\n## Examples\n\n```rescript\nBelt.Array.getBy([1, 4, 3, 2], x => mod(x, 2) == 0) == Some(4)\nBelt.Array.getBy([15, 13, 11], x => mod(x, 2) == 0) == None\n```" - ], - "signature": "let getBy: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Belt.Array.getIndexByU", - "kind": "value", - "name": "getIndexByU", - "docstrings": [], - "signature": "let getIndexByU: (t<'a>, 'a => bool) => option", - "deprecated": "Use `getIndexBy` instead" - }, - { - "id": "Belt.Array.getIndexBy", - "kind": "value", - "name": "getIndexBy", - "docstrings": [ - "`getIndexBy(xs, p)` returns `Some(index)` for the first value in `xs` that\nsatisifies the predicate function `p`; returns `None` if no element satisifies\nthe function.\n\n## Examples\n\n```rescript\nBelt.Array.getIndexBy([1, 4, 3, 2], x => mod(x, 2) == 0) == Some(1)\nBelt.Array.getIndexBy([15, 13, 11], x => mod(x, 2) == 0) == None\n```" - ], - "signature": "let getIndexBy: (t<'a>, 'a => bool) => option" - }, - { - "id": "Belt.Array.keepU", - "kind": "value", - "name": "keepU", - "docstrings": [], - "signature": "let keepU: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "Use `keep` instead" - }, - { - "id": "Belt.Array.keep", - "kind": "value", - "name": "keep", - "docstrings": [ - "`keep(xs, p)` returns a new array that keep all elements satisfy `p`." - ], - "signature": "let keep: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Belt.Array.keepWithIndexU", - "kind": "value", - "name": "keepWithIndexU", - "docstrings": [], - "signature": "let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "Use `keepWithIndex` instead" - }, - { - "id": "Belt.Array.keepWithIndex", - "kind": "value", - "name": "keepWithIndex", - "docstrings": [ - "`keepWithIndex(xs, p)` returns a new array that keep all elements satisfy `p`.\n\n## Examples\n\n```rescript\nBelt.Array.keepWithIndex([1, 2, 3], (_x, i) => i == 1) == [2]\n```" - ], - "signature": "let keepWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" - }, - { - "id": "Belt.Array.keepMapU", - "kind": "value", - "name": "keepMapU", - "docstrings": [], - "signature": "let keepMapU: (t<'a>, 'a => option<'b>) => array<'b>", - "deprecated": "Use `keepMap` instead" - }, - { - "id": "Belt.Array.keepMap", - "kind": "value", - "name": "keepMap", - "docstrings": [ - "`keepMap(xs, p)` returns a new array that keep all elements that return a non\nNone applied `p`.\n\n## Examples\n\n```rescript\nBelt.Array.keepMap([1, 2, 3], x =>\n if mod(x, 2) == 0 {\n Some(x)\n } else {\n None\n }\n) == [2]\n```" - ], - "signature": "let keepMap: (t<'a>, 'a => option<'b>) => array<'b>" - }, - { - "id": "Belt.Array.forEachWithIndexU", - "kind": "value", - "name": "forEachWithIndexU", - "docstrings": [], - "signature": "let forEachWithIndexU: (t<'a>, (int, 'a) => unit) => unit", - "deprecated": "Use `forEachWithIndex` instead" - }, - { - "id": "Belt.Array.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(xs, f)` same as `Belt.Array.forEach`, except that `f` is\nsupplied two arguments: the index starting from 0 and the element from `xs`.\n\n## Examples\n\n```rescript\nBelt.Array.forEachWithIndex([\"a\", \"b\", \"c\"], (i, x) =>\n Js.log(\"Item \" ++ Belt.Int.toString(i) ++ \" is \" ++ x)\n)\n\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\nlet total = ref(0)\n\nBelt.Array.forEachWithIndex([10, 11, 12, 13], (i, x) => total := total.contents + x + i)\n\ntotal.contents == 0 + 10 + 1 + 11 + 2 + 12 + 3 + 13\n```" - ], - "signature": "let forEachWithIndex: (t<'a>, (int, 'a) => unit) => unit" - }, - { - "id": "Belt.Array.mapWithIndexU", - "kind": "value", - "name": "mapWithIndexU", - "docstrings": [], - "signature": "let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => array<'b>", - "deprecated": "Use `mapWithIndex` instead" - }, - { - "id": "Belt.Array.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(xs, f)` applies `f` to each element of `xs`. Function `f` takes\ntwo arguments: the index starting from 0 and the element from `xs`.\n\n## Examples\n\n```rescript\nBelt.Array.mapWithIndex([1, 2, 3], (i, x) => i + x) == [0 + 1, 1 + 2, 2 + 3]\n```" - ], - "signature": "let mapWithIndex: (t<'a>, (int, 'a) => 'b) => array<'b>" - }, - { - "id": "Belt.Array.partitionU", - "kind": "value", - "name": "partitionU", - "docstrings": [], - "signature": "let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)", - "deprecated": "Use `partition` instead" - }, - { - "id": "Belt.Array.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(f, a)` split array into tuple of two arrays based on predicate `f`;\nfirst of tuple where predicate cause true, second where predicate cause false\n\n## Examples\n\n```rescript\nBelt.Array.partition([1, 2, 3, 4, 5], x => mod(x, 2) == 0) == ([2, 4], [1, 3, 5])\n\nBelt.Array.partition([1, 2, 3, 4, 5], x => mod(x, 2) != 0) == ([1, 3, 5], [2, 4])\n```" - ], - "signature": "let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)" - }, - { - "id": "Belt.Array.reduceU", - "kind": "value", - "name": "reduceU", - "docstrings": [], - "signature": "let reduceU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a", - "deprecated": "Use `reduce` instead" - }, - { - "id": "Belt.Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(xs, init, f)` applies `f` to each element of `xs` from beginning to end.\nFunction `f` has two parameters: the item from the list and an “accumulator”;\nwhich starts with a value of `init`. `reduce` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nBelt.Array.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\nBelt.Array.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n```" - ], - "signature": "let reduce: (array<'b>, 'a, ('a, 'b) => 'a) => 'a" - }, - { - "id": "Belt.Array.reduceReverseU", - "kind": "value", - "name": "reduceReverseU", - "docstrings": [], - "signature": "let reduceReverseU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a", - "deprecated": "Use `reduceReverse` instead" - }, - { - "id": "Belt.Array.reduceReverse", - "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "`reduceReverse(xs, init, f)` works like `Belt.Array.reduce` except that\nfunction `f` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nBelt.Array.reduceReverse([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n```" - ], - "signature": "let reduceReverse: (array<'b>, 'a, ('a, 'b) => 'a) => 'a" - }, - { - "id": "Belt.Array.reduceReverse2U", - "kind": "value", - "name": "reduceReverse2U", - "docstrings": [], - "signature": "let reduceReverse2U: (t<'a>, array<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c", - "deprecated": "Use `reduceReverse2` instead" - }, - { - "id": "Belt.Array.reduceReverse2", - "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "`reduceReverse2(xs, ys, init, f)` reduces two arrays xs and ys;taking items\nstarting at `min(length(xs), length(ys))` down to and including zero.\n\n## Examples\n\n```rescript\nBelt.Array.reduceReverse2([1, 2, 3], [1, 2], 0, (acc, x, y) => acc + x + y) == 6\n```" - ], - "signature": "let reduceReverse2: (t<'a>, array<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" - }, - { - "id": "Belt.Array.reduceWithIndexU", - "kind": "value", - "name": "reduceWithIndexU", - "docstrings": [], - "signature": "let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b", - "deprecated": "Use `reduceWithIndex` instead" - }, - { - "id": "Belt.Array.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "Applies `f` to each element of `xs` from beginning to end. Function `f` has\nthree parameters: the item from the array and an “accumulator”, which starts\nwith a value of `init` and the index of each element. `reduceWithIndex` returns\nthe final value of the accumulator.\n\n## Examples\n\n```rescript\nBelt.Array.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n```" - ], - "signature": "let reduceWithIndex: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Belt.Array.joinWithU", - "kind": "value", - "name": "joinWithU", - "docstrings": [], - "signature": "let joinWithU: (t<'a>, string, 'a => string) => string", - "deprecated": "Use `joinWith` instead" - }, - { - "id": "Belt.Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "`joinWith(xs, sep, toString)`\n\nConcatenates all the elements of `xs` converted to string with `toString`, each\nseparated by `sep`, the string given as the second argument, into a single string.\nIf the array has only one element, then that element will be returned without\nusing the separator. If the array is empty, the empty string will be returned.\n\n## Examples\n\n```rescript\nBelt.Array.joinWith([0, 1], \", \", Js.Int.toString) == \"0, 1\"\nBelt.Array.joinWith([], \" \", Js.Int.toString) == \"\"\nBelt.Array.joinWith([1], \" \", Js.Int.toString) == \"1\"\n```" - ], - "signature": "let joinWith: (t<'a>, string, 'a => string) => string" - }, - { - "id": "Belt.Array.someU", - "kind": "value", - "name": "someU", - "docstrings": [], - "signature": "let someU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `some` instead" - }, - { - "id": "Belt.Array.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(xs, p)` returns true if at least one of the elements in `xs` satifies `p`;\nwhere `p` is a predicate: a function taking an element and returning a `bool`.\n\n## Examples\n\n```rescript\nBelt.Array.some([2, 3, 4], x => mod(x, 2) == 1) == true\n\nBelt.Array.some([-1, -3, -5], x => x > 0) == false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.Array.everyU", - "kind": "value", - "name": "everyU", - "docstrings": [], - "signature": "let everyU: (t<'a>, 'a => bool) => bool", - "deprecated": "Use `every` instead" - }, - { - "id": "Belt.Array.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(xs, p)` returns `true` if all elements satisfy `p`; where `p` is a\npredicate: a function taking an element and returning a `bool`.\n\n## Examples\n\n```rescript\nBelt.Array.every([1, 3, 5], x => mod(x, 2) == 1) == true\n\nBelt.Array.every([1, -3, 5], x => x > 0) == false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Belt.Array.every2U", - "kind": "value", - "name": "every2U", - "docstrings": [], - "signature": "let every2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `every2` instead" - }, - { - "id": "Belt.Array.every2", - "kind": "value", - "name": "every2", - "docstrings": [ - "`every2(xs, ys, p)` returns true if `p(xi, yi)` is true for all pairs of\nelements up to the shorter length (i.e. `min(length(xs), length(ys))`)\n\n## Examples\n\n```rescript\nBelt.Array.every2([1, 2, 3], [0, 1], (a, b) => a > b) == true\n\nBelt.Array.every2([], [1], (x, y) => x > y) == true\n\nBelt.Array.every2([2, 3], [1], (x, y) => x > y) == true\n\nBelt.Array.every2([0, 1], [5, 0], (x, y) => x > y) == false\n```" - ], - "signature": "let every2: (t<'a>, array<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Array.some2U", - "kind": "value", - "name": "some2U", - "docstrings": [], - "signature": "let some2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool", - "deprecated": "Use `some2` instead" - }, - { - "id": "Belt.Array.some2", - "kind": "value", - "name": "some2", - "docstrings": [ - "`some2(xs, ys, p)` returns true if `p(xi, yi)` is true for any pair of elements\nup to the shorter length (i.e. `min(length(xs), length(ys))`)\n\n## Examples\n\n```rescript\nBelt.Array.some2([0, 2], [1, 0, 3], (a, b) => a > b) == true\n\nBelt.Array.some2([], [1], (x, y) => x > y) == false\n\nBelt.Array.some2([2, 3], [1, 4], (x, y) => x > y) == true\n```" - ], - "signature": "let some2: (t<'a>, array<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Belt.Array.cmpU", - "kind": "value", - "name": "cmpU", - "docstrings": [], - "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int", - "deprecated": "Use `cmp` instead" - }, - { - "id": "Belt.Array.cmp", - "kind": "value", - "name": "cmp", - "docstrings": [ - "`cmp(xs, ys, f)` compared by length if `length(xs) != length(ys)`; returning `-1`\nif `length(xs) < length(ys)` or 1 if `length(xs) > length(ys)`. Otherwise\ncompare one by one `f(x, y)`. `f` returns a negative number if `x` is “less than” `y`\nzero if `x` is “equal to” `y` a positive number if `x` is “greater than”\n`y`. The comparison returns the first non-zero result of `f`; or zero if `f`\nreturns zero for all `x` and `y`.\n\n## Examples\n\n```rescript\nBelt.Array.cmp([1, 3, 5], [1, 4, 2], (a, b) => compare(a, b)) == -1\n\nBelt.Array.cmp([1, 3, 5], [1, 2, 3], (a, b) => compare(a, b)) == 1\n\nBelt.Array.cmp([1, 3, 5], [1, 3, 5], (a, b) => compare(a, b)) == 0\n```" - ], - "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int" - }, - { - "id": "Belt.Array.eqU", - "kind": "value", - "name": "eqU", - "docstrings": [], - "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool", - "deprecated": "Use `eq` instead" - }, - { - "id": "Belt.Array.eq", - "kind": "value", - "name": "eq", - "docstrings": [ - "`eq(xs, ys)` return `false` if length is not the same otherwise compare items\none by one using `f(xi, yi)`; and return true if all results are true false otherwise\n\n## Examples\n\n```rescript\nBelt.Array.eq([1, 2, 3], [-1, -2, -3], (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Belt.Array.truncateToLengthUnsafe", - "kind": "value", - "name": "truncateToLengthUnsafe", - "docstrings": [ - "Unsafe `truncateToLengthUnsafe(xs, n)` sets length of array `xs` to `n`. If `n`\nis greater than the length of `xs`; the extra elements are set to `Js.Null_undefined.null`.\nIf `n` is less than zero; throws a `RangeError`.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n\nBelt.Array.truncateToLengthUnsafe(arr, 3)\n\narr == [\"ant\", \"bee\", \"cat\"]\n```" - ], - "signature": "let truncateToLengthUnsafe: (t<'a>, int) => unit" - }, - { - "id": "Belt.Array.initU", - "kind": "value", - "name": "initU", - "docstrings": [], - "signature": "let initU: (int, int => 'a) => t<'a>", - "deprecated": "Use `init` instead" - }, - { - "id": "Belt.Array.init", - "kind": "value", - "name": "init", - "docstrings": [], - "signature": "let init: (int, int => 'a) => t<'a>" - }, - { - "id": "Belt.Array.push", - "kind": "value", - "name": "push", - "docstrings": [ - "`arr->push(item)` pushes an element `item` into an array `arr`." - ], - "signature": "let push: (t<'a>, 'a) => unit" - } - ] - }, - "belt/id": { - "id": "Belt.Id", - "name": "Id", - "docstrings": [ - "[`Belt.Id`]()\n\n Provide utilities to create identified comparators or hashes for\n data structures used below.\n\n It create a unique identifier per module of\n functions so that different data structures with slightly different\n comparison functions won't mix", - "[`Belt.Id`]()\n\nProvide utiliites to create identified comparators or hashes for\ndata structures used below.\n\nIt create a unique identifer per module of functions so that different data structures with slightly different\ncomparison functions won't mix." - ], - "items": [ - { - "id": "Belt.Id.hash", - "kind": "type", - "name": "hash", - "docstrings": [ - "`('a, 'id) hash`\n\nIts runtime represenation is a `hash` function, but signed with a\ntype parameter, so that different hash functions type mismatch" - ], - "signature": "type hash<'a, 'id>" - }, - { - "id": "Belt.Id.eq", - "kind": "type", - "name": "eq", - "docstrings": [ - "`('a, 'id) eq`\n\nIts runtime represenation is an `eq` function, but signed with a\ntype parameter, so that different hash functions type mismatch" - ], - "signature": "type eq<'a, 'id>" - }, - { - "id": "Belt.Id.cmp", - "kind": "type", - "name": "cmp", - "docstrings": [ - "`('a,'id) cmp`\n\nIts runtime representation is a `cmp` function, but signed with a\ntype parameter, so that different hash functions type mismatch" - ], - "signature": "type cmp<'a, 'id>" - }, - { - "id": "Belt.Id.comparable", - "kind": "type", - "name": "comparable", - "docstrings": [ - "`('key, 'id) cmparable` is a module of functions, here it only includes `cmp`.\n\nUnlike normal functions, when created, it comes with a unique identity (guaranteed\nby the type system).\n\nIt can be created using function [`comparableU`]() or [`comparable`]().\n\nThe idea of a unique identity when created is that it makes sure two sets would type\nmismatch if they use different comparison function" - ], - "signature": "type comparable<'key, 'id> = module(Comparable\n with type identity = 'id\n and type t = 'key)" - }, - { - "id": "Belt.Id.comparableU", - "kind": "value", - "name": "comparableU", - "docstrings": [], - "signature": "let comparableU: (\n ~cmp: ('a, 'a) => int,\n) => module(Comparable with type t = 'a)", - "deprecated": "Use `comparable` instead" - }, - { - "id": "Belt.Id.comparable", - "kind": "value", - "name": "comparable", - "docstrings": [], - "signature": "let comparable: (\n ~cmp: ('a, 'a) => int,\n) => module(Comparable with type t = 'a)" - }, - { - "id": "Belt.Id.hashable", - "kind": "type", - "name": "hashable", - "docstrings": [ - "`('key, 'id) hashable` is a module of functions, here it only includes `hash`, `eq`.\n\nUnlike normal functions, when created, it comes with a unique identity (guaranteed\nby the type system).\n\nIt can be created using function [`hashableU`]() or [`hashable`]().\n\nThe idea of a unique identity when created is that it makes sure two hash sets would type\nmismatch if they use different comparison function" - ], - "signature": "type hashable<'key, 'id> = module(Hashable\n with type identity = 'id\n and type t = 'key)" - }, - { - "id": "Belt.Id.hashableU", - "kind": "value", - "name": "hashableU", - "docstrings": [], - "signature": "let hashableU: (\n ~hash: 'a => int,\n ~eq: ('a, 'a) => bool,\n) => module(Hashable with type t = 'a)", - "deprecated": "Use `hashable` instead" - }, - { - "id": "Belt.Id.hashable", - "kind": "value", - "name": "hashable", - "docstrings": [], - "signature": "let hashable: (\n ~hash: 'a => int,\n ~eq: ('a, 'a) => bool,\n) => module(Hashable with type t = 'a)" - }, - { - "id": "Belt.Id.getHashInternal", - "kind": "value", - "name": "getHashInternal", - "docstrings": [], - "signature": "let getHashInternal: hash<'a, 'id> => 'a => int" - }, - { - "id": "Belt.Id.getEqInternal", - "kind": "value", - "name": "getEqInternal", - "docstrings": [], - "signature": "let getEqInternal: eq<'a, 'id> => ('a, 'a) => bool" - }, - { - "id": "Belt.Id.getCmpInternal", - "kind": "value", - "name": "getCmpInternal", - "docstrings": [], - "signature": "let getCmpInternal: cmp<'a, 'id> => ('a, 'a) => int" - } - ] - } -} diff --git a/apps/docs/markdown-pages/docs/api/dom.json b/apps/docs/markdown-pages/docs/api/dom.json deleted file mode 100644 index 239098825..000000000 --- a/apps/docs/markdown-pages/docs/api/dom.json +++ /dev/null @@ -1,1962 +0,0 @@ -{ - "dom": { - "id": "Dom", - "name": "Dom", - "docstrings": [], - "items": [ - { - "id": "Dom._baseClass", - "kind": "type", - "name": "_baseClass", - "docstrings": [], - "signature": "type _baseClass" - }, - { - "id": "Dom.animation", - "kind": "type", - "name": "animation", - "docstrings": [], - "signature": "type animation" - }, - { - "id": "Dom.cssStyleDeclaration", - "kind": "type", - "name": "cssStyleDeclaration", - "docstrings": [], - "signature": "type cssStyleDeclaration" - }, - { - "id": "Dom.cssStyleSheet", - "kind": "type", - "name": "cssStyleSheet", - "docstrings": [], - "signature": "type cssStyleSheet" - }, - { - "id": "Dom.eventTarget_like", - "kind": "type", - "name": "eventTarget_like", - "docstrings": [], - "signature": "type eventTarget_like<'a>" - }, - { - "id": "Dom.eventTarget", - "kind": "type", - "name": "eventTarget", - "docstrings": [], - "signature": "type eventTarget = eventTarget_like<_baseClass>" - }, - { - "id": "Dom._node", - "kind": "type", - "name": "_node", - "docstrings": [], - "signature": "type _node<'a>" - }, - { - "id": "Dom.node_like", - "kind": "type", - "name": "node_like", - "docstrings": [], - "signature": "type node_like<'a> = eventTarget_like<_node<'a>>" - }, - { - "id": "Dom.node", - "kind": "type", - "name": "node", - "docstrings": [], - "signature": "type node = node_like<_baseClass>" - }, - { - "id": "Dom._attr", - "kind": "type", - "name": "_attr", - "docstrings": [], - "signature": "type _attr" - }, - { - "id": "Dom.attr", - "kind": "type", - "name": "attr", - "docstrings": [], - "signature": "type attr = node_like<_attr>" - }, - { - "id": "Dom._characterData", - "kind": "type", - "name": "_characterData", - "docstrings": [], - "signature": "type _characterData<'a>" - }, - { - "id": "Dom.characterData_like", - "kind": "type", - "name": "characterData_like", - "docstrings": [], - "signature": "type characterData_like<'a> = node_like<_characterData<'a>>" - }, - { - "id": "Dom.characterData", - "kind": "type", - "name": "characterData", - "docstrings": [], - "signature": "type characterData = characterData_like<_baseClass>" - }, - { - "id": "Dom._cdataSection", - "kind": "type", - "name": "_cdataSection", - "docstrings": [], - "signature": "type _cdataSection" - }, - { - "id": "Dom.cdataSection", - "kind": "type", - "name": "cdataSection", - "docstrings": [], - "signature": "type cdataSection = characterData_like<_cdataSection>" - }, - { - "id": "Dom._comment", - "kind": "type", - "name": "_comment", - "docstrings": [], - "signature": "type _comment" - }, - { - "id": "Dom.comment", - "kind": "type", - "name": "comment", - "docstrings": [], - "signature": "type comment = characterData_like<_comment>" - }, - { - "id": "Dom._document", - "kind": "type", - "name": "_document", - "docstrings": [], - "signature": "type _document<'a>" - }, - { - "id": "Dom.document_like", - "kind": "type", - "name": "document_like", - "docstrings": [], - "signature": "type document_like<'a> = node_like<_document<'a>>" - }, - { - "id": "Dom.document", - "kind": "type", - "name": "document", - "docstrings": [], - "signature": "type document = document_like<_baseClass>" - }, - { - "id": "Dom._documentFragment", - "kind": "type", - "name": "_documentFragment", - "docstrings": [], - "signature": "type _documentFragment" - }, - { - "id": "Dom.documentFragment", - "kind": "type", - "name": "documentFragment", - "docstrings": [], - "signature": "type documentFragment = node_like<_documentFragment>" - }, - { - "id": "Dom._documentType", - "kind": "type", - "name": "_documentType", - "docstrings": [], - "signature": "type _documentType" - }, - { - "id": "Dom.documentType", - "kind": "type", - "name": "documentType", - "docstrings": [], - "signature": "type documentType = node_like<_documentType>" - }, - { - "id": "Dom.domImplementation", - "kind": "type", - "name": "domImplementation", - "docstrings": [], - "signature": "type domImplementation" - }, - { - "id": "Dom._element", - "kind": "type", - "name": "_element", - "docstrings": [], - "signature": "type _element<'a>" - }, - { - "id": "Dom.element_like", - "kind": "type", - "name": "element_like", - "docstrings": [], - "signature": "type element_like<'a> = node_like<_element<'a>>" - }, - { - "id": "Dom.element", - "kind": "type", - "name": "element", - "docstrings": [], - "signature": "type element = element_like<_baseClass>" - }, - { - "id": "Dom.htmlCollection", - "kind": "type", - "name": "htmlCollection", - "docstrings": [], - "signature": "type htmlCollection" - }, - { - "id": "Dom.htmlFormControlsCollection", - "kind": "type", - "name": "htmlFormControlsCollection", - "docstrings": [], - "signature": "type htmlFormControlsCollection" - }, - { - "id": "Dom.htmlOptionsCollection", - "kind": "type", - "name": "htmlOptionsCollection", - "docstrings": [], - "signature": "type htmlOptionsCollection" - }, - { - "id": "Dom.intersectionObserver", - "kind": "type", - "name": "intersectionObserver", - "docstrings": [], - "signature": "type intersectionObserver" - }, - { - "id": "Dom.intersectionObserverEntry", - "kind": "type", - "name": "intersectionObserverEntry", - "docstrings": [], - "signature": "type intersectionObserverEntry" - }, - { - "id": "Dom.mutationObserver", - "kind": "type", - "name": "mutationObserver", - "docstrings": [], - "signature": "type mutationObserver" - }, - { - "id": "Dom.mutationRecord", - "kind": "type", - "name": "mutationRecord", - "docstrings": [], - "signature": "type mutationRecord" - }, - { - "id": "Dom.performanceObserver", - "kind": "type", - "name": "performanceObserver", - "docstrings": [], - "signature": "type performanceObserver" - }, - { - "id": "Dom.performanceObserverEntryList", - "kind": "type", - "name": "performanceObserverEntryList", - "docstrings": [], - "signature": "type performanceObserverEntryList" - }, - { - "id": "Dom.reportingObserver", - "kind": "type", - "name": "reportingObserver", - "docstrings": [], - "signature": "type reportingObserver" - }, - { - "id": "Dom.reportingObserverOptions", - "kind": "type", - "name": "reportingObserverOptions", - "docstrings": [], - "signature": "type reportingObserverOptions" - }, - { - "id": "Dom.resizeObserver", - "kind": "type", - "name": "resizeObserver", - "docstrings": [], - "signature": "type resizeObserver" - }, - { - "id": "Dom.resizeObserverEntry", - "kind": "type", - "name": "resizeObserverEntry", - "docstrings": [], - "signature": "type resizeObserverEntry" - }, - { - "id": "Dom.namedNodeMap", - "kind": "type", - "name": "namedNodeMap", - "docstrings": [], - "signature": "type namedNodeMap" - }, - { - "id": "Dom.nodeList", - "kind": "type", - "name": "nodeList", - "docstrings": [], - "signature": "type nodeList" - }, - { - "id": "Dom.radioNodeList", - "kind": "type", - "name": "radioNodeList", - "docstrings": [], - "signature": "type radioNodeList" - }, - { - "id": "Dom.processingInstruction", - "kind": "type", - "name": "processingInstruction", - "docstrings": [], - "signature": "type processingInstruction" - }, - { - "id": "Dom._shadowRoot", - "kind": "type", - "name": "_shadowRoot", - "docstrings": [], - "signature": "type _shadowRoot" - }, - { - "id": "Dom.shadowRoot", - "kind": "type", - "name": "shadowRoot", - "docstrings": [], - "signature": "type shadowRoot = node_like<_shadowRoot>" - }, - { - "id": "Dom._text", - "kind": "type", - "name": "_text", - "docstrings": [], - "signature": "type _text" - }, - { - "id": "Dom.text", - "kind": "type", - "name": "text", - "docstrings": [], - "signature": "type text = characterData_like<_text>" - }, - { - "id": "Dom.domRect", - "kind": "type", - "name": "domRect", - "docstrings": [], - "signature": "type domRect" - }, - { - "id": "Dom.dataTransfer", - "kind": "type", - "name": "dataTransfer", - "docstrings": [], - "signature": "type dataTransfer" - }, - { - "id": "Dom.domStringMap", - "kind": "type", - "name": "domStringMap", - "docstrings": [], - "signature": "type domStringMap" - }, - { - "id": "Dom.history", - "kind": "type", - "name": "history", - "docstrings": [], - "signature": "type history" - }, - { - "id": "Dom._htmlDocument", - "kind": "type", - "name": "_htmlDocument", - "docstrings": [], - "signature": "type _htmlDocument" - }, - { - "id": "Dom.htmlDocument", - "kind": "type", - "name": "htmlDocument", - "docstrings": [], - "signature": "type htmlDocument = document_like<_htmlDocument>" - }, - { - "id": "Dom._htmlElement", - "kind": "type", - "name": "_htmlElement", - "docstrings": [], - "signature": "type _htmlElement<'a>" - }, - { - "id": "Dom.htmlElement_like", - "kind": "type", - "name": "htmlElement_like", - "docstrings": [], - "signature": "type htmlElement_like<'a> = element_like<_htmlElement<'a>>" - }, - { - "id": "Dom.htmlElement", - "kind": "type", - "name": "htmlElement", - "docstrings": [], - "signature": "type htmlElement = htmlElement_like<_baseClass>" - }, - { - "id": "Dom._htmlAnchorElement", - "kind": "type", - "name": "_htmlAnchorElement", - "docstrings": [], - "signature": "type _htmlAnchorElement" - }, - { - "id": "Dom.htmlAnchorElement", - "kind": "type", - "name": "htmlAnchorElement", - "docstrings": [], - "signature": "type htmlAnchorElement = htmlElement_like<\n _htmlAnchorElement,\n>" - }, - { - "id": "Dom._htmlAreaElement", - "kind": "type", - "name": "_htmlAreaElement", - "docstrings": [], - "signature": "type _htmlAreaElement" - }, - { - "id": "Dom.htmlAreaElement", - "kind": "type", - "name": "htmlAreaElement", - "docstrings": [], - "signature": "type htmlAreaElement = htmlElement_like<_htmlAreaElement>" - }, - { - "id": "Dom._htmlAudioElement", - "kind": "type", - "name": "_htmlAudioElement", - "docstrings": [], - "signature": "type _htmlAudioElement" - }, - { - "id": "Dom.htmlAudioElement", - "kind": "type", - "name": "htmlAudioElement", - "docstrings": [], - "signature": "type htmlAudioElement = htmlElement_like<_htmlAudioElement>" - }, - { - "id": "Dom._htmlBaseElement", - "kind": "type", - "name": "_htmlBaseElement", - "docstrings": [], - "signature": "type _htmlBaseElement" - }, - { - "id": "Dom.htmlBaseElement", - "kind": "type", - "name": "htmlBaseElement", - "docstrings": [], - "signature": "type htmlBaseElement = htmlElement_like<_htmlBaseElement>" - }, - { - "id": "Dom._htmlBodyElement", - "kind": "type", - "name": "_htmlBodyElement", - "docstrings": [], - "signature": "type _htmlBodyElement" - }, - { - "id": "Dom.htmlBodyElement", - "kind": "type", - "name": "htmlBodyElement", - "docstrings": [], - "signature": "type htmlBodyElement = htmlElement_like<_htmlBodyElement>" - }, - { - "id": "Dom._htmlBrElement", - "kind": "type", - "name": "_htmlBrElement", - "docstrings": [], - "signature": "type _htmlBrElement" - }, - { - "id": "Dom.htmlBrElement", - "kind": "type", - "name": "htmlBrElement", - "docstrings": [], - "signature": "type htmlBrElement = htmlElement_like<_htmlBrElement>" - }, - { - "id": "Dom._htmlButtonElement", - "kind": "type", - "name": "_htmlButtonElement", - "docstrings": [], - "signature": "type _htmlButtonElement" - }, - { - "id": "Dom.htmlButtonElement", - "kind": "type", - "name": "htmlButtonElement", - "docstrings": [], - "signature": "type htmlButtonElement = htmlElement_like<\n _htmlButtonElement,\n>" - }, - { - "id": "Dom._htmlCanvasElement", - "kind": "type", - "name": "_htmlCanvasElement", - "docstrings": [], - "signature": "type _htmlCanvasElement" - }, - { - "id": "Dom.htmlCanvasElement", - "kind": "type", - "name": "htmlCanvasElement", - "docstrings": [], - "signature": "type htmlCanvasElement = htmlElement_like<\n _htmlCanvasElement,\n>" - }, - { - "id": "Dom._htmlDataElement", - "kind": "type", - "name": "_htmlDataElement", - "docstrings": [], - "signature": "type _htmlDataElement" - }, - { - "id": "Dom.htmlDataElement", - "kind": "type", - "name": "htmlDataElement", - "docstrings": [], - "signature": "type htmlDataElement = htmlElement_like<_htmlDataElement>" - }, - { - "id": "Dom._htmlDataListElement", - "kind": "type", - "name": "_htmlDataListElement", - "docstrings": [], - "signature": "type _htmlDataListElement" - }, - { - "id": "Dom.htmlDataListElement", - "kind": "type", - "name": "htmlDataListElement", - "docstrings": [], - "signature": "type htmlDataListElement = htmlElement_like<\n _htmlDataListElement,\n>" - }, - { - "id": "Dom._htmlDialogElement", - "kind": "type", - "name": "_htmlDialogElement", - "docstrings": [], - "signature": "type _htmlDialogElement" - }, - { - "id": "Dom.htmlDialogElement", - "kind": "type", - "name": "htmlDialogElement", - "docstrings": [], - "signature": "type htmlDialogElement = htmlElement_like<\n _htmlDialogElement,\n>" - }, - { - "id": "Dom._htmlDivElement", - "kind": "type", - "name": "_htmlDivElement", - "docstrings": [], - "signature": "type _htmlDivElement" - }, - { - "id": "Dom.htmlDivElement", - "kind": "type", - "name": "htmlDivElement", - "docstrings": [], - "signature": "type htmlDivElement = htmlElement_like<_htmlDivElement>" - }, - { - "id": "Dom._htmlDlistElement", - "kind": "type", - "name": "_htmlDlistElement", - "docstrings": [], - "signature": "type _htmlDlistElement" - }, - { - "id": "Dom.htmlDlistElement", - "kind": "type", - "name": "htmlDlistElement", - "docstrings": [], - "signature": "type htmlDlistElement = htmlElement_like<_htmlDlistElement>" - }, - { - "id": "Dom._htmlEmbedElement", - "kind": "type", - "name": "_htmlEmbedElement", - "docstrings": [], - "signature": "type _htmlEmbedElement" - }, - { - "id": "Dom.htmlEmbedElement", - "kind": "type", - "name": "htmlEmbedElement", - "docstrings": [], - "signature": "type htmlEmbedElement = htmlElement_like<_htmlEmbedElement>" - }, - { - "id": "Dom._htmlFieldSetElement", - "kind": "type", - "name": "_htmlFieldSetElement", - "docstrings": [], - "signature": "type _htmlFieldSetElement" - }, - { - "id": "Dom.htmlFieldSetElement", - "kind": "type", - "name": "htmlFieldSetElement", - "docstrings": [], - "signature": "type htmlFieldSetElement = htmlElement_like<\n _htmlFieldSetElement,\n>" - }, - { - "id": "Dom._htmlFormElement", - "kind": "type", - "name": "_htmlFormElement", - "docstrings": [], - "signature": "type _htmlFormElement" - }, - { - "id": "Dom.htmlFormElement", - "kind": "type", - "name": "htmlFormElement", - "docstrings": [], - "signature": "type htmlFormElement = htmlElement_like<_htmlFormElement>" - }, - { - "id": "Dom._htmlHeadElement", - "kind": "type", - "name": "_htmlHeadElement", - "docstrings": [], - "signature": "type _htmlHeadElement" - }, - { - "id": "Dom.htmlHeadElement", - "kind": "type", - "name": "htmlHeadElement", - "docstrings": [], - "signature": "type htmlHeadElement = htmlElement_like<_htmlHeadElement>" - }, - { - "id": "Dom._htmlHeadingElement", - "kind": "type", - "name": "_htmlHeadingElement", - "docstrings": [], - "signature": "type _htmlHeadingElement" - }, - { - "id": "Dom.htmlHeadingElement", - "kind": "type", - "name": "htmlHeadingElement", - "docstrings": [], - "signature": "type htmlHeadingElement = htmlElement_like<\n _htmlHeadingElement,\n>" - }, - { - "id": "Dom._htmlHrElement", - "kind": "type", - "name": "_htmlHrElement", - "docstrings": [], - "signature": "type _htmlHrElement" - }, - { - "id": "Dom.htmlHrElement", - "kind": "type", - "name": "htmlHrElement", - "docstrings": [], - "signature": "type htmlHrElement = htmlElement_like<_htmlHrElement>" - }, - { - "id": "Dom._htmlHtmlElement", - "kind": "type", - "name": "_htmlHtmlElement", - "docstrings": [], - "signature": "type _htmlHtmlElement" - }, - { - "id": "Dom.htmlHtmlElement", - "kind": "type", - "name": "htmlHtmlElement", - "docstrings": [], - "signature": "type htmlHtmlElement = htmlElement_like<_htmlHtmlElement>" - }, - { - "id": "Dom._htmlIframeElement", - "kind": "type", - "name": "_htmlIframeElement", - "docstrings": [], - "signature": "type _htmlIframeElement" - }, - { - "id": "Dom.htmlIframeElement", - "kind": "type", - "name": "htmlIframeElement", - "docstrings": [], - "signature": "type htmlIframeElement = htmlElement_like<\n _htmlIframeElement,\n>" - }, - { - "id": "Dom._htmlImageElement", - "kind": "type", - "name": "_htmlImageElement", - "docstrings": [], - "signature": "type _htmlImageElement" - }, - { - "id": "Dom.htmlImageElement", - "kind": "type", - "name": "htmlImageElement", - "docstrings": [], - "signature": "type htmlImageElement = htmlElement_like<_htmlImageElement>" - }, - { - "id": "Dom._htmlInputElement", - "kind": "type", - "name": "_htmlInputElement", - "docstrings": [], - "signature": "type _htmlInputElement" - }, - { - "id": "Dom.htmlInputElement", - "kind": "type", - "name": "htmlInputElement", - "docstrings": [], - "signature": "type htmlInputElement = htmlElement_like<_htmlInputElement>" - }, - { - "id": "Dom._htmlLabelElement", - "kind": "type", - "name": "_htmlLabelElement", - "docstrings": [], - "signature": "type _htmlLabelElement" - }, - { - "id": "Dom.htmlLabelElement", - "kind": "type", - "name": "htmlLabelElement", - "docstrings": [], - "signature": "type htmlLabelElement = htmlElement_like<_htmlLabelElement>" - }, - { - "id": "Dom._htmlLegendElement", - "kind": "type", - "name": "_htmlLegendElement", - "docstrings": [], - "signature": "type _htmlLegendElement" - }, - { - "id": "Dom.htmlLegendElement", - "kind": "type", - "name": "htmlLegendElement", - "docstrings": [], - "signature": "type htmlLegendElement = htmlElement_like<\n _htmlLegendElement,\n>" - }, - { - "id": "Dom._htmlLiElement", - "kind": "type", - "name": "_htmlLiElement", - "docstrings": [], - "signature": "type _htmlLiElement" - }, - { - "id": "Dom.htmlLiElement", - "kind": "type", - "name": "htmlLiElement", - "docstrings": [], - "signature": "type htmlLiElement = htmlElement_like<_htmlLiElement>" - }, - { - "id": "Dom._htmlLinkElement", - "kind": "type", - "name": "_htmlLinkElement", - "docstrings": [], - "signature": "type _htmlLinkElement" - }, - { - "id": "Dom.htmlLinkElement", - "kind": "type", - "name": "htmlLinkElement", - "docstrings": [], - "signature": "type htmlLinkElement = htmlElement_like<_htmlLinkElement>" - }, - { - "id": "Dom._htmlMapElement", - "kind": "type", - "name": "_htmlMapElement", - "docstrings": [], - "signature": "type _htmlMapElement" - }, - { - "id": "Dom.htmlMapElement", - "kind": "type", - "name": "htmlMapElement", - "docstrings": [], - "signature": "type htmlMapElement = htmlElement_like<_htmlMapElement>" - }, - { - "id": "Dom._htmlMediaElement", - "kind": "type", - "name": "_htmlMediaElement", - "docstrings": [], - "signature": "type _htmlMediaElement" - }, - { - "id": "Dom.htmlMediaElement", - "kind": "type", - "name": "htmlMediaElement", - "docstrings": [], - "signature": "type htmlMediaElement = htmlElement_like<_htmlMediaElement>" - }, - { - "id": "Dom._htmlMenuElement", - "kind": "type", - "name": "_htmlMenuElement", - "docstrings": [], - "signature": "type _htmlMenuElement" - }, - { - "id": "Dom.htmlMenuElement", - "kind": "type", - "name": "htmlMenuElement", - "docstrings": [], - "signature": "type htmlMenuElement = htmlElement_like<_htmlMenuElement>" - }, - { - "id": "Dom._htmlMetaElement", - "kind": "type", - "name": "_htmlMetaElement", - "docstrings": [], - "signature": "type _htmlMetaElement" - }, - { - "id": "Dom.htmlMetaElement", - "kind": "type", - "name": "htmlMetaElement", - "docstrings": [], - "signature": "type htmlMetaElement = htmlElement_like<_htmlMetaElement>" - }, - { - "id": "Dom._htmlMeterElement", - "kind": "type", - "name": "_htmlMeterElement", - "docstrings": [], - "signature": "type _htmlMeterElement" - }, - { - "id": "Dom.htmlMeterElement", - "kind": "type", - "name": "htmlMeterElement", - "docstrings": [], - "signature": "type htmlMeterElement = htmlElement_like<_htmlMeterElement>" - }, - { - "id": "Dom._htmlModElement", - "kind": "type", - "name": "_htmlModElement", - "docstrings": [], - "signature": "type _htmlModElement" - }, - { - "id": "Dom.htmlModElement", - "kind": "type", - "name": "htmlModElement", - "docstrings": [], - "signature": "type htmlModElement = htmlElement_like<_htmlModElement>" - }, - { - "id": "Dom._htmlOListElement", - "kind": "type", - "name": "_htmlOListElement", - "docstrings": [], - "signature": "type _htmlOListElement" - }, - { - "id": "Dom.htmlOListElement", - "kind": "type", - "name": "htmlOListElement", - "docstrings": [], - "signature": "type htmlOListElement = htmlElement_like<_htmlOListElement>" - }, - { - "id": "Dom._htmlObjectElement", - "kind": "type", - "name": "_htmlObjectElement", - "docstrings": [], - "signature": "type _htmlObjectElement" - }, - { - "id": "Dom.htmlObjectElement", - "kind": "type", - "name": "htmlObjectElement", - "docstrings": [], - "signature": "type htmlObjectElement = htmlElement_like<\n _htmlObjectElement,\n>" - }, - { - "id": "Dom._htmlOptGroupElement", - "kind": "type", - "name": "_htmlOptGroupElement", - "docstrings": [], - "signature": "type _htmlOptGroupElement" - }, - { - "id": "Dom.htmlOptGroupElement", - "kind": "type", - "name": "htmlOptGroupElement", - "docstrings": [], - "signature": "type htmlOptGroupElement = htmlElement_like<\n _htmlOptGroupElement,\n>" - }, - { - "id": "Dom._htmlOptionElement", - "kind": "type", - "name": "_htmlOptionElement", - "docstrings": [], - "signature": "type _htmlOptionElement" - }, - { - "id": "Dom.htmlOptionElement", - "kind": "type", - "name": "htmlOptionElement", - "docstrings": [], - "signature": "type htmlOptionElement = htmlElement_like<\n _htmlOptionElement,\n>" - }, - { - "id": "Dom._htmlOutputElement", - "kind": "type", - "name": "_htmlOutputElement", - "docstrings": [], - "signature": "type _htmlOutputElement" - }, - { - "id": "Dom.htmlOutputElement", - "kind": "type", - "name": "htmlOutputElement", - "docstrings": [], - "signature": "type htmlOutputElement = htmlElement_like<\n _htmlOutputElement,\n>" - }, - { - "id": "Dom._htmlParagraphElement", - "kind": "type", - "name": "_htmlParagraphElement", - "docstrings": [], - "signature": "type _htmlParagraphElement" - }, - { - "id": "Dom.htmlParagraphElement", - "kind": "type", - "name": "htmlParagraphElement", - "docstrings": [], - "signature": "type htmlParagraphElement = htmlElement_like<\n _htmlParagraphElement,\n>" - }, - { - "id": "Dom._htmlParamElement", - "kind": "type", - "name": "_htmlParamElement", - "docstrings": [], - "signature": "type _htmlParamElement" - }, - { - "id": "Dom.htmlParamElement", - "kind": "type", - "name": "htmlParamElement", - "docstrings": [], - "signature": "type htmlParamElement = htmlElement_like<_htmlParamElement>" - }, - { - "id": "Dom._htmlPreElement", - "kind": "type", - "name": "_htmlPreElement", - "docstrings": [], - "signature": "type _htmlPreElement" - }, - { - "id": "Dom.htmlPreElement", - "kind": "type", - "name": "htmlPreElement", - "docstrings": [], - "signature": "type htmlPreElement = htmlElement_like<_htmlPreElement>" - }, - { - "id": "Dom._htmlProgressElement", - "kind": "type", - "name": "_htmlProgressElement", - "docstrings": [], - "signature": "type _htmlProgressElement" - }, - { - "id": "Dom.htmlProgressElement", - "kind": "type", - "name": "htmlProgressElement", - "docstrings": [], - "signature": "type htmlProgressElement = htmlElement_like<\n _htmlProgressElement,\n>" - }, - { - "id": "Dom._htmlQuoteElement", - "kind": "type", - "name": "_htmlQuoteElement", - "docstrings": [], - "signature": "type _htmlQuoteElement" - }, - { - "id": "Dom.htmlQuoteElement", - "kind": "type", - "name": "htmlQuoteElement", - "docstrings": [], - "signature": "type htmlQuoteElement = htmlElement_like<_htmlQuoteElement>" - }, - { - "id": "Dom._htmlScriptElement", - "kind": "type", - "name": "_htmlScriptElement", - "docstrings": [], - "signature": "type _htmlScriptElement" - }, - { - "id": "Dom.htmlScriptElement", - "kind": "type", - "name": "htmlScriptElement", - "docstrings": [], - "signature": "type htmlScriptElement = htmlElement_like<\n _htmlScriptElement,\n>" - }, - { - "id": "Dom._htmlSelectElement", - "kind": "type", - "name": "_htmlSelectElement", - "docstrings": [], - "signature": "type _htmlSelectElement" - }, - { - "id": "Dom.htmlSelectElement", - "kind": "type", - "name": "htmlSelectElement", - "docstrings": [], - "signature": "type htmlSelectElement = htmlElement_like<\n _htmlSelectElement,\n>" - }, - { - "id": "Dom._htmlSlotElement", - "kind": "type", - "name": "_htmlSlotElement", - "docstrings": [], - "signature": "type _htmlSlotElement" - }, - { - "id": "Dom.htmlSlotElement", - "kind": "type", - "name": "htmlSlotElement", - "docstrings": [], - "signature": "type htmlSlotElement = htmlElement_like<_htmlSlotElement>" - }, - { - "id": "Dom._htmlSourceElement", - "kind": "type", - "name": "_htmlSourceElement", - "docstrings": [], - "signature": "type _htmlSourceElement" - }, - { - "id": "Dom.htmlSourceElement", - "kind": "type", - "name": "htmlSourceElement", - "docstrings": [], - "signature": "type htmlSourceElement = htmlElement_like<\n _htmlSourceElement,\n>" - }, - { - "id": "Dom._htmlSpanElement", - "kind": "type", - "name": "_htmlSpanElement", - "docstrings": [], - "signature": "type _htmlSpanElement" - }, - { - "id": "Dom.htmlSpanElement", - "kind": "type", - "name": "htmlSpanElement", - "docstrings": [], - "signature": "type htmlSpanElement = htmlElement_like<_htmlSpanElement>" - }, - { - "id": "Dom._htmlStyleElement", - "kind": "type", - "name": "_htmlStyleElement", - "docstrings": [], - "signature": "type _htmlStyleElement" - }, - { - "id": "Dom.htmlStyleElement", - "kind": "type", - "name": "htmlStyleElement", - "docstrings": [], - "signature": "type htmlStyleElement = htmlElement_like<_htmlStyleElement>" - }, - { - "id": "Dom._htmlTableCaptionElement", - "kind": "type", - "name": "_htmlTableCaptionElement", - "docstrings": [], - "signature": "type _htmlTableCaptionElement" - }, - { - "id": "Dom.htmlTableCaptionElement", - "kind": "type", - "name": "htmlTableCaptionElement", - "docstrings": [], - "signature": "type htmlTableCaptionElement = htmlElement_like<\n _htmlTableCaptionElement,\n>" - }, - { - "id": "Dom._htmlTableCellElement", - "kind": "type", - "name": "_htmlTableCellElement", - "docstrings": [], - "signature": "type _htmlTableCellElement" - }, - { - "id": "Dom.htmlTableCellElement", - "kind": "type", - "name": "htmlTableCellElement", - "docstrings": [], - "signature": "type htmlTableCellElement = htmlElement_like<\n _htmlTableCellElement,\n>" - }, - { - "id": "Dom._htmlTableColElement", - "kind": "type", - "name": "_htmlTableColElement", - "docstrings": [], - "signature": "type _htmlTableColElement" - }, - { - "id": "Dom.htmlTableColElement", - "kind": "type", - "name": "htmlTableColElement", - "docstrings": [], - "signature": "type htmlTableColElement = htmlElement_like<\n _htmlTableColElement,\n>" - }, - { - "id": "Dom._htmlTableDataCellElement", - "kind": "type", - "name": "_htmlTableDataCellElement", - "docstrings": [], - "signature": "type _htmlTableDataCellElement" - }, - { - "id": "Dom.htmlTableDataCellElement", - "kind": "type", - "name": "htmlTableDataCellElement", - "docstrings": [], - "signature": "type htmlTableDataCellElement = htmlElement_like<\n _htmlTableDataCellElement,\n>" - }, - { - "id": "Dom._htmlTableElement", - "kind": "type", - "name": "_htmlTableElement", - "docstrings": [], - "signature": "type _htmlTableElement" - }, - { - "id": "Dom.htmlTableElement", - "kind": "type", - "name": "htmlTableElement", - "docstrings": [], - "signature": "type htmlTableElement = htmlElement_like<_htmlTableElement>" - }, - { - "id": "Dom._htmlTableHeaderCellElement", - "kind": "type", - "name": "_htmlTableHeaderCellElement", - "docstrings": [], - "signature": "type _htmlTableHeaderCellElement" - }, - { - "id": "Dom.htmlTableHeaderCellElement", - "kind": "type", - "name": "htmlTableHeaderCellElement", - "docstrings": [], - "signature": "type htmlTableHeaderCellElement = htmlElement_like<\n _htmlTableHeaderCellElement,\n>" - }, - { - "id": "Dom._htmlTableRowElement", - "kind": "type", - "name": "_htmlTableRowElement", - "docstrings": [], - "signature": "type _htmlTableRowElement" - }, - { - "id": "Dom.htmlTableRowElement", - "kind": "type", - "name": "htmlTableRowElement", - "docstrings": [], - "signature": "type htmlTableRowElement = htmlElement_like<\n _htmlTableRowElement,\n>" - }, - { - "id": "Dom._htmlTableSectionElement", - "kind": "type", - "name": "_htmlTableSectionElement", - "docstrings": [], - "signature": "type _htmlTableSectionElement" - }, - { - "id": "Dom.htmlTableSectionElement", - "kind": "type", - "name": "htmlTableSectionElement", - "docstrings": [], - "signature": "type htmlTableSectionElement = htmlElement_like<\n _htmlTableSectionElement,\n>" - }, - { - "id": "Dom._htmlTextAreaElement", - "kind": "type", - "name": "_htmlTextAreaElement", - "docstrings": [], - "signature": "type _htmlTextAreaElement" - }, - { - "id": "Dom.htmlTextAreaElement", - "kind": "type", - "name": "htmlTextAreaElement", - "docstrings": [], - "signature": "type htmlTextAreaElement = htmlElement_like<\n _htmlTextAreaElement,\n>" - }, - { - "id": "Dom._htmlTimeElement", - "kind": "type", - "name": "_htmlTimeElement", - "docstrings": [], - "signature": "type _htmlTimeElement" - }, - { - "id": "Dom.htmlTimeElement", - "kind": "type", - "name": "htmlTimeElement", - "docstrings": [], - "signature": "type htmlTimeElement = htmlElement_like<_htmlTimeElement>" - }, - { - "id": "Dom._htmlTitleElement", - "kind": "type", - "name": "_htmlTitleElement", - "docstrings": [], - "signature": "type _htmlTitleElement" - }, - { - "id": "Dom.htmlTitleElement", - "kind": "type", - "name": "htmlTitleElement", - "docstrings": [], - "signature": "type htmlTitleElement = htmlElement_like<_htmlTitleElement>" - }, - { - "id": "Dom._htmlTrackElement", - "kind": "type", - "name": "_htmlTrackElement", - "docstrings": [], - "signature": "type _htmlTrackElement" - }, - { - "id": "Dom.htmlTrackElement", - "kind": "type", - "name": "htmlTrackElement", - "docstrings": [], - "signature": "type htmlTrackElement = htmlElement_like<_htmlTrackElement>" - }, - { - "id": "Dom._htmlUlistElement", - "kind": "type", - "name": "_htmlUlistElement", - "docstrings": [], - "signature": "type _htmlUlistElement" - }, - { - "id": "Dom.htmlUlistElement", - "kind": "type", - "name": "htmlUlistElement", - "docstrings": [], - "signature": "type htmlUlistElement = htmlElement_like<_htmlUlistElement>" - }, - { - "id": "Dom._htmlUnknownElement", - "kind": "type", - "name": "_htmlUnknownElement", - "docstrings": [], - "signature": "type _htmlUnknownElement" - }, - { - "id": "Dom.htmlUnknownElement", - "kind": "type", - "name": "htmlUnknownElement", - "docstrings": [], - "signature": "type htmlUnknownElement = htmlElement_like<\n _htmlUnknownElement,\n>" - }, - { - "id": "Dom._htmlVideoElement", - "kind": "type", - "name": "_htmlVideoElement", - "docstrings": [], - "signature": "type _htmlVideoElement" - }, - { - "id": "Dom.htmlVideoElement", - "kind": "type", - "name": "htmlVideoElement", - "docstrings": [], - "signature": "type htmlVideoElement = htmlElement_like<_htmlVideoElement>" - }, - { - "id": "Dom.location", - "kind": "type", - "name": "location", - "docstrings": [], - "signature": "type location" - }, - { - "id": "Dom.window", - "kind": "type", - "name": "window", - "docstrings": [], - "signature": "type window" - }, - { - "id": "Dom._xmlDocument", - "kind": "type", - "name": "_xmlDocument", - "docstrings": [], - "signature": "type _xmlDocument" - }, - { - "id": "Dom.xmlDocument", - "kind": "type", - "name": "xmlDocument", - "docstrings": [], - "signature": "type xmlDocument = document_like<_xmlDocument>" - }, - { - "id": "Dom.event_like", - "kind": "type", - "name": "event_like", - "docstrings": [], - "signature": "type event_like<'a>" - }, - { - "id": "Dom.event", - "kind": "type", - "name": "event", - "docstrings": [], - "signature": "type event = event_like<_baseClass>" - }, - { - "id": "Dom._uiEvent", - "kind": "type", - "name": "_uiEvent", - "docstrings": [], - "signature": "type _uiEvent<'a>" - }, - { - "id": "Dom.uiEvent_like", - "kind": "type", - "name": "uiEvent_like", - "docstrings": [], - "signature": "type uiEvent_like<'a> = event_like<_uiEvent<'a>>" - }, - { - "id": "Dom.uiEvent", - "kind": "type", - "name": "uiEvent", - "docstrings": [], - "signature": "type uiEvent = uiEvent_like<_baseClass>" - }, - { - "id": "Dom._animationEvent", - "kind": "type", - "name": "_animationEvent", - "docstrings": [], - "signature": "type _animationEvent" - }, - { - "id": "Dom.animationEvent", - "kind": "type", - "name": "animationEvent", - "docstrings": [], - "signature": "type animationEvent = event_like<_animationEvent>" - }, - { - "id": "Dom._beforeUnloadEvent", - "kind": "type", - "name": "_beforeUnloadEvent", - "docstrings": [], - "signature": "type _beforeUnloadEvent" - }, - { - "id": "Dom.beforeUnloadEvent", - "kind": "type", - "name": "beforeUnloadEvent", - "docstrings": [], - "signature": "type beforeUnloadEvent = event_like<_beforeUnloadEvent>" - }, - { - "id": "Dom._clipboardEvent", - "kind": "type", - "name": "_clipboardEvent", - "docstrings": [], - "signature": "type _clipboardEvent" - }, - { - "id": "Dom.clipboardEvent", - "kind": "type", - "name": "clipboardEvent", - "docstrings": [], - "signature": "type clipboardEvent = event_like<_clipboardEvent>" - }, - { - "id": "Dom._closeEvent", - "kind": "type", - "name": "_closeEvent", - "docstrings": [], - "signature": "type _closeEvent" - }, - { - "id": "Dom.closeEvent", - "kind": "type", - "name": "closeEvent", - "docstrings": [], - "signature": "type closeEvent = event_like<_closeEvent>" - }, - { - "id": "Dom._compositionEvent", - "kind": "type", - "name": "_compositionEvent", - "docstrings": [], - "signature": "type _compositionEvent" - }, - { - "id": "Dom.compositionEvent", - "kind": "type", - "name": "compositionEvent", - "docstrings": [], - "signature": "type compositionEvent = uiEvent_like<_compositionEvent>" - }, - { - "id": "Dom._customEvent", - "kind": "type", - "name": "_customEvent", - "docstrings": [], - "signature": "type _customEvent" - }, - { - "id": "Dom.customEvent", - "kind": "type", - "name": "customEvent", - "docstrings": [], - "signature": "type customEvent = event_like<_customEvent>" - }, - { - "id": "Dom._dragEvent", - "kind": "type", - "name": "_dragEvent", - "docstrings": [], - "signature": "type _dragEvent" - }, - { - "id": "Dom.dragEvent", - "kind": "type", - "name": "dragEvent", - "docstrings": [], - "signature": "type dragEvent = event_like<_dragEvent>" - }, - { - "id": "Dom._errorEvent", - "kind": "type", - "name": "_errorEvent", - "docstrings": [], - "signature": "type _errorEvent" - }, - { - "id": "Dom.errorEvent", - "kind": "type", - "name": "errorEvent", - "docstrings": [], - "signature": "type errorEvent = event_like<_errorEvent>" - }, - { - "id": "Dom._focusEvent", - "kind": "type", - "name": "_focusEvent", - "docstrings": [], - "signature": "type _focusEvent" - }, - { - "id": "Dom.focusEvent", - "kind": "type", - "name": "focusEvent", - "docstrings": [], - "signature": "type focusEvent = uiEvent_like<_focusEvent>" - }, - { - "id": "Dom._idbVersionChangeEvent", - "kind": "type", - "name": "_idbVersionChangeEvent", - "docstrings": [], - "signature": "type _idbVersionChangeEvent" - }, - { - "id": "Dom.idbVersionChangeEvent", - "kind": "type", - "name": "idbVersionChangeEvent", - "docstrings": [], - "signature": "type idbVersionChangeEvent = event_like<\n _idbVersionChangeEvent,\n>" - }, - { - "id": "Dom._inputEvent", - "kind": "type", - "name": "_inputEvent", - "docstrings": [], - "signature": "type _inputEvent" - }, - { - "id": "Dom.inputEvent", - "kind": "type", - "name": "inputEvent", - "docstrings": [], - "signature": "type inputEvent = uiEvent_like<_inputEvent>" - }, - { - "id": "Dom._keyboardEvent", - "kind": "type", - "name": "_keyboardEvent", - "docstrings": [], - "signature": "type _keyboardEvent" - }, - { - "id": "Dom.keyboardEvent", - "kind": "type", - "name": "keyboardEvent", - "docstrings": [], - "signature": "type keyboardEvent = uiEvent_like<_keyboardEvent>" - }, - { - "id": "Dom._mouseEvent", - "kind": "type", - "name": "_mouseEvent", - "docstrings": [], - "signature": "type _mouseEvent<'a>" - }, - { - "id": "Dom.mouseEvent_like", - "kind": "type", - "name": "mouseEvent_like", - "docstrings": [], - "signature": "type mouseEvent_like<'a> = uiEvent_like<_mouseEvent<'a>>" - }, - { - "id": "Dom.mouseEvent", - "kind": "type", - "name": "mouseEvent", - "docstrings": [], - "signature": "type mouseEvent = mouseEvent_like<_baseClass>" - }, - { - "id": "Dom._pageTransitionEvent", - "kind": "type", - "name": "_pageTransitionEvent", - "docstrings": [], - "signature": "type _pageTransitionEvent" - }, - { - "id": "Dom.pageTransitionEvent", - "kind": "type", - "name": "pageTransitionEvent", - "docstrings": [], - "signature": "type pageTransitionEvent = event_like<_pageTransitionEvent>" - }, - { - "id": "Dom._pointerEvent", - "kind": "type", - "name": "_pointerEvent", - "docstrings": [], - "signature": "type _pointerEvent" - }, - { - "id": "Dom.pointerEvent", - "kind": "type", - "name": "pointerEvent", - "docstrings": [], - "signature": "type pointerEvent = mouseEvent_like<_pointerEvent>" - }, - { - "id": "Dom._popStateEvent", - "kind": "type", - "name": "_popStateEvent", - "docstrings": [], - "signature": "type _popStateEvent" - }, - { - "id": "Dom.popStateEvent", - "kind": "type", - "name": "popStateEvent", - "docstrings": [], - "signature": "type popStateEvent = event_like<_popStateEvent>" - }, - { - "id": "Dom._progressEvent", - "kind": "type", - "name": "_progressEvent", - "docstrings": [], - "signature": "type _progressEvent" - }, - { - "id": "Dom.progressEvent", - "kind": "type", - "name": "progressEvent", - "docstrings": [], - "signature": "type progressEvent = event_like<_progressEvent>" - }, - { - "id": "Dom._relatedEvent", - "kind": "type", - "name": "_relatedEvent", - "docstrings": [], - "signature": "type _relatedEvent" - }, - { - "id": "Dom.relatedEvent", - "kind": "type", - "name": "relatedEvent", - "docstrings": [], - "signature": "type relatedEvent = event_like<_relatedEvent>" - }, - { - "id": "Dom._storageEvent", - "kind": "type", - "name": "_storageEvent", - "docstrings": [], - "signature": "type _storageEvent" - }, - { - "id": "Dom.storageEvent", - "kind": "type", - "name": "storageEvent", - "docstrings": [], - "signature": "type storageEvent = event_like<_storageEvent>" - }, - { - "id": "Dom._svgZoomEvent", - "kind": "type", - "name": "_svgZoomEvent", - "docstrings": [], - "signature": "type _svgZoomEvent" - }, - { - "id": "Dom.svgZoomEvent", - "kind": "type", - "name": "svgZoomEvent", - "docstrings": [], - "signature": "type svgZoomEvent = event_like<_svgZoomEvent>" - }, - { - "id": "Dom._timeEvent", - "kind": "type", - "name": "_timeEvent", - "docstrings": [], - "signature": "type _timeEvent" - }, - { - "id": "Dom.timeEvent", - "kind": "type", - "name": "timeEvent", - "docstrings": [], - "signature": "type timeEvent = event_like<_timeEvent>" - }, - { - "id": "Dom._touchEvent", - "kind": "type", - "name": "_touchEvent", - "docstrings": [], - "signature": "type _touchEvent" - }, - { - "id": "Dom.touchEvent", - "kind": "type", - "name": "touchEvent", - "docstrings": [], - "signature": "type touchEvent = uiEvent_like<_touchEvent>" - }, - { - "id": "Dom._trackEvent", - "kind": "type", - "name": "_trackEvent", - "docstrings": [], - "signature": "type _trackEvent" - }, - { - "id": "Dom.trackEvent", - "kind": "type", - "name": "trackEvent", - "docstrings": [], - "signature": "type trackEvent = event_like<_trackEvent>" - }, - { - "id": "Dom._transitionEvent", - "kind": "type", - "name": "_transitionEvent", - "docstrings": [], - "signature": "type _transitionEvent" - }, - { - "id": "Dom.transitionEvent", - "kind": "type", - "name": "transitionEvent", - "docstrings": [], - "signature": "type transitionEvent = event_like<_transitionEvent>" - }, - { - "id": "Dom._webGlContextEvent", - "kind": "type", - "name": "_webGlContextEvent", - "docstrings": [], - "signature": "type _webGlContextEvent" - }, - { - "id": "Dom.webGlContextEvent", - "kind": "type", - "name": "webGlContextEvent", - "docstrings": [], - "signature": "type webGlContextEvent = event_like<_webGlContextEvent>" - }, - { - "id": "Dom._wheelEvent", - "kind": "type", - "name": "_wheelEvent", - "docstrings": [], - "signature": "type _wheelEvent" - }, - { - "id": "Dom.wheelEvent", - "kind": "type", - "name": "wheelEvent", - "docstrings": [], - "signature": "type wheelEvent = uiEvent_like<_wheelEvent>" - }, - { - "id": "Dom.range", - "kind": "type", - "name": "range", - "docstrings": [], - "signature": "type range" - }, - { - "id": "Dom.selection", - "kind": "type", - "name": "selection", - "docstrings": [], - "signature": "type selection" - }, - { - "id": "Dom.domTokenList", - "kind": "type", - "name": "domTokenList", - "docstrings": [], - "signature": "type domTokenList" - }, - { - "id": "Dom.domSettableTokenList", - "kind": "type", - "name": "domSettableTokenList", - "docstrings": [], - "signature": "type domSettableTokenList" - }, - { - "id": "Dom.nodeFilter", - "kind": "type", - "name": "nodeFilter", - "docstrings": [], - "signature": "type nodeFilter = {acceptNode: element => int}" - }, - { - "id": "Dom.nodeIterator", - "kind": "type", - "name": "nodeIterator", - "docstrings": [], - "signature": "type nodeIterator" - }, - { - "id": "Dom.treeWalker", - "kind": "type", - "name": "treeWalker", - "docstrings": [], - "signature": "type treeWalker" - }, - { - "id": "Dom.svgRect", - "kind": "type", - "name": "svgRect", - "docstrings": [], - "signature": "type svgRect" - }, - { - "id": "Dom.svgPoint", - "kind": "type", - "name": "svgPoint", - "docstrings": [], - "signature": "type svgPoint" - }, - { - "id": "Dom.eventPointerId", - "kind": "type", - "name": "eventPointerId", - "docstrings": [], - "signature": "type eventPointerId" - } - ] - }, - "dom/storage2": { - "id": "Dom.Storage2", - "name": "Storage2", - "docstrings": [], - "items": [ - { - "id": "Dom.Storage2.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Dom.Storage2.getItem", - "kind": "value", - "name": "getItem", - "docstrings": [], - "signature": "let getItem: (t, string) => option" - }, - { - "id": "Dom.Storage2.setItem", - "kind": "value", - "name": "setItem", - "docstrings": [], - "signature": "let setItem: (t, string, string) => unit" - }, - { - "id": "Dom.Storage2.removeItem", - "kind": "value", - "name": "removeItem", - "docstrings": [], - "signature": "let removeItem: (t, string) => unit" - }, - { - "id": "Dom.Storage2.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Dom.Storage2.key", - "kind": "value", - "name": "key", - "docstrings": [], - "signature": "let key: (t, int) => option" - }, - { - "id": "Dom.Storage2.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int" - }, - { - "id": "Dom.Storage2.localStorage", - "kind": "value", - "name": "localStorage", - "docstrings": [], - "signature": "let localStorage: t" - }, - { - "id": "Dom.Storage2.sessionStorage", - "kind": "value", - "name": "sessionStorage", - "docstrings": [], - "signature": "let sessionStorage: t" - } - ] - }, - "dom/storage": { - "id": "Dom.Storage", - "name": "Storage", - "docstrings": [], - "items": [ - { - "id": "Dom.Storage.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Dom_storage2.t" - }, - { - "id": "Dom.Storage.getItem", - "kind": "value", - "name": "getItem", - "docstrings": [], - "signature": "let getItem: (string, t) => option" - }, - { - "id": "Dom.Storage.setItem", - "kind": "value", - "name": "setItem", - "docstrings": [], - "signature": "let setItem: (string, string, t) => unit" - }, - { - "id": "Dom.Storage.removeItem", - "kind": "value", - "name": "removeItem", - "docstrings": [], - "signature": "let removeItem: (string, t) => unit" - }, - { - "id": "Dom.Storage.clear", - "kind": "value", - "name": "clear", - "docstrings": [], - "signature": "let clear: t => unit" - }, - { - "id": "Dom.Storage.key", - "kind": "value", - "name": "key", - "docstrings": [], - "signature": "let key: (int, t) => option" - }, - { - "id": "Dom.Storage.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int" - }, - { - "id": "Dom.Storage.localStorage", - "kind": "value", - "name": "localStorage", - "docstrings": [], - "signature": "let localStorage: t" - }, - { - "id": "Dom.Storage.sessionStorage", - "kind": "value", - "name": "sessionStorage", - "docstrings": [], - "signature": "let sessionStorage: t" - } - ] - } -} diff --git a/apps/docs/markdown-pages/docs/api/js.json b/apps/docs/markdown-pages/docs/api/js.json deleted file mode 100644 index 0428542de..000000000 --- a/apps/docs/markdown-pages/docs/api/js.json +++ /dev/null @@ -1,12644 +0,0 @@ -{ - "js": { - "id": "Js", - "name": "Js", - "docstrings": [ - "The Js module mostly contains ReScript bindings to _standard JavaScript APIs_\nlike [console.log](https://developer.mozilla.org/en-US/docs/Web/API/Console/log),\nor the JavaScript\n[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String),\n[Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date), and\n[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\nclasses.\n\nIt is meant as a zero-abstraction interop layer and directly exposes JavaScript functions as they are. If you can find your API in this module, prefer this over an equivalent Belt helper. For example, prefer [Js.Array2](js/array2) over [Belt.Array](belt/array)\n\n## Argument Order\n\nFor historical reasons, some APIs in the Js namespace (e.g. [Js.String](js/string)) are\nusing the data-last argument order whereas others (e.g. [Js.Date](js/date)) are using data-first.\n\nFor more information about these argument orders and the trade-offs between them, see\n[this blog post](https://www.javierchavarri.com/data-first-and-data-last-a-comparison/).\n\n_Eventually, all modules in the Js namespace are going to be migrated to data-first though._\n\n## Js.Xxx2 Modules\n\nPrefer `Js.Array2` over `Js.Array`, `Js.String2` over `Js.String`, etc. The latters are old modules." - ], - "items": [ - { - "id": "Js.t", - "kind": "type", - "name": "t", - "docstrings": ["JS object type"], - "signature": "type t<'a> = 'a\n constraint 'a = {..}", - "deprecated": "This has been deprecated and will be removed in v13. Use the `{..}` type directly instead." - }, - { - "id": "Js.globalThis", - "kind": "value", - "name": "globalThis", - "docstrings": ["JS global object reference"], - "signature": "let globalThis: t<{..}>", - "deprecated": "" - }, - { - "id": "Js.null", - "kind": "type", - "name": "null", - "docstrings": [], - "signature": "@unboxed\ntype null<'a> = Js_null.t<'a> = Value('a) | @as(null) Null", - "deprecated": "" - }, - { - "id": "Js.undefined", - "kind": "type", - "name": "undefined", - "docstrings": [], - "signature": "type undefined<'a> = Js_undefined.t<'a>", - "deprecated": "This has been deprecated and will be removed in v13." - }, - { - "id": "Js.nullable", - "kind": "type", - "name": "nullable", - "docstrings": [], - "signature": "@unboxed\ntype nullable<'a> = Js_null_undefined.t<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined", - "deprecated": "" - }, - { - "id": "Js.null_undefined", - "kind": "type", - "name": "null_undefined", - "docstrings": [], - "signature": "type null_undefined<'a> = nullable<'a>", - "deprecated": "" - }, - { - "id": "Js.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [], - "signature": "let toOption: nullable<'a> => option<'a>" - }, - { - "id": "Js.undefinedToOption", - "kind": "value", - "name": "undefinedToOption", - "docstrings": [], - "signature": "let undefinedToOption: undefined<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.nullToOption", - "kind": "value", - "name": "nullToOption", - "docstrings": [], - "signature": "let nullToOption: null<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [], - "signature": "let isNullable: nullable<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.import", - "kind": "value", - "name": "import", - "docstrings": [], - "signature": "let import: 'a => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.testAny", - "kind": "value", - "name": "testAny", - "docstrings": [ - "The same as {!test} except that it is more permissive on the types of input" - ], - "signature": "let testAny: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.promise", - "kind": "type", - "name": "promise", - "docstrings": [ - "The promise type, defined here for interoperation across packages." - ], - "signature": "type promise<+'a, +'e>", - "deprecated": "This is deprecated and will be removed in v13. Use the `promise` type directly instead." - }, - { - "id": "Js.null", - "kind": "value", - "name": "null", - "docstrings": ["The same as empty in `Js.Null`. Compiles to `null`."], - "signature": "let null: null<'a>", - "deprecated": "" - }, - { - "id": "Js.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The same as empty `Js.Undefined`. Compiles to `undefined`." - ], - "signature": "let undefined: undefined<'a>", - "deprecated": "" - }, - { - "id": "Js.typeof", - "kind": "value", - "name": "typeof", - "docstrings": [ - "`typeof x` will be compiled as `typeof x` in JS. Please consider functions in\n`Js.Types` for a type safe way of reflection." - ], - "signature": "let typeof: 'a => string", - "deprecated": "" - }, - { - "id": "Js.log", - "kind": "value", - "name": "log", - "docstrings": ["Equivalent to console.log any value."], - "signature": "let log: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.log2", - "kind": "value", - "name": "log2", - "docstrings": [], - "signature": "let log2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.log3", - "kind": "value", - "name": "log3", - "docstrings": [], - "signature": "let log3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.log4", - "kind": "value", - "name": "log4", - "docstrings": [], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.logMany", - "kind": "value", - "name": "logMany", - "docstrings": [ - "A convenience function to console.log more than 4 arguments" - ], - "signature": "let logMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.eqNull", - "kind": "value", - "name": "eqNull", - "docstrings": [], - "signature": "let eqNull: ('a, null<'a>) => bool", - "deprecated": "" - }, - { - "id": "Js.eqUndefined", - "kind": "value", - "name": "eqUndefined", - "docstrings": [], - "signature": "let eqUndefined: ('a, undefined<'a>) => bool", - "deprecated": "" - }, - { - "id": "Js.eqNullable", - "kind": "value", - "name": "eqNullable", - "docstrings": [], - "signature": "let eqNullable: ('a, nullable<'a>) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_lt", - "kind": "value", - "name": "unsafe_lt", - "docstrings": [ - "`unsafe_lt(a, b)` will be compiled as `a < b`.\n It is marked as unsafe, since it is impossible\n to give a proper semantics for comparision which applies to any type" - ], - "signature": "let unsafe_lt: ('a, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_le", - "kind": "value", - "name": "unsafe_le", - "docstrings": [ - "`unsafe_le(a, b)` will be compiled as `a <= b`.\n See also `Js.unsafe_lt`." - ], - "signature": "let unsafe_le: ('a, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_gt", - "kind": "value", - "name": "unsafe_gt", - "docstrings": [ - "`unsafe_gt(a, b)` will be compiled as `a > b`.\n See also `Js.unsafe_lt`." - ], - "signature": "let unsafe_gt: ('a, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.unsafe_ge", - "kind": "value", - "name": "unsafe_ge", - "docstrings": [ - "`unsafe_ge(a, b)` will be compiled as `a >= b`.\n See also `Js.unsafe_lt`." - ], - "signature": "let unsafe_ge: ('a, 'a) => bool", - "deprecated": "" - } - ] - }, - "js/typedarray2/dataview": { - "id": "Js.TypedArray2.DataView", - "name": "DataView", - "docstrings": [ - "The DataView view provides a low-level interface for reading and writing\nmultiple number types in an ArrayBuffer irrespective of the platform's endianness.\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)" - ], - "items": [ - { - "id": "Js.TypedArray2.DataView.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Js.TypedArray2.DataView.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array_buffer => t" - }, - { - "id": "Js.TypedArray2.DataView.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.DataView.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [], - "signature": "let fromBufferOffset: (array_buffer, int) => t" - }, - { - "id": "Js.TypedArray2.DataView.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t" - }, - { - "id": "Js.TypedArray2.DataView.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.DataView.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.DataView.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt8", - "kind": "value", - "name": "getInt8", - "docstrings": [], - "signature": "let getInt8: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint8", - "kind": "value", - "name": "getUint8", - "docstrings": [], - "signature": "let getUint8: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt16", - "kind": "value", - "name": "getInt16", - "docstrings": [], - "signature": "let getInt16: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt16LittleEndian", - "kind": "value", - "name": "getInt16LittleEndian", - "docstrings": [], - "signature": "let getInt16LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint16", - "kind": "value", - "name": "getUint16", - "docstrings": [], - "signature": "let getUint16: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint16LittleEndian", - "kind": "value", - "name": "getUint16LittleEndian", - "docstrings": [], - "signature": "let getUint16LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt32", - "kind": "value", - "name": "getInt32", - "docstrings": [], - "signature": "let getInt32: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getInt32LittleEndian", - "kind": "value", - "name": "getInt32LittleEndian", - "docstrings": [], - "signature": "let getInt32LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint32", - "kind": "value", - "name": "getUint32", - "docstrings": [], - "signature": "let getUint32: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getUint32LittleEndian", - "kind": "value", - "name": "getUint32LittleEndian", - "docstrings": [], - "signature": "let getUint32LittleEndian: (t, int) => int" - }, - { - "id": "Js.TypedArray2.DataView.getFloat32", - "kind": "value", - "name": "getFloat32", - "docstrings": [], - "signature": "let getFloat32: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.getFloat32LittleEndian", - "kind": "value", - "name": "getFloat32LittleEndian", - "docstrings": [], - "signature": "let getFloat32LittleEndian: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.getFloat64", - "kind": "value", - "name": "getFloat64", - "docstrings": [], - "signature": "let getFloat64: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.getFloat64LittleEndian", - "kind": "value", - "name": "getFloat64LittleEndian", - "docstrings": [], - "signature": "let getFloat64LittleEndian: (t, int) => float" - }, - { - "id": "Js.TypedArray2.DataView.setInt8", - "kind": "value", - "name": "setInt8", - "docstrings": [], - "signature": "let setInt8: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint8", - "kind": "value", - "name": "setUint8", - "docstrings": [], - "signature": "let setUint8: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt16", - "kind": "value", - "name": "setInt16", - "docstrings": [], - "signature": "let setInt16: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt16LittleEndian", - "kind": "value", - "name": "setInt16LittleEndian", - "docstrings": [], - "signature": "let setInt16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint16", - "kind": "value", - "name": "setUint16", - "docstrings": [], - "signature": "let setUint16: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint16LittleEndian", - "kind": "value", - "name": "setUint16LittleEndian", - "docstrings": [], - "signature": "let setUint16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt32", - "kind": "value", - "name": "setInt32", - "docstrings": [], - "signature": "let setInt32: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setInt32LittleEndian", - "kind": "value", - "name": "setInt32LittleEndian", - "docstrings": [], - "signature": "let setInt32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint32", - "kind": "value", - "name": "setUint32", - "docstrings": [], - "signature": "let setUint32: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setUint32LittleEndian", - "kind": "value", - "name": "setUint32LittleEndian", - "docstrings": [], - "signature": "let setUint32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat32", - "kind": "value", - "name": "setFloat32", - "docstrings": [], - "signature": "let setFloat32: (t, int, float) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat32LittleEndian", - "kind": "value", - "name": "setFloat32LittleEndian", - "docstrings": [], - "signature": "let setFloat32LittleEndian: (t, int, float) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat64", - "kind": "value", - "name": "setFloat64", - "docstrings": [], - "signature": "let setFloat64: (t, int, float) => unit" - }, - { - "id": "Js.TypedArray2.DataView.setFloat64LittleEndian", - "kind": "value", - "name": "setFloat64LittleEndian", - "docstrings": [], - "signature": "let setFloat64LittleEndian: (t, int, float) => unit" - } - ] - }, - "js/typedarray2/float64array": { - "id": "Js.TypedArray2.Float64Array", - "name": "Float64Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Float64Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [""], - "signature": "type elt = float" - }, - { - "id": "Js.TypedArray2.Float64Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Float64Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Float64Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Float64Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Float64Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Float64Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Float64Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Float64Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.slice", - "kind": "value", - "name": "slice", - "docstrings": ["`start` is inclusive, `end_` exclusive"], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": ["`start` is inclusive, `end_` exclusive"], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": ["can throw"], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float64Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/float32array": { - "id": "Js.TypedArray2.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Float32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [""], - "signature": "type elt = float" - }, - { - "id": "Js.TypedArray2.Float32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Float32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Float32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Float32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Float32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Float32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Float32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Float32Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": ["`start` is inclusive, `end_` exclusive"], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": ["`start` is inclusive, `end_` exclusive"], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": ["can throw"], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Float32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/uint32array": { - "id": "Js.TypedArray2.Uint32Array", - "name": "Uint32Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [""], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint32Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": ["`start` is inclusive, `end_` exclusive"], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": ["`start` is inclusive, `end_` exclusive"], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": ["can throw"], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/int32array": { - "id": "Js.TypedArray2.Int32Array", - "name": "Int32Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Int32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [""], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Int32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Int32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Int32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Int32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Int32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Int32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Int32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Int32Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": ["`start` is inclusive, `end_` exclusive"], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": ["`start` is inclusive, `end_` exclusive"], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": ["can throw"], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/uint16array": { - "id": "Js.TypedArray2.Uint16Array", - "name": "Uint16Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [""], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": ["`start` is inclusive, `end_` exclusive"], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": ["`start` is inclusive, `end_` exclusive"], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string" - }, - { - "id": "Js.TypedArray2.Uint16Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t" - }, - { - "id": "Js.TypedArray2.Uint16Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t" - }, - { - "id": "Js.TypedArray2.Uint16Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t" - }, - { - "id": "Js.TypedArray2.Uint16Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int" - }, - { - "id": "Js.TypedArray2.Uint16Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit" - }, - { - "id": "Js.TypedArray2.Uint16Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>" - }, - { - "id": "Js.TypedArray2.Uint16Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b" - }, - { - "id": "Js.TypedArray2.Uint16Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b" - }, - { - "id": "Js.TypedArray2.Uint16Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b" - }, - { - "id": "Js.TypedArray2.Uint16Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool" - }, - { - "id": "Js.TypedArray2.Uint16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": ["can throw"], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/int16array": { - "id": "Js.TypedArray2.Int16Array", - "name": "Int16Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Int16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [""], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Int16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Int16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Int16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Int16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Int16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Int16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Int16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Int16Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": ["`start` is inclusive, `end_` exclusive"], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": ["`start` is inclusive, `end_` exclusive"], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int" - }, - { - "id": "Js.TypedArray2.Int16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": ["can throw"], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t" - }, - { - "id": "Js.TypedArray2.Int16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t" - }, - { - "id": "Js.TypedArray2.Int16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t" - } - ] - }, - "js/typedarray2/uint8clampedarray": { - "id": "Js.TypedArray2.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint8ClampedArray.elt", - "kind": "type", - "name": "elt", - "docstrings": [""], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.slice", - "kind": "value", - "name": "slice", - "docstrings": ["`start` is inclusive, `end_` exclusive"], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.subarray", - "kind": "value", - "name": "subarray", - "docstrings": ["`start` is inclusive, `end_` exclusive"], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": ["can throw"], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8ClampedArray.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/uint8array": { - "id": "Js.TypedArray2.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Uint8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [""], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Uint8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Uint8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Uint8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Uint8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Uint8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Uint8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Uint8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Uint8Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t" - }, - { - "id": "Js.TypedArray2.Uint8Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": ["`start` is inclusive, `end_` exclusive"], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": ["`start` is inclusive, `end_` exclusive"], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": ["can throw"], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Uint8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/int8array": { - "id": "Js.TypedArray2.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ - { - "id": "Js.TypedArray2.Int8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [""], - "signature": "type elt = int" - }, - { - "id": "Js.TypedArray2.Int8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.TypedArray2.Int8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.TypedArray2.Int8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.TypedArray2.Int8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.TypedArray2.Int8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.TypedArray2.Int8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.Int8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.TypedArray2.Int8Array.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [], - "signature": "let setArray: (t, array) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.setArrayOffset", - "kind": "value", - "name": "setArrayOffset", - "docstrings": [], - "signature": "let setArrayOffset: (t, array, int) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (t, ~to_: int, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (t, ~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: (t, elt) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: (t, elt, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: (t, elt, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [], - "signature": "let reverseInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [], - "signature": "let sortInPlace: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (t, (elt, elt) => int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, elt) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t, string) => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, elt) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, elt, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": ["`start` is inclusive, `end_` exclusive"], - "signature": "let slice: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": ["`start` is inclusive, `end_` exclusive"], - "signature": "let subarray: (t, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.subarrayFrom", - "kind": "value", - "name": "subarrayFrom", - "docstrings": [], - "signature": "let subarrayFrom: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t, elt => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (t, (elt, int) => bool) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t, elt => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t, elt => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (t, (elt, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t, elt => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (t, (elt, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t, elt => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (t, (elt, int) => 'b) => typed_array<'b>", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t, ('b, elt) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t, elt => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (t, (elt, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": ["can throw"], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.TypedArray2.Int8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.Int8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typedarray2/arraybuffer": { - "id": "Js.TypedArray2.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [ - "The underlying buffer that the typed arrays provide views of\n\n **see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)" - ], - "items": [ - { - "id": "Js.TypedArray2.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = array_buffer" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.make", - "kind": "value", - "name": "make", - "docstrings": ["takes length. initializes elements to 0"], - "signature": "let make: int => t" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (t, ~start: int, ~end_: int) => array_buffer", - "deprecated": "" - }, - { - "id": "Js.TypedArray2.ArrayBuffer.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (t, int) => array_buffer", - "deprecated": "" - } - ] - }, - "js/typed_array/dataview": { - "id": "Js.Typed_array.DataView", - "name": "DataView", - "docstrings": [ - "The DataView view provides a low-level interface for reading and writing\nmultiple number types in an ArrayBuffer irrespective of the platform's endianness.\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)" - ], - "items": [ - { - "id": "Js.Typed_array.DataView.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Js_typed_array2.DataView.t" - }, - { - "id": "Js.Typed_array.DataView.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array_buffer => t" - }, - { - "id": "Js.Typed_array.DataView.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.DataView.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [], - "signature": "let fromBufferOffset: (array_buffer, int) => t" - }, - { - "id": "Js.Typed_array.DataView.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t" - }, - { - "id": "Js.Typed_array.DataView.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.DataView.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.DataView.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.DataView.getInt8", - "kind": "value", - "name": "getInt8", - "docstrings": [], - "signature": "let getInt8: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint8", - "kind": "value", - "name": "getUint8", - "docstrings": [], - "signature": "let getUint8: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt16", - "kind": "value", - "name": "getInt16", - "docstrings": [], - "signature": "let getInt16: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt16LittleEndian", - "kind": "value", - "name": "getInt16LittleEndian", - "docstrings": [], - "signature": "let getInt16LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint16", - "kind": "value", - "name": "getUint16", - "docstrings": [], - "signature": "let getUint16: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint16LittleEndian", - "kind": "value", - "name": "getUint16LittleEndian", - "docstrings": [], - "signature": "let getUint16LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt32", - "kind": "value", - "name": "getInt32", - "docstrings": [], - "signature": "let getInt32: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getInt32LittleEndian", - "kind": "value", - "name": "getInt32LittleEndian", - "docstrings": [], - "signature": "let getInt32LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint32", - "kind": "value", - "name": "getUint32", - "docstrings": [], - "signature": "let getUint32: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getUint32LittleEndian", - "kind": "value", - "name": "getUint32LittleEndian", - "docstrings": [], - "signature": "let getUint32LittleEndian: (t, int) => int" - }, - { - "id": "Js.Typed_array.DataView.getFloat32", - "kind": "value", - "name": "getFloat32", - "docstrings": [], - "signature": "let getFloat32: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.getFloat32LittleEndian", - "kind": "value", - "name": "getFloat32LittleEndian", - "docstrings": [], - "signature": "let getFloat32LittleEndian: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.getFloat64", - "kind": "value", - "name": "getFloat64", - "docstrings": [], - "signature": "let getFloat64: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.getFloat64LittleEndian", - "kind": "value", - "name": "getFloat64LittleEndian", - "docstrings": [], - "signature": "let getFloat64LittleEndian: (t, int) => float" - }, - { - "id": "Js.Typed_array.DataView.setInt8", - "kind": "value", - "name": "setInt8", - "docstrings": [], - "signature": "let setInt8: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint8", - "kind": "value", - "name": "setUint8", - "docstrings": [], - "signature": "let setUint8: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt16", - "kind": "value", - "name": "setInt16", - "docstrings": [], - "signature": "let setInt16: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt16LittleEndian", - "kind": "value", - "name": "setInt16LittleEndian", - "docstrings": [], - "signature": "let setInt16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint16", - "kind": "value", - "name": "setUint16", - "docstrings": [], - "signature": "let setUint16: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint16LittleEndian", - "kind": "value", - "name": "setUint16LittleEndian", - "docstrings": [], - "signature": "let setUint16LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt32", - "kind": "value", - "name": "setInt32", - "docstrings": [], - "signature": "let setInt32: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setInt32LittleEndian", - "kind": "value", - "name": "setInt32LittleEndian", - "docstrings": [], - "signature": "let setInt32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint32", - "kind": "value", - "name": "setUint32", - "docstrings": [], - "signature": "let setUint32: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setUint32LittleEndian", - "kind": "value", - "name": "setUint32LittleEndian", - "docstrings": [], - "signature": "let setUint32LittleEndian: (t, int, int) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat32", - "kind": "value", - "name": "setFloat32", - "docstrings": [], - "signature": "let setFloat32: (t, int, float) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat32LittleEndian", - "kind": "value", - "name": "setFloat32LittleEndian", - "docstrings": [], - "signature": "let setFloat32LittleEndian: (t, int, float) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat64", - "kind": "value", - "name": "setFloat64", - "docstrings": [], - "signature": "let setFloat64: (t, int, float) => unit" - }, - { - "id": "Js.Typed_array.DataView.setFloat64LittleEndian", - "kind": "value", - "name": "setFloat64LittleEndian", - "docstrings": [], - "signature": "let setFloat64LittleEndian: (t, int, float) => unit" - } - ] - }, - "js/typed_array/float64_array": { - "id": "Js.Typed_array.Float64_array", - "name": "Float64_array", - "docstrings": [], - "items": [] - }, - "js/typed_array/float64array": { - "id": "Js.Typed_array.Float64Array", - "name": "Float64Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Float64Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [""], - "signature": "type elt = float" - }, - { - "id": "Js.Typed_array.Float64Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Float64Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Float64Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Float64Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Float64Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Float64Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Float64Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Float64Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Float64Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": ["can throw"], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float64Array.create", - "kind": "value", - "name": "create", - "docstrings": [], - "signature": "let create: array => t", - "deprecated": "use `make` instead" - }, - { - "id": "Js.Typed_array.Float64Array.of_buffer", - "kind": "value", - "name": "of_buffer", - "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" - } - ] - }, - "js/typed_array/float32_array": { - "id": "Js.Typed_array.Float32_array", - "name": "Float32_array", - "docstrings": [], - "items": [] - }, - "js/typed_array/float32array": { - "id": "Js.Typed_array.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Float32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [""], - "signature": "type elt = float" - }, - { - "id": "Js.Typed_array.Float32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Float32Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Float32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Float32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Float32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Float32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Float32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Float32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Float32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": ["can throw"], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Float32Array.create", - "kind": "value", - "name": "create", - "docstrings": [], - "signature": "let create: array => t", - "deprecated": "use `make` instead" - }, - { - "id": "Js.Typed_array.Float32Array.of_buffer", - "kind": "value", - "name": "of_buffer", - "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" - } - ] - }, - "js/typed_array/uint32array": { - "id": "Js.Typed_array.Uint32Array", - "name": "Uint32Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [""], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint32Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": ["can throw"], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/int32_array": { - "id": "Js.Typed_array.Int32_array", - "name": "Int32_array", - "docstrings": [], - "items": [] - }, - "js/typed_array/int32array": { - "id": "Js.Typed_array.Int32Array", - "name": "Int32Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Int32Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [""], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Int32Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int32Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Int32Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Int32Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Int32Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Int32Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Int32Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Int32Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Int32Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": ["can throw"], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int32Array.create", - "kind": "value", - "name": "create", - "docstrings": [], - "signature": "let create: array => t", - "deprecated": "use `make` instead" - }, - { - "id": "Js.Typed_array.Int32Array.of_buffer", - "kind": "value", - "name": "of_buffer", - "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" - } - ] - }, - "js/typed_array/uint16array": { - "id": "Js.Typed_array.Uint16Array", - "name": "Uint16Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [""], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint16Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": ["can throw"], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/int16array": { - "id": "Js.Typed_array.Int16Array", - "name": "Int16Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Int16Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [""], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Int16Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int16Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Int16Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Int16Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Int16Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Int16Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Int16Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Int16Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Int16Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": ["can throw"], - "signature": "let fromBuffer: array_buffer => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int16Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/uint8clampedarray": { - "id": "Js.Typed_array.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint8ClampedArray.elt", - "kind": "type", - "name": "elt", - "docstrings": [""], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint8ClampedArray.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": ["can throw"], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8ClampedArray.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/uint8array": { - "id": "Js.Typed_array.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Uint8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [""], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Uint8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint8Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Uint8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Uint8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Uint8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Uint8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Uint8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Uint8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Uint8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": ["can throw"], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.Uint8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "**throw** Js.Exn.Error throw Js exception\n\n **param** offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "**throw** Js.Exn.Error throws Js exception\n\n **param** offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Uint8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/int8array": { - "id": "Js.Typed_array.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Int8Array.elt", - "kind": "type", - "name": "elt", - "docstrings": [""], - "signature": "type elt = int" - }, - { - "id": "Js.Typed_array.Int8Array.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int8Array.typed_array<'a>" - }, - { - "id": "Js.Typed_array.Int8Array.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.Int8Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.Int8Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.Int8Array.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.Int8Array.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.Int8Array.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.Int8Array.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int) => t", - "deprecated": "Use `TypedArray.slice` instead." - }, - { - "id": "Js.Typed_array.Int8Array.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (~start: int, ~end_: int) => t", - "deprecated": "Use `TypedArray.sliceToEnd` instead." - }, - { - "id": "Js.Typed_array.Int8Array._BYTES_PER_ELEMENT", - "kind": "value", - "name": "_BYTES_PER_ELEMENT", - "docstrings": [], - "signature": "let _BYTES_PER_ELEMENT: int", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: array => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": ["can throw"], - "signature": "let fromBuffer: array_buffer => t" - }, - { - "id": "Js.Typed_array.Int8Array.fromBufferOffset", - "kind": "value", - "name": "fromBufferOffset", - "docstrings": [ - "throw Js.Exn.Error throw Js exception\n\n param offset is in bytes" - ], - "signature": "let fromBufferOffset: (array_buffer, int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.fromBufferRange", - "kind": "value", - "name": "fromBufferRange", - "docstrings": [ - "throw Js.Exn.Error throws Js exception\n\n param offset is in bytes, length in elements" - ], - "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [], - "signature": "let fromLength: int => t", - "deprecated": "" - }, - { - "id": "Js.Typed_array.Int8Array.from", - "kind": "value", - "name": "from", - "docstrings": [], - "signature": "let from: array_like => t", - "deprecated": "" - } - ] - }, - "js/typed_array/s": { - "id": "Js.Typed_array.S", - "name": "S", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.S.elt", - "kind": "type", - "name": "elt", - "docstrings": [], - "signature": "type elt" - }, - { - "id": "Js.Typed_array.S.typed_array", - "kind": "type", - "name": "typed_array", - "docstrings": [], - "signature": "type typed_array<'a>" - }, - { - "id": "Js.Typed_array.S.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = typed_array" - }, - { - "id": "Js.Typed_array.S.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t, int) => elt" - }, - { - "id": "Js.Typed_array.S.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [], - "signature": "let unsafe_set: (t, int, elt) => unit" - }, - { - "id": "Js.Typed_array.S.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t => array_buffer" - }, - { - "id": "Js.Typed_array.S.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - }, - { - "id": "Js.Typed_array.S.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t => int" - }, - { - "id": "Js.Typed_array.S.length", - "kind": "value", - "name": "length", - "docstrings": [], - "signature": "let length: t => int" - }, - { - "id": "Js.Typed_array.S.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t" - }, - { - "id": "Js.Typed_array.S.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: elt => bool", - "deprecated": "" - }, - { - "id": "Js.Typed_array.S.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "should we use `bool` or `boolean` seems they are intechangeable here" - ], - "signature": "let filter: (elt => bool) => t" - } - ] - }, - "js/typed_array/arraybuffer": { - "id": "Js.Typed_array.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [ - "The underlying buffer that the typed arrays provide views of\n\n **see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)" - ], - "items": [ - { - "id": "Js.Typed_array.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = array_buffer" - }, - { - "id": "Js.Typed_array.ArrayBuffer.make", - "kind": "value", - "name": "make", - "docstrings": ["takes length. initializes elements to 0"], - "signature": "let make: int => t" - }, - { - "id": "Js.Typed_array.ArrayBuffer.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" - } - ] - }, - "js/typed_array/type": { - "id": "Js.Typed_array.Type", - "name": "Type", - "docstrings": [], - "items": [ - { - "id": "Js.Typed_array.Type.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - } - ] - }, - "js/json/kind": { - "id": "Js.Json.Kind", - "name": "Kind", - "docstrings": [], - "items": [ - { - "id": "Js.Json.Kind.json", - "kind": "type", - "name": "json", - "docstrings": [], - "signature": "type json = t" - }, - { - "id": "Js.Json.Kind.t", - "kind": "type", - "name": "t", - "docstrings": ["Underlying type of a JSON value"], - "signature": "type t<_> =\n | String: t\n | Number: t\n | Object: t>\n | Array: t>\n | Boolean: t\n | Null: t" - } - ] - }, - "js/weakmap": { - "id": "Js.WeakMap", - "name": "WeakMap", - "docstrings": ["Provides bindings for ES6 WeakMap", "ES6 WeakMap API"], - "items": [ - { - "id": "Js.WeakMap.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v> = WeakMap.t<'k, 'v>", - "deprecated": "" - } - ] - }, - "js/map": { - "id": "Js.Map", - "name": "Map", - "docstrings": ["Provides bindings for ES6 Map", "ES6 Map API"], - "items": [ - { - "id": "Js.Map.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v> = Map.t<'k, 'v>", - "deprecated": "" - } - ] - }, - "js/weakset": { - "id": "Js.WeakSet", - "name": "WeakSet", - "docstrings": ["Provides bindings for ES6 WeakSet", "ES6 WeakSet API"], - "items": [ - { - "id": "Js.WeakSet.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = WeakSet.t<'a>", - "deprecated": "" - } - ] - }, - "js/set": { - "id": "Js.Set", - "name": "Set", - "docstrings": ["Provides bindings for ES6 Set", "ES6 Set API"], - "items": [ - { - "id": "Js.Set.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = Set.t<'a>", - "deprecated": "" - } - ] - }, - "js/console": { - "id": "Js.Console", - "name": "Console", - "docstrings": ["Provides bindings for console"], - "items": [ - { - "id": "Js.Console.log", - "kind": "value", - "name": "log", - "docstrings": [], - "signature": "let log: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.log2", - "kind": "value", - "name": "log2", - "docstrings": [], - "signature": "let log2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.log3", - "kind": "value", - "name": "log3", - "docstrings": [], - "signature": "let log3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.log4", - "kind": "value", - "name": "log4", - "docstrings": [], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.logMany", - "kind": "value", - "name": "logMany", - "docstrings": [], - "signature": "let logMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info", - "kind": "value", - "name": "info", - "docstrings": [], - "signature": "let info: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info2", - "kind": "value", - "name": "info2", - "docstrings": [], - "signature": "let info2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info3", - "kind": "value", - "name": "info3", - "docstrings": [], - "signature": "let info3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.info4", - "kind": "value", - "name": "info4", - "docstrings": [], - "signature": "let info4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.infoMany", - "kind": "value", - "name": "infoMany", - "docstrings": [], - "signature": "let infoMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn", - "kind": "value", - "name": "warn", - "docstrings": [], - "signature": "let warn: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn2", - "kind": "value", - "name": "warn2", - "docstrings": [], - "signature": "let warn2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn3", - "kind": "value", - "name": "warn3", - "docstrings": [], - "signature": "let warn3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warn4", - "kind": "value", - "name": "warn4", - "docstrings": [], - "signature": "let warn4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.warnMany", - "kind": "value", - "name": "warnMany", - "docstrings": [], - "signature": "let warnMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error", - "kind": "value", - "name": "error", - "docstrings": [], - "signature": "let error: 'a => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error2", - "kind": "value", - "name": "error2", - "docstrings": [], - "signature": "let error2: ('a, 'b) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error3", - "kind": "value", - "name": "error3", - "docstrings": [], - "signature": "let error3: ('a, 'b, 'c) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.error4", - "kind": "value", - "name": "error4", - "docstrings": [], - "signature": "let error4: ('a, 'b, 'c, 'd) => unit", - "deprecated": "" - }, - { - "id": "Js.Console.errorMany", - "kind": "value", - "name": "errorMany", - "docstrings": [], - "signature": "let errorMany: array<'a> => unit", - "deprecated": "" - }, - { - "id": "Js.Console.trace", - "kind": "value", - "name": "trace", - "docstrings": [], - "signature": "let trace: unit => unit", - "deprecated": "" - }, - { - "id": "Js.Console.timeStart", - "kind": "value", - "name": "timeStart", - "docstrings": [], - "signature": "let timeStart: string => unit", - "deprecated": "" - }, - { - "id": "Js.Console.timeEnd", - "kind": "value", - "name": "timeEnd", - "docstrings": [], - "signature": "let timeEnd: string => unit", - "deprecated": "" - }, - { - "id": "Js.Console.table", - "kind": "value", - "name": "table", - "docstrings": [], - "signature": "let table: 'a => unit", - "deprecated": "" - } - ] - }, - "js/result": { - "id": "Js.Result", - "name": "Result", - "docstrings": ["Define the interface for result"], - "items": [ - { - "id": "Js.Result.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'good, 'bad> = Ok('good) | Error('bad)", - "deprecated": "" - } - ] - }, - "js/option": { - "id": "Js.Option", - "name": "Option", - "docstrings": ["Provide utilities for option"], - "items": [ - { - "id": "Js.Option.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = option<'a>", - "deprecated": "" - }, - { - "id": "Js.Option.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: 'a => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Option.isSome", - "kind": "value", - "name": "isSome", - "docstrings": [], - "signature": "let isSome: option<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Option.isSomeValue", - "kind": "value", - "name": "isSomeValue", - "docstrings": [], - "signature": "let isSomeValue: (('a, 'a) => bool, 'a, option<'a>) => bool", - "deprecated": "Use `Option.equal` instead." - }, - { - "id": "Js.Option.isNone", - "kind": "value", - "name": "isNone", - "docstrings": [], - "signature": "let isNone: option<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Option.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: option<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Option.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (('a, 'b) => bool, option<'a>, option<'b>) => bool", - "deprecated": "" - }, - { - "id": "Js.Option.andThen", - "kind": "value", - "name": "andThen", - "docstrings": [], - "signature": "let andThen: ('a => option<'b>, option<'a>) => option<'b>", - "deprecated": "" - }, - { - "id": "Js.Option.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: ('a => 'b, option<'a>) => option<'b>", - "deprecated": "" - }, - { - "id": "Js.Option.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: ('a, option<'a>) => 'a", - "deprecated": "" - }, - { - "id": "Js.Option.default", - "kind": "value", - "name": "default", - "docstrings": [], - "signature": "let default: ('a, option<'a>) => 'a", - "deprecated": "" - }, - { - "id": "Js.Option.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: ('a => bool, option<'a>) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Option.firstSome", - "kind": "value", - "name": "firstSome", - "docstrings": [], - "signature": "let firstSome: (option<'a>, option<'a>) => option<'a>", - "deprecated": "" - } - ] - }, - "js/blob": { - "id": "Js.Blob", - "name": "Blob", - "docstrings": ["Provide utilities for Blob", "JavaScript Blob API"], - "items": [ - { - "id": "Js.Blob.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - } - ] - }, - "js/file": { - "id": "Js.File", - "name": "File", - "docstrings": ["Provide utilities for File", "JavaScript File API"], - "items": [ - { - "id": "Js.File.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - } - ] - }, - "js/bigint": { - "id": "Js.BigInt", - "name": "BigInt", - "docstrings": ["Provide utilities for bigint", "JavaScript BigInt API"], - "items": [ - { - "id": "Js.BigInt.fromStringExn", - "kind": "value", - "name": "fromStringExn", - "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Return the\nnumber as a `bigint` if successfully parsed. Uncaught syntax exception otherwise.\n\n## Examples\n\n```rescript\n/* returns 123n */\nJs.BigInt.fromStringExn(\"123\")\n\n/* returns 0n */\nJs.BigInt.fromStringExn(\"\")\n\n/* returns 17n */\nJs.BigInt.fromStringExn(\"0x11\")\n\n/* returns 3n */\nJs.BigInt.fromStringExn(\"0b11\")\n\n/* returns 9n */\nJs.BigInt.fromStringExn(\"0o11\")\n\n/* catch exception */\ntry {\n Js.BigInt.fromStringExn(\"a\")\n} catch {\n| _ => Console.error(\"Error parsing bigint\")\n}\n```" - ], - "signature": "let fromStringExn: string => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.~-", - "kind": "value", - "name": "~-", - "docstrings": [], - "signature": "let ~-: bigint => bigint" - }, - { - "id": "Js.BigInt.~+", - "kind": "value", - "name": "~+", - "docstrings": [], - "signature": "let ~+: bigint => bigint" - }, - { - "id": "Js.BigInt.+", - "kind": "value", - "name": "+", - "docstrings": [], - "signature": "let +: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.-", - "kind": "value", - "name": "-", - "docstrings": [], - "signature": "let -: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.*", - "kind": "value", - "name": "*", - "docstrings": [], - "signature": "let *: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt./", - "kind": "value", - "name": "/", - "docstrings": [], - "signature": "let /: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.mod", - "kind": "value", - "name": "mod", - "docstrings": [], - "signature": "let mod: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.**", - "kind": "value", - "name": "**", - "docstrings": [], - "signature": "let **: (bigint, bigint) => bigint" - }, - { - "id": "Js.BigInt.land", - "kind": "value", - "name": "land", - "docstrings": [], - "signature": "let land: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lor", - "kind": "value", - "name": "lor", - "docstrings": [], - "signature": "let lor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lxor", - "kind": "value", - "name": "lxor", - "docstrings": [], - "signature": "let lxor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lnot", - "kind": "value", - "name": "lnot", - "docstrings": [], - "signature": "let lnot: bigint => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.lsl", - "kind": "value", - "name": "lsl", - "docstrings": [], - "signature": "let lsl: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.asr", - "kind": "value", - "name": "asr", - "docstrings": [], - "signature": "let asr: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Js.BigInt.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats a `bigint` as a string. Return a `string` representing the given value.\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123\" */\nJs.BigInt.toString(123n)->Js.log\n```" - ], - "signature": "let toString: bigint => string", - "deprecated": "" - }, - { - "id": "Js.BigInt.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Returns a string with a language-sensitive representation of this BigInt value.\n\n## Examples\n\n```rescript\n/* prints \"123\" */\nJs.BigInt.toString(123n)->Js.log\n```" - ], - "signature": "let toLocaleString: bigint => string", - "deprecated": "" - } - ] - }, - "js/int": { - "id": "Js.Int", - "name": "Int", - "docstrings": [ - "Provide utilities for int", - "Provide utilities for handling `int`." - ], - "items": [ - { - "id": "Js.Int.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "Formats an `int` using exponential (scientific) notation.\nReturns a `string` representing the given value in exponential notation.\nThrows `RangeError` if digits is not in the range \\[0, 20\\] (inclusive).\n\nSee [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.7e+1\" */\nJs.log(Js.Int.toExponential(77))\n```" - ], - "signature": "let toExponential: int => string", - "deprecated": "" - }, - { - "id": "Js.Int.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "Formats an `int` using exponential (scientific) notation.\n`digits` specifies how many digits should appear after the decimal point. The value must be in the range \\[0, 20\\] (inclusive).\n\nReturns a `string` representing the given value in exponential notation.\n\nThe output will be rounded or padded with zeroes if necessary.\nThrows `RangeError` if `digits` is not in the range \\[0, 20\\] (inclusive).\n\nSee [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.70e+1\" */\nJs.log(Js.Int.toExponentialWithPrecision(77, ~digits=2))\n\n/* prints \"5.68e+3\" */\nJs.log(Js.Int.toExponentialWithPrecision(5678, ~digits=2))\n```" - ], - "signature": "let toExponentialWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Int.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "Formats an `int` using some fairly arbitrary rules.\nReturns a `string` representing the given value in fixed-point (usually).\n\n`toPrecision` differs from `toFixed` in that the former will format the number with full precision, while the latter will not output any digits after the decimal point.\nThrows `RangeError` if `digits` is not in the range accepted by this function.\n\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123456789\" */\nJs.log(Js.Int.toPrecision(123456789))\n```" - ], - "signature": "let toPrecision: int => string", - "deprecated": "" - }, - { - "id": "Js.Int.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "Formats an `int` using some fairly arbitrary rules.\n`digits` specifies how many digits should appear in total. The value must between 0 and some arbitrary number that's hopefully at least larger than 20 (for Node it's 21. Why? Who knows).\n\nReturns a `string` representing the given value in fixed-point or scientific notation.\n\nThe output will be rounded or padded with zeroes if necessary.\n\n`toPrecisionWithPrecision` differs from `toFixedWithPrecision` in that the former will count all digits against the precision, while the latter will count only the digits after the decimal point.\n`toPrecisionWithPrecision` will also use scientific notation if the specified precision is less than the number of digits before the decimal point.\nThrows `RangeError` if `digits` is not in the range accepted by this function.\n\n\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"1.2e+8\" */\nJs.log(Js.Int.toPrecisionWithPrecision(123456789, ~digits=2))\n\n/* prints \"0.0\" */\nJs.log(Js.Int.toPrecisionWithPrecision(0, ~digits=2))\n```" - ], - "signature": "let toPrecisionWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Int.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats an `int` as a `string`. Returns a `string` representing the given value\nin fixed-point (usually).\n\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123456789\" */\nJs.log(Js.Int.toString(123456789))\n```" - ], - "signature": "let toString: int => string", - "deprecated": "" - }, - { - "id": "Js.Int.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "Formats an `int` as a `string`. `radix` specifies the radix base to use for the\nformatted number. The value must be in the range \\[2, 36\\] (inclusive). Returns\na `string` representing the given value in fixed-point (usually). Throws\n`RangeError` if `radix` is not in the range \\[2, 36\\] (inclusive).\n\n\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"110\" */\nJs.log(Js.Int.toStringWithRadix(6, ~radix=2))\n\n/* prints \"deadbeef\" */\nJs.log(Js.Int.toStringWithRadix(3735928559, ~radix=16))\n\n/* prints \"2n9c\" */\nJs.log(Js.Int.toStringWithRadix(123456, ~radix=36))\n```" - ], - "signature": "let toStringWithRadix: (int, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Js.Int.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [], - "signature": "let toFloat: int => float", - "deprecated": "" - }, - { - "id": "Js.Int.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (int, int) => bool", - "deprecated": "" - }, - { - "id": "Js.Int.max", - "kind": "value", - "name": "max", - "docstrings": [], - "signature": "let max: int" - }, - { - "id": "Js.Int.min", - "kind": "value", - "name": "min", - "docstrings": [], - "signature": "let min: int" - } - ] - }, - "js/float": { - "id": "Js.Float", - "name": "Float", - "docstrings": [ - "Provide utilities for JS float", - "Provide utilities for JS float." - ], - "items": [ - { - "id": "Js.Float._NaN", - "kind": "value", - "name": "_NaN", - "docstrings": [ - "The special value \"Not a Number\". See [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN) on MDN." - ], - "signature": "let _NaN: float", - "deprecated": "" - }, - { - "id": "Js.Float.isNaN", - "kind": "value", - "name": "isNaN", - "docstrings": [ - "Tests if the given value is `_NaN`\n\nNote that both `_NaN = _NaN` and `_NaN == _NaN` will return `false`. `isNaN` is\ntherefore necessary to test for `_NaN`. Return `true` if the given value is\n`_NaN`, `false` otherwise. See [`isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) on MDN." - ], - "signature": "let isNaN: float => bool", - "deprecated": "" - }, - { - "id": "Js.Float.isFinite", - "kind": "value", - "name": "isFinite", - "docstrings": [ - "Tests if the given value is finite. Return `true` if the given value is a finite\nnumber, `false` otherwise. See [`isFinite`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite) on MDN.\n\n## Examples\n\n```rescript\n/* returns [false] */\nJs.Float.isFinite(infinity)\n\n/* returns [false] */\nJs.Float.isFinite(neg_infinity)\n\n/* returns [false] */\nJs.Float.isFinite(Js.Float._NaN)\n\n/* returns [true] */\nJs.Float.isFinite(1234.)\n```" - ], - "signature": "let isFinite: float => bool", - "deprecated": "" - }, - { - "id": "Js.Float.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "Formats a `float` using exponential (scientific) notation. Return a\n`string` representing the given value in exponential notation. Throw\nRangeError if digits is not in the range \\[0, 20\\] (inclusive). See [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.71234e+1\" */\nJs.Float.toExponential(77.1234)->Js.log\n\n/* prints \"7.7e+1\" */\nJs.Float.toExponential(77.)->Js.log\n```" - ], - "signature": "let toExponential: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "Formats a `float` using exponential (scientific) notation. `digits` specifies\nhow many digits should appear after the decimal point. The value must be in\nthe range \\[0, 20\\] (inclusive). Return a `string` representing the given value\nin exponential notation. The output will be rounded or padded with zeroes if\nnecessary. Throw RangeError if `digits` is not in the range \\[0, 20\\] (inclusive).\nSee [`toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"7.71e+1\" */\nJs.Float.toExponentialWithPrecision(77.1234, ~digits=2)->Js.log\n```" - ], - "signature": "let toExponentialWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.toFixed", - "kind": "value", - "name": "toFixed", - "docstrings": [ - "Formats a `float` using fixed point notation. Return a `string` representing the\ngiven value in fixed-point notation (usually). Throw RangeError if digits is not\nin the range \\[0, 20\\] (inclusive). See [`toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"12346\" (note the rounding) */\nJs.Float.toFixed(12345.6789)->Js.log\n\n/* print \"1.2e+21\" */\nJs.Float.toFixed(1.2e21)->Js.log\n```" - ], - "signature": "let toFixed: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toFixedWithPrecision", - "kind": "value", - "name": "toFixedWithPrecision", - "docstrings": [ - "Formats a `float` using fixed point notation. `digits` specifies how many digits\nshould appear after the decimal point. The value must be in the range \\[0, 20\\]\n(inclusive). Defaults to `0`. Return a `string` representing the given value in\nfixed-point notation (usually). See [`toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\nThe output will be rounded or padded with zeroes if necessary.\n\nThrow RangeError if digits is not in the range \\[0, 20\\] (inclusive)\n\n## Examples\n\n```rescript\n/* prints \"12345.7\" (note the rounding) */\nJs.Float.toFixedWithPrecision(12345.6789, ~digits=1)->Js.log\n\n/* prints \"0.00\" (note the added zeroes) */\nJs.Float.toFixedWithPrecision(0., ~digits=2)->Js.log\n```" - ], - "signature": "let toFixedWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "Formats a `float` using some fairly arbitrary rules. Return a `string`\nrepresenting the given value in fixed-point (usually). `toPrecision` differs\nfrom `Js.Float.toFixed` in that the former will format the number with full\nprecision, while the latter will not output any digits after the decimal point.\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\nThrow RangeError if digits is not in the range accepted by this function (what do you mean \"vague\"?)\n\n## Examples\n\n```rescript\n/* prints \"12345.6789\" */\nJs.Float.toPrecision(12345.6789)->Js.log\n\n/* print \"1.2e+21\" */\nJs.Float.toPrecision(1.2e21)->Js.log\n```" - ], - "signature": "let toPrecision: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "Formats a `float` using some fairly arbitrary rules. `digits` specifies how many\ndigits should appear in total. The value must between 0 and some arbitrary number\nthat's hopefully at least larger than 20 (for Node it's 21. Why? Who knows).\nSee [`toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\nReturn a `string` representing the given value in fixed-point or scientific\nnotation. The output will be rounded or padded with zeroes if necessary.\n\n`toPrecisionWithPrecision` differs from `toFixedWithPrecision` in that the former\nwill count all digits against the precision, while the latter will count only\nthe digits after the decimal point. `toPrecisionWithPrecision` will also use\nscientific notation if the specified precision is less than the number for digits\nbefore the decimal point.\n\nThrow RangeError if digits is not in the range accepted by this function (what do you mean \"vague\"?)\n\n## Examples\n\n```rescript\n/* prints \"1e+4\" */\nJs.Float.toPrecisionWithPrecision(12345.6789, ~digits=1)->Js.log\n\n/* prints \"0.0\" */\nJs.Float.toPrecisionWithPrecision(0., ~digits=2)->Js.log\n```" - ], - "signature": "let toPrecisionWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats a `float` as a string. Return a `string` representing the given value in\nfixed-point (usually). See [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"12345.6789\" */\nJs.Float.toString(12345.6789)->Js.log\n```" - ], - "signature": "let toString: float => string", - "deprecated": "" - }, - { - "id": "Js.Float.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "Formats a `float` as a string. `radix` specifies the radix base to use for the\nformatted number. The value must be in the range \\[2, 36\\] (inclusive). Return a\n`string` representing the given value in fixed-point (usually). See [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\nThrow RangeError if radix is not in the range \\[2, 36\\] (inclusive)\n\n## Examples\n\n```rescript\n/* prints \"110\" */\nJs.Float.toStringWithRadix(6., ~radix=2)->Js.log\n\n/* prints \"11.001000111101011100001010001111010111000010100011111\" */\nJs.Float.toStringWithRadix(3.14, ~radix=2)->Js.log\n\n/* prints \"deadbeef\" */\nJs.Float.toStringWithRadix(3735928559., ~radix=16)->Js.log\n\n/* prints \"3f.gez4w97ry0a18ymf6qadcxr\" */\nJs.Float.toStringWithRadix(123.456, ~radix=36)->Js.log\n```" - ], - "signature": "let toStringWithRadix: (float, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Js.Float.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Parses the given `string` into a `float` using JavaScript semantics. Return the\nnumber as a `float` if successfully parsed, `_NaN` otherwise.\n\n## Examples\n\n```rescript\n/* returns 123 */\nJs.Float.fromString(\"123\")\n\n/* returns 12.3 */\nJs.Float.fromString(\"12.3\")\n\n/* returns 0 */\nJs.Float.fromString(\"\")\n\n/* returns 17 */\nJs.Float.fromString(\"0x11\")\n\n/* returns 3 */\nJs.Float.fromString(\"0b11\")\n\n/* returns 9 */\nJs.Float.fromString(\"0o11\")\n\n/* returns [_NaN] */\nJs.Float.fromString(\"hello\")\n\n/* returns [_NaN] */\nJs.Float.fromString(\"100a\")\n```" - ], - "signature": "let fromString: string => float", - "deprecated": "" - } - ] - }, - "js/types": { - "id": "Js.Types", - "name": "Types", - "docstrings": [ - "Provide utilities for manipulating JS types", - "Provide utilities for manipulating JS types." - ], - "items": [ - { - "id": "Js.Types.symbol", - "kind": "type", - "name": "symbol", - "docstrings": ["Js symbol type (only available in ES6)"], - "signature": "type symbol = Symbol.t", - "deprecated": "" - }, - { - "id": "Js.Types.obj_val", - "kind": "type", - "name": "obj_val", - "docstrings": [], - "signature": "type obj_val = \\\"Type.Classify\".object", - "deprecated": "" - }, - { - "id": "Js.Types.undefined_val", - "kind": "type", - "name": "undefined_val", - "docstrings": ["This type has only one value `undefined`"], - "signature": "type undefined_val", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.null_val", - "kind": "type", - "name": "null_val", - "docstrings": ["This type has only one value `null`"], - "signature": "type null_val", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.function_val", - "kind": "type", - "name": "function_val", - "docstrings": [], - "signature": "type function_val = \\\"Type.Classify\".function", - "deprecated": "" - }, - { - "id": "Js.Types.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<_> =\n | Undefined: t\n | Null: t\n | Boolean: t\n | Number: t\n | String: t\n | Function: t\n | Object: t\n | Symbol: t\n | BigInt: t", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.test", - "kind": "value", - "name": "test", - "docstrings": [ - "`test(value, t)` returns `true` if `value` is `typeof t`, otherwise `false`.\nThis is useful for doing runtime reflection on any given value.\n\n## Examples\n\n```rescript\ntest(\"test\", String) == true\ntest(() => true, Function) == true\ntest(\"test\", Boolean) == false\n```" - ], - "signature": "let test: ('a, t<'b>) => bool", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.tagged_t", - "kind": "type", - "name": "tagged_t", - "docstrings": [], - "signature": "type tagged_t =\n | JSFalse\n | JSTrue\n | JSNull\n | JSUndefined\n | JSNumber(float)\n | JSString(string)\n | JSFunction(function_val)\n | JSObject(obj_val)\n | JSSymbol(symbol)\n | JSBigInt(bigint)", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - }, - { - "id": "Js.Types.classify", - "kind": "value", - "name": "classify", - "docstrings": [], - "signature": "let classify: 'a => tagged_t", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `Type` module instead." - } - ] - }, - "js/typedarray2": { - "id": "Js.TypedArray2", - "name": "TypedArray2", - "docstrings": [ - "Provide bindings for JS typed array", - "JavaScript Typed Array API\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)" - ], - "items": [ - { - "id": "Js.TypedArray2.array_buffer", - "kind": "type", - "name": "array_buffer", - "docstrings": [], - "signature": "type array_buffer = ArrayBuffer.t" - }, - { - "id": "Js.TypedArray2.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [], - "signature": "type array_like<'a>" - } - ] - }, - "js/typed_array": { - "id": "Js.Typed_array", - "name": "Typed_array", - "docstrings": [ - "Provide bindings for JS typed array", - "JavaScript Typed Array API\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)" - ], - "items": [ - { - "id": "Js.Typed_array.array_buffer", - "kind": "type", - "name": "array_buffer", - "docstrings": [], - "signature": "type array_buffer = Js_typed_array2.array_buffer", - "deprecated": "" - }, - { - "id": "Js.Typed_array.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [], - "signature": "type array_like<'a> = Js_typed_array2.array_like<'a>", - "deprecated": "This has been deprecated and will be removed in v13. Use functions and types from the `TypedArray` module instead." - } - ] - }, - "js/obj": { - "id": "Js.Obj", - "name": "Obj", - "docstrings": [ - "Provide utilities for `Js.t`", - "Provides functions for inspecting and manipulating native JavaScript objects" - ], - "items": [ - { - "id": "Js.Obj.empty", - "kind": "value", - "name": "empty", - "docstrings": ["`empty()` returns the empty object `{}`"], - "signature": "let empty: unit => {..}", - "deprecated": "" - }, - { - "id": "Js.Obj.assign", - "kind": "value", - "name": "assign", - "docstrings": [ - "`assign(target, source)` copies properties from source to target.\nProperties in `target` will be overwritten by properties in `source` if they have the same key.\nReturns `target`.\n\n**See** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\n\n## Examples\n\n```rescript\n/* Copy an object */\n\nlet obj = {\"a\": 1}\n\nlet copy = Js.Obj.assign(Js.Obj.empty(), obj)\n\n/* prints \"{ a: 1 }\" */\nJs.log(copy)\n\n/* Merge objects with same properties */\n\nlet target = {\"a\": 1, \"b\": 1}\nlet source = {\"b\": 2}\n\nlet obj = Js.Obj.assign(target, source)\n\n/* prints \"{ a: 1, b: 2 }\" */\nJs.log(obj)\n\n/* prints \"{ a: 1, b: 2 }\", target is modified */\nJs.log(target)\n```" - ], - "signature": "let assign: ({..}, {..}) => {..}", - "deprecated": "" - }, - { - "id": "Js.Obj.keys", - "kind": "value", - "name": "keys", - "docstrings": [ - "`keys(obj)` returns an `array` of the keys of `obj`'s own enumerable properties." - ], - "signature": "let keys: {..} => array", - "deprecated": "" - } - ] - }, - "js/math": { - "id": "Js.Math", - "name": "Math", - "docstrings": [ - "Provide bindings for JS `Math` object", - "Provide utilities for JS Math. Note: The constants `_E`, `_LN10`, `_LN2`,\n`_LOG10E`, `_LOG2E`, `_PI`, `_SQRT1_2`, and `_SQRT2` begin with an underscore\nbecause ReScript variable names cannot begin with a capital letter. (Module\nnames begin with upper case.)" - ], - "items": [ - { - "id": "Js.Math._E", - "kind": "value", - "name": "_E", - "docstrings": [ - "Euler's number; ≈ 2.718281828459045. See\n[`Math.E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/E)\non MDN." - ], - "signature": "let _E: float", - "deprecated": "" - }, - { - "id": "Js.Math._LN2", - "kind": "value", - "name": "_LN2", - "docstrings": [ - "Natural logarithm of 2; ≈ 0.6931471805599453. See\n[`Math.LN2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN2)\non MDN." - ], - "signature": "let _LN2: float", - "deprecated": "" - }, - { - "id": "Js.Math._LN10", - "kind": "value", - "name": "_LN10", - "docstrings": [ - "Natural logarithm of 10; ≈ 2.302585092994046. See\n[`Math.LN10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN10)\non MDN." - ], - "signature": "let _LN10: float", - "deprecated": "" - }, - { - "id": "Js.Math._LOG2E", - "kind": "value", - "name": "_LOG2E", - "docstrings": [ - "Base 2 logarithm of E; ≈ 1.4426950408889634. See\n[`Math.LOG2E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG2E)\non MDN." - ], - "signature": "let _LOG2E: float", - "deprecated": "" - }, - { - "id": "Js.Math._LOG10E", - "kind": "value", - "name": "_LOG10E", - "docstrings": [ - "Base 10 logarithm of E; ≈ 0.4342944819032518. See\n[`Math.LOG10E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG10E)\non MDN." - ], - "signature": "let _LOG10E: float", - "deprecated": "" - }, - { - "id": "Js.Math._PI", - "kind": "value", - "name": "_PI", - "docstrings": [ - "Pi - ratio of the circumference to the diameter of a circle; ≈ 3.141592653589793. See\n[`Math.PI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/PI)\non MDN." - ], - "signature": "let _PI: float", - "deprecated": "" - }, - { - "id": "Js.Math._SQRT1_2", - "kind": "value", - "name": "_SQRT1_2", - "docstrings": [ - "Square root of 1/2; ≈ 0.7071067811865476. See\n[`Math.SQRT1_2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2)\non MDN." - ], - "signature": "let _SQRT1_2: float", - "deprecated": "" - }, - { - "id": "Js.Math._SQRT2", - "kind": "value", - "name": "_SQRT2", - "docstrings": [ - "Square root of 2; ≈ 1.4142135623730951. See\n[`Math.SQRT2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT2)\non MDN." - ], - "signature": "let _SQRT2: float", - "deprecated": "" - }, - { - "id": "Js.Math.abs_int", - "kind": "value", - "name": "abs_int", - "docstrings": [ - "Absolute value for integer argument. See\n[`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs)\non MDN." - ], - "signature": "let abs_int: int => int", - "deprecated": "" - }, - { - "id": "Js.Math.abs_float", - "kind": "value", - "name": "abs_float", - "docstrings": [ - "Absolute value for float argument. See\n[`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs)\non MDN." - ], - "signature": "let abs_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.acos", - "kind": "value", - "name": "acos", - "docstrings": [ - "Arccosine (in radians) of argument; returns `NaN` if the argument is outside\nthe range [-1.0, 1.0]. See\n[`Math.acos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acos)\non MDN." - ], - "signature": "let acos: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.acosh", - "kind": "value", - "name": "acosh", - "docstrings": [ - "Hyperbolic arccosine (in radians) of argument; returns `NaN` if the argument\nis less than 1.0. See\n[`Math.acosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acosh)\non MDN." - ], - "signature": "let acosh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.asin", - "kind": "value", - "name": "asin", - "docstrings": [ - "Arcsine (in radians) of argument; returns `NaN` if the argument is outside\nthe range [-1.0, 1.0]. See\n[`Math.asin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asin)\non MDN." - ], - "signature": "let asin: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.asinh", - "kind": "value", - "name": "asinh", - "docstrings": [ - "Hyperbolic arcsine (in radians) of argument. See\n[`Math.asinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh)\non MDN." - ], - "signature": "let asinh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.atan", - "kind": "value", - "name": "atan", - "docstrings": [ - "Arctangent (in radians) of argument. See\n[`Math.atan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan)\non MDN." - ], - "signature": "let atan: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.atanh", - "kind": "value", - "name": "atanh", - "docstrings": [ - "Hyperbolic arctangent (in radians) of argument; returns `NaN` if the argument\nis is outside the range [-1.0, 1.0]. Returns `-Infinity` and `Infinity` for\narguments -1.0 and 1.0. See\n[`Math.atanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh)\non MDN." - ], - "signature": "let atanh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.atan2", - "kind": "value", - "name": "atan2", - "docstrings": [ - "Returns the angle (in radians) of the quotient `y /. x`. It is also the angle\nbetween the *x*\\-axis and point (*x*, *y*). See\n[`Math.atan2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.atan2(~y=0.0, ~x=10.0, ()) == 0.0\nJs.Math.atan2(~x=5.0, ~y=5.0, ()) == Js.Math._PI /. 4.0\nJs.Math.atan2(~x=-5.0, ~y=5.0, ())\nJs.Math.atan2(~x=-5.0, ~y=5.0, ()) == 3.0 *. Js.Math._PI /. 4.0\nJs.Math.atan2(~x=-0.0, ~y=-5.0, ()) == -.Js.Math._PI /. 2.0\n```" - ], - "signature": "let atan2: (~y: float, ~x: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Math.cbrt", - "kind": "value", - "name": "cbrt", - "docstrings": [ - "Cube root. See\n[`Math.cbrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt)\non MDN" - ], - "signature": "let cbrt: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_ceil_int", - "kind": "value", - "name": "unsafe_ceil_int", - "docstrings": [ - "Returns the smallest integer greater than or equal to the argument. This\nfunction may return values not representable by `int`, whose range is\n\\-2147483648 to 2147483647. This is because, in JavaScript, there are only\n64-bit floating point numbers, which can represent integers in the range\n±(253\\-1) exactly. See\n[`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.unsafe_ceil_int(3.1) == 4\nJs.Math.unsafe_ceil_int(3.0) == 3\nJs.Math.unsafe_ceil_int(-3.1) == -3\nJs.Math.unsafe_ceil_int(1.0e15) // result is outside range of int datatype\n```" - ], - "signature": "let unsafe_ceil_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_ceil", - "kind": "value", - "name": "unsafe_ceil", - "docstrings": [], - "signature": "let unsafe_ceil: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.ceil_int", - "kind": "value", - "name": "ceil_int", - "docstrings": [ - "Returns the smallest `int` greater than or equal to the argument; the result\nis pinned to the range of the `int` data type: -2147483648 to 2147483647. See\n[`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.ceil_int(3.1) == 4\nJs.Math.ceil_int(3.0) == 3\nJs.Math.ceil_int(-3.1) == -3\nJs.Math.ceil_int(-1.0e15) == -2147483648\nJs.Math.ceil_int(1.0e15) == 2147483647\n```" - ], - "signature": "let ceil_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.ceil", - "kind": "value", - "name": "ceil", - "docstrings": [], - "signature": "let ceil: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.ceil_float", - "kind": "value", - "name": "ceil_float", - "docstrings": [ - "Returns the smallest integral value greater than or equal to the argument.\nThe result is a `float` and is not restricted to the `int` data type range.\nSee\n[`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.ceil_float(3.1) == 4.0\nJs.Math.ceil_float(3.0) == 3.0\nJs.Math.ceil_float(-3.1) == -3.0\nJs.Math.ceil_float(2_150_000_000.3) == 2_150_000_001.0\n```" - ], - "signature": "let ceil_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.clz32", - "kind": "value", - "name": "clz32", - "docstrings": [ - "Number of leading zero bits of the argument's 32 bit int representation. See\n[`Math.clz32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.clz32(0) == 32\nJs.Math.clz32(-1) == 0\nJs.Math.clz32(255) == 24\n```" - ], - "signature": "let clz32: int => int", - "deprecated": "" - }, - { - "id": "Js.Math.cos", - "kind": "value", - "name": "cos", - "docstrings": [ - "Cosine of argument, which must be specified in radians. See\n[`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos)\non MDN." - ], - "signature": "let cos: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.cosh", - "kind": "value", - "name": "cosh", - "docstrings": [ - "Hyperbolic cosine of argument, which must be specified in radians. See\n[`Math.cosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh)\non MDN." - ], - "signature": "let cosh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.exp", - "kind": "value", - "name": "exp", - "docstrings": [ - "Natural exponentional; returns *e* (the base of natural logarithms) to the\npower of the given argument. See\n[`Math.exp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/exp)\non MDN." - ], - "signature": "let exp: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.expm1", - "kind": "value", - "name": "expm1", - "docstrings": [ - "Returns *e* (the base of natural logarithms) to the power of the given\nargument minus 1. See\n[`Math.expm1`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1)\non MDN." - ], - "signature": "let expm1: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_floor_int", - "kind": "value", - "name": "unsafe_floor_int", - "docstrings": [ - "Returns the largest integer less than or equal to the argument. This function\nmay return values not representable by `int`, whose range is -2147483648 to\n2147483647. This is because, in JavaScript, there are only 64-bit floating\npoint numbers, which can represent integers in the range\n±(253\\-1) exactly. See\n[`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.unsafe_floor_int(3.7) == 3\nJs.Math.unsafe_floor_int(3.0) == 3\nJs.Math.unsafe_floor_int(-3.7) == -4\nJs.Math.unsafe_floor_int(1.0e15) // result is outside range of int datatype\n```" - ], - "signature": "let unsafe_floor_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_floor", - "kind": "value", - "name": "unsafe_floor", - "docstrings": [], - "signature": "let unsafe_floor: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.floor_int", - "kind": "value", - "name": "floor_int", - "docstrings": [ - "Returns the largest `int` less than or equal to the argument; the result is\npinned to the range of the `int` data type: -2147483648 to 2147483647. See\n[`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.floor_int(3.7) == 3\nJs.Math.floor_int(3.0) == 3\nJs.Math.floor_int(-3.1) == -4\nJs.Math.floor_int(-1.0e15) == -2147483648\nJs.Math.floor_int(1.0e15) == 2147483647\n```" - ], - "signature": "let floor_int: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.floor", - "kind": "value", - "name": "floor", - "docstrings": [], - "signature": "let floor: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.floor_float", - "kind": "value", - "name": "floor_float", - "docstrings": [ - "Returns the largest integral value less than or equal to the argument. The\nresult is a `float` and is not restricted to the `int` data type range. See\n[`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.floor_float(3.7) == 3.0\nJs.Math.floor_float(3.0) == 3.0\nJs.Math.floor_float(-3.1) == -4.0\nJs.Math.floor_float(2_150_000_000.3) == 2_150_000_000.0\n```" - ], - "signature": "let floor_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.fround", - "kind": "value", - "name": "fround", - "docstrings": [ - "Round to nearest single precision float. See\n[`Math.fround`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.fround(5.5) == 5.5\nJs.Math.fround(5.05) == 5.050000190734863\n```" - ], - "signature": "let fround: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.hypot", - "kind": "value", - "name": "hypot", - "docstrings": [ - "Returns the square root of the sum of squares of its two arguments (the\nPythagorean formula). See\n[`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot)\non MDN." - ], - "signature": "let hypot: (float, float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.hypotMany", - "kind": "value", - "name": "hypotMany", - "docstrings": [ - "Returns the square root of the sum of squares of the numbers in the array\nargument (generalized Pythagorean equation). Using an array allows you to\nhave more than two items. See\n[`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.hypotMany([3.0, 4.0, 12.0]) == 13.0\n```" - ], - "signature": "let hypotMany: array => float", - "deprecated": "" - }, - { - "id": "Js.Math.imul", - "kind": "value", - "name": "imul", - "docstrings": [ - "32-bit integer multiplication. Use this only when you need to optimize\nperformance of multiplication of numbers stored as 32-bit integers. See\n[`Math.imul`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul)\non MDN." - ], - "signature": "let imul: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.log", - "kind": "value", - "name": "log", - "docstrings": [ - "Returns the natural logarithm of its argument; this is the number *x* such\nthat *e**x* equals the argument. Returns `NaN` for negative\narguments. See\n[`Math.log`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log(Js.Math._E) == 1.0\nJs.Math.log(100.0) == 4.605170185988092\n```" - ], - "signature": "let log: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.log1p", - "kind": "value", - "name": "log1p", - "docstrings": [ - "Returns the natural logarithm of one plus the argument. Returns `NaN` for\narguments less than -1. See\n[`Math.log1p`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log1p)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log1p(Js.Math._E -. 1.0) == 1.0\nJs.Math.log1p(99.0) == 4.605170185988092\n```" - ], - "signature": "let log1p: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.log10", - "kind": "value", - "name": "log10", - "docstrings": [ - "Returns the base 10 logarithm of its argument. Returns `NaN` for negative\narguments. See\n[`Math.log10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log10)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log10(1000.0) == 3.0\nJs.Math.log10(0.01) == -2.0\nJs.Math.log10(Js.Math.sqrt(10.0)) == 0.5\n```" - ], - "signature": "let log10: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.log2", - "kind": "value", - "name": "log2", - "docstrings": [ - "Returns the base 2 logarithm of its argument. Returns `NaN` for negative\narguments. See\n[`Math.log2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.log2(512.0) == 9.0\nJs.Math.log2(0.125) == -3.0\nJs.Math.log2(Js.Math._SQRT2) == 0.5000000000000001 // due to precision\n```" - ], - "signature": "let log2: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.max_int", - "kind": "value", - "name": "max_int", - "docstrings": [ - "Returns the maximum of its two integer arguments. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let max_int: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.maxMany_int", - "kind": "value", - "name": "maxMany_int", - "docstrings": [ - "Returns the maximum of the integers in the given array. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let maxMany_int: array => int", - "deprecated": "" - }, - { - "id": "Js.Math.max_float", - "kind": "value", - "name": "max_float", - "docstrings": [ - "Returns the maximum of its two floating point arguments. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let max_float: (float, float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.maxMany_float", - "kind": "value", - "name": "maxMany_float", - "docstrings": [ - "Returns the maximum of the floating point values in the given array. See\n[`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max)\non MDN." - ], - "signature": "let maxMany_float: array => float", - "deprecated": "" - }, - { - "id": "Js.Math.min_int", - "kind": "value", - "name": "min_int", - "docstrings": [ - "Returns the minimum of its two integer arguments. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let min_int: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.minMany_int", - "kind": "value", - "name": "minMany_int", - "docstrings": [ - "Returns the minimum of the integers in the given array. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let minMany_int: array => int", - "deprecated": "" - }, - { - "id": "Js.Math.min_float", - "kind": "value", - "name": "min_float", - "docstrings": [ - "Returns the minimum of its two floating point arguments. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let min_float: (float, float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.minMany_float", - "kind": "value", - "name": "minMany_float", - "docstrings": [ - "Returns the minimum of the floating point values in the given array. See\n[`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min)\non MDN." - ], - "signature": "let minMany_float: array => float", - "deprecated": "" - }, - { - "id": "Js.Math.pow_int", - "kind": "value", - "name": "pow_int", - "docstrings": [ - "Throws the given base to the given exponent. (Arguments and result are\nintegers.) See\n[`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.pow_int(~base=3, ~exp=4) == 81\n```" - ], - "signature": "let pow_int: (~base: int, ~exp: int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.pow_float", - "kind": "value", - "name": "pow_float", - "docstrings": [ - "Throws the given base to the given exponent. (Arguments and result are\nfloats.) Returns `NaN` if the result would be imaginary. See\n[`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.pow_float(~base=3.0, ~exp=4.0) == 81.0\nJs.Math.pow_float(~base=4.0, ~exp=-2.0) == 0.0625\nJs.Math.pow_float(~base=625.0, ~exp=0.5) == 25.0\nJs.Math.pow_float(~base=625.0, ~exp=-0.5) == 0.04\nJs.Float.isNaN(Js.Math.pow_float(~base=-2.0, ~exp=0.5)) == true\n```" - ], - "signature": "let pow_float: (~base: float, ~exp: float) => float", - "deprecated": "" - }, - { - "id": "Js.Math.random", - "kind": "value", - "name": "random", - "docstrings": [ - "Returns a random number in the half-closed interval [0,1). See\n[`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\non MDN." - ], - "signature": "let random: unit => float", - "deprecated": "" - }, - { - "id": "Js.Math.random_int", - "kind": "value", - "name": "random_int", - "docstrings": [ - "A call to `random_int(minVal, maxVal)` returns a random number in the\nhalf-closed interval [minVal, maxVal). See\n[`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\non MDN." - ], - "signature": "let random_int: (int, int) => int", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_round", - "kind": "value", - "name": "unsafe_round", - "docstrings": [ - "Rounds its argument to nearest integer. For numbers with a fractional portion\nof exactly 0.5, the argument is rounded to the next integer in the direction\nof positive infinity. This function may return values not representable by\n`int`, whose range is -2147483648 to 2147483647. This is because, in\nJavaScript, there are only 64-bit floating point numbers, which can represent\nintegers in the range ±(253\\-1) exactly. See\n[`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round)\non MDN.\n\n## Examples\n\n```rescript\nJs.Math.unsafe_round(3.7) == 4\nJs.Math.unsafe_round(-3.5) == -3\nJs.Math.unsafe_round(2_150_000_000_000.3) // out of range for int\n```" - ], - "signature": "let unsafe_round: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.round", - "kind": "value", - "name": "round", - "docstrings": [ - "Rounds to nearest integral value (expressed as a float). See\n[`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round)\non MDN." - ], - "signature": "let round: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sign_int", - "kind": "value", - "name": "sign_int", - "docstrings": [ - "Returns the sign of its integer argument: -1 if negative, 0 if zero, 1 if\npositive. See\n[`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign)\non MDN." - ], - "signature": "let sign_int: int => int", - "deprecated": "" - }, - { - "id": "Js.Math.sign_float", - "kind": "value", - "name": "sign_float", - "docstrings": [ - "Returns the sign of its float argument: -1.0 if negative, 0.0 if zero, 1.0 if\npositive. See\n[`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign)\non MDN." - ], - "signature": "let sign_float: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sin", - "kind": "value", - "name": "sin", - "docstrings": [ - "Sine of argument, which must be specified in radians. See\n[`Math.sin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin)\non MDN." - ], - "signature": "let sin: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sinh", - "kind": "value", - "name": "sinh", - "docstrings": [ - "Hyperbolic sine of argument, which must be specified in radians. See\n[`Math.sinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sinh)\non MDN." - ], - "signature": "let sinh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.sqrt", - "kind": "value", - "name": "sqrt", - "docstrings": [ - "Square root. If the argument is negative, this function returns `NaN`. See\n[`Math.sqrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt)\non MDN." - ], - "signature": "let sqrt: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.tan", - "kind": "value", - "name": "tan", - "docstrings": [ - "Tangent of argument, which must be specified in radians. Returns `NaN` if the\nargument is positive infinity or negative infinity. See\n[`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos)\non MDN." - ], - "signature": "let tan: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.tanh", - "kind": "value", - "name": "tanh", - "docstrings": [ - "Hyperbolic tangent of argument, which must be specified in radians. See\n[`Math.tanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tanh)\non MDN." - ], - "signature": "let tanh: float => float", - "deprecated": "" - }, - { - "id": "Js.Math.unsafe_trunc", - "kind": "value", - "name": "unsafe_trunc", - "docstrings": [ - "Truncates its argument; i.e., removes fractional digits. This function may\nreturn values not representable by `int`, whose range is -2147483648 to\n2147483647. This is because, in JavaScript, there are only 64-bit floating\npoint numbers, which can represent integers in the range ±(253-1)\nexactly. See\n[`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc)\non MDN." - ], - "signature": "let unsafe_trunc: float => int", - "deprecated": "" - }, - { - "id": "Js.Math.trunc", - "kind": "value", - "name": "trunc", - "docstrings": [ - "Truncates its argument; i.e., removes fractional digits. See\n[`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc)\non MDN." - ], - "signature": "let trunc: float => float", - "deprecated": "" - } - ] - }, - "js/json": { - "id": "Js.Json", - "name": "Json", - "docstrings": [ - "Provide utilities for json", - "Efficient JSON encoding using JavaScript API\n\n**see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON)" - ], - "items": [ - { - "id": "Js.Json.t", - "kind": "type", - "name": "t", - "docstrings": ["The JSON data structure"], - "signature": "@unboxed\ntype t = JSON.t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)", - "deprecated": "" - }, - { - "id": "Js.Json.tagged_t", - "kind": "type", - "name": "tagged_t", - "docstrings": [], - "signature": "type tagged_t =\n | JSONFalse\n | JSONTrue\n | JSONNull\n | JSONString(string)\n | JSONNumber(float)\n | JSONObject(dict)\n | JSONArray(array)", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.classify", - "kind": "value", - "name": "classify", - "docstrings": [], - "signature": "let classify: t => tagged_t", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.test", - "kind": "value", - "name": "test", - "docstrings": ["`test(v, kind)` returns `true` if `v` is of `kind`."], - "signature": "let test: ('a, Kind.t<'b>) => bool", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.decodeString", - "kind": "value", - "name": "decodeString", - "docstrings": [ - "`decodeString(json)` returns `Some(s)` if `json` is a `string`, `None` otherwise." - ], - "signature": "let decodeString: t => option", - "deprecated": "" - }, - { - "id": "Js.Json.decodeNumber", - "kind": "value", - "name": "decodeNumber", - "docstrings": [ - "`decodeNumber(json)` returns `Some(n)` if `json` is a `number`, `None` otherwise." - ], - "signature": "let decodeNumber: t => option", - "deprecated": "" - }, - { - "id": "Js.Json.decodeObject", - "kind": "value", - "name": "decodeObject", - "docstrings": [ - "`decodeObject(json)` returns `Some(o)` if `json` is an `object`, `None` otherwise." - ], - "signature": "let decodeObject: t => option>", - "deprecated": "" - }, - { - "id": "Js.Json.decodeArray", - "kind": "value", - "name": "decodeArray", - "docstrings": [ - "`decodeArray(json)` returns `Some(a)` if `json` is an `array`, `None` otherwise." - ], - "signature": "let decodeArray: t => option>", - "deprecated": "" - }, - { - "id": "Js.Json.decodeBoolean", - "kind": "value", - "name": "decodeBoolean", - "docstrings": [ - "`decodeBoolean(json)` returns `Some(b)` if `json` is a `boolean`, `None` otherwise." - ], - "signature": "let decodeBoolean: t => option", - "deprecated": "" - }, - { - "id": "Js.Json.decodeNull", - "kind": "value", - "name": "decodeNull", - "docstrings": [ - "`decodeNull(json)` returns `Some(null)` if `json` is a `null`, `None` otherwise." - ], - "signature": "let decodeNull: t => option>", - "deprecated": "" - }, - { - "id": "Js.Json.null", - "kind": "value", - "name": "null", - "docstrings": ["`null` is the singleton null JSON value."], - "signature": "let null: t", - "deprecated": "" - }, - { - "id": "Js.Json.string", - "kind": "value", - "name": "string", - "docstrings": ["`string(s)` makes a JSON string of the `string` `s`."], - "signature": "let string: string => t", - "deprecated": "" - }, - { - "id": "Js.Json.number", - "kind": "value", - "name": "number", - "docstrings": ["`number(n)` makes a JSON number of the `float` `n`."], - "signature": "let number: float => t", - "deprecated": "" - }, - { - "id": "Js.Json.boolean", - "kind": "value", - "name": "boolean", - "docstrings": ["`boolean(b)` makes a JSON boolean of the `bool` `b`."], - "signature": "let boolean: bool => t", - "deprecated": "" - }, - { - "id": "Js.Json.object_", - "kind": "value", - "name": "object_", - "docstrings": ["`object_(dict)` makes a JSON object of the `dict`."], - "signature": "let object_: dict => t", - "deprecated": "" - }, - { - "id": "Js.Json.array", - "kind": "value", - "name": "array", - "docstrings": [ - "`array_(a)` makes a JSON array of the `Js.Json.t` array `a`." - ], - "signature": "let array: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.stringArray", - "kind": "value", - "name": "stringArray", - "docstrings": [ - "`stringArray(a)` makes a JSON array of the `string` array `a`." - ], - "signature": "let stringArray: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.numberArray", - "kind": "value", - "name": "numberArray", - "docstrings": [ - "`numberArray(a)` makes a JSON array of the `float` array `a`." - ], - "signature": "let numberArray: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.booleanArray", - "kind": "value", - "name": "booleanArray", - "docstrings": [ - "`booleanArray(a)` makes a JSON array of the `bool` array `a`." - ], - "signature": "let booleanArray: array => t", - "deprecated": "" - }, - { - "id": "Js.Json.objectArray", - "kind": "value", - "name": "objectArray", - "docstrings": [ - "`objectArray(a) makes a JSON array of the `JsDict.t` array `a`." - ], - "signature": "let objectArray: array> => t", - "deprecated": "" - }, - { - "id": "Js.Json.parseExn", - "kind": "value", - "name": "parseExn", - "docstrings": [ - "`parseExn(s)` parses the `string` `s` into a JSON data structure.\nReturns a JSON data structure.\nThrows `SyntaxError` if the given string is not a valid JSON. Note: `SyntaxError` is a JavaScript exception.\n\nSee [`parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) on MDN.\n\n## Examples\n\n```rescript\n/* parse a simple JSON string */\n\nlet json = try Js.Json.parseExn(` \"hello\" `) catch {\n| _ => failwith(\"Error parsing JSON string\")\n}\n\nswitch Js.Json.classify(json) {\n| Js.Json.JSONString(value) => Js.log(value)\n| _ => failwith(\"Expected a string\")\n}\n```\n\n```rescript\n/* parse a complex JSON string */\n\nlet getIds = s => {\n let json = try Js.Json.parseExn(s) catch {\n | _ => failwith(\"Error parsing JSON string\")\n }\n\n switch Js.Json.classify(json) {\n | Js.Json.JSONObject(value) =>\n /* In this branch, compiler infer value : Js.Json.t dict */\n switch Js.Dict.get(value, \"ids\") {\n | Some(ids) =>\n switch Js.Json.classify(ids) {\n | Js.Json.JSONArray(ids) => /* In this branch compiler infer ids : Js.Json.t array */\n ids\n | _ => failwith(\"Expected an array\")\n }\n | None => failwith(\"Expected an `ids` property\")\n }\n | _ => failwith(\"Expected an object\")\n }\n}\n\n/* prints `1, 2, 3` */\nJs.log(getIds(` { \"ids\" : [1, 2, 3 ] } `))\n```" - ], - "signature": "let parseExn: string => t", - "deprecated": "" - }, - { - "id": "Js.Json.stringify", - "kind": "value", - "name": "stringify", - "docstrings": [ - "`stringify(json)` formats the JSON data structure as a `string`.\nReturns the string representation of a given JSON data structure.\n\nSee [`stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) on MDN.\n\n## Examples\n\n```rescript\n/* Creates and stringifies a simple JS object */\n\nlet dict = Js.Dict.empty()\nJs.Dict.set(dict, \"name\", Js.Json.string(\"John Doe\"))\nJs.Dict.set(dict, \"age\", Js.Json.number(30.0))\nJs.Dict.set(dict, \"likes\", Js.Json.stringArray([\"ReScript\", \"ocaml\", \"js\"]))\n\nJs.log(Js.Json.stringify(Js.Json.object_(dict)))\n```" - ], - "signature": "let stringify: t => string", - "deprecated": "" - }, - { - "id": "Js.Json.stringifyWithSpace", - "kind": "value", - "name": "stringifyWithSpace", - "docstrings": [ - "`stringifyWithSpace(json)` formats the JSON data structure as a `string`.\nReturns the string representation of a given JSON data structure with spacing.\n\nSee [`stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) on MDN.\n\n## Examples\n\n```rescript\n/* Creates and stringifies a simple JS object with spacing */\n\nlet dict = Js.Dict.empty()\nJs.Dict.set(dict, \"name\", Js.Json.string(\"John Doe\"))\nJs.Dict.set(dict, \"age\", Js.Json.number(30.0))\nJs.Dict.set(dict, \"likes\", Js.Json.stringArray([\"ReScript\", \"ocaml\", \"js\"]))\n\nJs.log(Js.Json.stringifyWithSpace(Js.Json.object_(dict), 2))\n```" - ], - "signature": "let stringifyWithSpace: (t, int) => string", - "deprecated": "" - }, - { - "id": "Js.Json.stringifyAny", - "kind": "value", - "name": "stringifyAny", - "docstrings": [ - "`stringifyAny(value)` formats any value into a JSON string.\n\n## Examples\n\n```rescript\n/* prints `[\"hello\", \"world\"]` */\nJs.log(Js.Json.stringifyAny([\"hello\", \"world\"]))\n```" - ], - "signature": "let stringifyAny: 'a => option", - "deprecated": "" - }, - { - "id": "Js.Json.deserializeUnsafe", - "kind": "value", - "name": "deserializeUnsafe", - "docstrings": [ - "Best-effort serialization, it tries to seralize as\nmany objects as possible and deserialize it back\n\nIt is unsafe in two aspects\n- It may throw during parsing\n- when you cast it to a specific type, it may have a type mismatch" - ], - "signature": "let deserializeUnsafe: string => 'a", - "deprecated": "This functionality has been deprecated and will be removed in v13." - }, - { - "id": "Js.Json.serializeExn", - "kind": "value", - "name": "serializeExn", - "docstrings": [ - "It will throw in such situations:\n- The object can not be serlialized to a JSON\n- There are cycles\n- Some JS engines can not stringify deeply nested json objects" - ], - "signature": "let serializeExn: 'a => string", - "deprecated": "This functionality has been deprecated and will be removed in v13." - } - ] - }, - "js/global": { - "id": "Js.Global", - "name": "Global", - "docstrings": [ - "Provide bindings to JS global functions in global namespace", - "Contains functions available in the global scope (`window` in a browser context)" - ], - "items": [ - { - "id": "Js.Global.intervalId", - "kind": "type", - "name": "intervalId", - "docstrings": [ - "Identify an interval started by `Js.Global.setInterval`." - ], - "signature": "type intervalId = Global.intervalId", - "deprecated": "" - }, - { - "id": "Js.Global.timeoutId", - "kind": "type", - "name": "timeoutId", - "docstrings": ["Identify timeout started by `Js.Global.setTimeout`."], - "signature": "type timeoutId = Global.timeoutId", - "deprecated": "" - }, - { - "id": "Js.Global.clearInterval", - "kind": "value", - "name": "clearInterval", - "docstrings": [ - "Clear an interval started by `Js.Global.setInterval`\n\n## Examples\n\n```rescript\n/* API for a somewhat aggressive snoozing alarm clock */\n\nlet punchSleepyGuy = () => Js.log(\"Punch\")\n\nlet interval = ref(Js.Nullable.null)\n\nlet remind = () => {\n Js.log(\"Wake Up!\")\n punchSleepyGuy()\n}\n\nlet snooze = mins => interval := Js.Nullable.return(Js.Global.setInterval(remind, mins * 60 * 1000))\n\nlet cancel = () =>\n Js.Nullable.iter(interval.contents, intervalId => Js.Global.clearInterval(intervalId))\n```" - ], - "signature": "let clearInterval: intervalId => unit", - "deprecated": "" - }, - { - "id": "Js.Global.clearTimeout", - "kind": "value", - "name": "clearTimeout", - "docstrings": [ - "Clear a timeout started by `Js.Global.setTimeout`.\n\n## Examples\n\n```rescript\n/* A simple model of a code monkey's brain */\n\nlet closeHackerNewsTab = () => Js.log(\"close\")\n\nlet timer = ref(Js.Nullable.null)\n\nlet work = () => closeHackerNewsTab()\n\nlet procrastinate = mins => {\n Js.Nullable.iter(timer.contents, timer => Js.Global.clearTimeout(timer))\n timer := Js.Nullable.return(Js.Global.setTimeout(work, mins * 60 * 1000))\n}\n```" - ], - "signature": "let clearTimeout: timeoutId => unit", - "deprecated": "" - }, - { - "id": "Js.Global.setInterval", - "kind": "value", - "name": "setInterval", - "docstrings": [ - "Repeatedly executes a callback with a specified interval (in milliseconds)\nbetween calls. Returns a `Js.Global.intervalId` that can be passed to\n`Js.Global.clearInterval` to cancel the timeout.\n\n## Examples\n\n```rescript\n/* Will count up and print the count to the console every second */\n\nlet count = ref(0)\n\nlet tick = () => {\n count := count.contents + 1\n Js.log(Belt.Int.toString(count.contents))\n}\n\nJs.Global.setInterval(tick, 1000)\n```" - ], - "signature": "let setInterval: (unit => unit, int) => intervalId", - "deprecated": "" - }, - { - "id": "Js.Global.setIntervalFloat", - "kind": "value", - "name": "setIntervalFloat", - "docstrings": [ - "Repeatedly executes a callback with a specified interval (in milliseconds)\nbetween calls. Returns a `Js.Global.intervalId` that can be passed to\n`Js.Global.clearInterval` to cancel the timeout.\n\n## Examples\n\n```rescript\n/* Will count up and print the count to the console every second */\n\nlet count = ref(0)\n\nlet tick = () => {\n count := count.contents + 1\n Js.log(Belt.Int.toString(count.contents))\n}\n\nJs.Global.setIntervalFloat(tick, 1000.0)\n```" - ], - "signature": "let setIntervalFloat: (unit => unit, float) => intervalId", - "deprecated": "" - }, - { - "id": "Js.Global.setTimeout", - "kind": "value", - "name": "setTimeout", - "docstrings": [ - "Execute a callback after a specified delay (in milliseconds). Returns a\n`Js.Global.timeoutId` that can be passed to `Js.Global.clearTimeout` to cancel\nthe timeout.\n\n## Examples\n\n```rescript\n/* Prints \"Timed out!\" in the console after one second */\n\nlet message = \"Timed out!\"\n\nJs.Global.setTimeout(() => Js.log(message), 1000)\n```" - ], - "signature": "let setTimeout: (unit => unit, int) => timeoutId", - "deprecated": "" - }, - { - "id": "Js.Global.setTimeoutFloat", - "kind": "value", - "name": "setTimeoutFloat", - "docstrings": [ - "Execute a callback after a specified delay (in milliseconds). Returns a\n`Js.Global.timeoutId` that can be passed to `Js.Global.clearTimeout` to cancel\nthe timeout.\n\n## Examples\n\n```rescript\n/* Prints \"Timed out!\" in the console after one second */\n\nlet message = \"Timed out!\"\n\nJs.Global.setTimeoutFloat(() => Js.log(message), 1000.0)\n```" - ], - "signature": "let setTimeoutFloat: (unit => unit, float) => timeoutId", - "deprecated": "" - }, - { - "id": "Js.Global.encodeURI", - "kind": "value", - "name": "encodeURI", - "docstrings": [ - "URL-encodes a string.\n\nSee [`encodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI) on MDN." - ], - "signature": "let encodeURI: string => string", - "deprecated": "" - }, - { - "id": "Js.Global.decodeURI", - "kind": "value", - "name": "decodeURI", - "docstrings": [ - "Decodes a URL-enmcoded string produced by `encodeURI`\n\nSee [`decodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI) on MDN." - ], - "signature": "let decodeURI: string => string", - "deprecated": "" - }, - { - "id": "Js.Global.encodeURIComponent", - "kind": "value", - "name": "encodeURIComponent", - "docstrings": [ - "URL-encodes a string, including characters with special meaning in a URI.\n\nSee [`encodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) on MDN." - ], - "signature": "let encodeURIComponent: string => string", - "deprecated": "" - }, - { - "id": "Js.Global.decodeURIComponent", - "kind": "value", - "name": "decodeURIComponent", - "docstrings": [ - "Decodes a URL-enmcoded string produced by `encodeURIComponent`\n\nSee [`decodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) on MDN." - ], - "signature": "let decodeURIComponent: string => string", - "deprecated": "" - } - ] - }, - "js/dict": { - "id": "Js.Dict", - "name": "Dict", - "docstrings": [ - "Provide utilities for JS dictionary object", - "Provide utilities for JS dictionary object.\n\n**Note:** This module's examples will assume this predeclared dictionary:\n\n## Examples\n\n```rescript\nlet ages = Js.Dict.fromList(list{(\"Maria\", 30), (\"Vinh\", 22), (\"Fred\", 49)})\n```" - ], - "items": [ - { - "id": "Js.Dict.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = dict<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.key", - "kind": "type", - "name": "key", - "docstrings": [ - "The type for dictionary keys. This means that dictionaries *must* use `string`s as their keys." - ], - "signature": "type key = string", - "deprecated": "" - }, - { - "id": "Js.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`Js.Dict.get(key)` returns `None` if the key is not found in the dictionary,\n`Some(value)` otherwise.\n\n## Examples\n\n```rescript\nJs.Dict.get(ages, \"Vinh\") == Some(22)\nJs.Dict.get(ages, \"Paul\") == None\n```" - ], - "signature": "let get: (t<'a>, key) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.unsafeGet", - "kind": "value", - "name": "unsafeGet", - "docstrings": [ - "`Js.Dict.unsafeGet(key)` returns the value if the key exists, otherwise an `undefined` value is returned. Use this only when you are sure the key exists (i.e. when having used the `keys()` function to check that the key is valid).\n\n## Examples\n\n```rescript\nJs.Dict.unsafeGet(ages, \"Fred\") == 49\nJs.Dict.unsafeGet(ages, \"Paul\") // returns undefined\n```" - ], - "signature": "let unsafeGet: (t<'a>, key) => 'a", - "deprecated": "" - }, - { - "id": "Js.Dict.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`Js.Dict.set(dict, key, value)` sets the key/value in the dictionary `dict`. If\nthe key does not exist, and entry will be created for it.\n\n*This function modifies the original dictionary.*\n\n## Examples\n\n```rescript\nJs.Dict.set(ages, \"Maria\", 31)\nJs.log(ages == Js.Dict.fromList(list{(\"Maria\", 31), (\"Vinh\", 22), (\"Fred\", 49)}))\n\nJs.Dict.set(ages, \"David\", 66)\nJs.log(ages == Js.Dict.fromList(list{(\"Maria\", 31), (\"Vinh\", 22), (\"Fred\", 49), (\"David\", 66)}))\n```" - ], - "signature": "let set: (t<'a>, key, 'a) => unit", - "deprecated": "" - }, - { - "id": "Js.Dict.keys", - "kind": "value", - "name": "keys", - "docstrings": [ - "Returns all the keys in the dictionary `dict`.\n\n## Examples\n\n```rescript\nJs.Dict.keys(ages) == [\"Maria\", \"Vinh\", \"Fred\"]\n```" - ], - "signature": "let keys: t<'a> => array", - "deprecated": "" - }, - { - "id": "Js.Dict.empty", - "kind": "value", - "name": "empty", - "docstrings": ["Returns an empty dictionary."], - "signature": "let empty: unit => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.unsafeDeleteKey", - "kind": "value", - "name": "unsafeDeleteKey", - "docstrings": ["Experimental internal function"], - "signature": "let unsafeDeleteKey: (t, string) => unit", - "deprecated": "" - }, - { - "id": "Js.Dict.entries", - "kind": "value", - "name": "entries", - "docstrings": [ - "Returns an array of key/value pairs in the given dictionary (ES2017).\n\n## Examples\n\n```rescript\nJs.Dict.entries(ages) == [(\"Maria\", 30), (\"Vinh\", 22), (\"Fred\", 49)]\n```" - ], - "signature": "let entries: t<'a> => array<(key, 'a)>", - "deprecated": "" - }, - { - "id": "Js.Dict.values", - "kind": "value", - "name": "values", - "docstrings": [ - "Returns the values in the given dictionary (ES2017).\n\n## Examples\n\n```rescript\nJs.Dict.values(ages) == [30, 22, 49]\n```" - ], - "signature": "let values: t<'a> => array<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.fromList", - "kind": "value", - "name": "fromList", - "docstrings": [ - "Creates a new dictionary containing each (key, value) pair in its list\nargument.\n\n## Examples\n\n```rescript\nlet capitals = Js.Dict.fromList(list{(\"Japan\", \"Tokyo\"), (\"France\", \"Paris\"), (\"Egypt\", \"Cairo\")})\n```" - ], - "signature": "let fromList: list<(key, 'a)> => t<'a>", - "deprecated": "Use `Dict.fromArray(List.toArray(...))` instead." - }, - { - "id": "Js.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Creates a new dictionary containing each (key, value) pair in its array\nargument.\n\n## Examples\n\n```rescript\nlet capitals2 = Js.Dict.fromArray([(\"Germany\", \"Berlin\"), (\"Burkina Faso\", \"Ouagadougou\")])\n```" - ], - "signature": "let fromArray: array<(key, 'a)> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Dict.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(f, dict)` maps `dict` to a new dictionary with the same keys, using the\nfunction `f` to map each value.\n\n## Examples\n\n```rescript\nlet prices = Js.Dict.fromList(list{(\"pen\", 1.00), (\"book\", 5.00), (\"stapler\", 7.00)})\n\nlet discount = price => price *. 0.90\nlet salePrices = Js.Dict.map(discount, prices)\n\nsalePrices == Js.Dict.fromList(list{(\"pen\", 0.90), (\"book\", 4.50), (\"stapler\", 6.30)})\n```" - ], - "signature": "let map: ('a => 'b, t<'a>) => t<'b>", - "deprecated": "" - } - ] - }, - "js/date": { - "id": "Js.Date", - "name": "Date", - "docstrings": [ - "Provide bindings for JS Date", - "Provide bindings to JS date. (See\n[`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)\non MDN.) JavaScript stores dates as the number of milliseconds since the UNIX\n*epoch*, midnight 1 January 1970, UTC." - ], - "items": [ - { - "id": "Js.Date.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Date.t", - "deprecated": "" - }, - { - "id": "Js.Date.valueOf", - "kind": "value", - "name": "valueOf", - "docstrings": [ - "Returns the primitive value of this date, equivalent to `getTime()`. (See\n[`Date.valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/valueOf)\non MDN.)\n\n## Examples\n\n```rescript\nJs.Date.valueOf(exampleDate) == 123456654321.0\n```" - ], - "signature": "let valueOf: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Returns a date representing the current time. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nlet now = Js.Date.make()\n```" - ], - "signature": "let make: unit => t", - "deprecated": "" - }, - { - "id": "Js.Date.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "Returns a date representing the given argument, which is a number of\nmilliseconds since the epoch. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.fromFloat(123456654321.0) == exampleDate\n```" - ], - "signature": "let fromFloat: float => t", - "deprecated": "" - }, - { - "id": "Js.Date.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Returns a `Js.Date.t` represented by the given string. The string can be in\n“IETF-compliant RFC 2822 timestamps, and also strings in a version of ISO8601.”\nReturns `NaN` if given an invalid date string. According to the [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\ndocumentation on MDN, its use is discouraged.\n\n## Examples\n\n```rescript\nJs.Date.fromString(\"Thu, 29 Nov 1973 21:30:54.321 GMT\") == exampleDate\nJs.Date.fromString(\"1973-11-29T21:30:54.321Z00:00\") == exampleDate\nJs.Date.fromString(\"Thor, 32 Lok -19 60:70:80 XYZ\") // returns NaN\n```" - ], - "signature": "let fromString: string => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYM", - "kind": "value", - "name": "makeWithYM", - "docstrings": [ - "Returns a date representing midnight of the first day of the given month and\nyear in the current time zone. Fractional parts of arguments are ignored. See\n[`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nlet november1 = Js.Date.makeWithYM(~year=2020.0, ~month=10.0, ())\n```" - ], - "signature": "let makeWithYM: (~year: float, ~month: float, unit) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMD", - "kind": "value", - "name": "makeWithYMD", - "docstrings": [ - "Returns a date representing midnight of the given date of the given month and\nyear in the current time zone. Fractional parts of arguments are ignored. See\n[`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN." - ], - "signature": "let makeWithYMD: (~year: float, ~month: float, ~date: float, unit) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMDH", - "kind": "value", - "name": "makeWithYMDH", - "docstrings": [ - "Returns a date representing the given date of the given month and year, at zero\nminutes and zero seconds past the given `hours`, in the current time zone.\nFractional parts of arguments are ignored. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN. Fractional parts of the arguments are ignored." - ], - "signature": "let makeWithYMDH: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n unit,\n) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMDHM", - "kind": "value", - "name": "makeWithYMDHM", - "docstrings": [ - "Returns a date representing the given date of the given month and year, at zero\nseconds past the given time in hours and minutes in the current time zone.\nFractional parts of arguments are ignored. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN." - ], - "signature": "let makeWithYMDHM: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n unit,\n) => t", - "deprecated": "" - }, - { - "id": "Js.Date.makeWithYMDHMS", - "kind": "value", - "name": "makeWithYMDHMS", - "docstrings": [ - "Returns a date representing the given date of the given month and year, at the\ngiven time in hours, minutes, and seconds in the current time zone. Fractional\nparts of arguments are ignored. See [`Date()`\nConstructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.makeWithYMDHMS(\n ~year=1973.0,\n ~month=11.0,\n ~date=29.0,\n ~hours=21.0,\n ~minutes=30.0,\n ~seconds=54.321,\n (),\n) == exampleDate\n```" - ], - "signature": "let makeWithYMDHMS: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => t", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYM", - "kind": "value", - "name": "utcWithYM", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the first day of the given month and year in UTC. Fractional parts\nof arguments are ignored. See\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN.\n\n## Examples\n\n```rescript\nlet november1 = Js.Date.utcWithYM(~year=2020.0, ~month=10.0, ())\n```" - ], - "signature": "let utcWithYM: (~year: float, ~month: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMD", - "kind": "value", - "name": "utcWithYMD", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year in UTC. Fractional parts\nof arguments are ignored. See\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMD: (~year: float, ~month: float, ~date: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMDH", - "kind": "value", - "name": "utcWithYMDH", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year, at zero minutes and\nseconds past the given hours in UTC. Fractional parts of arguments are ignored.\nSee\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMDH: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMDHM", - "kind": "value", - "name": "utcWithYMDHM", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year, at zero seconds past\nthe given number of minutes past the given hours in UTC. Fractional parts of\narguments are ignored. See\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMDHM: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.utcWithYMDHMS", - "kind": "value", - "name": "utcWithYMDHMS", - "docstrings": [ - "Returns a float representing the number of milliseconds past the epoch for\nmidnight of the given date of the given month and year, at the given time in\nhours, minutes and seconds in UTC. Fractional parts of arguments are ignored.\n\nSee\n[`Date.UTC`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC)\non MDN." - ], - "signature": "let utcWithYMDHMS: (\n ~year: float,\n ~month: float,\n ~date: float,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.now", - "kind": "value", - "name": "now", - "docstrings": [ - "Returns the current time as number of milliseconds since Unix epoch." - ], - "signature": "let now: unit => float", - "deprecated": "" - }, - { - "id": "Js.Date.parse", - "kind": "value", - "name": "parse", - "docstrings": [], - "signature": "let parse: string => t", - "deprecated": "" - }, - { - "id": "Js.Date.parseAsFloat", - "kind": "value", - "name": "parseAsFloat", - "docstrings": [ - "Returns a float with the number of milliseconds past the epoch represented by\nthe given string. The string can be in “IETF-compliant RFC 2822 timestamps, and\nalso strings in a version of ISO8601.” Returns `NaN` if given an invalid date\nstring. According to the\n[`Date.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse)\ndocumentation on MDN, its use is discouraged. Returns `NaN` if passed invalid\ndate string." - ], - "signature": "let parseAsFloat: string => float", - "deprecated": "" - }, - { - "id": "Js.Date.getDate", - "kind": "value", - "name": "getDate", - "docstrings": [ - "Returns the day of the month for its argument. The argument is evaluated in the\ncurrent time zone. See\n[`Date.getDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDate)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getDate(exampleDate) == 29.0\n```" - ], - "signature": "let getDate: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getDay", - "kind": "value", - "name": "getDay", - "docstrings": [ - "Returns the day of the week (0.0-6.0) for its argument, where 0.0 represents\nSunday. The argument is evaluated in the current time zone. See\n[`Date.getDay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDay)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getDay(exampleDate) == 4.0\n```" - ], - "signature": "let getDay: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getFullYear", - "kind": "value", - "name": "getFullYear", - "docstrings": [ - "Returns the full year (as opposed to the range 0-99) for its argument. The\nargument is evaluated in the current time zone. See\n[`Date.getFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getFullYear)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getFullYear(exampleDate) == 1973.0\n```" - ], - "signature": "let getFullYear: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getHours", - "kind": "value", - "name": "getHours", - "docstrings": [ - "Returns the hours for its argument, evaluated in the current time zone. See\n[`Date.getHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getHours)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getHours(exampleDate) == 22.0 // Vienna is in GMT+01:00\n```" - ], - "signature": "let getHours: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getMilliseconds", - "kind": "value", - "name": "getMilliseconds", - "docstrings": [ - "Returns the number of milliseconds for its argument, evaluated in the current\ntime zone. See\n[`Date.getMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getMilliseconds(exampleDate) == 321.0\n```" - ], - "signature": "let getMilliseconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getMinutes", - "kind": "value", - "name": "getMinutes", - "docstrings": [ - "Returns the number of minutes for its argument, evaluated in the current time\nzone. See\n[`Date.getMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMinutes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getMinutes(exampleDate) == 30.0\n```" - ], - "signature": "let getMinutes: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getMonth", - "kind": "value", - "name": "getMonth", - "docstrings": [ - "Returns the month (0.0-11.0) for its argument, evaluated in the current time\nzone. January is month zero. See\n[`Date.getMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMonth)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getMonth(exampleDate) == 10.0\n```" - ], - "signature": "let getMonth: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getSeconds", - "kind": "value", - "name": "getSeconds", - "docstrings": [ - "Returns the seconds for its argument, evaluated in the current time zone. See\n[`Date.getSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getSeconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getSeconds(exampleDate) == 54.0\n```" - ], - "signature": "let getSeconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getTime", - "kind": "value", - "name": "getTime", - "docstrings": [ - "Returns the number of milliseconds since Unix epoch, evaluated in UTC. See\n[`Date.getTime`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getTime(exampleDate) == 123456654321.0\n```" - ], - "signature": "let getTime: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getTimezoneOffset", - "kind": "value", - "name": "getTimezoneOffset", - "docstrings": [ - "Returns the time zone offset in minutes from the current time zone to UTC. See\n[`Date.getTimezoneOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getTimezoneOffset(exampleDate) == -60.0\n```" - ], - "signature": "let getTimezoneOffset: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCDate", - "kind": "value", - "name": "getUTCDate", - "docstrings": [ - "Returns the day of the month of the argument, evaluated in UTC. See\n[`Date.getUTCDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCDate)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCDate(exampleDate) == 29.0\n```" - ], - "signature": "let getUTCDate: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCDay", - "kind": "value", - "name": "getUTCDay", - "docstrings": [ - "Returns the day of the week of the argument, evaluated in UTC. The range of the\nreturn value is 0.0-6.0, where Sunday is zero. See\n[`Date.getUTCDay`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCDay)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCDay(exampleDate) == 4.0\n```" - ], - "signature": "let getUTCDay: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCFullYear", - "kind": "value", - "name": "getUTCFullYear", - "docstrings": [ - "Returns the full year (as opposed to the range 0-99) for its argument. The\nargument is evaluated in UTC. See\n[`Date.getUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCFullYear(exampleDate) == 1973.0\n```" - ], - "signature": "let getUTCFullYear: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCHours", - "kind": "value", - "name": "getUTCHours", - "docstrings": [ - "Returns the hours for its argument, evaluated in the current time zone. See\n[`Date.getUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCHours(exampleDate) == 21.0\n```" - ], - "signature": "let getUTCHours: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCMilliseconds", - "kind": "value", - "name": "getUTCMilliseconds", - "docstrings": [ - "Returns the number of milliseconds for its argument, evaluated in UTC. See\n[`Date.getUTCMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCMilliseconds(exampleDate) == 321.0\n```" - ], - "signature": "let getUTCMilliseconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCMinutes", - "kind": "value", - "name": "getUTCMinutes", - "docstrings": [ - "Returns the number of minutes for its argument, evaluated in UTC. See\n[`Date.getUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCMinutes(exampleDate) == 30.0\n```" - ], - "signature": "let getUTCMinutes: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCMonth", - "kind": "value", - "name": "getUTCMonth", - "docstrings": [ - "Returns the month (0.0-11.0) for its argument, evaluated in UTC. January is\nmonth zero. See\n[`Date.getUTCMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCMonth)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCMonth(exampleDate) == 10.0\n```" - ], - "signature": "let getUTCMonth: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getUTCSeconds", - "kind": "value", - "name": "getUTCSeconds", - "docstrings": [ - "Returns the seconds for its argument, evaluated in UTC. See\n[`Date.getUTCSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCSeconds)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.getUTCSeconds(exampleDate) == 54.0\n```" - ], - "signature": "let getUTCSeconds: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.getYear", - "kind": "value", - "name": "getYear", - "docstrings": [], - "signature": "let getYear: t => float", - "deprecated": "" - }, - { - "id": "Js.Date.setDate", - "kind": "value", - "name": "setDate", - "docstrings": [ - "Sets the given `Date`’s day of month to the value in the second argument\naccording to the current time zone. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setDate)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet twoWeeksBefore = Js.Date.setDate(date1, 15.0)\ndate1 == Js.Date.fromString(\"1973-11-15T21:30:54.321Z00:00\")\ntwoWeeksBefore == Js.Date.getTime(date1)\n```" - ], - "signature": "let setDate: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setFullYear", - "kind": "value", - "name": "setFullYear", - "docstrings": [ - "Sets the given `Date`’s year to the value in the second argument according to\nthe current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextYear = Js.Date.setFullYear(date1, 1974.0)\ndate1 == Js.Date.fromString(\"1974-11-15T21:30:54.321Z00:00\")\nnextYear == Js.Date.getTime(date1)\n```" - ], - "signature": "let setFullYear: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setFullYearM", - "kind": "value", - "name": "setFullYearM", - "docstrings": [ - "Sets the given `Date`’s year and month to the values in the labeled arguments\naccording to the current time zone. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setFullYearM(date1, ~year=1974.0, ~month=0.0, ())\ndate1 == Js.Date.fromString(\"1974-01-22T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setFullYearM: (t, ~year: float, ~month: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setFullYearMD", - "kind": "value", - "name": "setFullYearMD", - "docstrings": [ - "Sets the given `Date`’s year, month, and day of month to the values in the\nlabeled arguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setFullYearMD(date1, ~year=1974.0, ~month=0.0, ~date=7.0, ())\ndate1 == Js.Date.fromString(\"1974-01-07T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setFullYearMD: (\n t,\n ~year: float,\n ~month: float,\n ~date: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHours", - "kind": "value", - "name": "setHours", - "docstrings": [ - "Sets the given `Date`’s hours to the value in the second argument according to\nthe current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextHour = Js.Date.setHours(date1, 22.0)\ndate1 == Js.Date.fromString(\"1973-11-29T22:30:54.321Z00:00\")\nnextHour == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHours: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHoursM", - "kind": "value", - "name": "setHoursM", - "docstrings": [ - "Sets the given `Date`’s hours and minutes to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setHoursM(date1, ~hours=22.0, ~minutes=46.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:54.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHoursM: (t, ~hours: float, ~minutes: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHoursMS", - "kind": "value", - "name": "setHoursMS", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, and seconds to the values in the\nlabeled arguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setHoursMS(date1, ~hours=22.0, ~minutes=46.0, ~seconds=37.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHoursMS: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setHoursMSMs", - "kind": "value", - "name": "setHoursMSMs", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, seconds, and milliseconds to the values\nin the labeled arguments according to the current time zone. Returns the number\nof milliseconds since the epoch of the updated `Date`. *This function modifies\nthe original `Date`.* See\n[`Date.setHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setHoursMSMs(\n date1,\n ~hours=22.0,\n ~minutes=46.0,\n ~seconds=37.0,\n ~milliseconds=494.0,\n (),\n)\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setHoursMSMs: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMilliseconds", - "kind": "value", - "name": "setMilliseconds", - "docstrings": [ - "Sets the given `Date`’s milliseconds to the value in the second argument\naccording to the current time zone. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMilliseconds(date1, 494.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:30:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMilliseconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMinutes", - "kind": "value", - "name": "setMinutes", - "docstrings": [ - "Sets the given `Date`’s minutes to the value in the second argument according\nto the current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMinutes(date1, 34.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMinutes: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMinutesS", - "kind": "value", - "name": "setMinutesS", - "docstrings": [ - "Sets the given `Date`’s minutes and seconds to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMinutesS(date1, ~minutes=34.0, ~seconds=56.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMinutesS: (t, ~minutes: float, ~seconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMinutesSMs", - "kind": "value", - "name": "setMinutesSMs", - "docstrings": [ - "Sets the given `Date`’s minutes, seconds, and milliseconds to the values in the\nlabeled arguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMinutesSMs(date1, ~minutes=34.0, ~seconds=56.0, ~milliseconds=789.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMinutesSMs: (\n t,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMonth", - "kind": "value", - "name": "setMonth", - "docstrings": [ - "Sets the given `Date`’s month to the value in the second argument according to\nthe current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMonth(date1, 11.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMonth: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setMonthD", - "kind": "value", - "name": "setMonthD", - "docstrings": [ - "Sets the given `Date`’s month and day of month to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setMonthD(date1, ~month=11.0, ~date=8.0, ())\ndate1 == Js.Date.fromString(\"1973-12-08T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setMonthD: (t, ~month: float, ~date: float, unit) => float", - "deprecated": "Use `Date.setMonth` then `Date.setDate`. No direct 1:1 migration available." - }, - { - "id": "Js.Date.setSeconds", - "kind": "value", - "name": "setSeconds", - "docstrings": [ - "Sets the given `Date`’s seconds to the value in the second argument according\nto the current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setSeconds(date1, 56.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setSeconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setSecondsMs", - "kind": "value", - "name": "setSecondsMs", - "docstrings": [ - "Sets the given `Date`’s seconds and milliseconds to the values in the labeled\narguments according to the current time zone. Returns the number of\nmilliseconds since the epoch of the updated `Date`. *This function modifies the\noriginal `Date`.* See\n[`Date.setSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setSecondsMs(date1, ~seconds=56.0, ~milliseconds=789.0, ())\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setSecondsMs: (t, ~seconds: float, ~milliseconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setTime", - "kind": "value", - "name": "setTime", - "docstrings": [ - "Sets the given `Date`’s value in terms of milliseconds since the epoch. Returns\nthe number of milliseconds since the epoch of the updated `Date`. *This\nfunction modifies the original `Date`.* See\n[`Date.setTime`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setTime)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setTime(date1, 198765432101.0)\n\ndate1 == Js.Date.fromString(\"1976-04-19T12:37:12.101Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setTime: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCDate", - "kind": "value", - "name": "setUTCDate", - "docstrings": [ - "Sets the given `Date`’s day of month to the value in the second argument\naccording to UTC. Returns the number of milliseconds since the epoch of the\nupdated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCDate`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCDate)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet twoWeeksBefore = Js.Date.setUTCDate(date1, 15.0)\ndate1 == Js.Date.fromString(\"1973-11-15T21:30:54.321Z00:00\")\ntwoWeeksBefore == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCDate: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCFullYear", - "kind": "value", - "name": "setUTCFullYear", - "docstrings": [ - "Sets the given `Date`’s year to the value in the second argument according to\nUTC. Returns the number of milliseconds since the epoch of the updated `Date`.\n*This function modifies the original `Date`.* See\n[`Date.setUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextYear = Js.Date.setUTCFullYear(date1, 1974.0)\ndate1 == Js.Date.fromString(\"1974-11-15T21:30:54.321Z00:00\")\nnextYear == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCFullYear: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCFullYearM", - "kind": "value", - "name": "setUTCFullYearM", - "docstrings": [ - "Sets the given `Date`’s year and month to the values in the labeled arguments\naccording to UTC. Returns the number of milliseconds since the epoch of the\nupdated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setUTCFullYearM(date1, ~year=1974.0, ~month=0.0, ())\ndate1 == Js.Date.fromString(\"1974-01-22T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCFullYearM: (t, ~year: float, ~month: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCFullYearMD", - "kind": "value", - "name": "setUTCFullYearMD", - "docstrings": [ - "Sets the given `Date`’s year, month, and day of month to the values in the\nlabeled arguments according to UTC. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setUTCFullYear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCFullYear)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet future = Js.Date.setUTCFullYearMD(date1, ~year=1974.0, ~month=0.0, ~date=7.0, ())\ndate1 == Js.Date.fromString(\"1974-01-07T21:30:54.321Z00:00\")\nfuture == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCFullYearMD: (\n t,\n ~year: float,\n ~month: float,\n ~date: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHours", - "kind": "value", - "name": "setUTCHours", - "docstrings": [ - "Sets the given `Date`’s hours to the value in the second argument according to\nUTC. Returns the number of milliseconds since the epoch of the updated `Date`.\n*This function modifies the original `Date`.* See\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet nextHour = Js.Date.setUTCHours(date1, 22.0)\ndate1 == Js.Date.fromString(\"1973-11-29T22:30:54.321Z00:00\")\nnextHour == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHours: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHoursM", - "kind": "value", - "name": "setUTCHoursM", - "docstrings": [ - "Sets the given `Date`’s hours and minutes to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCHoursM(date1, ~hours=22.0, ~minutes=46.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:54.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHoursM: (t, ~hours: float, ~minutes: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHoursMS", - "kind": "value", - "name": "setUTCHoursMS", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, and seconds to the values in the\nlabeled arguments according to UTC. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\n\nSee\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCHoursMS(date1, ~hours=22.0, ~minutes=46.0, ~seconds=37.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHoursMS: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCHoursMSMs", - "kind": "value", - "name": "setUTCHoursMSMs", - "docstrings": [ - "Sets the given `Date`’s hours, minutes, seconds, and milliseconds to the values\nin the labeled arguments according to UTC. Returns the number of milliseconds\nsince the epoch of the updated `Date`. *This function modifies the original\n`Date`.* See\n[`Date.setUTCHours`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCHours)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCHoursMSMs(\n date1,\n ~hours=22.0,\n ~minutes=46.0,\n ~seconds=37.0,\n ~milliseconds=494.0,\n (),\n)\ndate1 == Js.Date.fromString(\"1973-11-29T22:46:37.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCHoursMSMs: (\n t,\n ~hours: float,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMilliseconds", - "kind": "value", - "name": "setUTCMilliseconds", - "docstrings": [ - "Sets the given `Date`’s milliseconds to the value in the second argument\naccording to UTC. Returns the number of milliseconds since the epoch of the\nupdated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMilliseconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMilliseconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMilliseconds(date1, 494.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:30:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMilliseconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMinutes", - "kind": "value", - "name": "setUTCMinutes", - "docstrings": [ - "Sets the given `Date`’s minutes to the value in the second argument according\nto the current time zone. Returns the number of milliseconds since the epoch of\nthe updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMinutes(date1, 34.0)\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:54.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMinutes: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMinutesS", - "kind": "value", - "name": "setUTCMinutesS", - "docstrings": [ - "Sets the given `Date`’s minutes and seconds to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMinutesS(date1, ~minutes=34.0, ~seconds=56.0, ())\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.494Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMinutesS: (t, ~minutes: float, ~seconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMinutesSMs", - "kind": "value", - "name": "setUTCMinutesSMs", - "docstrings": [ - "Sets the given `Date`’s minutes, seconds, and milliseconds to the values in the\nlabeled arguments according to UTC. Returns the number of milliseconds since\nthe epoch of the updated `Date`. *This function modifies the original `Date`.*\nSee\n[`Date.setUTCMinutes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMinutes)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMinutesSMs(\n date1,\n ~minutes=34.0,\n ~seconds=56.0,\n ~milliseconds=789.0,\n (),\n)\ndate1 == Js.Date.fromString(\"1973-11-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMinutesSMs: (\n t,\n ~minutes: float,\n ~seconds: float,\n ~milliseconds: float,\n unit,\n) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMonth", - "kind": "value", - "name": "setUTCMonth", - "docstrings": [ - "Sets the given `Date`’s month to the value in the second argument according to\nUTC. Returns the number of milliseconds since the epoch of the updated `Date`.\n*This function modifies the original `Date`.* See\n[`Date.setUTCMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMonth(date1, 11.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMonth: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCMonthD", - "kind": "value", - "name": "setUTCMonthD", - "docstrings": [ - "Sets the given `Date`’s month and day of month to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCMonth`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMonth)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCMonthD(date1, ~month=11.0, ~date=8.0, ())\ndate1 == Js.Date.fromString(\"1973-12-08T21:34:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCMonthD: (t, ~month: float, ~date: float, unit) => float", - "deprecated": "Use `Date.setUTCMonth` then `Date.setUTCDate`. No direct 1:1 migration available." - }, - { - "id": "Js.Date.setUTCSeconds", - "kind": "value", - "name": "setUTCSeconds", - "docstrings": [ - "Sets the given `Date`’s seconds to the value in the second argument according\nto UTC. Returns the number of milliseconds since the epoch of the updated\n`Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCSeconds(date1, 56.0)\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.321Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCSeconds: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCSecondsMs", - "kind": "value", - "name": "setUTCSecondsMs", - "docstrings": [ - "Sets the given `Date`’s seconds and milliseconds to the values in the labeled\narguments according to UTC. Returns the number of milliseconds since the epoch\nof the updated `Date`. *This function modifies the original `Date`.* See\n[`Date.setUTCSeconds`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCSeconds)\non MDN.\n\n## Examples\n\n```rescript\nlet date1 = Js.Date.fromFloat(123456654321.0) // 29 November 1973 21:30:54.321 GMT\nlet futureTime = Js.Date.setUTCSecondsMs(date1, ~seconds=56.0, ~milliseconds=789.0, ())\ndate1 == Js.Date.fromString(\"1973-12-29T21:30:56.789Z00:00\")\nfutureTime == Js.Date.getTime(date1)\n```" - ], - "signature": "let setUTCSecondsMs: (t, ~seconds: float, ~milliseconds: float, unit) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setUTCTime", - "kind": "value", - "name": "setUTCTime", - "docstrings": ["Same as [`setTime()`](#settime)."], - "signature": "let setUTCTime: (t, float) => float", - "deprecated": "" - }, - { - "id": "Js.Date.setYear", - "kind": "value", - "name": "setYear", - "docstrings": [], - "signature": "let setYear: (t, float) => float", - "deprecated": "Use `setFullYear` instead" - }, - { - "id": "Js.Date.toDateString", - "kind": "value", - "name": "toDateString", - "docstrings": [ - "Returns the date (day of week, year, month, and day of month) portion of a\n`Date` in English. See\n[`Date.toDateString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toDateString(exampleDate) == \"Thu Nov 29 1973\"\n```" - ], - "signature": "let toDateString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toGMTString", - "kind": "value", - "name": "toGMTString", - "docstrings": [], - "signature": "let toGMTString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toISOString", - "kind": "value", - "name": "toISOString", - "docstrings": [ - "Returns a simplified version of the ISO 8601 format for the date. See\n[`Date.toISOString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toISOString(exampleDate) == \"1973-11-29T21:30:54.321Z\"\n```" - ], - "signature": "let toISOString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toJSON", - "kind": "value", - "name": "toJSON", - "docstrings": [], - "signature": "let toJSON: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toJSONUnsafe", - "kind": "value", - "name": "toJSONUnsafe", - "docstrings": [ - "Returns a string representation of the given date. See\n[`Date.toJSON`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON)\non MDN." - ], - "signature": "let toJSONUnsafe: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toLocaleDateString", - "kind": "value", - "name": "toLocaleDateString", - "docstrings": [ - "Returns the year, month, and day for the given `Date` in the current locale\nformat. See\n[`Date.toLocaleDateString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toLocaleDateString(exampleDate) == \"11/29/1973\" // for en_US.utf8\nJs.Date.toLocaleDateString(exampleDate) == \"29.11.73\" // for de_DE.utf8\n```" - ], - "signature": "let toLocaleDateString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Returns the time and date for the given `Date` in the current locale format.\nSee\n[`Date.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toLocaleString(exampleDate) == \"11/29/1973, 10:30:54 PM\" // for en_US.utf8\nJs.Date.toLocaleString(exampleDate) == \"29.11.1973, 22:30:54\" // for de_DE.utf8\n```" - ], - "signature": "let toLocaleString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toLocaleTimeString", - "kind": "value", - "name": "toLocaleTimeString", - "docstrings": [ - "Returns the time of day for the given `Date` in the current locale format. See\n[`Date.toLocaleTimeString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toLocaleString(exampleDate) == \"10:30:54 PM\" // for en_US.utf8\nJs.Date.toLocaleString(exampleDate) == \"22:30:54\" // for de_DE.utf8\n```" - ], - "signature": "let toLocaleTimeString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Returns a string representing the date and time of day for the given `Date` in\nthe current locale and time zone. See\n[`Date.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toString(\n exampleDate,\n) == \"Thu Nov 29 1973 22:30:54 GMT+0100 (Central European Standard Time)\"\n```" - ], - "signature": "let toString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toTimeString", - "kind": "value", - "name": "toTimeString", - "docstrings": [ - "Returns a string representing the time of day for the given `Date` in the\ncurrent locale and time zone. See\n[`Date.toTimeString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toTimeString(exampleDate) == \"22:30:54 GMT+0100 (Central European Standard Time)\"\n```" - ], - "signature": "let toTimeString: t => string", - "deprecated": "" - }, - { - "id": "Js.Date.toUTCString", - "kind": "value", - "name": "toUTCString", - "docstrings": [ - "Returns a string representing the date and time of day for the given `Date` in\nthe current locale and UTC (GMT time zone). See\n[`Date.toUTCString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Date.toUTCString(exampleDate) == \"Thu, 29 Nov 1973 21:30:54 GMT\"\n```" - ], - "signature": "let toUTCString: t => string", - "deprecated": "" - } - ] - }, - "js/promise2": { - "id": "Js.Promise2", - "name": "Promise2", - "docstrings": ["Provide bindings to JS Promise"], - "items": [ - { - "id": "Js.Promise2.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.error", - "kind": "type", - "name": "error", - "docstrings": [], - "signature": "type error" - }, - { - "id": "Js.Promise2.then", - "kind": "value", - "name": "then", - "docstrings": ["Type-safe t-first then"], - "signature": "let then: (promise<'a>, 'a => promise<'b>) => promise<'b>", - "deprecated": "" - }, - { - "id": "Js.Promise2.catch", - "kind": "value", - "name": "catch", - "docstrings": ["Type-safe t-first catch"], - "signature": "let catch: (promise<'a>, error => promise<'a>) => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (\n (~resolve: 'a => unit, ~reject: exn => unit) => unit,\n) => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.resolve", - "kind": "value", - "name": "resolve", - "docstrings": [], - "signature": "let resolve: 'a => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.reject", - "kind": "value", - "name": "reject", - "docstrings": [], - "signature": "let reject: exn => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all", - "kind": "value", - "name": "all", - "docstrings": [], - "signature": "let all: array> => promise>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all2", - "kind": "value", - "name": "all2", - "docstrings": [], - "signature": "let all2: ((promise<'a0>, promise<'a1>)) => promise<('a0, 'a1)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all3", - "kind": "value", - "name": "all3", - "docstrings": [], - "signature": "let all3: (\n (promise<'a0>, promise<'a1>, promise<'a2>),\n) => promise<('a0, 'a1, 'a2)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all4", - "kind": "value", - "name": "all4", - "docstrings": [], - "signature": "let all4: (\n (promise<'a0>, promise<'a1>, promise<'a2>, promise<'a3>),\n) => promise<('a0, 'a1, 'a2, 'a3)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all5", - "kind": "value", - "name": "all5", - "docstrings": [], - "signature": "let all5: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.all6", - "kind": "value", - "name": "all6", - "docstrings": [], - "signature": "let all6: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n promise<'a5>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4, 'a5)>", - "deprecated": "" - }, - { - "id": "Js.Promise2.race", - "kind": "value", - "name": "race", - "docstrings": [], - "signature": "let race: array> => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise2.unsafe_async", - "kind": "value", - "name": "unsafe_async", - "docstrings": [], - "signature": "let unsafe_async: 'a => promise<'a>" - }, - { - "id": "Js.Promise2.unsafe_await", - "kind": "value", - "name": "unsafe_await", - "docstrings": [], - "signature": "let unsafe_await: promise<'a> => 'a" - } - ] - }, - "js/promise": { - "id": "Js.Promise", - "name": "Promise", - "docstrings": [ - "Provide bindings to JS Promise", - "Deprecation note: These bindings are pretty outdated and cannot be used properly\nwith the `->` operator.\n\nMore details on proper Promise usage can be found here:\nhttps://rescript-lang.org/docs/manual/promise#promise-legacy" - ], - "items": [ - { - "id": "Js.Promise.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.error", - "kind": "type", - "name": "error", - "docstrings": [], - "signature": "type error = Js_promise2.error", - "deprecated": "" - }, - { - "id": "Js.Promise.make", - "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (\n (~resolve: 'a => unit, ~reject: exn => unit) => unit,\n) => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.resolve", - "kind": "value", - "name": "resolve", - "docstrings": [], - "signature": "let resolve: 'a => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.reject", - "kind": "value", - "name": "reject", - "docstrings": [], - "signature": "let reject: exn => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.all", - "kind": "value", - "name": "all", - "docstrings": [], - "signature": "let all: array> => promise>", - "deprecated": "" - }, - { - "id": "Js.Promise.all2", - "kind": "value", - "name": "all2", - "docstrings": [], - "signature": "let all2: ((promise<'a0>, promise<'a1>)) => promise<('a0, 'a1)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all3", - "kind": "value", - "name": "all3", - "docstrings": [], - "signature": "let all3: (\n (promise<'a0>, promise<'a1>, promise<'a2>),\n) => promise<('a0, 'a1, 'a2)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all4", - "kind": "value", - "name": "all4", - "docstrings": [], - "signature": "let all4: (\n (promise<'a0>, promise<'a1>, promise<'a2>, promise<'a3>),\n) => promise<('a0, 'a1, 'a2, 'a3)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all5", - "kind": "value", - "name": "all5", - "docstrings": [], - "signature": "let all5: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4)>", - "deprecated": "" - }, - { - "id": "Js.Promise.all6", - "kind": "value", - "name": "all6", - "docstrings": [], - "signature": "let all6: (\n (\n promise<'a0>,\n promise<'a1>,\n promise<'a2>,\n promise<'a3>,\n promise<'a4>,\n promise<'a5>,\n ),\n) => promise<('a0, 'a1, 'a2, 'a3, 'a4, 'a5)>", - "deprecated": "" - }, - { - "id": "Js.Promise.race", - "kind": "value", - "name": "race", - "docstrings": [], - "signature": "let race: array> => promise<'a>", - "deprecated": "" - }, - { - "id": "Js.Promise.then_", - "kind": "value", - "name": "then_", - "docstrings": [], - "signature": "let then_: ('a => promise<'b>, promise<'a>) => promise<'b>", - "deprecated": "" - }, - { - "id": "Js.Promise.catch", - "kind": "value", - "name": "catch", - "docstrings": [], - "signature": "let catch: (error => promise<'a>, promise<'a>) => promise<'a>", - "deprecated": "" - } - ] - }, - "js/re": { - "id": "Js.Re", - "name": "Re", - "docstrings": [ - "Provide bindings to JS regex expression", - "Provide bindings to JS regular expressions (RegExp).\n\n**Note:** This is not an immutable API. A RegExp object with the `global` (\"g\")\nflag set will modify the [`lastIndex`]() property when the RegExp object is used,\nand subsequent uses will continue the search from the previous [`lastIndex`]()." - ], - "items": [ - { - "id": "Js.Re.t", - "kind": "type", - "name": "t", - "docstrings": ["The RegExp object."], - "signature": "type t = RegExp.t", - "deprecated": "" - }, - { - "id": "Js.Re.result", - "kind": "type", - "name": "result", - "docstrings": ["The result of a executing a RegExp on a string."], - "signature": "type result" - }, - { - "id": "Js.Re.captures", - "kind": "value", - "name": "captures", - "docstrings": [ - "An `array` of the match and captures, the first is the full match and the\nremaining are the substring captures." - ], - "signature": "let captures: result => array>", - "deprecated": "" - }, - { - "id": "Js.Re.matches", - "kind": "value", - "name": "matches", - "docstrings": [], - "signature": "let matches: result => array", - "deprecated": "" - }, - { - "id": "Js.Re.index", - "kind": "value", - "name": "index", - "docstrings": ["0-based index of the match in the input string."], - "signature": "let index: result => int", - "deprecated": "" - }, - { - "id": "Js.Re.input", - "kind": "value", - "name": "input", - "docstrings": ["The original input string."], - "signature": "let input: result => string", - "deprecated": "" - }, - { - "id": "Js.Re.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Constructs a RegExp object (Js.Re.t) from a `string`.\nRegex literals `/.../` should generally be preferred, but `fromString`\nis useful when you need to dynamically construct a regex using strings,\nexactly like when you do so in JavaScript.\n\n## Examples\n\n```rescript\nlet firstReScriptFileExtension = (filename, content) => {\n let result = Js.Re.fromString(filename ++ \"\\.(res|resi)\")->Js.Re.exec_(content)\n switch result {\n | Some(r) => Js.Nullable.toOption(Js.Re.captures(r)[1])\n | None => None\n }\n}\n\n// outputs \"res\"\nfirstReScriptFileExtension(\"School\", \"School.res School.resi Main.js School.bs.js\")\n```" - ], - "signature": "let fromString: string => t", - "deprecated": "" - }, - { - "id": "Js.Re.fromStringWithFlags", - "kind": "value", - "name": "fromStringWithFlags", - "docstrings": [ - "Constructs a RegExp object (`Js.Re.t`) from a string with the given flags.\nSee `Js.Re.fromString`.\n\nValid flags:\n\n- **g** global\n- **i** ignore case\n- **m** multiline\n- **u** unicode (es2015)\n- **y** sticky (es2015)" - ], - "signature": "let fromStringWithFlags: (string, ~flags: string) => t", - "deprecated": "" - }, - { - "id": "Js.Re.flags", - "kind": "value", - "name": "flags", - "docstrings": ["Returns the enabled flags as a string."], - "signature": "let flags: t => string", - "deprecated": "" - }, - { - "id": "Js.Re.global", - "kind": "value", - "name": "global", - "docstrings": [ - "Returns a `bool` indicating whether the global flag is set." - ], - "signature": "let global: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.ignoreCase", - "kind": "value", - "name": "ignoreCase", - "docstrings": [ - "Returns a `bool` indicating whether the ignoreCase flag is set." - ], - "signature": "let ignoreCase: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.lastIndex", - "kind": "value", - "name": "lastIndex", - "docstrings": [ - "Returns the index where the next match will start its search. This property\nwill be modified when the RegExp object is used, if the global (\"g\") flag is\nset.\n\n## Examples\n\n```rescript\nlet re = /ab*TODO/g\nlet str = \"abbcdefabh\"\n\nlet break = ref(false)\nwhile !break.contents {\n switch Js.Re.exec_(re, str) {\n | Some(result) =>\n Js.Nullable.iter(Js.Re.captures(result)[0], match_ => {\n let next = Belt.Int.toString(Js.Re.lastIndex(re))\n Js.log(\"Found \" ++ (match_ ++ (\". Next match starts at \" ++ next)))\n })\n | None => break := true\n }\n}\n```\n\nSee\n[`RegExp: lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex)\non MDN." - ], - "signature": "let lastIndex: t => int", - "deprecated": "" - }, - { - "id": "Js.Re.setLastIndex", - "kind": "value", - "name": "setLastIndex", - "docstrings": [ - "Sets the index at which the next match will start its search from." - ], - "signature": "let setLastIndex: (t, int) => unit", - "deprecated": "" - }, - { - "id": "Js.Re.multiline", - "kind": "value", - "name": "multiline", - "docstrings": [ - "Returns a `bool` indicating whether the multiline flag is set." - ], - "signature": "let multiline: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.source", - "kind": "value", - "name": "source", - "docstrings": ["Returns the pattern as a `string`."], - "signature": "let source: t => string", - "deprecated": "" - }, - { - "id": "Js.Re.sticky", - "kind": "value", - "name": "sticky", - "docstrings": [ - "Returns a `bool` indicating whether the sticky flag is set." - ], - "signature": "let sticky: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.unicode", - "kind": "value", - "name": "unicode", - "docstrings": [ - "Returns a `bool` indicating whether the unicode flag is set." - ], - "signature": "let unicode: t => bool", - "deprecated": "" - }, - { - "id": "Js.Re.exec_", - "kind": "value", - "name": "exec_", - "docstrings": [ - "Executes a search on a given string using the given RegExp object.\nReturns `Some(Js.Re.result)` if a match is found, `None` otherwise.\n\n## Examples\n\n```rescript\n/* Match \"quick brown\" followed by \"jumps\", ignoring characters in between\n * Remember \"brown\" and \"jumps\"\n * Ignore case\n */\n\nlet re = /quick\\s(brown).+?(jumps)/ig\nlet result = Js.Re.exec_(re, \"The Quick Brown Fox Jumps Over The Lazy Dog\")\n```\n\nSee [`RegExp.prototype.exec()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec)\non MDN." - ], - "signature": "let exec_: (t, string) => option", - "deprecated": "" - }, - { - "id": "Js.Re.test_", - "kind": "value", - "name": "test_", - "docstrings": [ - "Tests whether the given RegExp object will match a given `string`.\nReturns true if a match is found, false otherwise.\n\n## Examples\n\n```rescript\n/* A simple implementation of Js.String.startsWith */\n\nlet str = \"hello world!\"\n\nlet startsWith = (target, substring) => Js.Re.fromString(\"^\" ++ substring)->Js.Re.test_(target)\n\nJs.log(str->startsWith(\"hello\")) /* prints \"true\" */\n```\n\nSee [`RegExp.prototype.test()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test)\non MDN." - ], - "signature": "let test_: (t, string) => bool", - "deprecated": "" - } - ] - }, - "js/string2": { - "id": "Js.String2", - "name": "String2", - "docstrings": [ - "Provide bindings to JS string", - "Provide bindings to JS string. Optimized for pipe-first." - ], - "items": [ - { - "id": "Js.String2.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = string", - "deprecated": "" - }, - { - "id": "Js.String2.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nJs.String2.make(3.5) == \"3.5\"\nJs.String2.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCharCode", - "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to\nthat number; `n` ranges from 0 to 65535.If out of range, the lower 16 bits of\nthe value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as\n`fromCharCode(0xF63A)`.\n\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCharCode(65) == \"A\"\nJs.String2.fromCharCode(0x3c8) == `ψ`\nJs.String2.fromCharCode(0xd55c) == `한`\nJs.String2.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCharCodeMany", - "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`.\n\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)\non MDN." - ], - "signature": "let fromCharCodeMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCodePoint", - "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point. If the number is not a valid code point, it throws\n`RangeError`. Thus, `fromCodePoint(0x1F63A)` will produce a correct value,\nunlike `fromCharCode(0x1F63A)`, and `fromCodePoint(-5)` will throw a\n`RangeError`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePoint(65) == \"A\"\nJs.String2.fromCodePoint(0x3c8) == `ψ`\nJs.String2.fromCodePoint(0xd55c) == `한`\nJs.String2.fromCodePoint(0x1f63a) == `😺`\n```" - ], - "signature": "let fromCodePoint: int => t", - "deprecated": "" - }, - { - "id": "Js.String2.fromCodePointMany", - "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```" - ], - "signature": "let fromCodePointMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String2.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(s)` returns the length of the given `string`.\n\nSee [`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.length(\"abcd\") == 4\n```" - ], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.String2.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(s, n)` returns as a `string` the character at the given index number. If\n`n` is out of range, this function returns `undefined`,so at some point this\nfunction may be modified to return `option`.\n\n## Examples\n\n```rescript\nJs.String2.get(\"Reason\", 0) == \"R\"\nJs.String2.get(\"Reason\", 4) == \"o\"\nJs.String2.get(`Rẽasöń`, 5) == `ń`\n```" - ], - "signature": "let get: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.charAt", - "kind": "value", - "name": "charAt", - "docstrings": [ - "`charAt(s, n)` gets the character at index `n` within string `s`. If `n` is\nnegative or greater than the length of `s`, it returns the empty string. If the\nstring contains characters outside the range \\\\u0000-\\\\uffff, it will return the\nfirst 16-bit value at that position in the string.\n\nSee [`String.charAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.charAt(\"Reason\", 0) == \"R\"\nJs.String2.charAt(\"Reason\", 12) == \"\"\nJs.String2.charAt(`Rẽasöń`, 5) == `ń`\n```" - ], - "signature": "let charAt: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.charCodeAt", - "kind": "value", - "name": "charCodeAt", - "docstrings": [ - "`charCodeAt(s, n)` returns the character code at position `n` in string `s`;\nthe result is in the range 0-65535, unlke `codePointAt`, so it will not work\ncorrectly for characters with code points greater than or equal to 0x10000. The\nreturn type is `float` because this function returns NaN if `n` is less than\nzero or greater than the length of the string.\n\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.charCodeAt(`😺`, 0) == 0xd83d->Belt.Int.toFloat\nJs.String2.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" - ], - "signature": "let charCodeAt: (t, int) => float", - "deprecated": "" - }, - { - "id": "Js.String2.codePointAt", - "kind": "value", - "name": "codePointAt", - "docstrings": [ - "`codePointAt(s, n)` returns the code point at position `n` within string `s` as\na `Some(value)`. The return value handles code points greater than or equal to\n0x10000. If there is no code point at the given position, the function returns\n`None`.\n\nSee [`String.codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.codePointAt(`¿😺?`, 1) == Some(0x1f63a)\nJs.String2.codePointAt(\"abc\", 5) == None\n```" - ], - "signature": "let codePointAt: (t, int) => option", - "deprecated": "" - }, - { - "id": "Js.String2.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(original, append)` returns a new `string` with `append` added after\n`original`.\n\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.concat(\"cow\", \"bell\") == \"cowbell\"\n```" - ], - "signature": "let concat: (t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(original, arr)` returns a new `string` consisting of each item of an\narray of strings added to the `original` string.\n\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.concatMany(\"1st\", [\"2nd\", \"3rd\", \"4th\"]) == \"1st2nd3rd4th\"\n```" - ], - "signature": "let concatMany: (t, array) => t", - "deprecated": "" - }, - { - "id": "Js.String2.endsWith", - "kind": "value", - "name": "endsWith", - "docstrings": [ - "ES2015: `endsWith(str, substr)` returns `true` if the `str` ends with `substr`,\n`false` otherwise.\n\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.endsWith(\"ReScript\", \"Script\") == true\nJs.String2.endsWith(\"C++\", \"Script\") == false\n```" - ], - "signature": "let endsWith: (t, t) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.endsWithFrom", - "kind": "value", - "name": "endsWithFrom", - "docstrings": [ - "`endsWithFrom(str, ending, len)` returns `true` if the first len characters of\n`str` end with `ending`, `false` otherwise. If `len` is greater than or equal\nto the length of `str`, then it works like `endsWith`. (Honestly, this should\nhave been named endsWithAt, but oh well).\n\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.endsWithFrom(\"abcd\", \"cd\", 4) == true\nJs.String2.endsWithFrom(\"abcde\", \"cd\", 3) == false\nJs.String2.endsWithFrom(\"abcde\", \"cde\", 99) == true\nJs.String2.endsWithFrom(\"example.dat\", \"ple\", 7) == true\n```" - ], - "signature": "let endsWithFrom: (t, t, int) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "ES2015: `includes(str, searchValue)` returns `true` if `searchValue` is found\nanywhere within `str`, false otherwise.\n\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.includes(\"programmer\", \"gram\") == true\nJs.String2.includes(\"programmer\", \"er\") == true\nJs.String2.includes(\"programmer\", \"pro\") == true\nJs.String2.includes(\"programmer.dat\", \"xyz\") == false\n```" - ], - "signature": "let includes: (t, t) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.includesFrom", - "kind": "value", - "name": "includesFrom", - "docstrings": [ - "ES2015: `includes(str, searchValue start)` returns `true` if `searchValue` is\nfound anywhere within `str` starting at character number `start` (where 0 is\nthe first character), `false` otherwise.\n\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.includesFrom(\"programmer\", \"gram\", 1) == true\nJs.String2.includesFrom(\"programmer\", \"gram\", 4) == false\nJs.String2.includesFrom(`대한민국`, `한`, 1) == true\n```" - ], - "signature": "let includesFrom: (t, t, int) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "ES2015: `indexOf(str, searchValue)` returns the position at which `searchValue`\nwas first found within `str`, or -1 if `searchValue` is not in `str`.\n\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.indexOf(\"bookseller\", \"ok\") == 2\nJs.String2.indexOf(\"bookseller\", \"sell\") == 4\nJs.String2.indexOf(\"beekeeper\", \"ee\") == 1\nJs.String2.indexOf(\"bookseller\", \"xyz\") == -1\n```" - ], - "signature": "let indexOf: (t, t) => int", - "deprecated": "" - }, - { - "id": "Js.String2.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "`indexOfFrom(str, searchValue, start)` returns the position at which\n`searchValue` was found within `str` starting at character position `start`, or\n\\-1 if `searchValue` is not found in that portion of `str`. The return value is\nrelative to the beginning of the string, no matter where the search started\nfrom.\n\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.indexOfFrom(\"bookseller\", \"ok\", 1) == 2\nJs.String2.indexOfFrom(\"bookseller\", \"sell\", 2) == 4\nJs.String2.indexOfFrom(\"bookseller\", \"sell\", 5) == -1\n```" - ], - "signature": "let indexOfFrom: (t, t, int) => int", - "deprecated": "" - }, - { - "id": "Js.String2.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(str, searchValue)` returns the position of the last occurrence of\n`searchValue` within `str`, searching backwards from the end of the string.\nReturns -1 if `searchValue` is not in `str`. The return value is always\nrelative to the beginning of the string.\n\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.lastIndexOf(\"bookseller\", \"ok\") == 2\nJs.String2.lastIndexOf(\"beekeeper\", \"ee\") == 4\nJs.String2.lastIndexOf(\"abcdefg\", \"xyz\") == -1\n```" - ], - "signature": "let lastIndexOf: (t, t) => int", - "deprecated": "" - }, - { - "id": "Js.String2.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "`lastIndexOfFrom(str, searchValue, start)` returns the position of the last\noccurrence of `searchValue` within `str`, searching backwards from the given\nstart position. Returns -1 if `searchValue` is not in `str`. The return value\nis always relative to the beginning of the string.\n\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.lastIndexOfFrom(\"bookseller\", \"ok\", 6) == 2\nJs.String2.lastIndexOfFrom(\"beekeeper\", \"ee\", 8) == 4\nJs.String2.lastIndexOfFrom(\"beekeeper\", \"ee\", 3) == 1\nJs.String2.lastIndexOfFrom(\"abcdefg\", \"xyz\", 4) == -1\n```" - ], - "signature": "let lastIndexOfFrom: (t, t, int) => int", - "deprecated": "" - }, - { - "id": "Js.String2.localeCompare", - "kind": "value", - "name": "localeCompare", - "docstrings": [ - "`localeCompare(reference, comparison)` returns\n- a negative value if reference comes before comparison in sort order\n- zero if reference and comparison have the same sort order\n- a positive value if reference comes after comparison in sort order\n\nSee [`String.localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.localeCompare(\"zebra\", \"ant\") > 0.0\nJs.String2.localeCompare(\"ant\", \"zebra\") < 0.0\nJs.String2.localeCompare(\"cat\", \"cat\") == 0.0\nJs.String2.localeCompare(\"CAT\", \"cat\") > 0.0\n```" - ], - "signature": "let localeCompare: (t, t) => float", - "deprecated": "" - }, - { - "id": "Js.String2.match_", - "kind": "value", - "name": "match_", - "docstrings": [ - "`match(str, regexp)` matches a `string` against the given `regexp`. If there is\nno match, it returns `None`. For regular expressions without the g modifier, if\nthere is a match, the return value is `Some(array)` where the array contains:\n- The entire matched string\n- Any capture groups if the regexp had parentheses\n For regular expressions with the g modifier, a matched expression returns\n `Some(array)` with all the matched substrings and no capture groups.\n\nSee [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.match_(\"The better bats\", /b[aeiou]t/) == Some([\"bet\"])\nJs.String2.match_(\"The better bats\", /b[aeiou]t/g) == Some([\"bet\", \"bat\"])\nJs.String2.match_(\"Today is 2018-04-05.\", /(\\d+)-(\\d+)-(\\d+)/) ==\n Some([\"2018-04-05\", \"2018\", \"04\", \"05\"])\nJs.String2.match_(\"The large container.\", /b[aeiou]g/) == None\n```" - ], - "signature": "let match_: (t, Js_re.t) => option>>", - "deprecated": "" - }, - { - "id": "Js.String2.normalize", - "kind": "value", - "name": "normalize", - "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\u00e3 or the combination of a lower case letter A\n\\u0061 and a combining tilde \\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)\non MDN. See also [Unicode technical report\n#15](https://unicode.org/reports/tr15/) for details." - ], - "signature": "let normalize: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.normalizeByForm", - "kind": "value", - "name": "normalizeByForm", - "docstrings": [ - "ES2015: `normalize(str, form)` returns the normalized Unicode string using the\nspecified form of normalization, which may be one of:\n- \"NFC\" — Normalization Form Canonical Composition.\n- \"NFD\" — Normalization Form Canonical Decomposition.\n- \"NFKC\" — Normalization Form Compatibility Composition.\n- \"NFKD\" — Normalization Form Compatibility Decomposition.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\nSee also [Unicode technical report #15](https://unicode.org/reports/tr15/) for details." - ], - "signature": "let normalizeByForm: (t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.repeat", - "kind": "value", - "name": "repeat", - "docstrings": [ - "`repeat(str, n)` returns a `string` that consists of `n` repetitions of `str`.\nThrows `RangeError` if `n` is negative.\n\nSee [`String.repeat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.repeat(\"ha\", 3) == \"hahaha\"\nJs.String2.repeat(\"empty\", 0) == \"\"\n```" - ], - "signature": "let repeat: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.replace", - "kind": "value", - "name": "replace", - "docstrings": [ - "ES2015: `replace(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with the first matching instance of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.replace(\"old string\", \"old\", \"new\") == \"new string\"\nJs.String2.replace(\"the cat and the dog\", \"the\", \"this\") == \"this cat and the dog\"\n```" - ], - "signature": "let replace: (t, t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.replaceByRe", - "kind": "value", - "name": "replaceByRe", - "docstrings": [ - "`replaceByRe(str, regex, replacement)` returns a new `string` where occurrences\nmatching regex have been replaced by `replacement`.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.replaceByRe(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nJs.String2.replaceByRe(\"Juan Fulano\", /(\\w+) (\\w+)/, \"$2, $1\") == \"Fulano, Juan\"\n```" - ], - "signature": "let replaceByRe: (t, Js_re.t, t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy0", - "kind": "value", - "name": "unsafeReplaceBy0", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with no capturing\nparentheses replaced by the value returned from the given function. The\nfunction receives as its parameters the matched string, the offset at which the\nmatch begins, and the whole string being matched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (matchPart, _offset, _wholeString) => Js.String2.toUpperCase(matchPart)\n\nJs.String2.unsafeReplaceBy0(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" - ], - "signature": "let unsafeReplaceBy0: (t, Js_re.t, (t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy1", - "kind": "value", - "name": "unsafeReplaceBy1", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with one set of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstring, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (_match, part1, _offset, _wholeString) => {\n part1 ++ \"41\"\n}\n\nJs.String2.unsafeReplaceBy1(str, re, matchFn) == \"Jony is 41\"\n```" - ], - "signature": "let unsafeReplaceBy1: (t, Js_re.t, (t, t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy2", - "kind": "value", - "name": "unsafeReplaceBy2", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with two sets of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstrings, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (_match, p1, p2, _offset, _wholeString) => {\n switch (Belt.Int.fromString(p1), Belt.Int.fromString(p2)) {\n | (Some(x), Some(y)) => Belt.Int.toString(x * y)\n | _ => \"???\"\n }\n}\n\nJs.String2.unsafeReplaceBy2(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let unsafeReplaceBy2: (t, Js_re.t, (t, t, t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.unsafeReplaceBy3", - "kind": "value", - "name": "unsafeReplaceBy3", - "docstrings": [ - "Returns a new `string` with some or all matches of a pattern with three sets of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstrings, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN." - ], - "signature": "let unsafeReplaceBy3: (t, Js_re.t, (t, t, t, t, int, t) => t) => t", - "deprecated": "" - }, - { - "id": "Js.String2.search", - "kind": "value", - "name": "search", - "docstrings": [ - "`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\n\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.search(\"testing 1 2 3\", /\\d+/) == 8\nJs.String2.search(\"no numbers\", /\\d+/) == -1\n```" - ], - "signature": "let search: (t, Js_re.t) => int", - "deprecated": "" - }, - { - "id": "Js.String2.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(str, from:n1, to_:n2)` returns the substring of `str` starting at\ncharacter `n1` up to but not including `n2`.\n- If either `n1` or `n2` is negative, then it is evaluated as `length(str - n1)` or `length(str - n2)`.\n- If `n2` is greater than the length of `str`, then it is treated as `length(str)`.\n- If `n1` is greater than `n2`, slice returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=5) == \"cde\"\nJs.String2.slice(\"abcdefg\", ~from=2, ~to_=9) == \"cdefg\"\nJs.String2.slice(\"abcdefg\", ~from=-4, ~to_=-2) == \"de\"\nJs.String2.slice(\"abcdefg\", ~from=5, ~to_=1) == \"\"\n```" - ], - "signature": "let slice: (t, ~from: int, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(str, from:n)` returns the substring of `str` starting at character\n`n` to the end of the string.\n- If `n` is negative, then it is evaluated as `length(str - n)`.\n- If `n` is greater than the length of `str`, then sliceToEnd returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.sliceToEnd(\"abcdefg\", ~from=4) == \"efg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=-2) == \"fg\"\nJs.String2.sliceToEnd(\"abcdefg\", ~from=7) == \"\"\n```" - ], - "signature": "let sliceToEnd: (t, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nJs.String2.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nJs.String2.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nJs.String2.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```" - ], - "signature": "let split: (t, t) => array", - "deprecated": "" - }, - { - "id": "Js.String2.splitAtMost", - "kind": "value", - "name": "splitAtMost", - "docstrings": [ - "`splitAtMost delimiter ~limit: n str` splits the given `str` at every occurrence of `delimiter` and returns an array of the first `n` resulting substrings. If `n` is negative or greater than the number of substrings, the array will contain all the substrings.\n\n```\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 3 = [|\"ant\"; \"bee\"; \"cat\"|];;\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 0 = [| |];;\nsplitAtMost \"ant/bee/cat/dog/elk\" \"/\" ~limit: 9 = [|\"ant\"; \"bee\"; \"cat\"; \"dog\"; \"elk\"|];;\n```" - ], - "signature": "let splitAtMost: (t, t, ~limit: int) => array", - "deprecated": "" - }, - { - "id": "Js.String2.splitByRe", - "kind": "value", - "name": "splitByRe", - "docstrings": [ - "`splitByRe(str, regex)` splits the given `str` at every occurrence of `regex`\nand returns an array of the resulting substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.splitByRe(\"art; bed , cog ;dad\", /\\s*[,;]\\s*TODO/) == [\n Some(\"art\"),\n Some(\"bed\"),\n Some(\"cog\"),\n Some(\"dad\"),\n ]\n```" - ], - "signature": "let splitByRe: (t, Js_re.t) => array>", - "deprecated": "" - }, - { - "id": "Js.String2.splitByReAtMost", - "kind": "value", - "name": "splitByReAtMost", - "docstrings": [ - "`splitByReAtMost(str, regex, ~limit:n)` splits the given `str` at every\noccurrence of `regex` and returns an array of the first `n` resulting\nsubstrings. If `n` is negative or greater than the number of substrings, the\narray will contain all the substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=3) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n ]\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=0) == []\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=8) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n Some(\"four\"),\n ]\n```" - ], - "signature": "let splitByReAtMost: (t, Js_re.t, ~limit: int) => array>", - "deprecated": "" - }, - { - "id": "Js.String2.startsWith", - "kind": "value", - "name": "startsWith", - "docstrings": [ - "ES2015: `startsWith(str, substr)` returns `true` if the `str` starts with\n`substr`, `false` otherwise.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWith(\"ReScript\", \"Re\") == true\nJs.String2.startsWith(\"ReScript\", \"\") == true\nJs.String2.startsWith(\"JavaScript\", \"Re\") == false\n```" - ], - "signature": "let startsWith: (t, t) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.startsWithFrom", - "kind": "value", - "name": "startsWithFrom", - "docstrings": [ - "ES2015: `startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, false otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.startsWithFrom(\"ReScript\", \"Scri\", 2) == true\nJs.String2.startsWithFrom(\"ReScript\", \"\", 2) == true\nJs.String2.startsWithFrom(\"JavaScript\", \"Scri\", 2) == false\n```" - ], - "signature": "let startsWithFrom: (t, t, int) => bool", - "deprecated": "" - }, - { - "id": "Js.String2.substr", - "kind": "value", - "name": "substr", - "docstrings": [ - "`substr(str, ~from:n)` returns the substring of `str` from position `n` to the\nend of the string.\n- If `n` is less than zero, the starting position is the length of `str - n`.\n- If `n` is greater than or equal to the length of `str`, returns the empty string.\n\nJavaScript’s `String.substr()` is a legacy function. When possible, use\n`substring()` instead.\n\nSee [`String.substr`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.substr(\"abcdefghij\", ~from=3) == \"defghij\"\nJs.String2.substr(\"abcdefghij\", ~from=-3) == \"hij\"\nJs.String2.substr(\"abcdefghij\", ~from=12) == \"\"\n```" - ], - "signature": "let substr: (t, ~from: int) => t", - "deprecated": "Use `String.substring` instead" - }, - { - "id": "Js.String2.substrAtMost", - "kind": "value", - "name": "substrAtMost", - "docstrings": [ - "`substrAtMost(str, ~from: pos, ~length: n)` returns the substring of `str` of\nlength `n` starting at position `pos`.\n- If `pos` is less than zero, the starting position is the length of `str - pos`.\n- If `pos` is greater than or equal to the length of `str`, returns the empty string.\n- If `n` is less than or equal to zero, returns the empty string.\n\nJavaScript’s `String.substr()` is a legacy function. When possible, use\n`substring()` instead.\n\nSee [`String.substr`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.substrAtMost(\"abcdefghij\", ~from=3, ~length=4) == \"defg\"\nJs.String2.substrAtMost(\"abcdefghij\", ~from=-3, ~length=4) == \"hij\"\nJs.String2.substrAtMost(\"abcdefghij\", ~from=12, ~length=2) == \"\"\n```" - ], - "signature": "let substrAtMost: (t, ~from: int, ~length: int) => t", - "deprecated": "Use `String.substringAtMost` instead" - }, - { - "id": "Js.String2.substring", - "kind": "value", - "name": "substring", - "docstrings": [ - "`substring(str, ~from: start, ~to_: finish)` returns characters `start` up to\nbut not including finish from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `finish` is zero or negative, the empty string is returned.\n- If `start` is greater than `finish`, the `start` and `finish` points are swapped.\n\nSee [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.substring(\"playground\", ~from=3, ~to_=6) == \"ygr\"\nJs.String2.substring(\"playground\", ~from=6, ~to_=3) == \"ygr\"\nJs.String2.substring(\"playground\", ~from=4, ~to_=12) == \"ground\"\n```" - ], - "signature": "let substring: (t, ~from: int, ~to_: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.substringToEnd", - "kind": "value", - "name": "substringToEnd", - "docstrings": [ - "`substringToEnd(str, ~from: start)` returns the substring of `str` from\nposition `start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string is returned.\n\nSee [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.substringToEnd(\"playground\", ~from=4) == \"ground\"\nJs.String2.substringToEnd(\"playground\", ~from=-3) == \"playground\"\nJs.String2.substringToEnd(\"playground\", ~from=12) == \"\"\n```" - ], - "signature": "let substringToEnd: (t, ~from: int) => t", - "deprecated": "" - }, - { - "id": "Js.String2.toLowerCase", - "kind": "value", - "name": "toLowerCase", - "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms; one when it is the last\ncharacter in a string and another when it is not.\n\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.toLowerCase(\"ABC\") == \"abc\"\nJs.String2.toLowerCase(`ΣΠ`) == `σπ`\nJs.String2.toLowerCase(`ΠΣ`) == `πς`\n```" - ], - "signature": "let toLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.toLocaleLowerCase", - "kind": "value", - "name": "toLocaleLowerCase", - "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase)\non MDN." - ], - "signature": "let toLocaleLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.toUpperCase", - "kind": "value", - "name": "toUpperCase", - "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result; for example the German ß\ncapitalizes to two Ses in a row.\n\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.toUpperCase(\"abc\") == \"ABC\"\nJs.String2.toUpperCase(`Straße`) == `STRASSE`\nJs.String2.toUpperCase(`πς`) == `ΠΣ`\n```" - ], - "signature": "let toUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.toLocaleUpperCase", - "kind": "value", - "name": "toLocaleUpperCase", - "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\nSee [`String.to:LocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\non MDN." - ], - "signature": "let toLocaleUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.trim", - "kind": "value", - "name": "trim", - "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\n\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.trim(\" abc def \") == \"abc def\"\nJs.String2.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" - ], - "signature": "let trim: t => t", - "deprecated": "" - }, - { - "id": "Js.String2.anchor", - "kind": "value", - "name": "anchor", - "docstrings": [ - "`anchor(anchorText, anchorName)` creates a string with an HTML `` element\nwith name attribute of `anchorName` and `anchorText` as its content. Please do\nnot use this method, as it has been removed from the relevant web standards.\n\nSee [`String.anchor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/anchor)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.anchor(\"Page One\", \"page1\") == \"Page One\"\n```" - ], - "signature": "let anchor: (t, t) => t", - "deprecated": "This function has been removed from the relevant web standards." - }, - { - "id": "Js.String2.link", - "kind": "value", - "name": "link", - "docstrings": [ - "ES2015: `link(linkText, urlText)` creates a string with an HTML `` element\nwith href attribute of `urlText` and `linkText` as its content. Please do not\nuse this method, as it has been removed from the relevant web standards. See\n[`String.link`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/link)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.link(\"Go to page two\", \"page2.html\") == \"Go to page two\"\n```" - ], - "signature": "let link: (t, t) => t", - "deprecated": "This function has been removed from the relevant web standards." - }, - { - "id": "Js.String2.castToArrayLike", - "kind": "value", - "name": "castToArrayLike", - "docstrings": [ - "Casts its argument to an `array_like` entity that can be processed by functions\nsuch as `Js.Array2.fromMap()`\n\n## Examples\n\n```rescript\nlet s = \"abcde\"\nlet arr = Js.Array2.fromMap(Js.String2.castToArrayLike(s), x => x)\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let castToArrayLike: t => Js_array2.array_like", - "deprecated": "" - } - ] - }, - "js/string": { - "id": "Js.String", - "name": "String", - "docstrings": ["Provide bindings to JS string", "JavaScript String API"], - "items": [ - { - "id": "Js.String.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = string", - "deprecated": "" - }, - { - "id": "Js.String.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nJs.String2.make(3.5) == \"3.5\"\nJs.String2.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCharCode", - "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to that number; `n` ranges from 0 to 65535.\nIf out of range, the lower 16 bits of the value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as `fromCharCode(0xF63A)`. See [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCharCode(65) == \"A\"\nJs.String2.fromCharCode(0x3c8) == `ψ`\nJs.String2.fromCharCode(0xd55c) == `한`\nJs.String2.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCharCodeMany", - "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`. See\n[`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)\non MDN." - ], - "signature": "let fromCharCodeMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCodePoint", - "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point. If the number is not a valid code point, it throws\n`RangeError`.Thus, `fromCodePoint(0x1F63A)` will produce a correct value,\nunlike `fromCharCode(0x1F63A)`, and `fromCodePoint(-5)` will throw a\n`RangeError`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePoint(65) == \"A\"\nJs.String2.fromCodePoint(0x3c8) == `ψ`\nJs.String2.fromCodePoint(0xd55c) == `한`\nJs.String2.fromCodePoint(0x1f63a) == `😺`\n```" - ], - "signature": "let fromCodePoint: int => t", - "deprecated": "" - }, - { - "id": "Js.String.fromCodePointMany", - "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\n\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```" - ], - "signature": "let fromCodePointMany: array => t", - "deprecated": "" - }, - { - "id": "Js.String.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(s)` returns the length of the given `string`. See\n[`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.length(\"abcd\") == 4\n```" - ], - "signature": "let length: t => int", - "deprecated": "" - }, - { - "id": "Js.String.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(s, n)` returns as a `string` the character at the given index number. If\n`n` is out of range, this function returns `undefined`, so at some point this\nfunction may be modified to return `option`.\n\n## Examples\n\n```rescript\nJs.String2.get(\"Reason\", 0) == \"R\"\nJs.String2.get(\"Reason\", 4) == \"o\"\nJs.String2.get(`Rẽasöń`, 5) == `ń`\n```" - ], - "signature": "let get: (t, int) => t", - "deprecated": "" - }, - { - "id": "Js.String.charAt", - "kind": "value", - "name": "charAt", - "docstrings": [], - "signature": "let charAt: (int, t) => t" - }, - { - "id": "Js.String.charCodeAt", - "kind": "value", - "name": "charCodeAt", - "docstrings": [], - "signature": "let charCodeAt: (int, t) => float" - }, - { - "id": "Js.String.codePointAt", - "kind": "value", - "name": "codePointAt", - "docstrings": [], - "signature": "let codePointAt: (int, t) => option" - }, - { - "id": "Js.String.concat", - "kind": "value", - "name": "concat", - "docstrings": [], - "signature": "let concat: (t, t) => t" - }, - { - "id": "Js.String.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [], - "signature": "let concatMany: (array, t) => t" - }, - { - "id": "Js.String.endsWith", - "kind": "value", - "name": "endsWith", - "docstrings": [], - "signature": "let endsWith: (t, t) => bool" - }, - { - "id": "Js.String.endsWithFrom", - "kind": "value", - "name": "endsWithFrom", - "docstrings": [], - "signature": "let endsWithFrom: (t, int, t) => bool" - }, - { - "id": "Js.String.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t, t) => bool" - }, - { - "id": "Js.String.includesFrom", - "kind": "value", - "name": "includesFrom", - "docstrings": [], - "signature": "let includesFrom: (t, int, t) => bool" - }, - { - "id": "Js.String.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t, t) => int" - }, - { - "id": "Js.String.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t, int, t) => int" - }, - { - "id": "Js.String.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t, t) => int" - }, - { - "id": "Js.String.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t, int, t) => int" - }, - { - "id": "Js.String.localeCompare", - "kind": "value", - "name": "localeCompare", - "docstrings": [], - "signature": "let localeCompare: (t, t) => float" - }, - { - "id": "Js.String.match_", - "kind": "value", - "name": "match_", - "docstrings": [], - "signature": "let match_: (Js_re.t, t) => option>>" - }, - { - "id": "Js.String.normalize", - "kind": "value", - "name": "normalize", - "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\u00e3 or the combination of a lower case letter A\n\\u0061 and a combining tilde \\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)\non MDN.\n\nSee also [Unicode technical report #15](https://unicode.org/reports/tr15/) for\ndetails." - ], - "signature": "let normalize: t => t", - "deprecated": "" - }, - { - "id": "Js.String.normalizeByForm", - "kind": "value", - "name": "normalizeByForm", - "docstrings": [], - "signature": "let normalizeByForm: (t, t) => t" - }, - { - "id": "Js.String.repeat", - "kind": "value", - "name": "repeat", - "docstrings": [], - "signature": "let repeat: (int, t) => t" - }, - { - "id": "Js.String.replace", - "kind": "value", - "name": "replace", - "docstrings": [], - "signature": "let replace: (t, t, t) => t" - }, - { - "id": "Js.String.replaceByRe", - "kind": "value", - "name": "replaceByRe", - "docstrings": [], - "signature": "let replaceByRe: (Js_re.t, t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy0", - "kind": "value", - "name": "unsafeReplaceBy0", - "docstrings": [], - "signature": "let unsafeReplaceBy0: (Js_re.t, (t, int, t) => t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy1", - "kind": "value", - "name": "unsafeReplaceBy1", - "docstrings": [], - "signature": "let unsafeReplaceBy1: (Js_re.t, (t, t, int, t) => t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy2", - "kind": "value", - "name": "unsafeReplaceBy2", - "docstrings": [], - "signature": "let unsafeReplaceBy2: (Js_re.t, (t, t, t, int, t) => t, t) => t" - }, - { - "id": "Js.String.unsafeReplaceBy3", - "kind": "value", - "name": "unsafeReplaceBy3", - "docstrings": [], - "signature": "let unsafeReplaceBy3: (Js_re.t, (t, t, t, t, int, t) => t, t) => t" - }, - { - "id": "Js.String.search", - "kind": "value", - "name": "search", - "docstrings": [], - "signature": "let search: (Js_re.t, t) => int" - }, - { - "id": "Js.String.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (~from: int, ~to_: int, t) => t" - }, - { - "id": "Js.String.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [], - "signature": "let sliceToEnd: (~from: int, t) => t" - }, - { - "id": "Js.String.split", - "kind": "value", - "name": "split", - "docstrings": [], - "signature": "let split: (t, t) => array" - }, - { - "id": "Js.String.splitAtMost", - "kind": "value", - "name": "splitAtMost", - "docstrings": [], - "signature": "let splitAtMost: (t, ~limit: int, t) => array" - }, - { - "id": "Js.String.splitByRe", - "kind": "value", - "name": "splitByRe", - "docstrings": [], - "signature": "let splitByRe: (Js_re.t, t) => array>" - }, - { - "id": "Js.String.splitByReAtMost", - "kind": "value", - "name": "splitByReAtMost", - "docstrings": [], - "signature": "let splitByReAtMost: (Js_re.t, ~limit: int, t) => array>" - }, - { - "id": "Js.String.startsWith", - "kind": "value", - "name": "startsWith", - "docstrings": [], - "signature": "let startsWith: (t, t) => bool" - }, - { - "id": "Js.String.startsWithFrom", - "kind": "value", - "name": "startsWithFrom", - "docstrings": [], - "signature": "let startsWithFrom: (t, int, t) => bool" - }, - { - "id": "Js.String.substr", - "kind": "value", - "name": "substr", - "docstrings": [], - "signature": "let substr: (~from: int, t) => t" - }, - { - "id": "Js.String.substrAtMost", - "kind": "value", - "name": "substrAtMost", - "docstrings": [], - "signature": "let substrAtMost: (~from: int, ~length: int, t) => t" - }, - { - "id": "Js.String.substring", - "kind": "value", - "name": "substring", - "docstrings": [], - "signature": "let substring: (~from: int, ~to_: int, t) => t" - }, - { - "id": "Js.String.substringToEnd", - "kind": "value", - "name": "substringToEnd", - "docstrings": [], - "signature": "let substringToEnd: (~from: int, t) => t" - }, - { - "id": "Js.String.toLowerCase", - "kind": "value", - "name": "toLowerCase", - "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms; one when it is the last\ncharacter in a string and another when it is not.\n\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.toLowerCase(\"ABC\") == \"abc\"\nJs.String.toLowerCase(`ΣΠ`) == `σπ`\nJs.String.toLowerCase(`ΠΣ`) == `πς`\n```" - ], - "signature": "let toLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.toLocaleLowerCase", - "kind": "value", - "name": "toLocaleLowerCase", - "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\n\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase)\non MDN." - ], - "signature": "let toLocaleLowerCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.toUpperCase", - "kind": "value", - "name": "toUpperCase", - "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result; for example the German ß\ncapitalizes to two Ses in a row.\n\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.toUpperCase(\"abc\") == \"ABC\"\nJs.String.toUpperCase(`Straße`) == `STRASSE`\nJs.String.toUpperCase(`πς`) == `ΠΣ`\n```" - ], - "signature": "let toUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.toLocaleUpperCase", - "kind": "value", - "name": "toLocaleUpperCase", - "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\n\nSee [`String.to:LocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\non MDN." - ], - "signature": "let toLocaleUpperCase: t => t", - "deprecated": "" - }, - { - "id": "Js.String.trim", - "kind": "value", - "name": "trim", - "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\n\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.trim(\" abc def \") == \"abc def\"\nJs.String.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" - ], - "signature": "let trim: t => t", - "deprecated": "" - }, - { - "id": "Js.String.anchor", - "kind": "value", - "name": "anchor", - "docstrings": [], - "signature": "let anchor: (t, t) => t" - }, - { - "id": "Js.String.link", - "kind": "value", - "name": "link", - "docstrings": [], - "signature": "let link: (t, t) => t" - }, - { - "id": "Js.String.castToArrayLike", - "kind": "value", - "name": "castToArrayLike", - "docstrings": [ - "Casts its argument to an `array_like` entity that can be processed by functions\nsuch as `Js.Array2.fromMap()`\n\n## Examples\n\n```rescript\nlet s = \"abcde\"\nlet arr = Js.Array2.fromMap(Js.String.castToArrayLike(s), x => x)\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let castToArrayLike: t => Js_array2.array_like", - "deprecated": "This has been deprecated and will be removed in v13. Use functions from the `String` module instead." - } - ] - }, - "js/array2": { - "id": "Js.Array2", - "name": "Array2", - "docstrings": [ - "Provide bindings to JS array", - "Provides bindings to JavaScript’s `Array` functions. These bindings are optimized for pipe-first (`->`), where the array to be processed is the first parameter in the function.\n\nHere is an example to find the sum of squares of all even numbers in an array.\nWithout pipe first, we must call the functions in reverse order:\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nlet square = x => x * x\nlet result = {\n open Js.Array2\n reduce(map(filter([5, 2, 3, 4, 1], isEven), square), \"+\", 0)\n}\n```\n\nWith pipe first, we call the functions in the “natural” order:\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nlet square = x => x * x\nlet result = {\n open Js.Array2\n [5, 2, 3, 4, 1]->filter(isEven)->map(square)->reduce(\"+\", 0)\n}\n```" - ], - "items": [ - { - "id": "Js.Array2.t", - "kind": "type", - "name": "t", - "docstrings": ["The type used to describe a JavaScript array."], - "signature": "type t<'a> = array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [ - "A type used to describe JavaScript objects that are like an array or are iterable." - ], - "signature": "type array_like<'a> = Array.arrayLike<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.from", - "kind": "value", - "name": "from", - "docstrings": [ - "Creates a shallow copy of an array from an array-like object. See\n[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\non MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nJs.Array2.from(strArr) == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let from: array_like<'a> => array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fromMap", - "kind": "value", - "name": "fromMap", - "docstrings": [ - "Creates a new array by applying a function (the second argument) to each item\nin the `array_like` first argument. See\n[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\non MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nlet code = s => Js.String.charCodeAt(0, s)\nJs.Array2.fromMap(strArr, code) == [97.0, 98.0, 99.0, 100.0]\n```" - ], - "signature": "let fromMap: (array_like<'a>, 'a => 'b) => array<'b>", - "deprecated": "" - }, - { - "id": "Js.Array2.isArray", - "kind": "value", - "name": "isArray", - "docstrings": [ - "Returns `true` if its argument is an array; `false` otherwise. This is a runtime check, which is why the second example returns `true`\\---a list is internally represented as a nested JavaScript array.\n\n## Examples\n\n```rescript\nJs.Array2.isArray([5, 2, 3, 1, 4]) == true\nJs.Array2.isArray(list{5, 2, 3, 1, 4}) == true\nJs.Array2.isArray(\"abcd\") == false\n```" - ], - "signature": "let isArray: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Returns the number of elements in the array. See\n[`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length)\non MDN." - ], - "signature": "let length: array<'a> => int", - "deprecated": "" - }, - { - "id": "Js.Array2.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [ - "Copies from the first element in the given array to the designated `~to_`\nposition, returning the resulting array. *This function modifies the original\narray.* See\n[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.copyWithin(arr, ~to_=2) == [100, 101, 100, 101, 102]\narr == [100, 101, 100, 101, 102]\n```" - ], - "signature": "let copyWithin: (t<'a>, ~to_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [ - "Copies starting at element `~from` in the given array to the designated `~to_`\nposition, returning the resulting array. *This function modifies the original\narray.* See\n[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.copyWithinFrom(arr, ~from=2, ~to_=0) == [102, 103, 104, 103, 104]\narr == [102, 103, 104, 103, 104]\n```" - ], - "signature": "let copyWithinFrom: (t<'a>, ~to_: int, ~from: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [ - "Copies starting at element `~start` in the given array up to but not including\n`~end_` to the designated `~to_` position, returning the resulting array. *This\nfunction modifies the original array.* See\n[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105]\nJs.Array2.copyWithinFromRange(arr, ~start=2, ~end_=5, ~to_=1) == [100, 102, 103, 104, 104, 105]\narr == [100, 102, 103, 104, 104, 105]\n```" - ], - "signature": "let copyWithinFromRange: (t<'a>, ~to_: int, ~start: int, ~end_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [ - "Sets all elements of the given array (the first arumgent) to the designated\nvalue (the secon argument), returning the resulting array. *This function\nmodifies the original array.*\n\nSee\n[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.fillInPlace(arr, 99) == [99, 99, 99, 99, 99]\narr == [99, 99, 99, 99, 99]\n```" - ], - "signature": "let fillInPlace: (t<'a>, 'a) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [ - "Sets all elements of the given array (the first arumgent) from position `~from`\nto the end to the designated value (the second argument), returning the\nresulting array. *This function modifies the original array.* See\n[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.fillFromInPlace(arr, 99, ~from=2) == [100, 101, 99, 99, 99]\narr == [100, 101, 99, 99, 99]\n```" - ], - "signature": "let fillFromInPlace: (t<'a>, 'a, ~from: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [ - "Sets the elements of the given array (the first arumgent) from position\n`~start` up to but not including position `~end_` to the designated value (the\nsecond argument), returning the resulting array. *This function modifies the\noriginal array.* See\n[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.fillRangeInPlace(arr, 99, ~start=1, ~end_=4) == [100, 99, 99, 99, 104]\narr == [100, 99, 99, 99, 104]\n```" - ], - "signature": "let fillRangeInPlace: (t<'a>, 'a, ~start: int, ~end_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "If the array is not empty, removes the last element and returns it as\n`Some(value)`; returns `None` if the array is empty. *This function modifies\nthe original array.* See\n[`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.pop(arr) == Some(104)\narr == [100, 101, 102, 103]\n\nlet empty: array = []\nJs.Array2.pop(empty) == None\n```" - ], - "signature": "let pop: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.push", - "kind": "value", - "name": "push", - "docstrings": [ - "Appends the given value to the array, returning the number of elements in the\nupdated array. *This function modifies the original array.* See\n[`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array2.push(arr, \"dog\") == 4\narr == [\"ant\", \"bee\", \"cat\", \"dog\"]\n```" - ], - "signature": "let push: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.pushMany", - "kind": "value", - "name": "pushMany", - "docstrings": [ - "Appends the values from one array (the second argument) to another (the first\nargument), returning the number of elements in the updated array. *This\nfunction modifies the original array.* See\n[`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array2.pushMany(arr, [\"dog\", \"elk\"]) == 5\narr == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```" - ], - "signature": "let pushMany: (t<'a>, array<'a>) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [ - "Returns an array with the elements of the input array in reverse order. *This\nfunction modifies the original array.* See\n[`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array2.reverseInPlace(arr) == [\"cat\", \"bee\", \"ant\"]\narr == [\"cat\", \"bee\", \"ant\"]\n```" - ], - "signature": "let reverseInPlace: t<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.shift", - "kind": "value", - "name": "shift", - "docstrings": [ - "If the array is not empty, removes the first element and returns it as\n`Some(value)`; returns `None` if the array is empty. *This function modifies\nthe original array.* See\n[`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array2.shift(arr) == Some(100)\narr == [101, 102, 103, 104]\n\nlet empty: array = []\nJs.Array2.shift(empty) == None\n```" - ], - "signature": "let shift: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [ - "Sorts the given array in place and returns the sorted array. JavaScript sorts\nthe array by converting the arguments to UTF-16 strings and sorting them. See\nthe second example with sorting numbers, which does not do a numeric sort.\n*This function modifies the original array.* See\n[`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\non MDN.\n\n## Examples\n\n```rescript\nlet words = [\"bee\", \"dog\", \"ant\", \"cat\"]\nJs.Array2.sortInPlace(words) == [\"ant\", \"bee\", \"cat\", \"dog\"]\nwords == [\"ant\", \"bee\", \"cat\", \"dog\"]\n\nlet numbers = [3, 30, 10, 1, 20, 2]\nJs.Array2.sortInPlace(numbers) == [1, 10, 2, 20, 3, 30]\nnumbers == [1, 10, 2, 20, 3, 30]\n```" - ], - "signature": "let sortInPlace: t<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [ - "Sorts the given array in place and returns the sorted array. *This function\nmodifies the original array.*\n\nThe first argument to `sortInPlaceWith()` is a function that compares two items\nfrom the array and returns:\n\n* an integer less than zero if the first item is less than the second item \\*\n zero if the items are equal \\* an integer greater than zero if the first item is\n greater than the second item\n\nSee\n[`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\non MDN.\n\n## Examples\n\n```rescript\n// sort by word length\nlet words = [\"horse\", \"aardvark\", \"dog\", \"camel\"]\nlet byLength = (s1, s2) => Js.String.length(s1) - Js.String.length(s2)\n\nJs.Array2.sortInPlaceWith(words, byLength) == [\"dog\", \"horse\", \"camel\", \"aardvark\"]\n\n// sort in reverse numeric order\nlet numbers = [3, 30, 10, 1, 20, 2]\nlet reverseNumeric = (n1, n2) => n2 - n1\nJs.Array2.sortInPlaceWith(numbers, reverseNumeric) == [30, 20, 10, 3, 2, 1]\n```" - ], - "signature": "let sortInPlaceWith: (t<'a>, ('a, 'a) => int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.spliceInPlace", - "kind": "value", - "name": "spliceInPlace", - "docstrings": [ - "Starting at position `~pos`, remove `~remove` elements and then add the\nelements from the `~add` array. Returns an array consisting of the removed\nitems. *This function modifies the original array.* See\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.spliceInPlace(arr, ~pos=2, ~remove=2, ~add=[\"x\", \"y\", \"z\"]) == [\"c\", \"d\"]\narr == [\"a\", \"b\", \"x\", \"y\", \"z\", \"e\", \"f\"]\n\nlet arr2 = [\"a\", \"b\", \"c\", \"d\"]\nJs.Array2.spliceInPlace(arr2, ~pos=3, ~remove=0, ~add=[\"x\", \"y\"]) == []\narr2 == [\"a\", \"b\", \"c\", \"x\", \"y\", \"d\"]\n\nlet arr3 = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.spliceInPlace(arr3, ~pos=9, ~remove=2, ~add=[\"x\", \"y\", \"z\"]) == []\narr3 == [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"x\", \"y\", \"z\"]\n```" - ], - "signature": "let spliceInPlace: (t<'a>, ~pos: int, ~remove: int, ~add: array<'a>) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.removeFromInPlace", - "kind": "value", - "name": "removeFromInPlace", - "docstrings": [ - "Removes elements from the given array starting at position `~pos` to the end of\nthe array, returning the removed elements. *This function modifies the original\narray.* See\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.removeFromInPlace(arr, ~pos=4) == [\"e\", \"f\"]\narr == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let removeFromInPlace: (t<'a>, ~pos: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.removeCountInPlace", - "kind": "value", - "name": "removeCountInPlace", - "docstrings": [ - "Removes `~count` elements from the given array starting at position `~pos`,\nreturning the removed elements. *This function modifies the original array.*\nSee\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array2.removeCountInPlace(arr, ~pos=2, ~count=3) == [\"c\", \"d\", \"e\"]\narr == [\"a\", \"b\", \"f\"]\n```" - ], - "signature": "let removeCountInPlace: (t<'a>, ~pos: int, ~count: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.unshift", - "kind": "value", - "name": "unshift", - "docstrings": [ - "Adds the given element to the array, returning the new number of elements in\nthe array. *This function modifies the original array.* See\n[`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"b\", \"c\", \"d\"]\nJs.Array2.unshift(arr, \"a\") == 4\narr == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let unshift: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.unshiftMany", - "kind": "value", - "name": "unshiftMany", - "docstrings": [ - "Adds the elements in the second array argument at the beginning of the first\narray argument, returning the new number of elements in the array. *This\nfunction modifies the original array.* See\n[`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"d\", \"e\"]\nJs.Array2.unshiftMany(arr, [\"a\", \"b\", \"c\"]) == 5\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let unshiftMany: (t<'a>, array<'a>) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.append", - "kind": "value", - "name": "append", - "docstrings": [], - "signature": "let append: (t<'a>, 'a) => t<'a>", - "deprecated": "`append` is not type-safe. Use `concat` instead." - }, - { - "id": "Js.Array2.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "Concatenates the second array argument to the first array argument, returning a\nnew array. The original arrays are not modified. See\n[`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.concat([\"a\", \"b\"], [\"c\", \"d\", \"e\"]) == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "The second argument to `concatMany()` is an array of arrays; these are added at\nthe end of the first argument, returning a new array. See\n[`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.concatMany([\"a\", \"b\", \"c\"], [[\"d\", \"e\"], [\"f\", \"g\", \"h\"]]) == [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n ]\n```" - ], - "signature": "let concatMany: (t<'a>, array>) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "Returns true if the given value is in the array, `false` otherwise. See\n[`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.includes([\"a\", \"b\", \"c\"], \"b\") == true\nJs.Array2.includes([\"a\", \"b\", \"c\"], \"x\") == false\n```" - ], - "signature": "let includes: (t<'a>, 'a) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "Returns the index of the first element in the array that has the given value.\nIf the value is not in the array, returns -1. See\n[`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.indexOf([100, 101, 102, 103], 102) == 2\nJs.Array2.indexOf([100, 101, 102, 103], 999) == -1\n```" - ], - "signature": "let indexOf: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "Returns the index of the first element in the array with the given value. The\nsearch starts at position `~from`. See\n[`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.indexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\"], \"a\", ~from=2) == 2\nJs.Array2.indexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\"], \"a\", ~from=3) == 4\nJs.Array2.indexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\"], \"b\", ~from=2) == -1\n```" - ], - "signature": "let indexOfFrom: (t<'a>, 'a, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "This function converts each element of the array to a string (via JavaScript)\nand concatenates them, separated by the string given in the first argument,\ninto a single string. See\n[`Array.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.joinWith([\"ant\", \"bee\", \"cat\"], \"--\") == \"ant--bee--cat\"\nJs.Array2.joinWith([\"door\", \"bell\"], \"\") == \"doorbell\"\nJs.Array2.joinWith([2020, 9, 4], \"/\") == \"2020/9/4\"\nJs.Array2.joinWith([2.5, 3.6, 3e-2], \";\") == \"2.5;3.6;0.03\"\n```" - ], - "signature": "let joinWith: (t<'a>, string) => string", - "deprecated": "" - }, - { - "id": "Js.Array2.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "Returns the index of the last element in the array that has the given value. If\nthe value is not in the array, returns -1. See\n[`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.lastIndexOf([\"a\", \"b\", \"a\", \"c\"], \"a\") == 2\nJs.Array2.lastIndexOf([\"a\", \"b\", \"a\", \"c\"], \"x\") == -1\n```" - ], - "signature": "let lastIndexOf: (t<'a>, 'a) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "Returns the index of the last element in the array that has the given value,\nsearching from position `~from` down to the start of the array. If the value is\nnot in the array, returns -1. See\n[`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.lastIndexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\", \"d\"], \"a\", ~from=3) == 2\nJs.Array2.lastIndexOfFrom([\"a\", \"b\", \"a\", \"c\", \"a\", \"d\"], \"c\", ~from=2) == -1\n```" - ], - "signature": "let lastIndexOfFrom: (t<'a>, 'a, ~from: int) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "Returns a shallow copy of the given array from the `~start` index up to but not\nincluding the `~end_` position. Negative numbers indicate an offset from the\nend of the array. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105, 106]\nJs.Array2.slice(arr, ~start=2, ~end_=5) == [102, 103, 104]\nJs.Array2.slice(arr, ~start=-3, ~end_=-1) == [104, 105]\nJs.Array2.slice(arr, ~start=9, ~end_=10) == []\n```" - ], - "signature": "let slice: (t<'a>, ~start: int, ~end_: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Returns a copy of the entire array. Same as `Js.Array2.Slice(arr, ~start=0,\n~end_=Js.Array2.length(arr))`. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." - ], - "signature": "let copy: t<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [ - "Returns a shallow copy of the given array from the given index to the end. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." - ], - "signature": "let sliceFrom: (t<'a>, int) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts the array to a string. Each element is converted to a string using\nJavaScript. Unlike the JavaScript `Array.toString()`, all elements in a\nReasonML array must have the same type. See\n[`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.toString([3.5, 4.6, 7.8]) == \"3.5,4.6,7.8\"\nJs.Array2.toString([\"a\", \"b\", \"c\"]) == \"a,b,c\"\n```" - ], - "signature": "let toString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array2.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Converts the array to a string using the conventions of the current locale.\nEach element is converted to a string using JavaScript. Unlike the JavaScript\n`Array.toLocaleString()`, all elements in a ReasonML array must have the same\ntype. See\n[`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.toLocaleString([Js.Date.make()])\n// returns \"3/19/2020, 10:52:11 AM\" for locale en_US.utf8\n// returns \"2020-3-19 10:52:11\" for locale de_DE.utf8\n```" - ], - "signature": "let toLocaleString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array2.every", - "kind": "value", - "name": "every", - "docstrings": [ - "The first argument to `every()` is an array. The second argument is a predicate\nfunction that returns a boolean. The `every()` function returns `true` if the\npredicate function is true for all items in the given array. If given an empty\narray, returns `true`. See\n[`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every)\non MDN.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nJs.Array2.every([6, 22, 8, 4], isEven) == true\nJs.Array2.every([6, 22, 7, 4], isEven) == false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [ - "The first argument to `everyi()` is an array. The second argument is a\npredicate function with two arguments: an array element and that element’s\nindex; it returns a boolean. The `everyi()` function returns `true` if the\npredicate function is true for all items in the given array. If given an empty\narray, returns `true`. See\n[`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every)\non MDN.\n\n## Examples\n\n```rescript\n// determine if all even-index items are positive\nlet evenIndexPositive = (item, index) => mod(index, 2) == 0 ? item > 0 : true\n\nJs.Array2.everyi([6, -3, 5, 8], evenIndexPositive) == true\nJs.Array2.everyi([6, 3, -5, 8], evenIndexPositive) == false\n```" - ], - "signature": "let everyi: (t<'a>, ('a, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "Applies the given predicate function (the second argument) to each element in\nthe array; the result is an array of those elements for which the predicate\nfunction returned `true`. See\n[`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\non MDN.\n\n## Examples\n\n```rescript\nlet nonEmpty = s => s != \"\"\nJs.Array2.filter([\"abc\", \"\", \"\", \"def\", \"ghi\"], nonEmpty) == [\"abc\", \"def\", \"ghi\"]\n```" - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [ - "Each element of the given array are passed to the predicate function. The\nreturn value is an array of all those elements for which the predicate function\nreturned `true`.\n\nSee\n[`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\non MDN.\n\n## Examples\n\n```rescript\n// keep only positive elements at odd indices\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array2.filteri([6, 3, 5, 8, 7, -4, 1], positiveOddElement) == [3, 8]\n```" - ], - "signature": "let filteri: (t<'a>, ('a, int) => bool) => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.find", - "kind": "value", - "name": "find", - "docstrings": [ - "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find first negative element\nJs.Array2.find([33, 22, -55, 77, -44], x => x < 0) == Some(-55)\nJs.Array2.find([33, 22, 55, 77, 44], x => x < 0) == None\n```" - ], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.findi", - "kind": "value", - "name": "findi", - "docstrings": [ - "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate. The\npredicate function takes an array element and an index as its parameters. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find first positive item at an odd index\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array2.findi([66, -33, 55, 88, 22], positiveOddElement) == Some(88)\nJs.Array2.findi([66, -33, 55, -88, 22], positiveOddElement) == None\n```" - ], - "signature": "let findi: (t<'a>, ('a, int) => bool) => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array2.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [ - "Returns the index of the first element in the array that satisifies the given\npredicate function, or -1 if no element satisifies the predicate. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.findIndex([33, 22, -55, 77, -44], x => x < 0) == 2\nJs.Array2.findIndex([33, 22, 55, 77, 44], x => x < 0) == -1\n```" - ], - "signature": "let findIndex: (t<'a>, 'a => bool) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [ - "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate. The\npredicate function takes an array element and an index as its parameters. See\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find index of first positive item at an odd index\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array2.findIndexi([66, -33, 55, 88, 22], positiveOddElement) == 3\nJs.Array2.findIndexi([66, -33, 55, -88, 22], positiveOddElement) == -1\n```" - ], - "signature": "let findIndexi: (t<'a>, ('a, int) => bool) => int", - "deprecated": "" - }, - { - "id": "Js.Array2.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "The `forEach()` function applies the function given as the second argument to\neach element in the array. The function you provide returns `unit`, and the\n`forEach()` function also returns `unit`. You use `forEach()` when you need to\nprocess each element in the array but not return any new array or value; for\nexample, to print the items in an array. See\n[`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\non MDN.\n\n## Examples\n\n```rescript\n// display all elements in an array\nJs.Array2.forEach([\"a\", \"b\", \"c\"], x => Js.log(x)) == ()\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Array2.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [ - "The `forEachi()` function applies the function given as the second argument to\neach element in the array. The function you provide takes an item in the array\nand its index number, and returns `unit`. The `forEachi()` function also\nreturns `unit`. You use `forEachi()` when you need to process each element in\nthe array but not return any new array or value; for example, to print the\nitems in an array. See\n[`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\non MDN.\n\n## Examples\n\n```rescript\n// display all elements in an array as a numbered list\nJs.Array2.forEachi([\"a\", \"b\", \"c\"], (item, index) => Js.log2(index + 1, item)) == ()\n```" - ], - "signature": "let forEachi: (t<'a>, ('a, int) => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Array2.map", - "kind": "value", - "name": "map", - "docstrings": [ - "Applies the function (the second argument) to each item in the array, returning\na new array. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]\nJs.Array2.map([\"animal\", \"vegetable\", \"mineral\"], Js.String.length) == [6, 9, 7]\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Array2.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [ - "Applies the function (the second argument) to each item in the array, returning\na new array. The function acceps two arguments: an item from the array and its\nindex number. The result array does not have to have elements of the same type\nas the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array2.mapi([10, 11, 12], product) == [0, 11, 24]\n```" - ], - "signature": "let mapi: (t<'a>, ('a, int) => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Array2.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "The `reduce()` function takes three parameters: an array, a *reducer function*,\nand a beginning accumulator value. The reducer function has two parameters: an\naccumulated value and an element of the array.\n\n`reduce()` first calls the reducer function with the beginning value and the\nfirst element in the array. The result becomes the new accumulator value, which\nis passed in to the reducer function along with the second element in the\narray. `reduce()` proceeds through the array, passing in the result of each\nstage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduce()`. See\n[`Array.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\non MDN.\n\n## Examples\n\n```rescript\nlet sumOfSquares = (accumulator, item) => accumulator + item * item\n\nJs.Array2.reduce([10, 2, 4], sumOfSquares, 0) == 120\nJs.Array2.reduce([10, 2, 4], \"*\", 1) == 80\nJs.Array2.reduce(\n [\"animal\", \"vegetable\", \"mineral\"],\n (acc, item) => acc + Js.String.length(item),\n 0,\n) == 22 // 6 + 9 + 7\nJs.Array2.reduce([2.0, 4.0], (acc, item) => item /. acc, 1.0) == 2.0 // 4.0 / (2.0 / 1.0)\n```" - ], - "signature": "let reduce: (t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [ - "The `reducei()` function takes three parameters: an array, a *reducer\nfunction*, and a beginning accumulator value. The reducer function has three\nparameters: an accumulated value, an element of the array, and the index of\nthat element.\n\n`reducei()` first calls the reducer function with the beginning value, the\nfirst element in the array, and zero (its index). The result becomes the new\naccumulator value, which is passed to the reducer function along with the\nsecond element in the array and one (its index). `reducei()` proceeds from left\nto right through the array, passing in the result of each stage as the\naccumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reducei()`. See\n[`Array.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\non MDN.\n\n## Examples\n\n```rescript\n// find sum of even-index elements in array\nlet sumOfEvens = (accumulator, item, index) =>\n if mod(index, 2) == 0 {\n accumulator + item\n } else {\n accumulator\n }\n\nJs.Array2.reducei([2, 5, 1, 4, 3], sumOfEvens, 0) == 6\n```" - ], - "signature": "let reducei: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [ - "The `reduceRight()` function takes three parameters: an array, a *reducer\nfunction*, and a beginning accumulator value. The reducer function has two\nparameters: an accumulated value and an element of the array.\n\n`reduceRight()` first calls the reducer function with the beginning value and\nthe last element in the array. The result becomes the new accumulator value,\nwhich is passed in to the reducer function along with the next-to-last element\nin the array. `reduceRight()` proceeds from right to left through the array,\npassing in the result of each stage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduceRight()`. See\n[`Array.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight)\non MDN.\n\n**NOTE:** In many cases, `reduce()` and `reduceRight()` give the same result.\nHowever, see the last example here and compare it to the example from\n`reduce()`, where order makes a difference.\n\n## Examples\n\n```rescript\nlet sumOfSquares = (accumulator, item) => accumulator + item * item\n\nJs.Array2.reduceRight([10, 2, 4], sumOfSquares, 0) == 120\nJs.Array2.reduceRight([2.0, 4.0], (acc, item) => item /. acc, 1.0) == 0.5 // 2.0 / (4.0 / 1.0)\n```" - ], - "signature": "let reduceRight: (t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [ - "The `reduceRighti()` function takes three parameters: an array, a *reducer\nfunction*, and a beginning accumulator value. The reducer function has three\nparameters: an accumulated value, an element of the array, and the index of\nthat element. `reduceRighti()` first calls the reducer function with the\nbeginning value, the last element in the array, and its index (length of array\nminus one). The result becomes the new accumulator value, which is passed in to\nthe reducer function along with the second element in the array and one (its\nindex). `reduceRighti()` proceeds from right to left through the array, passing\nin the result of each stage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduceRighti()`. See\n[`Array.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight)\non MDN.\n\n**NOTE:** In many cases, `reducei()` and `reduceRighti()` give the same result.\nHowever, there are cases where the order in which items are processed makes a\ndifference.\n\n## Examples\n\n```rescript\n// find sum of even-index elements in array\nlet sumOfEvens = (accumulator, item, index) =>\n if mod(index, 2) == 0 {\n accumulator + item\n } else {\n accumulator\n }\n\nJs.Array2.reduceRighti([2, 5, 1, 4, 3], sumOfEvens, 0) == 6\n```" - ], - "signature": "let reduceRighti: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "deprecated": "" - }, - { - "id": "Js.Array2.some", - "kind": "value", - "name": "some", - "docstrings": [ - "Returns `true` if the predicate function given as the second argument to\n`some()` returns `true` for any element in the array; `false` otherwise.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nJs.Array2.some([3, 7, 5, 2, 9], isEven) == true\nJs.Array2.some([3, 7, 5, 1, 9], isEven) == false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.somei", - "kind": "value", - "name": "somei", - "docstrings": [ - "Returns `true` if the predicate function given as the second argument to\n`somei()` returns `true` for any element in the array; `false` otherwise. The\npredicate function has two arguments: an item from the array and the index\nvalue\n\n## Examples\n\n```rescript\n// Does any string in the array\n// have the same length as its index?\n\nlet sameLength = (str, index) => Js.String.length(str) == index\n\n// \"ef\" has length 2 and is it at index 2\nJs.Array2.somei([\"ab\", \"cd\", \"ef\", \"gh\"], sameLength) == true\n// no item has the same length as its index\nJs.Array2.somei([\"a\", \"bc\", \"def\", \"gh\"], sameLength) == false\n```" - ], - "signature": "let somei: (t<'a>, ('a, int) => bool) => bool", - "deprecated": "" - }, - { - "id": "Js.Array2.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [ - "Returns the value at the given position in the array if the position is in\nbounds; returns the JavaScript value `undefined` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array2.unsafe_get(arr, 3) == 103\nJs.Array2.unsafe_get(arr, 4) // returns undefined\n```" - ], - "signature": "let unsafe_get: (array<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Js.Array2.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [ - "Sets the value at the given position in the array if the position is in bounds.\nIf the index is out of bounds, well, “here there be dragons.“\n\n*This function modifies the original array.*\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array2.unsafe_set(arr, 3, 99)\n// result is [100, 101, 102, 99];\n\nJs.Array2.unsafe_set(arr, 4, 88)\n// result is [100, 101, 102, 99, 88]\n\nJs.Array2.unsafe_set(arr, 6, 77)\n// result is [100, 101, 102, 99, 88, <1 empty item>, 77]\n\nJs.Array2.unsafe_set(arr, -1, 66)\n// you don't want to know.\n```" - ], - "signature": "let unsafe_set: (array<'a>, int, 'a) => unit", - "deprecated": "" - } - ] - }, - "js/array": { - "id": "Js.Array", - "name": "Array", - "docstrings": [ - "Provide bindings to JS array", - "Provides bindings to JavaScript’s `Array` functions. These bindings are\noptimized for pipe-last (`|>`), where the array to be processed is the last\nparameter in the function." - ], - "items": [ - { - "id": "Js.Array.t", - "kind": "type", - "name": "t", - "docstrings": ["The type used to describe a JavaScript array."], - "signature": "type t<'a> = array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.array_like", - "kind": "type", - "name": "array_like", - "docstrings": [ - "A type used to describe JavaScript objects that are like an array or are iterable." - ], - "signature": "type array_like<'a> = Js_array2.array_like<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.from", - "kind": "value", - "name": "from", - "docstrings": [ - "Creates a shallow copy of an array from an array-like object. See [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nJs.Array.from(strArr) == [\"a\", \"b\", \"c\", \"d\"]\n```" - ], - "signature": "let from: array_like<'a> => array<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.fromMap", - "kind": "value", - "name": "fromMap", - "docstrings": [ - "Creates a new array by applying a function (the second argument) to each item\nin the `array_like` first argument. See\n[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\non MDN.\n\n## Examples\n\n```rescript\nlet strArr = Js.String.castToArrayLike(\"abcd\")\nlet code = s => Js.String.charCodeAt(0, s)\nJs.Array.fromMap(strArr, code) == [97.0, 98.0, 99.0, 100.0]\n```" - ], - "signature": "let fromMap: (array_like<'a>, 'a => 'b) => array<'b>", - "deprecated": "" - }, - { - "id": "Js.Array.isArray", - "kind": "value", - "name": "isArray", - "docstrings": [], - "signature": "let isArray: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.Array.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Returns the number of elements in the array. See [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN." - ], - "signature": "let length: array<'a> => int", - "deprecated": "" - }, - { - "id": "Js.Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (~to_: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.copyWithinFrom", - "kind": "value", - "name": "copyWithinFrom", - "docstrings": [], - "signature": "let copyWithinFrom: (~to_: int, ~from: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.copyWithinFromRange", - "kind": "value", - "name": "copyWithinFromRange", - "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", - "docstrings": [], - "signature": "let fillInPlace: ('a, t<'a>) => 'b" - }, - { - "id": "Js.Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", - "docstrings": [], - "signature": "let fillFromInPlace: ('a, ~from: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", - "docstrings": [], - "signature": "let fillRangeInPlace: ('a, ~start: int, ~end_: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "If the array is not empty, removes the last element and returns it as `Some(value)`; returns `None` if the array is empty. *This function modifies the original array.* See [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array.pop(arr) == Some(104)\narr == [100, 101, 102, 103]\n\nlet empty: array = []\nJs.Array.pop(empty) == None\n```" - ], - "signature": "let pop: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.push", - "kind": "value", - "name": "push", - "docstrings": [], - "signature": "let push: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.pushMany", - "kind": "value", - "name": "pushMany", - "docstrings": [], - "signature": "let pushMany: (array<'a>, t<'a>) => int" - }, - { - "id": "Js.Array.reverseInPlace", - "kind": "value", - "name": "reverseInPlace", - "docstrings": [ - "Returns an array with the elements of the input array in reverse order. *This function modifies the original array.* See [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array.reverseInPlace(arr) == [\"cat\", \"bee\", \"ant\"]\narr == [\"cat\", \"bee\", \"ant\"]\n```" - ], - "signature": "let reverseInPlace: t<'a> => 'this", - "deprecated": "" - }, - { - "id": "Js.Array.shift", - "kind": "value", - "name": "shift", - "docstrings": [ - "If the array is not empty, removes the first element and returns it as `Some(value)`; returns `None` if the array is empty. *This function modifies the original array.* See [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array.shift(arr) == Some(100)\narr == [101, 102, 103, 104]\n\nlet empty: array = []\nJs.Array.shift(empty) == None\n```" - ], - "signature": "let shift: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Array.sortInPlace", - "kind": "value", - "name": "sortInPlace", - "docstrings": [ - "Sorts the given array in place and returns the sorted array. JavaScript sorts the array by converting the arguments to UTF-16 strings and sorting them. See the second example with sorting numbers, which does not do a numeric sort. *This function modifies the original array.* See [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet words = [\"bee\", \"dog\", \"ant\", \"cat\"]\nJs.Array.sortInPlace(words) == [\"ant\", \"bee\", \"cat\", \"dog\"]\nwords == [\"ant\", \"bee\", \"cat\", \"dog\"]\n\nlet numbers = [3, 30, 10, 1, 20, 2]\nJs.Array.sortInPlace(numbers) == [1, 10, 2, 20, 3, 30]\nnumbers == [1, 10, 2, 20, 3, 30]\n```" - ], - "signature": "let sortInPlace: t<'a> => 'this", - "deprecated": "This has been deprecated and will be removed in v13. Use functions from the `Array` module instead." - }, - { - "id": "Js.Array.sortInPlaceWith", - "kind": "value", - "name": "sortInPlaceWith", - "docstrings": [], - "signature": "let sortInPlaceWith: (('a, 'a) => int, t<'a>) => 'b" - }, - { - "id": "Js.Array.spliceInPlace", - "kind": "value", - "name": "spliceInPlace", - "docstrings": [], - "signature": "let spliceInPlace: (~pos: int, ~remove: int, ~add: array<'a>, t<'a>) => 'b" - }, - { - "id": "Js.Array.removeFromInPlace", - "kind": "value", - "name": "removeFromInPlace", - "docstrings": [], - "signature": "let removeFromInPlace: (~pos: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.removeCountInPlace", - "kind": "value", - "name": "removeCountInPlace", - "docstrings": [], - "signature": "let removeCountInPlace: (~pos: int, ~count: int, t<'a>) => 'b" - }, - { - "id": "Js.Array.unshift", - "kind": "value", - "name": "unshift", - "docstrings": [], - "signature": "let unshift: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.unshiftMany", - "kind": "value", - "name": "unshiftMany", - "docstrings": [], - "signature": "let unshiftMany: (array<'a>, t<'a>) => int" - }, - { - "id": "Js.Array.concat", - "kind": "value", - "name": "concat", - "docstrings": [], - "signature": "let concat: ('a, t<'b>) => 'a" - }, - { - "id": "Js.Array.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [], - "signature": "let concatMany: (array<'a>, t<'b>) => 'a" - }, - { - "id": "Js.Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: ('a, t<'a>) => bool" - }, - { - "id": "Js.Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: ('a, ~from: int, t<'a>) => int" - }, - { - "id": "Js.Array.join", - "kind": "value", - "name": "join", - "docstrings": [], - "signature": "let join: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (string, t<'a>) => string" - }, - { - "id": "Js.Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: ('a, t<'a>) => int" - }, - { - "id": "Js.Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: ('a, ~from: int, t<'a>) => int" - }, - { - "id": "Js.Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (int, ~end_: int, ~obj: t<'a>) => 'b" - }, - { - "id": "Js.Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "Returns a copy of the entire array. Same as `Js.Array.Slice(~start=0,\n~end_=Js.Array.length(arr), arr)`. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." - ], - "signature": "let copy: t<'a> => 'this", - "deprecated": "" - }, - { - "id": "Js.Array.sliceFrom", - "kind": "value", - "name": "sliceFrom", - "docstrings": [], - "signature": "let sliceFrom: (int, t<'a>) => 'b" - }, - { - "id": "Js.Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts the array to a string. Each element is converted to a string using\nJavaScript. Unlike the JavaScript `Array.toString()`, all elements in a\nReasonML array must have the same type. See\n[`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.toString([3.5, 4.6, 7.8]) == \"3.5,4.6,7.8\"\nJs.Array.toString([\"a\", \"b\", \"c\"]) == \"a,b,c\"\n```" - ], - "signature": "let toString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Converts the array to a string using the conventions of the current locale.\nEach element is converted to a string using JavaScript. Unlike the JavaScript\n`Array.toLocaleString()`, all elements in a ReasonML array must have the same\ntype. See\n[`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.toLocaleString([Js.Date.make()])\n// returns \"3/19/2020, 10:52:11 AM\" for locale en_US.utf8\n// returns \"2020-3-19 10:52:11\" for locale de_DE.utf8\n```" - ], - "signature": "let toLocaleString: t<'a> => string", - "deprecated": "" - }, - { - "id": "Js.Array.every", - "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: ('a => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.everyi", - "kind": "value", - "name": "everyi", - "docstrings": [], - "signature": "let everyi: (('a, int) => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: ('a => bool, t<'a>) => 'b" - }, - { - "id": "Js.Array.filteri", - "kind": "value", - "name": "filteri", - "docstrings": [], - "signature": "let filteri: (('a, int) => bool, t<'a>) => 'b" - }, - { - "id": "Js.Array.find", - "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: ('a => bool, t<'a>) => option<'a>" - }, - { - "id": "Js.Array.findi", - "kind": "value", - "name": "findi", - "docstrings": [], - "signature": "let findi: (('a, int) => bool, t<'a>) => option<'a>" - }, - { - "id": "Js.Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: ('a => bool, t<'a>) => int" - }, - { - "id": "Js.Array.findIndexi", - "kind": "value", - "name": "findIndexi", - "docstrings": [], - "signature": "let findIndexi: (('a, int) => bool, t<'a>) => int" - }, - { - "id": "Js.Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: ('a => unit, t<'a>) => unit" - }, - { - "id": "Js.Array.forEachi", - "kind": "value", - "name": "forEachi", - "docstrings": [], - "signature": "let forEachi: (('a, int) => unit, t<'a>) => unit" - }, - { - "id": "Js.Array.map", - "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: ('a => 'b, t<'a>) => t<'b>" - }, - { - "id": "Js.Array.mapi", - "kind": "value", - "name": "mapi", - "docstrings": [], - "signature": "let mapi: (('a, int) => 'b, t<'a>) => t<'b>" - }, - { - "id": "Js.Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (('a, 'b) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.reducei", - "kind": "value", - "name": "reducei", - "docstrings": [], - "signature": "let reducei: (('a, 'b, int) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (('a, 'b) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.reduceRighti", - "kind": "value", - "name": "reduceRighti", - "docstrings": [], - "signature": "let reduceRighti: (('a, 'b, int) => 'a, 'a, t<'b>) => 'a" - }, - { - "id": "Js.Array.some", - "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: ('a => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.somei", - "kind": "value", - "name": "somei", - "docstrings": [], - "signature": "let somei: (('a, int) => bool, t<'a>) => bool" - }, - { - "id": "Js.Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [ - "Returns the value at the given position in the array if the position is in\nbounds; returns the JavaScript value `undefined` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array.unsafe_get(arr, 3) == 103\nJs.Array.unsafe_get(arr, 4) // returns undefined\n```" - ], - "signature": "let unsafe_get: (array<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Js.Array.unsafe_set", - "kind": "value", - "name": "unsafe_set", - "docstrings": [ - "Sets the value at the given position in the array if the position is in bounds.\nIf the index is out of bounds, well, “here there be dragons.“ *This function\nmodifies the original array.*\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103]\nJs.Array.unsafe_set(arr, 3, 99)\n// result is [100, 101, 102, 99]\n\nJs.Array.unsafe_set(arr, 4, 88)\n// result is [100, 101, 102, 99, 88]\n\nJs.Array.unsafe_set(arr, 6, 77)\n// result is [100, 101, 102, 99, 88, <1 empty item>, 77]\n\nJs.Array.unsafe_set(arr, -1, 66)\n// you don't want to know.\n```" - ], - "signature": "let unsafe_set: (array<'a>, int, 'a) => unit", - "deprecated": "" - } - ] - }, - "js/exn": { - "id": "Js.Exn", - "name": "Exn", - "docstrings": [ - "Provide utilities for dealing with Js exceptions", - "Provide utilities for dealing with JS exceptions." - ], - "items": [ - { - "id": "Js.Exn.t", - "kind": "type", - "name": "t", - "docstrings": ["Represents a JS exception"], - "signature": "type t", - "deprecated": "" - }, - { - "id": "Js.Exn.asJsExn", - "kind": "value", - "name": "asJsExn", - "docstrings": [], - "signature": "let asJsExn: exn => option", - "deprecated": "" - }, - { - "id": "Js.Exn.stack", - "kind": "value", - "name": "stack", - "docstrings": [], - "signature": "let stack: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.message", - "kind": "value", - "name": "message", - "docstrings": [], - "signature": "let message: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.name", - "kind": "value", - "name": "name", - "docstrings": [], - "signature": "let name: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [], - "signature": "let fileName: t => option", - "deprecated": "" - }, - { - "id": "Js.Exn.anyToExnInternal", - "kind": "value", - "name": "anyToExnInternal", - "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a Exn.Error if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." - ], - "signature": "let anyToExnInternal: 'a => exn", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseError", - "kind": "value", - "name": "raiseError", - "docstrings": ["Raise Js exception Error object with stacktrace"], - "signature": "let raiseError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseEvalError", - "kind": "value", - "name": "raiseEvalError", - "docstrings": [], - "signature": "let raiseEvalError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseRangeError", - "kind": "value", - "name": "raiseRangeError", - "docstrings": [], - "signature": "let raiseRangeError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseReferenceError", - "kind": "value", - "name": "raiseReferenceError", - "docstrings": [], - "signature": "let raiseReferenceError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseSyntaxError", - "kind": "value", - "name": "raiseSyntaxError", - "docstrings": [], - "signature": "let raiseSyntaxError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseTypeError", - "kind": "value", - "name": "raiseTypeError", - "docstrings": [], - "signature": "let raiseTypeError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.raiseUriError", - "kind": "value", - "name": "raiseUriError", - "docstrings": [], - "signature": "let raiseUriError: string => 'a", - "deprecated": "" - }, - { - "id": "Js.Exn.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(exn)` ignores the provided exn and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit", - "deprecated": "" - } - ] - }, - "js/null_undefined": { - "id": "Js.Null_undefined", - "name": "Null_undefined", - "docstrings": [ - "Contains functionality for dealing with values that can be both `null` and `undefined`" - ], - "items": [ - { - "id": "Js.Null_undefined.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.null_undefined<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [ - "Returns `true` if the given value is null or undefined, `false` otherwise." - ], - "signature": "let isNullable: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.null", - "kind": "value", - "name": "null", - "docstrings": ["The null value of type `Js.null_undefined<'a>`."], - "signature": "let null: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.undefined", - "kind": "value", - "name": "undefined", - "docstrings": ["The undefined value of type `Js.null_undefined<'a>`."], - "signature": "let undefined: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\n\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped, mapped to\na `'b` using the given function `a' => 'b`, then wrapped back up and returned\nas `Js.null_undefined<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.null_undefined) =>\n Js.Null_undefined.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function.\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped and applied to the given function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.null_undefined) =>\n Js.Null_undefined.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.null_undefined<'a>`.\n`Some(a)` => `a`\n`None` => `undefined`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.null_undefined<'a>` to `option<'a>`.\n`a` => `Some(a)`\n`undefined` => `None`\n`null` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Null_undefined.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - }, - "js/nullable": { - "id": "Js.Nullable", - "name": "Nullable", - "docstrings": [ - "Provide utilities for `Js.null_undefined`", - "Contains functionality for dealing with values that can be both `null` and `undefined`" - ], - "items": [ - { - "id": "Js.Nullable.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined", - "deprecated": "" - }, - { - "id": "Js.Nullable.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.null_undefined<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [ - "Returns `true` if the given value is null or undefined, `false` otherwise." - ], - "signature": "let isNullable: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Nullable.null", - "kind": "value", - "name": "null", - "docstrings": ["The null value of type `Js.null_undefined<'a>`."], - "signature": "let null: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.undefined", - "kind": "value", - "name": "undefined", - "docstrings": ["The undefined value of type `Js.null_undefined<'a>`."], - "signature": "let undefined: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\n\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped, mapped to\na `'b` using the given function `a' => 'b`, then wrapped back up and returned\nas `Js.null_undefined<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.null_undefined) =>\n Js.Null_undefined.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Nullable.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function.\nIf `Js.null_undefined<'a>` contains a value, that value is unwrapped and applied to the given function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.null_undefined) =>\n Js.Null_undefined.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Nullable.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.null_undefined<'a>`.\n`Some(a)` => `a`\n`None` => `undefined`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.null_undefined<'a>` to `option<'a>`.\n`a` => `Some(a)`\n`undefined` => `None`\n`null` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Nullable.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - }, - "js/undefined": { - "id": "Js.Undefined", - "name": "Undefined", - "docstrings": [ - "Provide utilities for `Js.undefined<'a>`", - "Provides functionality for dealing with the `Js.undefined<'a>` type" - ], - "items": [ - { - "id": "Js.Undefined.t", - "kind": "type", - "name": "t", - "docstrings": ["Local alias for `Js.undefined<'a>`"], - "signature": "type t<'a> = undefined<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.undefined<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.test", - "kind": "value", - "name": "test", - "docstrings": [ - "Returns `true` if the given value is empty (undefined), `false` otherwise." - ], - "signature": "let test: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Undefined.testAny", - "kind": "value", - "name": "testAny", - "docstrings": [ - "Returns `true` if the given value is empty (undefined).\n\n**since 1.6.1**" - ], - "signature": "let testAny: 'a => bool", - "deprecated": "" - }, - { - "id": "Js.Undefined.empty", - "kind": "value", - "name": "empty", - "docstrings": ["The empty value, `undefined`"], - "signature": "let empty: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [], - "signature": "let getUnsafe: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Undefined.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Undefined.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\nIf `Js.undefined<'a>` contains a value, that value is unwrapped, mapped to a\n`'b` using the given function `a' => 'b`, then wrapped back up and returned as\n`Js.undefined<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.undefined) =>\n Js.Undefined.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Undefined.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function. If\n`Js.undefined<'a>` contains a value, that value is unwrapped and applied to the\ngiven function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.undefined) =>\n Js.Undefined.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Undefined.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.undefined<'a>`.\n`Some(a)` => `a`\n`None` => `empty`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.undefined<'a>` to `option<'a>`\n`a` => `Some(a)`\n`empty` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Undefined.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - }, - "js/null": { - "id": "Js.Null", - "name": "Null", - "docstrings": [ - "Provide utilities for `Js.null<'a>`", - "Provides functionality for dealing with the `Js.null<'a>` type" - ], - "items": [ - { - "id": "Js.Null.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "@unboxed\ntype t<'a> = null<'a> =\n | Value('a)\n | @as(null) Null", - "deprecated": "" - }, - { - "id": "Js.Null.return", - "kind": "value", - "name": "return", - "docstrings": [ - "Constructs a value of `Js.null<'a>` containing a value of `'a`." - ], - "signature": "let return: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.test", - "kind": "value", - "name": "test", - "docstrings": [ - "Returns `true` if the given value is empty (`null`), `false` otherwise." - ], - "signature": "let test: t<'a> => bool", - "deprecated": "" - }, - { - "id": "Js.Null.empty", - "kind": "value", - "name": "empty", - "docstrings": ["The empty value, `null`"], - "signature": "let empty: t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [], - "signature": "let getUnsafe: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Null.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Js.Null.bind", - "kind": "value", - "name": "bind", - "docstrings": [ - "Maps the contained value using the given function.\n\nIf `Js.null<'a>` contains a value, that value is unwrapped, mapped to a `'b`\nusing the given function `'a => 'b`, then wrapped back up and returned as\n`Js.null<'b>`.\n\n## Examples\n\n```rescript\nlet maybeGreetWorld = (maybeGreeting: Js.null) =>\n Js.Null.bind(maybeGreeting, greeting => greeting ++ \" world!\")\n```" - ], - "signature": "let bind: (t<'a>, 'a => 'b) => t<'b>", - "deprecated": "" - }, - { - "id": "Js.Null.iter", - "kind": "value", - "name": "iter", - "docstrings": [ - "Iterates over the contained value with the given function.\nIf `Js.null<'a>` contains a value, that value is unwrapped and applied to the given function.\n\n## Examples\n\n```rescript\nlet maybeSay = (maybeMessage: Js.null) =>\n Js.Null.iter(maybeMessage, message => Js.log(message))\n```" - ], - "signature": "let iter: (t<'a>, 'a => unit) => unit", - "deprecated": "" - }, - { - "id": "Js.Null.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Maps `option<'a>` to `Js.null<'a>`.\n`Some(a)` => `a`\n`None` => `empty`" - ], - "signature": "let fromOption: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.from_opt", - "kind": "value", - "name": "from_opt", - "docstrings": [], - "signature": "let from_opt: option<'a> => t<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Maps `Js.null<'a>` to `option<'a>`.\n`a` => `Some(a)`\n`empty` => `None`" - ], - "signature": "let toOption: t<'a> => option<'a>", - "deprecated": "" - }, - { - "id": "Js.Null.to_opt", - "kind": "value", - "name": "to_opt", - "docstrings": [], - "signature": "let to_opt: t<'a> => option<'a>", - "deprecated": "" - } - ] - } -} diff --git a/apps/docs/markdown-pages/docs/api/stdlib.json b/apps/docs/markdown-pages/docs/api/stdlib.json deleted file mode 100644 index 457ebfbe6..000000000 --- a/apps/docs/markdown-pages/docs/api/stdlib.json +++ /dev/null @@ -1,12625 +0,0 @@ -{ - "stdlib": { - "id": "Stdlib", - "name": "Stdlib", - "docstrings": [], - "items": [ - { - "id": "Stdlib.timeoutId", - "kind": "type", - "name": "timeoutId", - "docstrings": [ - "An `id` representing a timeout started via `setTimeout`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN." - ], - "signature": "type timeoutId = Global.timeoutId" - }, - { - "id": "Stdlib.setTimeout", - "kind": "value", - "name": "setTimeout", - "docstrings": [ - "`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200)\n```" - ], - "signature": "let setTimeout: (unit => unit, int) => timeoutId" - }, - { - "id": "Stdlib.setTimeoutFloat", - "kind": "value", - "name": "setTimeoutFloat", - "docstrings": [ - "`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200.)\n```" - ], - "signature": "let setTimeoutFloat: (unit => unit, float) => timeoutId" - }, - { - "id": "Stdlib.clearTimeout", - "kind": "value", - "name": "clearTimeout", - "docstrings": [ - "`clearTimeout(timeoutId)` clears a scheduled timeout if it hasn't already executed.\n\nSee [`clearTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout) on MDN.\n\n## Examples\n\n```rescript\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 2 seconds.\")\n}, 2000)\n\n// Clearing the timeout right away, before 2 seconds has passed, means that the above callback logging to the console will never run.\nclearTimeout(timeoutId)\n```" - ], - "signature": "let clearTimeout: timeoutId => unit" - }, - { - "id": "Stdlib.intervalId", - "kind": "type", - "name": "intervalId", - "docstrings": [ - "An `id` representing an interval started via `setInterval`.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN." - ], - "signature": "type intervalId = Global.intervalId" - }, - { - "id": "Stdlib.setInterval", - "kind": "value", - "name": "setInterval", - "docstrings": [ - "`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 200 ms (200 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 200 ms.\")\n}, 200)\n\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```" - ], - "signature": "let setInterval: (unit => unit, int) => intervalId" - }, - { - "id": "Stdlib.setIntervalFloat", - "kind": "value", - "name": "setIntervalFloat", - "docstrings": [ - "`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 2 seconds (200 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 200 ms\")\n}, 200.)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeoutFloat(() => {\n clearInterval(intervalId)\n}, 500.0)\n```" - ], - "signature": "let setIntervalFloat: (unit => unit, float) => intervalId" - }, - { - "id": "Stdlib.clearInterval", - "kind": "value", - "name": "clearInterval", - "docstrings": [ - "`clearInterval(intervalId)` clears a scheduled interval.\n\nSee [`clearInterval`](https://developer.mozilla.org/en-US/docs/Web/API/clearInterval) on MDN.\n\n## Examples\n\n```rescript\nlet intervalId = setInterval(() => {\n Console.log(\"This prints in 100 ms\")\n}, 100)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```" - ], - "signature": "let clearInterval: intervalId => unit" - }, - { - "id": "Stdlib.encodeURI", - "kind": "value", - "name": "encodeURI", - "docstrings": [ - "Encodes a URI by replacing characters in the provided string that aren't valid in a URL.\n\nThis is intended to operate on full URIs, so it encodes fewer characters than what `encodeURIComponent` does.\nIf you're looking to encode just parts of a URI, like a query parameter, prefer `encodeURIComponent`.\n\nSee [`encodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI) on MDN.\n\n## Examples\n```rescript\nConsole.log(encodeURI(\"https://rescript-lang.org?array=[someValue]\"))\n// Logs \"https://rescript-lang.org?array=%5BsomeValue%5D\" to the console.\n```" - ], - "signature": "let encodeURI: string => string" - }, - { - "id": "Stdlib.decodeURI", - "kind": "value", - "name": "decodeURI", - "docstrings": [ - "Decodes a previously encoded URI back to a regular string.\n\nThis is intended to operate on full URIs, so it decodes fewer characters than what `decodeURIComponent` does.\nIf you're looking to decode just parts of a URI, like a query parameter, prefer `decodeURIComponent`.\n\nSee [`decodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI) on MDN.\n\n## Examples\n```rescript\nConsole.log(decodeURI(\"https://rescript-lang.org?array=%5BsomeValue%5D\"))\n// Logs \"https://rescript-lang.org?array=[someValue]\" to the console.\n```" - ], - "signature": "let decodeURI: string => string" - }, - { - "id": "Stdlib.encodeURIComponent", - "kind": "value", - "name": "encodeURIComponent", - "docstrings": [ - "Encodes a string so it can be used as part of a URI.\n\nSee [`encodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) on MDN.\n\n## Examples\n```rescript\nConsole.log(encodeURIComponent(\"array=[someValue]\"))\n// Logs \"array%3D%5BsomeValue%5D\" to the console.\n```" - ], - "signature": "let encodeURIComponent: string => string" - }, - { - "id": "Stdlib.decodeURIComponent", - "kind": "value", - "name": "decodeURIComponent", - "docstrings": [ - "Decodes a previously URI encoded string back to its original form.\n\nSee [`decodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) on MDN.\n\n## Examples\n```rescript\nConsole.log(decodeURIComponent(\"array%3D%5BsomeValue%5D\"))\n// Logs \"array=[someValue]\" to the console.\n```" - ], - "signature": "let decodeURIComponent: string => string" - }, - { - "id": "Stdlib.date", - "kind": "type", - "name": "date", - "docstrings": [], - "signature": "type date = Date.t" - }, - { - "id": "Stdlib.null", - "kind": "type", - "name": "null", - "docstrings": [], - "signature": "type null<'a> = null<'a>" - }, - { - "id": "Stdlib.undefined", - "kind": "type", - "name": "undefined", - "docstrings": [], - "signature": "type undefined<'a> = undefined<'a>" - }, - { - "id": "Stdlib.nullable", - "kind": "type", - "name": "nullable", - "docstrings": [], - "signature": "type nullable<'a> = nullable<'a>" - }, - { - "id": "Stdlib.lazy_t", - "kind": "type", - "name": "lazy_t", - "docstrings": [], - "signature": "type lazy_t<'a> = Lazy.t<'a>", - "deprecated": "Use Lazy.t instead" - }, - { - "id": "Stdlib.window", - "kind": "value", - "name": "window", - "docstrings": [], - "signature": "let window: Dom.window", - "deprecated": "Use rescript-webapi instead" - }, - { - "id": "Stdlib.document", - "kind": "value", - "name": "document", - "docstrings": [], - "signature": "let document: Dom.document", - "deprecated": "Use rescript-webapi instead" - }, - { - "id": "Stdlib.globalThis", - "kind": "value", - "name": "globalThis", - "docstrings": [ - "`globalThis` gives you the host global object (`window` in browsers, `global` in Node, etc.).\nYou can reach shared globals from any runtime without special checks.\n\n## Examples\n\n**Note:** These are demonstrative examples. In real code, prefer writing your own type-safe bindings.\nSee [`Bind to Global JS Values`](https://rescript-lang.org/docs/manual/v12.0.0/bind-to-global-js-values).\n\n\n```rescript\ntypeof(globalThis[\"setTimeout\"]) == #function\n\nglobalThis[\"myAppName\"] = \"SuperApp\";\nglobalThis[\"myAppName\"] == \"SuperApp\"\n```" - ], - "signature": "let globalThis: {..}" - }, - { - "id": "Stdlib.import", - "kind": "value", - "name": "import", - "docstrings": [ - "`import(value)` dynamically import a value or function from a ReScript\nmodule. The import call will return a `promise`, resolving to the dynamically loaded\nvalue.\n\n## Examples\n\n`Array.res` file:\n\n```rescript\n@send external indexOf: (array<'a>, 'a) => int = \"indexOf\"\n\nlet indexOfOpt = (arr, item) =>\n switch arr->indexOf(item) {\n | -1 => None\n | index => Some(index)\n }\n```\nIn other file you can import the `indexOfOpt` value defined in `Array.res`\n\n```rescript\nlet main = async () => {\n let indexOfOpt = await import(Array.indexOfOpt)\n let index = indexOfOpt([1, 2], 2)\n Console.log(index)\n}\n```\n\nCompiles to:\n\n```javascript\nasync function main() {\n var add = await import(\"./Array.mjs\").then(function(m) {\n return m.indexOfOpt;\n });\n var index = indexOfOpt([1, 2], 2);\n console.log(index);\n}\n```" - ], - "signature": "let import: 'a => promise<'a>" - }, - { - "id": "Stdlib.panic", - "kind": "value", - "name": "panic", - "docstrings": [ - "`panic(message)` throws a JavaScript `Error` prefixed with `Panic!`.\nCall it when something went wrong and the program should stop right away.\n\n## Examples\n\n```rescript\nlet caught = try panic(\"Invariant violated\") catch {\n| JsExn(err) => JsExn.message(err)->Option.getOrThrow\n}\n\ncaught == \"Panic! Invariant violated\"\n```" - ], - "signature": "let panic: string => 'a" - }, - { - "id": "Stdlib.assertEqual", - "kind": "value", - "name": "assertEqual", - "docstrings": [ - "`assertEqual(a, b)` check if `a` is equal `b`. If not throw a panic exception\n\n## Examples\n\n```rescript\nlist{1, 2}->List.tailExn == list{2}\n```" - ], - "signature": "let assertEqual: ('a, 'a) => unit" - }, - { - "id": "Stdlib.null", - "kind": "value", - "name": "null", - "docstrings": [ - "`null` returns the JavaScript `null` value as a `nullable<'a>`.\nUse the `Nullable` helpers to convert it into an `option` or to read the value.\n\n## Examples\n\n```rescript\nnull->Nullable.toOption == None\n```" - ], - "signature": "let null: nullable<'a>" - }, - { - "id": "Stdlib.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "`undefined` returns the JavaScript `undefined` value as a `nullable<'a>`.\nUse the `Nullable` helpers to convert it into an `option` or to read the value.\n\n## Examples\n\n```rescript\nundefined->Nullable.toOption == None\n```" - ], - "signature": "let undefined: nullable<'a>" - }, - { - "id": "Stdlib.typeof", - "kind": "value", - "name": "typeof", - "docstrings": [ - "`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```" - ], - "signature": "let typeof: 'a => Type.t" - } - ] - }, - "stdlib/intl/numberformat/grouping": { - "id": "Stdlib.Intl.NumberFormat.Grouping", - "name": "Grouping", - "docstrings": [ - "Represents the `useGrouping` option accepted by `Intl.NumberFormat`.\n\nSee [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) on MDN for full option details." - ], - "items": [ - { - "id": "Stdlib.Intl.NumberFormat.Grouping.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.parsed", - "kind": "type", - "name": "parsed", - "docstrings": [], - "signature": "type parsed = [#always | #auto | #bool(bool) | #min2]" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.fromBool", - "kind": "value", - "name": "fromBool", - "docstrings": [ - "Constructs a grouping setting from a boolean.\n\n## Examples\n\n```rescript\nlet formatter =\n Intl.NumberFormat.make(\n ~locales=[\"en-US\"],\n ~options={useGrouping: Intl.NumberFormat.Grouping.fromBool(false)},\n )\nformatter->Intl.NumberFormat.format(1234.) == \"1234\"\n```" - ], - "signature": "let fromBool: bool => t" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Constructs a grouping setting from a string literal.\n\n## Examples\n\n```rescript\nlet formatter =\n Intl.NumberFormat.make(\n ~locales=[\"en-US\"],\n ~options={useGrouping: Intl.NumberFormat.Grouping.fromString(#always)},\n )\nformatter->Intl.NumberFormat.format(1234.) == \"1,234\"\n```" - ], - "signature": "let fromString: [#always | #auto | #min2] => t" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.parseJsValue", - "kind": "value", - "name": "parseJsValue", - "docstrings": [ - "`parseJsValue(value)` attempts to interpret a JavaScript `value` as a grouping setting.\n\n## Examples\n\n```rescript\nIntl.NumberFormat.Grouping.parseJsValue(Js.Json.string(\"auto\")) == Some(#auto)\n```" - ], - "signature": "let parseJsValue: 'a => option<[> #always | #auto | #bool(bool) | #min2]>" - }, - { - "id": "Stdlib.Intl.NumberFormat.Grouping.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(grouping)` ignores the provided grouping and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/biguint64array/constants": { - "id": "Stdlib.BigUint64Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigUint64Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/bigint64array/constants": { - "id": "Stdlib.BigInt64Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigInt64Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint8clampedarray/constants": { - "id": "Stdlib.Uint8ClampedArray.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8ClampedArray.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint32array/constants": { - "id": "Stdlib.Uint32Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint32Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint16array/constants": { - "id": "Stdlib.Uint16Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint16Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/uint8array/constants": { - "id": "Stdlib.Uint8Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/int32array/constants": { - "id": "Stdlib.Int32Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int32Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/int16array/constants": { - "id": "Stdlib.Int16Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int16Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/int8array/constants": { - "id": "Stdlib.Int8Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int8Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/float64array/constants": { - "id": "Stdlib.Float64Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float64Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/float32array/constants": { - "id": "Stdlib.Float32Array.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float32Array.Constants.bytesPerElement", - "kind": "value", - "name": "bytesPerElement", - "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" - ], - "signature": "let bytesPerElement: int" - } - ] - }, - "stdlib/type/classify": { - "id": "Stdlib.Type.Classify", - "name": "Classify", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Type.Classify.function", - "kind": "type", - "name": "function", - "docstrings": [ - "An abstract type representing a JavaScript function.\n\n See [`function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) on MDN." - ], - "signature": "type function" - }, - { - "id": "Stdlib.Type.Classify.object", - "kind": "type", - "name": "object", - "docstrings": [ - "An abstract type representing a JavaScript object.\n\n See [`object`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) on MDN." - ], - "signature": "type object" - }, - { - "id": "Stdlib.Type.Classify.t", - "kind": "type", - "name": "t", - "docstrings": ["The type representing a classified JavaScript value."], - "signature": "type t =\n | Bool(bool)\n | Null\n | Undefined\n | String(string)\n | Number(float)\n | Object(object)\n | Function(function)\n | Symbol(Symbol.t)\n | BigInt(bigint)" - }, - { - "id": "Stdlib.Type.Classify.classify", - "kind": "value", - "name": "classify", - "docstrings": [ - "`classify(anyValue)`\nClassifies a JavaScript value.\n\n## Examples\n```rescript\nswitch %raw(`null`)->Type.Classify.classify {\n| Null => Console.log(\"Yup, that's null.\")\n| _ => Console.log(\"This doesn't actually appear to be null...\")\n}\n```" - ], - "signature": "let classify: 'a => t" - } - ] - }, - "stdlib/regexp/result": { - "id": "Stdlib.RegExp.Result", - "name": "Result", - "docstrings": [], - "items": [ - { - "id": "Stdlib.RegExp.Result.t", - "kind": "type", - "name": "t", - "docstrings": ["Type representing the result of a `RegExp` execution."], - "signature": "type t = array>" - }, - { - "id": "Stdlib.RegExp.Result.fullMatch", - "kind": "value", - "name": "fullMatch", - "docstrings": [ - "`fullMatch(regExpResult)` returns the full string that matched in this result.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n \n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints the full string that matched, \"ReScript is\"\n }\n ```" - ], - "signature": "let fullMatch: t => string" - }, - { - "id": "Stdlib.RegExp.Result.matches", - "kind": "value", - "name": "matches", - "docstrings": [ - "`matches(regExpResult)` returns all matches for `regExpResult`.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n \n // This below will log \"ReScript\" and \"is\" to the console.\n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) =>\n switch result->RegExp.Result.matches->Array.keepSome {\n | [firstWord, secondWord] => Console.log2(firstWord, secondWord)\n | _ => Console.log(\"Didn't find exactly two words...\")\n }\n }\n ```" - ], - "signature": "let matches: t => array>" - }, - { - "id": "Stdlib.RegExp.Result.index", - "kind": "value", - "name": "index", - "docstrings": [], - "signature": "let index: t => int" - }, - { - "id": "Stdlib.RegExp.Result.input", - "kind": "value", - "name": "input", - "docstrings": [ - "`input(regExpResult)` returns the full input string that was passed to what produced the `RegExp.Result.t`.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n \n // This below will log the full input string \"ReScript is pretty cool, right?\" to the console.\n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) => Console.log(result->RegExp.Result.input)\n }\n ```" - ], - "signature": "let input: t => string" - } - ] - }, - "stdlib/math/int": { - "id": "Stdlib.Math.Int", - "name": "Int", - "docstrings": ["Provide Math utilities for `int`"], - "items": [ - { - "id": "Stdlib.Math.Int.abs", - "kind": "value", - "name": "abs", - "docstrings": [ - "`abs(v)` returns absolute value of `v`.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.abs(-2) == 2\n Math.Int.abs(3) == 3\n ```" - ], - "signature": "let abs: int => int" - }, - { - "id": "Stdlib.Math.Int.clz32", - "kind": "value", - "name": "clz32", - "docstrings": [ - "`clz32(v)` returns the number of leading zero bits of the argument's 32 bit\nint representation.\nSee [`Math.clz32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32) on MDN.\n\n ## Examples\n\n ```rescript\n // 00000000000000000000000000000001\n Math.Int.clz32(1) == 31\n // 00000000000000000000000000000100\n Math.Int.clz32(4) == 29\n ```" - ], - "signature": "let clz32: int => int" - }, - { - "id": "Stdlib.Math.Int.imul", - "kind": "value", - "name": "imul", - "docstrings": [ - "`imul(a, b)` returns 32-bit integer multiplication. Use this only when you\nneed to optimize performance of multiplication of numbers stored as 32-bit\nintegers.\nSee [`Math.imul`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.imul(3, 4) == 12\n Math.Int.imul(-5, 12) == -60\n ```" - ], - "signature": "let imul: (int, int) => int" - }, - { - "id": "Stdlib.Math.Int.min", - "kind": "value", - "name": "min", - "docstrings": [ - "`min(a, b)` returns the minimum of its two integer arguments.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.min(1, 2) == 1\n Math.Int.min(-1, -2) == -2\n ```" - ], - "signature": "let min: (int, int) => int" - }, - { - "id": "Stdlib.Math.Int.minMany", - "kind": "value", - "name": "minMany", - "docstrings": [ - "`minMany(arr)` returns the minimum of the integers in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.minMany([1, 2]) == 1\n Math.Int.minMany([-1, -2]) == -2\n Math.Int.minMany([])->Int.toFloat->Float.isFinite == false\n ```" - ], - "signature": "let minMany: array => int" - }, - { - "id": "Stdlib.Math.Int.max", - "kind": "value", - "name": "max", - "docstrings": [ - "`max(a, b)` returns the maximum of its two integer arguments.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.max(1, 2) == 2\n Math.Int.max(-1, -2) == -1\n ```" - ], - "signature": "let max: (int, int) => int" - }, - { - "id": "Stdlib.Math.Int.maxMany", - "kind": "value", - "name": "maxMany", - "docstrings": [ - "`maxMany(arr)` returns the maximum of the integers in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.maxMany([1, 2]) == 2\n Math.Int.maxMany([-1, -2]) == -1\n Math.Int.maxMany([])->Int.toFloat->Float.isFinite == false\n ```" - ], - "signature": "let maxMany: array => int" - }, - { - "id": "Stdlib.Math.Int.pow", - "kind": "value", - "name": "pow", - "docstrings": [ - "`pow(a, ~exp)` throws the given base `a` to the given exponent `exp`.\nSee [`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.pow(2, ~exp=4) == 16\n Math.Int.pow(3, ~exp=4) == 81\n ```" - ], - "signature": "let pow: (int, ~exp: int) => int" - }, - { - "id": "Stdlib.Math.Int.sign", - "kind": "value", - "name": "sign", - "docstrings": [ - "`sign(v)` returns the sign of its integer argument: `-1` if negative, `0` if\nzero, `1` if positive.\nSee [`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.sign(3) == 1\n Math.Int.sign(-3) == -1\n Math.Int.sign(0) == 0\n ```" - ], - "signature": "let sign: int => int" - }, - { - "id": "Stdlib.Math.Int.floor", - "kind": "value", - "name": "floor", - "docstrings": [ - "floor(v) returns the largest `int` less than or equal to the argument;\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.floor(3.7) == 3\n Math.Int.floor(3.0) == 3\n Math.Int.floor(-3.1) == -4\n ```" - ], - "signature": "let floor: float => int" - }, - { - "id": "Stdlib.Math.Int.ceil", - "kind": "value", - "name": "ceil", - "docstrings": [ - "ceil(v) returns the smallest `int` greater than or equal to the argument;\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\non MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.ceil(3.7) == 4\n Math.Int.ceil(3.0) == 3\n Math.Int.ceil(-3.1) == -3\n ```" - ], - "signature": "let ceil: float => int" - }, - { - "id": "Stdlib.Math.Int.random", - "kind": "value", - "name": "random", - "docstrings": [ - "`random(minVal, maxVal)` returns a random integer number in the half-closed interval \\[minVal, maxVal).\nSee [`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\non MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.random(2, 5)\n Math.Int.random(505, 2000)\n Math.Int.random(-7, -2)\n ```" - ], - "signature": "let random: (int, int) => int" - } - ] - }, - "stdlib/math/constants": { - "id": "Stdlib.Math.Constants", - "name": "Constants", - "docstrings": ["Mathematical Constants"], - "items": [ - { - "id": "Stdlib.Math.Constants.e", - "kind": "value", - "name": "e", - "docstrings": [ - "`Math.Constants.e` returns Euler's number, ≈ 2.718281828459045.\nSee [`Math.E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.e\n ```" - ], - "signature": "let e: float" - }, - { - "id": "Stdlib.Math.Constants.ln2", - "kind": "value", - "name": "ln2", - "docstrings": [ - "`Math.Constants.ln2` returns Natural logarithm of 2, ≈ 0.6931471805599453.\nSee [`Math.LN2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN2) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.ln2\n ```" - ], - "signature": "let ln2: float" - }, - { - "id": "Stdlib.Math.Constants.ln10", - "kind": "value", - "name": "ln10", - "docstrings": [ - "`Math.Constants.ln10` returns Natural logarithm of 10, ≈ 2.302585092994046.\nSee [`Math.LN10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN10) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.ln10\n ```" - ], - "signature": "let ln10: float" - }, - { - "id": "Stdlib.Math.Constants.log2e", - "kind": "value", - "name": "log2e", - "docstrings": [ - "`Math.Constants.log2e` returns Base 2 logarithm of E, ≈ 1.4426950408889634.\nSee [`Math.LOG2E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG2E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.log2e\n ```" - ], - "signature": "let log2e: float" - }, - { - "id": "Stdlib.Math.Constants.log10e", - "kind": "value", - "name": "log10e", - "docstrings": [ - "`Math.Constants.log10e` returns Base 10 logarithm of E, ≈ 0.4342944819032518.\nSee [`Math.LOG10E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG10E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.log10e\n ```" - ], - "signature": "let log10e: float" - }, - { - "id": "Stdlib.Math.Constants.pi", - "kind": "value", - "name": "pi", - "docstrings": [ - "`Math.Constants.pi` returns Pi - ratio of the circumference to the diameter\nof a circle, ≈ 3.141592653589793.\nSee [`Math.PI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/PI) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.pi\n ```" - ], - "signature": "let pi: float" - }, - { - "id": "Stdlib.Math.Constants.sqrt1_2", - "kind": "value", - "name": "sqrt1_2", - "docstrings": [ - "`Math.Constants.sqrt1_2` returns Square root of 1/2, ≈ 0.7071067811865476.\nSee [`Math.SQRT1_2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.sqrt1_2\n ```" - ], - "signature": "let sqrt1_2: float" - }, - { - "id": "Stdlib.Math.Constants.sqrt2", - "kind": "value", - "name": "sqrt2", - "docstrings": [ - "`Math.Constants.e` returns Absolute value for integer argument.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.sqrt2\n ```" - ], - "signature": "let sqrt2: float" - } - ] - }, - "stdlib/json/decode": { - "id": "Stdlib.JSON.Decode", - "name": "Decode", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JSON.Decode.bool", - "kind": "value", - "name": "bool", - "docstrings": [ - "Decodes a single JSON value. If the value is a bool, it will return `Some(bool)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`true`)->JSON.Decode.bool\n // Some(true)\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.bool\n // None\n ```" - ], - "signature": "let bool: t => option" - }, - { - "id": "Stdlib.JSON.Decode.null", - "kind": "value", - "name": "null", - "docstrings": [ - "Decodes a single JSON value. If the value is null, it will return `Some(Null.t)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`null`)->JSON.Decode.null\n // Some(null)\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.null\n // None\n ```" - ], - "signature": "let null: t => option>" - }, - { - "id": "Stdlib.JSON.Decode.string", - "kind": "value", - "name": "string", - "docstrings": [ - "Decodes a single JSON value. If the value is a string, it will return `Some(string)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.string\n // Some(\"hello world\")\n \n JSON.parseOrThrow(`42`)->JSON.Decode.string\n // None\n ```" - ], - "signature": "let string: t => option" - }, - { - "id": "Stdlib.JSON.Decode.float", - "kind": "value", - "name": "float", - "docstrings": [ - "Decodes a single JSON value. If the value is a float, it will return `Some(float)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`42.0`)->JSON.Decode.float\n // Some(42.0)\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.float\n // None\n ```" - ], - "signature": "let float: t => option" - }, - { - "id": "Stdlib.JSON.Decode.object", - "kind": "value", - "name": "object", - "docstrings": [ - "Decodes a single JSON value. If the value is an object, it will return `Some(dict)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`{\"foo\":\"bar\"}`)->JSON.Decode.object\n // Some({ foo: 'bar' })\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.object\n // None\n ```" - ], - "signature": "let object: t => option>" - }, - { - "id": "Stdlib.JSON.Decode.array", - "kind": "value", - "name": "array", - "docstrings": [ - "Decodes a single JSON value. If the value is an array, it will return `Some(array)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`[\"foo\", \"bar\"]`)->JSON.Decode.array\n // Some([ 'foo', 'bar' ])\n \n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.array\n // None\n ```" - ], - "signature": "let array: t => option>" - } - ] - }, - "stdlib/json/encode": { - "id": "Stdlib.JSON.Encode", - "name": "Encode", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JSON.Encode.bool", - "kind": "value", - "name": "bool", - "docstrings": [ - "Returns a boolean as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.bool(true)\n ```" - ], - "signature": "let bool: bool => t" - }, - { - "id": "Stdlib.JSON.Encode.null", - "kind": "value", - "name": "null", - "docstrings": [ - "Returns null as a JSON value.\n\n ## Examples\n ```rescript\n JSON.Encode.null\n ```" - ], - "signature": "let null: t" - }, - { - "id": "Stdlib.JSON.Encode.string", - "kind": "value", - "name": "string", - "docstrings": [ - "Returns a string as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.string(\"hello world\")\n ```" - ], - "signature": "let string: string => t" - }, - { - "id": "Stdlib.JSON.Encode.int", - "kind": "value", - "name": "int", - "docstrings": [ - "Returns an int as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.int(42)\n ```" - ], - "signature": "let int: int => t" - }, - { - "id": "Stdlib.JSON.Encode.float", - "kind": "value", - "name": "float", - "docstrings": [ - "Returns a float as JSON.\n\n ## Examples\n ```rescript\n JSON.Encode.float(42.0)\n ```" - ], - "signature": "let float: float => t" - }, - { - "id": "Stdlib.JSON.Encode.object", - "kind": "value", - "name": "object", - "docstrings": [ - "Returns a dict as a JSON object.\n\n ## Examples\n ```rescript\n let dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n ])\n \n JSON.Encode.object(dict)\n ```" - ], - "signature": "let object: dict => t" - }, - { - "id": "Stdlib.JSON.Encode.array", - "kind": "value", - "name": "array", - "docstrings": [ - "Returns an array as JSON.\n\n ## Examples\n ```rescript\n let array = [JSON.Encode.string(\"hello world\"), JSON.Encode.int(42)]\n \n JSON.Encode.array(array)\n ```" - ], - "signature": "let array: array => t" - }, - { - "id": "Stdlib.JSON.Encode.stringArray", - "kind": "value", - "name": "stringArray", - "docstrings": ["Returns an array of strings as a JSON object."], - "signature": "let stringArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.floatArray", - "kind": "value", - "name": "floatArray", - "docstrings": ["Returns an array of floats as a JSON object."], - "signature": "let floatArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.intArray", - "kind": "value", - "name": "intArray", - "docstrings": ["Returns an array of integers as a JSON object."], - "signature": "let intArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.boolArray", - "kind": "value", - "name": "boolArray", - "docstrings": ["Returns an array of booleans as a JSON object."], - "signature": "let boolArray: array => t" - }, - { - "id": "Stdlib.JSON.Encode.objectArray", - "kind": "value", - "name": "objectArray", - "docstrings": ["Returns an array of objects as a JSON object."], - "signature": "let objectArray: array> => t" - } - ] - }, - "stdlib/json/classify": { - "id": "Stdlib.JSON.Classify", - "name": "Classify", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JSON.Classify.t", - "kind": "type", - "name": "t", - "docstrings": ["A type representing a JavaScript type."], - "signature": "type t =\n | Bool(bool)\n | Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)" - }, - { - "id": "Stdlib.JSON.Classify.classify", - "kind": "value", - "name": "classify", - "docstrings": [ - "Returns the JSON type of any value.\n\n ## Examples\n ```rescript\n JSON.Classify.classify(\"hello world\")\n // String(\"hello world\")\n \n JSON.Classify.classify(42)\n // Number(42)\n ```" - ], - "signature": "let classify: 'a => t", - "deprecated": "Directly switch on the JSON object instead" - } - ] - }, - "stdlib/jserror/urierror": { - "id": "Stdlib.JsError.URIError", - "name": "URIError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.URIError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `URIError` with the provided `message`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.URIError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `URIError` with the provided `message` and throws it.\n\n `JsError.URIError.throwWithMessage(\"message\")` is equivalent to `JsError.URIError.make(\"message\")->JsError.throw`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/typeerror": { - "id": "Stdlib.JsError.TypeError", - "name": "TypeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.TypeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `TypeError` with the provided `message`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.TypeError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `TypeError` with the provided `message` and throws it.\n\n `JsError.TypeError.throwWithMessage(\"message\")` is equivalent to `JsError.TypeError.make(\"message\")->JsError.throw`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/syntaxerror": { - "id": "Stdlib.JsError.SyntaxError", - "name": "SyntaxError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.SyntaxError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `SyntaxError` with the provided `message`.\n\n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.SyntaxError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `SyntaxError` with the provided `message` and throws it.\n \n `JsError.SyntaxError.throwWithMessage(\"message\")` is equivalent to `JsError.SyntaxError.make(\"message\")->JsError.throw`.\n \n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/referenceerror": { - "id": "Stdlib.JsError.ReferenceError", - "name": "ReferenceError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.ReferenceError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `ReferenceError` with the provided `message`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.ReferenceError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `ReferenceError` with the provided `message` and throws it.\n\n `JsError.ReferenceError.throwWithMessage(\"message\")` is equivalent to `JsError.ReferenceError.make(\"message\")->JsError.throw`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/rangeerror": { - "id": "Stdlib.JsError.RangeError", - "name": "RangeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.RangeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `RangeError` with the provided `message`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.RangeError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `RangeError` with the provided `message` and throws it.\n \n `JsError.RangeError.throwWithMessage(\"message\")` is equivalent to `JsError.RangeError.make(\"message\")->JsError.throw`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/jserror/evalerror": { - "id": "Stdlib.JsError.EvalError", - "name": "EvalError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.JsError.EvalError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `EvalError` with the provided `message`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.EvalError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `EvalError` with the provided `message` and throws it.\n\n `JsError.EvalError.throwWithMessage(\"message\")` is equivalent to `JsError.EvalError.make(\"message\")->JsError.throw`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." - ], - "signature": "let throwWithMessage: string => 'a" - } - ] - }, - "stdlib/intl/segments": { - "id": "Stdlib.Intl.Segments", - "name": "Segments", - "docstrings": [ - "Bindings to `Segments` objects produced by `Intl.Segmenter.segment`.\n A Segments instance is an object that represents the segments of a specific string, subject to the locale and options of its constructing Intl.Segmenter instance.\nhttps://tc39.es/ecma402/#sec-segments-objects.\n\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment) for API details and the [ECMA-402 specification](https://tc39.es/ecma402/#sec-segments-objects) for the object shape." - ], - "items": [ - { - "id": "Stdlib.Intl.Segments.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Segments.segmentData", - "kind": "type", - "name": "segmentData", - "docstrings": [], - "signature": "type segmentData = {\n segment: string,\n index: int,\n isWordLike: option,\n input: string,\n}" - }, - { - "id": "Stdlib.Intl.Segments.containing", - "kind": "value", - "name": "containing", - "docstrings": [ - "`containing(segments)` returns the segment data for the index supplied when iterating.\n\nUse this when consuming `Segments` via iteration helpers where the index is already implied." - ], - "signature": "let containing: t => segmentData" - }, - { - "id": "Stdlib.Intl.Segments.containingWithIndex", - "kind": "value", - "name": "containingWithIndex", - "docstrings": [ - "`containingWithIndex(segments, index)` returns the segment that contains `index` within the original string.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #word})\nlet segments = segmenter->Intl.Segmenter.segment(\"Hello world\")\nIntl.Segments.containingWithIndex(segments, 0).segment == \"Hello\"\n```" - ], - "signature": "let containingWithIndex: (t, int) => segmentData" - }, - { - "id": "Stdlib.Intl.Segments.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(segments)` ignores the provided segments and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/segmenter": { - "id": "Stdlib.Intl.Segmenter", - "name": "Segmenter", - "docstrings": [ - "Bindings to JavaScript's `Intl.Segmenter`.\n\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter) for API details." - ], - "items": [ - { - "id": "Stdlib.Intl.Segmenter.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Segmenter.granularity", - "kind": "type", - "name": "granularity", - "docstrings": [], - "signature": "type granularity = [#grapheme | #sentence | #word]" - }, - { - "id": "Stdlib.Intl.Segmenter.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n granularity?: granularity,\n}" - }, - { - "id": "Stdlib.Intl.Segmenter.pluralCategories", - "kind": "type", - "name": "pluralCategories", - "docstrings": [], - "signature": "type pluralCategories = [\n | #few\n | #many\n | #one\n | #other\n | #two\n | #zero\n]" - }, - { - "id": "Stdlib.Intl.Segmenter.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n granularity: granularity,\n}" - }, - { - "id": "Stdlib.Intl.Segmenter.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.Segmenter.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.Segmenter` instance for segmenting strings.\n\nSee [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter) on MDN.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #word})\nIntl.Segmenter.resolvedOptions(segmenter).granularity == #word\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.Segmenter.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for segmentation.\n\nSee [`Intl.Segmenter.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.Segmenter.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.Segmenter.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(segmenter)` returns the locale and granularity currently in use.\n\nSee [`Intl.Segmenter.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #sentence})\nIntl.Segmenter.resolvedOptions(segmenter).granularity == #sentence\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.Segmenter.segment", - "kind": "value", - "name": "segment", - "docstrings": [ - "`segment(segmenter, input)` returns a `Segments` object describing `input`.\n\nSee [`Intl.Segmenter.prototype.segment`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment) on MDN.\n\n## Examples\n\n```rescript\nlet segmenter = Intl.Segmenter.make(~locales=[\"en\"], ~options={granularity: #word})\nlet segments = segmenter->Intl.Segmenter.segment(\"Hello world\")\nIntl.Segments.containingWithIndex(segments, 0).segment == \"Hello\"\n```" - ], - "signature": "let segment: (t, string) => Intl_Segments.t" - }, - { - "id": "Stdlib.Intl.Segmenter.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(segmenter)` ignores the provided segmenter and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/relativetimeformat": { - "id": "Stdlib.Intl.RelativeTimeFormat", - "name": "RelativeTimeFormat", - "docstrings": [ - "Bindings to JavaScript's `Intl.RelativeTimeFormat`.\n\nSee [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) for API details." - ], - "items": [ - { - "id": "Stdlib.Intl.RelativeTimeFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.numeric", - "kind": "type", - "name": "numeric", - "docstrings": [], - "signature": "type numeric = [#always | #auto]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.style", - "kind": "type", - "name": "style", - "docstrings": [], - "signature": "type style = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.timeUnit", - "kind": "type", - "name": "timeUnit", - "docstrings": [], - "signature": "type timeUnit = [\n | #day\n | #hour\n | #minute\n | #month\n | #quarter\n | #second\n | #week\n | #year\n]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n numeric?: numeric,\n style?: style,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n numeric: numeric,\n style: style,\n numberingSystem: string,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.relativeTimePartComponent", - "kind": "type", - "name": "relativeTimePartComponent", - "docstrings": [], - "signature": "type relativeTimePartComponent = [#integer | #literal]" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.relativeTimePart", - "kind": "type", - "name": "relativeTimePart", - "docstrings": [], - "signature": "type relativeTimePart = {\n \\\"type\": relativeTimePartComponent,\n value: string,\n unit?: timeUnit,\n}" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.RelativeTimeFormat` instance for formatting relative time strings.\n\nSee [`Intl.RelativeTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en-US\"])\nformatter->Intl.RelativeTimeFormat.format(1, #day)->String.length > 0\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for relative time formatting.\n\nSee [`Intl.RelativeTimeFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.RelativeTimeFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the locale and options currently in use.\n\nSee [`Intl.RelativeTimeFormat.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en-US\"])\nIntl.RelativeTimeFormat.resolvedOptions(formatter).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, value, unit)` returns the formatted string for `value` expressed in `unit`.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en\"])\nformatter->Intl.RelativeTimeFormat.format(-1, #day)->String.length > 0\n```" - ], - "signature": "let format: (t, int, timeUnit) => string" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, value, unit)` returns an array describing how the output string is assembled.\n\nSee [`Intl.RelativeTimeFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.RelativeTimeFormat.make(~locales=[\"en\"])\nformatter->Intl.RelativeTimeFormat.formatToParts(-1, #day)->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, int, timeUnit) => array" - }, - { - "id": "Stdlib.Intl.RelativeTimeFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(relativeTimeFormat)` ignores the provided relativeTimeFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/pluralrules": { - "id": "Stdlib.Intl.PluralRules", - "name": "PluralRules", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.PluralRules.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.PluralRules.localeType", - "kind": "type", - "name": "localeType", - "docstrings": [], - "signature": "type localeType = [#cardinal | #ordinal]" - }, - { - "id": "Stdlib.Intl.PluralRules.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n \\\"type\"?: localeType,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" - }, - { - "id": "Stdlib.Intl.PluralRules.pluralCategories", - "kind": "type", - "name": "pluralCategories", - "docstrings": [], - "signature": "type pluralCategories = [\n | #few\n | #many\n | #one\n | #other\n | #two\n | #zero\n]" - }, - { - "id": "Stdlib.Intl.PluralRules.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n pluralCategories: array,\n \\\"type\": localeType,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" - }, - { - "id": "Stdlib.Intl.PluralRules.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.PluralRules.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.PluralRules` instance to determine plural categories.\n\nSee [`Intl.PluralRules`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules) on MDN.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nlet category = rules->Intl.PluralRules.select(1.0)\ncategory == #one\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.PluralRules.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for plural rules.\n\nSee [`Intl.PluralRules.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.PluralRules.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.PluralRules.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(rules)` returns the plural rule configuration in use.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nIntl.PluralRules.resolvedOptions(rules).locale == \"en\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.PluralRules.rule", - "kind": "type", - "name": "rule", - "docstrings": [], - "signature": "type rule = [#few | #many | #one | #other | #two | #zero]" - }, - { - "id": "Stdlib.Intl.PluralRules.select", - "kind": "value", - "name": "select", - "docstrings": [ - "`select(rules, value)` returns the plural category for the given number.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.select(1.) == #one\n```" - ], - "signature": "let select: (t, float) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.selectInt", - "kind": "value", - "name": "selectInt", - "docstrings": [ - "`selectInt(rules, value)` is like `select` but accepts an integer.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.selectInt(2) == #other\n```" - ], - "signature": "let selectInt: (t, int) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.selectRange", - "kind": "value", - "name": "selectRange", - "docstrings": [ - "`selectRange(rules, ~start, ~end)` returns the category for numbers in the range.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.selectRange(~start=1., ~end=2.) == #other\n```" - ], - "signature": "let selectRange: (t, ~start: float, ~end: float) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.selectRangeInt", - "kind": "value", - "name": "selectRangeInt", - "docstrings": [ - "`selectRangeInt(rules, ~start, ~end)` is the integer version of `selectRange`.\n\n## Examples\n\n```rescript\nlet rules = Intl.PluralRules.make(~locales=[\"en\"])\nrules->Intl.PluralRules.selectRangeInt(~start=1, ~end=1) == #other\n```" - ], - "signature": "let selectRangeInt: (t, ~start: int, ~end: int) => rule" - }, - { - "id": "Stdlib.Intl.PluralRules.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(pluralRules)` ignores the provided pluralRules and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/numberformat": { - "id": "Stdlib.Intl.NumberFormat", - "name": "NumberFormat", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.NumberFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.NumberFormat.currency", - "kind": "type", - "name": "currency", - "docstrings": ["An ISO 4217 currency code. e.g. USD, EUR, CNY"], - "signature": "type currency = string" - }, - { - "id": "Stdlib.Intl.NumberFormat.currencyDisplay", - "kind": "type", - "name": "currencyDisplay", - "docstrings": [], - "signature": "type currencyDisplay = [\n | #code\n | #name\n | #narrowSymbol\n | #symbol\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.currencySign", - "kind": "type", - "name": "currencySign", - "docstrings": [], - "signature": "type currencySign = [#accounting | #standard]" - }, - { - "id": "Stdlib.Intl.NumberFormat.notation", - "kind": "type", - "name": "notation", - "docstrings": [], - "signature": "type notation = [\n | #compact\n | #engineering\n | #scientific\n | #standard\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.compactDisplay", - "kind": "type", - "name": "compactDisplay", - "docstrings": ["Used only when notation is #compact"], - "signature": "type compactDisplay = [#long | #short]" - }, - { - "id": "Stdlib.Intl.NumberFormat.signDisplay", - "kind": "type", - "name": "signDisplay", - "docstrings": [], - "signature": "type signDisplay = [\n | #always\n | #auto\n | #exceptZero\n | #negative\n | #never\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.style", - "kind": "type", - "name": "style", - "docstrings": [], - "signature": "type style = [#currency | #decimal | #percent | #unit]" - }, - { - "id": "Stdlib.Intl.NumberFormat.unitSystem", - "kind": "type", - "name": "unitSystem", - "docstrings": [ - "Defined in https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier\nOnly used when style is #unit" - ], - "signature": "type unitSystem = string" - }, - { - "id": "Stdlib.Intl.NumberFormat.unitDisplay", - "kind": "type", - "name": "unitDisplay", - "docstrings": ["Only used when style is #unit"], - "signature": "type unitDisplay = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.NumberFormat.rounding", - "kind": "type", - "name": "rounding", - "docstrings": [], - "signature": "type rounding = [\n | #ceil\n | #expand\n | #floor\n | #halfCeil\n | #halfEven\n | #halfExpand\n | #halfFloor\n | #halfTrunc\n | #trunc\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.roundingPriority", - "kind": "type", - "name": "roundingPriority", - "docstrings": [], - "signature": "type roundingPriority = [\n | #auto\n | #lessPrecision\n | #morePrecision\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.roundingIncrement", - "kind": "type", - "name": "roundingIncrement", - "docstrings": [], - "signature": "type roundingIncrement = [\n | #1\n | #10\n | #100\n | #1000\n | #2\n | #20\n | #200\n | #2000\n | #25\n | #250\n | #2500\n | #5\n | #50\n | #500\n | #5000\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.trailingZeroDisplay", - "kind": "type", - "name": "trailingZeroDisplay", - "docstrings": [], - "signature": "type trailingZeroDisplay = [\n | #auto\n | #lessPrecision\n | #stripIfInteger\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n compactDisplay?: compactDisplay,\n numberingSystem?: Intl_Common.numberingSystem,\n currency?: currency,\n currencyDisplay?: currencyDisplay,\n currencySign?: currencySign,\n localeMatcher?: Intl_Common.localeMatcher,\n notation?: notation,\n signDisplay?: signDisplay,\n style?: style,\n unit?: unitSystem,\n unitDisplay?: unitDisplay,\n useGrouping?: Grouping.t,\n roundingMode?: rounding,\n roundingPriority?: roundingPriority,\n roundingIncrement?: roundingIncrement,\n trailingZeroDisplay?: trailingZeroDisplay,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n currency?: currency,\n currencyDisplay?: currencyDisplay,\n currencySign?: currencySign,\n compactDisplay?: compactDisplay,\n unit: unitSystem,\n unitDisplay: unitDisplay,\n roundingMode?: rounding,\n roundingPriority?: roundingPriority,\n roundingIncrement?: roundingIncrement,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n locale: string,\n notation: notation,\n numberingSystem: Intl_Common.numberingSystem,\n signDisplay: signDisplay,\n style: style,\n useGrouping: Grouping.t,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.numberFormatPartType", - "kind": "type", - "name": "numberFormatPartType", - "docstrings": [], - "signature": "type numberFormatPartType = [\n | #compact\n | #currency\n | #decimal\n | #exponentInteger\n | #exponentMinusSign\n | #exponentSeparator\n | #fraction\n | #group\n | #infinity\n | #integer\n | #literal\n | #minusSign\n | #nan\n | #percentSign\n | #plusSign\n | #unit\n | #unknown\n]" - }, - { - "id": "Stdlib.Intl.NumberFormat.numberFormatPart", - "kind": "type", - "name": "numberFormatPart", - "docstrings": [], - "signature": "type numberFormatPart = {\n \\\"type\": numberFormatPartType,\n value: string,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.rangeSource", - "kind": "type", - "name": "rangeSource", - "docstrings": [], - "signature": "type rangeSource = [#endRange | #shared | #startRange]" - }, - { - "id": "Stdlib.Intl.NumberFormat.numberFormatRangePart", - "kind": "type", - "name": "numberFormatRangePart", - "docstrings": [], - "signature": "type numberFormatRangePart = {\n \\\"type\": numberFormatPartType,\n value: string,\n source: rangeSource,\n}" - }, - { - "id": "Stdlib.Intl.NumberFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.NumberFormat` instance for locale-aware number formatting.\n\nSee [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"], ~options={style: #currency, currency: \"USD\"})\nformatter->Intl.NumberFormat.format(1234.5) == \"$1,234.50\"\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.NumberFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for number formatting.\n\nSee [`Intl.NumberFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.NumberFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the actual options being used.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nIntl.NumberFormat.resolvedOptions(formatter).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.NumberFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, value)` returns the formatted representation of `value`.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.format(1234.5) == \"1,234.5\"\n```" - ], - "signature": "let format: (t, float) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatRange", - "kind": "value", - "name": "formatRange", - "docstrings": [ - "`formatRange(formatter, ~start, ~end)` formats numbers representing a range.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.formatRange(~start=1., ~end=2.)->String.length > 0\n```" - ], - "signature": "let formatRange: (t, ~start: float, ~end: float) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, value)` breaks the formatted result into parts.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.formatToParts(123)->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, float) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatRangeToParts", - "kind": "value", - "name": "formatRangeToParts", - "docstrings": [ - "`formatRangeToParts(formatter, ~start, ~end)` returns how the range would be rendered.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en-US\"])\nformatter->Intl.NumberFormat.formatRangeToParts(~start=1., ~end=2.)->Array.length > 0\n```" - ], - "signature": "let formatRangeToParts: (\n t,\n ~start: float,\n ~end: float,\n) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatInt", - "kind": "value", - "name": "formatInt", - "docstrings": [ - "`formatInt(formatter, value)` formats integer values.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatInt(42) == \"42\"\n```" - ], - "signature": "let formatInt: (t, int) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatIntRange", - "kind": "value", - "name": "formatIntRange", - "docstrings": [ - "`formatIntRange(formatter, ~start, ~end)` formats integer ranges.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatIntRange(~start=1, ~end=3)->String.length > 0\n```" - ], - "signature": "let formatIntRange: (t, ~start: int, ~end: int) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatIntToParts", - "kind": "value", - "name": "formatIntToParts", - "docstrings": [ - "`formatIntToParts(formatter, value)` returns formatting parts for an integer.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatIntToParts(123)->Array.length > 0\n```" - ], - "signature": "let formatIntToParts: (t, int) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatIntRangeToParts", - "kind": "value", - "name": "formatIntRangeToParts", - "docstrings": [ - "`formatIntRangeToParts(formatter, ~start, ~end)` returns how the integer range would be rendered.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatIntRangeToParts(~start=1, ~end=1)->Array.length > 0\n```" - ], - "signature": "let formatIntRangeToParts: (t, ~start: int, ~end: int) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigInt", - "kind": "value", - "name": "formatBigInt", - "docstrings": [ - "`formatBigInt(formatter, value)` formats bigint values." - ], - "signature": "let formatBigInt: (t, bigint) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigIntRange", - "kind": "value", - "name": "formatBigIntRange", - "docstrings": [ - "`formatBigIntRange(formatter, ~start, ~end)` formats a range of bigint values.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatBigIntRange(~start=1n, ~end=2n) == \"1–2\"\n```" - ], - "signature": "let formatBigIntRange: (t, ~start: bigint, ~end: bigint) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigIntToParts", - "kind": "value", - "name": "formatBigIntToParts", - "docstrings": [ - "`formatBigIntToParts(formatter, value)` returns the bigint formatting broken into parts.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatBigIntToParts(5n)->Array.length > 0\n```" - ], - "signature": "let formatBigIntToParts: (t, bigint) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatBigIntRangeToParts", - "kind": "value", - "name": "formatBigIntRangeToParts", - "docstrings": [ - "`formatBigIntRangeToParts(formatter, ~start, ~end)` describes how the bigint range would be rendered.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatBigIntRangeToParts(~start=3n, ~end=4n)->Array.length > 0\n```" - ], - "signature": "let formatBigIntRangeToParts: (\n t,\n ~start: bigint,\n ~end: bigint,\n) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatString", - "kind": "value", - "name": "formatString", - "docstrings": [ - "`formatString(formatter, value)` interprets `value` as a number string and formats it.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatString(\"1234\") == \"1,234\"\n```" - ], - "signature": "let formatString: (t, string) => string" - }, - { - "id": "Stdlib.Intl.NumberFormat.formatStringToParts", - "kind": "value", - "name": "formatStringToParts", - "docstrings": [ - "`formatStringToParts(formatter, value)` returns formatting parts for a numeric string.\n\n## Examples\n\n```rescript\nlet formatter = Intl.NumberFormat.make(~locales=[\"en\"])\nformatter->Intl.NumberFormat.formatStringToParts(\"123\")->Array.length > 0\n```" - ], - "signature": "let formatStringToParts: (t, string) => array" - }, - { - "id": "Stdlib.Intl.NumberFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(numberFormat)` ignores the provided numberFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/locale": { - "id": "Stdlib.Intl.Locale", - "name": "Locale", - "docstrings": ["Bindings to JavaScript's `Intl.Locale`."], - "items": [ - { - "id": "Stdlib.Intl.Locale.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Locale.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n baseName?: string,\n calendar?: Intl_Common.calendar,\n collation?: Intl_Common.collation,\n hourCycle?: [#h11 | #h12 | #h23 | #h24],\n caseFirst?: [#\"false\" | #lower | #upper],\n numberingSystem?: Intl_Common.numberingSystem,\n numeric?: bool,\n language?: string,\n script?: string,\n region?: string,\n}" - }, - { - "id": "Stdlib.Intl.Locale.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.Locale` object from a locale identifier and optional modifiers.\n\nSee [`Intl.Locale`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en-US\")\nlocale->Intl.Locale.language == \"en\"\n```" - ], - "signature": "let make: (string, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.Locale.baseName", - "kind": "value", - "name": "baseName", - "docstrings": [ - "`baseName(locale)` returns the canonical base name (without Unicode extensions).\n\nSee [`Intl.Locale.prototype.baseName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/baseName) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"fr-CA\")\nlocale->Intl.Locale.baseName == \"fr-CA\"\n```" - ], - "signature": "let baseName: t => string" - }, - { - "id": "Stdlib.Intl.Locale.calendar", - "kind": "value", - "name": "calendar", - "docstrings": [ - "`calendar(locale)` returns the specified calendar, if present.\n\nSee [`Intl.Locale.prototype.calendar`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/calendar) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={calendar: #gregory})\nlocale->Intl.Locale.calendar == Some(\"gregory\")\n```" - ], - "signature": "let calendar: t => option" - }, - { - "id": "Stdlib.Intl.Locale.caseFirst", - "kind": "value", - "name": "caseFirst", - "docstrings": [ - "`caseFirst(locale)` returns the case-first ordering setting, if present.\n\nSee [`Intl.Locale.prototype.caseFirst`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/caseFirst) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={caseFirst: #upper})\nlocale->Intl.Locale.caseFirst == Some(\"upper\")\n```" - ], - "signature": "let caseFirst: t => option" - }, - { - "id": "Stdlib.Intl.Locale.collation", - "kind": "value", - "name": "collation", - "docstrings": [ - "`collation(locale)` returns the collation type, if present.\n\nSee [`Intl.Locale.prototype.collation`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/collation) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={collation: #phonebk})\nlocale->Intl.Locale.collation == Some(\"phonebk\")\n```" - ], - "signature": "let collation: t => option" - }, - { - "id": "Stdlib.Intl.Locale.hourCycle", - "kind": "value", - "name": "hourCycle", - "docstrings": [ - "`hourCycle(locale)` returns the preferred hour cycle, if present.\n\nSee [`Intl.Locale.prototype.hourCycle`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={hourCycle: #h12})\nlocale->Intl.Locale.hourCycle == Some(\"h12\")\n```" - ], - "signature": "let hourCycle: t => option" - }, - { - "id": "Stdlib.Intl.Locale.language", - "kind": "value", - "name": "language", - "docstrings": [ - "`language(locale)` returns the primary language subtag.\n\nSee [`Intl.Locale.prototype.language`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/language) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"pt-BR\")\nlocale->Intl.Locale.language == \"pt\"\n```" - ], - "signature": "let language: t => string" - }, - { - "id": "Stdlib.Intl.Locale.numberingSystem", - "kind": "value", - "name": "numberingSystem", - "docstrings": [ - "`numberingSystem(locale)` returns the numbering system identifier, if present.\n\nSee [`Intl.Locale.prototype.numberingSystem`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/numberingSystem) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={numberingSystem: #latn})\nlocale->Intl.Locale.numberingSystem == Some(\"latn\")\n```" - ], - "signature": "let numberingSystem: t => option" - }, - { - "id": "Stdlib.Intl.Locale.numeric", - "kind": "value", - "name": "numeric", - "docstrings": [ - "`numeric(locale)` indicates whether numeric ordering should be used for region subtags.\n\nSee [`Intl.Locale.prototype.numeric`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/numeric) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\", ~options={numeric: true})\nlocale->Intl.Locale.numeric == true\n```" - ], - "signature": "let numeric: t => bool" - }, - { - "id": "Stdlib.Intl.Locale.region", - "kind": "value", - "name": "region", - "docstrings": [ - "`region(locale)` returns the region subtag, if present.\n\nSee [`Intl.Locale.prototype.region`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/region) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en-US\")\nlocale->Intl.Locale.region == Some(\"US\")\n```" - ], - "signature": "let region: t => option" - }, - { - "id": "Stdlib.Intl.Locale.script", - "kind": "value", - "name": "script", - "docstrings": [ - "`script(locale)` returns the script subtag, if present.\n\nSee [`Intl.Locale.prototype.script`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/script) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"sr-Cyrl\")\nlocale->Intl.Locale.script == Some(\"Cyrl\")\n```" - ], - "signature": "let script: t => option" - }, - { - "id": "Stdlib.Intl.Locale.maximize", - "kind": "value", - "name": "maximize", - "docstrings": [ - "`maximize(locale)` adds likely subtags to produce the most specific locale.\n\nSee [`Intl.Locale.prototype.maximize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/maximize) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en\")\nlocale->Intl.Locale.maximize->Intl.Locale.region == Some(\"US\")\n```" - ], - "signature": "let maximize: t => t" - }, - { - "id": "Stdlib.Intl.Locale.minimize", - "kind": "value", - "name": "minimize", - "docstrings": [ - "`minimize(locale)` removes unnecessary subtags while preserving semantics.\n\nSee [`Intl.Locale.prototype.minimize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/minimize) on MDN.\n\n## Examples\n\n```rescript\nlet locale = Intl.Locale.make(\"en-Latn-US\")\nlocale->Intl.Locale.minimize->Intl.Locale.baseName == \"en\"\n```" - ], - "signature": "let minimize: t => t" - }, - { - "id": "Stdlib.Intl.Locale.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(locale)` ignores the provided locale and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/listformat": { - "id": "Stdlib.Intl.ListFormat", - "name": "ListFormat", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.ListFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.ListFormat.listType", - "kind": "type", - "name": "listType", - "docstrings": [], - "signature": "type listType = [#conjunction | #disjunction | #unit]" - }, - { - "id": "Stdlib.Intl.ListFormat.style", - "kind": "type", - "name": "style", - "docstrings": [], - "signature": "type style = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.ListFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n \\\"type\"?: listType,\n style?: style,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.listPartComponentType", - "kind": "type", - "name": "listPartComponentType", - "docstrings": [], - "signature": "type listPartComponentType = [#element | #literal]" - }, - { - "id": "Stdlib.Intl.ListFormat.listPart", - "kind": "type", - "name": "listPart", - "docstrings": [], - "signature": "type listPart = {\n \\\"type\": listPartComponentType,\n value: string,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n style: style,\n \\\"type\": listType,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.ListFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.ListFormat` instance for formatting lists.\n\nSee [`Intl.ListFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"], ~options={\\\"type\": #conjunction})\nformatter->Intl.ListFormat.format([\"apples\", \"bananas\", \"cherries\"]) == \"apples, bananas, and cherries\"\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.ListFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported for list formatting.\n\nSee [`Intl.ListFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.ListFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.ListFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the actual options being used.\n\nSee [`Intl.ListFormat.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"])\nIntl.ListFormat.resolvedOptions(formatter).locale == \"en\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.ListFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, items)` returns the formatted list string.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"])\nformatter->Intl.ListFormat.format([\"a\", \"b\"]) == \"a and b\"\n```" - ], - "signature": "let format: (t, array) => string" - }, - { - "id": "Stdlib.Intl.ListFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, items)` returns the list as an array of parts describing how it would be rendered.\n\nSee [`Intl.ListFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/formatToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.ListFormat.make(~locales=[\"en\"])\nformatter->Intl.ListFormat.formatToParts([\"a\", \"b\"])->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, array) => array" - }, - { - "id": "Stdlib.Intl.ListFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(listFormat)` ignores the provided listFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/datetimeformat": { - "id": "Stdlib.Intl.DateTimeFormat", - "name": "DateTimeFormat", - "docstrings": ["Bindings to JavaScript's `Intl.DateTimeFormat`."], - "items": [ - { - "id": "Stdlib.Intl.DateTimeFormat.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateStyle", - "kind": "type", - "name": "dateStyle", - "docstrings": [], - "signature": "type dateStyle = [#full | #long | #medium | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.timeStyle", - "kind": "type", - "name": "timeStyle", - "docstrings": [], - "signature": "type timeStyle = [#full | #long | #medium | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dayPeriod", - "kind": "type", - "name": "dayPeriod", - "docstrings": [], - "signature": "type dayPeriod = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.weekday", - "kind": "type", - "name": "weekday", - "docstrings": [], - "signature": "type weekday = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.era", - "kind": "type", - "name": "era", - "docstrings": [], - "signature": "type era = [#long | #narrow | #short]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.year", - "kind": "type", - "name": "year", - "docstrings": [], - "signature": "type year = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.month", - "kind": "type", - "name": "month", - "docstrings": [], - "signature": "type month = [\n | #\"2-digit\"\n | #long\n | #narrow\n | #numeric\n | #short\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.day", - "kind": "type", - "name": "day", - "docstrings": [], - "signature": "type day = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.hour", - "kind": "type", - "name": "hour", - "docstrings": [], - "signature": "type hour = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.minute", - "kind": "type", - "name": "minute", - "docstrings": [], - "signature": "type minute = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.second", - "kind": "type", - "name": "second", - "docstrings": [], - "signature": "type second = [#\"2-digit\" | #numeric]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.timeZoneName", - "kind": "type", - "name": "timeZoneName", - "docstrings": [ - "Firefox also supports IANA time zone names here\nNode v19+ supports \"shortOffset\", \"shortGeneric\", \"longOffset\", and \"longGeneric\"." - ], - "signature": "type timeZoneName = [\n | #long\n | #longGeneric\n | #longOffset\n | #short\n | #shortGeneric\n | #shortOffset\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.hourCycle", - "kind": "type", - "name": "hourCycle", - "docstrings": [], - "signature": "type hourCycle = [#h11 | #h12 | #h23 | #h24]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatMatcher", - "kind": "type", - "name": "formatMatcher", - "docstrings": [], - "signature": "type formatMatcher = [#basic | #\"best fit\"]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.fractionalSecondDigits", - "kind": "type", - "name": "fractionalSecondDigits", - "docstrings": [], - "signature": "type fractionalSecondDigits = [#0 | #1 | #2 | #3]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n dateStyle?: dateStyle,\n timeStyle?: timeStyle,\n calendar?: Intl_Common.calendar,\n dayPeriod?: dayPeriod,\n numberingSystem?: Intl_Common.numberingSystem,\n localeMatcher?: Intl_Common.localeMatcher,\n timeZone?: string,\n hour12?: bool,\n hourCycle?: hourCycle,\n formatMatcher?: formatMatcher,\n weekday?: weekday,\n era?: era,\n year?: year,\n month?: month,\n day?: day,\n hour?: hour,\n minute?: minute,\n second?: second,\n fractionalSecondDigits?: fractionalSecondDigits,\n timeZoneName?: timeZoneName,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n dateStyle?: dateStyle,\n timeStyle?: timeStyle,\n weekday?: weekday,\n era?: era,\n year?: year,\n month?: month,\n day?: day,\n hour?: hour,\n minute?: minute,\n second?: second,\n fractionalSecondDigits?: fractionalSecondDigits,\n timeZoneName?: timeZoneName,\n calendar: Intl_Common.calendar,\n hour12: bool,\n hourCycle: hourCycle,\n locale: string,\n numberingSystem: Intl_Common.numberingSystem,\n timeZone: string,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimeComponent", - "kind": "type", - "name": "dateTimeComponent", - "docstrings": [], - "signature": "type dateTimeComponent = [\n | #day\n | #dayPeriod\n | #era\n | #fractionalSecond\n | #hour\n | #literal\n | #minute\n | #month\n | #relatedYear\n | #second\n | #timeZone\n | #weekday\n | #year\n | #yearName\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimePart", - "kind": "type", - "name": "dateTimePart", - "docstrings": [], - "signature": "type dateTimePart = {\n \\\"type\": dateTimeComponent,\n value: string,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimeRangeSource", - "kind": "type", - "name": "dateTimeRangeSource", - "docstrings": [], - "signature": "type dateTimeRangeSource = [\n | #endRange\n | #shared\n | #startRange\n]" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.dateTimeRangePart", - "kind": "type", - "name": "dateTimeRangePart", - "docstrings": [], - "signature": "type dateTimeRangePart = {\n \\\"type\": dateTimeComponent,\n value: string,\n source: dateTimeRangeSource,\n}" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.DateTimeFormat` instance for formatting date values.\n\nSee [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"], ~options={timeStyle: #short})\nlet sampleDate = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nformatter->Intl.DateTimeFormat.format(sampleDate)->String.length > 0\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported by the runtime for date/time formatting.\n\nSee [`Intl.DateTimeFormat.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.DateTimeFormat.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(formatter)` returns the actual locale and formatting options in use.\n\nSee [`Intl.DateTimeFormat.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"])\nIntl.DateTimeFormat.resolvedOptions(formatter).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.format", - "kind": "value", - "name": "format", - "docstrings": [ - "`format(formatter, date)` returns the formatted string for `date`.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en\"])\nlet date = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nformatter->Intl.DateTimeFormat.format(date)->String.length > 0\n```" - ], - "signature": "let format: (t, Date.t) => string" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatToParts", - "kind": "value", - "name": "formatToParts", - "docstrings": [ - "`formatToParts(formatter, date)` breaks the formatted output into an array of parts.\n\nSee [`Intl.DateTimeFormat.prototype.formatToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en\"])\nlet date = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nformatter->Intl.DateTimeFormat.formatToParts(date)->Array.length > 0\n```" - ], - "signature": "let formatToParts: (t, Date.t) => array" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatRange", - "kind": "value", - "name": "formatRange", - "docstrings": [ - "`formatRange(formatter, ~startDate, ~endDate)` formats the range between `startDate` and `endDate`.\n\nSee [`Intl.DateTimeFormat.prototype.formatRange`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatRange) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"], ~options={dateStyle: #short})\nlet startDate = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nlet endDate = Js.Date.makeWithYMD(~year=2024, ~month=1, ~date=1)\nformatter->Intl.DateTimeFormat.formatRange(~startDate=startDate, ~endDate=endDate)->String.length > 0\n```" - ], - "signature": "let formatRange: (t, ~startDate: Date.t, ~endDate: Date.t) => string" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.formatRangeToParts", - "kind": "value", - "name": "formatRangeToParts", - "docstrings": [ - "`formatRangeToParts(formatter, ~startDate, ~endDate)` returns an array describing how the range would be rendered.\n\nSee [`Intl.DateTimeFormat.prototype.formatRangeToParts`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatRangeToParts) on MDN.\n\n## Examples\n\n```rescript\nlet formatter = Intl.DateTimeFormat.make(~locales=[\"en-US\"], ~options={dateStyle: #short})\nlet startDate = Js.Date.makeWithYMD(~year=2024, ~month=0, ~date=1)\nlet endDate = Js.Date.makeWithYMD(~year=2024, ~month=1, ~date=1)\nformatter->Intl.DateTimeFormat.formatRangeToParts(~startDate=startDate, ~endDate=endDate)->Array.length > 0\n```" - ], - "signature": "let formatRangeToParts: (\n t,\n ~startDate: Date.t,\n ~endDate: Date.t,\n) => array" - }, - { - "id": "Stdlib.Intl.DateTimeFormat.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(dateTimeFormat)` ignores the provided dateTimeFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/collator": { - "id": "Stdlib.Intl.Collator", - "name": "Collator", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.Collator.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Stdlib.Intl.Collator.usage", - "kind": "type", - "name": "usage", - "docstrings": [], - "signature": "type usage = [#search | #sort]" - }, - { - "id": "Stdlib.Intl.Collator.sensitivity", - "kind": "type", - "name": "sensitivity", - "docstrings": [], - "signature": "type sensitivity = [#accent | #base | #case | #variant]" - }, - { - "id": "Stdlib.Intl.Collator.caseFirst", - "kind": "type", - "name": "caseFirst", - "docstrings": [], - "signature": "type caseFirst = [#\"false\" | #lower | #upper]" - }, - { - "id": "Stdlib.Intl.Collator.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n usage?: usage,\n sensitivity?: sensitivity,\n ignorePunctuation?: bool,\n numeric?: bool,\n caseFirst?: caseFirst,\n}" - }, - { - "id": "Stdlib.Intl.Collator.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n usage: usage,\n sensitivity: sensitivity,\n ignorePunctuation: bool,\n collation: [\n | #compat\n | #default\n | #dict\n | #emoji\n | #eor\n | #phonebk\n | #phonetic\n | #pinyin\n | #stroke\n | #trad\n | #unihan\n | #zhuyin\n ],\n numeric?: bool,\n caseFirst?: caseFirst,\n}" - }, - { - "id": "Stdlib.Intl.Collator.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" - }, - { - "id": "Stdlib.Intl.Collator.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Intl.Collator` instance that can compare strings using locale-aware rules.\n\nSee [`Intl.Collator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) on MDN.\n\n## Examples\n\n```rescript\nlet collator = Intl.Collator.make(~locales=[\"en\"])\ncollator->Intl.Collator.compare(\"apple\", \"banana\") < 0\n```" - ], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, - { - "id": "Stdlib.Intl.Collator.supportedLocalesOf", - "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [ - "`supportedLocalesOf(locales, ~options)` filters `locales` to those supported by the runtime for collation.\n\nSee [`Intl.Collator.supportedLocalesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/supportedLocalesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.Collator.supportedLocalesOf([\"en-US\", \"klingon\"]) == [\"en-US\"]\n\n```" - ], - "signature": "let supportedLocalesOf: (\n array,\n ~options: supportedLocalesOptions=?,\n) => array" - }, - { - "id": "Stdlib.Intl.Collator.resolvedOptions", - "kind": "value", - "name": "resolvedOptions", - "docstrings": [ - "`resolvedOptions(collator)` returns the locale and collation settings in use.\n\nSee [`Intl.Collator.prototype.resolvedOptions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/resolvedOptions) on MDN.\n\n## Examples\n\n```rescript\nlet collator = Intl.Collator.make(~locales=[\"en-US\"])\nIntl.Collator.resolvedOptions(collator).locale == \"en-US\"\n```" - ], - "signature": "let resolvedOptions: t => resolvedOptions" - }, - { - "id": "Stdlib.Intl.Collator.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(collator, a, b)` compares two strings using the rules of `collator`. Returns a negative number when `a` comes before `b`, `0` when equal, and a positive number otherwise.\n\n## Examples\n\n```rescript\nlet collator = Intl.Collator.make(~locales=[\"en-US\"])\ncollator->Intl.Collator.compare(\"apple\", \"banana\") < 0\n```" - ], - "signature": "let compare: (t, string, string) => int" - }, - { - "id": "Stdlib.Intl.Collator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(collator)` ignores the provided collator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl/common": { - "id": "Stdlib.Intl.Common", - "name": "Common", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.Common.localeMatcher", - "kind": "type", - "name": "localeMatcher", - "docstrings": [], - "signature": "type localeMatcher = [#\"best fit\" | #lookup]" - }, - { - "id": "Stdlib.Intl.Common.calendar", - "kind": "type", - "name": "calendar", - "docstrings": [], - "signature": "type calendar = [\n | #buddhist\n | #chinese\n | #coptic\n | #dangi\n | #ethioaa\n | #ethiopic\n | #gregory\n | #hebrew\n | #indian\n | #islamic\n | #\"islamic-civil\"\n | #\"islamic-rgsa\"\n | #\"islamic-tbla\"\n | #\"islamic-umalqura\"\n | #iso8601\n | #japanese\n | #persian\n | #roc\n]" - }, - { - "id": "Stdlib.Intl.Common.collation", - "kind": "type", - "name": "collation", - "docstrings": [], - "signature": "type collation = [\n | #compat\n | #dict\n | #emoji\n | #eor\n | #phonebk\n | #phonetic\n | #pinyin\n | #stroke\n | #trad\n | #unihan\n | #zhuyin\n]" - }, - { - "id": "Stdlib.Intl.Common.numberingSystem", - "kind": "type", - "name": "numberingSystem", - "docstrings": [], - "signature": "type numberingSystem = [\n | #adlm\n | #ahom\n | #arab\n | #arabext\n | #bali\n | #beng\n | #bhks\n | #brah\n | #cakm\n | #cham\n | #deva\n | #diak\n | #fullwide\n | #gong\n | #gonm\n | #gujr\n | #guru\n | #hanidec\n | #hmng\n | #hmnp\n | #java\n | #kali\n | #kawi\n | #khmr\n | #knda\n | #lana\n | #lanatham\n | #laoo\n | #latn\n | #lepc\n | #limb\n | #mathbold\n | #mathdbl\n | #mathmono\n | #mathsanb\n | #mathsans\n | #mlym\n | #modi\n | #mong\n | #mroo\n | #mtei\n | #mymr\n | #mymrshan\n | #mymrtlng\n | #nagm\n | #newa\n | #nkoo\n | #olck\n | #orya\n | #osma\n | #rohg\n | #saur\n | #segment\n | #shrd\n | #sind\n | #sinh\n | #sora\n | #sund\n | #takr\n | #talu\n | #tamldec\n | #telu\n | #thai\n | #tibt\n | #tirh\n | #tnsa\n | #vaii\n | #wara\n | #wcho\n]" - }, - { - "id": "Stdlib.Intl.Common.oneTo21", - "kind": "type", - "name": "oneTo21", - "docstrings": [], - "signature": "type oneTo21 = [\n | #1\n | #10\n | #11\n | #12\n | #13\n | #14\n | #15\n | #16\n | #17\n | #18\n | #19\n | #2\n | #20\n | #21\n | #3\n | #4\n | #5\n | #6\n | #7\n | #8\n | #9\n]" - }, - { - "id": "Stdlib.Intl.Common.zeroTo20", - "kind": "type", - "name": "zeroTo20", - "docstrings": [], - "signature": "type zeroTo20 = [\n | #0\n | #1\n | #10\n | #11\n | #12\n | #13\n | #14\n | #15\n | #16\n | #17\n | #18\n | #19\n | #2\n | #20\n | #3\n | #4\n | #5\n | #6\n | #7\n | #8\n | #9\n]" - } - ] - }, - "stdlib/int/ref": { - "id": "Stdlib.Int.Ref", - "name": "Ref", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int.Ref.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = ref" - }, - { - "id": "Stdlib.Int.Ref.increment", - "kind": "value", - "name": "increment", - "docstrings": [ - "`increment(intRef)` increments the value of the provided reference by 1.\n\n ## Examples\n\n ```rescript\n let myRef = ref(4)\n Int.Ref.increment(myRef)\n myRef.contents == 5\n ```" - ], - "signature": "let increment: ref => unit" - }, - { - "id": "Stdlib.Int.Ref.decrement", - "kind": "value", - "name": "decrement", - "docstrings": [ - "`decrement(intRef)` decrements the value of the provided reference by 1.\n\n ## Examples\n\n ```rescript\n let myRef = ref(4)\n Int.Ref.decrement(myRef)\n myRef.contents == 3\n ```" - ], - "signature": "let decrement: ref => unit" - } - ] - }, - "stdlib/int/bitwise": { - "id": "Stdlib.Int.Bitwise", - "name": "Bitwise", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int.Bitwise.land", - "kind": "value", - "name": "land", - "docstrings": [], - "signature": "let land: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lor", - "kind": "value", - "name": "lor", - "docstrings": [], - "signature": "let lor: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lxor", - "kind": "value", - "name": "lxor", - "docstrings": [], - "signature": "let lxor: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lsl", - "kind": "value", - "name": "lsl", - "docstrings": [], - "signature": "let lsl: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lsr", - "kind": "value", - "name": "lsr", - "docstrings": [], - "signature": "let lsr: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.asr", - "kind": "value", - "name": "asr", - "docstrings": [], - "signature": "let asr: (int, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Int.Bitwise.lnot", - "kind": "value", - "name": "lnot", - "docstrings": [], - "signature": "let lnot: int => int", - "deprecated": "" - } - ] - }, - "stdlib/int/constants": { - "id": "Stdlib.Int.Constants", - "name": "Constants", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int.Constants.minValue", - "kind": "value", - "name": "minValue", - "docstrings": [ - "The smallest positive number represented in JavaScript.\nSee [`Number.MIN_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE)\non MDN.\n\n ## Examples\n\n ```rescript\n Console.log(Int.Constants.minValue)\n ```" - ], - "signature": "let minValue: int" - }, - { - "id": "Stdlib.Int.Constants.maxValue", - "kind": "value", - "name": "maxValue", - "docstrings": [ - "The largest positive number represented in JavaScript.\nSee [`Number.MAX_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE)\non MDN.\n\n ## Examples\n\n ```rescript\n Console.log(Int.Constants.maxValue)\n ```" - ], - "signature": "let maxValue: int" - } - ] - }, - "stdlib/float/constants": { - "id": "Stdlib.Float.Constants", - "name": "Constants", - "docstrings": ["Float constants."], - "items": [ - { - "id": "Stdlib.Float.Constants.nan", - "kind": "value", - "name": "nan", - "docstrings": [ - "The special value \"Not a Number\"\nSee [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.nan\n ```" - ], - "signature": "let nan: float" - }, - { - "id": "Stdlib.Float.Constants.epsilon", - "kind": "value", - "name": "epsilon", - "docstrings": [ - "Represents the difference between 1 and the smallest floating point number greater than 1.\nSee [`Number.EPSILON`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.epsilon\n ```" - ], - "signature": "let epsilon: float" - }, - { - "id": "Stdlib.Float.Constants.positiveInfinity", - "kind": "value", - "name": "positiveInfinity", - "docstrings": [ - "The positive Infinity value\nSee [`Number.POSITIVE_INFINITY`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/POSITIVE_INFINITY) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.positiveInfinity\n ```" - ], - "signature": "let positiveInfinity: float" - }, - { - "id": "Stdlib.Float.Constants.negativeInfinity", - "kind": "value", - "name": "negativeInfinity", - "docstrings": [ - "The negative Infinity value\nSee [`Number.NEGATIVE_INFINITY`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.negativeInfinity\n ```" - ], - "signature": "let negativeInfinity: float" - }, - { - "id": "Stdlib.Float.Constants.minValue", - "kind": "value", - "name": "minValue", - "docstrings": [ - "The smallest positive numeric value representable in JavaScript.\nSee [`Number.MIN_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.minValue\n ```" - ], - "signature": "let minValue: float" - }, - { - "id": "Stdlib.Float.Constants.maxValue", - "kind": "value", - "name": "maxValue", - "docstrings": [ - "The maximum positive numeric value representable in JavaScript.\nSee [`Number.MAX_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.minValue\n ```" - ], - "signature": "let maxValue: float" - } - ] - }, - "stdlib/error/urierror": { - "id": "Stdlib.Error.URIError", - "name": "URIError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.URIError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `URIError` with the provided `message`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/typeerror": { - "id": "Stdlib.Error.TypeError", - "name": "TypeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.TypeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `TypeError` with the provided `message`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/syntaxerror": { - "id": "Stdlib.Error.SyntaxError", - "name": "SyntaxError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.SyntaxError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `SyntaxError` with the provided `message`.\n\n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/referenceerror": { - "id": "Stdlib.Error.ReferenceError", - "name": "ReferenceError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.ReferenceError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `ReferenceError` with the provided `message`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/rangeerror": { - "id": "Stdlib.Error.RangeError", - "name": "RangeError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.RangeError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `RangeError` with the provided `message`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/error/evalerror": { - "id": "Stdlib.Error.EvalError", - "name": "EvalError", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Error.EvalError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `EvalError` with the provided `message`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." - ], - "signature": "let make: string => t", - "deprecated": "" - } - ] - }, - "stdlib/date/utc": { - "id": "Stdlib.Date.UTC", - "name": "UTC", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Date.UTC.makeWithYM", - "kind": "value", - "name": "makeWithYM", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYM(~year=2023, ~month=0)\n // 1672531200000\n \n Date.UTC.makeWithYM(~year=2023, ~month=11)\n // 1701388800000\n \n Date.UTC.makeWithYM(~year=2023, ~month=12)\n // 1704067200000\n \n Date.UTC.makeWithYM(~year=2023, ~month=-1)\n // 1669852800000\n ```" - ], - "signature": "let makeWithYM: (~year: int, ~month: int) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMD", - "kind": "value", - "name": "makeWithYMD", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=20)\n // 1676851200000\n \n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=-1)\n // 1675036800000\n \n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=29)\n // 1677628800000\n ```" - ], - "signature": "let makeWithYMD: (~year: int, ~month: int, ~day: int) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDH", - "kind": "value", - "name": "makeWithYMDH", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=16)\n // 1676908800000\n \n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=24)\n // 1676937600000\n \n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=-1)\n // 1676847600000\n ```" - ], - "signature": "let makeWithYMDH: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDHM", - "kind": "value", - "name": "makeWithYMDHM", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40)\n // 1676911200000\n \n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=60)\n // 1676912400000\n \n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=-1)\n // 1676908740000\n ```" - ], - "signature": "let makeWithYMDHM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDHMS", - "kind": "value", - "name": "makeWithYMDHMS", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0)\n // 1676911200000\n \n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=60)\n // 1676911260000\n \n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=-1)\n // 1676911199000\n ```" - ], - "signature": "let makeWithYMDHMS: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => msSinceEpoch" - }, - { - "id": "Stdlib.Date.UTC.makeWithYMDHMSM", - "kind": "value", - "name": "makeWithYMDHMSM", - "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=0,\n )->Console.log\n // 1676911200000\n \n Date.UTC.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=1000,\n )->Console.log\n // 1676911201000\n \n Date.UTC.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=-1,\n )->Console.log\n // 1676911199999\n ```" - ], - "signature": "let makeWithYMDHMSM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => msSinceEpoch" - } - ] - }, - "stdlib/biguint64array": { - "id": "Stdlib.BigUint64Array", - "name": "BigUint64Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigUint64Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `BigUint64Array` typed array represents an array of 64-bit unsigned integers in platform byte order. See [BigUint64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.BigUint64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `BigUint64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.BigUint64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `BigUint64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.BigUint64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigUint64Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigUint64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `BigUint64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.BigUint64Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `BigUint64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => bigint=?) => t" - }, - { - "id": "Stdlib.BigUint64Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `BigUint64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigUint64Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bigUintArray)` ignores the provided bigUintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/bigint64array": { - "id": "Stdlib.BigInt64Array", - "name": "BigInt64Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigInt64Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `BigInt64Array` typed array represents an array of 64-bit signed integers in platform byte order. See [BigInt64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.BigInt64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `BigInt64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.BigInt64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `BigInt64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.BigInt64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt64Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `BigInt64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.BigInt64Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `BigInt64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => bigint=?) => t" - }, - { - "id": "Stdlib.BigInt64Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `BigInt64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt64Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bigIntArray)` ignores the provided bigIntArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint8clampedarray": { - "id": "Stdlib.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8ClampedArray.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint8ClampedArray` typed array represents an array of 8-bit unsigned integers clamped to 0-255. See [Uint8ClampedArray on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint8ClampedArray` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint8ClampedArray` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint8ClampedArray` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint8ClampedArray.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint8ClampedArray` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8ClampedArray.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint32array": { - "id": "Stdlib.Uint32Array", - "name": "Uint32Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint32Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint32Array` typed array represents an array of 32-bit unsigned integers in platform byte order. See [Uint32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint32Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint32Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint32Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint32Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint32Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint16array": { - "id": "Stdlib.Uint16Array", - "name": "Uint16Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint16Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint16Array` typed array represents an array of 16-bit unsigned integers in platform byte order. See [Uint16Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint16Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint16Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint16Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint16Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint16Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint16Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint16Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint16Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint16Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint16Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint16Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint16Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/uint8array": { - "id": "Stdlib.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Uint8Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Uint8Array` typed array represents an array of 8-bit unsigned integers. See [Uint8Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Uint8Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint8Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Uint8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint8Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Uint8Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint8Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint8Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Uint8Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint8Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Uint8Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint8Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Uint8Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/int32array": { - "id": "Stdlib.Int32Array", - "name": "Int32Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int32Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Int32Array` typed array represents an array of twos-complemenet 32-bit signed integers in platform byte order. See [Int32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Int32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Int32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Int32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Int32Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Int32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int32Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Int32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Int32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Int32Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Int32Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int32Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/int16array": { - "id": "Stdlib.Int16Array", - "name": "Int16Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int16Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Int16Array` typed array represents an array of twos-complement 16-bit signed integers in platform byte order. See [Int16Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Int16Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int16Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Int16Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Int16Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Int16Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int16Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int16Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Int16Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Int16Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int16Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Int16Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int16Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int16Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/int8array": { - "id": "Stdlib.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Int8Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Int8Array` typed array represents an array of twos-complement 8-bit signed integers. See [Int8Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Int8Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int8Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Int8Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Int8Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Int8Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int8Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int8Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Int8Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Int8Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int8Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t" - }, - { - "id": "Stdlib.Int8Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int8Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Int8Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/float64array": { - "id": "Stdlib.Float64Array", - "name": "Float64Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float64Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Float64Array` typed array represents an array of 64-bit floating point numbers in platform byte order. See [Float64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Float64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Float64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Float64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Float64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Float64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float64Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float64Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Float64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Float64Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Float64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => float=?) => t" - }, - { - "id": "Stdlib.Float64Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Float64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float64Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/float32array": { - "id": "Stdlib.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Float32Array.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The `Float32Array` typed array represents an array of 32-bit floating point numbers in platform byte order. See [Float32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array)" - ], - "signature": "type t = TypedArray.t" - }, - { - "id": "Stdlib.Float32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Float32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Stdlib.Float32Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Float32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.Float32Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float32Array.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float32Array.fromLength", - "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Float32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" - }, - { - "id": "Stdlib.Float32Array.fromArrayLikeOrIterable", - "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Float32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => float=?) => t" - }, - { - "id": "Stdlib.Float32Array.fromArrayLikeOrIterableWithMap", - "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Float32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t", - "deprecated": "" - }, - { - "id": "Stdlib.Float32Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/typedarray": { - "id": "Stdlib.TypedArray", - "name": "TypedArray", - "docstrings": [], - "items": [ - { - "id": "Stdlib.TypedArray.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.TypedArray.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```" - ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```" - ], - "signature": "let set: (t<'a>, int, 'a) => unit" - }, - { - "id": "Stdlib.TypedArray.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [ - "`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN." - ], - "signature": "let buffer: t<'a> => ArrayBuffer.t" - }, - { - "id": "Stdlib.TypedArray.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [ - "`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```" - ], - "signature": "let byteLength: t<'a> => int" - }, - { - "id": "Stdlib.TypedArray.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [ - "`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN." - ], - "signature": "let byteOffset: t<'a> => int" - }, - { - "id": "Stdlib.TypedArray.setArray", - "kind": "value", - "name": "setArray", - "docstrings": [ - "`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```" - ], - "signature": "let setArray: (t<'a>, array<'a>) => unit" - }, - { - "id": "Stdlib.TypedArray.setArrayFrom", - "kind": "value", - "name": "setArrayFrom", - "docstrings": [ - "`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```" - ], - "signature": "let setArrayFrom: (t<'a>, array<'a>, int) => unit" - }, - { - "id": "Stdlib.TypedArray.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```" - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Stdlib.TypedArray.copyAllWithin", - "kind": "value", - "name": "copyAllWithin", - "docstrings": [ - "`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```" - ], - "signature": "let copyAllWithin: (t<'a>, ~target: int) => array<'a>" - }, - { - "id": "Stdlib.TypedArray.copyWithinToEnd", - "kind": "value", - "name": "copyWithinToEnd", - "docstrings": [ - "`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```" - ], - "signature": "let copyWithinToEnd: (t<'a>, ~target: int, ~start: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [ - "`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```" - ], - "signature": "let copyWithin: (t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>" - }, - { - "id": "Stdlib.TypedArray.fillAll", - "kind": "value", - "name": "fillAll", - "docstrings": [ - "`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```" - ], - "signature": "let fillAll: (t<'a>, 'a) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.fillToEnd", - "kind": "value", - "name": "fillToEnd", - "docstrings": [ - "`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array." - ], - "signature": "let fillToEnd: (t<'a>, 'a, ~start: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.fill", - "kind": "value", - "name": "fill", - "docstrings": [ - "`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```" - ], - "signature": "let fill: (t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN." - ], - "signature": "let reverse: t<'a> => unit" - }, - { - "id": "Stdlib.TypedArray.toReversed", - "kind": "value", - "name": "toReversed", - "docstrings": [ - "`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```" - ], - "signature": "let toReversed: t<'a> => t<'a>" - }, - { - "id": "Stdlib.TypedArray.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN." - ], - "signature": "let sort: (t<'a>, ('a, 'a) => Ordering.t) => unit" - }, - { - "id": "Stdlib.TypedArray.toSorted", - "kind": "value", - "name": "toSorted", - "docstrings": [ - "`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```" - ], - "signature": "let toSorted: (t<'a>, ('a, 'a) => Ordering.t) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.with", - "kind": "value", - "name": "with", - "docstrings": [ - "`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```" - ], - "signature": "let with: (t<'a>, int, 'a) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```" - ], - "signature": "let includes: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.TypedArray.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN." - ], - "signature": "let indexOf: (t<'a>, 'a) => int" - }, - { - "id": "Stdlib.TypedArray.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`." - ], - "signature": "let indexOfFrom: (t<'a>, 'a, int) => int" - }, - { - "id": "Stdlib.TypedArray.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```" - ], - "signature": "let joinWith: (t<'a>, string) => string" - }, - { - "id": "Stdlib.TypedArray.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN." - ], - "signature": "let lastIndexOf: (t<'a>, 'a) => int" - }, - { - "id": "Stdlib.TypedArray.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`." - ], - "signature": "let lastIndexOfFrom: (t<'a>, 'a, int) => int" - }, - { - "id": "Stdlib.TypedArray.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN." - ], - "signature": "let slice: (t<'a>, ~start: int, ~end: int=?) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array." - ], - "signature": "let sliceToEnd: (t<'a>, ~start: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(typedArray)` produces a shallow copy of the typed array." - ], - "signature": "let copy: t<'a> => t<'a>" - }, - { - "id": "Stdlib.TypedArray.subarray", - "kind": "value", - "name": "subarray", - "docstrings": [ - "`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN." - ], - "signature": "let subarray: (t<'a>, ~start: int, ~end: int=?) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.subarrayToEnd", - "kind": "value", - "name": "subarrayToEnd", - "docstrings": [ - "`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer." - ], - "signature": "let subarrayToEnd: (t<'a>, ~start: int) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.TypedArray.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```" - ], - "signature": "let toString: t<'a> => string" - }, - { - "id": "Stdlib.TypedArray.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN." - ], - "signature": "let toLocaleString: t<'a> => string" - }, - { - "id": "Stdlib.TypedArray.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN." - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.everyWithIndex", - "kind": "value", - "name": "everyWithIndex", - "docstrings": [ - "`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`." - ], - "signature": "let everyWithIndex: (t<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN." - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`." - ], - "signature": "let filterWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" - }, - { - "id": "Stdlib.TypedArray.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN." - ], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findWithIndex", - "kind": "value", - "name": "findWithIndex", - "docstrings": [ - "`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index." - ], - "signature": "let findWithIndex: (t<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findLast", - "kind": "value", - "name": "findLast", - "docstrings": [ - "`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN." - ], - "signature": "let findLast: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findLastWithIndex", - "kind": "value", - "name": "findLastWithIndex", - "docstrings": [ - "`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`." - ], - "signature": "let findLastWithIndex: (t<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.TypedArray.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [ - "`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN." - ], - "signature": "let findIndex: (t<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.TypedArray.findIndexWithIndex", - "kind": "value", - "name": "findIndexWithIndex", - "docstrings": [ - "`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`." - ], - "signature": "let findIndexWithIndex: (t<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.TypedArray.findLastIndex", - "kind": "value", - "name": "findLastIndex", - "docstrings": [ - "`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN." - ], - "signature": "let findLastIndex: (t<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.TypedArray.findLastIndexWithIndex", - "kind": "value", - "name": "findLastIndexWithIndex", - "docstrings": [ - "`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`." - ], - "signature": "let findLastIndexWithIndex: (t<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.TypedArray.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN." - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.TypedArray.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index." - ], - "signature": "let forEachWithIndex: (t<'a>, ('a, int) => unit) => unit" - }, - { - "id": "Stdlib.TypedArray.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.TypedArray.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index." - ], - "signature": "let mapWithIndex: (t<'a>, ('a, int) => 'b) => t<'b>" - }, - { - "id": "Stdlib.TypedArray.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN." - ], - "signature": "let reduce: (t<'a>, ('b, 'a) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`." - ], - "signature": "let reduceWithIndex: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [ - "`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN." - ], - "signature": "let reduceRight: (t<'a>, ('b, 'a) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.reduceRightWithIndex", - "kind": "value", - "name": "reduceRightWithIndex", - "docstrings": [ - "`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`." - ], - "signature": "let reduceRightWithIndex: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b" - }, - { - "id": "Stdlib.TypedArray.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN." - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.someWithIndex", - "kind": "value", - "name": "someWithIndex", - "docstrings": [ - "`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index." - ], - "signature": "let someWithIndex: (t<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.TypedArray.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/arraybuffer": { - "id": "Stdlib.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [ - "Functions for interacting with JavaScript ArrayBuffer.\nSee: [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)." - ], - "items": [ - { - "id": "Stdlib.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an ArrayBuffer object used to represent a generic raw binary data buffer." - ], - "signature": "type t" - }, - { - "id": "Stdlib.ArrayBuffer.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(length)` creates a new ArrayBuffer with the specified length in bytes.\nSee [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/ArrayBuffer) on MDN.\n\n## Examples\n\n```rescript\nlet buffer = ArrayBuffer.make(8)\nArrayBuffer.byteLength(buffer) == 8\n```\n\n## Exceptions\n\n- `RangeError`: If `length` is larger than `Number.MAX_SAFE_INTEGER` or negative." - ], - "signature": "let make: int => t" - }, - { - "id": "Stdlib.ArrayBuffer.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [ - "`byteLength(arrayBuffer)` returns the size, in bytes, of the ArrayBuffer.\nSee [`ArrayBuffer.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet buffer = ArrayBuffer.make(16)\nArrayBuffer.byteLength(buffer) == 16\n```" - ], - "signature": "let byteLength: t => int" - }, - { - "id": "Stdlib.ArrayBuffer.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(arrayBuffer, ~start, ~end)` returns a new ArrayBuffer whose contents are a copy of this ArrayBuffer's bytes from `start`, inclusive, up to `end`, exclusive.\nSee [`ArrayBuffer.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/slice) on MDN.\n\n## Examples\n\n```rescript\nlet buffer = ArrayBuffer.make(16)\nlet sliced = buffer->ArrayBuffer.slice(~start=4, ~end=12)\nArrayBuffer.byteLength(sliced) == 8\n```" - ], - "signature": "let slice: (t, ~start: int=?, ~end: int=?) => t" - }, - { - "id": "Stdlib.ArrayBuffer.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [], - "signature": "let sliceToEnd: (t, ~start: int) => t", - "deprecated": "" - } - ] - }, - "stdlib/weakset": { - "id": "Stdlib.WeakSet", - "name": "WeakSet", - "docstrings": [ - "Bindings to JavaScript's `WeakSet`.\n\nWeak sets store references to objects without preventing those objects from being garbage collected." - ], - "items": [ - { - "id": "Stdlib.WeakSet.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Mutable weak set storing object references of type `'a`." - ], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.WeakSet.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates an empty weak set.\n\nSee [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) on MDN.\n\n## Examples\n\n```rescript\nlet visited = WeakSet.make()\nWeakSet.has(visited, Object.make()) == false\n```" - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Stdlib.WeakSet.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(set, value)` inserts `value` into the weak set and returns the set for chaining.\n\nSee [`WeakSet.prototype.add`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/add) on MDN.\n\n## Examples\n\n```rescript\nlet set = WeakSet.make()\nlet node = Object.make()\nWeakSet.add(set, node)\nWeakSet.has(set, node) == true\n```" - ], - "signature": "let add: (t<'a>, 'a) => t<'a>" - }, - { - "id": "Stdlib.WeakSet.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "`delete(set, value)` removes `value` and returns `true` if an entry existed.\n\nSee [`WeakSet.prototype.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/delete) on MDN.\n\n## Examples\n\n```rescript\nlet set = WeakSet.make()\nlet node = Object.make()\nlet _ = WeakSet.add(set, node)\nWeakSet.delete(set, node) == true\nWeakSet.delete(set, node) == false\n```" - ], - "signature": "let delete: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.WeakSet.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(set, value)` checks whether `value` exists in the weak set.\n\nSee [`WeakSet.prototype.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/has) on MDN.\n\n## Examples\n\n```rescript\nlet set = WeakSet.make()\nlet node = Object.make()\nWeakSet.has(set, node) == false\nlet _ = WeakSet.add(set, node)\nWeakSet.has(set, node) == true\n```" - ], - "signature": "let has: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.WeakSet.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(weakSet)` ignores the provided weakSet and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/set": { - "id": "Stdlib.Set", - "name": "Set", - "docstrings": [ - "Bindings to the mutable JavaScript `Set`.\n\nSee [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) on MDN." - ], - "items": [ - { - "id": "Stdlib.Set.t", - "kind": "type", - "name": "t", - "docstrings": ["Type representing an instance of `Set`."], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.Set.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new, mutable JavaScript `Set`. A `Set` is a collection of unique values.\n\nSee [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) on MDN.\n\n\n\n## Examples\n```rescript\n// You can annotate the type of your set if you want to\nlet mySet: Set.t = Set.make()\n\n// Or you can let ReScript infer what's in your Set\nlet set = Set.make()\nset->Set.add(\"Fine name\") // Inferred as Set.t\n```\n\n## Alternatives\nA JavaScript `Set` is mutable. If you're looking for an immutable alternative, check out `Belt.Set`." - ], - "signature": "let make: unit => t<'a>" - }, - { - "id": "Stdlib.Set.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Turns an array of values into a Set. Meaning only unique values are preserved.\n\n## Examples\n```rescript\ntype languages = ReScript | JavaScript | TypeScript\nlet languageRank = [ReScript, JavaScript, TypeScript]\n\nlet set = Set.fromArray(languageRank) // Set.t\n\nswitch set->Set.has(ReScript) {\n| true => Console.log(\"Yay, ReScript is in there!\")\n| false => Console.log(\"Uh-oh, something is _terribly_ wrong with this program... abort.\")\n}\n```" - ], - "signature": "let fromArray: array<'a> => t<'a>" - }, - { - "id": "Stdlib.Set.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "Turns an iterator into a `Set`.\n\n## Examples\n\n```rescript\n// Let's pretend we have an interator\nlet iterator: Iterator.t = %raw(`\n (() => {\n var array1 = ['a', 'b', 'c'];\n var iterator1 = array1[Symbol.iterator]();\n return iterator1\n })()\n`)\n\niterator\n->Set.fromIterator\n->Set.size == 3\n```" - ], - "signature": "let fromIterator: Iterator.t<'a> => t<'a>" - }, - { - "id": "Stdlib.Set.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns the size, the number of unique values, of the set.\n\nSee [`Set.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/size) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\n\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue2\")\n\nlet size = set->Set.size // 2\n```" - ], - "signature": "let size: t<'a> => int" - }, - { - "id": "Stdlib.Set.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(set)` returns `true` if the set has no values, `false` otherwise.\n\n## Examples\n```rescript\nlet emptySet = Set.make()\nemptySet->Set.isEmpty->assertEqual(true)\n\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.isEmpty->assertEqual(false)\n\n// After clearing the set\nset->Set.clear\nset->Set.isEmpty->assertEqual(true)\n```" - ], - "signature": "let isEmpty: t<'a> => bool" - }, - { - "id": "Stdlib.Set.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Clears all entries in the set.\n\nSee [`Set.clear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/clear) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\n\nset->Set.add(\"someKey\")\nset->Set.size // 1\n\nset->Set.clear\nset->Set.size // 0\n```" - ], - "signature": "let clear: t<'a> => unit" - }, - { - "id": "Stdlib.Set.add", - "kind": "value", - "name": "add", - "docstrings": [ - "Adds a new value to the set.\n\nSee [`Set.add`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/add) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\n```" - ], - "signature": "let add: (t<'a>, 'a) => unit" - }, - { - "id": "Stdlib.Set.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "Deletes the provided `value` from the set. Returns a `bool` for whether the value existed, and was deleted.\n\nSee [`Set.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nlet didDeleteValue = set->Set.delete(\"someValue\")\nConsole.log(didDeleteValue) // Logs `true` to the console, becuase the set had the value, so it was successfully deleted\n\nlet didDeleteValue = set->Set.delete(\"someNonExistantKey\")\nConsole.log(didDeleteValue) // Logs `false` to the console, becuase the value did not exist in the set\n```" - ], - "signature": "let delete: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.Set.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks whether the set has a specific value.\n\nSee [`Set.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/has) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\n\nswitch set->Set.has(\"someValue\") {\n| false => Console.log(\"Nope, didn't have it.\")\n| true => Console.log(\"Yay, we have the value!\")\n}\n```" - ], - "signature": "let has: (t<'a>, 'a) => bool" - }, - { - "id": "Stdlib.Set.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Iterates through all values of the set.\n\nSee [`Set.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/forEach) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue2\")\n\nset->Set.forEach(value => {\n Console.log(value)\n})\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Set.values", - "kind": "value", - "name": "values", - "docstrings": [ - "Returns an iterator that holds all values of the set.\n\nSee [`Set.values`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/values) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.add(\"anotherValue\")\n\nlet values = set->Set.values\n\n// Logs the first value\nConsole.log(Iterator.next(values).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh values iterator to get an array of all values, since we consumed a value via `next` above already.\nConsole.log(set->Set.values->Iterator.toArray)\n```" - ], - "signature": "let values: t<'a> => Iterator.t<'a>" - }, - { - "id": "Stdlib.Set.difference", - "kind": "value", - "name": "difference", - "docstrings": [ - "Returns a new set with the values of the set that are not in the other set.\n\nSee [`Set.difference`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/difference) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.difference(set2) // Set.fromArray([\"orange\"])\n```" - ], - "signature": "let difference: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.symmetricDifference", - "kind": "value", - "name": "symmetricDifference", - "docstrings": [ - "Returns a new set with the values containing the values which are in either the set, but not in both.\n\nSee [`Set.symmetricDifference`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/symmetricDifference) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.symmetricDifference(set2) // Set.fromArray([\"orange\", \"pear\"])\n```" - ], - "signature": "let symmetricDifference: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.intersection", - "kind": "value", - "name": "intersection", - "docstrings": [ - "Returns a new set with the values containing the values which are in both the set and the other set.\n\nSee [`Set.intersection`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/intersection) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.intersection(set2) // Set.fromArray([\"apple\", \"banana\"])\n```" - ], - "signature": "let intersection: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.isDisjointFrom", - "kind": "value", - "name": "isDisjointFrom", - "docstrings": [ - "Returns a bool indicating if this set has no elements in common with the given set.\n\nSee [`Set.isDisjointFrom`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isDisjointFrom) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"kiwi\", \"melon\", \"pear\"])\nset1->Set.isDisjointFrom(set2) // true\n```" - ], - "signature": "let isDisjointFrom: (t<'a>, t<'a>) => bool" - }, - { - "id": "Stdlib.Set.isSubsetOf", - "kind": "value", - "name": "isSubsetOf", - "docstrings": [ - "Returns a bool indicating if the all values in the set are in the given set.\n\nSee [`Set.isSubsetOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isSubsetOf) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.isSubsetOf(set2) // true\n```" - ], - "signature": "let isSubsetOf: (t<'a>, t<'a>) => bool" - }, - { - "id": "Stdlib.Set.isSupersetOf", - "kind": "value", - "name": "isSupersetOf", - "docstrings": [ - "Returns a bool indicating if the all values in the given set are in the set.\n\nSee [`Set.isSupersetOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isSupersetOf) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\"])\nset1->Set.isSupersetOf(set2) // true\n```" - ], - "signature": "let isSupersetOf: (t<'a>, t<'a>) => bool" - }, - { - "id": "Stdlib.Set.union", - "kind": "value", - "name": "union", - "docstrings": [ - "Returns a new set with the values of the set that are in both the set and the other set.\n\nSee [`Set.union`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/union) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.union(set2) // Set.fromArray([\"apple\", \"orange\", \"banana\", \"pear\"])\n```" - ], - "signature": "let union: (t<'a>, t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Set.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(set)` returns an array of all values of the set.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n```rescript\nlet set = Set.fromArray([\"apple\", \"orange\", \"apple\", \"banana\"])\nset->Set.toArray // [\"apple\", \"orange\", \"banana\"]\n```" - ], - "signature": "let toArray: t<'a> => array<'a>" - }, - { - "id": "Stdlib.Set.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(set)` ignores the provided set and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/weakmap": { - "id": "Stdlib.WeakMap", - "name": "WeakMap", - "docstrings": [ - "Bindings to JavaScript's `WeakMap`.\n\nWeak maps keep key/value pairs where keys must be objects and the references do not prevent garbage collection." - ], - "items": [ - { - "id": "Stdlib.WeakMap.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Mutable weak map storing values of type `'v` with object keys `'k`." - ], - "signature": "type t<'k, 'v>" - }, - { - "id": "Stdlib.WeakMap.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates an empty weak map.\n\nSee [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nWeakMap.get(cache, Object.make()) == None\n```" - ], - "signature": "let make: unit => t<'k, 'v>" - }, - { - "id": "Stdlib.WeakMap.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(map, key)` returns `Some(value)` when `key` exists, otherwise `None`.\n\nSee [`WeakMap.prototype.get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/get) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nWeakMap.get(cache, key) == None\nlet _ = WeakMap.set(cache, key, \"user\")\nWeakMap.get(cache, key) == Some(\"user\")\n```" - ], - "signature": "let get: (t<'k, 'v>, 'k) => option<'v>" - }, - { - "id": "Stdlib.WeakMap.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(map, key)` checks whether `key` exists in the weak map.\n\nSee [`WeakMap.prototype.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/has) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nWeakMap.has(cache, key) == false\nlet _ = WeakMap.set(cache, key, ())\nWeakMap.has(cache, key) == true\n```" - ], - "signature": "let has: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.WeakMap.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(map, key, value)` stores `value` for `key` and returns the map for chaining.\n\nSee [`WeakMap.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/set) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nlet _ = WeakMap.set(cache, key, 42)\nWeakMap.get(cache, key) == Some(42)\n```" - ], - "signature": "let set: (t<'k, 'v>, 'k, 'v) => t<'k, 'v>" - }, - { - "id": "Stdlib.WeakMap.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "`delete(map, key)` removes `key` and returns `true` if an entry existed.\n\nSee [`WeakMap.prototype.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/delete) on MDN.\n\n## Examples\n\n```rescript\nlet cache = WeakMap.make()\nlet key = Object.make()\nWeakMap.delete(cache, key) == false\nlet _ = WeakMap.set(cache, key, 1)\nWeakMap.delete(cache, key) == true\n```" - ], - "signature": "let delete: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.WeakMap.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(weakMap)` ignores the provided weakMap and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'k, 'v> => unit" - } - ] - }, - "stdlib/map": { - "id": "Stdlib.Map", - "name": "Map", - "docstrings": [ - "Bindings to the mutable JavaScript `Map`.\n\nSee [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) on MDN." - ], - "items": [ - { - "id": "Stdlib.Map.t", - "kind": "type", - "name": "t", - "docstrings": ["Type representing an instance of `Map`."], - "signature": "type t<'k, 'v>" - }, - { - "id": "Stdlib.Map.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new, mutable JavaScript `Map`. A `Map` can have any values as both keys and values.\n\nSee [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) on MDN.\n\n\n\n## Examples\n```rescript\n`make()`\n// You can annotate the type of your map if you want to\nlet myMap: Map.t = Map.make()\n\n// Or you can let ReScript infer what's in your map\nlet map = Map.make()\nmap->Map.set(\"lang\", \"ReScript\") // Inferred as Map.t\n```\n\n## Alternatives\nA JavaScript `Map` is mutable. If you're looking for an immutable alternative, check out`Belt.Map`." - ], - "signature": "let make: unit => t<'k, 'v>" - }, - { - "id": "Stdlib.Map.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "Turns an array of key/value pairs into a Map.\n\n## Examples\n```rescript\ntype languages = ReScript | JavaScript | TypeScript\nlet languageRank = [(ReScript, 1), (JavaScript, 2), (TypeScript, 3)]\n\nlet map = Map.fromArray(languageRank) // Map.t\n\nswitch map->Map.get(ReScript) {\n| Some(1) => Console.log(\"Yay, ReScript is #1!\")\n| _ => Console.log(\"Uh-oh, something is _terribly_ wrong with this program... abort.\")\n}\n```" - ], - "signature": "let fromArray: array<('k, 'v)> => t<'k, 'v>" - }, - { - "id": "Stdlib.Map.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "Turns an iterator in the shape of `('key, 'value)` into a `Map`.\n\n## Examples\n\n```rescript\n// Let's pretend we have an interator in the correct shape\nlet iterator: Iterator.t<(string, string)> = %raw(`\n (() => {\n var map1 = new Map();\n\n map1.set('first', '1');\n map1.set('second', '2');\n\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\n\niterator\n->Map.fromIterator\n->Map.size == 2\n```" - ], - "signature": "let fromIterator: Iterator.t<('k, 'v)> => t<'k, 'v>" - }, - { - "id": "Stdlib.Map.size", - "kind": "value", - "name": "size", - "docstrings": [ - "Returns the size, the number of key/value pairs, of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\n\nmap->Map.set(\"someKey\", \"someValue\")\n\nlet size = map->Map.size // 1\n```" - ], - "signature": "let size: t<'k, 'v> => int" - }, - { - "id": "Stdlib.Map.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(map)` returns `true` if the map has no key/value pairs, `false` otherwise.\n\n## Examples\n```rescript\nlet emptyMap = Map.make()\nemptyMap->Map.isEmpty->assertEqual(true)\n\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.isEmpty->assertEqual(false)\n\n// After clearing the map\nmap->Map.clear\nmap->Map.isEmpty->assertEqual(true)\n```" - ], - "signature": "let isEmpty: t<'k, 'v> => bool" - }, - { - "id": "Stdlib.Map.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "Clears all entries in the map.\n\n## Examples\n```rescript\nlet map = Map.make()\n\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.size // 1\n\nmap->Map.clear\nmap->Map.size // 0\n```" - ], - "signature": "let clear: t<'k, 'v> => unit" - }, - { - "id": "Stdlib.Map.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "Iterates through all values of the map.\n\n> Please note that this is *without the keys*, just the values. If you need the key as well, use `Map.forEachWithKey`.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\nmap->Map.forEach(value => {\n Console.log(value)\n})\n```" - ], - "signature": "let forEach: (t<'k, 'v>, 'v => unit) => unit" - }, - { - "id": "Stdlib.Map.forEachWithKey", - "kind": "value", - "name": "forEachWithKey", - "docstrings": [ - "Iterates through all values of the map, including the key for each value.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\nmap->Map.forEachWithKey((value, key) => {\n Console.log2(value, key)\n})\n```" - ], - "signature": "let forEachWithKey: (t<'k, 'v>, ('v, 'k) => unit) => unit" - }, - { - "id": "Stdlib.Map.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the value for a key, if a value exists at that key.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n\nswitch map->Map.get(\"someKey\") {\n| None => Console.log(\"Nope, didn't have it.\")\n| Some(value) => Console.log2(\"Yay, had the value, and it's:\", value)\n}\n```" - ], - "signature": "let get: (t<'k, 'v>, 'k) => option<'v>" - }, - { - "id": "Stdlib.Map.has", - "kind": "value", - "name": "has", - "docstrings": [ - "Checks whether the map has a specific key.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n\nswitch map->Map.has(\"someKey\") {\n| false => Console.log(\"Nope, didn't have it.\")\n| true => Console.log(\"Yay, we have the value!\")\n}\n```" - ], - "signature": "let has: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.Map.set", - "kind": "value", - "name": "set", - "docstrings": [ - "Sets the provided `value` to the provided `key`.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n```" - ], - "signature": "let set: (t<'k, 'v>, 'k, 'v) => unit" - }, - { - "id": "Stdlib.Map.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "Deletes the provided `key` and its value from the map. Returns a `bool` for whether the key existed, and was deleted.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nlet didDeleteKey = map->Map.delete(\"someKey\")\nConsole.log(didDeleteKey) // Logs `true` to the console, becuase the map had the key, so it was successfully deleted\n\nlet didDeleteKey = map->Map.delete(\"someNonExistantKey\")\nConsole.log(didDeleteKey) // Logs `false` to the console, becuase the key did not exist\n```" - ], - "signature": "let delete: (t<'k, 'v>, 'k) => bool" - }, - { - "id": "Stdlib.Map.keys", - "kind": "value", - "name": "keys", - "docstrings": [ - "Returns an iterator that holds all keys of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet keys = map->Map.keys\n\n// Logs the first key\nConsole.log(Iterator.next(keys).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh keys iterator to get an array of all keys, since we consumed a value via `next` above already.\nConsole.log(map->Map.keys->Iterator.toArray)\n```" - ], - "signature": "let keys: t<'k, 'v> => Iterator.t<'k>" - }, - { - "id": "Stdlib.Map.values", - "kind": "value", - "name": "values", - "docstrings": [ - "Returns an iterator that holds all values of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet values = map->Map.values\n\n// Logs the first value\nConsole.log(Iterator.next(values).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh values iterator to get an array of all values, since we consumed a value via `next` above already.\nConsole.log(map->Map.values->Iterator.toArray)\n```" - ], - "signature": "let values: t<'k, 'v> => Iterator.t<'v>" - }, - { - "id": "Stdlib.Map.entries", - "kind": "value", - "name": "entries", - "docstrings": [ - "Returns an iterator that holds all entries of the map.\nAn entry is represented as a tuple of `('key, 'value)`,\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet entries = map->Map.entries\n\n// Logs the first value\nConsole.log(Iterator.next(entries).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes entries. We'll need a fresh entries iterator to get an array of all entries, since we consumed a value via `next` above already.\nConsole.log(map->Map.entries->Iterator.toArray)\n```" - ], - "signature": "let entries: t<'k, 'v> => Iterator.t<('k, 'v)>" - }, - { - "id": "Stdlib.Map.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(map)` ignores the provided map and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'k, 'v> => unit" - } - ] - }, - "stdlib/asynciterator": { - "id": "Stdlib.AsyncIterator", - "name": "AsyncIterator", - "docstrings": [ - "Bindings to async iterators, a way to do async iteration in JavaScript.\n\nSee [async iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) on MDN." - ], - "items": [ - { - "id": "Stdlib.AsyncIterator.t", - "kind": "type", - "name": "t", - "docstrings": ["The type representing an async iterator."], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.AsyncIterator.value", - "kind": "type", - "name": "value", - "docstrings": [], - "signature": "type value<'a> = {done: bool, value: option<'a>}" - }, - { - "id": "Stdlib.AsyncIterator.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(nextFn)`\n\nCreates an async iterator from a function that returns the next value of the iterator.\n\n## Examples\n\n- A simple example, creating an async iterator that returns 1, 2, 3:\n\n```rescript\nlet context = ref(0)\n\nlet asyncIterator = AsyncIterator.make(async () => {\n let currentValue = context.contents\n // Increment current value\n context := currentValue + 1\n\n {\n AsyncIterator.value: Some(currentValue),\n done: currentValue >= 3,\n }\n})\n\n// This will log 1, 2, 3\nlet main = async () =>\n await asyncIterator->AsyncIterator.forEach(value =>\n switch value {\n | Some(value) => Console.log(value)\n | None => ()\n }\n )\n\nmain()->ignore\n```" - ], - "signature": "let make: (unit => promise>) => t<'value>" - }, - { - "id": "Stdlib.AsyncIterator.value", - "kind": "value", - "name": "value", - "docstrings": [ - "`value(value)`\n\nShorthand for creating a value object with the provided value, and the `done` property set to false.\n\n## Examples\n\n```rescript\nlet context = ref(0)\n\nlet asyncIterator = AsyncIterator.make(async () => {\n let currentValue = context.contents\n // Increment current value\n context := currentValue + 1\n\n if currentValue >= 3 {\n AsyncIterator.done()\n } else {\n AsyncIterator.value(currentValue)\n }\n})\n```" - ], - "signature": "let value: 'value => value<'value>" - }, - { - "id": "Stdlib.AsyncIterator.done", - "kind": "value", - "name": "done", - "docstrings": [ - "`done(~finalValue=?)`\n\n Shorthand for creating a value object with the `done` property set to true, and the provided value as the final value, if any.\n\n ## Examples\n ```rescript\n let context = ref(0)\n \n let asyncIterator = AsyncIterator.make(async () => {\n let currentValue = context.contents\n // Increment current value\n context := currentValue + 1\n \n if currentValue >= 3 {\n AsyncIterator.done()\n } else {\n AsyncIterator.value(currentValue)\n }\n })\n ```" - ], - "signature": "let done: (~finalValue: 'value=?) => value<'value>" - }, - { - "id": "Stdlib.AsyncIterator.next", - "kind": "value", - "name": "next", - "docstrings": [ - "`next(asyncIterator)`\n\nReturns the next value of the iterator, if any.\n\nSee [async iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) on MDN.\n\n## Examples\n\n- A simple example, getting the next value:\n\n```rescript\nlet asyncIterator: AsyncIterator.t<(string, string)> = %raw(`\n (() => {\n var map1 = new Map();\n\n map1.set('first', '1');\n map1.set('second', '2');\n\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\n\nlet processMyAsyncIterator = async () => {\n // ReScript doesn't have `for ... of` loops, but it's easy to mimic using a while loop.\n let break = ref(false)\n\n while !break.contents {\n // Await the next iterator value\n let {value, done} = await asyncIterator->AsyncIterator.next\n\n // Exit the while loop if the iterator says it's done\n break := done\n\n if done {\n value->Option.isNone == true\n }\n }\n}\n\nprocessMyAsyncIterator()->ignore\n```" - ], - "signature": "let next: t<'a> => promise>" - }, - { - "id": "Stdlib.AsyncIterator.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(iterator, fn)` consumes all values in the async iterator and runs the callback `fn` for each value.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n\n```rescript\n// Let's pretend we get an async iterator returning ints from somewhere.\nlet asyncIterator: AsyncIterator.t<(string, string)> = %raw(`\n (() => {\n var map1 = new Map();\n\n map1.set('first', '1');\n map1.set('second', '2');\n\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\n\nlet main = async () =>\n await asyncIterator->AsyncIterator.forEach(v => {\n switch v {\n | Some((\"second\", value)) => value == \"2\"\n | _ => ()\n }\n })\n\nmain()->ignore\n```" - ], - "signature": "let forEach: (t<'a>, option<'a> => unit) => promise" - }, - { - "id": "Stdlib.AsyncIterator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(iterator)` ignores the provided async iterator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/iterator": { - "id": "Stdlib.Iterator", - "name": "Iterator", - "docstrings": [ - "Bindings to JavaScript iterators.\n\nSee [`Iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) on MDN." - ], - "items": [ - { - "id": "Stdlib.Iterator.t", - "kind": "type", - "name": "t", - "docstrings": ["The type representing an iterator."], - "signature": "type t<'a>" - }, - { - "id": "Stdlib.Iterator.value", - "kind": "type", - "name": "value", - "docstrings": ["The current value of an iterator."], - "signature": "type value<'a> = {done: bool, value: option<'a>}" - }, - { - "id": "Stdlib.Iterator.next", - "kind": "value", - "name": "next", - "docstrings": [ - "Returns the next value of the iterator, if any.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n\n```rescript\nlet iterator: Iterator.t = %raw(`\n (() => {\n var array1 = ['a'];\n var iterator1 = array1[Symbol.iterator]();\n return iterator1\n })()\n`)\n(iterator->Iterator.next).done == false\n(iterator->Iterator.next).done == true\n```" - ], - "signature": "let next: t<'a> => value<'a>" - }, - { - "id": "Stdlib.Iterator.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "Turns an iterator into an array of the remaining values.\nRemember that each invocation of `next` of an iterator consumes a value. `Iterator.toArray` will consume all remaining values of the iterator and return them in an array to you.\n\nSee [Iterator.prototype.toArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/toArray) on MDN.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\n// `Map.keys` returns all keys of the map as an iterator.\nlet mapKeysAsArray = map->Map.keys->Iterator.toArray\n\nmapKeysAsArray == [\"someKey\", \"someKey2\"]\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let toArray: t<'a> => array<'a>" - }, - { - "id": "Stdlib.Iterator.toArrayWithMapper", - "kind": "value", - "name": "toArrayWithMapper", - "docstrings": [ - "`toArray(iterator)` turns `iterator` into an array of its remaining values, applying the provided mapper function on each item.\nRemember that each invocation of `next` of an iterator consumes a value. `Iterator.toArrayWithMapper` will consume all remaining values of the iterator and return them in an array to you.\n\nSee [Iterator.prototype.toArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/toArray) on MDN.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\n// `Map.keys` returns all keys of the map as an iterator.\nlet mapKeysAsArray =\n map\n ->Map.keys\n ->Iterator.toArrayWithMapper(key => key->String.length)\n\nmapKeysAsArray == [7, 8]\n```" - ], - "signature": "let toArrayWithMapper: (t<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Stdlib.Iterator.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(iterator, fn)` consumes all values in the iterator and runs the callback `fn` for each value.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n```rescript\nlet iterator: Iterator.t = [\"a\", \"b\", \"c\"]->Array.values\nlet acc = ref(\"\")\niterator->Iterator.forEach(v => {\n acc := acc.contents ++ v\n})\n\nacc.contents == \"abc\"\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Iterator.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(iterator)` ignores the provided iterator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - }, - { - "id": "Stdlib.Iterator.drop", - "kind": "value", - "name": "drop", - "docstrings": [ - "`drop(iterator, n)` returns a new iterator helper object that skips the given number of elements at the start of this iterator.\n\nSee [Iterator.prototype.drop](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/drop) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.drop(2)\nseq->Iterator.next == {done: false, value: Some(2)}\nseq->Iterator.next == {done: false, value: Some(3)}\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let drop: (t<'a>, int) => t<'a>" - }, - { - "id": "Stdlib.Iterator.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(iterator, fn)` tests whether all elements in the iterator pass the test implemented by the provided function.\n\nSee [Iterator.prototype.every](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/every) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet areAllEven = fibonacci->Iterator.every(n => n % 2 == 0)\nareAllEven == false\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Iterator.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(iterator, fn)` returns a new iterator helper object that contains the elements of the original iterator that pass the test implemented by the provided function.\n\nSee [Iterator.prototype.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/filter) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.filter(n => n % 2 == 0)\nseq->Iterator.next == {done: false, value: Some(2)}\nseq->Iterator.next == {done: false, value: Some(8)}\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>" - }, - { - "id": "Stdlib.Iterator.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(iterator, fn)` returns the value of the first element in the iterator that satisfies the provided testing function.\n\nSee [Iterator.prototype.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/find) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.find(n => n % 2 == 0)\nseq == Some(2)\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Iterator.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(iterator, fn)` returns a new iterator helper object that contains the elements of the original iterator that pass the test implemented by the provided function.\n\nSee [Iterator.prototype.flatMap](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/flatMap) on MDN.\n\n## Examples\n```rescript\nlet map1 = Map.fromArray([(\"a\", 1), (\"b\", 2), (\"c\", 3)])\nlet map2 = Map.fromArray([(\"d\", 4), (\"e\", 5), (\"f\", 6)])\n\nlet letters =\n [map1, map2]\n ->Array.values\n ->Iterator.flatMap(m => Map.keys(m))\n ->Array.fromIterator\nletters == [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Iterator.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(iterator, fn)` returns a new iterator helper object that yields elements of the iterator, each transformed by a mapping function.\n\nSee [Iterator.prototype.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/map) on MDN.\n\n## Examples\n```rescript\nlet map = Map.fromArray([(\"a\", 1), (\"b\", 2), (\"c\", 3)])\nlet letters = map->Map.keys->Iterator.map(v => v->String.toUpperCase)->Array.fromIterator\nletters == [\"A\", \"B\", \"C\"]\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Iterator.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(iterator, fn, initialValue)` applies a function against an accumulator and each element in the iterator (from left to right) to reduce it to a single value.\n\nSee [Iterator.prototype.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/reduce) on MDN.\n\n## Examples\n```rescript\nlet numbers: Iterator.t = [1, 2, 3]->Array.values\n\nlet sum = numbers->Iterator.reduce((acc, n) => acc + n, ~initialValue=0)\nsum == 6\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let reduce: (t<'a>, ('acc, 'a) => 'acc, ~initialValue: 'acc=?) => 'acc" - }, - { - "id": "Stdlib.Iterator.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(iterator, fn)` The some() method of Iterator instances is similar to Array.some:\nit tests whether at least one element produced by the iterator passes the test implemented by the provided function.\nIt returns a boolean value.\n\nSee [Iterator.prototype.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/some) on MDN.\n\n## Examples\n```rescript\nlet numbers: Iterator.t = [1, 2, 3]->Array.values\n\nlet hasEven = numbers->Iterator.some(n => n % 2 == 0)\nhasEven == true\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Iterator.take", - "kind": "value", - "name": "take", - "docstrings": [ - "`take((iterator, n))` returns a new iterator helper object that contains the first `n` elements of this iterator.\n\nSee [Iterator.prototype.take](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/take) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [1, 1, 2, 3, 5, 8, 13, 21]->Array.values\n\nlet seq = fibonacci->Iterator.take(2)\nseq->Iterator.next == {done: false, value: Some(1)}\nseq->Iterator.next == {done: false, value: Some(1)}\nseq->Iterator.next == {done: true, value: None}\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let take: (t<'a>, int) => t<'a>" - } - ] - }, - "stdlib/type": { - "id": "Stdlib.Type", - "name": "Type", - "docstrings": [ - "Utilities for classifying the type of JavaScript values at runtime." - ], - "items": [ - { - "id": "Stdlib.Type.t", - "kind": "type", - "name": "t", - "docstrings": ["The possible types of JavaScript values."], - "signature": "type t = [\n | #bigint\n | #boolean\n | #function\n | #number\n | #object\n | #string\n | #symbol\n | #undefined\n]" - }, - { - "id": "Stdlib.Type.typeof", - "kind": "value", - "name": "typeof", - "docstrings": [ - "`typeof(someValue)`\n\nReturns the underlying JavaScript type of any runtime value.\n\nSee [`typeof`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof) on MDN.\n\n## Examples\n```rescript\nConsole.log(Type.typeof(\"Hello\")) // Logs \"string\" to the console.\n\nlet someVariable = true\n\nswitch someVariable->Type.typeof {\n| #boolean => Console.log(\"This is a bool, yay!\")\n| _ => Console.log(\"Oh, not a bool sadly...\")\n}\n```" - ], - "signature": "let typeof: 'a => t" - }, - { - "id": "Stdlib.Type.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(type)` ignores the provided type and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/symbol": { - "id": "Stdlib.Symbol", - "name": "Symbol", - "docstrings": [ - "A built-in object that serves as a namespace for globally-unique identifiers.\n\nCompiles to a regular JavaScript Symbol." - ], - "items": [ - { - "id": "Stdlib.Symbol.t", - "kind": "type", - "name": "t", - "docstrings": ["Type representing a Symbol."], - "signature": "type t" - }, - { - "id": "Stdlib.Symbol.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(key)`\n\nMakes a new unique Symbol value.\n\n## Examples\n\n```rescript\nSymbol.make(\"sym1\")->Symbol.description == Some(\"sym1\")\n```" - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.Symbol.getFor", - "kind": "value", - "name": "getFor", - "docstrings": [ - "`getFor(key)`\n\nSearches for existing registered Symbols in the global Symbol registry with the given key and returns it if found.\nOtherwise a new Symbol gets created and registered with key.\n\n## Examples\n\n```rescript\nSymbol.getFor(\"sym1\") == Symbol.getFor(\"sym1\")\n```" - ], - "signature": "let getFor: string => option" - }, - { - "id": "Stdlib.Symbol.keyFor", - "kind": "value", - "name": "keyFor", - "docstrings": [ - "`keyFor(key)`\n\nRetrieves a shared Symbol key from the global Symbol registry for the given Symbol.\n\n## Examples\n\n```rescript\nlet globalSym = Symbol.getFor(\"sym1\") // Global symbol\n\nglobalSym->Option.flatMap(Symbol.description) == Some(\"sym1\")\n```" - ], - "signature": "let keyFor: t => option" - }, - { - "id": "Stdlib.Symbol.description", - "kind": "value", - "name": "description", - "docstrings": [ - "`description`\n\nReturns `Some(string)` containing the description of this symbol, or `None` if the symbol has no description.\n## Examples\n\n```rescript\nlet sym = Symbol.make(\"sym1\")\nSymbol.description(sym) == Some(\"sym1\")\n```" - ], - "signature": "let description: t => option" - }, - { - "id": "Stdlib.Symbol.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString`\n\n// Returns a string representing this symbol value.\n\n## Examples\n\n```rescript\nlet sym = Symbol.make(\"sym1\")\n\nSymbol.toString(sym) == \"Symbol(sym1)\"\n```" - ], - "signature": "let toString: t => string" - }, - { - "id": "Stdlib.Symbol.asyncIterator", - "kind": "value", - "name": "asyncIterator", - "docstrings": [ - "`asyncIterator` is the well-known symbol used by asynchronous iterables.\n\nSee [`Symbol.asyncIterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator) on MDN." - ], - "signature": "let asyncIterator: t" - }, - { - "id": "Stdlib.Symbol.hasInstance", - "kind": "value", - "name": "hasInstance", - "docstrings": [ - "`hasInstance` is used by custom `instanceof` checks.\n\nSee [`Symbol.hasInstance`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance) on MDN." - ], - "signature": "let hasInstance: t" - }, - { - "id": "Stdlib.Symbol.isConcatSpreadable", - "kind": "value", - "name": "isConcatSpreadable", - "docstrings": [ - "`isConcatSpreadable` controls whether objects are flattened when passed to `Array.concat`.\n\nSee [`Symbol.isConcatSpreadable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/isConcatSpreadable) on MDN." - ], - "signature": "let isConcatSpreadable: t" - }, - { - "id": "Stdlib.Symbol.iterator", - "kind": "value", - "name": "iterator", - "docstrings": [ - "`iterator` is returned by objects that can be iterated with `for..of`.\n\nSee [`Symbol.iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/iterator) on MDN." - ], - "signature": "let iterator: t" - }, - { - "id": "Stdlib.Symbol.match", - "kind": "value", - "name": "match", - "docstrings": [ - "`match` customises how values respond to `String.prototype.match`.\n\nSee [`Symbol.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/match) on MDN." - ], - "signature": "let match: t" - }, - { - "id": "Stdlib.Symbol.matchAll", - "kind": "value", - "name": "matchAll", - "docstrings": [ - "`matchAll` customises how values respond to `String.prototype.matchAll`.\n\nSee [`Symbol.matchAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/matchAll) on MDN." - ], - "signature": "let matchAll: t" - }, - { - "id": "Stdlib.Symbol.replace", - "kind": "value", - "name": "replace", - "docstrings": [ - "`replace` customises how values respond to `String.prototype.replace`.\n\nSee [`Symbol.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/replace) on MDN." - ], - "signature": "let replace: t" - }, - { - "id": "Stdlib.Symbol.search", - "kind": "value", - "name": "search", - "docstrings": [ - "`search` customises how values respond to `String.prototype.search`.\n\nSee [`Symbol.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) on MDN." - ], - "signature": "let search: t" - }, - { - "id": "Stdlib.Symbol.species", - "kind": "value", - "name": "species", - "docstrings": [ - "`species` lets constructors return a different derived constructor when methods create new instances.\n\nSee [`Symbol.species`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/species) on MDN." - ], - "signature": "let species: t" - }, - { - "id": "Stdlib.Symbol.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split` customises how values respond to `String.prototype.split`.\n\nSee [`Symbol.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/split) on MDN." - ], - "signature": "let split: t" - }, - { - "id": "Stdlib.Symbol.toPrimitive", - "kind": "value", - "name": "toPrimitive", - "docstrings": [ - "`toPrimitive` customises how objects convert to primitive values.\n\nSee [`Symbol.toPrimitive`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toPrimitive) on MDN." - ], - "signature": "let toPrimitive: t" - }, - { - "id": "Stdlib.Symbol.toStringTag", - "kind": "value", - "name": "toStringTag", - "docstrings": [ - "`toStringTag` customises the default tag shown by `Object.prototype.toString`.\n\nSee [`Symbol.toStringTag`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag) on MDN." - ], - "signature": "let toStringTag: t" - }, - { - "id": "Stdlib.Symbol.unscopables", - "kind": "value", - "name": "unscopables", - "docstrings": [ - "`unscopables` marks properties that should be skipped by `with`.\n\nSee [`Symbol.unscopables`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/unscopables) on MDN." - ], - "signature": "let unscopables: t" - }, - { - "id": "Stdlib.Symbol.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(symbol)` ignores the provided symbol and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/string": { - "id": "Stdlib.String", - "name": "String", - "docstrings": [ - "Functions for interacting with JavaScript strings.\nSee: [`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)." - ], - "items": [ - { - "id": "Stdlib.String.t", - "kind": "type", - "name": "t", - "docstrings": ["Type representing a string."], - "signature": "type t = string" - }, - { - "id": "Stdlib.String.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nString.make(3.5) == \"3.5\"\nString.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => string" - }, - { - "id": "Stdlib.String.fromCharCode", - "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to\nthat number, `n` ranges from 0 to 65535. If out of range, the lower 16 bits of\nthe value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as\n`fromCharCode(0xF63A)`.\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nString.fromCharCode(65) == \"A\"\nString.fromCharCode(0x3c8) == `ψ`\nString.fromCharCode(0xd55c) == `한`\nString.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => string" - }, - { - "id": "Stdlib.String.fromCharCodeMany", - "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`.\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nString.fromCharCodeMany([189, 43, 190, 61]) == \"½+¾=\"\nString.fromCharCodeMany([65, 66, 67]) == \"ABC\"\n```" - ], - "signature": "let fromCharCodeMany: array => string" - }, - { - "id": "Stdlib.String.fromCodePoint", - "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point.\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint) on MDN.\n\n## Examples\n\n```rescript\nString.fromCodePoint(65) == \"A\"\nString.fromCodePoint(0x3c8) == `ψ`\nString.fromCodePoint(0xd55c) == `한`\nString.fromCodePoint(0x1f63a) == `😺`\n```\n\n## Exceptions\n\n- `RangeError`: If the number is not a valid code point, like `fromCharCode(-5)`." - ], - "signature": "let fromCodePoint: int => string" - }, - { - "id": "Stdlib.String.fromCodePointMany", - "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint) on MDN.\n\n## Examples\n\n```rescript\nString.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```\n\n## Exceptions\n\n- `RangeError`: If one of the number is not a valid code point, like\n `fromCharCode([1, -5])`." - ], - "signature": "let fromCodePointMany: array => string" - }, - { - "id": "Stdlib.String.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(str1, str2)` checks if two strings are equal.\n\n## Examples\n\n```rescript\nString.equal(\"hello\", \"hello\") == true\nString.equal(\"hello\", \"world\") == false\nString.equal(\"\", \"\") == true\n```" - ], - "signature": "let equal: (string, string) => bool" - }, - { - "id": "Stdlib.String.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(str1, str2)` compares two strings, returns an `Ordering.t` value.\n\n## Examples\n\n```rescript\nString.compare(\"hello\", \"hello\") == Ordering.equal\nString.compare(\"apple\", \"banana\") == Ordering.less\nString.compare(\"zebra\", \"apple\") == Ordering.greater\n```" - ], - "signature": "let compare: (string, string) => Ordering.t" - }, - { - "id": "Stdlib.String.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(str)` returns the length of the given `string`.\nSee [`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length) on MDN.\n\n## Examples\n\n```rescript\nString.length(\"abcd\") == 4\n```" - ], - "signature": "let length: string => int" - }, - { - "id": "Stdlib.String.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(str, index)` returns an `option` at the given `index` number. If\n`index` is out of range, this function returns `None`.\n\n## Examples\n\n```rescript\nString.get(\"ReScript\", 0) == Some(\"R\")\nString.get(\"Hello\", 4) == Some(\"o\")\nString.get(`JS`, 4) == None\n```" - ], - "signature": "let get: (string, int) => option" - }, - { - "id": "Stdlib.String.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(str, index)` returns an `string` at the given `index` number.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `string`.\n\nUse `String.getUnsafe` only when you are sure the `index` exists.\n## Examples\n\n```rescript\nString.getUnsafe(\"ReScript\", 0) == \"R\"\nString.getUnsafe(\"Hello\", 4) == \"o\"\n```" - ], - "signature": "let getUnsafe: (string, int) => string" - }, - { - "id": "Stdlib.String.charAt", - "kind": "value", - "name": "charAt", - "docstrings": [ - "`charAt(str, index)` gets the character at `index` within string `str`. If\n`index` is negative or greater than the length of `str`, it returns the empty\nstring. If the string contains characters outside the range \\\\u0000-\\\\uffff, it\nwill return the first 16-bit value at that position in the string.\nSee [`String.charAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt) on MDN.\n\n## Examples\n\n```rescript\nString.charAt(\"ReScript\", 0) == \"R\"\nString.charAt(\"Hello\", 12) == \"\"\nString.charAt(`JS`, 5) == \"\"\n```" - ], - "signature": "let charAt: (string, int) => string" - }, - { - "id": "Stdlib.String.charCodeAt", - "kind": "value", - "name": "charCodeAt", - "docstrings": [ - "`charCodeAt(str, index)` returns the character code at position `index` in\nstring `str` the result is in the range 0-65535, unlike `codePointAt`, so it\nwill not work correctly for characters with code points greater than or equal\nto 0x10000.\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt) on MDN.\n\n## Examples\n\n```rescript\nString.charCodeAt(`😺`, 0) == Some(0xd83d)\nString.charCodeAt(\"\", 0) == None\nString.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" - ], - "signature": "let charCodeAt: (string, int) => option" - }, - { - "id": "Stdlib.String.charCodeAtUnsafe", - "kind": "value", - "name": "charCodeAtUnsafe", - "docstrings": [ - "`charCodeAtUnsafe(str, index)` returns the character code at position `index` in\nstring `str` the result is in the range 0-65535, unlike `codePointAt`, so it\nwill not work correctly for characters with code points greater than or equal\nto 0x10000.\nBeware: If the index is out of range, it will return `NaN` which is not actually a valid int.\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt) on MDN.\n\n## Examples\n\n```rescript\nString.charCodeAtUnsafe(`😺`, 0) == 0xd83d\nString.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" - ], - "signature": "let charCodeAtUnsafe: (string, int) => int" - }, - { - "id": "Stdlib.String.codePointAt", - "kind": "value", - "name": "codePointAt", - "docstrings": [ - "`codePointAt(str, index)` returns the code point at position `index` within\nstring `str` as a `Some(value)`. The return value handles code points greater\nthan or equal to 0x10000. If there is no code point at the given position, the\nfunction returns `None`.\nSee [`String.codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) on MDN.\n\n## Examples\n\n```rescript\nString.codePointAt(`¿😺?`, 1) == Some(0x1f63a)\nString.codePointAt(\"abc\", 5) == None\n```" - ], - "signature": "let codePointAt: (string, int) => option" - }, - { - "id": "Stdlib.String.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(original, append)` returns a new `string` with `append` added after\n`original`.\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat) on MDN.\n\n## Examples\n\n```rescript\nString.concat(\"cow\", \"bell\") == \"cowbell\"\nString.concat(\"Re\", \"Script\") == \"ReScript\"\n```" - ], - "signature": "let concat: (string, string) => string" - }, - { - "id": "Stdlib.String.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(original, arr)` returns a new `string` consisting of each item of an\narray of strings added to the `original` string.\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat) on MDN.\n\n## Examples\n\n```rescript\nString.concatMany(\"1st\", [\"2nd\", \"3rd\", \"4th\"]) == \"1st2nd3rd4th\"\n```" - ], - "signature": "let concatMany: (string, array) => string" - }, - { - "id": "Stdlib.String.endsWith", - "kind": "value", - "name": "endsWith", - "docstrings": [ - "`endsWith(str, substr)` returns `true` if the `str` ends with `substr`, `false`\notherwise.\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith) on MDN.\n\n## Examples\n\n```rescript\nString.endsWith(\"BuckleScript\", \"Script\") == true\nString.endsWith(\"BuckleShoes\", \"Script\") == false\n```" - ], - "signature": "let endsWith: (string, string) => bool" - }, - { - "id": "Stdlib.String.endsWithFrom", - "kind": "value", - "name": "endsWithFrom", - "docstrings": [ - "`endsWithFrom(str, ending, len)` returns `true` if the first len characters of\n`str` end with `ending`, `false` otherwise. If `len` is greater than or equal\nto the length of `str`, then it works like `endsWith`.\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith) on MDN.\n\n## Examples\n\n```rescript\nString.endsWithFrom(\"abcd\", \"cd\", 4) == true\nString.endsWithFrom(\"abcde\", \"cd\", 3) == false\nString.endsWithFrom(\"abcde\", \"cde\", 99) == true\nString.endsWithFrom(\"example.dat\", \"ple\", 7) == true\n```" - ], - "signature": "let endsWithFrom: (string, string, int) => bool" - }, - { - "id": "Stdlib.String.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "`includes(str, searchValue)` returns `true` if `searchValue` is found anywhere\nwithin `str`, `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includes(\"programmer\", \"gram\") == true\nString.includes(\"programmer\", \"er\") == true\nString.includes(\"programmer\", \"pro\") == true\nString.includes(\"programmer.dat\", \"xyz\") == false\n```" - ], - "signature": "let includes: (string, string) => bool" - }, - { - "id": "Stdlib.String.includesFrom", - "kind": "value", - "name": "includesFrom", - "docstrings": [ - "`includesFrom(str, searchValue, start)` returns `true` if `searchValue` is found\nanywhere within `str` starting at character number `start` (where 0 is the\nfirst character), `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includesFrom(\"programmer\", \"gram\", 1) == true\nString.includesFrom(\"programmer\", \"gram\", 4) == false\nString.includesFrom(`대한민국`, `한`, 1) == true\n```" - ], - "signature": "let includesFrom: (string, string, int) => bool" - }, - { - "id": "Stdlib.String.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "`indexOf(str, searchValue)` returns the position at which `searchValue` was\nfirst found within `str`, or `-1` if `searchValue` is not in `str`.\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) on MDN.\n\n## Examples\n\n```rescript\nString.indexOf(\"bookseller\", \"ok\") == 2\nString.indexOf(\"bookseller\", \"sell\") == 4\nString.indexOf(\"beekeeper\", \"ee\") == 1\nString.indexOf(\"bookseller\", \"xyz\") == -1\n```" - ], - "signature": "let indexOf: (string, string) => int" - }, - { - "id": "Stdlib.String.indexOfOpt", - "kind": "value", - "name": "indexOfOpt", - "docstrings": [ - "`indexOfOpt(str, searchValue)`. Like `indexOf`, but return an `option`.\n\n## Examples\n\n```rescript\nString.indexOfOpt(\"bookseller\", \"ok\") == Some(2)\nString.indexOfOpt(\"bookseller\", \"xyz\") == None\n```" - ], - "signature": "let indexOfOpt: (string, string) => option" - }, - { - "id": "Stdlib.String.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [ - "`indexOfFrom(str, searchValue, start)` returns the position at which\n`searchValue` was found within `str` starting at character position `start`, or\n`-1` if `searchValue` is not found in that portion of `str`. The return value is\nrelative to the beginning of the string, no matter where the search started\nfrom.\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) on MDN.\n\n## Examples\n\n```rescript\nString.indexOfFrom(\"bookseller\", \"ok\", 1) == 2\nString.indexOfFrom(\"bookseller\", \"sell\", 2) == 4\nString.indexOfFrom(\"bookseller\", \"sell\", 5) == -1\n```" - ], - "signature": "let indexOfFrom: (string, string, int) => int" - }, - { - "id": "Stdlib.String.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(str, searchValue)` returns the position of the last occurrence of\n`searchValue` within `str`, searching backwards from the end of the string.\nReturns `-1` if `searchValue` is not in `str`. The return value is always\nrelative to the beginning of the string.\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\nString.lastIndexOf(\"bookseller\", \"ok\") == 2\nString.lastIndexOf(\"beekeeper\", \"ee\") == 4\nString.lastIndexOf(\"abcdefg\", \"xyz\") == -1\n```" - ], - "signature": "let lastIndexOf: (string, string) => int" - }, - { - "id": "Stdlib.String.lastIndexOfOpt", - "kind": "value", - "name": "lastIndexOfOpt", - "docstrings": [ - "`lastIndexOfOpt(str, searchValue)`. Like `lastIndexOfOpt`, but return an\n`option`.\n\n## Examples\n\n```rescript\nString.lastIndexOfOpt(\"bookseller\", \"ok\") == Some(2)\nString.lastIndexOfOpt(\"beekeeper\", \"ee\") == Some(4)\nString.lastIndexOfOpt(\"abcdefg\", \"xyz\") == None\n```" - ], - "signature": "let lastIndexOfOpt: (string, string) => option" - }, - { - "id": "Stdlib.String.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [ - "`lastIndexOfFrom(str, searchValue, start)` returns the position of the last\noccurrence of `searchValue` within `str`, searching backwards from the given\nstart position. Returns `-1` if `searchValue` is not in `str`. The return value\nis always relative to the beginning of the string.\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\nString.lastIndexOfFrom(\"bookseller\", \"ok\", 6) == 2\nString.lastIndexOfFrom(\"beekeeper\", \"ee\", 8) == 4\nString.lastIndexOfFrom(\"beekeeper\", \"ee\", 3) == 1\nString.lastIndexOfFrom(\"abcdefg\", \"xyz\", 4) == -1\n```" - ], - "signature": "let lastIndexOfFrom: (string, string, int) => int" - }, - { - "id": "Stdlib.String.match", - "kind": "value", - "name": "match", - "docstrings": [ - "`match(str, regexp)` matches a `string` against the given `regexp`. If there is\nno match, it returns `None`. For regular expressions without the g modifier, if\nthere is a match, the return value is `Some(array)` where the array contains:\n- The entire matched string\n- Any capture groups if the regexp had parentheses\n For regular expressions with the g modifier, a matched expression returns\n `Some(array)` with all the matched substrings and no capture groups.\n See [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match) on MDN.\n\n## Examples\n\n```rescript\nString.match(\"The better bats\", /b[aeiou]t/) == Some([Some(\"bet\")])\nString.match(\"The better bats\", /b[aeiou]t/g) == Some([Some(\"bet\"), Some(\"bat\")])\nString.match(\"Today is 2018-04-05.\", /(\\d+)-(\\d+)-(\\d+)/) ==\n Some([Some(\"2018-04-05\"), Some(\"2018\"), Some(\"04\"), Some(\"05\")])\nString.match(\"The optional example\", /(foo)?(example)/) ==\n Some([Some(\"example\"), None, Some(\"example\")])\nString.match(\"The large container.\", /b[aeiou]g/) == None\n```" - ], - "signature": "let match: (string, RegExp.t) => option<\\\"RegExp.Result\".t>" - }, - { - "id": "Stdlib.String.normalize", - "kind": "value", - "name": "normalize", - "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\\\u00e3 or the combination of a lower case letter A\n\\\\u0061 and a combining tilde \\\\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\nSee also [Unicode technical report \\#15](https://unicode.org/reports/tr15/) for details.\n\n## Examples\n\n```rescript\nlet string1 = \"\\u00F1\"\nlet string2 = \"\\u006E\\u0303\"\n\nassert(string1 != string2) // true\nString.normalize(string1) == String.normalize(string2)\n```" - ], - "signature": "let normalize: string => string" - }, - { - "id": "Stdlib.String.normalizeForm", - "kind": "type", - "name": "normalizeForm", - "docstrings": [ - "`normalizeByForm(str, form)` returns the normalized Unicode string using the\nspecified form of normalization, which may be one of:\n- \"NFC\" — Normalization Form Canonical Composition.\n- \"NFD\" — Normalization Form Canonical Decomposition.\n- \"NFKC\" — Normalization Form Compatibility Composition.\n- \"NFKD\" — Normalization Form Compatibility Decomposition.\n See [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\n See also [Unicode technical report \\#15](https://unicode.org/reports/tr15/) for\n details.\n\n## Examples\n\n```rescript\nlet string1 = \"\\uFB00\"\nlet string2 = \"\\u0066\\u0066\"\nConsole.log(string1 == string2) // false\n\nlet normalizeString1 = String.normalizeByForm(string1, #NFKD)\nlet normalizeString2 = String.normalizeByForm(string2, #NFKD)\nConsole.log(normalizeString1 == normalizeString2) // true\n```" - ], - "signature": "type normalizeForm = [#NFC | #NFD | #NFKC | #NFKD]" - }, - { - "id": "Stdlib.String.normalizeByForm", - "kind": "value", - "name": "normalizeByForm", - "docstrings": [], - "signature": "let normalizeByForm: (string, normalizeForm) => string" - }, - { - "id": "Stdlib.String.repeat", - "kind": "value", - "name": "repeat", - "docstrings": [ - "`repeat(str, n)` returns a `string` that consists of `n` repetitions of `str`.\nSee [`String.repeat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat) on MDN.\n\n## Examples\n\n```rescript\nString.repeat(\"ha\", 3) == \"hahaha\"\nString.repeat(\"empty\", 0) == \"\"\n```\n\n## Exceptions\n\n- `RangeError`: if `n` is negative." - ], - "signature": "let repeat: (string, int) => string" - }, - { - "id": "Stdlib.String.replace", - "kind": "value", - "name": "replace", - "docstrings": [ - "`replace(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with the first matching instance of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nString.replace(\"old string\", \"old\", \"new\") == \"new string\"\nString.replace(\"the cat and the dog\", \"the\", \"this\") == \"this cat and the dog\"\n```" - ], - "signature": "let replace: (string, string, string) => string" - }, - { - "id": "Stdlib.String.replaceRegExp", - "kind": "value", - "name": "replaceRegExp", - "docstrings": [ - "`replaceRegExp(str, regex, replacement)` returns a new `string` where\noccurrences matching regex have been replaced by `replacement`.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nString.replaceRegExp(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nString.replaceRegExp(\"Juan Fulano\", /(\\w+) (\\w+)/, \"$2, $1\") == \"Fulano, Juan\"\n```" - ], - "signature": "let replaceRegExp: (string, RegExp.t, string) => string" - }, - { - "id": "Stdlib.String.replaceAll", - "kind": "value", - "name": "replaceAll", - "docstrings": [ - "`replaceAll(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with all matching instances of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\nSee [`String.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) on MDN.\n\n## Examples\n\n```rescript\nString.replaceAll(\"old old string\", \"old\", \"new\") == \"new new string\"\nString.replaceAll(\"the cat and the dog\", \"the\", \"this\") == \"this cat and this dog\"\n```" - ], - "signature": "let replaceAll: (string, string, string) => string" - }, - { - "id": "Stdlib.String.replaceAllRegExp", - "kind": "value", - "name": "replaceAllRegExp", - "docstrings": [ - "`replaceAllRegExp(str, regex, replacement)` returns a new `string` where\nall occurrences matching regex have been replaced by `replacement`.\nThe pattern must include the global (`g`) flag or a runtime TypeError will be thrown.\nSee [`String.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) on MDN.\n\n## Examples\n\n```rescript\nString.replaceAllRegExp(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nString.replaceAllRegExp(\"aabbcc\", /b/g, \".\") == \"aa..cc\"\n```" - ], - "signature": "let replaceAllRegExp: (string, RegExp.t, string) => string" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy0", - "kind": "value", - "name": "unsafeReplaceRegExpBy0", - "docstrings": [ - "`unsafeReplaceRegExpBy0(str, regex, f)` returns a new `string` with some or all\nmatches of a pattern with no capturing parentheses replaced by the value\nreturned from the given function. The function receives as its parameters the\nmatched string, the offset at which the match begins, and the whole string being\nmatched.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (~match, ~offset as _, ~input as _) => String.toUpperCase(match)\nString.unsafeReplaceRegExpBy0(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy0: (\n string,\n RegExp.t,\n (~match: string, ~offset: int, ~input: string) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy1", - "kind": "value", - "name": "unsafeReplaceRegExpBy1", - "docstrings": [ - "`unsafeReplaceRegExpBy1(str, regexp, f)`. Like `unsafeReplaceRegExpBy0`, but `f`\nhas `group1` parameter.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (~match as _, ~group1, ~offset as _, ~input as _) => {\n group1 ++ \"41\"\n}\nString.unsafeReplaceRegExpBy1(str, re, matchFn) == \"Jony is 41\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy1: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy2", - "kind": "value", - "name": "unsafeReplaceRegExpBy2", - "docstrings": [ - "`unsafeReplaceRegExpBy2(str, regexp, f)`. Like `unsafeReplaceRegExpBy1`, but `f`\nhas two group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (~match as _, ~group1, ~group2, ~offset as _, ~input as _) => {\n switch (Int.fromString(group1), Int.fromString(group2)) {\n | (Some(x), Some(y)) => Int.toString(x * y)\n | _ => \"???\"\n }\n}\nString.unsafeReplaceRegExpBy2(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy2: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.unsafeReplaceRegExpBy3", - "kind": "value", - "name": "unsafeReplaceRegExpBy3", - "docstrings": [ - "`unsafeReplaceRegExpBy3(str, regexp, f)`. Like `unsafeReplaceRegExpBy2`, but `f`\nhas three group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN." - ], - "signature": "let unsafeReplaceRegExpBy3: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~group3: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.replaceRegExpBy0Unsafe", - "kind": "value", - "name": "replaceRegExpBy0Unsafe", - "docstrings": [ - "`replaceRegExpBy0Unsafe(str, regex, f)` returns a new `string` with some or all\nmatches of a pattern with no capturing parentheses replaced by the value\nreturned from the given function. The function receives as its parameters the\nmatched string, the offset at which the match begins, and the whole string being\nmatched.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (~match, ~offset as _, ~input as _) => String.toUpperCase(match)\nString.replaceRegExpBy0Unsafe(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" - ], - "signature": "let replaceRegExpBy0Unsafe: (\n string,\n RegExp.t,\n (~match: string, ~offset: int, ~input: string) => string,\n) => string" - }, - { - "id": "Stdlib.String.replaceRegExpBy1Unsafe", - "kind": "value", - "name": "replaceRegExpBy1Unsafe", - "docstrings": [ - "`replaceRegExpBy1Unsafe(str, regexp, f)`. Like `replaceRegExpBy0Unsafe`, but `f`\nhas `group1` parameter.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (~match as _, ~group1, ~offset as _, ~input as _) => {\n group1 ++ \"41\"\n}\nString.replaceRegExpBy1Unsafe(str, re, matchFn) == \"Jony is 41\"\n```" - ], - "signature": "let replaceRegExpBy1Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" - }, - { - "id": "Stdlib.String.replaceRegExpBy2Unsafe", - "kind": "value", - "name": "replaceRegExpBy2Unsafe", - "docstrings": [ - "`replaceRegExpBy2Unsafe(str, regexp, f)`. Like `replaceRegExpBy1Unsafe`, but `f`\nhas two group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (~match as _, ~group1, ~group2, ~offset as _, ~input as _) => {\n switch (Int.fromString(group1), Int.fromString(group2)) {\n | (Some(x), Some(y)) => Int.toString(x * y)\n | _ => \"???\"\n }\n}\nString.replaceRegExpBy2Unsafe(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let replaceRegExpBy2Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" - }, - { - "id": "Stdlib.String.replaceRegExpBy3Unsafe", - "kind": "value", - "name": "replaceRegExpBy3Unsafe", - "docstrings": [ - "`replaceRegExpBy3Unsafe(str, regexp, f)`. Like `replaceRegExpBy2Unsafe`, but `f`\nhas three group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN." - ], - "signature": "let replaceRegExpBy3Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~group3: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" - }, - { - "id": "Stdlib.String.search", - "kind": "value", - "name": "search", - "docstrings": [ - "`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search) on MDN.\n\n## Examples\n\n```rescript\nString.search(\"testing 1 2 3\", /\\d+/) == 8\nString.search(\"no numbers\", /\\d+/) == -1\n```" - ], - "signature": "let search: (string, RegExp.t) => int" - }, - { - "id": "Stdlib.String.searchOpt", - "kind": "value", - "name": "searchOpt", - "docstrings": [ - "`searchOpt(str, regexp)`. Like `search`, but return an `option`.\n\n## Examples\n\n```rescript\nString.searchOpt(\"testing 1 2 3\", /\\d+/) == Some(8)\nString.searchOpt(\"no numbers\", /\\d+/) == None\n```" - ], - "signature": "let searchOpt: (string, RegExp.t) => option" - }, - { - "id": "Stdlib.String.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(str)` returns `true` if the string is empty (has zero length), \n`false` otherwise.\n\n## Examples\n\n```rescript\nString.isEmpty(\"\") == true\nString.isEmpty(\"hello\") == false\nString.isEmpty(\" \") == false\n```" - ], - "signature": "let isEmpty: string => bool" - }, - { - "id": "Stdlib.String.capitalize", - "kind": "value", - "name": "capitalize", - "docstrings": [ - "`capitalize(str)` returns a new string with the first character converted to \nuppercase and the remaining characters unchanged. If the string is empty, \nreturns the empty string.\n\n## Examples\n\n```rescript\nString.capitalize(\"hello\") == \"Hello\"\nString.capitalize(\"HELLO\") == \"HELLO\"\nString.capitalize(\"hello world\") == \"Hello world\"\nString.capitalize(\"\") == \"\"\n```" - ], - "signature": "let capitalize: string => string" - }, - { - "id": "Stdlib.String.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```" - ], - "signature": "let slice: (string, ~start: int, ~end: int=?) => string" - }, - { - "id": "Stdlib.String.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```" - ], - "signature": "let sliceToEnd: (string, ~start: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.split", - "kind": "value", - "name": "split", - "docstrings": [ - "`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nString.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nString.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nString.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```" - ], - "signature": "let split: (string, string) => array" - }, - { - "id": "Stdlib.String.splitAtMost", - "kind": "value", - "name": "splitAtMost", - "docstrings": [ - "`splitAtMost(str, delimiter, ~limit)` splits the given `str` at every\noccurrence of `delimiter` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings,\nthe array will contain all the substrings.\n\n## Examples\n\n```rescript\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=3) == [\"ant\", \"bee\", \"cat\"]\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=0) == []\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=9) == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```" - ], - "signature": "let splitAtMost: (string, string, ~limit: int) => array" - }, - { - "id": "Stdlib.String.splitByRegExp", - "kind": "value", - "name": "splitByRegExp", - "docstrings": [ - "`splitByRegExp(str, regexp)` splits the given `str` at every occurrence of\n`regexp` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExp(\"Jan,Feb,Mar\", /,/) == [Some(\"Jan\"), Some(\"Feb\"), Some(\"Mar\")]\n```" - ], - "signature": "let splitByRegExp: (string, RegExp.t) => array>" - }, - { - "id": "Stdlib.String.splitByRegExpAtMost", - "kind": "value", - "name": "splitByRegExpAtMost", - "docstrings": [ - "`splitByRegExpAtMost(str, regexp, ~limit)` splits the given `str` at every\noccurrence of `regexp` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings, the\narray will contain all the substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExpAtMost(\"Hello World. How are you doing?\", / /, ~limit=3) == [\n Some(\"Hello\"),\n Some(\"World.\"),\n Some(\"How\"),\n ]\n```" - ], - "signature": "let splitByRegExpAtMost: (string, RegExp.t, ~limit: int) => array>" - }, - { - "id": "Stdlib.String.startsWith", - "kind": "value", - "name": "startsWith", - "docstrings": [ - "`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```" - ], - "signature": "let startsWith: (string, string) => bool" - }, - { - "id": "Stdlib.String.startsWithFrom", - "kind": "value", - "name": "startsWithFrom", - "docstrings": [ - "`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```" - ], - "signature": "let startsWithFrom: (string, string, int) => bool" - }, - { - "id": "Stdlib.String.substring", - "kind": "value", - "name": "substring", - "docstrings": [ - "`substring(str, ~start, ~end)` returns characters `start` up to but not\nincluding end from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `end` is zero or negative, the empty string is returned.\n- If `start` is greater than `end`, the `start` and `end` points are swapped.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substring(\"playground\", ~start=3, ~end=6) == \"ygr\"\nString.substring(\"playground\", ~start=6, ~end=3) == \"ygr\"\nString.substring(\"playground\", ~start=4, ~end=12) == \"ground\"\nString.substring(\"playground\", ~start=4) == \"ground\"\nString.substring(\"Hello World\", ~start=6) == \"World\"\n```" - ], - "signature": "let substring: (string, ~start: int, ~end: int=?) => string" - }, - { - "id": "Stdlib.String.substringToEnd", - "kind": "value", - "name": "substringToEnd", - "docstrings": [ - "`substringToEnd(str, ~start)` returns the substring of `str` from position\n`start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string\n is returned.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substringToEnd(\"playground\", ~start=4) == \"ground\"\nString.substringToEnd(\"playground\", ~start=-3) == \"playground\"\nString.substringToEnd(\"playground\", ~start=12) == \"\"\n```" - ], - "signature": "let substringToEnd: (string, ~start: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.String.toLowerCase", - "kind": "value", - "name": "toLowerCase", - "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms, one when it is the last\ncharacter in a string and another when it is not.\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase) on MDN.\n\n## Examples\n\n```rescript\nString.toLowerCase(\"ABC\") == \"abc\"\nString.toLowerCase(`ΣΠ`) == `σπ`\nString.toLowerCase(`ΠΣ`) == `πς`\n```" - ], - "signature": "let toLowerCase: string => string" - }, - { - "id": "Stdlib.String.toLocaleLowerCase", - "kind": "value", - "name": "toLocaleLowerCase", - "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase) on MDN." - ], - "signature": "let toLocaleLowerCase: string => string" - }, - { - "id": "Stdlib.String.toUpperCase", - "kind": "value", - "name": "toUpperCase", - "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result, for example the German ß\ncapitalizes to two Ses in a row.\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) on MDN.\n\n## Examples\n\n```rescript\nString.toUpperCase(\"abc\") == \"ABC\"\nString.toUpperCase(`Straße`) == `STRASSE`\nString.toUpperCase(`πς`) == `ΠΣ`\n```" - ], - "signature": "let toUpperCase: string => string" - }, - { - "id": "Stdlib.String.toLocaleUpperCase", - "kind": "value", - "name": "toLocaleUpperCase", - "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\nSee [`String.toLocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase) on MDN." - ], - "signature": "let toLocaleUpperCase: string => string" - }, - { - "id": "Stdlib.String.trim", - "kind": "value", - "name": "trim", - "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim) on MDN.\n\n## Examples\n\n```rescript\nString.trim(\" abc def \") == \"abc def\"\nString.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" - ], - "signature": "let trim: string => string" - }, - { - "id": "Stdlib.String.trimStart", - "kind": "value", - "name": "trimStart", - "docstrings": [ - "`trimStart(str)` returns a string that is `str` with whitespace stripped from\nthe beginning of a string. Internal whitespace is not removed.\nSee [`String.trimStart`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimStart) on MDN.\n\n## Examples\n\n```rescript\nString.trimStart(\" Hello world! \") == \"Hello world! \"\nString.trimStart(\" Hello world! \") == \"Hello world! \"\n```" - ], - "signature": "let trimStart: string => string" - }, - { - "id": "Stdlib.String.trimEnd", - "kind": "value", - "name": "trimEnd", - "docstrings": [ - "`trimEnd(str)` returns a string that is `str` with whitespace stripped from the\nend of a string. Internal whitespace is not removed.\nSee [`String.trimEnd`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd) on MDN.\n\n## Examples\n\n```rescript\nString.trimEnd(\" Hello world! \") == \" Hello world!\"\nString.trimEnd(\" Hello world! \") == \" Hello world!\"\n```" - ], - "signature": "let trimEnd: string => string" - }, - { - "id": "Stdlib.String.padStart", - "kind": "value", - "name": "padStart", - "docstrings": [ - "`padStart(str, n, padStr)` returns a string that has been padded with `padStr`\n(multiple times, if needed) until the resulting string reaches the given `n`\nlength. The padding is applied from the start of the current string.\nSee [`String.padStart`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart) on MDN.\n\n## Examples\n\n```rescript\nString.padStart(\"abc\", 5, \" \") == \" abc\"\nString.padStart(\"abc\", 6, \"123465\") == \"123abc\"\n```" - ], - "signature": "let padStart: (string, int, string) => string" - }, - { - "id": "Stdlib.String.padEnd", - "kind": "value", - "name": "padEnd", - "docstrings": [ - "`padEnd(str, n, padStr)` returns a string that has been padded with `padStr`\n(multiple times, if needed) until the resulting string reaches the given `n`\nlength. The padding is applied from the end of the current string.\nSee [`String.padEnd`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd) on MDN.\n\n## Examples\n\n```rescript\nString.padEnd(\"Hello\", 10, \".\") == \"Hello.....\"\nString.padEnd(\"abc\", 1, \"\") == \"abc\"\n```" - ], - "signature": "let padEnd: (string, int, string) => string" - }, - { - "id": "Stdlib.String.localeCompare", - "kind": "value", - "name": "localeCompare", - "docstrings": [ - "`localeCompare(referenceStr, compareStr)` returns a float than indicatings\nwhether a reference string comes before or after, or is the same as the given\nstring in sort order. If `referenceStr` occurs before `compareStr` positive if\nthe `referenceStr` occurs after `compareStr`, `0` if they are equivalent.\nDo not rely on exact return values of `-1` or `1`\nSee [`String.localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare) on MDN.\n\n## Examples\n\n```rescript\nString.localeCompare(\"a\", \"c\") < 0.0 == true\nString.localeCompare(\"a\", \"a\") == 0.0\n```" - ], - "signature": "let localeCompare: (string, string) => float" - }, - { - "id": "Stdlib.String.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(string)` ignores the provided string and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: string => unit" - }, - { - "id": "Stdlib.String.getSymbolUnsafe", - "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [ - "`getSymbolUnsafe(str, symbol)` returns the value of the symbol property of a string.\n\n## Examples\n\n```rescript\nlet it: Iterator.t = (\"foo\"->String.getSymbolUnsafe(Symbol.iterator))()\nNullable.make(it)->Nullable.isNullable == false\n```" - ], - "signature": "let getSymbolUnsafe: (string, Symbol.t) => 'a" - } - ] - }, - "stdlib/result": { - "id": "Stdlib.Result", - "name": "Result", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Result.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Result types are really useful to describe the result of a certain operation\n without relying on exceptions or `option` types.\n\n This module gives you useful utilities to create and combine `Result` data." - ], - "signature": "type t<'res, 'err> = result<'res, 'err> =\n | Ok('res)\n | Error('err)" - }, - { - "id": "Stdlib.Result.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getExn(Result.Ok(42)) == 42\n \n switch Result.getExn(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getExn(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```" - ], - "signature": "let getExn: (result<'a, 'b>, ~message: string=?) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Result.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getOrThrow(Result.Ok(42)) == 42\n \n switch Result.getOrThrow(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getOrThrow(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```" - ], - "signature": "let getOrThrow: (result<'a, 'b>, ~message: string=?) => 'a" - }, - { - "id": "Stdlib.Result.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(res, default, f)`: When res is `Ok(n)`, returns `f(n)`, otherwise `default`.\n\n## Examples\n\n```rescript\nlet ok = Ok(42)\nResult.mapOr(ok, 0, x => x / 2) == 21\n\nlet error = Error(\"Invalid data\")\nResult.mapOr(error, 0, x => x / 2) == 0\n```" - ], - "signature": "let mapOr: (result<'a, 'c>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Result.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (result<'a, 'c>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Result.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(res, f)`: When res is `Ok(n)`, returns `Ok(f(n))`. Otherwise returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns an\nordinary value.\n\n## Examples\n\n```rescript\nlet f = x => sqrt(Int.toFloat(x))\n\nResult.map(Ok(64), f) == Ok(8.0)\n\nResult.map(Error(\"Invalid data\"), f) == Error(\"Invalid data\")\n```" - ], - "signature": "let map: (result<'a, 'c>, 'a => 'b) => result<'b, 'c>" - }, - { - "id": "Stdlib.Result.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(res, f)`: When res is `Ok(n)`, returns `f(n)`. Otherwise, returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns a\n`Result`.\n\n## Examples\n\n```rescript\nlet recip = x =>\n if x !== 0.0 {\n Ok(1.0 /. x)\n } else {\n Error(\"Divide by zero\")\n }\n\nResult.flatMap(Ok(2.0), recip) == Ok(0.5)\n\nResult.flatMap(Ok(0.0), recip) == Error(\"Divide by zero\")\n\nResult.flatMap(Error(\"Already bad\"), recip) == Error(\"Already bad\")\n```" - ], - "signature": "let flatMap: (result<'a, 'c>, 'a => result<'b, 'c>) => result<'b, 'c>" - }, - { - "id": "Stdlib.Result.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`, otherwise `default`\n\n## Examples\n\n```rescript\nResult.getOr(Ok(42), 0) == 42\n\nResult.getOr(Error(\"Invalid Data\"), 0) == 0\n```" - ], - "signature": "let getOr: (result<'a, 'b>, 'a) => 'a" - }, - { - "id": "Stdlib.Result.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (result<'a, 'b>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Result.isOk", - "kind": "value", - "name": "isOk", - "docstrings": [ - "`isOk(res)`: Returns `true` if `res` is of the form `Ok(n)`, `false` if it is the `Error(e)` variant." - ], - "signature": "let isOk: result<'a, 'b> => bool" - }, - { - "id": "Stdlib.Result.isError", - "kind": "value", - "name": "isError", - "docstrings": [ - "`isError(res)`: Returns `true` if `res` is of the form `Error(e)`, `false` if it is the `Ok(n)` variant." - ], - "signature": "let isError: result<'a, 'b> => bool" - }, - { - "id": "Stdlib.Result.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(res1, res2, eqOk, eqError)`: Determine if two `Result` variables are equal with\nrespect to equality functions. If `res1` and `res2` are of the form `Ok(n)`\nand `Ok(m)`, return the result of `eqOk(n, m)`. If one of `res1` and `res2` are of\nthe form `Error(e)`, return false If both `res1` and `res2` are of the form\n`Error(e)`, return the result of `eqError(e1, e2)`.\n\n## Examples\n\n```rescript\nlet good1 = Ok(42)\n\nlet good2 = Ok(32)\n\nlet bad1 = Error(\"invalid\")\n\nlet bad2 = Error(\"really invalid\")\n\nlet mod10equal = (a, b) => mod(a, 10) === mod(b, 10)\n\nResult.equal(good1, good2, mod10equal, String.equal) == true\n\nResult.equal(good1, bad1, mod10equal, String.equal) == false\n\nResult.equal(bad2, good2, mod10equal, String.equal) == false\n\nResult.equal(bad1, bad2, mod10equal, String.equal) == false\n```" - ], - "signature": "let equal: (\n result<'a, 'c>,\n result<'b, 'd>,\n ('a, 'b) => bool,\n ('c, 'd) => bool,\n) => bool" - }, - { - "id": "Stdlib.Result.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(res1, res2, cmpOk, cmpError)`: Compare two `Result` variables with respect to a\ncomparison function. The comparison function returns -1. if the first variable\nis \"less than\" the second, 0. if the two variables are equal, and 1. if the first\nis \"greater than\" the second.\n\nIf `res1` and `res2` are of the form `Ok(n)` and `Ok(m)`, return the result of\n`cmpOk(n, m)`. If `res1` is of the form `Error(e)` and `res2` of the form `Ok(n)`,\nreturn -1. (nothing is less than something) If `res1` is of the form `Ok(n)` and\n`res2` is of the form `Error(e)`, return 1. (something is greater than nothing) If\nboth `res1` and `res2` are of the form `Error(e)`, return cmpError(e1, e2).\n\n## Examples\n\n```rescript\nlet good1 = Ok(59)\n\nlet good2 = Ok(37)\n\nlet bad1 = Error(\"invalid\")\n\nlet bad2 = Error(\"really invalid\")\n\nlet mod10cmp = (a, b) => Int.compare(mod(a, 10), mod(b, 10))\n\nResult.compare(Ok(39), Ok(57), mod10cmp, String.compare) == 1.\n\nResult.compare(Ok(57), Ok(39), mod10cmp, String.compare) == -1.\n\nResult.compare(Ok(39), Error(\"y\"), mod10cmp, String.compare) == 1.\n\nResult.compare(Error(\"x\"), Ok(57), mod10cmp, String.compare) == -1.\n\nResult.compare(Error(\"x\"), Error(\"y\"), mod10cmp, String.compare) == -1.\n```" - ], - "signature": "let compare: (\n result<'a, 'c>,\n result<'b, 'd>,\n ('a, 'b) => Ordering.t,\n ('c, 'd) => Ordering.t,\n) => Ordering.t" - }, - { - "id": "Stdlib.Result.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(res, f)` runs the provided function `f` on the `Ok` value. If `res` is `Error`, nothing happens.\n\n## Examples\n\n```rescript\nResult.forEach(Ok(3), Console.log) // Logs \"3\", returns ()\nResult.forEach(Error(\"x\"), Console.log) // Does nothing, returns ()\n```" - ], - "signature": "let forEach: (result<'a, 'b>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Result.mapError", - "kind": "value", - "name": "mapError", - "docstrings": [ - "`mapError(r, f)` generates a new `result` by applying the function `f` to the `Error` value. If the source is `Ok`, return it as-is.\n\n## Examples\n\n```rescript\nlet format = n => `Error code: ${n->Int.toString}`\nResult.mapError(Error(14), format) == Error(\"Error code: 14\")\nResult.mapError(Ok(\"abc\"), format) == Ok(\"abc\")\n```" - ], - "signature": "let mapError: (result<'a, 'b>, 'b => 'c) => result<'a, 'c>" - }, - { - "id": "Stdlib.Result.all", - "kind": "value", - "name": "all", - "docstrings": [ - "`all(results)` returns a result of array if all options are Ok, otherwise returns Error.\n## Examples\n```rescript\nResult.all([Ok(1), Ok(2), Ok(3)]) == Ok([1, 2, 3])\nResult.all([Ok(1), Error(1)]) == Error(1)\n```" - ], - "signature": "let all: array> => result, 'b>" - }, - { - "id": "Stdlib.Result.all2", - "kind": "value", - "name": "all2", - "docstrings": [ - "`all2((r1, r2))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all2: (\n (result<'r1, 'e>, result<'r2, 'e>),\n) => result<('r1, 'r2), 'e>" - }, - { - "id": "Stdlib.Result.all3", - "kind": "value", - "name": "all3", - "docstrings": [ - "`all3((r1, r2, r3))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all3: (\n (result<'r1, 'e>, result<'r2, 'e>, result<'r3, 'e>),\n) => result<('r1, 'r2, 'r3), 'e>" - }, - { - "id": "Stdlib.Result.all4", - "kind": "value", - "name": "all4", - "docstrings": [ - "`all4((r1, r2, r3, r4))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all4: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4), 'e>" - }, - { - "id": "Stdlib.Result.all5", - "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((r1, r2, r3, r4, r5))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all5: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n result<'r5, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4, 'r5), 'e>" - }, - { - "id": "Stdlib.Result.all6", - "kind": "value", - "name": "all6", - "docstrings": [ - "`all6((r1, r2, r3, r4, r5, r6))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all6: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n result<'r5, 'e>,\n result<'r6, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4, 'r5, 'r6), 'e>" - }, - { - "id": "Stdlib.Result.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(result)` ignores the provided result and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: result<'res, 'err> => unit" - }, - { - "id": "Stdlib.Result.mapOkAsync", - "kind": "value", - "name": "mapOkAsync", - "docstrings": [ - "`mapOkAsync(res, f)`: Asynchronously maps over the Ok value of a Result. When `res` is `Ok(n)`, \napplies the async function `f` to `n` and wraps the result in `Ok`. \nWhen `res` is `Error`, returns the error unchanged.\n\n## Examples\n\n```rescript\n let square = x => x * x\n\n let result1 = await Result.mapOkAsync(Promise.resolve(Ok(4)), square)\n result1 == Ok(16)\n\n let result2 = await Result.mapOkAsync(\n Promise.resolve(Error(\"invalid\")),\n square,\n )\n result2 == Error(\"invalid\")\n```" - ], - "signature": "let mapOkAsync: (\n promise>,\n 'ok => 'mappedOk,\n) => promise>" - }, - { - "id": "Stdlib.Result.mapErrorAsync", - "kind": "value", - "name": "mapErrorAsync", - "docstrings": [ - "`mapErrorAsync(res, f)`: Asynchronously maps over the Error value of a Result. When `res` is `Error(e)`, \napplies the async function `f` to `e` and wraps the result in `Error`. \nWhen `res` is `Ok`, returns the ok value unchanged.\n\n## Examples\n\n```rescript\nlet formatError = e => `Error: ${e}`\n\nlet result1 = await Result.mapErrorAsync(Promise.resolve(Ok(42)), formatError)\nresult1 == Ok(42)\n\nlet result2 = await Result.mapErrorAsync(Promise.resolve(Error(\"invalid\")), formatError)\nresult2 == Error(\"Error: invalid\")\n```" - ], - "signature": "let mapErrorAsync: (\n promise>,\n 'error => 'mappedError,\n) => promise>" - }, - { - "id": "Stdlib.Result.flatMapOkAsync", - "kind": "value", - "name": "flatMapOkAsync", - "docstrings": [ - "`flatMapOkAsync(res, f)`: Asynchronously flat-maps over the Ok value of a Result. When `res` is `Ok(n)`, \napplies the async function `f` to `n` which returns a Promise of a Result. \nWhen `res` is `Error`, returns the error unchanged.\n\n## Examples\n\n```rescript\nlet asyncValidate = async x =>\n if x > 0 {\n Ok(x * 2)\n } else {\n Error(\"Must be positive\")\n }\n\nlet result1 = await Result.flatMapOkAsync(Promise.resolve(Ok(5)), asyncValidate)\nresult1 == Ok(10)\n\nlet result2 = await Result.flatMapOkAsync(\n Promise.resolve(Error(\"Already failed\")),\n asyncValidate,\n)\nresult2 == Error(\"Already failed\")\n```" - ], - "signature": "let flatMapOkAsync: (\n promise>,\n 'ok => promise>,\n) => promise>" - }, - { - "id": "Stdlib.Result.flatMapErrorAsync", - "kind": "value", - "name": "flatMapErrorAsync", - "docstrings": [ - "`flatMapErrorAsync(res, f)`: Asynchronously flat-maps over the Error value of a Result. When `res` is `Error(e)`, \napplies the async function `f` to `e` which returns a Promise of a Result. \nWhen `res` is `Ok`, returns the ok value unchanged.\n\n## Examples\n\n```rescript\nlet asyncRecover = async error =>\n if error === \"timeout\" {\n Ok(\"default\")\n } else {\n Error(error)\n }\n\nlet result1 = await Result.flatMapErrorAsync(\n Promise.resolve(Error(\"timeout\")),\n asyncRecover,\n)\nresult1 == Ok(\"default\")\n\nlet result2 = await Result.flatMapErrorAsync(\n Promise.resolve(Ok(\"default\")),\n asyncRecover,\n)\nresult2 == Ok(\"default\")\n```" - ], - "signature": "let flatMapErrorAsync: (\n promise>,\n 'error => promise>,\n) => promise>" - } - ] - }, - "stdlib/regexp": { - "id": "Stdlib.RegExp", - "name": "RegExp", - "docstrings": [ - "Functions for handling RegExp's in ReScript.\n\nSee [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) on MDN." - ], - "items": [ - { - "id": "Stdlib.RegExp.t", - "kind": "type", - "name": "t", - "docstrings": ["Type representing an instantiated `RegExp`."], - "signature": "type t" - }, - { - "id": "Stdlib.RegExp.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(string)` creates a `RegExp.t` from the provided string. This can then be used to match on strings using `RegExp.exec`.\n\nSee [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n\n// Match 'foo' with case insensitive flag\nlet regexp = RegExp.fromString(\"foo\", ~flags=\"i\")\n\nswitch regexp->RegExp.exec(\"FOO\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"FOO\"\n}\n```" - ], - "signature": "let fromString: (string, ~flags: string=?) => t" - }, - { - "id": "Stdlib.RegExp.fromStringWithFlags", - "kind": "value", - "name": "fromStringWithFlags", - "docstrings": [ - "`fromStringWithFlags(string)` creates a `RegExp.t` from the provided string, using the provided `flags`. This can then be used to match on strings using `RegExp.exec`.\n\nSee [`RegExp parameters`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp#parameters) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```" - ], - "signature": "let fromStringWithFlags: (string, ~flags: string) => t", - "deprecated": "" - }, - { - "id": "Stdlib.RegExp.escape", - "kind": "value", - "name": "escape", - "docstrings": [ - "`escape(string)` escapes any potential regex syntax characters in a string.\n\nSee [`RegExp.escape`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/escape) on MDN.\n\n## Examples\n```rescript\nlet literal = \"foo[bar]\"\nlet regexp = literal->RegExp.escape->RegExp.fromString\nregexp->RegExp.test(\"foo[bar]\") == true\n```\n\n## Remark\n\nSince May 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." - ], - "signature": "let escape: string => string" - }, - { - "id": "Stdlib.RegExp.test", - "kind": "value", - "name": "test", - "docstrings": [ - "`test(regexp, string)` tests whether the provided `regexp` matches on the provided string.\n\nSee [`RegExp.test`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nif regexp->RegExp.test(\"ReScript is cool!\") {\n Console.log(\"Yay, there's a word in there.\")\n}\n```" - ], - "signature": "let test: (t, string) => bool" - }, - { - "id": "Stdlib.RegExp.exec", - "kind": "value", - "name": "exec", - "docstrings": [ - "`exec(regexp, string)` executes the provided regexp on the provided string, optionally returning a `RegExp.Result.t` if the regexp matches on the string.\n\nSee [`RegExp.exec`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```" - ], - "signature": "let exec: (t, string) => option" - }, - { - "id": "Stdlib.RegExp.lastIndex", - "kind": "value", - "name": "lastIndex", - "docstrings": [ - "`lastIndex(regexp)` returns the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `0` to the console\n\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `4` to the console\n```" - ], - "signature": "let lastIndex: t => int" - }, - { - "id": "Stdlib.RegExp.setLastIndex", - "kind": "value", - "name": "setLastIndex", - "docstrings": [ - "`setLastIndex(regexp, index)` set the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nregexp->RegExp.setLastIndex(4)\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `10` to the console\n```" - ], - "signature": "let setLastIndex: (t, int) => unit" - }, - { - "id": "Stdlib.RegExp.ignoreCase", - "kind": "value", - "name": "ignoreCase", - "docstrings": [ - "`ignoreCase(regexp)` returns whether the ignore case (`i`) flag is set on this `RegExp`.\n\nSee [`RegExp.ignoreCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/ignoreCase) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.ignoreCase) // Logs `false`, since `i` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.ignoreCase) // Logs `true`, since `i` is set\n```" - ], - "signature": "let ignoreCase: t => bool" - }, - { - "id": "Stdlib.RegExp.global", - "kind": "value", - "name": "global", - "docstrings": [ - "`global(regexp)` returns whether the global (`g`) flag is set on this `RegExp`.\n\nSee [`RegExp.global`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/global) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.global) // Logs `true`, since `g` is set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.global) // Logs `false`, since `g` is not set\n```" - ], - "signature": "let global: t => bool" - }, - { - "id": "Stdlib.RegExp.multiline", - "kind": "value", - "name": "multiline", - "docstrings": [ - "`multiline(regexp)` returns whether the multiline (`m`) flag is set on this `RegExp`.\n\nSee [`RegExp.multiline`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/multiline) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.multiline) // Logs `false`, since `m` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mi\")\nConsole.log(regexp2->RegExp.multiline) // Logs `true`, since `m` is set\n```" - ], - "signature": "let multiline: t => bool" - }, - { - "id": "Stdlib.RegExp.source", - "kind": "value", - "name": "source", - "docstrings": [ - "`source(regexp)` returns the source text for this `RegExp`, without the two forward slashes (if present), and without any set flags.\n\nSee [`RegExp.source`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/source) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp->RegExp.source) // Logs `\\w+`, the source text of the `RegExp`\n```" - ], - "signature": "let source: t => string" - }, - { - "id": "Stdlib.RegExp.sticky", - "kind": "value", - "name": "sticky", - "docstrings": [ - "`sticky(regexp)` returns whether the sticky (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.sticky`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `y` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"my\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `y` is set\n```" - ], - "signature": "let sticky: t => bool" - }, - { - "id": "Stdlib.RegExp.unicode", - "kind": "value", - "name": "unicode", - "docstrings": [ - "`unicode(regexp)` returns whether the unicode (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.unicode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `u` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mu\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `u` is set\n```" - ], - "signature": "let unicode: t => bool" - }, - { - "id": "Stdlib.RegExp.flags", - "kind": "value", - "name": "flags", - "docstrings": [ - "`flags(regexp)` returns a string consisting of all the flags set on this `RegExp`.\n\nSee [`RegExp.flags`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromString(\"\\\\w+\", ~flags=\"gi\")\nConsole.log(regexp->RegExp.flags) // Logs \"gi\", all the flags set on the RegExp\n```" - ], - "signature": "let flags: t => string" - }, - { - "id": "Stdlib.RegExp.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(regExp)` ignores the provided regExp and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/promise": { - "id": "Stdlib.Promise", - "name": "Promise", - "docstrings": [ - "Functions for interacting with JavaScript Promise.\nSee: [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)." - ], - "items": [ - { - "id": "Stdlib.Promise.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>" - }, - { - "id": "Stdlib.Promise.resolve", - "kind": "value", - "name": "resolve", - "docstrings": [ - "`resolve(value)` creates a resolved Promise with a given `value`.\nSee [`Promise.resolve`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve) on MDN.\n\n## Examples\n\n```rescript\nlet p = Promise.resolve(5) // promise\n```" - ], - "signature": "let resolve: 'a => t<'a>" - }, - { - "id": "Stdlib.Promise.reject", - "kind": "value", - "name": "reject", - "docstrings": [ - "`reject(exn)` reject a Promise.\nSee [`Promise.reject`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject) on MDN.\n\n## Examples\n\n```rescript\nexception TestError(string)\n\nTestError(\"some rejected value\")\n->Promise.reject\n->Promise.catch(v => {\n switch v {\n | TestError(msg) => msg == \"some rejected value\"\n | _ => assert(false)\n }\n Promise.resolve()\n})\n->ignore\n```" - ], - "signature": "let reject: exn => t<'a>" - }, - { - "id": "Stdlib.Promise.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(callback)` creates a new Promise based on a `callback` that receives two\nuncurried functions `resolve` and `reject` for defining the Promise's result.\n\n## Examples\n\n```rescript\nopen Promise\n\nlet n = 4\nPromise.make((resolve, reject) => {\n if n < 5 {\n resolve(\"success\")\n } else {\n reject(\"failed\")\n }\n})\n->then(str => {\n Console.log(str)->resolve\n})\n->catch(_ => {\n Console.log(\"Error occurred\")\n resolve()\n})\n->ignore\n```" - ], - "signature": "let make: (('a => unit, 'e => unit) => unit) => t<'a>" - }, - { - "id": "Stdlib.Promise.promiseAndResolvers", - "kind": "type", - "name": "promiseAndResolvers", - "docstrings": [], - "signature": "type promiseAndResolvers<'a> = {\n promise: t<'a>,\n resolve: 'a => unit,\n reject: exn => unit,\n}" - }, - { - "id": "Stdlib.Promise.withResolvers", - "kind": "value", - "name": "withResolvers", - "docstrings": [ - "`withResolvers()` returns a object containing a new promise with functions to resolve or reject it. See [`Promise.withResolvers`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\n\nlet {promise, resolve, _} = Promise.withResolvers()\n\nsetTimeout(() => {\n resolve(\"success\")\n}, 1000)->TimeoutId.ignore\n\npromise\n->thenResolve(str => {\n Console.log(str)\n})\n->ignore\n```" - ], - "signature": "let withResolvers: unit => promiseAndResolvers<'a>" - }, - { - "id": "Stdlib.Promise.catch", - "kind": "value", - "name": "catch", - "docstrings": [ - "`catch(promise, errorCallback)` registers an exception handler in a promise chain.\nThe `errorCallback` receives an `exn` value that can later be refined into a JS\nerror or ReScript error. The `errorCallback` needs to return a promise with the\nsame type as the consumed promise. See [`Promise.catch`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\n\nexception SomeError(string)\n\nreject(SomeError(\"this is an error\"))\n->then(_ => {\n Ok(\"This result will never be returned\")->resolve\n})\n->catch(e => {\n let msg = switch e {\n | SomeError(msg) => \"ReScript error occurred: \" ++ msg\n | JsExn(obj) =>\n switch JsExn.message(obj) {\n | Some(msg) => \"JS exception occurred: \" ++ msg\n | None => \"Some other JS value has been thrown\"\n }\n | _ => \"Unexpected error occurred\"\n }\n\n Error(msg)->resolve\n})\n->then(result => {\n switch result {\n | Ok(r) => Console.log2(\"Operation successful: \", r)\n | Error(msg) => Console.log2(\"Operation failed: \", msg)\n }->resolve\n})\n->ignore // Ignore needed for side-effects\n```\n\nIn case you want to return another promise in your `callback`, consider using\n`then` instead." - ], - "signature": "let catch: (t<'a>, exn => t<'a>) => t<'a>" - }, - { - "id": "Stdlib.Promise.then", - "kind": "value", - "name": "then", - "docstrings": [ - "`then(promise, callback)` returns a new promise based on the result of `promise`'s\nvalue. The `callback` needs to explicitly return a new promise via `resolve`.\nIt is **not allowed** to resolve a nested promise (like `resolve(resolve(1))`).\nSee [`Promise.then`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) on MDN.\n## Examples\n\n```rescript\nopen Promise\nresolve(5)\n->then(num => {\n resolve(num + 5)\n})\n->then(num => {\n Console.log2(\"Your lucky number is: \", num)\n resolve()\n})\n->ignore\n```" - ], - "signature": "let then: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Promise.thenResolve", - "kind": "value", - "name": "thenResolve", - "docstrings": [ - "`thenResolve(promise, callback)` converts an encapsulated value of a promise\ninto another promise wrapped value. It is **not allowed** to return a promise\nwithin the provided callback (e.g. `thenResolve(value => resolve(value))`).\n\n## Examples\n\n```rescript\nopen Promise\nresolve(\"Anna\")\n->thenResolve(str => {\n \"Hello \" ++ str\n})\n->thenResolve(str => {\n Console.log(str)\n})\n->ignore // Ignore needed for side-effects\n```\n\nIn case you want to return another promise in your `callback`, consider using\n`then` instead." - ], - "signature": "let thenResolve: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Promise.finally", - "kind": "value", - "name": "finally", - "docstrings": [ - "`finally(promise, callback)` is used to execute a function that is called no\nmatter if a promise was resolved or rejected. It will return the same `promise`\nit originally received. See [`Promise.finally`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/finally) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nexception SomeError(string)\nlet isDone = ref(false)\n\nresolve(5)\n->then(_ => {\n reject(SomeError(\"test\"))\n})\n->then(v => {\n Console.log2(\"final result\", v)\n resolve()\n})\n->catch(_ => {\n Console.log(\"Error handled\")\n resolve()\n})\n->finally(() => {\n Console.log(\"finally\")\n isDone := true\n})\n->then(() => {\n Console.log2(\"isDone:\", isDone.contents)\n resolve()\n})\n->ignore\n```" - ], - "signature": "let finally: (t<'a>, unit => unit) => t<'a>" - }, - { - "id": "Stdlib.Promise.race", - "kind": "value", - "name": "race", - "docstrings": [ - "`race(arr)` runs all promises concurrently and returns promise settles with the eventual state of the first promise that settles. See [`Promise.race`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nlet racer = (ms, name) => {\n Promise.make((resolve, _) => {\n setTimeout(() => {\n resolve(name)\n }, ms)->TimeoutId.ignore\n })\n}\n\nlet promises = [racer(1000, \"Turtle\"), racer(500, \"Hare\"), racer(100, \"Eagle\")]\n\nrace(promises)->then(winner => {\n Console.log(\"The winner is \" ++ winner)\n resolve()\n})\n```" - ], - "signature": "let race: array> => t<'a>" - }, - { - "id": "Stdlib.Promise.any", - "kind": "value", - "name": "any", - "docstrings": [ - "`any(arr)` runs all promises concurrently and returns promise fulfills when any of the input's promises fulfills, with this first fulfillment value. See [`Promise.any`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/any) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nlet racer = (ms, name) => {\n Promise.make((resolve, _) => {\n setTimeout(() => {\n resolve(name)\n }, ms)->TimeoutId.ignore\n })\n}\n\nlet promises = [racer(1000, \"Turtle\"), racer(500, \"Hare\"), racer(100, \"Eagle\")]\n\nany(promises)->then(winner => {\n Console.log(\"The winner is \" ++ winner)\n resolve()\n})\n```" - ], - "signature": "let any: array> => t<'a>" - }, - { - "id": "Stdlib.Promise.all", - "kind": "value", - "name": "all", - "docstrings": [ - "`all(promises)` runs all promises concurrently and returns a promise fulfills when all of the input's promises fulfill, with an array of the fulfillment values. See [`Promise.all`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all) on MDN.\n\n```rescript\nopen Promise\nlet promises = [resolve(1), resolve(2), resolve(3)]\n\nall(promises)\n->then(results => {\n results->Array.forEach(num => {\n Console.log2(\"Number: \", num)\n })\n\n resolve()\n})\n->ignore\n```" - ], - "signature": "let all: array> => t>" - }, - { - "id": "Stdlib.Promise.all2", - "kind": "value", - "name": "all2", - "docstrings": [ - "`all2((p1, p2))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all2: ((t<'a>, t<'b>)) => t<('a, 'b)>" - }, - { - "id": "Stdlib.Promise.all3", - "kind": "value", - "name": "all3", - "docstrings": [ - "`all3((p1, p2, p3))`. Like `all()`, but with a fixed size tuple of 3" - ], - "signature": "let all3: ((t<'a>, t<'b>, t<'c>)) => t<('a, 'b, 'c)>" - }, - { - "id": "Stdlib.Promise.all4", - "kind": "value", - "name": "all4", - "docstrings": [ - "`all4((p1, p2, p3, p4))`. Like `all()`, but with a fixed size tuple of 4" - ], - "signature": "let all4: ((t<'a>, t<'b>, t<'c>, t<'d>)) => t<('a, 'b, 'c, 'd)>" - }, - { - "id": "Stdlib.Promise.all5", - "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((p1, p2, p3, p4, p5))`. Like `all()`, but with a fixed size tuple of 5" - ], - "signature": "let all5: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>),\n) => t<('a, 'b, 'c, 'd, 'e)>" - }, - { - "id": "Stdlib.Promise.all6", - "kind": "value", - "name": "all6", - "docstrings": [ - "`all6((p1, p2, p4, p5, p6))`. Like `all()`, but with a fixed size tuple of 6\n\")" - ], - "signature": "let all6: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>, t<'f>),\n) => t<('a, 'b, 'c, 'd, 'e, 'f)>" - }, - { - "id": "Stdlib.Promise.settledResult", - "kind": "type", - "name": "settledResult", - "docstrings": [], - "signature": "type settledResult<'a> =\n | Fulfilled({value: 'a})\n | Rejected({reason: exn})" - }, - { - "id": "Stdlib.Promise.allSettled", - "kind": "value", - "name": "allSettled", - "docstrings": [ - "`allSettled(promises)` runs all promises concurrently and returns promise fulfills when all of the input's promises settle with an array of objects that describe the outcome of each promise. See [`Promise.allSettled`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled) on MDN.\n\n```rescript\nopen Promise\n\nexception TestError(string)\n\nlet promises = [resolve(1), resolve(2), reject(TestError(\"some rejected promise\"))]\n\nallSettled(promises)\n->then(results => {\n results->Array.forEach(result => {\n switch result {\n | Fulfilled({value: num}) => Console.log2(\"Number: \", num)\n | Rejected({reason}) => Console.log(reason)\n }\n })\n\n resolve()\n})\n->ignore\n```" - ], - "signature": "let allSettled: array> => t>>" - }, - { - "id": "Stdlib.Promise.allSettled2", - "kind": "value", - "name": "allSettled2", - "docstrings": [ - "`allSettled2((p1, p2))`. Like `allSettled()`, but with a fixed size tuple of 2" - ], - "signature": "let allSettled2: (\n (t<'a>, t<'b>),\n) => t<(settledResult<'a>, settledResult<'b>)>" - }, - { - "id": "Stdlib.Promise.allSettled3", - "kind": "value", - "name": "allSettled3", - "docstrings": [ - "`allSettled3((p1, p2, p3))`. Like `allSettled()`, but with a fixed size tuple of 3" - ], - "signature": "let allSettled3: (\n (t<'a>, t<'b>, t<'c>),\n) => t<\n (settledResult<'a>, settledResult<'b>, settledResult<'c>),\n>" - }, - { - "id": "Stdlib.Promise.allSettled4", - "kind": "value", - "name": "allSettled4", - "docstrings": [ - "`allSettled4((p1, p2, p3, p4))`. Like `allSettled()`, but with a fixed size tuple of 4" - ], - "signature": "let allSettled4: (\n (t<'a>, t<'b>, t<'c>, t<'d>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n ),\n>" - }, - { - "id": "Stdlib.Promise.allSettled5", - "kind": "value", - "name": "allSettled5", - "docstrings": [ - "`allSettled5((p1, p2, p3, p4, p5))`. Like `allSettled()`, but with a fixed size tuple of 5" - ], - "signature": "let allSettled5: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n settledResult<'e>,\n ),\n>" - }, - { - "id": "Stdlib.Promise.allSettled6", - "kind": "value", - "name": "allSettled6", - "docstrings": [ - "`allSettled6((p1, p2, p4, p5, p6))`. Like `allSettled()`, but with a fixed size tuple of 6\n\")" - ], - "signature": "let allSettled6: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>, t<'f>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n settledResult<'e>,\n settledResult<'f>,\n ),\n>" - }, - { - "id": "Stdlib.Promise.done", - "kind": "value", - "name": "done", - "docstrings": [ - "`done(p)` is a safe way to ignore a promise. If a value is anything else than a\npromise, it will throw a type error." - ], - "signature": "let done: promise<'a> => unit", - "deprecated": "" - }, - { - "id": "Stdlib.Promise.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(promise)` ignores the provided promise and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: promise<'a> => unit" - } - ] - }, - "stdlib/pair": { - "id": "Stdlib.Pair", - "name": "Pair", - "docstrings": [ - "This module provides functions to work with pairs, which are 2-element tuples." - ], - "items": [ - { - "id": "Stdlib.Pair.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a, 'b> = ('a, 'b)" - }, - { - "id": "Stdlib.Pair.first", - "kind": "value", - "name": "first", - "docstrings": [ - "`first(pair)` returns the first element of a pair.\n\n## Examples\n\n```rescript\nPair.first((1, 2)) == 1\n```" - ], - "signature": "let first: (('a, 'b)) => 'a" - }, - { - "id": "Stdlib.Pair.second", - "kind": "value", - "name": "second", - "docstrings": [ - "`second(pair)` returns the second element of a pair.\n\n## Examples\n\n```rescript\nPair.second((1, 2)) == 2\n```" - ], - "signature": "let second: (('a, 'b)) => 'b" - }, - { - "id": "Stdlib.Pair.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(pair)` ignores the provided pair and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Pair.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(pair1, pair2, f1, f2)` check equality of `pair2` and `pair2` using `f1` for\nequality on the first element and `f2` for equality on the second element.\n\n## Examples\n\n```rescript\nPair.equal((1, \"test\"), (1, \"test\"), Int.equal, String.equal) == true\n\nPair.equal((1, \"test\"), (2, \"test\"), Int.equal, String.equal) == false\n```" - ], - "signature": "let equal: (\n ('a, 'b),\n ('c, 'd),\n ('a, 'c) => bool,\n ('b, 'd) => bool,\n) => bool" - }, - { - "id": "Stdlib.Pair.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(pair1, pair2, f1, f2)` compares two pairs, using `f1` to compare the first element\nand `f2` to compare the second element. Ordering is based on the first element,\nif they are equal, the second element is compared.\n\n## Examples\n\n```rescript\nPair.compare((1, \"a\"), (1, \"a\"), Int.compare, String.compare) == Ordering.equal\nPair.compare((1, \"a\"), (1, \"b\"), Int.compare, String.compare) == Ordering.less\nPair.compare((2, \"a\"), (1, \"b\"), Int.compare, String.compare) == Ordering.greater\n```" - ], - "signature": "let compare: (\n ('a, 'b),\n ('c, 'd),\n ('a, 'c) => float,\n ('b, 'd) => float,\n) => float" - } - ] - }, - "stdlib/ordering": { - "id": "Stdlib.Ordering", - "name": "Ordering", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Ordering.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Ordering values represent the result of a comparison: `less`, `equal`, or `greater`." - ], - "signature": "type t = float" - }, - { - "id": "Stdlib.Ordering.less", - "kind": "value", - "name": "less", - "docstrings": [], - "signature": "let less: float" - }, - { - "id": "Stdlib.Ordering.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: float" - }, - { - "id": "Stdlib.Ordering.greater", - "kind": "value", - "name": "greater", - "docstrings": [], - "signature": "let greater: float" - }, - { - "id": "Stdlib.Ordering.isLess", - "kind": "value", - "name": "isLess", - "docstrings": [ - "`isLess(ordering)` returns `true` when `ordering` equals `Ordering.less`.\n\n## Examples\n\n```rescript\nOrdering.isLess(Ordering.less) == true\nOrdering.isLess(Ordering.equal) == false\n```" - ], - "signature": "let isLess: float => bool" - }, - { - "id": "Stdlib.Ordering.isEqual", - "kind": "value", - "name": "isEqual", - "docstrings": [ - "`isEqual(ordering)` returns `true` when `ordering` equals `Ordering.equal`.\n\n## Examples\n\n```rescript\nOrdering.isEqual(Ordering.equal) == true\nOrdering.isEqual(Ordering.greater) == false\n```" - ], - "signature": "let isEqual: float => bool" - }, - { - "id": "Stdlib.Ordering.isGreater", - "kind": "value", - "name": "isGreater", - "docstrings": [ - "`isGreater(ordering)` returns `true` when `ordering` equals `Ordering.greater`.\n\n## Examples\n\n```rescript\nOrdering.isGreater(Ordering.greater) == true\nOrdering.isGreater(Ordering.less) == false\n```" - ], - "signature": "let isGreater: float => bool" - }, - { - "id": "Stdlib.Ordering.invert", - "kind": "value", - "name": "invert", - "docstrings": [ - "`invert(ordering)` flips the ordering result (less becomes greater and vice versa).\n\n## Examples\n\n```rescript\nOrdering.invert(Ordering.less) == Ordering.greater\nOrdering.invert(Ordering.equal) == Ordering.equal\n```" - ], - "signature": "let invert: float => float" - }, - { - "id": "Stdlib.Ordering.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "`fromInt(n)` converts an integer comparison result into an ordering.\n\n## Examples\n\n```rescript\nOrdering.fromInt(-5) == Ordering.less\nOrdering.fromInt(0) == Ordering.equal\nOrdering.fromInt(3) == Ordering.greater\n```" - ], - "signature": "let fromInt: int => float" - }, - { - "id": "Stdlib.Ordering.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(ordering)` ignores the provided ordering and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/option": { - "id": "Stdlib.Option", - "name": "Option", - "docstrings": [ - "We represent the existence and nonexistence of a value by wrapping it with\nthe `option` type. In order to make it a bit more convenient to work with\noption-types, we provide utility-functions for it.\n\nThe `option` type is a part of the ReScript standard library which is defined\nlike this:\n\n```rescript\ntype option<'a> = None | Some('a)\n```\n\n```rescript\nlet someString: option = Some(\"hello\")\n```" - ], - "items": [ - { - "id": "Stdlib.Option.t", - "kind": "type", - "name": "t", - "docstrings": ["Type representing an option of type 'a."], - "signature": "type t<'a> = option<'a> = None | Some('a)" - }, - { - "id": "Stdlib.Option.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(opt, f)` applies `f` to `opt`, if `f` returns `true`, then it returns `Some(value)`, otherwise returns `None`.\n\n## Examples\n\n```rescript\nOption.filter(Some(10), x => x > 5) // Some(10)\nOption.filter(Some(4), x => x > 5) // None\nOption.filter(None, x => x > 5) // None\n```" - ], - "signature": "let filter: (option<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Option.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(opt, f)` call `f` on `opt`. if `opt` is `Some(value)`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nOption.forEach(Some(\"thing\"), x => Console.log(x)) // logs \"thing\"\nOption.forEach(None, x => Console.log(x)) // returns ()\n```" - ], - "signature": "let forEach: (option<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Option.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(opt, ~message=?)` returns `value` if `opt` is `Some(value)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n```rescript\nOption.getExn(Some(3)) == 3\n\nswitch Option.getExn(None) {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n\nswitch Option.getExn(None, ~message=\"was None!\") {\n| exception _ => assert(true) // Throws a JsError with the message \"was None!\"\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an error if `opt` is `None`" - ], - "signature": "let getExn: (option<'a>, ~message: string=?) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Option.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(opt, ~message=?)` returns `value` if `opt` is `Some(value)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n```rescript\nOption.getOrThrow(Some(3)) == 3\n\nswitch Option.getOrThrow(None) {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n\nswitch Option.getOrThrow(None, ~message=\"was None!\") {\n| exception _ => assert(true) // Throws a JsError with the message \"was None!\"\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an error if `opt` is `None`" - ], - "signature": "let getOrThrow: (option<'a>, ~message: string=?) => 'a" - }, - { - "id": "Stdlib.Option.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(opt)` returns `value` if `opt` is `Some(value)`, otherwise `undefined`.\n\n## Examples\n\n```rescript\nOption.getUnsafe(Some(3)) == 3\nOption.getUnsafe((None: option)) // Returns `undefined`, which is not a valid `int`\n```\n\n## Notes\n\n- This is an unsafe operation. It assumes `value` is not `None`, and may cause undefined behaviour if it is." - ], - "signature": "let getUnsafe: option<'a> => 'a" - }, - { - "id": "Stdlib.Option.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(opt, default, f)` returns `f(value)` if `opt` is `Some(value)`, otherwise `default`.\n\n## Examples\n\n```rescript\nlet someValue = Some(3)\nsomeValue->Option.mapOr(0, x => x + 5) // 8\n\nlet noneValue = None\nnoneValue->Option.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (option<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Option.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (option<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Option.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(opt, f)` returns `Some(f(value))` if `opt` is `Some(value)`, otherwise `None`.\n\n## Examples\n\n```rescript\nOption.map(Some(3), x => x * x) // Some(9)\nOption.map(None, x => x * x) // None\n```" - ], - "signature": "let map: (option<'a>, 'a => 'b) => option<'b>" - }, - { - "id": "Stdlib.Option.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(opt, f)` returns `f(value)` if `opt` is `Some(value)`, otherwise `None`.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Some(value + 1)\n } else {\n None\n }\n\nOption.flatMap(Some(2), addIfAboveOne) // Some(3)\nOption.flatMap(Some(-4), addIfAboveOne) // None\nOption.flatMap(None, addIfAboveOne) // None\n```" - ], - "signature": "let flatMap: (option<'a>, 'a => option<'b>) => option<'b>" - }, - { - "id": "Stdlib.Option.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(opt, default)` returns `value` if `opt` is `Some(value)`, otherwise `default`.\n\n## Examples\n\n```rescript\nOption.getOr(None, \"Banana\") // Banana\nOption.getOr(Some(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nSome(\"Jane\")->greet // \"Greetings Jane\"\nNone->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (option<'a>, 'a) => 'a" - }, - { - "id": "Stdlib.Option.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (option<'a>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Option.orElse", - "kind": "value", - "name": "orElse", - "docstrings": [ - "`orElse(opt1, opt2)` returns `opt2` if `opt1` is `None`, otherwise `opt1`.\n\n## Examples\n\n```rescript\nOption.orElse(Some(1812), Some(1066)) == Some(1812)\nOption.orElse(None, Some(1066)) == Some(1066)\nOption.orElse(None, None) == None\n```" - ], - "signature": "let orElse: (option<'a>, option<'a>) => option<'a>" - }, - { - "id": "Stdlib.Option.isSome", - "kind": "value", - "name": "isSome", - "docstrings": [ - "`isSome(opt)` returns `true` if `opt` is `Some(value)`, otherwise returns `false`.\n\n## Examples\n\n```rescript\nOption.isSome(None) // false\nOption.isSome(Some(1)) // true\n```" - ], - "signature": "let isSome: option<'a> => bool" - }, - { - "id": "Stdlib.Option.isNone", - "kind": "value", - "name": "isNone", - "docstrings": [ - "`isNone(opt)` returns `true` if `opt` is `None`, false otherwise.\n\n## Examples\n\n```rescript\nOption.isNone(None) // true\nOption.isNone(Some(1)) // false\n```" - ], - "signature": "let isNone: option<'a> => bool" - }, - { - "id": "Stdlib.Option.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(opt1, opt2, f)` evaluates two optional values for equality with respect to a predicate function `f`. If both `opt1` and `opt2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, the predicate function `f` must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Option\n\nequal(Some(3), Some(15), clockEqual) // true\nequal(Some(3), None, clockEqual) // false\nequal(None, Some(3), clockEqual) // false\nequal(None, None, clockEqual) // true\n```" - ], - "signature": "let equal: (option<'a>, option<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.Option.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(opt1, opt2, f)` compares two optional values with respect to given `f`.\n\nIf both `opt1` and `opt2` are `None`, it returns `0.`. If the first argument is `Some(value1)` and the second is `None`, returns `1.` (something is greater than nothing).\n\nIf the first argument is `None` and the second is `Some(value2)`, returns `-1.`\n(nothing is less than something).\n\nIf the arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, `f` takes two arguments and returns `-1.` if the first\nargument is less than the second, `0.` if the arguments are equal, and `1.` if\nthe first argument is greater than the second.\n\n## Examples\n\n```rescript\nlet clockCompare = (a, b) => Int.compare(mod(a, 12), mod(b, 12))\n\nOption.compare(Some(3), Some(15), clockCompare) // 0.\nOption.compare(Some(3), Some(14), clockCompare) // 1.\nOption.compare(Some(2), Some(15), clockCompare) // (-1.)\nOption.compare(None, Some(15), clockCompare) // (-1.)\nOption.compare(Some(14), None, clockCompare) // 1.\nOption.compare(None, None, clockCompare) // 0.\n```" - ], - "signature": "let compare: (\n option<'a>,\n option<'b>,\n ('a, 'b) => Ordering.t,\n) => Ordering.t" - }, - { - "id": "Stdlib.Option.all", - "kind": "value", - "name": "all", - "docstrings": [ - "`all(options)` returns an option of array if all options are Some, otherwise returns None.\n\n## Examples\n\n```rescript\nOption.all([Some(1), Some(2), Some(3)]) // Some([1, 2, 3])\nOption.all([Some(1), None]) // None\n```" - ], - "signature": "let all: array> => option>" - }, - { - "id": "Stdlib.Option.all2", - "kind": "value", - "name": "all2", - "docstrings": [ - "`all2((o1, o2))`. Like `all()`, but with a fixed size tuple of 2" - ], - "signature": "let all2: ((option<'a>, option<'b>)) => option<('a, 'b)>" - }, - { - "id": "Stdlib.Option.all3", - "kind": "value", - "name": "all3", - "docstrings": [ - "`all3((o1, o2, o3))`. Like `all()`, but with a fixed size tuple of 3" - ], - "signature": "let all3: (\n (option<'a>, option<'b>, option<'c>),\n) => option<('a, 'b, 'c)>" - }, - { - "id": "Stdlib.Option.all4", - "kind": "value", - "name": "all4", - "docstrings": [ - "`all4((o1, o2, o3, o4))`. Like `all()`, but with a fixed size tuple of 4" - ], - "signature": "let all4: (\n (option<'a>, option<'b>, option<'c>, option<'d>),\n) => option<('a, 'b, 'c, 'd)>" - }, - { - "id": "Stdlib.Option.all5", - "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((o1, o2, o3, o4, o5))`. Like `all()`, but with a fixed size tuple of 5" - ], - "signature": "let all5: (\n (\n option<'a>,\n option<'b>,\n option<'c>,\n option<'d>,\n option<'e>,\n ),\n) => option<('a, 'b, 'c, 'd, 'e)>" - }, - { - "id": "Stdlib.Option.all6", - "kind": "value", - "name": "all6", - "docstrings": [ - "`all6((o1, o2, o3, o4, o5, o6))`. Like `all()`, but with a fixed size tuple of 6" - ], - "signature": "let all6: (\n (\n option<'a>,\n option<'b>,\n option<'c>,\n option<'d>,\n option<'e>,\n option<'f>,\n ),\n) => option<('a, 'b, 'c, 'd, 'e, 'f)>" - }, - { - "id": "Stdlib.Option.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(option)` ignores the provided option and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: option<'a> => unit" - } - ] - }, - "stdlib/object": { - "id": "Stdlib.Object", - "name": "Object", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Object.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make` create a new object that inherits the properties and methods from the standard built-in Object, such as `toString`. See [Object on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)\n\n## Examples\n\n```rescript\nlet x = Object.make()\nx->Object.keysToArray->Array.length // 0\nx->Object.get(\"toString\")->Option.isSome // true\n```" - ], - "signature": "let make: unit => {..}" - }, - { - "id": "Stdlib.Object.is", - "kind": "value", - "name": "is", - "docstrings": [ - "`is` determines if two objects are identical in all contexts. Objects, arrays, records, and other non-primitives are only identical if they reference the **exact** same object in memory. Primitives like ints, floats, and strings are identical if they have the same value. `+0` and `-0` are distinct. NaN is equal to itself. See [Object.is on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)\n\nIn most scenarios use `==` or `===` or the custom `equals` function (if provided) for the type.\n\n## Examples\n\n```rescript\nObject.is(25, 13) // false\nObject.is(\"abc\", \"abc\") // true\nObject.is(undefined, undefined) // true\nObject.is(undefined, null) // false\nObject.is(-0.0, 0.0) // false\nObject.is(list{1, 2}, list{1, 2}) // false\n\nObject.is([1, 2, 3], [1, 2, 3]) // false\n[1, 2, 3] == [1, 2, 3] // true\n[1, 2, 3] === [1, 2, 3] // false\n\nlet fruit = {\"name\": \"Apple\"}\nObject.is(fruit, fruit) // true\nObject.is(fruit, {\"name\": \"Apple\"}) // false\nfruit == {\"name\": \"Apple\"} // true\nfruit === {\"name\": \"Apple\"} // false\n```" - ], - "signature": "let is: ('a, 'a) => bool" - }, - { - "id": "Stdlib.Object.create", - "kind": "value", - "name": "create", - "docstrings": [ - "`create` creates a new object, using an existing object as the prototype of the new object. See [Object.create on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\n\n**Note:** ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/object) and [records](https://rescript-lang.org/docs/manual/record). This is often safer and more convenient than using `create` and other functions in this module.\n\n## Examples\n\n```rescript\nlet x = {\"fruit\": \"banana\"}\nlet y = Object.create(x)\ny->Object.get(\"fruit\") // Some(\"banana\")\n```" - ], - "signature": "let create: {..} => {..}" - }, - { - "id": "Stdlib.Object.createWithProperties", - "kind": "value", - "name": "createWithProperties", - "docstrings": [ - "`createWithProperties(proto, descriptors)` creates a new object that delegates to `proto` and defines additional properties using descriptor objects.\n\nSee [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) on MDN.\n\n## Examples\n\n```rescript\nlet proto = {\"kind\": \"fruit\"}\nlet obj = Object.createWithProperties(proto, {\"name\": {\"value\": \"banana\"}})\nobj->Object.get(\"name\") == Some(\"banana\")\nobj->Object.get(\"kind\") == Some(\"fruit\")\n```" - ], - "signature": "let createWithProperties: ({..}, {..}) => {..}" - }, - { - "id": "Stdlib.Object.createWithNull", - "kind": "value", - "name": "createWithNull", - "docstrings": [ - "`createWithNull()` creates an object with a `null` prototype (no inherited properties).\n\nSee [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) on MDN.\n\n## Examples\n\n```rescript\nlet obj = Object.createWithNull()\nobj->Object.get(\"toString\") == None\n```" - ], - "signature": "let createWithNull: unit => {..}" - }, - { - "id": "Stdlib.Object.createWithNullAndProperties", - "kind": "value", - "name": "createWithNullAndProperties", - "docstrings": [ - "`createWithNullAndProperties(descriptors)` creates an object with a `null` prototype and defines properties using descriptor objects.\n\nSee [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) on MDN.\n\n## Examples\n\n```rescript\nlet obj = Object.createWithNullAndProperties({\"name\": {\"value\": \"banana\"}})\nobj->Object.get(\"name\") == Some(\"banana\")\nobj->Object.get(\"toString\") == None\n```" - ], - "signature": "let createWithNullAndProperties: {..} => {..}" - }, - { - "id": "Stdlib.Object.assign", - "kind": "value", - "name": "assign", - "docstrings": [ - "`assign(target, source)` copies enumerable own properties from the source to the target, overwriting properties with the same name. It returns the modified target object. A deep clone is not created; properties are copied by reference.\n\n**Warning:** ReScript provides compile-time support for type-safe access to JavaScript objects. This eliminates common errors such as accessing properties that do not exist, or using a property of type x as if it were a y. Using `assign` can bypass these safety checks and lead to run-time errors (if you are not careful). ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/object) and [records](https://rescript-lang.org/docs/manual/record). This is often safer and more convenient than using `assign` and other functions in this module.\n\nSee [Object.assign on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) or [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign).\n\n## Examples\n\n```rescript\nObject.assign({\"a\": 1}, {\"a\": 2}) // {\"a\": 2}\nObject.assign({\"a\": 1, \"b\": 2}, {\"a\": 0}) // {\"a\": 0, \"b\": 2}\nObject.assign({\"a\": 1}, {\"a\": null}) // {\"a\": null}\n```" - ], - "signature": "let assign: ({..}, {..}) => {..}" - }, - { - "id": "Stdlib.Object.assignMany", - "kind": "value", - "name": "assignMany", - "docstrings": [ - "`assignMany(target, sources)` copies enumerable own properties from each source to the target, overwriting properties with the same name. Later sources' properties overwrite earlier ones. It returns the modified target object. A deep clone is not created; properties are copied by reference.\n\n**Note:** ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/object), including spreading one object into another. This is often more convenient than using `assign` or `assignMany`. \n\nSee [Object.assign on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) or [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign)." - ], - "signature": "let assignMany: ({..}, array<{..}>) => {..}" - }, - { - "id": "Stdlib.Object.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(object)` creates a shallow copy of `object`.\n\nSee [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) on MDN.\n\n## Examples\n\n```rescript\nlet original = {\"name\": \"banana\"}\nlet cloned = Object.copy(original)\ncloned->Object.get(\"name\") == Some(\"banana\")\nObject.is(original, cloned) == false\n```" - ], - "signature": "let copy: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get` gets the value of a property by name. Returns `None` if the property does not exist or has the value `undefined`. Otherwise returns `Some`, including if the value is `null`.\n\n## Examples\n\n```rescript\n{\"a\": 1}->Object.get(\"a\") // Some(1)\n{\"a\": 1}->Object.get(\"b\") // None\n{\"a\": undefined}->Object.get(\"a\") // None\n{\"a\": null}->Object.get(\"a\") // Some(null)\n{\"a\": 1}->Object.get(\"toString\")->Option.isSome // true\n```" - ], - "signature": "let get: ({..}, string) => option<'a>" - }, - { - "id": "Stdlib.Object.getSymbol", - "kind": "value", - "name": "getSymbol", - "docstrings": [ - "`getSymbol` gets the value of a property by symbol. Returns `None` if the property does not exist or has the value `undefined`. Otherwise returns `Some`, including if the value is `null`.\n\n## Examples\n\n```rescript\nlet fruit = Symbol.make(\"fruit\")\nlet x = Object.make()\nx->Object.setSymbol(fruit, \"banana\")\nx->Object.getSymbol(fruit) == Some(\"banana\")\n```" - ], - "signature": "let getSymbol: ({..}, Symbol.t) => option<'a>" - }, - { - "id": "Stdlib.Object.getSymbolUnsafe", - "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [ - "`getSymbolUnsafe(object, key)` reads the value stored under the symbol `key` without any optional check.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet obj = Object.make()\nobj->Object.setSymbol(key, \"hello\")\nObject.getSymbolUnsafe(obj, key) == \"hello\"\n```" - ], - "signature": "let getSymbolUnsafe: ({..}, Symbol.t) => 'a" - }, - { - "id": "Stdlib.Object.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(name, value)` assigns a value to the named object property, overwriting the previous value if any. See [Working with Objects on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#objects_and_properties)\n\n## Examples\n\n```rescript\n{\"a\": 1}->Object.set(\"a\", 2) // {\"a\": 2}\n{\"a\": 1}->Object.set(\"a\", None) // {\"a\": None}\n{\"a\": 1}->Object.set(\"b\", 2) // {\"a\": 1, \"b\": 2}\n```" - ], - "signature": "let set: ({..}, string, 'a) => unit" - }, - { - "id": "Stdlib.Object.setSymbol", - "kind": "value", - "name": "setSymbol", - "docstrings": [ - "`setSymbol(object, key, value)` stores `value` under the symbol `key` on `object`.\n\nBeware this will *mutate* the object.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"count\")\nlet obj = Object.make()\nobj->Object.setSymbol(key, 5)\nObject.getSymbol(obj, key) == Some(5)\n```" - ], - "signature": "let setSymbol: ({..}, Symbol.t, 'a) => unit" - }, - { - "id": "Stdlib.Object.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "`keysToArray` returns an array of an object's own enumerable string-keyed property names. See [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.keys)\nor [Object.keys on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys).\n\n## Examples\n\n```rescript\n{\"a\": 1, \"b\": 2}->Object.keysToArray // [\"a\", \"b\"]\n{\"a\": None}->Object.keysToArray // [\"a\"]\nObject.make()->Object.keysToArray // []\n```" - ], - "signature": "let keysToArray: {..} => array" - }, - { - "id": "Stdlib.Object.hasOwnProperty", - "kind": "value", - "name": "hasOwnProperty", - "docstrings": [ - "`hasOwnProperty` determines whether the object has the specified property as its **own** property, as opposed to inheriting it. See [hasOwnProperty on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 2}\n{\"a\": 1}->Object.hasOwnProperty(\"a\") // true\n{\"a\": 1}->Object.hasOwnProperty(\"b\") // false\n{\"a\": 1}->Object.hasOwnProperty(\"toString\") // false\n```" - ], - "signature": "let hasOwnProperty: ({..}, string) => bool" - }, - { - "id": "Stdlib.Object.seal", - "kind": "value", - "name": "seal", - "docstrings": [ - "`seal` seals an object. Sealing an object prevents extensions and makes existing properties non-configurable. A sealed object has a fixed set of properties. Unlike `freeze`, values of existing properties can still be changed as long as they are writable.\n\n**Note:** `seal` returns the same object that was passed in; it does not create a copy. Any attempt to delete or add properties to a sealed object will fail, either silently or by throwing an error.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.seal) and [Object.seal on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 2}\npoint->Object.set(\"x\", -7) // succeeds\npoint->Object.seal->ignore\n\ntry {\n point->Object.set(\"z\", 9) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n\npoint->Object.set(\"x\", 13) // succeeds\n```" - ], - "signature": "let seal: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.preventExtensions", - "kind": "value", - "name": "preventExtensions", - "docstrings": [ - "`preventExtensions` prevents new properties from being added to the object. It modifies the object (rather than creating a copy) and returns it.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.preventextensions) and [Object.preventExtensions on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/preventExtensions)\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.set(\"b\", 2) // succeeds\nobj->Object.preventExtensions->ignore\ntry {\n obj->Object.set(\"c\", 3) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let preventExtensions: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.freeze", - "kind": "value", - "name": "freeze", - "docstrings": [ - "`freeze` freezes an object. Freezing an object makes existing properties non-writable and prevents extensions. Once an object is frozen, new properties cannot be be added, existing properties cannot be removed, and their values cannot be changed.\n\n**Note:** `freeze` returns the same object that was passed in; it does not create a frozen copy. Any attempt to change a frozen object will fail, either silently or by throwing an exception.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isfrozen) and [Object.isFrozen on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen).\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.set(\"a\", 2) // succeeds\nobj->Object.freeze->ignore\n\ntry {\n obj->Object.set(\"a\", 3) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let freeze: ({..} as 'a) => 'a" - }, - { - "id": "Stdlib.Object.isSealed", - "kind": "value", - "name": "isSealed", - "docstrings": [ - "`isSealed` determines if an object is sealed. A sealed object has a fixed set of properties.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.issealed) and [Object.isSealed on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 3}->Object.seal\nlet pointIsSealed = point->Object.isSealed // true\nlet fruit = {\"name\": \"Apple\"}\nlet fruitIsSealed = fruit->Object.isSealed // false\n```" - ], - "signature": "let isSealed: 'a => bool" - }, - { - "id": "Stdlib.Object.isFrozen", - "kind": "value", - "name": "isFrozen", - "docstrings": [ - "`isFrozen` determines if an object is frozen. An object is frozen if an only if it is not extensible, all its properties are non-configurable, and all its data properties are non-writable.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isfrozen) and [Object.isFrozen on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen).\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 3}->Object.freeze\nlet pointIsFrozen = point->Object.isFrozen // true\nlet fruit = {\"name\": \"Apple\"}\nlet fruitIsFrozen = fruit->Object.isFrozen // false\n```" - ], - "signature": "let isFrozen: 'a => bool" - }, - { - "id": "Stdlib.Object.isExtensible", - "kind": "value", - "name": "isExtensible", - "docstrings": [ - "`isExtensible` determines if an object is extensible (whether it can have new properties added to it).\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isextensible) and [Object.isExtensible on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible)\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.isExtensible // true\nobj->Object.preventExtensions->ignore\nobj->Object.isExtensible // false\n```" - ], - "signature": "let isExtensible: 'a => bool" - }, - { - "id": "Stdlib.Object.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(object)` ignores the provided object and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: {..} => unit" - } - ] - }, - "stdlib/nullable": { - "id": "Stdlib.Nullable", - "name": "Nullable", - "docstrings": [ - "Functions for handling nullable values.\n\nPrimarily useful when interoping with JavaScript when you don't know whether you'll get a value, `null` or `undefined`." - ], - "items": [ - { - "id": "Stdlib.Nullable.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing a nullable value.\nA nullable value can be the value `'a`, `null` or `undefined`." - ], - "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined" - }, - { - "id": "Stdlib.Nullable.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The value `null`.\n\nSee [`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null) on MDN.\n\n## Examples\n```rescript\nConsole.log(Nullable.null) // Logs `null` to the console.\n```" - ], - "signature": "let null: t<'a>" - }, - { - "id": "Stdlib.Nullable.undefined", - "kind": "value", - "name": "undefined", - "docstrings": [ - "The value `undefined`.\n\nSee [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/undefined) on MDN.\n\n## Examples\n```rescript\nConsole.log(undefined) // Logs `undefined` to the console.\n```" - ], - "signature": "let undefined: t<'a>" - }, - { - "id": "Stdlib.Nullable.isNullable", - "kind": "value", - "name": "isNullable", - "docstrings": [ - "`isNullable(a)` returns `true` if `a` is null or undefined, `false` otherwise.\n\n## Examples\n\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Check if asNullable is not null or undefined\nswitch asNullable->Nullable.isNullable {\n| true => assert(false)\n| false => assert(true)\n}\n```" - ], - "signature": "let isNullable: t<'a> => bool" - }, - { - "id": "Stdlib.Nullable.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new nullable value from the provided value.\nThis means the compiler will enforce null checks for the new value.\n\n## Examples\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Need to do this\nswitch asNullable->Nullable.toOption {\n| Some(value) if value == myStr => Console.log(\"Yay, values matched!\")\n| _ => Console.log(\"Values did not match.\")\n}\n```" - ], - "signature": "let make: 'a => t<'a>" - }, - { - "id": "Stdlib.Nullable.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.Nullable.compare", - "kind": "value", - "name": "compare", - "docstrings": [], - "signature": "let compare: (t<'a>, t<'b>, ('a, 'b) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.Nullable.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Converts a nullable value into an option, so it can be pattern matched on.\nWill convert both `null` and `undefined` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullableString = Nullable.make(\"Hello\")\n\nswitch nullableString->Nullable.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```" - ], - "signature": "let toOption: t<'a> => option<'a>" - }, - { - "id": "Stdlib.Nullable.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Turns an `option` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet optString = Some(\"Hello\")\nlet asNullable = optString->Nullable.fromOption // Nullable.t\n```" - ], - "signature": "let fromOption: option<'a> => t<'a>" - }, - { - "id": "Stdlib.Nullable.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(value, default)` returns `value` if not `null` or `undefined`,\notherwise return `default`.\n\n## Examples\n\n```rescript\nNullable.getOr(Nullable.null, \"Banana\") // Banana\nNullable.getOr(Nullable.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNullable.make(\"Jane\")->Nullable.toOption->greet // \"Greetings Jane\"\nNullable.null->Nullable.toOption->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (t<'a>, 'a) => 'a" - }, - { - "id": "Stdlib.Nullable.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Nullable.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getExn(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getExn(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`" - ], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Nullable.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getOrThrow(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getOrThrow(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`" - ], - "signature": "let getOrThrow: t<'a> => 'a" - }, - { - "id": "Stdlib.Nullable.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNullable.getUnsafe(Nullable.make(3)) == 3\nNullable.getUnsafe(Nullable.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null` or `undefined`." - ], - "signature": "let getUnsafe: t<'a> => 'a" - }, - { - "id": "Stdlib.Nullable.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(value, f)` call `f` on `value`. if `value` is not `null` or `undefined`,\nthen if calls `f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNullable.forEach(Nullable.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNullable.forEach(Nullable.null, x => Console.log(x)) // returns ()\nNullable.forEach(undefined, x => Console.log(x)) // returns ()\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Nullable.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nNullable.map(Nullable.make(3), x => x * x) // Nullable.make(9)\nNullable.map(undefined, x => x * x) // undefined\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Nullable.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`\nor `undefined`, otherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Nullable.make(3)\nsomeValue->Nullable.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Nullable.null\nnoneValue->Nullable.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (t<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Nullable.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (t<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Nullable.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Nullable.make(value + 1)\n } else {\n Nullable.null\n }\n\nNullable.flatMap(Nullable.make(2), addIfAboveOne) // Nullable.make(3)\nNullable.flatMap(Nullable.make(-4), addIfAboveOne) // undefined\nNullable.flatMap(Nullable.null, addIfAboveOne) // undefined\n```" - ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Nullable.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(nullable)` ignores the provided nullable and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/null": { - "id": "Stdlib.Null", - "name": "Null", - "docstrings": [ - "Functions for handling values that could be `null`.\n\nIf you also need to cover `undefined`, check out `Nullable` instead." - ], - "items": [ - { - "id": "Stdlib.Null.t", - "kind": "type", - "name": "t", - "docstrings": [ - "A type representing a value that can be either `'a` or `null`." - ], - "signature": "@unboxed\ntype t<'a> = null<'a> =\n | Value('a)\n | @as(null) Null" - }, - { - "id": "Stdlib.Null.asNullable", - "kind": "value", - "name": "asNullable", - "docstrings": [ - "Converts a `Null.t` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet nullValue = Null.make(\"Hello\")\nlet asNullable = nullValue->Null.asNullable // Nullable.t\n```" - ], - "signature": "let asNullable: t<'a> => Nullable.t<'a>" - }, - { - "id": "Stdlib.Null.null", - "kind": "value", - "name": "null", - "docstrings": [ - "The value `null`.\n\nSee [`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null) on MDN.\n\n## Examples\n```rescript\nConsole.log(null) // Logs `null` to the console.\n```" - ], - "signature": "let null: t<'a>" - }, - { - "id": "Stdlib.Null.make", - "kind": "value", - "name": "make", - "docstrings": [ - "Creates a new `Null.t` from the provided value.\nThis means the compiler will enforce null checks for the new value.\n\n## Examples\n```rescript\nlet myStr = \"Hello\"\nlet asNullValue = myStr->Null.make // The compiler now thinks this can be `string` or `null`.\n```" - ], - "signature": "let make: 'a => t<'a>" - }, - { - "id": "Stdlib.Null.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(a, b, eq)` checks if `a` and `b` are equal.\nIf both are `Null.Value`, it will use function `eq` to check if the values are equal.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\nNull.equal(a, b, Int.equal) == false\nNull.equal(a, c, Int.equal) == false\nNull.equal(Null.null, Null.null, Int.equal) == true\n```" - ], - "signature": "let equal: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.Null.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(a, b, cmp)` compares `a` and `b`.\nIf both are `Null.Value`, it will use function `cmp` to compare the values.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\n// A value is greater than null\nNull.compare(a, b, Int.compare) == Ordering.greater\n// A value is less than null\nNull.compare(b, a, Int.compare) == Ordering.less\n// A null is equal to null\nNull.compare(Null.null, Null.null, Int.compare) == Ordering.equal\n// The compare function is used if both are `Null.Value`\nNull.compare(a, c, Int.compare) == Ordering.less\n```" - ], - "signature": "let compare: (t<'a>, t<'b>, ('a, 'b) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.Null.toOption", - "kind": "value", - "name": "toOption", - "docstrings": [ - "Converts a nullable value into an option, so it can be pattern matched on.\nWill convert `null` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullStr = Null.make(\"Hello\")\n\nswitch nullStr->Null.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```" - ], - "signature": "let toOption: t<'a> => option<'a>" - }, - { - "id": "Stdlib.Null.fromOption", - "kind": "value", - "name": "fromOption", - "docstrings": [ - "Turns an `option` into a `Null.t`. `None` will be converted to `null`.\n\n## Examples\n```rescript\nlet optString: option = None\nlet asNull = optString->Null.fromOption // Null.t\nConsole.log(asNull == Null.null) // Logs `true` to the console.\n```" - ], - "signature": "let fromOption: option<'a> => t<'a>" - }, - { - "id": "Stdlib.Null.getOr", - "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(value, default)` returns `value` if not `null`, otherwise return\n`default`.\n\n## Examples\n\n```rescript\nNull.getOr(Null.null, \"Banana\") // Banana\nNull.getOr(Null.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNull.make(\"Jane\")->Null.toOption->greet // \"Greetings Jane\"\nNull.null->Null.toOption->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (t<'a>, 'a) => 'a" - }, - { - "id": "Stdlib.Null.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, 'a) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Null.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getExn(Null.make(3)) == 3\n\nswitch Null.getExn(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`" - ], - "signature": "let getExn: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Null.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getOrThrow(Null.make(3)) == 3\n\nswitch Null.getOrThrow(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`" - ], - "signature": "let getOrThrow: t<'a> => 'a" - }, - { - "id": "Stdlib.Null.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNull.getUnsafe(Null.make(3)) == 3\nNull.getUnsafe(Null.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null`." - ], - "signature": "let getUnsafe: t<'a> => 'a" - }, - { - "id": "Stdlib.Null.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(value, f)` call `f` on `value`. if `value` is not `null`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNull.forEach(Null.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNull.forEach(Null.null, x => Console.log(x)) // logs nothing\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Null.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(value, f)` returns `f(value)` if `value` is not `null`, otherwise returns\n`value` unchanged.\n\n## Examples\n\n```rescript\nNull.map(Null.make(3), x => x * x) // Null.make(9)\nNull.map(Null.null, x => x * x) // null\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" - }, - { - "id": "Stdlib.Null.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`,\notherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Null.make(3)\nsomeValue->Null.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Null.null\nnoneValue->Null.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (t<'a>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Stdlib.Null.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (t<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "" - }, - { - "id": "Stdlib.Null.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(value, f)` returns `f(value)` if `value` is not `null`, otherwise\nreturns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Null.make(value + 1)\n } else {\n Null.null\n }\n\nNull.flatMap(Null.make(2), addIfAboveOne) // Null.make(3)\nNull.flatMap(Null.make(-4), addIfAboveOne) // null\nNull.flatMap(Null.null, addIfAboveOne) // null\n```" - ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - }, - { - "id": "Stdlib.Null.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(null)` ignores the provided null and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t<'a> => unit" - } - ] - }, - "stdlib/math": { - "id": "Stdlib.Math", - "name": "Math", - "docstrings": [ - "Functions for interacting with JavaScript Math.\nSee: [`Math`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math)." - ], - "items": [ - { - "id": "Stdlib.Math.abs", - "kind": "value", - "name": "abs", - "docstrings": [ - "`abs(v)` returns absolute value of `v`.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n## Examples\n\n```rescript\nMath.abs(-2.0) == 2.0\nMath.abs(3.0) == 3.0\n```" - ], - "signature": "let abs: float => float" - }, - { - "id": "Stdlib.Math.acos", - "kind": "value", - "name": "acos", - "docstrings": [ - "`acos(v)` returns arccosine (in radians) of argument `v`, returns `NaN` if the\nargument is outside the range \\[-1.0, 1.0\\].\nSee [`Math.acos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acos) on MDN.\n\n## Examples\n\n```rescript\nMath.acos(-1.0) == 3.141592653589793\nMath.acos(-3.0)->Float.isNaN == true\n```" - ], - "signature": "let acos: float => float" - }, - { - "id": "Stdlib.Math.acosh", - "kind": "value", - "name": "acosh", - "docstrings": [ - "`acosh(v)` returns the inverse hyperbolic arccosine (in radians) of argument `v`,\nreturns `NaN` if the argument is less than `1.0`.\nSee [`Math.acosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acosh) on MDN.\n\n## Examples\n\n```rescript\nMath.acosh(1.0) == 0.0\nMath.acosh(0.5)->Float.isNaN == true\n```" - ], - "signature": "let acosh: float => float" - }, - { - "id": "Stdlib.Math.asin", - "kind": "value", - "name": "asin", - "docstrings": [ - "`asin(v)` returns the inverse sine (in radians) of argument `v`, returns `NaN`\nif the argument `v` is outside the range \\[-1.0, 1.0\\].\nSee [`Math.asin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asin) on MDN.\n\n## Examples\n\n```rescript\nMath.asin(-1.0) == -1.5707963267948966\nMath.asin(-2.0)->Float.isNaN == true\n```" - ], - "signature": "let asin: float => float" - }, - { - "id": "Stdlib.Math.asinh", - "kind": "value", - "name": "asinh", - "docstrings": [ - "`asinh(v)` returns the inverse hyperbolic sine of argument `v`.\nSee [`Math.asinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh) on MDN.\n\n## Examples\n\n```rescript\nMath.asinh(-1.0) == -0.881373587019543\nMath.asinh(-0.0) == -0.0\n```" - ], - "signature": "let asinh: float => float" - }, - { - "id": "Stdlib.Math.atan", - "kind": "value", - "name": "atan", - "docstrings": [ - "`atan(v)` returns the inverse tangent (in radians) of argument `v`.\nSee [`Math.atan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan) on MDN.\n\n## Examples\n\n```rescript\nMath.atan(-0.0) == -0.0\nMath.atan(0.0) == 0.0\nMath.atan(1.0) == 0.7853981633974483\n```" - ], - "signature": "let atan: float => float" - }, - { - "id": "Stdlib.Math.atanh", - "kind": "value", - "name": "atanh", - "docstrings": [ - "`atanh(v)` returns the invert hyperbolic tangent of argument `v`. Returns `NaN`\nif the argument `v` is is outside the range \\[-1.0, 1.0\\] and `Infinity` if `v`\nis `-1.0` or `1.0`.\nSee [`Math.atanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh) on MDN.\n\n## Examples\n\n```rescript\nMath.atanh(-2.0)->Float.isNaN == true\nMath.atanh(-1.0)->Float.isFinite == false\nMath.atanh(-0.0) == -0.0\nMath.atanh(0.0) == 0.0\nMath.atanh(0.5) == 0.5493061443340548\n```" - ], - "signature": "let atanh: float => float" - }, - { - "id": "Stdlib.Math.atan2", - "kind": "value", - "name": "atan2", - "docstrings": [ - "`atan2(~y, ~x)` returns the angle (in radians) of the quotient `y /. x`. It is\nalso the angle between the *x*\\-axis and point (*x*, *y*).\nSee [`Math.atan2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2) on MDN.\n\n## Examples\n\n```rescript\nMath.atan2(~y=0.0, ~x=10.0) == 0.0\nMath.atan2(~x=5.0, ~y=5.0) == Math.Constants.pi /. 4.0\nMath.atan2(~x=90.0, ~y=15.0) == 0.16514867741462683\nMath.atan2(~x=15.0, ~y=90.0) == 1.4056476493802699\n```" - ], - "signature": "let atan2: (~y: float, ~x: float) => float" - }, - { - "id": "Stdlib.Math.cbrt", - "kind": "value", - "name": "cbrt", - "docstrings": [ - "`cbrt(v)` returns the cube root of argument `v`.\nSee [`Math.cbrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt) on MDN.\n\n## Examples\n\n```rescript\nMath.cbrt(-1.0) == -1.0\nMath.cbrt(-0.0) == -0.0\nMath.cbrt(0.0) == 0.0\n```" - ], - "signature": "let cbrt: float => float" - }, - { - "id": "Stdlib.Math.ceil", - "kind": "value", - "name": "ceil", - "docstrings": [ - "`ceil(v)` returns the smallest integral value greater than or equal to the\nargument `v`. The result is a `float` and is not restricted to the `int` data\ntype range.\nSee [`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil) on MDN.\n\n## Examples\n\n```rescript\nMath.ceil(3.1) == 4.0\nMath.ceil(3.0) == 3.0\nMath.ceil(-3.1) == -3.0\nMath.ceil(2_150_000_000.3) == 2_150_000_001.0\n```" - ], - "signature": "let ceil: float => float" - }, - { - "id": "Stdlib.Math.cos", - "kind": "value", - "name": "cos", - "docstrings": [ - "`cos(v)` returns the cosine of argument `v`, which must be specified in radians.\nSee [`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos) on MDN.\n\n## Examples\n\n```rescript\nMath.cos(-0.0) == 1.0\nMath.cos(0.0) == 1.0\nMath.cos(1.0) == 0.5403023058681398\n```" - ], - "signature": "let cos: float => float" - }, - { - "id": "Stdlib.Math.cosh", - "kind": "value", - "name": "cosh", - "docstrings": [ - "`cosh(v)` returns the hyperbolic cosine of argument `v`, which must be specified\nin radians.\nSee [`Math.cosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh) on MDN.\n\n## Examples\n\n```rescript\nMath.cosh(-1.0) == 1.5430806348152437\nMath.cosh(-0.0) == 1.0\nMath.cosh(0.0) == 1.0\n```" - ], - "signature": "let cosh: float => float" - }, - { - "id": "Stdlib.Math.exp", - "kind": "value", - "name": "exp", - "docstrings": [ - "`exp(v)` returns natural exponentional, returns *e* (the base of natural logarithms)\nto the power of the given argument `v`.\nSee [`Math.exp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/exp) on MDN.\n\n## Examples\n\n```rescript\nMath.exp(-1.0) == 0.36787944117144233\nMath.exp(0.0) == 1.0\n```" - ], - "signature": "let exp: float => float" - }, - { - "id": "Stdlib.Math.expm1", - "kind": "value", - "name": "expm1", - "docstrings": [ - "`expm1(v)` returns *e* (the base of natural logarithms) to the power of the given\nargument `v` minus 1.\nSee [`Math.expm1`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1) on MDN.\n\n## Examples\n\n```rescript\nMath.expm1(-1.0) == -0.6321205588285577\nMath.expm1(-0.0) == -0.0\n```" - ], - "signature": "let expm1: float => float" - }, - { - "id": "Stdlib.Math.floor", - "kind": "value", - "name": "floor", - "docstrings": [ - "`floor(v)` returns the largest integral value less than or equal to the argument\n`v`. The result is a `float` and is not restricted to the `int` data type range.\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor) on MDN.\n\n## Examples\n\n```rescript\nMath.floor(-45.95) == -46.0\nMath.floor(-45.05) == -46.0\nMath.floor(-0.0) == -0.0\n```" - ], - "signature": "let floor: float => float" - }, - { - "id": "Stdlib.Math.fround", - "kind": "value", - "name": "fround", - "docstrings": [ - "`fround(v)` returns the nearest single precision float.\nSee [`Math.fround`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround) on MDN.\n\n## Examples\n\n```rescript\nMath.fround(5.5) == 5.5\nMath.fround(5.05) == 5.050000190734863\n```" - ], - "signature": "let fround: float => float" - }, - { - "id": "Stdlib.Math.hypot", - "kind": "value", - "name": "hypot", - "docstrings": [ - "`hypot(a, b)` returns the square root of the sum of squares of its two arguments\n(the Pythagorean formula).\nSee [`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot) on MDN.\n\n## Examples\n\n```rescript\nMath.hypot(3.0, 4.0) == 5.0\nMath.hypot(3.0, 5.0) == 5.8309518948453\n```" - ], - "signature": "let hypot: (float, float) => float" - }, - { - "id": "Stdlib.Math.hypotMany", - "kind": "value", - "name": "hypotMany", - "docstrings": [ - "`hypotMany(arr)` returns the square root of the sum of squares of the numbers in\nthe array argument (generalized Pythagorean equation). Using an array allows you\nto have more than two items. If `arr` is an empty array then returns `0.0`.\nSee [`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot) on MDN.\n\n## Examples\n\n```rescript\nMath.hypotMany([3.0, 4.0, 5.0]) == 7.0710678118654755\nMath.hypotMany([]) == 0.0\n```" - ], - "signature": "let hypotMany: array => float" - }, - { - "id": "Stdlib.Math.log", - "kind": "value", - "name": "log", - "docstrings": [ - "`log(v)` returns the natural logarithm of argument `v`, this is the number *x*\nsuch that `e^x` equals the argument. Returns `NaN` for negative arguments and\n`Infinity` for `0.0` or `-0.0`.\nSee [`Math.log`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log) on MDN.\n\n## Examples\n\n```rescript\nMath.log(-1.0)->Float.isNaN == true\nMath.log(-0.0)->Float.isFinite == false\nMath.log(0.0)->Float.isFinite == false\nMath.log(1.0) == 0.0\n```" - ], - "signature": "let log: float => float" - }, - { - "id": "Stdlib.Math.log1p", - "kind": "value", - "name": "log1p", - "docstrings": [ - "`log1p(v)` returns the natural logarithm of one plus the argument `v`.\nReturns `NaN` for arguments less than `-1` and `Infinity` if `v` is `-1.0`.\nSee [`Math.log1p`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log1p) on MDN.\n\n## Examples\n\n```rescript\nMath.log1p(-2.0)->Float.isNaN == true\nMath.log1p(-1.0)->Float.isFinite == false\nMath.log1p(-0.0) == -0.0\n```" - ], - "signature": "let log1p: float => float" - }, - { - "id": "Stdlib.Math.log10", - "kind": "value", - "name": "log10", - "docstrings": [ - "`log10(v)` returns the base 10 logarithm of argument `v`. Returns `NaN` for\nnegative `v`. If `v` is `-0.0` or `0.0` returns `Infinity`.\nSee [`Math.log10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log10) on MDN.\n\n## Examples\n\n```rescript\nMath.log10(-2.0)->Float.isNaN == true\nMath.log10(-0.0)->Float.isFinite == false\nMath.log10(0.0)->Float.isFinite == false\nMath.log10(1.0) == 0.0\n```" - ], - "signature": "let log10: float => float" - }, - { - "id": "Stdlib.Math.log2", - "kind": "value", - "name": "log2", - "docstrings": [ - "`log2(v)` returns the base 2 logarithm of argument `v`. Returns `NaN` for\nnegative `v` and `Infinity` if `v` is `-0.0` or `0.0`.\nSee [`Math.log2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2) on MDN.\n\n## Examples\n\n```rescript\nMath.log2(-2.0)->Float.isNaN == true\nMath.log2(-0.0)->Float.isFinite == false\nMath.log2(0.0)->Float.isFinite == false\nMath.log2(1.0) == 0.0\n```" - ], - "signature": "let log2: float => float" - }, - { - "id": "Stdlib.Math.min", - "kind": "value", - "name": "min", - "docstrings": [ - "`min(a, b)` returns the minimum of its two float arguments.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n## Examples\n\n```rescript\nMath.min(1.0, 2.0) == 1.0\nMath.min(-1.0, -2.0) == -2.0\n```" - ], - "signature": "let min: (float, float) => float" - }, - { - "id": "Stdlib.Math.minMany", - "kind": "value", - "name": "minMany", - "docstrings": [ - "`minMany(arr)` returns the minimum of the float in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n## Examples\n\n```rescript\nMath.minMany([1.0, 2.0]) == 1.0\nMath.minMany([-1.0, -2.0]) == -2.0\nMath.minMany([])->Float.isFinite == false\n```" - ], - "signature": "let minMany: array => float" - }, - { - "id": "Stdlib.Math.max", - "kind": "value", - "name": "max", - "docstrings": [ - "`max(a, b)` returns the maximum of its two float arguments.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n## Examples\n\n```rescript\nMath.max(1.0, 2.0) == 2.0\nMath.max(-1.0, -2.0) == -1.0\n```" - ], - "signature": "let max: (float, float) => float" - }, - { - "id": "Stdlib.Math.maxMany", - "kind": "value", - "name": "maxMany", - "docstrings": [ - "`maxMany(arr)` returns the maximum of the float in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n## Examples\n\n```rescript\nMath.maxMany([1.0, 2.0]) == 2.0\nMath.maxMany([-1.0, -2.0]) == -1.0\nMath.maxMany([])->Float.isFinite == false\n```" - ], - "signature": "let maxMany: array => float" - }, - { - "id": "Stdlib.Math.pow", - "kind": "value", - "name": "pow", - "docstrings": [ - "`pow(a, ~exp)` throws the given base `a` to the given exponent `exp`.\nSee [`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow) on MDN.\n\n## Examples\n\n```rescript\nMath.pow(2.0, ~exp=4.0) == 16.0\nMath.pow(3.0, ~exp=4.0) == 81.0\n```" - ], - "signature": "let pow: (float, ~exp: float) => float" - }, - { - "id": "Stdlib.Math.random", - "kind": "value", - "name": "random", - "docstrings": [ - "`random()` returns a random number in the half-closed interval \\[0,1\\].\nSee [`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random) on MDN.\n\n## Examples\n\n```rescript\nMath.random()\n```" - ], - "signature": "let random: unit => float" - }, - { - "id": "Stdlib.Math.round", - "kind": "value", - "name": "round", - "docstrings": [ - "`round(v)` returns then value of `v` rounded to nearest integral value\n(expressed as a float). If the fractional portion of the argument `v` is greater\nthan `0.5`, the argument `v` is rounded to the float with the next higher\nabsolute value.\nSee [`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round) on MDN.\n\n## Examples\n\n```rescript\nMath.round(-20.5) == -20.0\nMath.round(-0.1) == -0.0\nMath.round(0.0) == 0.0\nMath.round(-0.0) == -0.0\n```" - ], - "signature": "let round: float => float" - }, - { - "id": "Stdlib.Math.sign", - "kind": "value", - "name": "sign", - "docstrings": [ - "`sign(v)` returns the sign of its foat argument: `-1` if negative, `0` if\nzero, `1` if positive.\nSee [`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign) on MDN.\n\n## Examples\n\n```rescript\nMath.sign(3.0) == 1.0\nMath.sign(-3.0) == -1.0\nMath.sign(0.0) == 0.0\n```" - ], - "signature": "let sign: float => float" - }, - { - "id": "Stdlib.Math.sin", - "kind": "value", - "name": "sin", - "docstrings": [ - "`sin(v)` returns the sine of argument `v`, which must be specified in radians.\nSee [`Math.sin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin) on MDN.\n\n## Examples\n\n```rescript\nMath.sin(-0.0) == -0.0\nMath.sin(0.0) == 0.0\nMath.sin(1.0) == 0.8414709848078965\n```" - ], - "signature": "let sin: float => float" - }, - { - "id": "Stdlib.Math.sinh", - "kind": "value", - "name": "sinh", - "docstrings": [ - "`sinh(v)` returns then hyperbolic sine of argument `v`, which must be specified\nin radians.\nSee [`Math.sinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sinh) on MDN.\n\n## Examples\n\n```rescript\nMath.sinh(-0.0) == -0.0\nMath.sinh(0.0) == 0.0\nMath.sinh(1.0) == 1.1752011936438014\n```" - ], - "signature": "let sinh: float => float" - }, - { - "id": "Stdlib.Math.sqrt", - "kind": "value", - "name": "sqrt", - "docstrings": [ - "`sqrt(v)` returns the square root of `v`. If `v` is negative returns `NaN`.\nSee [`Math.sqrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt) on MDN.\n\n## Examples\n\n```rescript\nMath.sqrt(-1.0)->Float.isNaN == true\nMath.sqrt(-0.0) == -0.0\nMath.sqrt(0.0) == 0.0\nMath.sqrt(1.0) == 1.0\nMath.sqrt(9.0) == 3.0\n```" - ], - "signature": "let sqrt: float => float" - }, - { - "id": "Stdlib.Math.tan", - "kind": "value", - "name": "tan", - "docstrings": [ - "`tan(v)` returns the tangent of argument `v`, which must be specified in\nradians. Returns `NaN` if `v` is positive `Infinity` or negative `Infinity`.\nSee [`Math.tan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tan) on MDN.\n\n## Examples\n\n```rescript\nMath.tan(-0.0) == -0.0\nMath.tan(0.0) == 0.0\nMath.tan(1.0) == 1.5574077246549023\n```" - ], - "signature": "let tan: float => float" - }, - { - "id": "Stdlib.Math.tanh", - "kind": "value", - "name": "tanh", - "docstrings": [ - "`tanh(v)` returns the hyperbolic tangent of argument `v`, which must be\nspecified in radians.\nSee [`Math.tanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tanh) on MDN.\n\n## Examples\n\n```rescript\nMath.tanh(-0.0) == -0.0\nMath.tanh(0.0) == 0.0\nMath.tanh(1.0) == 0.7615941559557649\n```" - ], - "signature": "let tanh: float => float" - }, - { - "id": "Stdlib.Math.trunc", - "kind": "value", - "name": "trunc", - "docstrings": [ - "`trunc(v)` truncates the argument `v`, i.e., removes fractional digits.\nSee [`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc) on MDN.\n\n## Examples\n\n```rescript\nMath.trunc(0.123) == 0.0\nMath.trunc(1.999) == 1.0\nMath.trunc(13.37) == 13.0\nMath.trunc(42.84) == 42.0\n```" - ], - "signature": "let trunc: float => float" - } - ] - }, - "stdlib/list": { - "id": "Stdlib.List", - "name": "List", - "docstrings": [], - "items": [ - { - "id": "Stdlib.List.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Collection functions for manipulating the `list` data structures, a singly-linked list.\n\n**Prefer Array** if you need any of the following:\n\n- Random access of element\n- Better interop with JavaScript\n- Better memory usage & performance." - ], - "signature": "type t<'a> = list<'a>" - }, - { - "id": "Stdlib.List.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(list)` returns the length of `list`.\n\n## Examples\n\n```rescript\nList.length(list{1, 2, 3}) == 3\n```" - ], - "signature": "let length: list<'a> => int" - }, - { - "id": "Stdlib.List.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(list)`. See [`length`](#length)\n\n## Examples\n\n```rescript\nList.size(list{1, 2, 3}) == 3\n```" - ], - "signature": "let size: list<'a> => int" - }, - { - "id": "Stdlib.List.head", - "kind": "value", - "name": "head", - "docstrings": [ - "`head(list)` returns `Some(value)` where `value` is the first element in the\nlist, or `None` if `list` is an empty list.\n\n## Examples\n\n```rescript\nList.head(list{}) == None\nList.head(list{1, 2, 3}) == Some(1)\n```" - ], - "signature": "let head: list<'a> => option<'a>" - }, - { - "id": "Stdlib.List.headExn", - "kind": "value", - "name": "headExn", - "docstrings": [ - "`headExn(list)` same as [`head`](#head).\n\n## Examples\n\n```rescript\nList.headExn(list{1, 2, 3}) == 1\n\nswitch List.headExn(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let headExn: list<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.List.headOrThrow", - "kind": "value", - "name": "headOrThrow", - "docstrings": [ - "`headOrThrow(list)` same as [`head`](#head).\n\n## Examples\n\n```rescript\nList.headOrThrow(list{1, 2, 3}) == 1\n\nswitch List.headOrThrow(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let headOrThrow: list<'a> => 'a" - }, - { - "id": "Stdlib.List.tail", - "kind": "value", - "name": "tail", - "docstrings": [ - "`tail(list)` returns `None` if `list` is empty, otherwise it returns `Some(tail)`\nwhere `tail` is everything except the first element of `list`.\n\n## Examples\n\n```rescript\nList.tail(list{1, 2, 3}) == Some(list{2, 3})\n\nList.tail(list{}) == None\n```" - ], - "signature": "let tail: list<'a> => option>" - }, - { - "id": "Stdlib.List.tailExn", - "kind": "value", - "name": "tailExn", - "docstrings": [ - "`tailExn(list)` same as [`tail`](#tail).\n\n## Examples\n\n```rescript\nList.tailExn(list{1, 2, 3}) == list{2, 3}\n\nswitch List.tailExn(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let tailExn: list<'a> => list<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.List.tailOrThrow", - "kind": "value", - "name": "tailOrThrow", - "docstrings": [ - "`tailOrThrow(list)` same as [`tail`](#tail).\n\n## Examples\n\n```rescript\nList.tailOrThrow(list{1, 2, 3}) == list{2, 3}\n\nswitch List.tailOrThrow(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if list is empty." - ], - "signature": "let tailOrThrow: list<'a> => list<'a>" - }, - { - "id": "Stdlib.List.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(list, value)` adds a `value` to the beginning of list `list`.\n\n## Examples\n\n```rescript\nList.add(list{2, 3}, 1) == list{1, 2, 3}\n\nList.add(list{\"World\", \"!\"}, \"Hello\") == list{\"Hello\", \"World\", \"!\"}\n```" - ], - "signature": "let add: (list<'a>, 'a) => list<'a>" - }, - { - "id": "Stdlib.List.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(list, index)` return the `index` element in `list`, or `None` if `index`\nis larger than the length of list `list`.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.get(1) == Some(\"B\")\n\nabc->List.get(4) == None\n```" - ], - "signature": "let get: (list<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.List.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(list, index)` same as [`get`](#get).\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.getExn(1) == \"B\"\n\nswitch abc->List.getExn(4) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if `index` is larger than the length of list." - ], - "signature": "let getExn: (list<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.List.getOrThrow", - "kind": "value", - "name": "getOrThrow", - "docstrings": [ - "`getOrThrow(list, index)` same as [`get`](#get).\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.getOrThrow(1) == \"B\"\n\nswitch abc->List.getOrThrow(4) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws an Error if `index` is larger than the length of list." - ], - "signature": "let getOrThrow: (list<'a>, int) => 'a" - }, - { - "id": "Stdlib.List.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(length, value)` returns a list of length `length` with each element filled\nwith `value`. Returns an empty list if `value` is negative.\n\n## Examples\n\n```rescript\nList.make(~length=3, 1) == list{1, 1, 1}\n```" - ], - "signature": "let make: (~length: int, 'a) => list<'a>" - }, - { - "id": "Stdlib.List.fromInitializer", - "kind": "value", - "name": "fromInitializer", - "docstrings": [ - "`fromInitializer(length, f)` return a list of length `length` with element initialized\nwith `f`. Returns an empty list if `length` is negative.\n\n## Examples\n\n```rescript\nList.fromInitializer(~length=5, i => i) == list{0, 1, 2, 3, 4}\n\nList.fromInitializer(~length=5, i => i * i) == list{0, 1, 4, 9, 16}\n```" - ], - "signature": "let fromInitializer: (~length: int, int => 'a) => list<'a>" - }, - { - "id": "Stdlib.List.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "`shuffle(list)` returns a new list in random order.\n\n## Examples\n\n```rescript\nList.shuffle(list{1, 2, 3}) // list{2, 1, 3}\n```" - ], - "signature": "let shuffle: list<'a> => list<'a>" - }, - { - "id": "Stdlib.List.toShuffled", - "kind": "value", - "name": "toShuffled", - "docstrings": [ - "`toShuffled(list)` returns a new list in random order.\n\n## Examples\n\n```rescript\nList.toShuffled(list{1, 2, 3}) // list{2, 1, 3}\n```" - ], - "signature": "let toShuffled: list<'a> => list<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.List.drop", - "kind": "value", - "name": "drop", - "docstrings": [ - "`drop(list, value)` return a new list, dropping the first `value` element.\nReturns `None` if `list` has fewer than `value` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.drop(2) == Some(list{3})\n\nlist{1, 2, 3}->List.drop(3) == Some(list{})\n\nlist{1, 2, 3}->List.drop(4) == None\n```" - ], - "signature": "let drop: (list<'a>, int) => option>" - }, - { - "id": "Stdlib.List.take", - "kind": "value", - "name": "take", - "docstrings": [ - "`take(list, value)` returns a list with the first `value` elements from `list`,\nor `None` if `list` has fewer than `value` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.take(1) == Some(list{1})\n\nlist{1, 2, 3}->List.take(2) == Some(list{1, 2})\n\nlist{1, 2, 3}->List.take(4) == None\n```" - ], - "signature": "let take: (list<'a>, int) => option>" - }, - { - "id": "Stdlib.List.splitAt", - "kind": "value", - "name": "splitAt", - "docstrings": [ - "`splitAt(list, n)` split the list `list` at `n`. Returns `None` when the length\nof `list` is less than `n`.\n\n## Examples\n\n```rescript\nlist{\"Hello\", \"World\"}->List.splitAt(1) == Some((list{\"Hello\"}, list{\"World\"}))\n\nlist{0, 1, 2, 3, 4}->List.splitAt(2) == Some((list{0, 1}, list{2, 3, 4}))\n```" - ], - "signature": "let splitAt: (list<'a>, int) => option<(list<'a>, list<'a>)>" - }, - { - "id": "Stdlib.List.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(list1, list2)` returns the list obtained by adding `list2` after `list1`.\n\n## Examples\n\n```rescript\nList.concat(list{1, 2, 3}, list{4, 5}) == list{1, 2, 3, 4, 5}\n```" - ], - "signature": "let concat: (list<'a>, list<'a>) => list<'a>" - }, - { - "id": "Stdlib.List.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(arr)` returns the list obtained by concatenating all the lists in\narray `arr`, in order.\n\n## Examples\n\n```rescript\nList.concatMany([list{1, 2, 3}, list{}, list{3}]) == list{1, 2, 3, 3}\n```" - ], - "signature": "let concatMany: array> => list<'a>" - }, - { - "id": "Stdlib.List.reverseConcat", - "kind": "value", - "name": "reverseConcat", - "docstrings": [ - "`reverseConcat(list1, list2)` is equivalent to writing: `concat(reverse(list1, list2)`\n\n## Examples\n\n```rescript\nList.reverseConcat(list{1, 2}, list{3, 4}) == list{2, 1, 3, 4}\n```" - ], - "signature": "let reverseConcat: (list<'a>, list<'a>) => list<'a>" - }, - { - "id": "Stdlib.List.flat", - "kind": "value", - "name": "flat", - "docstrings": [ - "`flat(list)` return the list obtained by concatenating all the lists in\n`list`, in order.\n\n## Examples\n\n```rescript\nList.flat(list{list{1, 2, 3}, list{}, list{3}}) == list{1, 2, 3, 3}\n```" - ], - "signature": "let flat: list> => list<'a>" - }, - { - "id": "Stdlib.List.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nlist{1, 2}->List.map(x => x + 1) == list{2, 3}\n```" - ], - "signature": "let map: (list<'a>, 'a => 'b) => list<'b>" - }, - { - "id": "Stdlib.List.zip", - "kind": "value", - "name": "zip", - "docstrings": [ - "`zip(list1, list2)` returns a list of pairs from the two lists with the length\nof the shorter list.\n\n## Examples\n\n```rescript\nList.zip(list{1, 2}, list{3, 4, 5}) == list{(1, 3), (2, 4)}\n```" - ], - "signature": "let zip: (list<'a>, list<'b>) => list<('a, 'b)>" - }, - { - "id": "Stdlib.List.zipBy", - "kind": "value", - "name": "zipBy", - "docstrings": [ - "`zipBy(list1, list2, f)`. See [`zip`](#zip)\n\n## Examples\n\n```rescript\nList.zipBy(list{1, 2, 3}, list{4, 5}, (a, b) => 2 * a + b) == list{6, 9}\n```" - ], - "signature": "let zipBy: (list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>" - }, - { - "id": "Stdlib.List.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(list, f)` applies `f` to each element of `list`. Function `f`\ntakes two arguments: the index starting from 0 and the element from `list`, in\nthat order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.mapWithIndex((x, index) => index + x) == list{1, 3, 5}\n```" - ], - "signature": "let mapWithIndex: (list<'a>, ('a, int) => 'b) => list<'b>" - }, - { - "id": "Stdlib.List.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(arr)` converts the given array `arr` to a list.\n\n## Examples\n\n```rescript\nList.fromArray([1, 2, 3]) == list{1, 2, 3}\n```" - ], - "signature": "let fromArray: array<'a> => list<'a>" - }, - { - "id": "Stdlib.List.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(list)` converts the given list `list` to an array.\n\n## Examples\n\n```rescript\nList.toArray(list{1, 2, 3}) == [1, 2, 3]\n```" - ], - "signature": "let toArray: list<'a> => array<'a>" - }, - { - "id": "Stdlib.List.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(list)` returns a new list whose elements are those of `list` in\nreversed order.\n\n## Examples\n\n```rescript\nList.reverse(list{1, 2, 3}) == list{3, 2, 1}\n```" - ], - "signature": "let reverse: list<'a> => list<'a>" - }, - { - "id": "Stdlib.List.mapReverse", - "kind": "value", - "name": "mapReverse", - "docstrings": [ - "`mapReverse(list, f)` is equivalent to `map` function.\n\n## Examples\n\n```rescript\nlet f = x => x * x\nlet l = list{3, 4, 5}\n\nlet withMap = List.map(l, f)->List.reverse\nlet withMapReverse = l->List.mapReverse(f)\n\nConsole.log(withMap == withMapReverse) // true\n```" - ], - "signature": "let mapReverse: (list<'a>, 'a => 'b) => list<'b>" - }, - { - "id": "Stdlib.List.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(list, f)` call `f` on each element of `list` from the beginning to end.\n`f` returns `unit`, so no new array is created. Use `forEach` when you are primarily\nconcerned with repetitively creating side effects.\n\n## Examples\n\n```rescript\nList.forEach(list{\"a\", \"b\", \"c\"}, x => Console.log(\"Item: \" ++ x))\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\n```" - ], - "signature": "let forEach: (list<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.List.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(list, f, index)` call `f` on each element of `list` from beginning\nto end. Function `f` takes two arguments: the `index` starting from 0 and the\nelement from `list`. `f` returns `unit`.\n\n## Examples\n\n```rescript\nList.forEachWithIndex(list{\"a\", \"b\", \"c\"}, (x, index) => {\n Console.log(\"Item \" ++ Int.toString(index) ++ \" is \" ++ x)\n})\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\n```" - ], - "signature": "let forEachWithIndex: (list<'a>, ('a, int) => unit) => unit" - }, - { - "id": "Stdlib.List.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(list, initialValue, f)` applies `f` to each element of `list` from\nbeginning to end. Function `f` has two parameters: the item from the list and\nan \"accumulator\", which starts with a value of `initialValue`. `reduce` returns\nthe final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduce(0, (a, b) => a + b) == 10\n\n// same as\n\nlist{1, 2, 3, 4}->List.reduce(0, (acc, item) => acc + item) == 10\n```" - ], - "signature": "let reduce: (list<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.List.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(list, initialValue, f)` applies `f` to each element of `list`\nfrom beginning to end. Function `f` has three parameters: the item from the list\nand an \"accumulator\", which starts with a value of `initialValue` and the index\nof each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduceWithIndex(0, (acc, item, index) => acc + item + index) == 16\n```" - ], - "signature": "let reduceWithIndex: (list<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Stdlib.List.reduceReverse", - "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "`reduceReverse(list, initialValue, f)` works like `reduce`, except that\nfunction `f` is applied to each item of `list` from the last back to the first.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduceReverse(0, (a, b) => a + b) == 10\n\nlist{1, 2, 3, 4}->List.reduceReverse(10, (a, b) => a - b) == 0\n\nlist{1, 2, 3, 4}->List.reduceReverse(list{}, List.add) == list{1, 2, 3, 4}\n```" - ], - "signature": "let reduceReverse: (list<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.List.mapReverse2", - "kind": "value", - "name": "mapReverse2", - "docstrings": [ - "`mapReverse2(list1, list2, f)` is equivalent to `List.zipBy(list1, list2, f)->List.reverse`.\n\n## Examples\n\n```rescript\nList.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) == list{4, 2}\n```" - ], - "signature": "let mapReverse2: (list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>" - }, - { - "id": "Stdlib.List.forEach2", - "kind": "value", - "name": "forEach2", - "docstrings": [ - "`forEach2(list1, list2, f)` is similar to `forEach`, but accepts two lists and\nstops at the length of the shorter list.\n\n## Examples\n\n```rescript\nList.forEach2(list{\"Z\", \"Y\"}, list{\"A\", \"B\", \"C\"}, (x, y) => Console.log2(x, y))\n\n/*\n prints:\n \"Z\" \"A\"\n \"Y\" \"B\"\n*/\n```" - ], - "signature": "let forEach2: (list<'a>, list<'b>, ('a, 'b) => 'c) => unit" - }, - { - "id": "Stdlib.List.reduce2", - "kind": "value", - "name": "reduce2", - "docstrings": [ - "`reduce2(list1, list2, initialValue, f)` applies `f` to each element of `list1`\nand `list2` from beginning to end. Stops with the shorter list. Function `f` has\nthree parameters: an accumulator which starts with a value of `initialValue`, an\nitem from `l1`, and an item from `l2`. `reduce2` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nList.reduce2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduce2: (list<'b>, list<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a" - }, - { - "id": "Stdlib.List.reduceReverse2", - "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "`reduceReverse2(list1, list2, initialValue, f)` applies `f` to each element of\n`list1` and `list2`from end to beginning. Stops with the shorter list. Function\n`f` has three parameters: an accumulator which starts with a value of\n`initialValue`, an item from `l1`, and an item from `l2`. `reduce2` returns the\nfinal value of the accumulator.\n\n## Examples\n\n```rescript\nList.reduceReverse2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) ==\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduceReverse2: (list<'a>, list<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" - }, - { - "id": "Stdlib.List.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(list, f)` returns `true` if all elements in `list` satisfy `f`, where `f`\nis a predicate: a function taking an element and returning a bool.\n\n## Examples\n\n```rescript\nlet isBelow10 = value => value < 10\n\nlist{1, 9, 8, 2}->List.every(isBelow10) == true\n\nlist{1, 99, 8, 2}->List.every(isBelow10) == false\n```" - ], - "signature": "let every: (list<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.List.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(list, f)` returns `true` if at least _one_ of the elements in `list`\nsatisfies `f`, where `f` is a predicate: a function taking an element and\nreturning a bool.\n\n## Examples\n\n```rescript\nlet isAbove100 = value => value > 100\n\nlist{101, 1, 2, 3}->List.some(isAbove100) == true\n\nlist{1, 2, 3, 4}->List.some(isAbove100) == false\n```" - ], - "signature": "let some: (list<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.List.every2", - "kind": "value", - "name": "every2", - "docstrings": [ - "`every2(list1, list2, f)` returns `true` if predicate `f` is `true` for all\npairs of elements up to the shorter length (i.e. `min(length(list1), length(list2))`)\n\n## Examples\n\n```rescript\nList.every2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nList.every2(list{}, list{1}, (a, b) => a > b) == true\n\nList.every2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nList.every2(list{0, 1}, list{5, 0}, (a, b) => a > b) == false\n```" - ], - "signature": "let every2: (list<'a>, list<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.List.some2", - "kind": "value", - "name": "some2", - "docstrings": [ - "`some2(list1, list2, f)` returns `true` if predicate `f` is `true` for any pair\nof elements up to the shorter length (i.e. `min(length(list1), length(list2))`)\n\n## Examples\n\n```rescript\nList.some2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) == true\n\nList.some2(list{}, list{1}, (a, b) => a > b) == false\n\nList.some2(list{2, 3}, list{1}, (a, b) => a > b) == true\n\nList.some2(list{0, 1}, list{5, 0}, (a, b) => a > b) == true\n```" - ], - "signature": "let some2: (list<'a>, list<'b>, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.List.compareLength", - "kind": "value", - "name": "compareLength", - "docstrings": [ - "`compareLength(list1, list2)` compare two lists solely by length. Returns `-1.` if\n`length(list1)` is less than `length(list2)`, `0.` if `length(list1)` equals\n`length(list2)`, and `1.` if `length(list1)` is greater than `length(list2)`.\n\n## Examples\n\n```rescript\nList.compareLength(list{1, 2}, list{3, 4, 5, 6}) == -1.\n\nList.compareLength(list{1, 2, 3}, list{4, 5, 6}) == 0.\n\nList.compareLength(list{1, 2, 3, 4}, list{5, 6}) == 1.\n```" - ], - "signature": "let compareLength: (list<'a>, list<'a>) => Ordering.t" - }, - { - "id": "Stdlib.List.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(list1, list2, f)` compare elements one by one `f`. `f` returns a negative\nnumber if `list1` is \"less than\" `list2`, zero if `list1` is \"equal to\" `list2`,\na positive number if `list1` is \"greater than\" `list2`.\n\nThe comparison returns the first non-zero result of `f`, or zero if `f` returns\nzero for all `list1` and `list2`.\n\n- If all items have compared equal, but `list1` is exhausted first, return `-1.`. (`list1` is shorter).\n- If all items have compared equal, but `list2` is exhausted first, return `1.` (`list1` is longer).\n\n## Examples\n\n```rescript\nList.compare(list{3}, list{3, 7}, (a, b) => Int.compare(a, b)) == -1.\nList.compare(list{5, 3}, list{5}, (a, b) => Int.compare(a, b)) == 1.\nList.compare(list{1, 3, 5}, list{1, 4, 2}, (a, b) => Int.compare(a, b)) == -1.\nList.compare(list{1, 3, 5}, list{1, 2, 3}, (a, b) => Int.compare(a, b)) == 1.\nList.compare(list{1, 3, 5}, list{1, 3, 5}, (a, b) => Int.compare(a, b)) == 0.\n```\n\n**Please note:** The total ordering of List is different from Array,\nfor Array, we compare the length first and, only if the lengths are equal, elements one by one.\nFor lists, we just compare elements one by one." - ], - "signature": "let compare: (list<'a>, list<'a>, ('a, 'a) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.List.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(list1, list2, f)` check equality of `list2` and `list2` using `f` for\nequality on elements, where `f` is a function that returns `true` if items `x` and\n`y` meet some criterion for equality, `false` otherwise. equal `false` if length\nof `list1` and `list2` are not the same.\n\n## Examples\n\n```rescript\nList.equal(list{1, 2, 3}, list{1, 2}, (a, b) => a == b) == false\n\nList.equal(list{1, 2}, list{1, 2}, (a, b) => a == b) == true\n\nList.equal(list{1, 2, 3}, list{-1, -2, -3}, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let equal: (list<'a>, list<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Stdlib.List.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(list, element, f)` returns `true` if the list contains at least one\n`element` for which `f` returns \\`true'.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.has(2, (a, b) => a == b) == true\n\nlist{1, 2, 3}->List.has(4, (a, b) => a == b) == false\n\nlist{-1, -2, -3}->List.has(2, (a, b) => abs(a) == abs(b)) == true\n```" - ], - "signature": "let has: (list<'a>, 'b, ('a, 'b) => bool) => bool" - }, - { - "id": "Stdlib.List.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(list, f)` returns `Some(value)` for the first value in `list` that\nsatisfies the predicate function `f`. Returns `None` if no element satisfies\nthe function.\n\n## Examples\n\n```rescript\nList.find(list{1, 4, 3, 2}, x => x > 3) == Some(4)\n\nList.find(list{1, 4, 3, 2}, x => x > 4) == None\n```" - ], - "signature": "let find: (list<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.List.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(list, f)` returns a list of all elements in `list` which satisfy the\npredicate function `f`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nList.filter(list{1, 2, 3, 4}, isEven) == list{2, 4}\n\nList.filter(list{None, Some(2), Some(3), None}, Option.isSome) == list{Some(2), Some(3)}\n```" - ], - "signature": "let filter: (list<'a>, 'a => bool) => list<'a>" - }, - { - "id": "Stdlib.List.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(list, f)` returns a list of all elements in `list` which\nsatisfy the predicate function `f`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nList.filterWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) == list{1, 3}\n```" - ], - "signature": "let filterWithIndex: (list<'a>, ('a, int) => bool) => list<'a>" - }, - { - "id": "Stdlib.List.filterMap", - "kind": "value", - "name": "filterMap", - "docstrings": [ - "`filterMap(list, f)` applies `f` to each element of `list`. If `f` returns\n`Some(value)`, then `value` is _kept_ in the resulting list. If `f` returns\n`None`, the element is _not_ retained in the result.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nlist{1, 2, 3, 4}->List.filterMap(x =>\n if isEven(x) {\n Some(x)\n } else {\n None\n }\n) // list{2, 4}\n\nlist{Some(1), Some(2), None}->List.filterMap(x => x) == list{1, 2}\n```" - ], - "signature": "let filterMap: (list<'a>, 'a => option<'b>) => list<'b>" - }, - { - "id": "Stdlib.List.partition", - "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(list, f)` creates a pair of lists; the first list consists of all\nelements of `list` that satisfy the predicate function `f`, the second list\nconsists of all elements of `list` that _do not_ satisfy `f`.\n\n## Examples\n\n```rescript\n// (elementsThatSatisfies, elementsThatDoesNotSatisfy)\n\nList.partition(list{1, 2, 3, 4}, x => x > 2) == (list{3, 4}, list{1, 2})\n```" - ], - "signature": "let partition: (list<'a>, 'a => bool) => (list<'a>, list<'a>)" - }, - { - "id": "Stdlib.List.unzip", - "kind": "value", - "name": "unzip", - "docstrings": [ - "`unzip(list)` takes a list of pairs and creates a pair of lists. The first list\ncontains all the first items of the pairs, the second list contains all the\nsecond items.\n\n## Examples\n\n```rescript\nList.unzip(list{(1, 2), (3, 4)}) // (list{1, 3}, list{2, 4})\n\nList.unzip(list{(\"H\", \"W\"), (\"e\", \"o\"), (\"l\", \"r\"), (\"l\", \"l\"), (\"o\", \"d\"), (\" \", \"!\")}) ==\n (list{\"H\", \"e\", \"l\", \"l\", \"o\", \" \"}, list{\"W\", \"o\", \"r\", \"l\", \"d\", \"!\"})\n```" - ], - "signature": "let unzip: list<('a, 'b)> => (list<'a>, list<'b>)" - }, - { - "id": "Stdlib.List.getAssoc", - "kind": "value", - "name": "getAssoc", - "docstrings": [ - "`getAssoc(list, k, f)` return the second element of a pair in `list` where\nthe first element equals `k` as per the predicate function `f`, or `None` if\nnot found.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.getAssoc(3, (a, b) => a == b) // Some(\"c\")\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->List.getAssoc(15, (k, item) =>\n k /* 15 */ == item\n) == Some(\"afternoon\")\n/* 9, 5, 22 */\n```" - ], - "signature": "let getAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.hasAssoc", - "kind": "value", - "name": "hasAssoc", - "docstrings": [ - "`hasAssoc(list, k, f)` returns `true` if there is a pair in `list` where the\nfirst element equals `k` as per the predicate function `f`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.hasAssoc(1, (a, b) => a == b) // true\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->List.hasAssoc(25, (k, item) =>\n k /* 25 */ == item\n) == false\n/* 9, 5, 22 */\n```" - ], - "signature": "let hasAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => bool", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.removeAssoc", - "kind": "value", - "name": "removeAssoc", - "docstrings": [ - "`removeAssoc(list, k, f)` return a list after removing the first pair whose\nfirst value is `k` per the equality predicate `f`, if not found, return a new\nlist identical to `list`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.removeAssoc(1, (a, b) => a == b) // list{(2, \"b\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->List.removeAssoc(9, (k, item) =>\n k /* 9 */ == item\n) == list{(15, \"afternoon\"), (22, \"night\")}\n/* 9, 5, 22 */\n```" - ], - "signature": "let removeAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => list<('a, 'c)>", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.setAssoc", - "kind": "value", - "name": "setAssoc", - "docstrings": [ - "`setAssoc(list, k, v, f)`. If `k` exists in `list` by satisfying the `f`\npredicate, return a new list with the key and value replaced by the new `k` and\n`v`, otherwise, return a new list with the pair `k`, `v` added to the head of\n`list`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.setAssoc(2, \"x\", (a, b) => a == b) ==\n list{(1, \"a\"), (2, \"x\"), (3, \"c\")}\n\nlist{(1, \"a\"), (3, \"c\")}->List.setAssoc(2, \"b\", (a, b) => a == b) ==\n list{(2, \"b\"), (1, \"a\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (3, \"morning?!\"), (22, \"night\")}->List.setAssoc(15, \"afternoon\", (a, b) =>\n mod(a, 12) == mod(b, 12)\n) == list{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n```\n\n**Please note**: In the last example, since: `15 mod 12` equals `3 mod 12`. Both\nthe key _and_ the value are replaced in the list." - ], - "signature": "let setAssoc: (list<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => list<('a, 'c)>", - "deprecated": "Use a `Map` instead" - }, - { - "id": "Stdlib.List.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(list, f)` returns a sorted list.\n\n## Examples\n\n```rescript\nList.sort(list{5, 4, 9, 3, 7}, Int.compare) == list{3, 4, 5, 7, 9}\n```" - ], - "signature": "let sort: (list<'a>, ('a, 'a) => Ordering.t) => list<'a>" - }, - { - "id": "Stdlib.List.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(list)` ignores the provided list and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: list<'a> => unit" - } - ] - }, - "stdlib/lazy": { - "id": "Stdlib.Lazy", - "name": "Lazy", - "docstrings": [ - "This module provides a type `Lazy.t` and functions to create and\n manipulate lazy values. A lazy value is a value that is not\n computed until it is needed. This is useful for deferring\n computations that may be expensive or unnecessary." - ], - "items": [ - { - "id": "Stdlib.Lazy.t", - "kind": "type", - "name": "t", - "docstrings": [ - "The type of a lazy value. `Lazy.t<'a>` represents a lazy value\n that will eventually yield a value of type `'a` when accessed.\n The value is computed only once, and the result is cached for\n subsequent accesses. If the computation throws an exception,\n the same exception is thrown again on subsequent accesses." - ], - "signature": "type t<+'a>" - }, - { - "id": "Stdlib.Lazy.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`Lazy.make(f)` creates a lazy value from `f` which is the\n computation to be deferred of type `unit => 'a`. \n The function returns a lazy value of type `Lazy.t<'a>`. \n The computation is not executed until the lazy value is accessed.\n\n ## Examples \n ```rescript \n let lazyValue = Lazy.make(() => {\n // Some expensive computation\n Console.log(\"Computing...\")\n 42\n });\n lazyValue->Lazy.get->assertEqual(42)\n ```" - ], - "signature": "let make: (unit => 'a) => t<'a>" - }, - { - "id": "Stdlib.Lazy.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`Lazy.get(x)` forces the suspension `x` and returns its result.\n If `x` has already been forced, `Lazy.get(x)` returns the\n same value again without recomputing it. If it threw an\n exception, the same exception is thrown again.\n Throw `Undefined` if the forcing of `x` tries to force `x` itself\n recursively. This is a runtime error." - ], - "signature": "let get: t<'a> => 'a" - }, - { - "id": "Stdlib.Lazy.isEvaluated", - "kind": "value", - "name": "isEvaluated", - "docstrings": [ - "`Lazy.isEvaluated(x)` returns `true` if the suspension `x` has\n already been forced and did not throw an exception. Otherwise, \n it returns `false`. This is useful for checking if a lazy value\n has been computed before accessing it.\n\n ## Examples\n ```rescript \n let lazyValue = Lazy.make(() => {\n // Some expensive computation\n Console.log(\"Computing...\")\n 42\n })\n Lazy.isEvaluated(lazyValue)->assertEqual(false)\n lazyValue->Lazy.get->assertEqual(42)\n lazyValue->Lazy.isEvaluated->assertEqual(true)\n ```" - ], - "signature": "let isEvaluated: t<'a> => bool" - }, - { - "id": "Stdlib.Lazy.force", - "kind": "value", - "name": "force", - "docstrings": [ - "`force(x)` forces the suspension `x` and returns its result.\n If `x` has already been forced, `Lazy.force(x)` returns the\n same value again without recomputing it. If it threw an exception,\n the same exception is thrown again.\n Throw `Undefined` if the forcing of `x` tries to force `x` itself\n recursively." - ], - "signature": "let force: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.force_val", - "kind": "value", - "name": "force_val", - "docstrings": [ - "`force_val(x)` forces the suspension `x` and returns its\n result. If `x` has already been forced, `force_val(x)`\n returns the same value again without recomputing it.\n Throw `Undefined` if the forcing of `x` tries to force `x` itself\n recursively.\n If the computation of `x` throws an exception, it is unspecified\n whether `force_val(x)` throws the same exception or `Undefined`." - ], - "signature": "let force_val: t<'a> => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.from_fun", - "kind": "value", - "name": "from_fun", - "docstrings": [ - "`Lazy.from_fun(f)` creates a lazy value from `f` which is the\n computation to be deferred of type `unit => 'a`. \n The function returns a lazy value of type `Lazy.t<'a>`. \n The computation is not executed until the lazy value is accessed." - ], - "signature": "let from_fun: (unit => 'a) => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.from_val", - "kind": "value", - "name": "from_val", - "docstrings": [ - "`from_val(v)` returns an already-forced suspension of `v`.\n This is for special purposes only." - ], - "signature": "let from_val: 'a => t<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Lazy.is_val", - "kind": "value", - "name": "is_val", - "docstrings": [ - "`is_val(x)` returns `true` if `x has already been forced and\n did not throw an exception." - ], - "signature": "let is_val: t<'a> => bool", - "deprecated": "" - } - ] - }, - "stdlib/json": { - "id": "Stdlib.JSON", - "name": "JSON", - "docstrings": ["Functions for interacting with JSON."], - "items": [ - { - "id": "Stdlib.JSON.t", - "kind": "type", - "name": "t", - "docstrings": ["A type representing a JSON object."], - "signature": "@unboxed\ntype t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)" - }, - { - "id": "Stdlib.JSON.replacer", - "kind": "type", - "name": "replacer", - "docstrings": [], - "signature": "@unboxed\ntype replacer =\n | Keys(array)\n | Replacer((string, t) => t)" - }, - { - "id": "Stdlib.JSON.parseOrThrow", - "kind": "value", - "name": "parseOrThrow", - "docstrings": [ - "`parseOrThrow(string, ~reviver=?)`\n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\ntry {\n let _ = JSON.parseOrThrow(`{\"foo\":\"bar\",\"hello\":\"world\"}`)\n // { foo: 'bar', hello: 'world' }\n\n let _ = JSON.parseOrThrow(\"\")\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\ntry {\n JSON.parseOrThrow(jsonString, ~reviver)->Console.log\n // { hello: 'WORLD', someNumber: 42 }\n\n JSON.parseOrThrow(\"\", ~reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions\n\n- Throws a SyntaxError (Exn.t) if the string isn't valid JSON." - ], - "signature": "let parseOrThrow: (string, ~reviver: (string, t) => t=?) => t" - }, - { - "id": "Stdlib.JSON.parseExn", - "kind": "value", - "name": "parseExn", - "docstrings": [ - "`parseExn(string, ~reviver=?)`\n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\ntry {\n let _ = JSON.parseExn(`{\"foo\":\"bar\",\"hello\":\"world\"}`)\n // { foo: 'bar', hello: 'world' }\n\n let _ = JSON.parseExn(\"\")\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\ntry {\n JSON.parseExn(jsonString, ~reviver)->Console.log\n // { hello: 'WORLD', someNumber: 42 }\n\n JSON.parseExn(\"\", ~reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions\n\n- Throws a SyntaxError (Exn.t) if the string isn't valid JSON." - ], - "signature": "let parseExn: (string, ~reviver: (string, t) => t=?) => t", - "deprecated": "Use `parseOrThrow` instead" - }, - { - "id": "Stdlib.JSON.parseExnWithReviver", - "kind": "value", - "name": "parseExnWithReviver", - "docstrings": [ - "`parseExnWithReviver(string, reviver)`\n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\nJSON.parseExnWithReviver(jsonString, reviver)->Console.log\n// { hello: 'WORLD', someNumber: 42 }\n\ntry {\n JSON.parseExnWithReviver(\"\", reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions\n\n- Throws a SyntaxError if the string is not a valid JSON." - ], - "signature": "let parseExnWithReviver: (string, (string, t) => t) => t", - "deprecated": "Use `parseOrThrow` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringify", - "kind": "value", - "name": "stringify", - "docstrings": [ - "`stringify(json, ~replacer=?, ~space=?)`\n\nConverts a JSON object to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value,\nor an array of keys which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAny` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringify(json)\n// {\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}\n\nJSON.stringify(json, ~space=2)\n// {\n// \"foo\": \"bar\",\n// \"hello\": \"world\",\n// \"someNumber\": 42\n// }\n\nJSON.stringify(json, ~replacer=Keys([\"foo\", \"someNumber\"]))\n// {\"foo\":\"bar\",\"someNumber\":42}\n\nlet replacer = JSON.Replacer(\n (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n },\n)\n\nJSON.stringify(json, ~replacer)\n// {\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}\n```" - ], - "signature": "let stringify: (t, ~replacer: replacer=?, ~space: int=?) => string" - }, - { - "id": "Stdlib.JSON.stringifyWithIndent", - "kind": "value", - "name": "stringifyWithIndent", - "docstrings": [ - "`stringifyWithIndent(json, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nIf you want to stringify any type, use `JSON.stringifyAnyWithIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithIndent(json, 2)\n// {\n// \"foo\": \"bar\",\n// \"hello\": \"world\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithIndent: (t, int) => string", - "deprecated": "Use `stringify` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyWithReplacer", - "kind": "value", - "name": "stringifyWithReplacer", - "docstrings": [ - "`stringifyWithReplacer(json, replacer)`\n\nConverts a JSON object to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nIf you want to stringify any type, use `JSON.stringifyAnyWithReplacer` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\nJSON.stringifyWithReplacer(json, replacer)\n// {\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}\n```" - ], - "signature": "let stringifyWithReplacer: (t, (string, t) => t) => string", - "deprecated": "Use `stringify` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyWithReplacerAndIndent", - "kind": "value", - "name": "stringifyWithReplacerAndIndent", - "docstrings": [ - "`stringifyWithReplacerAndIndent(json, replacer, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nIf you want to stringify any type, use `JSON.stringifyAnyWithReplacerAndIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\nJSON.stringifyWithReplacerAndIndent(json, replacer, 2)\n// {\n// \"foo\": \"BAR\",\n// \"hello\": \"WORLD\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithReplacerAndIndent: (t, (string, t) => t, int) => string", - "deprecated": "Use `stringify` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.stringifyWithFilter", - "kind": "value", - "name": "stringifyWithFilter", - "docstrings": [ - "`stringifyWithFilter(json, filter)`\n\nConverts a JSON object to a JSON string.\nThe filter is an array of keys, which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAnyWithFilter` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithFilter(json, [\"foo\", \"someNumber\"])\n// {\"foo\":\"bar\",\"someNumber\":42}\n```" - ], - "signature": "let stringifyWithFilter: (t, array) => string", - "deprecated": "Use `stringify` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyWithFilterAndIndent", - "kind": "value", - "name": "stringifyWithFilterAndIndent", - "docstrings": [ - "`stringifyWithFilterAndIndent(json, filter, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nThe filter is an array of keys, which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAnyWithFilterAndIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithFilterAndIndent(json, [\"foo\", \"someNumber\"], 2)\n// {\n// \"foo\": \"bar\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithFilterAndIndent: (t, array, int) => string", - "deprecated": "Use `stringify` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.stringifyAny", - "kind": "value", - "name": "stringifyAny", - "docstrings": [ - "`stringifyAny(any, ~replacer=?, ~space=?)`\n\nConverts any type to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringify` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAny\n->Option.getUnsafe == `{\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}`\n\ndict\n->JSON.stringifyAny(~space=2)\n->Option.getUnsafe == `{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`\n\ndict\n->JSON.stringifyAny(~replacer=Keys([\"foo\", \"someNumber\"]))\n->Option.getUnsafe == `{\"foo\":\"bar\",\"someNumber\":42}`\n\nlet replacer = JSON.Replacer(\n (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n },\n)\n\ndict\n->JSON.stringifyAny(~replacer)\n->Option.getUnsafe == `{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\n// Throw a exception\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAny: ('a, ~replacer: replacer=?, ~space: int=?) => option" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithIndent", - "kind": "value", - "name": "stringifyAnyWithIndent", - "docstrings": [ - "`stringifyAnyWithIndent(any, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAnyWithIndent(2)\n->Option.getUnsafe == `{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithIndent: ('a, int) => option", - "deprecated": "Use `stringifyAny` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithReplacer", - "kind": "value", - "name": "stringifyAnyWithReplacer", - "docstrings": [ - "`stringifyAnyWithReplacer(json, replacer)`\n\nConverts any type to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithReplacer` instead.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\ndict\n->JSON.stringifyAnyWithReplacer(replacer)\n->Option.getUnsafe == `{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithReplacer: ('a, (string, t) => t) => option", - "deprecated": "Use `stringifyAny` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithReplacerAndIndent", - "kind": "value", - "name": "stringifyAnyWithReplacerAndIndent", - "docstrings": [ - "`stringifyAnyWithReplacerAndIndent(json, replacer, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithReplacerAndIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\ndict\n->JSON.stringifyAnyWithReplacer(replacer)\n->Option.getUnsafe == `{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithReplacerAndIndent: ('a, (string, t) => t, int) => option", - "deprecated": "Use `stringifyAny` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithFilter", - "kind": "value", - "name": "stringifyAnyWithFilter", - "docstrings": [ - "`stringifyAnyWithFilter(json, filter)`\n\nConverts any type to a JSON string.\nThe filter is an array of keys, which should be included in the output.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithFilter` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict->JSON.stringifyAnyWithFilter([\"foo\", \"someNumber\"]) == `{\"foo\":\"bar\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithFilter: ('a, array) => string", - "deprecated": "Use `stringifyAny` with optional parameter instead" - }, - { - "id": "Stdlib.JSON.stringifyAnyWithFilterAndIndent", - "kind": "value", - "name": "stringifyAnyWithFilterAndIndent", - "docstrings": [ - "`stringifyAnyWithFilterAndIndent(json, filter, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nThe filter is an array of keys, which should be included in the output.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithFilterAndIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAny\n->Option.getUnsafe == `{\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}`\n\ndict\n->JSON.stringifyAny(~space=2)\n->Option.getUnsafe == `{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`\n\ndict\n->JSON.stringifyAny(~replacer=Keys([\"foo\", \"someNumber\"]))\n->Option.getUnsafe == `{\"foo\":\"bar\",\"someNumber\":42}`\n\nJSON.stringifyAny(() => \"hello world\") == None\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws a TypeError if the value contains circular references.\n- Throws a TypeError if the value contains `BigInt`s." - ], - "signature": "let stringifyAnyWithFilterAndIndent: ('a, array, int) => string", - "deprecated": "Use `stringifyAny` with optional parameters instead" - }, - { - "id": "Stdlib.JSON.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(json)` ignores the provided json and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/jsexn": { - "id": "Stdlib.JsExn", - "name": "JsExn", - "docstrings": [ - "Provide utilities for dealing with JS exceptions.\n\nJS exceptions can be of any type, even though they *should* be of type `Error` of one of its subclasses.\n\nSee [`throw`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/throw) on MDN." - ], - "items": [ - { - "id": "Stdlib.JsExn.t", - "kind": "type", - "name": "t", - "docstrings": ["Represents a JS exception"], - "signature": "type t = unknown" - }, - { - "id": "Stdlib.JsExn.fromException", - "kind": "value", - "name": "fromException", - "docstrings": [], - "signature": "let fromException: exn => option" - }, - { - "id": "Stdlib.JsExn.anyToExnInternal", - "kind": "value", - "name": "anyToExnInternal", - "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a JsExn if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." - ], - "signature": "let anyToExnInternal: 'a => exn" - }, - { - "id": "Stdlib.JsExn.stack", - "kind": "value", - "name": "stack", - "docstrings": [ - "`stack(jsExn)` retrieves the `stack` property of the exception, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\ntry {JsError.make(\"error\")->JsError.throw} catch {\n| JsExn(e) => Console.log(JsExn.stack(e)) // Logs `stack`\n| _ => assert(false)\n}\n```" - ], - "signature": "let stack: t => option" - }, - { - "id": "Stdlib.JsExn.message", - "kind": "value", - "name": "message", - "docstrings": [ - "`message(error)` retrieves the `message` property of the error, if it exists.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\ntry {JsError.SyntaxError.throwWithMessage(\"Some message here\")} catch {\n| JsExn(e) => e->JsExn.message->Option.getExn == \"Some message here\"\n| _ => assert(false)\n}\n```" - ], - "signature": "let message: t => option" - }, - { - "id": "Stdlib.JsExn.name", - "kind": "value", - "name": "name", - "docstrings": [ - "`name(error)` retrieves the `name` property of the error, if it exists.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\ntry {JsError.SyntaxError.throwWithMessage(\"Some message here\")} catch {\n| JsExn(e) => e->JsExn.name->Option.getExn == \"SyntaxError\"\n| _ => assert(false)\n}\n```" - ], - "signature": "let name: t => option" - }, - { - "id": "Stdlib.JsExn.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [ - "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." - ], - "signature": "let fileName: t => option" - }, - { - "id": "Stdlib.JsExn.throw", - "kind": "value", - "name": "throw", - "docstrings": [ - "Throws the given value, terminating execution unless caught by a surrounding try/catch block.\n\nThis is meant to be used when a JS API is based on throwing values that are not of type `Error` or its subclasses." - ], - "signature": "let throw: 'a => 'b" - }, - { - "id": "Stdlib.JsExn.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(jsExn)` ignores the provided JS exception and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/jserror": { - "id": "Stdlib.JsError", - "name": "JsError", - "docstrings": [ - "Functions for working with JavaScript errors.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) on MDN." - ], - "items": [ - { - "id": "Stdlib.JsError.t", - "kind": "type", - "name": "t", - "docstrings": ["Represents a JavaScript error."], - "signature": "type t" - }, - { - "id": "Stdlib.JsError.stack", - "kind": "value", - "name": "stack", - "docstrings": [ - "`stack(error)` retrieves the `stack` property of the error, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\nlet error = JsError.make(\"error\")\nConsole.log(error->JsError.stack) // Logs `stack` if it exists on `someError`\n```" - ], - "signature": "let stack: t => option" - }, - { - "id": "Stdlib.JsError.message", - "kind": "value", - "name": "message", - "docstrings": [ - "`message(error)` retrieves the `message` property of the error.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\nlet error = JsError.SyntaxError.make(\"Some message here\")\nerror->JsError.message == \"Some message here\"\n```" - ], - "signature": "let message: t => string" - }, - { - "id": "Stdlib.JsError.name", - "kind": "value", - "name": "name", - "docstrings": [ - "`name(error)` retrieves the `name` property of the error.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\nlet error = JsError.SyntaxError.make(\"Some message here\")\nerror->JsError.name == \"SyntaxError\"\n```" - ], - "signature": "let name: t => string" - }, - { - "id": "Stdlib.JsError.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [ - "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." - ], - "signature": "let fileName: t => option" - }, - { - "id": "Stdlib.JsError.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(message)` creates a new error, setting its `message` to the provided value.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error) on MDN.\n\n## Example\n```rescript\nlet error = JsError.make(\"Some message here\")\nerror->JsError.message == \"Some message here\"\nerror->JsError.name == \"Error\"\n```" - ], - "signature": "let make: string => t" - }, - { - "id": "Stdlib.JsError.throw", - "kind": "value", - "name": "throw", - "docstrings": [ - "Throws the given error, terminating execution unless caught by a surrounding try/catch block.\n\n## Examples\n\n```rescript\nlet error = JsError.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n JsError.throw(error)\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" - ], - "signature": "let throw: t => 'a" - }, - { - "id": "Stdlib.JsError.throwWithMessage", - "kind": "value", - "name": "throwWithMessage", - "docstrings": [ - "Creates a new `Error` with the provided `message` and throws it.\n\n`JsError.throwWithMessage(\"message\")` is equivalent to `JsError.make(\"message\")->JsError.throw`." - ], - "signature": "let throwWithMessage: string => 'a" - }, - { - "id": "Stdlib.JsError.panic", - "kind": "value", - "name": "panic", - "docstrings": [ - "Throws a panic exception with the given message.\n\nA panic exception is a native JavaScript exception that is not intended to be caught and\nhandled. Compared to a ReScript exception this will give a better stack trace and\ndebugging experience.\n\n## Examples\n\n```rescript\ntry {\n JsError.panic(\"Uh oh. This was unexpected!\")\n} catch {\n| JsExn(obj) =>\n switch JsExn.message(obj) {\n | Some(m) => assert(m == \"Panic! Uh oh. This was unexpected!\")\n | None => assert(false)\n }\n| _ => assert(false)\n}\n```" - ], - "signature": "let panic: string => 'a" - }, - { - "id": "Stdlib.JsError.toJsExn", - "kind": "value", - "name": "toJsExn", - "docstrings": [ - "Casts a `JsError.t` to a `JsExn.t`. \n\nThis is useful when you want to compare a JS exception and a JS error." - ], - "signature": "let toJsExn: t => JsExn.t" - }, - { - "id": "Stdlib.JsError.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(error)` ignores the provided error and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/intl": { - "id": "Stdlib.Intl", - "name": "Intl", - "docstrings": [], - "items": [ - { - "id": "Stdlib.Intl.getCanonicalLocalesExn", - "kind": "value", - "name": "getCanonicalLocalesExn", - "docstrings": [ - "`getCanonicalLocalesExn(locale)` returns the canonical form of `locale`.\n\nThrows `RangeError` when the locale string is malformed.\n\nSee [`Intl.getCanonicalLocales`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales) on MDN.\n\n## Examples\n\n```rescript\nIntl.getCanonicalLocalesExn(\"EN-US\") == [\"en-US\"]\n```" - ], - "signature": "let getCanonicalLocalesExn: string => array" - }, - { - "id": "Stdlib.Intl.getCanonicalLocalesManyExn", - "kind": "value", - "name": "getCanonicalLocalesManyExn", - "docstrings": [ - "`getCanonicalLocalesManyExn(locales)` canonicalises every locale in `locales`.\n\nThrows `RangeError` when any locale string is malformed.\n\nSee [`Intl.getCanonicalLocales`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales) on MDN.\n\n## Examples\n\n```rescript\nIntl.getCanonicalLocalesManyExn([\"EN-US\", \"fr\"]) == [\"en-US\", \"fr\"]\n```" - ], - "signature": "let getCanonicalLocalesManyExn: array => array" - }, - { - "id": "Stdlib.Intl.supportedValuesOfExn", - "kind": "value", - "name": "supportedValuesOfExn", - "docstrings": [ - "`supportedValuesOfExn(key)` returns the list of values supported by the runtime for the feature identified by `key`.\n\nThrows `RangeError` when `key` is unsupported.\n\nSee [`Intl.supportedValuesOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf) on MDN.\n\n## Examples\n\n```rescript\nIntl.supportedValuesOfExn(\"calendar\")->Array.includes(\"gregory\") == true\n```" - ], - "signature": "let supportedValuesOfExn: string => array" - } - ] - }, - "stdlib/int": { - "id": "Stdlib.Int", - "name": "Int", - "docstrings": [ - "Functions for interacting with JavaScript Number.\nSee: [`Number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)." - ], - "items": [ - { - "id": "Stdlib.Int.t", - "kind": "type", - "name": "t", - "docstrings": ["Type representing an int."], - "signature": "type t = int" - }, - { - "id": "Stdlib.Int.equal", - "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (int, int) => bool" - }, - { - "id": "Stdlib.Int.compare", - "kind": "value", - "name": "compare", - "docstrings": [], - "signature": "let compare: (int, int) => Ordering.t" - }, - { - "id": "Stdlib.Int.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponential: (int, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Int.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponentialWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toFixed", - "kind": "value", - "name": "toFixed", - "docstrings": [ - "`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixed: (int, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Int.toFixedWithPrecision", - "kind": "value", - "name": "toFixedWithPrecision", - "docstrings": [ - "`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixedWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecision: (int, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Int.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecisionWithPrecision: (int, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." - ], - "signature": "let toString: (int, ~radix: int=?) => string" - }, - { - "id": "Stdlib.Int.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." - ], - "signature": "let toStringWithRadix: (int, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Int.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```" - ], - "signature": "let toLocaleString: int => string" - }, - { - "id": "Stdlib.Int.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [ - "`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```" - ], - "signature": "let toFloat: int => float" - }, - { - "id": "Stdlib.Int.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "`fromFloat(n)` return an `int` representing the given value. The conversion is\ndone by truncating the decimal part.\n\n## Examples\n\n```rescript\nInt.fromFloat(2.0) == 2\nInt.fromFloat(1.999) == 1\nInt.fromFloat(1.5) == 1\nInt.fromFloat(0.9999) == 0\n```" - ], - "signature": "let fromFloat: float => int" - }, - { - "id": "Stdlib.Int.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(str, ~radix=?)` return an `option` representing the given value\n`str`. `~radix` specifies the radix base to use for the formatted number.\n\n## Examples\n\n```rescript\nInt.fromString(\"0\") == Some(0)\nInt.fromString(\"NaN\") == None\nInt.fromString(\"6\", ~radix=2) == None\n```" - ], - "signature": "let fromString: (string, ~radix: int=?) => option" - }, - { - "id": "Stdlib.Int.mod", - "kind": "value", - "name": "mod", - "docstrings": [ - "`mod(n1, n2)` calculates the modulo (remainder after division) of two integers.\n\n## Examples\n\n```rescript\nInt.mod(7, 4) == 3\n```" - ], - "signature": "let mod: (int, int) => int" - }, - { - "id": "Stdlib.Int.rangeOptions", - "kind": "type", - "name": "rangeOptions", - "docstrings": ["The options for `range`."], - "signature": "type rangeOptions = {step?: int, inclusive?: bool}" - }, - { - "id": "Stdlib.Int.range", - "kind": "value", - "name": "range", - "docstrings": [ - "`range(start, end, ~options=?)` returns an int array of the sequence of integers in the\nrange `[start, end)`. That is, including `start` but excluding `end`.\n\nIf `step` is not set and `start < end`, the sequence will be increasing in steps of 1.\n\nIf `step` is not set and `start > end`, the sequence will be decreasing in steps of -1.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nthrown as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.range(3, 6) == [3, 4, 5]\nInt.range(-3, -1) == [-3, -2]\nInt.range(3, 1) == [3, 2]\nInt.range(3, 7, ~options={step: 2}) == [3, 5]\nInt.range(3, 7, ~options={step: 2, inclusive: true}) == [3, 5, 7]\nInt.range(3, 6, ~options={step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`." - ], - "signature": "let range: (int, int, ~options: rangeOptions=?) => array" - }, - { - "id": "Stdlib.Int.rangeWithOptions", - "kind": "value", - "name": "rangeWithOptions", - "docstrings": [ - "`rangeWithOptions(start, end, options)` is like `range`, but with `step` and\n`inclusive` options configurable.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nraised as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.rangeWithOptions(3, 7, {step: 2}) == [3, 5]\nInt.rangeWithOptions(3, 7, {step: 2, inclusive: true}) == [3, 5, 7]\nInt.rangeWithOptions(3, 6, {step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`." - ], - "signature": "let rangeWithOptions: (int, int, rangeOptions) => array", - "deprecated": "" - }, - { - "id": "Stdlib.Int.clamp", - "kind": "value", - "name": "clamp", - "docstrings": [ - "`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nInt.clamp(42) == 42\nInt.clamp(42, ~min=50) == 50\nInt.clamp(42, ~max=40) == 40\nInt.clamp(42, ~min=50, ~max=40) == 50\n```" - ], - "signature": "let clamp: (~min: int=?, ~max: int=?, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseAnd", - "kind": "value", - "name": "bitwiseAnd", - "docstrings": [ - "`bitwiseAnd(n1, n2)` calculates the bitwise AND of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseAnd(7, 4) == 4\n```" - ], - "signature": "let bitwiseAnd: (int, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseOr", - "kind": "value", - "name": "bitwiseOr", - "docstrings": [ - "`bitwiseOr(n1, n2)` calculates the bitwise OR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseOr(7, 4) == 7\n```" - ], - "signature": "let bitwiseOr: (int, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseXor", - "kind": "value", - "name": "bitwiseXor", - "docstrings": [ - "`bigwiseXor(n1, n2)` calculates the bitwise XOR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseXor(7, 4) == 3\n```" - ], - "signature": "let bitwiseXor: (int, int) => int" - }, - { - "id": "Stdlib.Int.bitwiseNot", - "kind": "value", - "name": "bitwiseNot", - "docstrings": [ - "`bitwiseNot(n)` calculates the bitwise NOT of an integer.\n\n## Examples\n\n```rescript\nInt.bitwiseNot(2) == -3\n```" - ], - "signature": "let bitwiseNot: int => int" - }, - { - "id": "Stdlib.Int.shiftLeft", - "kind": "value", - "name": "shiftLeft", - "docstrings": [ - "`shiftLeft(n, length)` calculates the shifted value of an integer `n` by `length` bits to the left.\n\n## Examples\n\n```rescript\nInt.shiftLeft(4, 1) == 8\n```" - ], - "signature": "let shiftLeft: (int, int) => int" - }, - { - "id": "Stdlib.Int.shiftRight", - "kind": "value", - "name": "shiftRight", - "docstrings": [ - "`shiftRight(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\n\nAlso known as \"arithmetic right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRight(8, 1) == 4\n```" - ], - "signature": "let shiftRight: (int, int) => int" - }, - { - "id": "Stdlib.Int.shiftRightUnsigned", - "kind": "value", - "name": "shiftRightUnsigned", - "docstrings": [ - "`shiftRightUnsigned(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\nExcess bits shifted off to the right are discarded, and zero bits are shifted in from the left.\n\nAlso known as \"zero-filling right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRightUnsigned(4, 1) == 2\n```" - ], - "signature": "let shiftRightUnsigned: (int, int) => int" - }, - { - "id": "Stdlib.Int.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(int)` ignores the provided int and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: int => unit" - } - ] - }, - "stdlib/float": { - "id": "Stdlib.Float", - "name": "Float", - "docstrings": ["Functions for interacting with float."], - "items": [ - { - "id": "Stdlib.Float.t", - "kind": "type", - "name": "t", - "docstrings": ["Type representing a float."], - "signature": "type t = float" - }, - { - "id": "Stdlib.Float.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "Checks if two floating point numbers are equal.\n\n## Examples\n```rescript\nFloat.equal(1.0, 1.0) == true\nFloat.equal(1.0, 2.0) == false\n```" - ], - "signature": "let equal: (float, float) => bool" - }, - { - "id": "Stdlib.Float.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "Compares two floating point numbers, returns an `Ordering.t` value.\n\n## Examples\n```rescript\nFloat.compare(1.0, 1.0) == Ordering.equal\nFloat.compare(1.0, 2.0) == Ordering.less\nFloat.compare(2.0, 1.0) == Ordering.greater\n```" - ], - "signature": "let compare: (float, float) => Ordering.t" - }, - { - "id": "Stdlib.Float.isNaN", - "kind": "value", - "name": "isNaN", - "docstrings": [ - "`isNaN(v)` tests if the given `v` is `NaN`.\nSee [`isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) on MDN.\n\n## Examples\n\n```rescript\nFloat.isNaN(3.0) // false\nFloat.isNaN(Float.Constants.nan) // true\n```" - ], - "signature": "let isNaN: float => bool" - }, - { - "id": "Stdlib.Float.isFinite", - "kind": "value", - "name": "isFinite", - "docstrings": [ - "`isFinite(v)` tests if the given `v` is finite.\nSee [`isFinite`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite) on MDN.\n\n## Examples\n\n```rescript\nFloat.isFinite(1.0) == true\nFloat.isFinite(Float.Constants.nan) == false\nFloat.isFinite(Float.Constants.positiveInfinity) == false\n```" - ], - "signature": "let isFinite: float => bool" - }, - { - "id": "Stdlib.Float.parseFloat", - "kind": "value", - "name": "parseFloat", - "docstrings": [ - "`parseFloat(v)` parse the given `v` and returns a float. Leading whitespace in\n`v` is ignored. Returns `NaN` if `v` can't be parsed. Use \\[`fromString`\\] to\nensure it returns a valid float and not `NaN`.\nSee [`parseFloat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseFloat(\"1.0\") == 1.0\nFloat.parseFloat(\" 3.14 \") == 3.14\nFloat.parseFloat(\"3.0\") == 3.0\nFloat.parseFloat(\"3.14some non-digit characters\") == 3.14\nFloat.parseFloat(\"error\")->Float.isNaN == true\n```" - ], - "signature": "let parseFloat: string => float" - }, - { - "id": "Stdlib.Float.parseInt", - "kind": "value", - "name": "parseInt", - "docstrings": [ - "`parseInt(v, ~radix=?)` parse the given `v` and returns a float. Leading\nwhitespace in this argument `v`is ignored. `radix` specifies the radix base to\nuse for the formatted number. The value must be in the range \\[2, 36\\] (inclusive).\nReturns `NaN` if `v` can't be parsed and `radix` is smaller than 2 or bigger\nthan 36.\nSee [`parseInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseInt(\"1.0\") == 1.0\nFloat.parseInt(\" 3.14 \") == 3.0\nFloat.parseInt(3) == 3.0\nFloat.parseInt(\"3.14some non-digit characters\") == 3.0\nFloat.parseInt(\"error\")->Float.isNaN == true\nFloat.parseInt(\"10.0\", ~radix=2) == 2.0\nFloat.parseInt(\"15 * 3\", ~radix=10) == 15.0\nFloat.parseInt(\"12\", ~radix=13) == 15.0\nFloat.parseInt(\"17\", ~radix=40)->Float.isNaN == true\n```" - ], - "signature": "let parseInt: ('a, ~radix: int=?) => float" - }, - { - "id": "Stdlib.Float.parseIntWithRadix", - "kind": "value", - "name": "parseIntWithRadix", - "docstrings": [ - "`parseIntWithRadix(v, ~radix)` parse the given `v` and returns a float. Leading\nwhitespace in this argument `v`is ignored. `radix` specifies the radix base to\nuse for the formatted number. The value must be in the range \\[2, 36\\] (inclusive).\nReturns `NaN` if `v` can't be parsed and `radix` is smaller than 2 or bigger\nthan 36.\nSee [`parseInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseIntWithRadix(\"10.0\", ~radix=2) == 2.0\nFloat.parseIntWithRadix(\"15 * 3\", ~radix=10) == 15.0\nFloat.parseIntWithRadix(\"12\", ~radix=13) == 15.0\nFloat.parseIntWithRadix(\"17\", ~radix=40)->Float.isNaN == true\n```" - ], - "signature": "let parseIntWithRadix: ('a, ~radix: int) => float", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toExponential", - "kind": "value", - "name": "toExponential", - "docstrings": [ - "`toExponential(v, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponential(1000.0) == \"1e+3\"\nFloat.toExponential(-1000.0) == \"-1e+3\"\nFloat.toExponential(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponential(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponential: (float, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Float.toExponentialWithPrecision", - "kind": "value", - "name": "toExponentialWithPrecision", - "docstrings": [ - "`toExponential(v, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponentialWithPrecision(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponentialWithPrecision(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." - ], - "signature": "let toExponentialWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toFixed", - "kind": "value", - "name": "toFixed", - "docstrings": [ - "`toFixed(v, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixed(123456.0) == \"123456\"\nFloat.toFixed(10.0) == \"10\"\nFloat.toFixed(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixed(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixed: (float, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Float.toFixedWithPrecision", - "kind": "value", - "name": "toFixedWithPrecision", - "docstrings": [ - "`toFixedWithPrecision(v, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixedWithPrecision(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixedWithPrecision(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." - ], - "signature": "let toFixedWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toPrecision", - "kind": "value", - "name": "toPrecision", - "docstrings": [ - "`toPrecision(v, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecision(100.0) == \"100\"\nFloat.toPrecision(1.0) == \"1\"\nFloat.toPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecision: (float, ~digits: int=?) => string" - }, - { - "id": "Stdlib.Float.toPrecisionWithPrecision", - "kind": "value", - "name": "toPrecisionWithPrecision", - "docstrings": [ - "`toPrecisionWithPrecision(v, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecisionWithPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecisionWithPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits." - ], - "signature": "let toPrecisionWithPrecision: (float, ~digits: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(v)` return a `string` representing the given value.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toString(1000.0) == \"1000\"\nFloat.toString(-1000.0) == \"-1000\"\n```" - ], - "signature": "let toString: (float, ~radix: int=?) => string" - }, - { - "id": "Stdlib.Float.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [ - "`toStringWithRadix(v, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toStringWithRadix(6.0, ~radix=2) == \"110\"\nFloat.toStringWithRadix(3735928559.0, ~radix=16) == \"deadbeef\"\nFloat.toStringWithRadix(123456.0, ~radix=36) == \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." - ], - "signature": "let toStringWithRadix: (float, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Float.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(v)` return a `string` with language-sensitive representing the\ngiven value.\nSee [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nFloat.toLocaleString(1000.0) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nFloat.toLocaleString(1000.0) // \"1.000\"\n```" - ], - "signature": "let toLocaleString: float => string" - }, - { - "id": "Stdlib.Float.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(str)` return an `option` representing the given value `str`.\n\n## Examples\n\n```rescript\nFloat.fromString(\"0\") == Some(0.0)\nFloat.fromString(\"NaN\") == None\nFloat.fromString(\"6\") == Some(6.0)\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.Float.toInt", - "kind": "value", - "name": "toInt", - "docstrings": [ - "`toInt(v)` returns an int to given float `v`.\n\n## Examples\n\n```rescript\nFloat.toInt(2.0) == 2\nFloat.toInt(1.0) == 1\nFloat.toInt(1.1) == 1\nFloat.toInt(1.6) == 1\n```" - ], - "signature": "let toInt: float => int" - }, - { - "id": "Stdlib.Float.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "`fromInt(v)` returns a float to given int `v`.\n\n## Examples\n\n```rescript\nFloat.fromInt(2) == 2.0\nFloat.fromInt(1) == 1.0\n```" - ], - "signature": "let fromInt: int => float" - }, - { - "id": "Stdlib.Float.mod", - "kind": "value", - "name": "mod", - "docstrings": [ - "`mod(n1, n2)` calculates the modulo (remainder after division) of two floats.\n\n## Examples\n\n```rescript\nFloat.mod(7.0, 4.0) == 3.0\n```" - ], - "signature": "let mod: (float, float) => float" - }, - { - "id": "Stdlib.Float.clamp", - "kind": "value", - "name": "clamp", - "docstrings": [ - "`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nFloat.clamp(4.2) == 4.2\nFloat.clamp(4.2, ~min=4.3) == 4.3\nFloat.clamp(4.2, ~max=4.1) == 4.1\nFloat.clamp(4.2, ~min=4.3, ~max=4.1) == 4.3\n```" - ], - "signature": "let clamp: (~min: float=?, ~max: float=?, float) => float" - }, - { - "id": "Stdlib.Float.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(float)` ignores the provided float and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: float => unit" - } - ] - }, - "stdlib/error": { - "id": "Stdlib.Error", - "name": "Error", - "docstrings": [ - "Functions for working with JavaScript exceptions.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) on MDN." - ], - "items": [ - { - "id": "Stdlib.Error.t", - "kind": "type", - "name": "t", - "docstrings": ["Represents a JavaScript exception."], - "signature": "type t = Exn.t", - "deprecated": "" - }, - { - "id": "Stdlib.Error.fromException", - "kind": "value", - "name": "fromException", - "docstrings": [], - "signature": "let fromException: exn => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.toException", - "kind": "value", - "name": "toException", - "docstrings": [ - "Turns an `Error.t` into an `exn`.\n\n## Examples\n```rescript\nlet error = Error.make(\"Something went wrong.\")\n\nlet asExn = error->Error.toException // `asExn` is now type `exn`\n```" - ], - "signature": "let toException: t => exn", - "deprecated": "Use functions from `JsExn` instead" - }, - { - "id": "Stdlib.Error.stack", - "kind": "value", - "name": "stack", - "docstrings": [ - "`stack(error)` retrieves the `stack` property of the error, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\nlet error = Error.make(\"error\")\nConsole.log(error->Error.stack) // Logs `stack` if it exists on `someError`\n```" - ], - "signature": "let stack: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.message", - "kind": "value", - "name": "message", - "docstrings": [ - "`message(error)` retrieves the `message` property of the error, if it exists.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\nlet error = Error.SyntaxError.make(\"Some message here\")\nConsole.log(error->Error.message) // Logs \"Some message here\" to the console\n```" - ], - "signature": "let message: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.name", - "kind": "value", - "name": "name", - "docstrings": [ - "`name(error)` retrieves the `name` property of the error, if it exists.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\nlet error = Error.SyntaxError.make(\"Some message here\")\nConsole.log(error->Error.name) // Logs \"SyntaxError\" to the console\n```" - ], - "signature": "let name: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [ - "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." - ], - "signature": "let fileName: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Error.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(message)` creates a new error, setting its `message` to the provided value.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error) on MDN.\n\n## Example\n```rescript\nlet error = Error.make(\"Some message here\")\nConsole.log(error->Error.message) // Logs \"Some message here\" to the console\nConsole.log(error->Error.name) // Logs \"Error\" to the console, because this is a regular error\n```" - ], - "signature": "let make: string => t", - "deprecated": "" - }, - { - "id": "Stdlib.Error.raise", - "kind": "value", - "name": "raise", - "docstrings": [ - "Raises (throws in JavaScript language) the provided `Error.t`, which will stop execution.\n\n## Examples\n```rescript\nlet error = Error.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n error->Error.raise\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" - ], - "signature": "let raise: t => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Error.throw", - "kind": "value", - "name": "throw", - "docstrings": [ - "Throws the given exception, terminating execution unless caught by a surrounding try/catch block.\n\n## Examples\n\n```rescript\nlet error = Error.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n Error.throw(error)\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" - ], - "signature": "let throw: t => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Error.panic", - "kind": "value", - "name": "panic", - "docstrings": [ - "Throws a panic exception with the given message.\n\nA panic exception is a native JavaScript exception that is not intended to be caught and\nhandled. Compared to a ReScript exception this will give a better stack trace and\ndebugging experience.\n\n## Examples\n\n```rescript\ntry {\n Error.panic(\"Uh oh. This was unexpected!\")\n} catch {\n| Exn.Error(obj) =>\n switch Exn.message(obj) {\n | Some(m) => assert(m == \"Panic! Uh oh. This was unexpected!\")\n | None => assert(false)\n }\n| _ => assert(false)\n}\n```" - ], - "signature": "let panic: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Error.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(error)` ignores the provided error and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit", - "deprecated": "" - } - ] - }, - "stdlib/exn": { - "id": "Stdlib.Exn", - "name": "Exn", - "docstrings": ["Provide utilities for dealing with JS exceptions."], - "items": [ - { - "id": "Stdlib.Exn.t", - "kind": "type", - "name": "t", - "docstrings": ["Represents a JS exception"], - "signature": "type t", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.asJsExn", - "kind": "value", - "name": "asJsExn", - "docstrings": [], - "signature": "let asJsExn: exn => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.stack", - "kind": "value", - "name": "stack", - "docstrings": [], - "signature": "let stack: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.message", - "kind": "value", - "name": "message", - "docstrings": [], - "signature": "let message: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.name", - "kind": "value", - "name": "name", - "docstrings": [], - "signature": "let name: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.fileName", - "kind": "value", - "name": "fileName", - "docstrings": [], - "signature": "let fileName: t => option", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.anyToExnInternal", - "kind": "value", - "name": "anyToExnInternal", - "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a Exn.Error if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." - ], - "signature": "let anyToExnInternal: 'a => exn", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseError", - "kind": "value", - "name": "raiseError", - "docstrings": ["Raise Js exception Error object with stacktrace"], - "signature": "let raiseError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseEvalError", - "kind": "value", - "name": "raiseEvalError", - "docstrings": [], - "signature": "let raiseEvalError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseRangeError", - "kind": "value", - "name": "raiseRangeError", - "docstrings": [], - "signature": "let raiseRangeError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseReferenceError", - "kind": "value", - "name": "raiseReferenceError", - "docstrings": [], - "signature": "let raiseReferenceError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseSyntaxError", - "kind": "value", - "name": "raiseSyntaxError", - "docstrings": [], - "signature": "let raiseSyntaxError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseTypeError", - "kind": "value", - "name": "raiseTypeError", - "docstrings": [], - "signature": "let raiseTypeError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.raiseUriError", - "kind": "value", - "name": "raiseUriError", - "docstrings": [], - "signature": "let raiseUriError: string => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Exn.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(exn)` ignores the provided exn and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit", - "deprecated": "" - } - ] - }, - "stdlib/dict": { - "id": "Stdlib.Dict", - "name": "Dict", - "docstrings": [ - "A mutable dictionary with string keys.\n\nCompiles to a regular JavaScript object." - ], - "items": [ - { - "id": "Stdlib.Dict.t", - "kind": "type", - "name": "t", - "docstrings": ["Type representing a dictionary of value `'a`."], - "signature": "type t<'a> = dict<'a>" - }, - { - "id": "Stdlib.Dict.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(dict, key)` Returns the `value` at the provided `key`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `key` does not exist in `dict`.\n\nUse `Dict.getUnsafe` only when you are sure the key exists (i.e. when iterating `Dict.keys` result).\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\nlet value = dict->Dict.getUnsafe(\"key1\")\nConsole.log(value) // value1\n```" - ], - "signature": "let getUnsafe: (dict<'a>, string) => 'a" - }, - { - "id": "Stdlib.Dict.get", - "kind": "value", - "name": "get", - "docstrings": [ - "Returns the value at the provided key, if it exists. Returns an option.\n\n## Examples\n```rescript\nlet dict = dict{\"someKey\": \"someValue\"}\n\nswitch dict->Dict.get(\"someKey\") {\n| None => Console.log(\"Nope, didn't have the key.\")\n| Some(value) => Console.log(value)\n}\n```\n\n## Alternative: Pattern Matching with `dict{}`\n\nFor nested dictionary access, consider using the more concise `dict{}` pattern matching syntax:\n\n```rescript\n// More concise approach using pattern matching\nlet decodeImageUrl = (json: JSON.t) => {\n switch json {\n | JSON.Object(dict{\"data\": JSON.Object(dict{\"image_url\": JSON.String(url)})}) => Some(url)\n | _ => None\n }\n}\n\n// Alternative using Dict.get\nlet decodeImageUrl = (json: JSON.t) => {\n switch json {\n | JSON.Object(obj) =>\n switch Dict.get(obj, \"data\") {\n | Some(JSON.Object(data)) =>\n switch Dict.get(data, \"image_url\") {\n | Some(JSON.String(url)) => Some(url)\n | _ => None\n }\n | _ => None\n }\n | _ => None\n }\n}\n```" - ], - "signature": "let get: (dict<'a>, string) => option<'a>" - }, - { - "id": "Stdlib.Dict.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(dictionary, key, value)` sets the value at the provided key to the provided value.\n\n## Examples\n```rescript\nlet dict = Dict.make()\n\ndict->Dict.set(\"someKey\", \"someValue\")\n```" - ], - "signature": "let set: (dict<'a>, string, 'a) => unit" - }, - { - "id": "Stdlib.Dict.delete", - "kind": "value", - "name": "delete", - "docstrings": [ - "`delete(dictionary, key)` deletes the value at `key`, if it exists.\n\n## Examples\n```rescript\nlet dict = dict{\"someKey\": \"someValue\"}\n\ndict->Dict.delete(\"someKey\")\n```" - ], - "signature": "let delete: (dict<'a>, string) => unit" - }, - { - "id": "Stdlib.Dict.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make()` creates a new, empty dictionary.\n\n## Examples\n```rescript\nlet dict1: dict = Dict.make() // You can annotate the type of the values of your dict yourself if you want\n\nlet dict2 = Dict.make() // Or you can let ReScript infer it via usage.\ndict2->Dict.set(\"someKey\", 12)\n```" - ], - "signature": "let make: unit => dict<'a>" - }, - { - "id": "Stdlib.Dict.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(entries)` creates a new dictionary from the provided array of key/value pairs.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([(\"key1\", \"value1\"), (\"key2\", \"value2\")])\n```" - ], - "signature": "let fromArray: array<(string, 'a)> => dict<'a>" - }, - { - "id": "Stdlib.Dict.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "`fromIterator(entries)` creates a new dictionary from the provided iterator of key/value pairs.\n\n## Examples\n\n```rescript\nlet iterator: Iterator.t<(string, int)> = %raw(`\n (() => {\n var map1 = new Map();\n map1.set('first', 1);\n map1.set('second', 2);\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\niterator\n->Dict.fromIterator\n->Dict.valuesToArray == [1, 2]\n```" - ], - "signature": "let fromIterator: Iterator.t<(string, 'a)> => dict<'a>" - }, - { - "id": "Stdlib.Dict.toArray", - "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(dictionary)` returns an array of all the key/value pairs of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet asArray = dict->Dict.toArray\nConsole.log(asArray) // Logs `[[\"someKey\", 1], [\"someKey2\", 2]]` to the console\n```" - ], - "signature": "let toArray: dict<'a> => array<(string, 'a)>" - }, - { - "id": "Stdlib.Dict.keysToArray", - "kind": "value", - "name": "keysToArray", - "docstrings": [ - "`keysToArray(dictionary)` returns an array of all the keys of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet keys = dict->Dict.keysToArray\nConsole.log(keys) // Logs `[\"someKey\", \"someKey2\"]` to the console\n```" - ], - "signature": "let keysToArray: dict<'a> => array" - }, - { - "id": "Stdlib.Dict.size", - "kind": "value", - "name": "size", - "docstrings": [ - "`size(dictionary)` returns the number of key/value pairs in the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.size->assertEqual(0)\n\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\ndict->Dict.size->assertEqual(2)\n\n// After deleting a key\ndict->Dict.delete(\"someKey\")\ndict->Dict.size->assertEqual(1)\n```" - ], - "signature": "let size: dict<'a> => int" - }, - { - "id": "Stdlib.Dict.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(dictionary)` returns `true` if the dictionary is empty (has no key/value pairs), `false` otherwise.\n\n## Examples\n```rescript\nlet emptyDict = Dict.make()\nemptyDict->Dict.isEmpty->assertEqual(true)\n\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.isEmpty->assertEqual(false)\n\n// After clearing all keys\ndict->Dict.delete(\"someKey\")\ndict->Dict.isEmpty->assertEqual(true)\n```" - ], - "signature": "let isEmpty: dict<'a> => bool" - }, - { - "id": "Stdlib.Dict.valuesToArray", - "kind": "value", - "name": "valuesToArray", - "docstrings": [ - "`valuesToArray(dictionary)` returns an array of all the values of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet values = dict->Dict.valuesToArray\nConsole.log(values) // Logs `[1, 2]` to the console\n```" - ], - "signature": "let valuesToArray: dict<'a> => array<'a>" - }, - { - "id": "Stdlib.Dict.assign", - "kind": "value", - "name": "assign", - "docstrings": [ - "`assign(dictionary1, dictionary2)` [shallowly](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) merges dictionary2 into dictionary1, and returns dictionary1.\n\nBeware this will *mutate* dictionary1. If you're looking for a way to copy a dictionary, check out `Dict.copy`.\n\n## Examples\n```rescript\nlet dict1 = Dict.make()\ndict1->Dict.set(\"firstKey\", 1)\nConsole.log(dict1->Dict.keysToArray) // Logs `[\"firstKey\"]`\n\nlet dict2 = Dict.make()\ndict2->Dict.set(\"someKey\", 2)\ndict2->Dict.set(\"someKey2\", 3)\n\nlet dict1 = dict1->Dict.assign(dict2)\n\nConsole.log(dict1->Dict.keysToArray) // Logs `[\"firstKey\", \"someKey\", \"someKey2\"]`\n```" - ], - "signature": "let assign: (dict<'a>, dict<'a>) => dict<'a>" - }, - { - "id": "Stdlib.Dict.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(dictionary)` [shallowly copies](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) the provided dictionary to a new dictionary.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\nlet dict2 = dict->Dict.copy\n\n// Both log `[\"key1\", \"key2\"]` here.\nConsole.log2(dict->Dict.keysToArray, dict2->Dict.keysToArray)\n```" - ], - "signature": "let copy: dict<'a> => dict<'a>" - }, - { - "id": "Stdlib.Dict.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(dictionary, f)` iterates through all values of the dict.\n\n> Please note that this is *without the keys*, just the values. If you need the key as well, use `Dict.forEachWithKey`.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\n\ndict->Dict.forEach(value => {\n Console.log(value)\n})\n```" - ], - "signature": "let forEach: (dict<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Dict.forEachWithKey", - "kind": "value", - "name": "forEachWithKey", - "docstrings": [ - "`forEachWithKey(dictionary, f)` iterates through all values of the dict, including the key for each value.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\n\ndict->Dict.forEachWithKey((value, key) => {\n Console.log2(value, key)\n})\n```" - ], - "signature": "let forEachWithKey: (dict<'a>, ('a, string) => unit) => unit" - }, - { - "id": "Stdlib.Dict.mapValues", - "kind": "value", - "name": "mapValues", - "docstrings": [ - "`mapValues(dictionary, f)` returns a new dictionary with the same keys, and `f` applied to each value in the original dictionary.\n\n## Examples\n\n```rescript\nlet dict = dict{\"key1\": 1, \"key2\": 2}\n\ndict->Dict.mapValues(v => v + 10)->Dict.toArray // [(\"key1\", 11), (\"key2\", 12)]\ndict->Dict.mapValues(v => Int.toString(v))->Dict.toArray // [(\"key1\", \"1\"), (\"key2\", \"2\")]\n```" - ], - "signature": "let mapValues: (dict<'a>, 'a => 'b) => dict<'b>" - }, - { - "id": "Stdlib.Dict.has", - "kind": "value", - "name": "has", - "docstrings": [ - "`has(dictionary, \"key\")` returns true if the \"key\" is present in the dictionary.\n\nBe aware that it uses the JavaScript `in` operator under the hood.\n\n## Examples\n\n```rescript\nlet dict = dict{\"key1\": Some(1), \"key2\": None}\n\ndict->Dict.has(\"key1\") == true\ndict->Dict.has(\"key2\") == true\ndict->Dict.has(\"key3\") == false\ndict->Dict.has(\"toString\") == true\n```" - ], - "signature": "let has: (dict<'a>, string) => bool" - }, - { - "id": "Stdlib.Dict.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(dict)` ignores the provided dict and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: dict<'a> => unit" - } - ] - }, - "stdlib/date": { - "id": "Stdlib.Date", - "name": "Date", - "docstrings": ["Functions for interacting with JavaScript Dates."], - "items": [ - { - "id": "Stdlib.Date.t", - "kind": "type", - "name": "t", - "docstrings": ["A type representing a JavaScript date."], - "signature": "type t" - }, - { - "id": "Stdlib.Date.msSinceEpoch", - "kind": "type", - "name": "msSinceEpoch", - "docstrings": [ - "Time, in milliseconds, since / until the UNIX epoch (January 1, 1970 00:00:00 UTC).\nPositive numbers represent dates after, negative numbers dates before epoch." - ], - "signature": "type msSinceEpoch = float" - }, - { - "id": "Stdlib.Date.localeOptions", - "kind": "type", - "name": "localeOptions", - "docstrings": [ - "A type representing date time format options.\n\nNote: There are some properties missing:\n- fractionalSecondDigits\n- dayPeriod\n- calendar\n- numberingSystem\n- localeMatcher\n- timeZone\n- hour12\n- hourCycle\n- formatMatcher\n\nSee full spec at https://tc39.es/ecma402/#datetimeformat-objects" - ], - "signature": "type localeOptions = {\n dateStyle?: [#full | #long | #medium | #short],\n timeStyle?: [#full | #long | #medium | #short],\n weekday?: [#long | #narrow | #short],\n era?: [#long | #narrow | #short],\n year?: [#\"2-digit\" | #numeric],\n month?: [\n | #\"2-digit\"\n | #long\n | #narrow\n | #numeric\n | #short\n ],\n day?: [#\"2-digit\" | #numeric],\n hour?: [#\"2-digit\" | #numeric],\n minute?: [#\"2-digit\" | #numeric],\n second?: [#\"2-digit\" | #numeric],\n timeZoneName?: [#long | #short],\n}" - }, - { - "id": "Stdlib.Date.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make()`\n\nCreates a date object with the current date time as value.\n\n## Examples\n```rescript\nDate.make()\n```" - ], - "signature": "let make: unit => t" - }, - { - "id": "Stdlib.Date.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(dateTimeString)`\n\nCreates a date object from given date time string.\nThe string has to be in the ISO 8601 format YYYY-MM-DDTHH:mm:ss.sssZ (https://tc39.es/ecma262/\\#sec-date-time-string-format).\n\nInvalid date time strings will create invalid dates.\nYou can use the result like any valid date, but many functions like `toString` will return \"Invalid Date\" or functions like `Date.getTime` will return NaN.\n\n## Examples\n```rescript\nDate.fromString(\"2023\") // 2023-01-01T00:00:00.000Z\n\nDate.fromString(\"2023-02-20\") // 2023-02-20T00:00:00.000Z\n\nDate.fromString(\"2023-02-20T16:40:00.00Z\") // 2023-02-20T16:40:00.000Z\n\nDate.fromString(\"\") // Invalid Date\n\nDate.fromString(\"\")->Date.getTime // NaN\n```" - ], - "signature": "let fromString: string => t" - }, - { - "id": "Stdlib.Date.fromTime", - "kind": "value", - "name": "fromTime", - "docstrings": [ - "`fromTime(msSinceEpoch)`\n\nCreates a date object from the given time in milliseconds since / until UNIX epoch (January 1, 1970 00:00:00 UTC).\nPositive numbers create dates after epoch, negative numbers create dates before epoch.\n\n## Examples\n```rescript\nDate.fromTime(0.0)\n// 1970-01-01T00:00:00.000Z\n\nDate.fromTime(-86_400_000.0)\n// 1969-12-31T00:00:00.000Z\n\nDate.fromTime(86_400_000.0)\n// 1970-01-02T00:00:00.000Z\n```" - ], - "signature": "let fromTime: msSinceEpoch => t" - }, - { - "id": "Stdlib.Date.makeWithYM", - "kind": "value", - "name": "makeWithYM", - "docstrings": [ - "Creates a date object with the given year and month.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYM(~year=2023, ~month=0)\n// 2023-01-01T00:00:00.000Z\n\nDate.makeWithYM(~year=2023, ~month=11)\n// 2023-12-01T00:00:00.000Z\n\nDate.makeWithYM(~year=2023, ~month=12)\n// 2024-01-01T00:00:00.000Z\n\nDate.makeWithYM(~year=2023, ~month=-1)\n// 2022-12-01T00:00:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYM: (~year: int, ~month: int) => t" - }, - { - "id": "Stdlib.Date.makeWithYMD", - "kind": "value", - "name": "makeWithYMD", - "docstrings": [ - "Creates a date object with the given year, month and date (day of month).\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMD(~year=2023, ~month=1, ~day=20)\n// 2023-02-20T00:00:00.000Z\n\nDate.makeWithYMD(~year=2023, ~month=1, ~day=-1)\n// 2022-11-29T00:00:00.000Z\n\nDate.makeWithYMD(~year=2023, ~month=1, ~day=29)\n// 2023-03-01T00:00:00.000Z\n```" - ], - "signature": "let makeWithYMD: (~year: int, ~month: int, ~day: int) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDH", - "kind": "value", - "name": "makeWithYMDH", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month) and hours.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=16)\n// 2023-02-20T16:00:00.000Z\n\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=24)\n// 2023-02-21T00:00:00.000Z\n\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=-1)\n// 2023-02-19T23:00:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDH: (~year: int, ~month: int, ~day: int, ~hours: int) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDHM", - "kind": "value", - "name": "makeWithYMDHM", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours and minutes.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=60)\n// 2023-02-20T17:00:00.000Z\n\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=-1)\n// 2023-02-20T15:59:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDHM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDHMS", - "kind": "value", - "name": "makeWithYMDHMS", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours, minutes and seconds.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=60)\n// 2023-02-20T16:41:00.000Z\n\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=-1)\n// 2023-02-20T16:39:59.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDHMS: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => t" - }, - { - "id": "Stdlib.Date.makeWithYMDHMSM", - "kind": "value", - "name": "makeWithYMDHMSM", - "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours, minutes, seconds and milliseconds.\nBe aware of using a value for year \\< 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\\_Objects/Date\\#interpretation\\_of\\_two-digit\\_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=0,\n)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=1000,\n)\n// 2023-02-20T16:40:01.000Z\n\nDate.makeWithYMDHMSM(\n ~year=2023,\n ~month=1,\n ~day=20,\n ~hours=16,\n ~minutes=40,\n ~seconds=0,\n ~milliseconds=-1,\n)\n// 2023-02-20T16:39:59.999Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n```" - ], - "signature": "let makeWithYMDHMSM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => t" - }, - { - "id": "Stdlib.Date.now", - "kind": "value", - "name": "now", - "docstrings": [ - "`now()`\n\nReturns the time, in milliseconds, between UNIX epoch (January 1, 1970 00:00:00 UTC) and the current date time." - ], - "signature": "let now: unit => msSinceEpoch" - }, - { - "id": "Stdlib.Date.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(date1, date2)` checks if two dates represent the same point in time.\n\n## Examples\n```rescript\nDate.equal(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-01\")) == true\nDate.equal(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-02\")) == false\n```" - ], - "signature": "let equal: (t, t) => bool" - }, - { - "id": "Stdlib.Date.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(date1, date2)` compares two dates chronologically, returns an `Ordering.t` value.\n\n## Examples\n```rescript\nDate.compare(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-01\")) == Ordering.equal\nDate.compare(Date.fromString(\"2023-01-01\"), Date.fromString(\"2023-01-02\")) == Ordering.less\nDate.compare(Date.fromString(\"2023-01-02\"), Date.fromString(\"2023-01-01\")) == Ordering.greater\n```" - ], - "signature": "let compare: (t, t) => Ordering.t" - }, - { - "id": "Stdlib.Date.getTime", - "kind": "value", - "name": "getTime", - "docstrings": [ - "`getTime(date)`\n\nReturns the time, in milliseconds, between UNIX epoch (January 1, 1970 00:00:00 UTC) and the current date time.\nInvalid dates will return NaN.\nDates before epoch will return negative numbers.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20\")->Date.getTime\n// 1676851200000\n```" - ], - "signature": "let getTime: t => msSinceEpoch" - }, - { - "id": "Stdlib.Date.getTimezoneOffset", - "kind": "value", - "name": "getTimezoneOffset", - "docstrings": [ - "`getTimezoneOffset(date)`\n\nReturns the time in minutes between the UTC time and the locale time.\nThe timezone of the given date doesn't matter.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01\")->Date.getTimezoneOffset\n// -60 with local time zone = Europe/Berlin\n\nDate.fromString(\"2023-06-01\")->Date.getTimezoneOffset\n// -120 with local time zone = Europe/Berlin\n```" - ], - "signature": "let getTimezoneOffset: t => int" - }, - { - "id": "Stdlib.Date.getFullYear", - "kind": "value", - "name": "getFullYear", - "docstrings": [ - "`getFullYear(date)`\n\nReturns the year of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20\")->Date.getFullYear\n// 2023\n```" - ], - "signature": "let getFullYear: t => int" - }, - { - "id": "Stdlib.Date.getMonth", - "kind": "value", - "name": "getMonth", - "docstrings": [ - "`getMonth(date)`\n\nReturns the month (0-indexed) of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01\")->Date.getMonth\n// 0\n```" - ], - "signature": "let getMonth: t => int" - }, - { - "id": "Stdlib.Date.getDate", - "kind": "value", - "name": "getDate", - "docstrings": [ - "`getDate(date)`\n\nReturns the date (day of month) of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getDate\n// 20\n```" - ], - "signature": "let getDate: t => int" - }, - { - "id": "Stdlib.Date.getHours", - "kind": "value", - "name": "getHours", - "docstrings": [ - "`getHours(date)`\n\nReturns the hours of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getHours\n// 16\n```" - ], - "signature": "let getHours: t => int" - }, - { - "id": "Stdlib.Date.getMinutes", - "kind": "value", - "name": "getMinutes", - "docstrings": [ - "`getMinutes(date)`\n\nReturns the minutes of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getMinutes\n// 40\n```" - ], - "signature": "let getMinutes: t => int" - }, - { - "id": "Stdlib.Date.getSeconds", - "kind": "value", - "name": "getSeconds", - "docstrings": [ - "`getSeconds(date)`\n\nReturns the seconds of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getSeconds\n// 0\n```" - ], - "signature": "let getSeconds: t => int" - }, - { - "id": "Stdlib.Date.getMilliseconds", - "kind": "value", - "name": "getMilliseconds", - "docstrings": [ - "`getMilliseconds(date)`\n\nReturns the milliseconds of a given date (according to local time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getMilliseconds\n// 0\n```" - ], - "signature": "let getMilliseconds: t => int" - }, - { - "id": "Stdlib.Date.getDay", - "kind": "value", - "name": "getDay", - "docstrings": [ - "`getDay(date)`\n\nReturns the day of week of a given date (according to local time).\n0 = Sunday, 1 = Monday, ... 6 = Saturday\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.getDay\n// 1\n```" - ], - "signature": "let getDay: t => int" - }, - { - "id": "Stdlib.Date.setFullYear", - "kind": "value", - "name": "setFullYear", - "docstrings": [ - "`setFullYear(date, year)`\n\nSets the year of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYear(2024)\n```" - ], - "signature": "let setFullYear: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setFullYearM", - "kind": "value", - "name": "setFullYearM", - "docstrings": [ - "`setFullYearM(date, ~year, ~month)`\n\nSets the year and month of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYearM(~year=2024, ~month=0)\n```" - ], - "signature": "let setFullYearM: (t, ~year: int, ~month: int) => unit" - }, - { - "id": "Stdlib.Date.setFullYearMD", - "kind": "value", - "name": "setFullYearMD", - "docstrings": [ - "`setFullYearMD(date, ~year, ~month, ~day)`\n\nSets the year, month and date (day of month) of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYearMD(~year=2024, ~month=0, ~day=1)\n```" - ], - "signature": "let setFullYearMD: (t, ~year: int, ~month: int, ~day: int) => unit" - }, - { - "id": "Stdlib.Date.setMonth", - "kind": "value", - "name": "setMonth", - "docstrings": [ - "`setMonth(date, month)`\n\nSets the month of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMonth(0)\n```" - ], - "signature": "let setMonth: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setDate", - "kind": "value", - "name": "setDate", - "docstrings": [ - "`setDate(date, day)`\n\nSets the date (day of month) of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setDate(1)\n```" - ], - "signature": "let setDate: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setHours", - "kind": "value", - "name": "setHours", - "docstrings": [ - "`setHours(date, hours)`\n\nSets the hours of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHours(0)\n```" - ], - "signature": "let setHours: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setHoursM", - "kind": "value", - "name": "setHoursM", - "docstrings": [ - "`setHoursM(date, ~hours, ~minutes)`\n\nSets the hours and minutes of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHoursM(~hours=0, ~minutes=0)\n```" - ], - "signature": "let setHoursM: (t, ~hours: int, ~minutes: int) => unit" - }, - { - "id": "Stdlib.Date.setHoursMS", - "kind": "value", - "name": "setHoursMS", - "docstrings": [ - "`setHoursMS(date, ~hours, ~minutes, ~seconds)`\n\nSets the hours, minutes and seconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHoursMS(~hours=0, ~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setHoursMS: (t, ~hours: int, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setHoursMSMs", - "kind": "value", - "name": "setHoursMSMs", - "docstrings": [ - "`setHoursMSMs(date, ~hours, ~minutes, ~seconds, ~milliseconds)`\n\nSets the hours, minutes, seconds and milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setHoursMSMs(\n ~hours=0,\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setHoursMSMs: (\n t,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setMinutes", - "kind": "value", - "name": "setMinutes", - "docstrings": [ - "`setMinutes(date, minutes)`\n\nSets the minutes of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMinutes(0)\n```" - ], - "signature": "let setMinutes: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setMinutesS", - "kind": "value", - "name": "setMinutesS", - "docstrings": [ - "`setMinutesS(date, ~minutes, ~seconds)`\n\nSets the minutes and seconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMinutesS(~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setMinutesS: (t, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setMinutesSMs", - "kind": "value", - "name": "setMinutesSMs", - "docstrings": [ - "`setMinutesSMs(date, ~minutes, ~seconds, ~milliseconds)`\n\nSets the minutes, seconds and milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMinutesSMs(\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setMinutesSMs: (\n t,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setSeconds", - "kind": "value", - "name": "setSeconds", - "docstrings": [ - "`setSeconds(date, seconds)`\n\nSets the seconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setSeconds(0)\n```" - ], - "signature": "let setSeconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setSecondsMs", - "kind": "value", - "name": "setSecondsMs", - "docstrings": [ - "`setSecondsMs(date, ~seconds, ~milliseconds)`\n\nSets the seconds and milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setSecondsMs(~seconds=0, ~milliseconds=0)\n```" - ], - "signature": "let setSecondsMs: (t, ~seconds: int, ~milliseconds: int) => unit" - }, - { - "id": "Stdlib.Date.setMilliseconds", - "kind": "value", - "name": "setMilliseconds", - "docstrings": [ - "`setMilliseconds(date, milliseconds)`\n\nSets the milliseconds of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setMilliseconds(0)\n```" - ], - "signature": "let setMilliseconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.getUTCFullYear", - "kind": "value", - "name": "getUTCFullYear", - "docstrings": [ - "`getUTCFullYear(date)`\n\nReturns the year of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCFullYear // 2022\n```" - ], - "signature": "let getUTCFullYear: t => int" - }, - { - "id": "Stdlib.Date.getUTCMonth", - "kind": "value", - "name": "getUTCMonth", - "docstrings": [ - "`getUTCMonth(date)`\n\nReturns the month of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCMonth // 11\n```" - ], - "signature": "let getUTCMonth: t => int" - }, - { - "id": "Stdlib.Date.getUTCDate", - "kind": "value", - "name": "getUTCDate", - "docstrings": [ - "`getUTCDate(date)`\n\nReturns the date (day of month) of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCDate // 31\n```" - ], - "signature": "let getUTCDate: t => int" - }, - { - "id": "Stdlib.Date.getUTCHours", - "kind": "value", - "name": "getUTCHours", - "docstrings": [ - "`getUTCHours(date)`\n\nReturns the hours of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCHours // 23\n```" - ], - "signature": "let getUTCHours: t => int" - }, - { - "id": "Stdlib.Date.getUTCMinutes", - "kind": "value", - "name": "getUTCMinutes", - "docstrings": [ - "`getUTCMinutes(date)`\n\nReturns the minutes of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCMinutes // 0\n```" - ], - "signature": "let getUTCMinutes: t => int" - }, - { - "id": "Stdlib.Date.getUTCSeconds", - "kind": "value", - "name": "getUTCSeconds", - "docstrings": [ - "`getUTCSeconds(date)`\n\nReturns the seconds of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCSeconds // 0\n```" - ], - "signature": "let getUTCSeconds: t => int" - }, - { - "id": "Stdlib.Date.getUTCMilliseconds", - "kind": "value", - "name": "getUTCMilliseconds", - "docstrings": [ - "`getUTCMilliseconds(date)`\n\nReturns the milliseconds of a given date (according to UTC time).\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCMilliseconds // 0\n```" - ], - "signature": "let getUTCMilliseconds: t => int" - }, - { - "id": "Stdlib.Date.getUTCDay", - "kind": "value", - "name": "getUTCDay", - "docstrings": [ - "`getUTCDay(date)`\n\nReturns the day (day of week) of a given date (according to UTC time).\n0 = Sunday, 1 = Monday, ... 6 = Saturday\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.getUTCDay // 6\n```" - ], - "signature": "let getUTCDay: t => int" - }, - { - "id": "Stdlib.Date.setUTCFullYear", - "kind": "value", - "name": "setUTCFullYear", - "docstrings": [ - "`setUTCFullYear(date, year)`\n\nSets the year of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYear(2024)\n```" - ], - "signature": "let setUTCFullYear: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCFullYearM", - "kind": "value", - "name": "setUTCFullYearM", - "docstrings": [ - "`setUTCFullYearM(date, ~year, ~month)`\n\nSets the year and month of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYearM(~year=2024, ~month=0)\n```" - ], - "signature": "let setUTCFullYearM: (t, ~year: int, ~month: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCFullYearMD", - "kind": "value", - "name": "setUTCFullYearMD", - "docstrings": [ - "`setUTCFullYearMD(date, ~year, ~month, ~day)`\n\nSets the year, month and date (day of month) of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYearMD(~year=2024, ~month=0, ~day=1)\n```" - ], - "signature": "let setUTCFullYearMD: (t, ~year: int, ~month: int, ~day: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMonth", - "kind": "value", - "name": "setUTCMonth", - "docstrings": [ - "`setUTCMonth(date, month)`\n\nSets the month of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMonth(0)\n```" - ], - "signature": "let setUTCMonth: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCDate", - "kind": "value", - "name": "setUTCDate", - "docstrings": [ - "`setDate(date, day)`\n\nSets the date (day of month) of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCDate(1)\n```" - ], - "signature": "let setUTCDate: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHours", - "kind": "value", - "name": "setUTCHours", - "docstrings": [ - "`setUTCHours(date, hours)`\n\nSets the hours of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHours(0)\n```" - ], - "signature": "let setUTCHours: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHoursM", - "kind": "value", - "name": "setUTCHoursM", - "docstrings": [ - "`setHoursM(date, ~hours, ~minutes)`\n\nSets the hours and minutes of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHoursM(~hours=0, ~minutes=0)\n```" - ], - "signature": "let setUTCHoursM: (t, ~hours: int, ~minutes: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHoursMS", - "kind": "value", - "name": "setUTCHoursMS", - "docstrings": [ - "`setUTCHoursMS(date, ~hours, ~minutes, ~seconds)`\n\nSets the hours, minutes and seconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHoursMS(~hours=0, ~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setUTCHoursMS: (t, ~hours: int, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCHoursMSMs", - "kind": "value", - "name": "setUTCHoursMSMs", - "docstrings": [ - "`setUTCHoursMSMs(date, ~hours, ~minutes, ~seconds, ~milliseconds)`\n\nSets the hours, minutes, seconds and milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCHoursMSMs(\n ~hours=0,\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setUTCHoursMSMs: (\n t,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setUTCMinutes", - "kind": "value", - "name": "setUTCMinutes", - "docstrings": [ - "`setUTCMinutes(date, minutes)`\n\nSets the minutes of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMinutes(0)\n```" - ], - "signature": "let setUTCMinutes: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMinutesS", - "kind": "value", - "name": "setUTCMinutesS", - "docstrings": [ - "`setUTCMinutesS(date, ~minutes, ~seconds)`\n\nSets the minutes and seconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMinutesS(~minutes=0, ~seconds=0)\n```" - ], - "signature": "let setUTCMinutesS: (t, ~minutes: int, ~seconds: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMinutesSMs", - "kind": "value", - "name": "setUTCMinutesSMs", - "docstrings": [ - "`setUTCMinutesSMs(date, ~minutes, ~seconds, ~milliseconds)`\n\nSets the minutes, seconds and milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMinutesSMs(\n ~minutes=0,\n ~seconds=0,\n ~milliseconds=0,\n)\n```" - ], - "signature": "let setUTCMinutesSMs: (\n t,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" - }, - { - "id": "Stdlib.Date.setUTCSeconds", - "kind": "value", - "name": "setUTCSeconds", - "docstrings": [ - "`setUTCSeconds(date, seconds)`\n\nSets the seconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCSeconds(0)\n```" - ], - "signature": "let setUTCSeconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.setUTCSecondsMs", - "kind": "value", - "name": "setUTCSecondsMs", - "docstrings": [ - "`setUTCSecondsMs(date, ~seconds, ~milliseconds)`\n\nSets the seconds and milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCSecondsMs(~seconds=0, ~milliseconds=0)\n```" - ], - "signature": "let setUTCSecondsMs: (t, ~seconds: int, ~milliseconds: int) => unit" - }, - { - "id": "Stdlib.Date.setUTCMilliseconds", - "kind": "value", - "name": "setUTCMilliseconds", - "docstrings": [ - "`setUTCMilliseconds(date, milliseconds)`\n\nSets the milliseconds of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCMilliseconds(0)\n```" - ], - "signature": "let setUTCMilliseconds: (t, int) => unit" - }, - { - "id": "Stdlib.Date.toDateString", - "kind": "value", - "name": "toDateString", - "docstrings": [ - "`toDateString(date)`\n\nConverts a JavaScript date to a standard date string. The date will be mapped to the current time zone.\nIf you want to convert it to a localized string, use `Date.toLocaleDateString` instead.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.toDateString->Console.log\n// Sun Jan 01 2023\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toDateString->Console.log\n// Sat Dec 31 2022\n```" - ], - "signature": "let toDateString: t => string" - }, - { - "id": "Stdlib.Date.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(date)`\n\nConverts a JavaScript date to a standard date time string. The date will be mapped to the current time zone.\nIf you want to convert it to a localized string, use `Date.toLocaleString` instead.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.toString->Console.log\n// Sun Jan 01 2023 00:00:00 GMT+0100 (Central European Standard Time)\n\nDate.fromString(\"2023-06-01T00:00:00.00+01:00\")->Date.toString->Console.log\n// Thu Jun 01 2023 01:00:00 GMT+0200 (Central European Summer Time)\n```" - ], - "signature": "let toString: t => string" - }, - { - "id": "Stdlib.Date.toTimeString", - "kind": "value", - "name": "toTimeString", - "docstrings": [ - "`toTimeString(date)`\n\nConverts a JavaScript date to a standard time string. The date will be mapped to the current time zone.\nIf you want to convert it to a localized string, use `Date.toLocaleStimeString` instead.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+01:00\")->Date.toTimeString->Console.log\n// 00:00:00 GMT+0100 (Central European Standard Time)\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toTimeString->Console.log\n// 17:00:00 GMT+0100 (Central European Standard Time)\n```" - ], - "signature": "let toTimeString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleDateString", - "kind": "value", - "name": "toLocaleDateString", - "docstrings": [ - "`toLocaleDateString(date)`\n\nConverts a JavaScript date to a localized date string. It will use the current locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleDateString->Console.log\n// 2/19/2023\n```" - ], - "signature": "let toLocaleDateString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleDateStringWithLocale", - "kind": "value", - "name": "toLocaleDateStringWithLocale", - "docstrings": [ - "`toLocaleDateStringWithLocale(date, locale)`\n\nConverts a JavaScript date to a localized date string. It will use the specified locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleDateStringWithLocale(\"en-US\")->Console.log\n// 2/19/2023\n```" - ], - "signature": "let toLocaleDateStringWithLocale: (t, string) => string" - }, - { - "id": "Stdlib.Date.toLocaleDateStringWithLocaleAndOptions", - "kind": "value", - "name": "toLocaleDateStringWithLocaleAndOptions", - "docstrings": [ - "`toLocaleDateStringWithLocaleAndOptions(date, locale, options)`\n\nConverts a JavaScript date to a localized date string. It will use the specified locale and formatting options.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleDateStringWithLocaleAndOptions(\"en-US\", {dateStyle: #long})->Console.log\n// February 19, 2023\n\nDate.make()\n->Date.toLocaleDateStringWithLocaleAndOptions(\"de\", {hour: #\"2-digit\", minute: #\"2-digit\"})\n->Console.log\n// 19.2.2023, 15:40\n\nDate.make()->Date.toLocaleDateStringWithLocaleAndOptions(\"de\", {year: #numeric})->Console.log\n// 2023\n```" - ], - "signature": "let toLocaleDateStringWithLocaleAndOptions: (t, string, localeOptions) => string" - }, - { - "id": "Stdlib.Date.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(date)`\n\nConverts a JavaScript date to a localized date-time string. It will use the current locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleString->Console.log\n// 2/19/2023, 3:40:00 PM\n```" - ], - "signature": "let toLocaleString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleStringWithLocale", - "kind": "value", - "name": "toLocaleStringWithLocale", - "docstrings": [ - "`toLocaleStringWithLocale(date, locale)`\n\nConverts a JavaScript date to a localized date-time string. It will use the specified locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleStringWithLocale(\"en-US\")->Console.log\n// 2/19/2023, 3:40:00 PM\n```" - ], - "signature": "let toLocaleStringWithLocale: (t, string) => string" - }, - { - "id": "Stdlib.Date.toLocaleStringWithLocaleAndOptions", - "kind": "value", - "name": "toLocaleStringWithLocaleAndOptions", - "docstrings": [ - "`toLocaleStringWithLocaleAndOptions(date, locale, options)`\n\nConverts a JavaScript date to a localized date-time string. It will use the specified locale and formatting options.\n\n## Examples\n```rescript\nDate.make()\n->Date.toLocaleStringWithLocaleAndOptions(\"en\", {dateStyle: #short, timeStyle: #short})\n->Console.log\n// 2/19/23, 3:40 PM\n\nDate.make()\n->Date.toLocaleStringWithLocaleAndOptions(\n \"en\",\n {\n era: #long,\n year: #numeric,\n month: #\"2-digit\",\n day: #\"2-digit\",\n hour: #numeric,\n timeZoneName: #short,\n },\n)\n->Console.log\n// 02/19/2023 Anno Domini, 3 PM GMT+1\n```" - ], - "signature": "let toLocaleStringWithLocaleAndOptions: (t, string, localeOptions) => string" - }, - { - "id": "Stdlib.Date.toLocaleTimeString", - "kind": "value", - "name": "toLocaleTimeString", - "docstrings": [ - "`toLocaleTimeString(date)`\n\nConverts a JavaScript date to a localized time string. It will use the current locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleTimeString->Console.log\n// 3:40:00 PM\n```" - ], - "signature": "let toLocaleTimeString: t => string" - }, - { - "id": "Stdlib.Date.toLocaleTimeStringWithLocale", - "kind": "value", - "name": "toLocaleTimeStringWithLocale", - "docstrings": [ - "`toLocaleTimeStringWithLocale(date, locale)`\n\nConverts a JavaScript date to a localized time string. It will use the specified locale.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleTimeStringWithLocale(\"en-US\")->Console.log\n// 3:40:00 PM\n```" - ], - "signature": "let toLocaleTimeStringWithLocale: (t, string) => string" - }, - { - "id": "Stdlib.Date.toLocaleTimeStringWithLocaleAndOptions", - "kind": "value", - "name": "toLocaleTimeStringWithLocaleAndOptions", - "docstrings": [ - "`toLocaleTimeStringWithLocaleAndOptions(date, locale, options)`\n\nConverts a JavaScript date to a localized time string. It will use the specified locale and formatting options.\n\n## Examples\n```rescript\nDate.make()->Date.toLocaleTimeStringWithLocaleAndOptions(\"en-US\", {timeStyle: #long})->Console.log\n// 3:40:00 PM GMT+1\n\nDate.make()\n->Date.toLocaleTimeStringWithLocaleAndOptions(\"de\", {hour: #\"2-digit\", minute: #\"2-digit\"})\n->Console.log\n// 15:40\n```" - ], - "signature": "let toLocaleTimeStringWithLocaleAndOptions: (t, string, localeOptions) => string" - }, - { - "id": "Stdlib.Date.toISOString", - "kind": "value", - "name": "toISOString", - "docstrings": [ - "`toISOString(date)`\n\nConverts a JavaScript date to a ISO 8601 string (YYYY-MM-DDTHH:mm:ss.sssZ). The date will be mapped to the UTC time.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toISOString->Console.log\n// 2023-01-01T00:00:00.000Z\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toISOString->Console.log\n// 2022-12-31T16:00:00.000Z\n```" - ], - "signature": "let toISOString: t => string" - }, - { - "id": "Stdlib.Date.toUTCString", - "kind": "value", - "name": "toUTCString", - "docstrings": [ - "`toUTCString(date)`\n\nConverts a JavaScript date to date time string. The date will be mapped to the UTC time.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toUTCString->Console.log\n// Sun, 01 Jan 2023 00:00:00 GMT\n\nDate.fromString(\"2023-01-01T00:00:00.00+08:00\")->Date.toUTCString->Console.log\n// Sat, 31 Dec 2022 16:00:00 GMT\n```" - ], - "signature": "let toUTCString: t => string" - }, - { - "id": "Stdlib.Date.toJSON", - "kind": "value", - "name": "toJSON", - "docstrings": [ - "`toJSON(date)`\n\nConverts a JavaScript date to a string.\nIf the date is valid, the function will return the same result as `Date.toISOString`.\nInvalid dates will return `None`.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toJSON\n// Some(\"2023-01-01T00:00:00.000Z\")\n\nDate.fromString(\"\")->Date.toJSON\n// None\n```" - ], - "signature": "let toJSON: t => option" - }, - { - "id": "Stdlib.Date.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(date)` ignores the provided date and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/dataview": { - "id": "Stdlib.DataView", - "name": "DataView", - "docstrings": [ - "Functions for interacting with DataView.\n\nSee [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN." - ], - "items": [ - { - "id": "Stdlib.DataView.t", - "kind": "type", - "name": "t", - "docstrings": ["Type representing a DataView."], - "signature": "type t" - }, - { - "id": "Stdlib.DataView.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer(buffer)` creates a DataView for the entire ArrayBuffer.\n\nSee [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN.\n\n## Examples\n\n```rescript\nDataView.fromBuffer(ArrayBuffer.make(16))\nDataView.fromBuffer(ArrayBuffer.make(16), ~byteOffset=4)\nDataView.fromBuffer(ArrayBuffer.make(16), ~byteOffset=4, ~length=8)\n```" - ], - "signature": "let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t" - }, - { - "id": "Stdlib.DataView.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd(buffer, ~byteOffset)` creates a DataView starting at a given byte offset. See [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN.\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.\n\n## Examples\n\n```rescript\nDataView.fromBufferToEnd(buffer, ~byteOffset=4)\n```" - ], - "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.DataView.fromBufferWithRange", - "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange(buffer, ~byteOffset, ~length)` creates a DataView for a specific byte range.\n\nSee [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) on MDN.\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.\n\n## Examples\n\n```rescript\nDataView.fromBufferWithRange(ArrayBuffer.make(16), ~byteOffset=2, ~length=8)\n```" - ], - "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t", - "deprecated": "" - }, - { - "id": "Stdlib.DataView.buffer", - "kind": "value", - "name": "buffer", - "docstrings": [ - "`buffer(dataView)` returns the underlying ArrayBuffer referenced by this DataView.\n\nSee [`DataView.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/buffer) on MDN.\n\n## Examples\n\n```rescript\nlet array_buffer = ArrayBuffer.make(16)\nlet dv = DataView.fromBuffer(array_buffer)\nDataView.buffer(dv) == array_buffer\n```" - ], - "signature": "let buffer: t => ArrayBuffer.t" - }, - { - "id": "Stdlib.DataView.byteLength", - "kind": "value", - "name": "byteLength", - "docstrings": [ - "`byteLength(dataView)` returns the length (in bytes) of this DataView.\n\nSee [`DataView.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet array_buffer = ArrayBuffer.make(16)\nlet dv = DataView.fromBuffer(array_buffer)\nDataView.byteLength(dv) == 16\n```" - ], - "signature": "let byteLength: t => int" - }, - { - "id": "Stdlib.DataView.byteOffset", - "kind": "value", - "name": "byteOffset", - "docstrings": [ - "`byteOffset(dataView)` returns the byte offset of this DataView from the start of its ArrayBuffer.\n\nSee [`DataView.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/byteOffset) on MDN.\n\n## Examples\n\n```rescript\nlet array_buffer = ArrayBuffer.make(16)\nlet dv = DataView.fromBuffer(array_buffer, ~byteOffset=4)\nDataView.byteOffset(dv) == 4\n```" - ], - "signature": "let byteOffset: t => int" - }, - { - "id": "Stdlib.DataView.getInt8", - "kind": "value", - "name": "getInt8", - "docstrings": [ - "`getInt8(dataView, offset)` reads an 8-bit signed integer at the specified byte offset.\n\nSee [`DataView.getInt8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setInt8(0, -12)\nDataView.getInt8(dv, 0) == -12\n```" - ], - "signature": "let getInt8: (t, int) => int" - }, - { - "id": "Stdlib.DataView.getUint8", - "kind": "value", - "name": "getUint8", - "docstrings": [ - "`getUint8(dataView, offset)` reads an 8-bit unsigned integer at the specified byte offset.\n\nSee [`DataView.getUint8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setUint8(1, 255)\nDataView.getUint8(dv, 1) == 255\n```" - ], - "signature": "let getUint8: (t, int) => int" - }, - { - "id": "Stdlib.DataView.getInt16", - "kind": "value", - "name": "getInt16", - "docstrings": [ - "`getInt16(dataView, offset, ~littleEndian=?)` reads a 16-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getInt16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setInt16(0, -1234)\ndv->DataView.setInt16(2, -1234, ~littleEndian=true)\nDataView.getInt16(dv, 0) == -1234\nDataView.getInt16(dv, 2, ~littleEndian=true) == -1234\n```" - ], - "signature": "let getInt16: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getUint16", - "kind": "value", - "name": "getUint16", - "docstrings": [ - "`getUint16(dataView, offset, ~littleEndian=?)` reads a 16-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getUint16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setUint16(0, 1234)\ndv->DataView.setUint16(2, 1234, ~littleEndian=true)\nDataView.getUint16(dv, 0) == 1234\nDataView.getUint16(dv, 2, ~littleEndian=true) == 1234\n```" - ], - "signature": "let getUint16: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getInt32", - "kind": "value", - "name": "getInt32", - "docstrings": [ - "`getInt32(dataView, offset, ~littleEndian=?)` reads a 32-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getInt32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setInt32(0, -123456)\ndv->DataView.setInt32(4, -123456, ~littleEndian=true)\nDataView.getInt32(dv, 0) == -123456\nDataView.getInt32(dv, 4, ~littleEndian=true) == -123456\n```" - ], - "signature": "let getInt32: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getUint32", - "kind": "value", - "name": "getUint32", - "docstrings": [ - "`getUint32(dataView, offset, ~littleEndian=?)` reads a 32-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.getUint32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setUint32(0, 123456)\ndv->DataView.setUint32(4, 123456, ~littleEndian=true)\nDataView.getUint32(dv, 0) == 123456\nDataView.getUint32(dv, 4, ~littleEndian=true) == 123456\n```" - ], - "signature": "let getUint32: (t, int, ~littleEndian: bool=?) => int" - }, - { - "id": "Stdlib.DataView.getFloat16", - "kind": "value", - "name": "getFloat16", - "docstrings": [ - "`getFloat16(dataView, offset, ~littleEndian=?)` reads a 16-bit floating point number (if supported) at the specified byte offset, with optional endianness.\n\nSee [`DataView.getFloat16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat16) on MDN.\n\n## Examples\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setFloat16(0, 1.5)\ndv->DataView.setFloat16(2, 1.5, ~littleEndian=true)\nDataView.getFloat16(dv, 0) == 1.5\nDataView.getFloat16(dv, 2, ~littleEndian=true) == 1.5\n```" - ], - "signature": "let getFloat16: (t, int, ~littleEndian: bool=?) => float" - }, - { - "id": "Stdlib.DataView.getFloat32", - "kind": "value", - "name": "getFloat32", - "docstrings": [ - "`getFloat32(dataView, offset, ~littleEndian=?)` reads a 32-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.getFloat32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setFloat32(0, 3.14)\ndv->DataView.setFloat32(4, 3.14, ~littleEndian=true)\n// DataView.getFloat32(dv, 0) == 3.14\n// DataView.getFloat32(dv, 4, ~littleEndian=true) == 3.14\n```" - ], - "signature": "let getFloat32: (t, int, ~littleEndian: bool=?) => float" - }, - { - "id": "Stdlib.DataView.getFloat64", - "kind": "value", - "name": "getFloat64", - "docstrings": [ - "`getFloat64(dataView, offset, ~littleEndian=?)` reads a 64-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.getFloat64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setFloat64(0, 6.28)\ndv->DataView.setFloat64(8, 6.28, ~littleEndian=true)\nDataView.getFloat64(dv, 0) == 6.28\nDataView.getFloat64(dv, 8, ~littleEndian=true) == 6.28\n```" - ], - "signature": "let getFloat64: (t, int, ~littleEndian: bool=?) => float" - }, - { - "id": "Stdlib.DataView.getBigInt64", - "kind": "value", - "name": "getBigInt64", - "docstrings": [ - "`getBigInt64(dataView, offset, ~littleEndian=?)` reads a 64-bit signed integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.getBigInt64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getBigInt64) on MDN.\n\n## Examples\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setBigInt64(0, -123456789n)\ndv->DataView.setBigInt64(8, -123456789n, ~littleEndian=true)\nDataView.getBigInt64(dv, 0) == -123456789n\nDataView.getBigInt64(dv, 8, ~littleEndian=true) == -123456789n\n```" - ], - "signature": "let getBigInt64: (t, int, ~littleEndian: bool=?) => bigint" - }, - { - "id": "Stdlib.DataView.getBigUint64", - "kind": "value", - "name": "getBigUint64", - "docstrings": [ - "`getBigUint64(dataView, offset, ~littleEndian=?)` reads a 64-bit unsigned integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.getBigUint64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getBigUint64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\ndv->DataView.setBigUint64(0, 123456789n)\ndv->DataView.setBigUint64(8, 123456789n, ~littleEndian=true)\nDataView.getBigUint64(dv, 0) == 123456789n\nDataView.getBigUint64(dv, 8, ~littleEndian=true) == 123456789n\n```" - ], - "signature": "let getBigUint64: (t, int, ~littleEndian: bool=?) => bigint" - }, - { - "id": "Stdlib.DataView.setInt8", - "kind": "value", - "name": "setInt8", - "docstrings": [ - "`setInt8(dataView, offset, value)` writes an 8-bit signed integer at the specified byte offset.\n\nSee [`DataView.setInt8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setInt8(dv, 0, -12)\ndv->DataView.getInt8(0) == -12\n```" - ], - "signature": "let setInt8: (t, int, int) => unit" - }, - { - "id": "Stdlib.DataView.setUint8", - "kind": "value", - "name": "setUint8", - "docstrings": [ - "`setUint8(dataView, offset, value)` writes an 8-bit unsigned integer at the specified byte offset.\n\nSee [`DataView.setUint8`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint8) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setUint8(dv, 0, 255)\ndv->DataView.getUint8(0) == 255\n```" - ], - "signature": "let setUint8: (t, int, int) => unit" - }, - { - "id": "Stdlib.DataView.setInt16", - "kind": "value", - "name": "setInt16", - "docstrings": [ - "`setInt16(dataView, offset, value, ~littleEndian=?)` writes a 16-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setInt16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setInt16(dv, 0, -1234)\nDataView.setInt16(dv, 2, -1234, ~littleEndian=true)\ndv->DataView.getInt16(0) == -1234\ndv->DataView.getInt16(2, ~littleEndian=true) == -1234\n```" - ], - "signature": "let setInt16: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setUint16", - "kind": "value", - "name": "setUint16", - "docstrings": [ - "`setUint16(dataView, offset, value, ~littleEndian=?)` writes a 16-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setUint16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setUint16(dv, 0, 1234)\nDataView.setUint16(dv, 2, 1234, ~littleEndian=true)\ndv->DataView.getUint16(0) == 1234\ndv->DataView.getUint16(2, ~littleEndian=true) == 1234\n```" - ], - "signature": "let setUint16: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setInt32", - "kind": "value", - "name": "setInt32", - "docstrings": [ - "`setInt32(dataView, offset, value, ~littleEndian=?)` writes a 32-bit signed integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setInt32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setInt32(dv, 0, -123456)\nDataView.setInt32(dv, 4, -123456, ~littleEndian=true)\ndv->DataView.getInt32(0) == -123456\ndv->DataView.getInt32(4, ~littleEndian=true) == -123456\n```" - ], - "signature": "let setInt32: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setUint32", - "kind": "value", - "name": "setUint32", - "docstrings": [ - "`setUint32(dataView, offset, value, ~littleEndian=?)` writes a 32-bit unsigned integer at the specified byte offset, with optional endianness.\n\nSee [`DataView.setUint32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setUint32(dv, 0, 123456)\nDataView.setUint32(dv, 4, 123456, ~littleEndian=true)\ndv->DataView.getUint32(0) == 123456\ndv->DataView.getUint32(4, ~littleEndian=true) == 123456\n```" - ], - "signature": "let setUint32: (t, int, int, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setFloat16", - "kind": "value", - "name": "setFloat16", - "docstrings": [ - "`setFloat16(dataView, offset, value, ~littleEndian=?)` writes a 16-bit floating point number (if supported) at the specified byte offset, with optional endianness.\n\nSee [`DataView.setFloat16`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat16) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setFloat16(dv, 0, 1.5)\nDataView.setFloat16(dv, 2, 1.5, ~littleEndian=true)\ndv->DataView.getFloat16(0) == 1.5\ndv->DataView.getFloat16(2, ~littleEndian=true) == 1.5\n```" - ], - "signature": "let setFloat16: (t, int, float, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setFloat32", - "kind": "value", - "name": "setFloat32", - "docstrings": [ - "`setFloat32(dataView, offset, value, ~littleEndian=?)` writes a 32-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.setFloat32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat32) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setFloat32(dv, 0, 3.14)\nDataView.setFloat32(dv, 4, 3.14, ~littleEndian=true)\n// dv->DataView.getFloat32(0) == 3.14\n// dv->DataView.getFloat32(4, ~littleEndian=true) == 3.14\n```" - ], - "signature": "let setFloat32: (t, int, float, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setFloat64", - "kind": "value", - "name": "setFloat64", - "docstrings": [ - "`setFloat64(dataView, offset, value, ~littleEndian=?)` writes a 64-bit floating point number at the specified byte offset, with optional endianness.\n\nSee [`DataView.setFloat64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setFloat64(dv, 0, 6.28)\nDataView.setFloat64(dv, 8, 6.28, ~littleEndian=true)\ndv->DataView.getFloat64(0) == 6.28\ndv->DataView.getFloat64(8, ~littleEndian=true) == 6.28\n```" - ], - "signature": "let setFloat64: (t, int, float, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setBigInt64", - "kind": "value", - "name": "setBigInt64", - "docstrings": [ - "`setBigInt64(dataView, offset, value, ~littleEndian=?)` writes a 64-bit signed integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.setBigInt64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setBigInt64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setBigInt64(dv, 0, -123456789n)\nDataView.setBigInt64(dv, 8, -123456789n, ~littleEndian=true)\ndv->DataView.getBigInt64(0) == -123456789n\ndv->DataView.getBigInt64(8, ~littleEndian=true) == -123456789n\n```" - ], - "signature": "let setBigInt64: (t, int, bigint, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.setBigUint64", - "kind": "value", - "name": "setBigUint64", - "docstrings": [ - "`setBigUint64(dataView, offset, value, ~littleEndian=?)` writes a 64-bit unsigned integer (BigInt) at the specified byte offset, with optional endianness.\n\nSee [`DataView.setBigUint64`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setBigUint64) on MDN.\n\n## Examples\n\n```rescript\nlet dv = DataView.fromBuffer(ArrayBuffer.make(16))\nDataView.setBigUint64(dv, 0, 123456789n)\nDataView.setBigUint64(dv, 8, 123456789n, ~littleEndian=true)\ndv->DataView.getBigUint64(0) == 123456789n\ndv->DataView.getBigUint64(8, ~littleEndian=true) == 123456789n\n```" - ], - "signature": "let setBigUint64: (t, int, bigint, ~littleEndian: bool=?) => unit" - }, - { - "id": "Stdlib.DataView.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(dataView)` ignores the provided DataView and returns unit.\n\nThis helper is useful when you want to discard a value (for example, the result of an operation with side effects) without having to store or process it further." - ], - "signature": "let ignore: t => unit" - } - ] - }, - "stdlib/console": { - "id": "Stdlib.Console", - "name": "Console", - "docstrings": [ - "Functions for interacting with JavaScript console.\n\nSee: [`console`](https://developer.mozilla.org/en-US/docs/Web/API/Console)." - ], - "items": [ - { - "id": "Stdlib.Console.assert_", - "kind": "value", - "name": "assert_", - "docstrings": [ - "`assert_(assertion, value)` print a message to console if `assertion` evaluates `false`. Does nothing if it's `true`.\n\nSee [`console.assert`](https://developer.mozilla.org/en-US/docs/Web/API/console/assert)\non MDN.\n\n## Examples\n\n```rescript\nConsole.assert_(false, \"Hello World!\")\nConsole.assert_(42 === 42, \"The answer\")\n```" - ], - "signature": "let assert_: (bool, 'a) => unit" - }, - { - "id": "Stdlib.Console.assert2", - "kind": "value", - "name": "assert2", - "docstrings": [ - "`assert2(v1, v2)`. Like `assert_`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.assert2(false, \"Hello\", \"World\")\nConsole.assert2(42 === 42, [1, 2, 3], '4')\n```" - ], - "signature": "let assert2: (bool, 'a, 'b) => unit" - }, - { - "id": "Stdlib.Console.assert3", - "kind": "value", - "name": "assert3", - "docstrings": [ - "`assert3(v1, v2, v3)`. Like `assert_`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.assert3(false, \"Hello\", \"World\", \"ReScript\")\nConsole.assert3(42 === 42, \"One\", 2, #3)\n```" - ], - "signature": "let assert3: (bool, 'a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.assert4", - "kind": "value", - "name": "assert4", - "docstrings": [ - "`assert4(v1, v2, v3, v4)`. Like `assert_`, but with four arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert4(false, \"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.assert4(value === 42, [1, 2], (3, 4), [#5, #6], #polyvar)\n```" - ], - "signature": "let assert4: (bool, 'a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.assert5", - "kind": "value", - "name": "assert5", - "docstrings": [ - "`assert5(v1, v2, v3, v4, v5)`. Like `assert_`, but with five arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert5(false, \"Hello\", \"World\", \"JS\", '!', '!')\nConsole.assert5(value === 42, [1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let assert5: (bool, 'a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.assert6", - "kind": "value", - "name": "assert6", - "docstrings": [ - "`assert6(v1, v2)`. Like `assert_`, but with six arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert6(false, \"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.assert6(value === 42, [1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let assert6: (bool, 'a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.assertMany", - "kind": "value", - "name": "assertMany", - "docstrings": [ - "`assertMany(assertion, arr)`. Like `assert_`, but variadic.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assertMany(false, [\"Hello\", \"World\"])\nConsole.assertMany(value === 42, [1, 2, 3])\n```" - ], - "signature": "let assertMany: (bool, array<'a>) => unit" - }, - { - "id": "Stdlib.Console.clear", - "kind": "value", - "name": "clear", - "docstrings": [ - "`clear()` clears the console, if allowed.\n\nSee [`console.clear`](https://developer.mozilla.org/en-US/docs/Web/API/console/clear)\non MDN.\n\n## Examples\n\n```rescript\nConsole.clear()\n```" - ], - "signature": "let clear: unit => unit" - }, - { - "id": "Stdlib.Console.count", - "kind": "value", - "name": "count", - "docstrings": [ - "`count(label)` prints to the console the number of times it's been called with the given label.\n\nSee [`console.count`](https://developer.mozilla.org/en-US/docs/Web/API/console/count)\non MDN.\n\n## Examples\n\n```rescript\nConsole.count(\"rescript\")\n```" - ], - "signature": "let count: string => unit" - }, - { - "id": "Stdlib.Console.countReset", - "kind": "value", - "name": "countReset", - "docstrings": [ - "`countReset(label)` resets the count for the given label to 0.\n\nSee [`console.countReset`](https://developer.mozilla.org/en-US/docs/Web/API/console/countReset)\non MDN.\n\n## Examples\n\n```rescript\nConsole.countReset(\"rescript\")\n```" - ], - "signature": "let countReset: string => unit" - }, - { - "id": "Stdlib.Console.debug", - "kind": "value", - "name": "debug", - "docstrings": [ - "`debug(value)` print a debug message to console.\n\nSee [`console.debug`](https://developer.mozilla.org/en-US/docs/Web/API/console/debug)\non MDN.\n\n## Examples\n\n```rescript\nConsole.debug(\"Hello\")\nlet obj = {\"name\": \"ReScript\", \"version\": 10}\nConsole.debug(obj)\n```" - ], - "signature": "let debug: 'a => unit" - }, - { - "id": "Stdlib.Console.debug2", - "kind": "value", - "name": "debug2", - "docstrings": [ - "`debug2(v1, v2)`. Like `debug`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.debug2(\"Hello\", \"World\")\nConsole.debug2([1, 2, 3], '4')\n```" - ], - "signature": "let debug2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.debug3", - "kind": "value", - "name": "debug3", - "docstrings": [ - "`debug3(v1, v2, v3)`. Like `debug`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.debug3(\"Hello\", \"World\", \"ReScript\")\nConsole.debug3(\"One\", 2, #3)\n```" - ], - "signature": "let debug3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.debug4", - "kind": "value", - "name": "debug4", - "docstrings": [ - "`debug4(v1, v2, v3, v4)`. Like `debug`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.debug4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.debug4([1, 2], (3, 4), [#5, #6], #polyvar)\n```" - ], - "signature": "let debug4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.debug5", - "kind": "value", - "name": "debug5", - "docstrings": [ - "`debug5(v1, v2, v3, v4, v5)`. Like `debug`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.debug5(\"Hello\", \"World\", \"JS\", '!', '!')\nConsole.debug5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let debug5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.debug6", - "kind": "value", - "name": "debug6", - "docstrings": [ - "`debug6(v1, v2, v3, v4, v5, v6)`. Like `debug`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.debug6(\"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.debug6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let debug6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.debugMany", - "kind": "value", - "name": "debugMany", - "docstrings": [ - "`debugMany(arr)`. Like `debug`, but variadic.\n\n## Examples\n\n```rescript\nConsole.debugMany([\"Hello\", \"World\"])\nConsole.debugMany([1, 2, 3])\n```" - ], - "signature": "let debugMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.dirOptions", - "kind": "type", - "name": "dirOptions", - "docstrings": [], - "signature": "type dirOptions = {\n colors?: bool,\n depth?: Nullable.t,\n showHidden?: bool,\n}" - }, - { - "id": "Stdlib.Console.dir", - "kind": "value", - "name": "dir", - "docstrings": [ - "`dir(object, options)` displays an interactive view of the object in the console.\n\nSee [`console.dir`](https://developer.mozilla.org/en-US/docs/Web/API/console/dir)\non MDN.\n\n## Examples\n\n```rescript\nConsole.dir({\"language\": \"rescript\", \"version\": \"10.1.2\"})\nConsole.dir(\n {\"language\": \"rescript\", \"version\": {\"major\": \"10\", \"minor\": \"1\", \"patch\": \"2\"}},\n ~options={depth: null},\n)\n```" - ], - "signature": "let dir: ('a, ~options: dirOptions=?) => unit" - }, - { - "id": "Stdlib.Console.dirxml", - "kind": "value", - "name": "dirxml", - "docstrings": [ - "`dirxml(object)` displays an interactive tree view of an XML/HTML element in the console.\n\nSee [`console.dirxml`](https://developer.mozilla.org/en-US/docs/Web/API/console/dirxml)\non MDN." - ], - "signature": "let dirxml: 'a => unit" - }, - { - "id": "Stdlib.Console.error", - "kind": "value", - "name": "error", - "docstrings": [ - "`error(value)` prints an error message to console.\n\nSee [`console.error`](https://developer.mozilla.org/en-US/docs/Web/API/console/error)\non MDN.\n\n## Examples\n\n```rescript\nConsole.error(\"error message\")\nConsole.error((\"error\", \"invalid value\"))\n```" - ], - "signature": "let error: 'a => unit" - }, - { - "id": "Stdlib.Console.error2", - "kind": "value", - "name": "error2", - "docstrings": [ - "`error(v1, v2)`. Like `error`, but two arguments.\n\n## Examples\n\n```rescript\nConsole.error2(\"Error\", \"here\")\nConsole.error2((\"log\", \"error\"), \"message\")\n```" - ], - "signature": "let error2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.error3", - "kind": "value", - "name": "error3", - "docstrings": [ - "`error3(v1, v2, v3)`. Like `error`, but three arguments.\n\n## Examples\n\n```rescript\nConsole.error3(\"Hello\", \"World\", \"!!!\")\nConsole.error3(#first, #second, #third)\n```" - ], - "signature": "let error3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.error4", - "kind": "value", - "name": "error4", - "docstrings": [ - "`error4(v1, v2, v3, v4)`. Like `error`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.error4(\"Hello\", \"World\", \"ReScript\", '!')\nConsole.error4(#first, #second, #third, \"fourth\")\n```" - ], - "signature": "let error4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.error5", - "kind": "value", - "name": "error5", - "docstrings": [ - "`error5(v1, v2, v3, v4, v5)`. Like `error`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.error5('e', 'r', 'r', 'o', 'r')\nConsole.error5(1, #second, #third, \"fourth\", 'c')\n```" - ], - "signature": "let error5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.error6", - "kind": "value", - "name": "error6", - "docstrings": [ - "`error6(v1, v2, v3, v4, v5, v6)`. Like `error`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.error6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.error6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let error6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.group", - "kind": "value", - "name": "group", - "docstrings": [ - "`group(label)` creates a new \"group\" level with the given label.\n\nSee [`console.group`](https://developer.mozilla.org/en-US/docs/Web/API/console/group)\non MDN.\n\n## Example\n\n```rescript\nConsole.group(\"first group\")\nConsole.group(\"second group\")\nConsole.log(\"a message on the second level\")\nConsole.groupEnd()\nConsole.log(\"a message message on the first level\")\nConsole.groupEnd()\n```" - ], - "signature": "let group: string => unit" - }, - { - "id": "Stdlib.Console.groupCollapsed", - "kind": "value", - "name": "groupCollapsed", - "docstrings": [ - "`groupCollapsed(label)`. Like `group` but collapses the group initially.\n\nSee [`console.groupCollapsed`](https://developer.mozilla.org/en-US/docs/Web/API/console/groupCollapsed)\non MDN." - ], - "signature": "let groupCollapsed: string => unit" - }, - { - "id": "Stdlib.Console.groupEnd", - "kind": "value", - "name": "groupEnd", - "docstrings": [ - "`groupEnd()` ends the current group.\n\nSee [`console.groupEnd`](https://developer.mozilla.org/en-US/docs/Web/API/console/groupEnd)\non MDN." - ], - "signature": "let groupEnd: unit => unit" - }, - { - "id": "Stdlib.Console.errorMany", - "kind": "value", - "name": "errorMany", - "docstrings": [ - "`errorMany(arr)`. Like `error`, but variadic.\n\n## Examples\n\n```rescript\nConsole.errorMany([\"Hello\", \"World\"])\nConsole.errorMany([1, 2, 3])\n```" - ], - "signature": "let errorMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.info", - "kind": "value", - "name": "info", - "docstrings": [ - "`info(value)` print an informational message to console.\n\nSee [`console.info`](https://developer.mozilla.org/en-US/docs/Web/API/console/info)\non MDN.\n\n## Examples\n\n```rescript\nConsole.info(\"Information\")\nConsole.info((\"Hello\", \"JS\"))\n```" - ], - "signature": "let info: 'a => unit" - }, - { - "id": "Stdlib.Console.info2", - "kind": "value", - "name": "info2", - "docstrings": [ - "`info2(v1, v2)`. Like `info`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.info2(\"Info\", \"failed to download\")\nConsole.info2(#info, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let info2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.info3", - "kind": "value", - "name": "info3", - "docstrings": [ - "`info3(v1, v2, v3)`. Like `info`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.info3(\"Hello\", \"World\", \"ReScript\")\nConsole.info3([1, 2, 3], #4, #5)\n```" - ], - "signature": "let info3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.info4", - "kind": "value", - "name": "info4", - "docstrings": [ - "`info4(v1, v2, v3, v4)`. Like `info`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.info4(\"Hello\", \"World\", \"ReScript\", '!')\nConsole.info4([1, 2, 3], #4, #5, #lastinfo)\n```" - ], - "signature": "let info4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.info5", - "kind": "value", - "name": "info5", - "docstrings": [ - "`info5(v1, v2, v3, v4, v5)`. Like `info`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.info5(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\")\nConsole.info5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let info5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.info6", - "kind": "value", - "name": "info6", - "docstrings": [ - "`info6(v1, v2, v3, v4, v5, v6)`. Like `info`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.info6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.info6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let info6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.infoMany", - "kind": "value", - "name": "infoMany", - "docstrings": [ - "`infoMany(arr)`. Like `info`, but variadic.\n\n## Examples\n\n```rescript\nConsole.infoMany([\"Hello\", \"World\"])\nConsole.infoMany([1, 2, 3])\n```" - ], - "signature": "let infoMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.log", - "kind": "value", - "name": "log", - "docstrings": [ - "`log(value)` print a message to console.\n\nSee [`console.log`](https://developer.mozilla.org/en-US/docs/Web/API/console/log)\non MDN.\n\n## Examples\n\n```rescript\nConsole.log(\"Hello\")\nlet obj = {\"name\": \"ReScript\", \"version\": 10}\nConsole.log(obj)\n```" - ], - "signature": "let log: 'a => unit" - }, - { - "id": "Stdlib.Console.log2", - "kind": "value", - "name": "log2", - "docstrings": [ - "`log2(v1, v2)`. Like `log`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.log2(\"Hello\", \"World\")\nConsole.log2([1, 2, 3], '4')\n```" - ], - "signature": "let log2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.log3", - "kind": "value", - "name": "log3", - "docstrings": [ - "`log3(v1, v2, v3)`. Like `log`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.log3(\"Hello\", \"World\", \"ReScript\")\nConsole.log3(\"One\", 2, #3)\n```" - ], - "signature": "let log3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.log4", - "kind": "value", - "name": "log4", - "docstrings": [ - "`log4(v1, v2, v3, v4)`. Like `log`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.log4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.log4([1, 2], (3, 4), [#5, #6], #polyvar)\n```" - ], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.log5", - "kind": "value", - "name": "log5", - "docstrings": [ - "`log5(v1, v2, v3, v4, v5)`. Like `log`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.log5(\"Hello\", \"World\", \"JS\", '!', '!')\nConsole.log5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let log5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.log6", - "kind": "value", - "name": "log6", - "docstrings": [ - "`log6(v1, v2, v3, v4, v5, v6)`. Like `log`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.log6(\"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.log6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let log6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.logMany", - "kind": "value", - "name": "logMany", - "docstrings": [ - "`logMany(arr)`. Like `log`, but variadic.\n\n## Examples\n\n```rescript\nConsole.logMany([\"Hello\", \"World\"])\nConsole.logMany([1, 2, 3])\n```" - ], - "signature": "let logMany: array<'a> => unit" - }, - { - "id": "Stdlib.Console.table", - "kind": "value", - "name": "table", - "docstrings": [ - "`table(object)` displays an tabular view of the object in the console.\n\nSee [`console.table`](https://developer.mozilla.org/en-US/docs/Web/API/console/table)\non MDN.\n\n## Examples\n\n```rescript\nConsole.table({\"language\": \"rescript\", \"version\": \"10.1.2\"})\n```" - ], - "signature": "let table: 'a => unit" - }, - { - "id": "Stdlib.Console.time", - "kind": "value", - "name": "time", - "docstrings": [ - "`time(label)` creates a timer to measure how long an operation takes. `label`\nmust be a unique name. Call `console.timeEnd` with the same `label` to print\noutput time.\n\nSee [`console.time`](https://developer.mozilla.org/en-US/docs/Web/API/console/time)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let time: string => unit" - }, - { - "id": "Stdlib.Console.timeEnd", - "kind": "value", - "name": "timeEnd", - "docstrings": [ - "`timeEnd(label)` stops a timer created by `time`.\n\nSee [`console.timeEnd`](https://developer.mozilla.org/en-US/docs/Web/API/console/timeEnd)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let timeEnd: string => unit" - }, - { - "id": "Stdlib.Console.timeLog", - "kind": "value", - "name": "timeLog", - "docstrings": [ - "`timeLog(label)` prints the current elapsed time of the given timer to the console.\n\nSee [`console.timeLog`](https://developer.mozilla.org/en-US/docs/Web/API/console/timeLog)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let timeLog: string => unit" - }, - { - "id": "Stdlib.Console.trace", - "kind": "value", - "name": "trace", - "docstrings": [ - "`trace()` print a stack trace to console.\n\nSee [`console.trace`](https://developer.mozilla.org/en-US/docs/Web/API/console/trace)\non MDN.\n\n## Examples\n\n```rescript\nlet main = () => {\n Console.trace()\n}\nmain()\n// In the console, the following trace will be displayed:\n// main\n// \n```" - ], - "signature": "let trace: unit => unit" - }, - { - "id": "Stdlib.Console.warn", - "kind": "value", - "name": "warn", - "docstrings": [ - "`warn(value)` print a warning message to console.\n\nSee [`console.warn`](https://developer.mozilla.org/en-US/docs/Web/API/console/warn)\non MDN.\n\n## Examples\n\n```rescript\nConsole.warn(\"Warning\")\nConsole.warn((\"Warning\", \"invalid number\"))\n```" - ], - "signature": "let warn: 'a => unit" - }, - { - "id": "Stdlib.Console.warn2", - "kind": "value", - "name": "warn2", - "docstrings": [ - "`warn2(v1, v2)`. Like `warn`, but two arguments.\n\n## Examples\n\n```rescript\nConsole.warn2(\"Hello\", \"World\")\nConsole.warn2([1, 2, 3], 4)\n```" - ], - "signature": "let warn2: ('a, 'b) => unit" - }, - { - "id": "Stdlib.Console.warn3", - "kind": "value", - "name": "warn3", - "docstrings": [ - "`warn3(v1, v2, v3)`. Like `warn`, but three arguments.\n\n## Examples\n\n```rescript\nConsole.warn3(\"Hello\", \"World\", \"ReScript\")\nConsole.warn3([1, 2, 3], #4, #5)\n```" - ], - "signature": "let warn3: ('a, 'b, 'c) => unit" - }, - { - "id": "Stdlib.Console.warn4", - "kind": "value", - "name": "warn4", - "docstrings": [ - "`warn4(v1, v2, v3, v4)`. Like `warn`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.warn4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.warn4(#first, #second, #third, \"fourth\")\n```" - ], - "signature": "let warn4: ('a, 'b, 'c, 'd) => unit" - }, - { - "id": "Stdlib.Console.warn5", - "kind": "value", - "name": "warn5", - "docstrings": [ - "`warn5(v1, v2, v3, v4, v5)`. Like `warn`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.warn5(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\")\nConsole.warn5([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"})\n```" - ], - "signature": "let warn5: ('a, 'b, 'c, 'd, 'e) => unit" - }, - { - "id": "Stdlib.Console.warn6", - "kind": "value", - "name": "warn6", - "docstrings": [ - "`warn6(v1, v2, v3, v4, v5, v6)`. Like `warn`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.warn6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.warn6([1, 2], (3, 4), [#5, #6], #polyvar, {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let warn6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" - }, - { - "id": "Stdlib.Console.warnMany", - "kind": "value", - "name": "warnMany", - "docstrings": [ - "`warnMany(arr)`. Like `warn`, but variadic.\n\n## Examples\n\n```rescript\nConsole.warnMany([\"Hello\", \"World\"])\nConsole.warnMany([1, 2, 3])\n```" - ], - "signature": "let warnMany: array<'a> => unit" - } - ] - }, - "stdlib/bool": { - "id": "Stdlib.Bool", - "name": "Bool", - "docstrings": [ - "Functions for interacting with JavaScript booleans.\nSee: [`Boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)" - ], - "items": [ - { - "id": "Stdlib.Bool.t", - "kind": "type", - "name": "t", - "docstrings": ["Type representing a boolean."], - "signature": "type t = bool" - }, - { - "id": "Stdlib.Bool.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Converts a boolean to a string.\n\n## Examples\n```rescript\nBool.toString(true) == \"true\"\nBool.toString(false) == \"false\"\n```" - ], - "signature": "let toString: bool => string" - }, - { - "id": "Stdlib.Bool.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Converts a string to a boolean.\n\n## Examples\n```rescript\nBool.fromString(\"true\") == Some(true)\nBool.fromString(\"false\") == Some(false)\nBool.fromString(\"notAValidBoolean\") == None\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.Bool.fromStringOrThrow", - "kind": "value", - "name": "fromStringOrThrow", - "docstrings": [ - "Converts a string to a boolean.\nThrows an `Invalid_argument` exception if the string is not a valid boolean.\n\n## Examples\n```rescript\nBool.fromStringOrThrow(\"true\") == true\nBool.fromStringOrThrow(\"false\") == false\nswitch Bool.fromStringOrThrow(\"notAValidBoolean\") {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let fromStringOrThrow: string => bool" - }, - { - "id": "Stdlib.Bool.fromStringExn", - "kind": "value", - "name": "fromStringExn", - "docstrings": [ - "Converts a string to a boolean.\nBeware, this function will throw an `Invalid_argument` exception\nif the string is not a valid boolean.\n\n## Examples\n```rescript\nBool.fromStringExn(\"true\") == true\nBool.fromStringExn(\"false\") == false\nswitch Bool.fromStringExn(\"notAValidBoolean\") {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```" - ], - "signature": "let fromStringExn: string => bool", - "deprecated": "" - }, - { - "id": "Stdlib.Bool.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "Compares two booleans, returns an `Ordering.t` value.\n\n## Examples\n```rescript\nBool.compare(true, true) == Ordering.equal\nBool.compare(false, false) == Ordering.equal\nBool.compare(true, false) == Ordering.greater\nBool.compare(false, true) == Ordering.less\n```" - ], - "signature": "let compare: (bool, bool) => Ordering.t" - }, - { - "id": "Stdlib.Bool.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "Checks if two booleans are equal and have the same value.\n\n## Examples\n```rescript\nBool.equal(true, true) == true\nBool.equal(false, false) == true\nBool.equal(true, false) == false\nBool.equal(false, true) == false\n```" - ], - "signature": "let equal: (bool, bool) => bool" - } - ] - }, - "stdlib/bigint": { - "id": "Stdlib.BigInt", - "name": "BigInt", - "docstrings": [], - "items": [ - { - "id": "Stdlib.BigInt.t", - "kind": "type", - "name": "t", - "docstrings": ["Type representing a bigint."], - "signature": "type t = bigint" - }, - { - "id": "Stdlib.BigInt.asIntN", - "kind": "value", - "name": "asIntN", - "docstrings": [ - "`asIntN(~width, bigint)` returns a bigint value truncated to the given number of bits as a signed integer.\n\nSee [`BigInt.asIntN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/asIntN) on MDN.\n\n## Examples\n\n```rescript\nBigInt.asIntN(~width=4, 25n) == -7n\nBigInt.asIntN(~width=4, 3n) == 3n\n```" - ], - "signature": "let asIntN: (~width: int, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.asUintN", - "kind": "value", - "name": "asUintN", - "docstrings": [ - "`asUintN(~width, bigint)` returns a bigint value truncated to the given number of bits as an unsigned integer.\n\nSee [`BigInt.asUintN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/asUintN) on MDN.\n\n## Examples\n\n```rescript\nBigInt.asUintN(~width=4, 25n) == 9n\nBigInt.asUintN(~width=4, 3n) == 3n\n```" - ], - "signature": "let asUintN: (~width: int, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.fromStringOrThrow", - "kind": "value", - "name": "fromStringOrThrow", - "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Return the\nnumber as a `bigint` if successfully parsed. Throws a syntax exception otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromStringOrThrow(\"123\") == 123n\n\nBigInt.fromStringOrThrow(\"\") == 0n\n\nBigInt.fromStringOrThrow(\"0x11\") == 17n\n\nBigInt.fromStringOrThrow(\"0b11\") == 3n\n\nBigInt.fromStringOrThrow(\"0o11\") == 9n\n\n/* catch exception */\nswitch BigInt.fromStringOrThrow(\"a\") {\n| exception JsExn(_error) => assert(true)\n| _bigInt => assert(false)\n}\n```" - ], - "signature": "let fromStringOrThrow: string => bigint" - }, - { - "id": "Stdlib.BigInt.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Returns\n`Some(bigint)` if the string can be parsed, `None` otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromString(\"123\") == Some(123n)\n\nBigInt.fromString(\"\") == Some(0n)\n\nBigInt.fromString(\"0x11\") == Some(17n)\n\nBigInt.fromString(\"0b11\") == Some(3n)\n\nBigInt.fromString(\"0o11\") == Some(9n)\n\nBigInt.fromString(\"invalid\") == None\n```" - ], - "signature": "let fromString: string => option" - }, - { - "id": "Stdlib.BigInt.fromStringExn", - "kind": "value", - "name": "fromStringExn", - "docstrings": [], - "signature": "let fromStringExn: string => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.fromInt", - "kind": "value", - "name": "fromInt", - "docstrings": [ - "`fromInt(int)` converts an `int` to a `bigint`.\n\n## Examples\n\n```rescript\nBigInt.fromInt(123) == 123n\nBigInt.fromInt(0) == 0n\nBigInt.fromInt(-456) == -456n\n```" - ], - "signature": "let fromInt: int => bigint" - }, - { - "id": "Stdlib.BigInt.fromFloatOrThrow", - "kind": "value", - "name": "fromFloatOrThrow", - "docstrings": [ - "Converts a `float` to a `bigint` using JavaScript semantics.\nThrows an exception if the float is not an integer or is infinite/NaN.\n\n## Examples\n\n```rescript\nBigInt.fromFloatOrThrow(123.0) == 123n\n\nBigInt.fromFloatOrThrow(0.0) == 0n\n\nBigInt.fromFloatOrThrow(-456.0) == -456n\n\n/* This will throw an exception */\nswitch BigInt.fromFloatOrThrow(123.5) {\n| exception JsExn(_error) => assert(true)\n| _bigInt => assert(false)\n}\n```" - ], - "signature": "let fromFloatOrThrow: float => bigint" - }, - { - "id": "Stdlib.BigInt.fromFloat", - "kind": "value", - "name": "fromFloat", - "docstrings": [ - "`fromFloat(float)` converts a `float` to a `bigint` using JavaScript semantics.\nReturns `Some(bigint)` if the float is a valid `bigint`, `None` otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromFloat(123.0) == Some(123n)\nBigInt.fromFloat(0.0) == Some(0n)\nBigInt.fromFloat(-456.0) == Some(-456n)\nBigInt.fromFloat(123.5) == None\n```" - ], - "signature": "let fromFloat: float => option" - }, - { - "id": "Stdlib.BigInt.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "Formats a `bigint` as a string. Return a `string` representing the given value.\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nBigInt.toString(123n) == \"123\"\n```" - ], - "signature": "let toString: (bigint, ~radix: int=?) => string" - }, - { - "id": "Stdlib.BigInt.toStringWithRadix", - "kind": "value", - "name": "toStringWithRadix", - "docstrings": [], - "signature": "let toStringWithRadix: (bigint, ~radix: int) => string", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "Returns a string with a language-sensitive representation of this BigInt value.\n\n## Examples\n\n```rescript\nBigInt.toString(123n) == \"123\"\n```" - ], - "signature": "let toLocaleString: bigint => string" - }, - { - "id": "Stdlib.BigInt.toFloat", - "kind": "value", - "name": "toFloat", - "docstrings": [ - "`toFloat(bigint)` converts a `bigint` to a `float`.\n\n## Examples\n\n```rescript\nBigInt.toFloat(123n) == 123.0\nBigInt.toFloat(0n) == 0.0\nBigInt.toFloat(-456n) == -456.0\n```" - ], - "signature": "let toFloat: bigint => float" - }, - { - "id": "Stdlib.BigInt.toInt", - "kind": "value", - "name": "toInt", - "docstrings": [ - "`toInt(bigint)` converts a `bigint` to an `int`.\n\n## Examples\n\n```rescript\nBigInt.toInt(123n) == 123\nBigInt.toInt(0n) == 0\nBigInt.toInt(-456n) == -456\n```" - ], - "signature": "let toInt: bigint => int" - }, - { - "id": "Stdlib.BigInt.add", - "kind": "value", - "name": "add", - "docstrings": [ - "`add(a, b)` calculates the sum of two bigints.\n\n## Examples\n\n```rescript\nBigInt.add(5n, 3n) == 8n\nBigInt.add(-2n, 7n) == 5n\n```" - ], - "signature": "let add: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.sub", - "kind": "value", - "name": "sub", - "docstrings": [ - "`sub(a, b)` calculates the difference of two bigints.\n\n## Examples\n\n```rescript\nBigInt.sub(8n, 3n) == 5n\nBigInt.sub(2n, 7n) == -5n\n```" - ], - "signature": "let sub: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.mul", - "kind": "value", - "name": "mul", - "docstrings": [ - "`mul(a, b)` calculates the product of two bigints.\n\n## Examples\n\n```rescript\nBigInt.mul(5n, 3n) == 15n\nBigInt.mul(-2n, 7n) == -14n\n```" - ], - "signature": "let mul: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.div", - "kind": "value", - "name": "div", - "docstrings": [ - "`div(a, b)` calculates the quotient of two bigints.\n\n## Examples\n\n```rescript\nBigInt.div(15n, 3n) == 5n\nBigInt.div(14n, 3n) == 4n\n```" - ], - "signature": "let div: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.mod", - "kind": "value", - "name": "mod", - "docstrings": [ - "`mod(a, b)` calculates the remainder of dividing two bigints.\n\n## Examples\n\n```rescript\nBigInt.mod(15n, 4n) == 3n\nBigInt.mod(14n, 3n) == 2n\n```" - ], - "signature": "let mod: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseAnd", - "kind": "value", - "name": "bitwiseAnd", - "docstrings": [ - "`bitwiseAnd(a, b)` calculates the bitwise AND of two bigints.\n\n## Examples\n\n```rescript\nBigInt.bitwiseAnd(7n, 4n) == 4n\nBigInt.bitwiseAnd(15n, 8n) == 8n\n```" - ], - "signature": "let bitwiseAnd: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseOr", - "kind": "value", - "name": "bitwiseOr", - "docstrings": [ - "`bitwiseOr(a, b)` calculates the bitwise OR of two bigints.\n\n## Examples\n\n```rescript\nBigInt.bitwiseOr(7n, 4n) == 7n\nBigInt.bitwiseOr(8n, 4n) == 12n\n```" - ], - "signature": "let bitwiseOr: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseXor", - "kind": "value", - "name": "bitwiseXor", - "docstrings": [ - "`bitwiseXor(a, b)` calculates the bitwise XOR of two bigints.\n\n## Examples\n\n```rescript\nBigInt.bitwiseXor(7n, 4n) == 3n\nBigInt.bitwiseXor(15n, 8n) == 7n\n```" - ], - "signature": "let bitwiseXor: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.bitwiseNot", - "kind": "value", - "name": "bitwiseNot", - "docstrings": [ - "`bitwiseNot(bigint)` calculates the bitwise NOT of a bigint.\n\n## Examples\n\n```rescript\nBigInt.bitwiseNot(2n) == -3n\nBigInt.bitwiseNot(-1n) == 0n\n```" - ], - "signature": "let bitwiseNot: bigint => bigint" - }, - { - "id": "Stdlib.BigInt.shiftLeft", - "kind": "value", - "name": "shiftLeft", - "docstrings": [ - "`shiftLeft(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the left.\n\n## Examples\n\n```rescript\nBigInt.shiftLeft(4n, 1n) == 8n\nBigInt.shiftLeft(1n, 3n) == 8n\n```" - ], - "signature": "let shiftLeft: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.shiftRight", - "kind": "value", - "name": "shiftRight", - "docstrings": [ - "`shiftRight(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the right.\n\n## Examples\n\n```rescript\nBigInt.shiftRight(8n, 1n) == 4n\nBigInt.shiftRight(16n, 2n) == 4n\n```" - ], - "signature": "let shiftRight: (bigint, bigint) => bigint" - }, - { - "id": "Stdlib.BigInt.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(bigint)` ignores the provided bigint and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: bigint => unit" - }, - { - "id": "Stdlib.BigInt.land", - "kind": "value", - "name": "land", - "docstrings": [ - "`land(a, b)` calculates the bitwise AND of two bigints.\n\n**Deprecated:** Use `&&&` operator or `bitwiseAnd` instead.\n\n## Examples\n\n```rescript\nBigInt.land(7n, 4n) == 4n\n```" - ], - "signature": "let land: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lor", - "kind": "value", - "name": "lor", - "docstrings": [ - "`lor(a, b)` calculates the bitwise OR of two bigints.\n\n**Deprecated:** Use `|||` operator or `bitwiseOr` instead.\n\n## Examples\n\n```rescript\nBigInt.lor(7n, 4n) == 7n\n```" - ], - "signature": "let lor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lxor", - "kind": "value", - "name": "lxor", - "docstrings": [ - "`lxor(a, b)` calculates the bitwise XOR of two bigints.\n\n**Deprecated:** Use `^^^` operator or `bitwiseXor` instead.\n\n## Examples\n\n```rescript\nBigInt.lxor(7n, 4n) == 3n\n```" - ], - "signature": "let lxor: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lnot", - "kind": "value", - "name": "lnot", - "docstrings": [ - "`lnot(bigint)` calculates the bitwise NOT of a bigint.\n\n**Deprecated:** Use `~~~` operator or `bitwiseNot` instead.\n\n## Examples\n\n```rescript\nBigInt.lnot(2n) == -3n\n```" - ], - "signature": "let lnot: bigint => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.lsl", - "kind": "value", - "name": "lsl", - "docstrings": [ - "`lsl(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the left.\n\n**Deprecated:** Use `<<` operator or `shiftLeft` instead.\n\n## Examples\n\n```rescript\nBigInt.lsl(4n, 1n) == 8n\n```" - ], - "signature": "let lsl: (bigint, bigint) => bigint", - "deprecated": "" - }, - { - "id": "Stdlib.BigInt.asr", - "kind": "value", - "name": "asr", - "docstrings": [ - "`asr(bigint, amount)` calculates the shifted value of a bigint by `amount` bits to the right.\n\n**Deprecated:** Use `>>` operator or `shiftRight` instead.\n\n## Examples\n\n```rescript\nBigInt.asr(8n, 1n) == 4n\n```" - ], - "signature": "let asr: (bigint, bigint) => bigint", - "deprecated": "" - } - ] - }, - "stdlib/array": { - "id": "Stdlib.Array", - "name": "Array", - "docstrings": [ - "A mutable array.\n\nCompiles to a regular JavaScript array." - ], - "items": [ - { - "id": "Stdlib.Array.t", - "kind": "type", - "name": "t", - "docstrings": ["Type representing an array of value `'a`."], - "signature": "type t<'a> = array<'a>" - }, - { - "id": "Stdlib.Array.arrayLike", - "kind": "type", - "name": "arrayLike", - "docstrings": [], - "signature": "type arrayLike<'a>" - }, - { - "id": "Stdlib.Array.fromIterator", - "kind": "value", - "name": "fromIterator", - "docstrings": [ - "`fromIterator(iterator)` creates an array from the provided `iterator`\n\n## Examples\n\n```rescript\nMap.fromArray([(\"foo\", 1), (\"bar\", 2)])\n->Map.values\n->Array.fromIterator == [1, 2]\n```" - ], - "signature": "let fromIterator: Iterator.t<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.fromArrayLike", - "kind": "value", - "name": "fromArrayLike", - "docstrings": [ - "`fromArrayLike(source)` converts an array-like value (anything with indexed items and a `length`) into a regular array.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 10, 1: 20, length: 2}`)\nArray.fromArrayLike(source) == [10, 20]\n```" - ], - "signature": "let fromArrayLike: arrayLike<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.fromArrayLikeWithMap", - "kind": "value", - "name": "fromArrayLikeWithMap", - "docstrings": [ - "`fromArrayLikeWithMap(source, map)` converts an array-like value into an array and applies `map` to every element.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 1, 1: 2, length: 2}`)\nArray.fromArrayLikeWithMap(source, x => x * 10) == [10, 20]\n```" - ], - "signature": "let fromArrayLikeWithMap: (arrayLike<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Stdlib.Array.fromString", - "kind": "value", - "name": "fromString", - "docstrings": [ - "`fromString(str)` creates an array of each character as a separate string from the provided `str`.\n\n## Examples\n\n```rescript\nArray.fromString(\"abcde\") == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" - ], - "signature": "let fromString: string => array" - }, - { - "id": "Stdlib.Array.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(~length, init)` creates an array of length `length` initialized with the value of `init`.\n\n## Examples\n\n```rescript\nArray.make(~length=3, #apple) == [#apple, #apple, #apple]\nArray.make(~length=6, 7) == [7, 7, 7, 7, 7, 7]\n```" - ], - "signature": "let make: (~length: int, 'a) => array<'a>" - }, - { - "id": "Stdlib.Array.fromInitializer", - "kind": "value", - "name": "fromInitializer", - "docstrings": [ - "`fromInitializer(~length, f)`\n\nCreates an array of length `length` initialized with the value returned from `f ` for each index.\n\n## Examples\n\n```rescript\nArray.fromInitializer(~length=3, i => i + 3) == [3, 4, 5]\n\nArray.fromInitializer(~length=7, i => i + 3) == [3, 4, 5, 6, 7, 8, 9]\n```" - ], - "signature": "let fromInitializer: (~length: int, int => 'a) => array<'a>" - }, - { - "id": "Stdlib.Array.equal", - "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(left, right, predicate)` checks if the two arrays contain the same elements according to the equality `predicate`.\n\n## Examples\n\n```rescript\nArray.equal([1, 2, 3], [1, 2, 3], Int.equal) == true\nArray.equal([1, 2, 3], [1, 3, 2], Int.equal) == false\n```" - ], - "signature": "let equal: (array<'a>, array<'a>, ('a, 'a) => bool) => bool" - }, - { - "id": "Stdlib.Array.compare", - "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(left, right, comparator)` compares two arrays element by element using `comparator` and returns an `Ordering`.\n\n## Examples\n\n```rescript\nArray.compare([1, 3], [1, 2], Int.compare) == Ordering.greater\nArray.compare([1, 2], [1, 2], Int.compare) == Ordering.equal\n```" - ], - "signature": "let compare: (array<'a>, array<'a>, ('a, 'a) => Ordering.t) => Ordering.t" - }, - { - "id": "Stdlib.Array.isArray", - "kind": "value", - "name": "isArray", - "docstrings": [ - "`isArray(value)` returns `true` when `value` is a JavaScript array and `false` otherwise.\n\nSee [`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) on MDN.\n\n## Examples\n\n```rescript\nArray.isArray([1, 2, 3]) == true\nArray.isArray(\"not an array\") == false\n```" - ], - "signature": "let isArray: 'a => bool" - }, - { - "id": "Stdlib.Array.length", - "kind": "value", - "name": "length", - "docstrings": [ - "`length(array)` returns the length of (i.e. number of items in) the array.\n\nSee [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.length == 2\n```" - ], - "signature": "let length: array<'a> => int" - }, - { - "id": "Stdlib.Array.isEmpty", - "kind": "value", - "name": "isEmpty", - "docstrings": [ - "`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\n[]->Array.isEmpty->assertEqual(true)\n[1, 2, 3]->Array.isEmpty->assertEqual(false)\n\nlet emptyArray = []\nemptyArray->Array.isEmpty->assertEqual(true)\n\nlet nonEmptyArray = [\"hello\"]\nnonEmptyArray->Array.isEmpty->assertEqual(false)\n```" - ], - "signature": "let isEmpty: array<'a> => bool" - }, - { - "id": "Stdlib.Array.copyAllWithin", - "kind": "value", - "name": "copyAllWithin", - "docstrings": [ - "`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyAllWithin(~target=2) == [100, 101, 100, 101, 102]\narr == [100, 101, 100, 101, 102]\n```" - ], - "signature": "let copyAllWithin: (array<'a>, ~target: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Array.copyWithinToEnd", - "kind": "value", - "name": "copyWithinToEnd", - "docstrings": [ - "`copyWithinToEnd(array, ~target, ~start)` copies starting at element `start` in the given array to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyWithinToEnd(~target=0, ~start=2) == [102, 103, 104, 103, 104]\narr == [102, 103, 104, 103, 104]\n```" - ], - "signature": "let copyWithinToEnd: (array<'a>, ~target: int, ~start: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Array.copyWithin", - "kind": "value", - "name": "copyWithin", - "docstrings": [ - "`copyWithin(array, ~target, ~start, ~end)` copies starting at element `start` in the given array up to but not including `end` to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105]\narr->Array.copyWithin(~target=1, ~start=2, ~end=5) == [100, 102, 103, 104, 104, 105]\narr == [100, 102, 103, 104, 104, 105]\n```" - ], - "signature": "let copyWithin: (\n array<'a>,\n ~target: int,\n ~start: int,\n ~end: int=?,\n) => array<'a>" - }, - { - "id": "Stdlib.Array.fillAll", - "kind": "value", - "name": "fillAll", - "docstrings": [ - "`fillAll(array, value)` fills the entire `array` with `value`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillAll(9)\nmyArray == [9, 9, 9, 9]\n```" - ], - "signature": "let fillAll: (array<'a>, 'a) => unit", - "deprecated": "" - }, - { - "id": "Stdlib.Array.fillToEnd", - "kind": "value", - "name": "fillToEnd", - "docstrings": [ - "`fillToEnd(array, value, ~start)` fills `array` with `value` from the `start` index.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillToEnd(9, ~start=1)\nmyArray == [1, 9, 9, 9]\n```" - ], - "signature": "let fillToEnd: (array<'a>, 'a, ~start: int) => unit", - "deprecated": "" - }, - { - "id": "Stdlib.Array.fill", - "kind": "value", - "name": "fill", - "docstrings": [ - "`fill(array, value, ~start, ~end)` fills `array` with `value` from `start` to `end`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\n\nmyArray->Array.fill(9)\nmyArray == [9, 9, 9, 9]\n\nmyArray->Array.fill(0, ~start=1)\nmyArray == [9, 0, 0, 0]\n\nmyArray->Array.fill(5, ~start=1, ~end=3)\nmyArray == [9, 5, 5, 0]\n```" - ], - "signature": "let fill: (array<'a>, 'a, ~start: int=?, ~end: int=?) => unit" - }, - { - "id": "Stdlib.Array.pop", - "kind": "value", - "name": "pop", - "docstrings": [ - "`pop(array)` removes the last item from `array` and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pop == Some(\"hello\")\n\nsomeArray == [\"hi\"] // Notice last item is gone.\n```" - ], - "signature": "let pop: array<'a> => option<'a>" - }, - { - "id": "Stdlib.Array.push", - "kind": "value", - "name": "push", - "docstrings": [ - "`push(array, item)` appends `item` to the end of `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.push(\"yay\")\n\nsomeArray == [\"hi\", \"hello\", \"yay\"]\n```" - ], - "signature": "let push: (array<'a>, 'a) => unit" - }, - { - "id": "Stdlib.Array.pushMany", - "kind": "value", - "name": "pushMany", - "docstrings": [ - "`pushMany(array, itemsArray)` appends many new items to the end of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pushMany([\"yay\", \"wehoo\"])\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let pushMany: (array<'a>, array<'a>) => unit" - }, - { - "id": "Stdlib.Array.reverse", - "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(array)` reverses the order of the items in `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.reverse\n\nsomeArray == [\"hello\", \"hi\"]\n```" - ], - "signature": "let reverse: array<'a> => unit" - }, - { - "id": "Stdlib.Array.shift", - "kind": "value", - "name": "shift", - "docstrings": [ - "`shift(array)` removes the first item in the array, and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.shift == Some(\"hi\")\n\nsomeArray == [\"hello\"] // Notice first item is gone.\n```" - ], - "signature": "let shift: array<'a> => option<'a>" - }, - { - "id": "Stdlib.Array.toSorted", - "kind": "value", - "name": "toSorted", - "docstrings": [ - "`toSorted(array, comparator)` returns a new, sorted array from `array`, using the `comparator` function.\n\nSee [`Array.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [3, 2, 1]\n\nsomeArray->Array.toSorted(Int.compare) == [1, 2, 3]\n\nsomeArray == [3, 2, 1] // Original unchanged\n```" - ], - "signature": "let toSorted: (array<'a>, ('a, 'a) => Ordering.t) => array<'a>" - }, - { - "id": "Stdlib.Array.sort", - "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(array, comparator)` sorts `array` in-place using the `comparator` function.\n\nBeware this will *mutate* the array.\n\nSee [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet array = [3, 2, 1]\narray->Array.sort((a, b) => float(a - b))\narray == [1, 2, 3]\n```" - ], - "signature": "let sort: (array<'a>, ('a, 'a) => Ordering.t) => unit" - }, - { - "id": "Stdlib.Array.splice", - "kind": "value", - "name": "splice", - "docstrings": [ - "`splice(array, ~start, ~remove, ~insert)` removes `remove` items starting at `start` and inserts the values from `insert`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) on MDN.\n\n## Examples\n\n```rescript\nlet items = [\"a\", \"b\", \"c\"]\nitems->Array.splice(~start=1, ~remove=1, ~insert=[\"x\"])\nitems == [\"a\", \"x\", \"c\"]\n```" - ], - "signature": "let splice: (\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => unit" - }, - { - "id": "Stdlib.Array.toSpliced", - "kind": "value", - "name": "toSpliced", - "docstrings": [ - "`toSpliced(array, ~start, ~remove, ~insert)` returns a new array with the same edits that `splice` would perform, leaving the original unchanged.\n\nSee [`Array.toSpliced`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced) on MDN.\n\n## Examples\n\n```rescript\nlet original = [1, 2, 3]\nlet updated = original->Array.toSpliced(~start=1, ~remove=1, ~insert=[10])\nupdated == [1, 10, 3]\noriginal == [1, 2, 3]\n```" - ], - "signature": "let toSpliced: (\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => array<'a>" - }, - { - "id": "Stdlib.Array.removeInPlace", - "kind": "value", - "name": "removeInPlace", - "docstrings": [ - "`removeInPlace(array, index)` removes the item at the specified `index` from `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = []\narray->Array.removeInPlace(0)\narray == [] // Removing from an empty array does nothing\n\nlet array2 = [\"Hello\", \"Hi\", \"Good bye\"]\narray2->Array.removeInPlace(1)\narray2 == [\"Hello\", \"Good bye\"] // Removes the item at index 1\n```" - ], - "signature": "let removeInPlace: (array<'a>, int) => unit" - }, - { - "id": "Stdlib.Array.with", - "kind": "value", - "name": "with", - "docstrings": [ - "`with(array, index, value)` returns a copy of `array` where the element at `index` is replaced with `value`.\n\nSee [`Array.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/with) on MDN.\n\n## Examples\n\n```rescript\nlet original = [\"a\", \"b\", \"c\"]\nlet replaced = original->Array.with(1, \"x\")\nreplaced == [\"a\", \"x\", \"c\"]\noriginal == [\"a\", \"b\", \"c\"]\n```" - ], - "signature": "let with: (array<'a>, int, 'a) => array<'a>" - }, - { - "id": "Stdlib.Array.unshift", - "kind": "value", - "name": "unshift", - "docstrings": [ - "`unshift(array, item)` inserts a new item at the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshift(\"yay\")\nsomeArray == [\"yay\", \"hi\", \"hello\"]\n```" - ], - "signature": "let unshift: (array<'a>, 'a) => unit" - }, - { - "id": "Stdlib.Array.unshiftMany", - "kind": "value", - "name": "unshiftMany", - "docstrings": [ - "`unshiftMany(array, itemsArray)` inserts many new items to the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshiftMany([\"yay\", \"wehoo\"])\nsomeArray == [\"yay\", \"wehoo\", \"hi\", \"hello\"]\n```" - ], - "signature": "let unshiftMany: (array<'a>, array<'a>) => unit" - }, - { - "id": "Stdlib.Array.concat", - "kind": "value", - "name": "concat", - "docstrings": [ - "`concat(array1, array2)` concatenates the two arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\", \"wehoo\"]\n\nlet someArray = array1->Array.concat(array2)\n\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let concat: (array<'a>, array<'a>) => array<'a>" - }, - { - "id": "Stdlib.Array.concatMany", - "kind": "value", - "name": "concatMany", - "docstrings": [ - "`concatMany(array1, arrays)` concatenates array1 with several other arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\"]\nlet array3 = [\"wehoo\"]\n\nlet someArray = array1->Array.concatMany([array2, array3])\n\nConsole.log(someArray) // [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" - ], - "signature": "let concatMany: (array<'a>, array>) => array<'a>" - }, - { - "id": "Stdlib.Array.flat", - "kind": "value", - "name": "flat", - "docstrings": [ - "`flat(arrays)` concatenates an array of arrays into a single array.\n\nSee [`Array.flat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) on MDN.\n\n## Examples\n\n```rescript\n[[1], [2], [3, 4]]->Array.flat == [1, 2, 3, 4]\n```" - ], - "signature": "let flat: array> => array<'a>" - }, - { - "id": "Stdlib.Array.includes", - "kind": "value", - "name": "includes", - "docstrings": [ - "`includes(array, item)` checks whether `array` includes `item`, by doing a [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality).\n\nSee [`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.includes(1) == true\n[1, 2]->Array.includes(3) == false\n\n[{\"language\": \"ReScript\"}]->Array.includes({\"language\": \"ReScript\"}) == false // false, because of strict equality\n```" - ], - "signature": "let includes: (array<'a>, 'a) => bool" - }, - { - "id": "Stdlib.Array.indexOf", - "kind": "value", - "name": "indexOf", - "docstrings": [ - "`indexOf(array, item, ~from)` returns the index of the provided `item` in `array`, starting the search at `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.indexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOf(2) == 1\n[1, 2]->Array.indexOf(3) == -1\n[1, 2, 1, 2]->Array.indexOf(2, ~from=2) == 3\n\n[{\"language\": \"ReScript\"}]->Array.indexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```" - ], - "signature": "let indexOf: (array<'a>, 'a, ~from: int=?) => int" - }, - { - "id": "Stdlib.Array.indexOfOpt", - "kind": "value", - "name": "indexOfOpt", - "docstrings": [ - "`indexOfOpt(array, item)` returns an option of the index of the provided `item` in `array`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOfOpt(2) == Some(1)\n[1, 2]->Array.indexOfOpt(3) == None\n[{\"language\": \"ReScript\"}]->Array.indexOfOpt({\"language\": \"ReScript\"}) == None // None, because of strict equality\n```" - ], - "signature": "let indexOfOpt: (array<'a>, 'a) => option" - }, - { - "id": "Stdlib.Array.indexOfFrom", - "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (array<'a>, 'a, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Array.join", - "kind": "value", - "name": "join", - "docstrings": [ - "`join(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.join(\" -- \") == \"One -- Two -- Three\"\n```" - ], - "signature": "let join: (array, string) => string" - }, - { - "id": "Stdlib.Array.joinWith", - "kind": "value", - "name": "joinWith", - "docstrings": [ - "`joinWith(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinWithUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.joinWith(\" -- \") == \"One -- Two -- Three\"\n```" - ], - "signature": "let joinWith: (array, string) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Array.joinUnsafe", - "kind": "value", - "name": "joinUnsafe", - "docstrings": [ - "`joinUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```" - ], - "signature": "let joinUnsafe: (array<'a>, string) => string" - }, - { - "id": "Stdlib.Array.joinWithUnsafe", - "kind": "value", - "name": "joinWithUnsafe", - "docstrings": [ - "`joinWithUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinWithUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```" - ], - "signature": "let joinWithUnsafe: (array<'a>, string) => string", - "deprecated": "" - }, - { - "id": "Stdlib.Array.lastIndexOf", - "kind": "value", - "name": "lastIndexOf", - "docstrings": [ - "`lastIndexOf(array, item, ~from)` returns the last index of the provided `item` in `array`, searching backwards from `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.lastIndexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 1, 2]->Array.lastIndexOf(2) == 3\n[1, 2]->Array.lastIndexOf(3) == -1\n[1, 2, 1, 2]->Array.lastIndexOf(2, ~from=2) == 1\n\n[{\"language\": \"ReScript\"}]->Array.lastIndexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```" - ], - "signature": "let lastIndexOf: (array<'a>, 'a, ~from: int=?) => int" - }, - { - "id": "Stdlib.Array.lastIndexOfOpt", - "kind": "value", - "name": "lastIndexOfOpt", - "docstrings": [], - "signature": "let lastIndexOfOpt: (array<'a>, 'a) => option" - }, - { - "id": "Stdlib.Array.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (array<'a>, 'a, int) => int", - "deprecated": "" - }, - { - "id": "Stdlib.Array.slice", - "kind": "value", - "name": "slice", - "docstrings": [ - "`slice(array, ~start, ~end)` creates a new array of items copied from `array` from `start` until (but not including) `end`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.slice(~start=1, ~end=3) == [2, 3]\n[1, 2, 3, 4]->Array.slice(~start=1) == [2, 3, 4]\n[1, 2, 3, 4]->Array.slice == [1, 2, 3, 4]\n```" - ], - "signature": "let slice: (array<'a>, ~start: int=?, ~end: int=?) => array<'a>" - }, - { - "id": "Stdlib.Array.sliceToEnd", - "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(array, start)` creates a new array from `array`, with all items from `array` starting from `start`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.sliceToEnd(~start=1) == [2, 3, 4]\n```" - ], - "signature": "let sliceToEnd: (array<'a>, ~start: int) => array<'a>", - "deprecated": "" - }, - { - "id": "Stdlib.Array.copy", - "kind": "value", - "name": "copy", - "docstrings": [ - "`copy(array)` makes a copy of the array with the items in it, but does not make copies of the items themselves.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3]\nlet copyOfMyArray = myArray->Array.copy\n\ncopyOfMyArray == [1, 2, 3]\n(myArray === copyOfMyArray) == false\n```" - ], - "signature": "let copy: array<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.toString", - "kind": "value", - "name": "toString", - "docstrings": [ - "`toString(array)` stringifies `array` by running `toString` on all of the array elements and joining them with \",\".\n\nSee [`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.toString == \"1,2,3,4\"\n```" - ], - "signature": "let toString: array<'a> => string" - }, - { - "id": "Stdlib.Array.toLocaleString", - "kind": "value", - "name": "toLocaleString", - "docstrings": [ - "`toLocaleString(array)` converts each element to a locale-aware string and joins them with commas.\n\nSee [`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n[\"apple\", \"banana\"]->Array.toLocaleString == \"apple,banana\"\n```" - ], - "signature": "let toLocaleString: array<'a> => string" - }, - { - "id": "Stdlib.Array.every", - "kind": "value", - "name": "every", - "docstrings": [ - "`every(array, predicate)` returns true if `predicate` returns true for all items in `array`.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.every(num => num <= 4) == true\n\narray->Array.every(num => num === 1) == false\n```" - ], - "signature": "let every: (array<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Array.everyWithIndex", - "kind": "value", - "name": "everyWithIndex", - "docstrings": [ - "`everyWithIndex(array, checker)` returns true if all items in `array` returns true when running the provided `checker` function.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.everyWithIndex((num, index) => index < 5 && num <= 4) == true\n\narray->Array.everyWithIndex((num, index) => index < 2 && num >= 2) == false\n```" - ], - "signature": "let everyWithIndex: (array<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.Array.filter", - "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filter(num => num > 2) == [3, 4]\n```" - ], - "signature": "let filter: (array<'a>, 'a => bool) => array<'a>" - }, - { - "id": "Stdlib.Array.filterWithIndex", - "kind": "value", - "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filterWithIndex((num, index) => index === 0 || num === 2) == [1, 2]\n```" - ], - "signature": "let filterWithIndex: (array<'a>, ('a, int) => bool) => array<'a>" - }, - { - "id": "Stdlib.Array.find", - "kind": "value", - "name": "find", - "docstrings": [ - "`find(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.find(item => item == ReScript) == Some(ReScript)\n```" - ], - "signature": "let find: (array<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findWithIndex", - "kind": "value", - "name": "findWithIndex", - "docstrings": [ - "`findWithIndex(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [TypeScript, JavaScript, ReScript]\n\narray->Array.findWithIndex((item, index) => index > 1 && item == ReScript) == Some(ReScript)\n```" - ], - "signature": "let findWithIndex: (array<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findLast", - "kind": "value", - "name": "findLast", - "docstrings": [ - "`findLast(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLast(item => item > 0) == Some(3)\n```" - ], - "signature": "let findLast: (array<'a>, 'a => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findLastWithIndex", - "kind": "value", - "name": "findLastWithIndex", - "docstrings": [ - "`findLastWithIndex(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLastWithIndex((item, index) => index < 2 && item > 0) == Some(2)\n```" - ], - "signature": "let findLastWithIndex: (array<'a>, ('a, int) => bool) => option<'a>" - }, - { - "id": "Stdlib.Array.findIndex", - "kind": "value", - "name": "findIndex", - "docstrings": [ - "`findIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\narray->Array.findIndex(item => item == ReScript) == 0\n\narray->Array.findIndex(item => item == TypeScript) == -1\n```" - ], - "signature": "let findIndex: (array<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.Array.findIndexWithIndex", - "kind": "value", - "name": "findIndexWithIndex", - "docstrings": [ - "`findIndexWithIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\nlet isReScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == ReScript)\nlet isTypeScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == TypeScript)\n\nisReScriptFirst == 0\nisTypeScriptFirst == -1\n```" - ], - "signature": "let findIndexWithIndex: (array<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.Array.findLastIndex", - "kind": "value", - "name": "findLastIndex", - "docstrings": [ - "`findLastIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, ReScript]\n\narray->Array.findLastIndex(item => item == ReScript) == 2\n\narray->Array.findLastIndex(item => item == TypeScript) == -1\n```" - ], - "signature": "let findLastIndex: (array<'a>, 'a => bool) => int" - }, - { - "id": "Stdlib.Array.findLastIndexWithIndex", - "kind": "value", - "name": "findLastIndexWithIndex", - "docstrings": [ - "`findLastIndexWithIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, JavaScript, ReScript]\n\nlet isReScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == ReScript)\nlet isTypeScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == TypeScript)\n\nisReScriptLast == 3\nisTypeScriptLast == -1\n```" - ], - "signature": "let findLastIndexWithIndex: (array<'a>, ('a, int) => bool) => int" - }, - { - "id": "Stdlib.Array.forEach", - "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEach(item => {\n Console.log(item)\n})\n```" - ], - "signature": "let forEach: (array<'a>, 'a => unit) => unit" - }, - { - "id": "Stdlib.Array.forEachWithIndex", - "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEachWithIndex((item, index) => {\n Console.log(\"At item \" ++ Int.toString(index) ++ \": \" ++ item)\n})\n```" - ], - "signature": "let forEachWithIndex: (array<'a>, ('a, int) => unit) => unit" - }, - { - "id": "Stdlib.Array.map", - "kind": "value", - "name": "map", - "docstrings": [ - "`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```" - ], - "signature": "let map: (array<'a>, 'a => 'b) => array<'b>" - }, - { - "id": "Stdlib.Array.mapWithIndex", - "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```" - ], - "signature": "let mapWithIndex: (array<'a>, ('a, int) => 'b) => array<'b>" - }, - { - "id": "Stdlib.Array.reduce", - "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(xs, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has two parameters: the item from the list and an \"accumulator\"; which starts with a value of `init`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\nArray.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n\n[1, 2, 3]->Array.reduce(list{}, List.add) == list{3, 2, 1}\n\nArray.reduce([], list{}, List.add) == list{}\n```" - ], - "signature": "let reduce: (array<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.reduceWithIndex", - "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(x, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has three parameters: the item from the array and an \"accumulator\", which starts with a value of `init` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceWithIndex([1, 2, 3], list{}, (acc, v, i) => list{v + i, ...acc}) == list{5, 3, 1}\n\nArray.reduceWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```" - ], - "signature": "let reduceWithIndex: (array<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.reduceRight", - "kind": "value", - "name": "reduceRight", - "docstrings": [ - "`reduceRight(xs, init, fn)`\n\nWorks like `Array.reduce`; except that function `fn` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nArray.reduceRight([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n\nArray.reduceRight([1, 2, 3], list{}, List.add) == list{1, 2, 3}\n\nArray.reduceRight([], list{}, List.add) == list{}\n```" - ], - "signature": "let reduceRight: (array<'a>, 'b, ('b, 'a) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.reduceRightWithIndex", - "kind": "value", - "name": "reduceRightWithIndex", - "docstrings": [ - "`reduceRightWithIndex(xs, init, fn)`\n\nLike `reduceRight`, but with an additional index argument on the callback function.\n\n## Examples\n\n```rescript\nArray.reduceRightWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceRightWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```" - ], - "signature": "let reduceRightWithIndex: (array<'a>, 'b, ('b, 'a, int) => 'b) => 'b" - }, - { - "id": "Stdlib.Array.some", - "kind": "value", - "name": "some", - "docstrings": [ - "`some(array, predicate)` returns true if `predicate` returns true for any element in `array`.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.some(greeting => greeting === \"Hello\") == true\n```" - ], - "signature": "let some: (array<'a>, 'a => bool) => bool" - }, - { - "id": "Stdlib.Array.someWithIndex", - "kind": "value", - "name": "someWithIndex", - "docstrings": [ - "`someWithIndex(array, checker)` returns true if running the provided `checker` function on any element in `array` returns true.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.someWithIndex((greeting, index) => greeting === \"Hello\" && index === 0) == true\n```" - ], - "signature": "let someWithIndex: (array<'a>, ('a, int) => bool) => bool" - }, - { - "id": "Stdlib.Array.get", - "kind": "value", - "name": "get", - "docstrings": [ - "`get(array, index)` returns the element at `index` of `array`.\n\nReturns `None` if the index does not exist in the array. Equivalent to doing `array[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.get(0) == Some(\"Hello\")\n\narray->Array.get(3) == None\n```" - ], - "signature": "let get: (array<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.Array.set", - "kind": "value", - "name": "set", - "docstrings": [ - "`set(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.set(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```" - ], - "signature": "let set: (array<'a>, int, 'a) => unit" - }, - { - "id": "Stdlib.Array.getSymbol", - "kind": "value", - "name": "getSymbol", - "docstrings": [ - "`getSymbol(array, key)` retrieves the value stored under the symbol `key`, if present.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN for more details about symbol keys.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbol(items, key) == Some(\"hello\")\n```" - ], - "signature": "let getSymbol: (array<'a>, Symbol.t) => option<'b>" - }, - { - "id": "Stdlib.Array.getSymbolUnsafe", - "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [ - "`getSymbolUnsafe(array, key)` retrieves the value stored under the symbol `key` without any safety checks.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbolUnsafe(items, key) == \"hello\"\n```" - ], - "signature": "let getSymbolUnsafe: (array<'a>, Symbol.t) => 'b" - }, - { - "id": "Stdlib.Array.setSymbol", - "kind": "value", - "name": "setSymbol", - "docstrings": [ - "`setSymbol(array, key, value)` stores `value` under the symbol `key` on `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"count\")\nlet items = []\nitems->Array.setSymbol(key, 5)\nArray.getSymbol(items, key) == Some(5)\n```" - ], - "signature": "let setSymbol: (array<'a>, Symbol.t, 'b) => unit" - }, - { - "id": "Stdlib.Array.getUnsafe", - "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.getUnsafe` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.getUnsafe(index)\n Console.log(value)\n}\n```" - ], - "signature": "let getUnsafe: (array<'a>, int) => 'a" - }, - { - "id": "Stdlib.Array.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [ - "`unsafe_get(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.unsafe_get` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.unsafe_get(index)\n Console.log(value)\n}\n```" - ], - "signature": "let unsafe_get: (array<'a>, int) => 'a", - "deprecated": "" - }, - { - "id": "Stdlib.Array.setUnsafe", - "kind": "value", - "name": "setUnsafe", - "docstrings": [ - "`setUnsafe(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array, and is *unsafe*.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.setUnsafe(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```" - ], - "signature": "let setUnsafe: (array<'a>, int, 'a) => unit" - }, - { - "id": "Stdlib.Array.findIndexOpt", - "kind": "value", - "name": "findIndexOpt", - "docstrings": [ - "`findIndexOpt(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.findIndexOpt(item => item == ReScript) == Some(0)\n```" - ], - "signature": "let findIndexOpt: (array<'a>, 'a => bool) => option" - }, - { - "id": "Stdlib.Array.findLastIndexOpt", - "kind": "value", - "name": "findLastIndexOpt", - "docstrings": [ - "`findIndexOpt(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"hello\", \"world\", \"!\"]\n\narray->Array.findLastIndexOpt(item => item->String.includes(\"o\")) == Some(1)\n```" - ], - "signature": "let findLastIndexOpt: (array<'a>, 'a => bool) => option" - }, - { - "id": "Stdlib.Array.toReversed", - "kind": "value", - "name": "toReversed", - "docstrings": [ - "`toReversed(array)` creates a new array with all items from `array` in reversed order.\n\nSee [`Array.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nlet reversed = someArray->Array.toReversed\n\nreversed == [\"hello\", \"hi\"]\nsomeArray == [\"hi\", \"hello\"] // Original unchanged\n```" - ], - "signature": "let toReversed: array<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.filterMap", - "kind": "value", - "name": "filterMap", - "docstrings": [ - "`filterMap(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMap(item =>\n switch item {\n | \"Hello\" => Some(item->String.length)\n | _ => None\n }\n) == [5]\n\n[1, 2, 3, 4, 5, 6]->Array.filterMap(n => mod(n, 2) == 0 ? Some(n * n) : None) == [4, 16, 36]\n\nArray.filterMap([1, 2, 3, 4, 5, 6], _ => None) == []\n\nArray.filterMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == []\n```" - ], - "signature": "let filterMap: (array<'a>, 'a => option<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.filterMapWithIndex", - "kind": "value", - "name": "filterMapWithIndex", - "docstrings": [ - "`filterMapWithIndex(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMapWithIndex((item, index) =>\n switch item {\n | \"Hello\" => Some(index)\n | _ => None\n }\n) == [0]\n```" - ], - "signature": "let filterMapWithIndex: (array<'a>, ('a, int) => option<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.keepSome", - "kind": "value", - "name": "keepSome", - "docstrings": [ - "`keepSome(arr)`\n\nReturns a new array containing `value` for all elements that are `Some(value)`\nand ignoring every value that is `None`\n\n## Examples\n\n```rescript\nArray.keepSome([Some(1), None, Some(3)]) == [1, 3]\n\nArray.keepSome([Some(1), Some(2), Some(3)]) == [1, 2, 3]\n\nArray.keepSome([None, None, None]) == []\n\nArray.keepSome([]) == []\n```" - ], - "signature": "let keepSome: array> => array<'a>" - }, - { - "id": "Stdlib.Array.toShuffled", - "kind": "value", - "name": "toShuffled", - "docstrings": [ - "`toShuffled(array)` returns a new array with all items in `array` in a random order.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet shuffledArray = array->Array.toShuffled\nConsole.log(shuffledArray)\n\nArray.toShuffled([1, 2, 3])->Array.length == 3\n```" - ], - "signature": "let toShuffled: array<'a> => array<'a>" - }, - { - "id": "Stdlib.Array.shuffle", - "kind": "value", - "name": "shuffle", - "docstrings": [ - "`shuffle(array)` randomizes the position of all items in `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.shuffle\nConsole.log(array)\n\nlet array2 = [1, 2, 3]\narray2->Array.shuffle\n\narray2->Array.length == 3\n```" - ], - "signature": "let shuffle: array<'a> => unit" - }, - { - "id": "Stdlib.Array.flatMap", - "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMap(item =>\n switch item {\n | ReScript => [1, 2, 3]\n | TypeScript => [4, 5, 6]\n | JavaScript => [7, 8, 9]\n }\n) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\n```" - ], - "signature": "let flatMap: (array<'a>, 'a => array<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.flatMapWithIndex", - "kind": "value", - "name": "flatMapWithIndex", - "docstrings": [ - "`flatMapWithIndex(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMapWithIndex((item, index) =>\n switch item {\n | ReScript => [index]\n | TypeScript => [index, index + 1]\n | JavaScript => [index, index + 1, index + 2]\n }\n) == [0, 1, 2, 2, 3, 4]\n```" - ], - "signature": "let flatMapWithIndex: (array<'a>, ('a, int) => array<'b>) => array<'b>" - }, - { - "id": "Stdlib.Array.findMap", - "kind": "value", - "name": "findMap", - "docstrings": [ - "`findMap(arr, fn)`\n\nCalls `fn` for each element and returns the first value from `fn` that is `Some(_)`.\nOtherwise returns `None`\n\n## Examples\n\n```rescript\nArray.findMap([1, 2, 3], n => mod(n, 2) == 0 ? Some(n - 2) : None) == Some(0)\n\nArray.findMap([1, 2, 3, 4, 5, 6], n => mod(n, 2) == 0 ? Some(n - 8) : None) == Some(-6)\n\nArray.findMap([1, 2, 3, 4, 5, 6], _ => None) == None\n\nArray.findMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == None\n```" - ], - "signature": "let findMap: (array<'a>, 'a => option<'b>) => option<'b>" - }, - { - "id": "Stdlib.Array.at", - "kind": "value", - "name": "at", - "docstrings": [ - "`at(array, index)`\n\nGet an element by its index. Negative indices count backwards from the last item.\n\n## Examples\n\n```rescript\n[\"a\", \"b\", \"c\"]->Array.at(0) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(2) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(3) == None\n[\"a\", \"b\", \"c\"]->Array.at(-1) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(-3) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(-4) == None\n```" - ], - "signature": "let at: (array<'a>, int) => option<'a>" - }, - { - "id": "Stdlib.Array.last", - "kind": "value", - "name": "last", - "docstrings": [ - "`last(array)` returns the last element of `array`.\n\nReturns `None` if the array is empty.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.last == Some(\"Good bye\")\n\n[]->Array.last == None\n```" - ], - "signature": "let last: array<'a> => option<'a>" - }, - { - "id": "Stdlib.Array.ignore", - "kind": "value", - "name": "ignore", - "docstrings": [ - "`ignore(array)` ignores the provided array and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." - ], - "signature": "let ignore: array<'a> => unit" - }, - { - "id": "Stdlib.Array.entries", - "kind": "value", - "name": "entries", - "docstrings": [ - "`entries(array)` returns a new array iterator object that contains the key/value pairs for each index in the array.\n\nSee [Array.prototype.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: Iterator.t<(int, int)> = array->Array.entries\niterator->Iterator.next == {done: false, value: Some((0, 5))}\niterator->Iterator.next == {done: false, value: Some((1, 6))}\n```" - ], - "signature": "let entries: array<'a> => Iterator.t<(int, 'a)>" - }, - { - "id": "Stdlib.Array.values", - "kind": "value", - "name": "values", - "docstrings": [ - "`values(array)` returns a new array iterator object that contains the values for each index in the array.\n\nSee [Array.prototype.values](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: Iterator.t = array->Array.values\niterator->Iterator.next == {done: false, value: Some(5)}\niterator->Iterator.next == {done: false, value: Some(6)}\n```" - ], - "signature": "let values: array<'a> => Iterator.t<'a>" - } - ] - }, - "stdlib/intervalid": { - "id": "Stdlib.IntervalId", - "name": "IntervalId", - "docstrings": [], - "items": [] - }, - "stdlib/timeoutid": { - "id": "Stdlib.TimeoutId", - "name": "TimeoutId", - "docstrings": [], - "items": [] - } -} diff --git a/apps/docs/markdown-pages/docs/api/toc_tree.json b/apps/docs/markdown-pages/docs/api/toc_tree.json deleted file mode 100644 index 99f925ff8..000000000 --- a/apps/docs/markdown-pages/docs/api/toc_tree.json +++ /dev/null @@ -1,744 +0,0 @@ -{ - "belt": { - "name": "Belt", - "path": ["belt"], - "children": [ - { "name": "Float", "path": ["belt", "float"], "children": [] }, - { "name": "Int", "path": ["belt", "int"], "children": [] }, - { "name": "Result", "path": ["belt", "result"], "children": [] }, - { "name": "Option", "path": ["belt", "option"], "children": [] }, - { - "name": "HashMap", - "path": ["belt", "hashmap"], - "children": [ - { - "name": "String", - "path": ["belt", "hashmap", "string"], - "children": [] - }, - { "name": "Int", "path": ["belt", "hashmap", "int"], "children": [] } - ] - }, - { - "name": "HashSet", - "path": ["belt", "hashset"], - "children": [ - { - "name": "String", - "path": ["belt", "hashset", "string"], - "children": [] - }, - { "name": "Int", "path": ["belt", "hashset", "int"], "children": [] } - ] - }, - { - "name": "MutableMap", - "path": ["belt", "mutablemap"], - "children": [ - { - "name": "String", - "path": ["belt", "mutablemap", "string"], - "children": [] - }, - { - "name": "Int", - "path": ["belt", "mutablemap", "int"], - "children": [] - } - ] - }, - { - "name": "MutableSet", - "path": ["belt", "mutableset"], - "children": [ - { - "name": "String", - "path": ["belt", "mutableset", "string"], - "children": [] - }, - { - "name": "Int", - "path": ["belt", "mutableset", "int"], - "children": [] - } - ] - }, - { - "name": "Map", - "path": ["belt", "map"], - "children": [ - { "name": "Dict", "path": ["belt", "map", "dict"], "children": [] }, - { - "name": "String", - "path": ["belt", "map", "string"], - "children": [] - }, - { "name": "Int", "path": ["belt", "map", "int"], "children": [] } - ] - }, - { - "name": "Set", - "path": ["belt", "set"], - "children": [ - { "name": "Dict", "path": ["belt", "set", "dict"], "children": [] }, - { - "name": "String", - "path": ["belt", "set", "string"], - "children": [] - }, - { "name": "Int", "path": ["belt", "set", "int"], "children": [] } - ] - }, - { "name": "Range", "path": ["belt", "range"], "children": [] }, - { "name": "List", "path": ["belt", "list"], "children": [] }, - { - "name": "MutableStack", - "path": ["belt", "mutablestack"], - "children": [] - }, - { - "name": "MutableQueue", - "path": ["belt", "mutablequeue"], - "children": [] - }, - { - "name": "SortArray", - "path": ["belt", "sortarray"], - "children": [ - { - "name": "String", - "path": ["belt", "sortarray", "string"], - "children": [] - }, - { - "name": "Int", - "path": ["belt", "sortarray", "int"], - "children": [] - } - ] - }, - { "name": "Array", "path": ["belt", "array"], "children": [] }, - { - "name": "Id", - "path": ["belt", "id"], - "children": [ - { - "name": "MakeHashable", - "path": ["belt", "id", "makehashable"], - "children": [] - }, - { - "name": "MakeHashableU", - "path": ["belt", "id", "makehashableu"], - "children": [] - }, - { - "name": "MakeComparable", - "path": ["belt", "id", "makecomparable"], - "children": [] - }, - { - "name": "MakeComparableU", - "path": ["belt", "id", "makecomparableu"], - "children": [] - } - ] - } - ] - }, - "dom": { - "name": "Dom", - "path": ["dom"], - "children": [ - { "name": "Storage2", "path": ["dom", "storage2"], "children": [] }, - { "name": "Storage", "path": ["dom", "storage"], "children": [] } - ] - }, - "js": { - "name": "Js", - "path": ["js"], - "children": [ - { "name": "WeakMap", "path": ["js", "weakmap"], "children": [] }, - { "name": "Map", "path": ["js", "map"], "children": [] }, - { "name": "WeakSet", "path": ["js", "weakset"], "children": [] }, - { "name": "Set", "path": ["js", "set"], "children": [] }, - { "name": "Console", "path": ["js", "console"], "children": [] }, - { "name": "Result", "path": ["js", "result"], "children": [] }, - { "name": "Option", "path": ["js", "option"], "children": [] }, - { "name": "Blob", "path": ["js", "blob"], "children": [] }, - { "name": "File", "path": ["js", "file"], "children": [] }, - { "name": "BigInt", "path": ["js", "bigint"], "children": [] }, - { "name": "Int", "path": ["js", "int"], "children": [] }, - { "name": "Float", "path": ["js", "float"], "children": [] }, - { "name": "Types", "path": ["js", "types"], "children": [] }, - { - "name": "TypedArray2", - "path": ["js", "typedarray2"], - "children": [ - { - "name": "DataView", - "path": ["js", "typedarray2", "dataview"], - "children": [] - }, - { - "name": "Float64Array", - "path": ["js", "typedarray2", "float64array"], - "children": [] - }, - { - "name": "Float32Array", - "path": ["js", "typedarray2", "float32array"], - "children": [] - }, - { - "name": "Uint32Array", - "path": ["js", "typedarray2", "uint32array"], - "children": [] - }, - { - "name": "Int32Array", - "path": ["js", "typedarray2", "int32array"], - "children": [] - }, - { - "name": "Uint16Array", - "path": ["js", "typedarray2", "uint16array"], - "children": [] - }, - { - "name": "Int16Array", - "path": ["js", "typedarray2", "int16array"], - "children": [] - }, - { - "name": "Uint8ClampedArray", - "path": ["js", "typedarray2", "uint8clampedarray"], - "children": [] - }, - { - "name": "Uint8Array", - "path": ["js", "typedarray2", "uint8array"], - "children": [] - }, - { - "name": "Int8Array", - "path": ["js", "typedarray2", "int8array"], - "children": [] - }, - { - "name": "ArrayBuffer", - "path": ["js", "typedarray2", "arraybuffer"], - "children": [] - } - ] - }, - { - "name": "Typed_array", - "path": ["js", "typed_array"], - "children": [ - { - "name": "DataView", - "path": ["js", "typed_array", "dataview"], - "children": [] - }, - { - "name": "Float64_array", - "path": ["js", "typed_array", "float64_array"], - "children": [] - }, - { - "name": "Float64Array", - "path": ["js", "typed_array", "float64array"], - "children": [] - }, - { - "name": "Float32_array", - "path": ["js", "typed_array", "float32_array"], - "children": [] - }, - { - "name": "Float32Array", - "path": ["js", "typed_array", "float32array"], - "children": [] - }, - { - "name": "Uint32Array", - "path": ["js", "typed_array", "uint32array"], - "children": [] - }, - { - "name": "Int32_array", - "path": ["js", "typed_array", "int32_array"], - "children": [] - }, - { - "name": "Int32Array", - "path": ["js", "typed_array", "int32array"], - "children": [] - }, - { - "name": "Uint16Array", - "path": ["js", "typed_array", "uint16array"], - "children": [] - }, - { - "name": "Int16Array", - "path": ["js", "typed_array", "int16array"], - "children": [] - }, - { - "name": "Uint8ClampedArray", - "path": ["js", "typed_array", "uint8clampedarray"], - "children": [] - }, - { - "name": "Uint8Array", - "path": ["js", "typed_array", "uint8array"], - "children": [] - }, - { - "name": "Int8Array", - "path": ["js", "typed_array", "int8array"], - "children": [] - }, - { "name": "S", "path": ["js", "typed_array", "s"], "children": [] }, - { - "name": "ArrayBuffer", - "path": ["js", "typed_array", "arraybuffer"], - "children": [] - }, - { - "name": "Type", - "path": ["js", "typed_array", "type"], - "children": [] - } - ] - }, - { "name": "Obj", "path": ["js", "obj"], "children": [] }, - { "name": "Math", "path": ["js", "math"], "children": [] }, - { - "name": "Json", - "path": ["js", "json"], - "children": [ - { "name": "Kind", "path": ["js", "json", "kind"], "children": [] } - ] - }, - { "name": "Global", "path": ["js", "global"], "children": [] }, - { "name": "Dict", "path": ["js", "dict"], "children": [] }, - { "name": "Date", "path": ["js", "date"], "children": [] }, - { "name": "Promise2", "path": ["js", "promise2"], "children": [] }, - { "name": "Promise", "path": ["js", "promise"], "children": [] }, - { "name": "Re", "path": ["js", "re"], "children": [] }, - { "name": "String2", "path": ["js", "string2"], "children": [] }, - { "name": "String", "path": ["js", "string"], "children": [] }, - { "name": "Array2", "path": ["js", "array2"], "children": [] }, - { "name": "Array", "path": ["js", "array"], "children": [] }, - { "name": "Exn", "path": ["js", "exn"], "children": [] }, - { - "name": "Null_undefined", - "path": ["js", "null_undefined"], - "children": [] - }, - { "name": "Nullable", "path": ["js", "nullable"], "children": [] }, - { "name": "Undefined", "path": ["js", "undefined"], "children": [] }, - { "name": "Null", "path": ["js", "null"], "children": [] } - ] - }, - "stdlib": { - "name": "Stdlib", - "path": ["stdlib"], - "children": [ - { - "name": "BigUint64Array", - "path": ["stdlib", "biguint64array"], - "children": [ - { - "name": "Constants", - "path": ["stdlib", "biguint64array", "constants"], - "children": [] - } - ] - }, - { - "name": "BigInt64Array", - "path": ["stdlib", "bigint64array"], - "children": [ - { - "name": "Constants", - "path": ["stdlib", "bigint64array", "constants"], - "children": [] - } - ] - }, - { - "name": "Uint8ClampedArray", - "path": ["stdlib", "uint8clampedarray"], - "children": [ - { - "name": "Constants", - "path": ["stdlib", "uint8clampedarray", "constants"], - "children": [] - } - ] - }, - { - "name": "Uint32Array", - "path": ["stdlib", "uint32array"], - "children": [ - { - "name": "Constants", - "path": ["stdlib", "uint32array", "constants"], - "children": [] - } - ] - }, - { - "name": "Uint16Array", - "path": ["stdlib", "uint16array"], - "children": [ - { - "name": "Constants", - "path": ["stdlib", "uint16array", "constants"], - "children": [] - } - ] - }, - { - "name": "Uint8Array", - "path": ["stdlib", "uint8array"], - "children": [ - { - "name": "Constants", - "path": ["stdlib", "uint8array", "constants"], - "children": [] - } - ] - }, - { - "name": "Int32Array", - "path": ["stdlib", "int32array"], - "children": [ - { - "name": "Constants", - "path": ["stdlib", "int32array", "constants"], - "children": [] - } - ] - }, - { - "name": "Int16Array", - "path": ["stdlib", "int16array"], - "children": [ - { - "name": "Constants", - "path": ["stdlib", "int16array", "constants"], - "children": [] - } - ] - }, - { - "name": "Int8Array", - "path": ["stdlib", "int8array"], - "children": [ - { - "name": "Constants", - "path": ["stdlib", "int8array", "constants"], - "children": [] - } - ] - }, - { - "name": "Float64Array", - "path": ["stdlib", "float64array"], - "children": [ - { - "name": "Constants", - "path": ["stdlib", "float64array", "constants"], - "children": [] - } - ] - }, - { - "name": "Float32Array", - "path": ["stdlib", "float32array"], - "children": [ - { - "name": "Constants", - "path": ["stdlib", "float32array", "constants"], - "children": [] - } - ] - }, - { - "name": "TypedArray", - "path": ["stdlib", "typedarray"], - "children": [] - }, - { - "name": "ArrayBuffer", - "path": ["stdlib", "arraybuffer"], - "children": [] - }, - { "name": "WeakSet", "path": ["stdlib", "weakset"], "children": [] }, - { "name": "Set", "path": ["stdlib", "set"], "children": [] }, - { "name": "WeakMap", "path": ["stdlib", "weakmap"], "children": [] }, - { "name": "Map", "path": ["stdlib", "map"], "children": [] }, - { - "name": "AsyncIterator", - "path": ["stdlib", "asynciterator"], - "children": [] - }, - { "name": "Iterator", "path": ["stdlib", "iterator"], "children": [] }, - { - "name": "Type", - "path": ["stdlib", "type"], - "children": [ - { - "name": "Classify", - "path": ["stdlib", "type", "classify"], - "children": [] - } - ] - }, - { "name": "Symbol", "path": ["stdlib", "symbol"], "children": [] }, - { "name": "String", "path": ["stdlib", "string"], "children": [] }, - { "name": "Result", "path": ["stdlib", "result"], "children": [] }, - { - "name": "RegExp", - "path": ["stdlib", "regexp"], - "children": [ - { - "name": "Result", - "path": ["stdlib", "regexp", "result"], - "children": [] - } - ] - }, - { "name": "Promise", "path": ["stdlib", "promise"], "children": [] }, - { "name": "Pair", "path": ["stdlib", "pair"], "children": [] }, - { "name": "Ordering", "path": ["stdlib", "ordering"], "children": [] }, - { "name": "Option", "path": ["stdlib", "option"], "children": [] }, - { "name": "Object", "path": ["stdlib", "object"], "children": [] }, - { "name": "Nullable", "path": ["stdlib", "nullable"], "children": [] }, - { "name": "Null", "path": ["stdlib", "null"], "children": [] }, - { - "name": "Math", - "path": ["stdlib", "math"], - "children": [ - { "name": "Int", "path": ["stdlib", "math", "int"], "children": [] }, - { - "name": "Constants", - "path": ["stdlib", "math", "constants"], - "children": [] - } - ] - }, - { "name": "List", "path": ["stdlib", "list"], "children": [] }, - { "name": "Lazy", "path": ["stdlib", "lazy"], "children": [] }, - { - "name": "JSON", - "path": ["stdlib", "json"], - "children": [ - { - "name": "Decode", - "path": ["stdlib", "json", "decode"], - "children": [] - }, - { - "name": "Encode", - "path": ["stdlib", "json", "encode"], - "children": [] - }, - { - "name": "Classify", - "path": ["stdlib", "json", "classify"], - "children": [] - } - ] - }, - { "name": "JsExn", "path": ["stdlib", "jsexn"], "children": [] }, - { - "name": "JsError", - "path": ["stdlib", "jserror"], - "children": [ - { - "name": "URIError", - "path": ["stdlib", "jserror", "urierror"], - "children": [] - }, - { - "name": "TypeError", - "path": ["stdlib", "jserror", "typeerror"], - "children": [] - }, - { - "name": "SyntaxError", - "path": ["stdlib", "jserror", "syntaxerror"], - "children": [] - }, - { - "name": "ReferenceError", - "path": ["stdlib", "jserror", "referenceerror"], - "children": [] - }, - { - "name": "RangeError", - "path": ["stdlib", "jserror", "rangeerror"], - "children": [] - }, - { - "name": "EvalError", - "path": ["stdlib", "jserror", "evalerror"], - "children": [] - } - ] - }, - { - "name": "Intl", - "path": ["stdlib", "intl"], - "children": [ - { - "name": "Segments", - "path": ["stdlib", "intl", "segments"], - "children": [] - }, - { - "name": "Segmenter", - "path": ["stdlib", "intl", "segmenter"], - "children": [] - }, - { - "name": "RelativeTimeFormat", - "path": ["stdlib", "intl", "relativetimeformat"], - "children": [] - }, - { - "name": "PluralRules", - "path": ["stdlib", "intl", "pluralrules"], - "children": [] - }, - { - "name": "NumberFormat", - "path": ["stdlib", "intl", "numberformat"], - "children": [ - { - "name": "Grouping", - "path": ["stdlib", "intl", "numberformat", "grouping"], - "children": [] - } - ] - }, - { - "name": "Locale", - "path": ["stdlib", "intl", "locale"], - "children": [] - }, - { - "name": "ListFormat", - "path": ["stdlib", "intl", "listformat"], - "children": [] - }, - { - "name": "DateTimeFormat", - "path": ["stdlib", "intl", "datetimeformat"], - "children": [] - }, - { - "name": "Collator", - "path": ["stdlib", "intl", "collator"], - "children": [] - }, - { - "name": "Common", - "path": ["stdlib", "intl", "common"], - "children": [] - } - ] - }, - { - "name": "Int", - "path": ["stdlib", "int"], - "children": [ - { "name": "Ref", "path": ["stdlib", "int", "ref"], "children": [] }, - { - "name": "Bitwise", - "path": ["stdlib", "int", "bitwise"], - "children": [] - }, - { - "name": "Constants", - "path": ["stdlib", "int", "constants"], - "children": [] - } - ] - }, - { - "name": "Float", - "path": ["stdlib", "float"], - "children": [ - { - "name": "Constants", - "path": ["stdlib", "float", "constants"], - "children": [] - } - ] - }, - { - "name": "Error", - "path": ["stdlib", "error"], - "children": [ - { - "name": "URIError", - "path": ["stdlib", "error", "urierror"], - "children": [] - }, - { - "name": "TypeError", - "path": ["stdlib", "error", "typeerror"], - "children": [] - }, - { - "name": "SyntaxError", - "path": ["stdlib", "error", "syntaxerror"], - "children": [] - }, - { - "name": "ReferenceError", - "path": ["stdlib", "error", "referenceerror"], - "children": [] - }, - { - "name": "RangeError", - "path": ["stdlib", "error", "rangeerror"], - "children": [] - }, - { - "name": "EvalError", - "path": ["stdlib", "error", "evalerror"], - "children": [] - } - ] - }, - { "name": "Exn", "path": ["stdlib", "exn"], "children": [] }, - { "name": "Dict", "path": ["stdlib", "dict"], "children": [] }, - { - "name": "Date", - "path": ["stdlib", "date"], - "children": [ - { "name": "UTC", "path": ["stdlib", "date", "utc"], "children": [] } - ] - }, - { "name": "DataView", "path": ["stdlib", "dataview"], "children": [] }, - { "name": "Console", "path": ["stdlib", "console"], "children": [] }, - { "name": "Bool", "path": ["stdlib", "bool"], "children": [] }, - { "name": "BigInt", "path": ["stdlib", "bigint"], "children": [] }, - { "name": "Array", "path": ["stdlib", "array"], "children": [] }, - { - "name": "IntervalId", - "path": ["stdlib", "intervalid"], - "children": [] - }, - { "name": "TimeoutId", "path": ["stdlib", "timeoutid"], "children": [] } - ] - } -} diff --git a/apps/docs/markdown-pages/docs/manual/api.mdx b/apps/docs/markdown-pages/docs/manual/api.mdx index c46915dea..c2fd77001 100644 --- a/apps/docs/markdown-pages/docs/manual/api.mdx +++ b/apps/docs/markdown-pages/docs/manual/api.mdx @@ -17,4 +17,4 @@ When possible it will compile directly to the equivalent JavaScript API, for exa - [WebAPI](https://rescript-lang.github.io/experimental-rescript-webapi/): Experimental, but we expect it to be stable very soon. Similar to how the Stdlib allows interacting with move of the JavaScript API this library allows you to work with Web APIs like `fetch`, `navigator`, `localStorage`, etc... - [Belt](/docs/manual/api/belt): Immutable collections and extra helpers not available in JavaScript / [Stdlib](/docs/manual/api/stdlib). -- [Dom](/docs/manual/api/stdlibdom): Deprecated DOM-related types and modules. You should use the `WebAPI` library instead. +- [Dom](/docs/manual/api/dom): Deprecated DOM-related types and modules. You should use the `WebAPI` library instead. diff --git a/apps/docs/markdown-pages/docs/manual/array-and-list.mdx b/apps/docs/markdown-pages/docs/manual/array-and-list.mdx index ce13b3d3a..730504fb7 100644 --- a/apps/docs/markdown-pages/docs/manual/array-and-list.mdx +++ b/apps/docs/markdown-pages/docs/manual/array-and-list.mdx @@ -133,16 +133,7 @@ let myList = list{1, 2, 3} ``` ```js -let myList = { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */ 0, - }, - }, -}; +let myList = { hd: 1, tl: { hd: 2, tl: { hd: 3, tl: /* [] */ 0 } } }; export { myList }; ``` @@ -171,21 +162,11 @@ let anotherList = list{0, ...myList} ``` ```js -var myList = { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: 0, - }, - }, -}; - -var anotherList = { - hd: 0, - tl: myList, -}; +let myList = { hd: 1, tl: { hd: 2, tl: { hd: 3, tl: /* [] */ 0 } } }; + +let anotherList = { hd: 0, tl: myList }; + +export { myList, anotherList }; ``` @@ -210,21 +191,9 @@ let message = ``` ```js -let myList = { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */ 0, - }, - }, -}; - -let anotherList = { - hd: 0, - tl: myList, -}; +let myList = { hd: 1, tl: { hd: 2, tl: { hd: 3, tl: /* [] */ 0 } } }; + +let anotherList = { hd: 0, tl: myList }; let message = myList !== 0 diff --git a/apps/docs/markdown-pages/docs/manual/async-await.mdx b/apps/docs/markdown-pages/docs/manual/async-await.mdx index 3b748fa4c..4330c31dc 100644 --- a/apps/docs/markdown-pages/docs/manual/async-await.mdx +++ b/apps/docs/markdown-pages/docs/manual/async-await.mdx @@ -105,9 +105,9 @@ let fetchData = async (userId: string): string => { For completeness reasons, let's expand the full signature and inline type definitions in one code snippet: -```res nocheck +```res // Note how the inline return type uses `string`, while the type definition uses `promise` -let fetchData: string => promise = async (userId: string): string { +let fetchData: string => promise = async (userId: string): string => { await fetchUserMail(userId) } ``` @@ -281,7 +281,7 @@ let logMultipleValues = async () => { Here's a full example of using the MDN `fetch` API, using `async` / `await` to simulate a login: -```res nocheck +```res // A generic Response type for typing our fetch requests module Response = { type t<'data> @@ -301,17 +301,19 @@ external fetch: ( // We now use our asynchronous `fetch` function to simulate a login. // Note how we use `await` with regular functions returning a `promise`. let login = async (email: string, password: string) => { - let body = { - "email": email, - "password": password, - } - let params = { "method": "POST", "headers": { "Content-Type": "application/json", }, - "body": Json.stringifyAny(body), + "body": JSON.stringify( + JSON.Object( + dict{ + "email": JSON.String(email), + "password": JSON.String(password), + }, + ), + ), } try { diff --git a/apps/docs/markdown-pages/docs/manual/attribute.mdx b/apps/docs/markdown-pages/docs/manual/attribute.mdx index fd59743da..09d810c37 100644 --- a/apps/docs/markdown-pages/docs/manual/attribute.mdx +++ b/apps/docs/markdown-pages/docs/manual/attribute.mdx @@ -90,11 +90,13 @@ There's a second category of attributes, called "extension points" (a remnant te ```res -%raw("var a = 1") +let result = %raw("1 + 2") ``` ```js -((var a = 1)); +let result = 1 + 2; + +export { result }; ``` diff --git a/apps/docs/markdown-pages/docs/manual/bind-to-js-function.mdx b/apps/docs/markdown-pages/docs/manual/bind-to-js-function.mdx index f7d319961..8108b5c0a 100644 --- a/apps/docs/markdown-pages/docs/manual/bind-to-js-function.mdx +++ b/apps/docs/markdown-pages/docs/manual/bind-to-js-function.mdx @@ -15,7 +15,8 @@ Binding a JS function is like binding any other value: ```res // Import nodejs' path.dirname @module("path") external dirname: string => string = "dirname" -let root = dirname("/User/github") // returns "User" +let root = dirname("/User/github") +assert(root === "/User") ``` ```js @@ -23,6 +24,14 @@ import * as Path from "path"; let root = Path.dirname("/User/github"); +if (root !== "/User") { + throw { + RE_EXN_ID: "Assert_failure", + _1: ["Example.res", 4, 0], + Error: new Error(), + }; +} + export { root }; ``` @@ -149,14 +158,47 @@ let stripe = new Stripe("sk\_..."); let session = stripe.checkout.sessions.create({}); -export { - stripe, - session, -} +export { stripe, session }; ```` +## Function on a Default-Exported Object + +When an ES module exports an object as its default value, use `@scope("default")` to bind to a function on that object: + +```js +// math.js +const math = { + add: (x, y) => x + y, +}; + +export default math; +``` + + + +```res +@module("./math.js") @scope("default") +external add: (int, int) => int = "add" + +let result = add(1, 1) +``` + +```js +import * as MathJs from "./math.js"; + +function add(prim0, prim1) { + return MathJs.default.add(prim0, prim1); +} + +let result = MathJs.default.add(1, 1); + +export { add, result }; +``` + + + ## Variadic Function Arguments You might have JS functions that take an arbitrary amount of arguments. ReScript supports modeling those, under the condition that the arbitrary arguments part is homogenous (aka of the same type). If so, add `variadic` to your `external`. diff --git a/apps/docs/markdown-pages/docs/manual/bind-to-js-object.mdx b/apps/docs/markdown-pages/docs/manual/bind-to-js-object.mdx index 6c67120a8..9bbabe767 100644 --- a/apps/docs/markdown-pages/docs/manual/bind-to-js-object.mdx +++ b/apps/docs/markdown-pages/docs/manual/bind-to-js-object.mdx @@ -64,9 +64,7 @@ let action = {type_: "ADD_USER"} ``` ```js -let action = { - type: "ADD_USER", -}; +let action = { type: "ADD_USER" }; export { action }; ``` diff --git a/apps/docs/markdown-pages/docs/manual/build-configuration.mdx b/apps/docs/markdown-pages/docs/manual/build-configuration.mdx index 9872f648a..cabc933d9 100644 --- a/apps/docs/markdown-pages/docs/manual/build-configuration.mdx +++ b/apps/docs/markdown-pages/docs/manual/build-configuration.mdx @@ -91,26 +91,24 @@ Note that only sources marked with `"type":"dev"` will be able to resolve module ## js-post-build -Hook that's invoked every time a file is recompiled. Good for JS build system interop, but please use it **sparingly**. Calling your custom command for every recompiled file slows down your build and worsens the building experience for even third-party users of your lib. +Hook that's invoked for every JavaScript file emitted by a build. It can be useful for JavaScript build-system interop, but use it **sparingly**. Starting another process for every recompiled file can noticeably slow down builds for both applications and libraries. Example: ```json { "js-post-build": { - "cmd": "/path/to/node ../../postProcessTheFile.js" + "cmd": "node ./postProcess.mjs" } } ``` -Note that the path resolution for the command (`node` in this case) is done so: +The build system appends the absolute path to the generated JavaScript file as the command's final argument. The path points: -- `/myCommand` is resolved into `/myCommand` -- `package/myCommand` is resolved into `node_modules/package/myCommand` -- `./myCommand` is resolved into `myProjectRoot/myCommand` -- `myCommand` is just called as `myCommand`, aka a globally available executable. But note that ReScript doesn't read into your shell's environment, so if you put e.g. `node`, it won't find it unless you specify an absolute path. Alternatively, add `#!/usr/local/bin/node` to the top of your script to directly call it without prepending `node`. +- next to the source file when `"in-source": true` +- into the corresponding `lib//` output directory when `"in-source": false` -The command itself is called from inside `lib/bs`. +Since ReScript 12.2, the command runs from the directory containing the `rescript.json` where the hook is defined, and output written to stdout or stderr is forwarded to the build output. This makes relative paths predictable in nested packages and monorepos. ## jsx diff --git a/apps/docs/markdown-pages/docs/manual/build-overview.mdx b/apps/docs/markdown-pages/docs/manual/build-overview.mdx index a505c05e6..1641dd7bd 100644 --- a/apps/docs/markdown-pages/docs/manual/build-overview.mdx +++ b/apps/docs/markdown-pages/docs/manual/build-overview.mdx @@ -9,62 +9,60 @@ order: 1 # Build System Overview -ReScript comes with a build system, [`rescript`](https://www.npmjs.com/package/rescript), that's fast, lean and used as the authoritative build system of the community. +ReScript comes with a fast, native build system through the [`rescript`](https://www.npmjs.com/package/rescript) package. Every ReScript project needs a build description file, `rescript.json`. -## Options +The current build system was introduced in ReScript 12. It tracks dependencies across packages and schedules only the work affected by a change. See [Reforging the Build System](../../blog/reforging-build-system.mdx) for a deeper look at its architecture. -See `rescript help`: +## Commands + +Run `rescript help` to see the available commands: ``` ❯ rescript help -Usage: rescript - -`rescript` is equivalent to `rescript build` - -Options: - -v, -version display version number - -h, -help display help - -Subcommands: - build - clean - format - convert - dump - help - -Run `rescript -h` for subcommand help. Examples: - rescript build -h - rescript format -h +Usage: rescript [OPTIONS] + +Commands: + build Build the project (default command) + watch Build, then start a watcher + clean Clean the build artifacts + format Format ReScript files + compiler-args Print the compiler arguments for a ReScript source file + help Print this message or the help of the given subcommand(s) ``` -## Build Project +Use `rescript help ` for the options of a particular command. + +## Build a Project Each build will create build artifacts from your project's source files. -**To build a project (including its dependencies)**, run: +To build a project, including its dependencies, run: ```sh rescript ``` -Which is an alias for `rescript build`. +This is an alias for `rescript build`. -To keep a build watcher, run: +To build once and then watch for changes, run: ```sh -rescript -w +rescript watch ``` Any new file change will be picked up and the build will re-run. -**Note**: third-party libraries in `node_modules` aren't watched, as doing so may exceed the node.js watcher count limit. +Third-party libraries in `node_modules` aren't watched. For monorepo setup in ReScript 12+, see [Setting up a monorepo](./build-monorepo-setup.mdx). -## Clean Project +### Incremental Builds + +The build system recompiles only files affected by a change. Interface files (`.resi`) can reduce this work further: if an implementation change doesn't alter the corresponding interface, dependent modules don't need to be recompiled. See [Module signatures](./module.mdx#signatures) and [Build Performance](./build-performance.mdx). + +## Clean a Project If you ever get into a stale build for edge-case reasons, use: @@ -72,14 +70,24 @@ If you ever get into a stale build for edge-case reasons, use: rescript clean ``` -## Compile with stricter errors in CI +## Format Source Files + +Format the project's ReScript files with: + +```sh +rescript format +``` + +Use `rescript format --check` in CI to check formatting without writing changes. You can also format selected files by passing their paths, or format standard input with `--stdin .res` or `--stdin .resi`. + +## Compile with Stricter Errors in CI **Since 11.1** -You may want to compile your project with stricter rules for production, than when developing. With the `-warn-error` build flag, this can easily be done, for instance in a continuous integration script. E.g.: +You may want to compile your project with stricter rules in CI than during development. Use the `--warn-error` build flag: ```sh -rescript -warn-error +110 +rescript build --warn-error "+110" ``` Here, warning number 110, which is triggered when a [`%todo`](../../syntax-lookup/extension_todo.mdx) has been found, gets promoted to an error. The full list of warning numbers can be found [here](./warning-numbers.mdx). diff --git a/apps/docs/markdown-pages/docs/manual/build-performance.mdx b/apps/docs/markdown-pages/docs/manual/build-performance.mdx index 7af0ea73a..12d8fe06c 100644 --- a/apps/docs/markdown-pages/docs/manual/build-performance.mdx +++ b/apps/docs/markdown-pages/docs/manual/build-performance.mdx @@ -11,9 +11,34 @@ order: 7 ReScript considers performance at install time, build time and run time as a serious feature; it's one of those things you don't notice until you realize it's missing. -## Profile Your Build +## Measuring Build Times -Sometime your build can be slow due to some confused infra setups. We provide an interactive visualization of your build's performance via `bstracing`: +When investigating a slowdown, compare the same kinds of build under the same conditions: + +- a clean build +- a no-op build, with no source changes +- an incremental build after changing a leaf module +- an incremental build after changing a widely used module + +Build times depend on the dependency graph, hardware, filesystem, and surrounding tools. Compare ReScript's build time with the duration of the entire development command: bundling, code generation, and tests can take more time than compilation itself. + +## Under the Hood + +Since ReScript v12, `rescript build` uses a native build system written in Rust. It reads `rescript.json`, tracks dependencies between modules and packages, and invokes the compiler directly. See [Reforging the ReScript Build System](../../blog/reforging-build-system.mdx) for more about its architecture. + +## The JS Wrapper + +The `rescript` command is a thin Node.js wrapper around the native `rescript.exe` binary. Both building and watching are handled by the native binary. + +The binary ships in a platform-specific package at `node_modules/@rescript/{your-platform}/bin/rescript.exe`, for example `node_modules/@rescript/darwin-arm64/bin/rescript.exe` on an Apple Silicon Mac. The wrapper selects the package for your platform and sets `RESCRIPT_RUNTIME` to the installed runtime package's path. Prefer `rescript build` and `rescript watch` so this setup is handled for you. + +## Legacy Build System + +The pre-v12 build system remains available through `rescript-legacy`. It uses [Ninja](https://ninja-build.org), a cross-platform, low-level build system. It reads `rescript.json`, generates Ninja build files in `lib/bs`, and runs Ninja to execute the compiler commands. + +### Profile Legacy Builds + +For builds made with `rescript-legacy`, `bstracing` turns Ninja's build log into a performance trace: ```sh ./node_modules/.bin/bstracing @@ -28,29 +53,17 @@ Run the above command at your ReScript project's root; it'll spit out a JSON fil caption="Screenshot of bstracing result" /> -## Under the Hood - -ReScript itself uses a build system under the hood, called [Ninja](https://ninja-build.org). Ninja is like Make, but cross-platform, minimal, focuses on perf and destined to be more of a low-level building block than a full-blown build system. In this regard, Ninja's a great implementation detail for `rescript`. - -ReScript reads into `rescript.json` and generates the Ninja build file in `lib/bs`. The file contains the low-level compiler commands, namespacing rules, intermediate artifacts generation & others. It then runs `ninja` for the actual build. - -## The JS Wrapper - -`rescript` itself is a Node.js wrapper which takes care of some miscellaneous tasks, plus the watcher. The lower-level, watcher-less, fast native `rescript` is called `rescript.exe`. It's located at `node_modules/rescript/{your-platform}/rescript.exe`. - -If you don't need the watcher, you can run said `rescript.exe`. This side-steps Node.js' long startup time, which can be in the order of `100ms`. Our editor plugin finds and uses this native `rescript.exe` for better performance. +### Historical Measurements -## Numbers +The following measurements were made with the pre-v12 Ninja-based build system. They are not benchmarks of the current build system. -Raw `rescript.exe` build on a small project should be around `70ms`. This doubles when you use the JS `rescript` wrapper which comes with a watcher, which is practically faster since you don't manually run the build at every change (though you should opt for the raw `rescript.exe` for programmatic usage, e.g. inserting rescript into your existing JS build pipeline). +A native build of a small project took around `70ms`, compared with roughly twice that through the old JS wrapper. That wrapper also provided watch mode. -No-op build (when no file's changed) should be around `15ms`. Incremental rebuild (described soon) of a single file in a project is around `70ms` too. +A no-op build (when no file changed) took around `15ms`. An incremental rebuild of a single file took around `70ms` too. -Cleaning the artifacts should be instantaneous. +#### Extreme Test -### Extreme Test - -We've stress-tested `rescript.exe` on a big project of 10,000 files (2 directories, 5000 files each, first 5000 no dependencies, last 5000 10 dependencies on files from the former directory) using https://github.com/rescript-lang/build-benchmark, on a Retina Macbook Pro Early 2015 (3.1 GHz Intel Core i7). +We stress-tested the old native build system on a big project of 10,000 files (2 directories, 5000 files each, first 5000 no dependencies, last 5000 10 dependencies on files from the former directory) using https://github.com/rescript-lang/build-benchmark, on a Retina Macbook Pro Early 2015 (3.1 GHz Intel Core i7). {/* TODO: better repro */} @@ -58,12 +71,6 @@ We've stress-tested `rescript.exe` on a big project of 10,000 files (2 directori - Clean build: \<3 minutes. - Incremental build: depends on the number of the dependents of the file. No dependent means `1s`. -### Stability - -`rescript` is a file-based build system. We don't do in-memory build, even if that speeds up the build a lot. In-memory builds risk memory leaks, out-of-memory errors, corrupt halfway build and others. Our watcher mode stays open for days or months with no leak. - -The watcher is also just a thin file watcher that calls `rescript.exe`. We don't like babysitting daemon processes. - ## Incrementality & Correctness ReScript doesn't take whole seconds to run every time. The bulk of the build performance comes from incremental build, aka re-building a previously built project when a few files changed. @@ -81,6 +88,10 @@ Unfortunately, JS build systems are usually the bottleneck for building a JS pro - Convert more files into ReScript =). Fewer files going through fewer parts of the JS pipeline helps a ton. - Careful with bringing in more dependencies: libraries, syntax transforms (e.g. the unofficially supported PPX), build step loaders, etc. The bulk of these dragging down the editing & building experience might out-weight the API benefits they provide. +Keep compiler artifacts between builds unless you specifically need a clean build. Cleaning before every compilation prevents incremental builds from doing their job. + +Commands configured through [`js-post-build`](./build-configuration.mdx#js-post-build) run once per emitted JavaScript file. Starting another process for each file can slow down an otherwise fast incremental build. + ## Hot Reloading Hot reloading refers to maintaining a dev server and listening to file changes in a way that allows the server to pipe some delta changes right into the currently running browser page. This provides a relatively fast iteration workflow while working in specific frameworks. diff --git a/apps/docs/markdown-pages/docs/manual/control-flow.mdx b/apps/docs/markdown-pages/docs/manual/control-flow.mdx index 7e0931d10..e5278b3ba 100644 --- a/apps/docs/markdown-pages/docs/manual/control-flow.mdx +++ b/apps/docs/markdown-pages/docs/manual/control-flow.mdx @@ -8,6 +8,19 @@ order: 14 # If-Else & Loops +
+ +```res prelude +@val external isMorning: bool = "isMorning" +@val external showMenu: bool = "showMenu" +@val external displayMenu: unit => unit = "displayMenu" +@val external startValueInclusive: int = "startValueInclusive" +@val external endValueInclusive: int = "endValueInclusive" +@val external testCondition: bool = "testCondition" +``` + +
+ ReScript supports `if`, `else`, ternary expression (`a ? b : c`), `for` and `while`. The `switch` pattern supports a default case. Read more about [pattern-matching & destructuring](./pattern-matching-destructuring.mdx). @@ -18,7 +31,7 @@ ReScript's `if` is an expression; it evaluates to its body's content: -```res nocheck +```res let message = if isMorning { "Good morning!" } else { @@ -27,7 +40,9 @@ let message = if isMorning { ``` ```js -var message = isMorning ? "Good morning!" : "Hello!"; +let message = isMorning ? "Good morning!" : "Hello!"; + +export { message }; ``` @@ -36,7 +51,7 @@ var message = isMorning ? "Good morning!" : "Hello!"; -```res nocheck +```res if showMenu { displayMenu() } @@ -54,7 +69,7 @@ is basically the same as: -```res nocheck +```res if showMenu { displayMenu() } else { @@ -84,12 +99,14 @@ We also have ternary sugar, but **we encourage you to prefer if-else when possib -```res nocheck +```res let message = isMorning ? "Good morning!" : "Hello!" ``` ```js -var message = isMorning ? "Good morning!" : "Hello!"; +let message = isMorning ? "Good morning!" : "Hello!"; + +export { message }; ``` @@ -102,14 +119,14 @@ For loops iterate from a starting value up to (and including) the ending value. -```res nocheck +```res for i in startValueInclusive to endValueInclusive { Console.log(i) } ``` ```js -for (var i = startValueInclusive; i <= endValueInclusive; ++i) { +for (let i = startValueInclusive; i <= endValueInclusive; ++i) { console.log(i); } ``` @@ -118,7 +135,7 @@ for (var i = startValueInclusive; i <= endValueInclusive; ++i) { -```res nocheck +```res // prints: 1 2 3, one per line for x in 1 to 3 { Console.log(x) @@ -137,14 +154,14 @@ You can make the `for` loop count in the opposite direction by using `downto`. -```res nocheck +```res for i in startValueInclusive downto endValueInclusive { Console.log(i) } ``` ```js -for (var i = startValueInclusive; i >= endValueInclusive; --i) { +for (let i = startValueInclusive; i >= endValueInclusive; --i) { console.log(i); } ``` @@ -153,7 +170,7 @@ for (var i = startValueInclusive; i >= endValueInclusive; --i) { -```res nocheck +```res // prints: 3 2 1, one per line for x in 3 downto 1 { Console.log(x) @@ -174,15 +191,15 @@ While loops execute its body code block while its condition is true. -```res nocheck +```res while testCondition { - // body here + Console.log("Still running") } ``` ```js while (testCondition) { - // body here + console.log("Still running"); } ``` @@ -194,7 +211,7 @@ There's no loop-breaking `break` keyword (nor early `return` from functions, for -```res nocheck +```res let break = ref(false) while !break.contents { @@ -207,9 +224,7 @@ while !break.contents { ``` ```js -let $$break = { - contents: false, -}; +let $$break = { contents: false }; while (!$$break.contents) { if (Math.random() > 0.3) { diff --git a/apps/docs/markdown-pages/docs/manual/converting-from-js.mdx b/apps/docs/markdown-pages/docs/manual/converting-from-js.mdx index 104212f38..81cc1b679 100644 --- a/apps/docs/markdown-pages/docs/manual/converting-from-js.mdx +++ b/apps/docs/markdown-pages/docs/manual/converting-from-js.mdx @@ -18,7 +18,7 @@ ReScript offers a unique project conversion methodology which: ## Step 1: Install ReScript -Run `npm install rescript` on your project, then imitate our [New Project](./installation.mdx#new-project) workflow by adding a `rescript.json` at the root. Then start `npx rescript -w`. +Run `npm install rescript` in your project, then follow the [New Project](./installation.mdx#new-project) workflow by adding a `rescript.json` at the root. Start the compiler in watch mode with `npx rescript watch`. ## Step 2: Copy Paste the Entire JS File @@ -119,6 +119,7 @@ function queryResult(usePayload, payload) { return school.getStudentById(defaultId); } } + let defaultId = 10; export { defaultId }; @@ -128,8 +129,6 @@ export { defaultId }; Check the output. Diff it. Code still works. Moving on! Extract the function: - - ```res nocheck %%raw(` const school = require('school'); @@ -146,22 +145,14 @@ let queryResult = (usePayload, payload) => { } ``` -```js - -``` - - - Format the code: `./node_modules/.bin/rescript format src/Main.res`. -We have a type error: "The record field student can't be found". That's fine! **Always ensure your code is syntactically valid first**. Fixing type errors comes later. +The compiler reports that `student` is a record field without a record type in scope, so it does not produce new JavaScript output for this step. That's fine! **Always ensure your code is syntactically valid first**. Fixing type errors comes later. ## Step 4: Add externals, Fix Types The previous type error is caused by `payload`'s record declaration (which supposedly contains the field `student`) not being found. Since we're trying to convert as quickly as possible, let's use our [object](./object.mdx) feature to avoid needing type declaration ceremonies: - - ```res nocheck %%raw(` const school = require('school'); @@ -178,13 +169,7 @@ let queryResult = (usePayload, payload) => { } ``` -```js - -``` - - - -Now this triggers the next type error, that `school` isn't found. Let's use [`external`](./external.mdx) to bind to that module: +Now this triggers the next type error, that `school` isn't found. There is still no new JavaScript output. Let's use [`external`](./external.mdx) to bind to that module: diff --git a/apps/docs/markdown-pages/docs/manual/dict.mdx b/apps/docs/markdown-pages/docs/manual/dict.mdx index b0bc36e97..b30653dd1 100644 --- a/apps/docs/markdown-pages/docs/manual/dict.mdx +++ b/apps/docs/markdown-pages/docs/manual/dict.mdx @@ -25,15 +25,14 @@ let d2 = Dict.fromArray([("A", 5), ("B", 6)]) ``` ```js -let d = { - A: 5, - B: 6, -}; +let d = { A: 5, B: 6 }; let d2 = Object.fromEntries([ ["A", 5], ["B", 6], ]); + +export { d, d2 }; ``` @@ -66,11 +65,12 @@ let dict{"C": ?c} = d ``` ```js -let d = { - A: 5, - B: 6, - C: 7, -}; +let d2 = Object.fromEntries([ + ["A", 5], + ["B", 6], +]); + +let d = { A: 5, B: 6, C: 7 }; let a = d["A"]; @@ -79,6 +79,8 @@ let b = d.B; let b$1 = b !== undefined ? b : undefined; let c = d.C; + +export { d2, d, a, b$1 as b, c }; ``` @@ -102,12 +104,26 @@ d->Dict.set("C", 7) ``` ```js -let d = { - A: 5, - B: 6, -}; +let d2 = Object.fromEntries([ + ["A", 5], + ["B", 6], +]); + +let d = { A: 5, B: 6, C: 7 }; + +let a = d["A"]; + +let b = d.B; + +let b$1 = b !== undefined ? b : undefined; + +let d$1 = { A: 5, B: 6 }; + +d$1["C"] = 7; -d["C"] = 7; +let c = d.C; + +export { d2, a, b$1 as b, c, d$1 as d }; ``` @@ -136,6 +152,23 @@ let decodeUser = (json: JSON.t) => { ``` ```js +let d2 = Object.fromEntries([ + ["A", 5], + ["B", 6], +]); + +let d = { A: 5, B: 6, C: 7 }; + +let a = d["A"]; + +let b = d.B; + +let b$1 = b !== undefined ? b : undefined; + +let d$1 = { A: 5, B: 6 }; + +d$1["C"] = 7; + function decodeUser(json) { if (typeof json !== "object" || json === null || Array.isArray(json)) { return; @@ -146,12 +179,13 @@ function decodeUser(json) { } let email = json.email; if (typeof email === "string") { - return { - name: name, - email: email, - }; + return { name: name, email: email }; } } + +let c = d.C; + +export { d2, a, b$1 as b, c, d$1 as d, decodeUser }; ``` diff --git a/apps/docs/markdown-pages/docs/manual/editor-code-analysis.mdx b/apps/docs/markdown-pages/docs/manual/editor-code-analysis.mdx index 9a1a5bca4..e0b2ccbd4 100644 --- a/apps/docs/markdown-pages/docs/manual/editor-code-analysis.mdx +++ b/apps/docs/markdown-pages/docs/manual/editor-code-analysis.mdx @@ -17,7 +17,7 @@ Dead code refers to code that's present in your codebase but is never executed. - Confusion during development - Misleading assumptions about functionality -ReScript’s language design allows for accurate and efficient dead code analysis using the **ReScript Code Analyzer**, available via the official VSCode extension. +ReScript’s language design allows for accurate and efficient dead code analysis using the **ReScript Code Analyzer**. It is available through the official VS Code extension and the `rescript-tools` executable bundled with ReScript. ### Prerequisites @@ -37,15 +37,31 @@ ReScript’s language design allows for accurate and efficient dead code analysi - The “Problems” pane populates with dead code warnings and suggestions. -### Reactive Updates (New) +### Command-Line Analysis -Reactive dead code updates are a newer enhancement of Editor Code Analysis and require ReScript VSCode extension v1.73.9 or higher (pre-release). +To run the analyses configured in `rescript.json` from the command line: + +```sh +rescript-tools reanalyze -config +``` + +ReScript 12.1 added a reactive mode that caches unchanged analysis data: + +```sh +rescript-tools reanalyze -config -reactive +``` + +The diagnostic flags `-runs ` and `-churn ` can benchmark cache effectiveness and incremental correctness. `-mermaid` prints a Mermaid diagram of the reactive pipeline. + +`reanalyze-server` keeps the analysis process alive between requests. JSON analysis requests delegate to it transparently, so integrations can use `rescript-tools reanalyze -json` without managing the server themselves. ## Real-World Use Cases ### 1. **Unused Record Fields** ```rescript +type item = {id: string, checked: bool} + type useReturn = { items: array, toggleItemChecked: string => unit, // ← Never used @@ -85,10 +101,11 @@ Old validation logic might remain after refactors—clean it up. ### 4. **Unnecessary Interface Exposure** -```rescript +```resi // DrilldownTarget.resi -MetricParam.parse // ← Never used -MetricParam.serialize // ← Never used +type t +let parse: string => option // ← Never used +let serialize: t => string // ← Never used ``` Keep interfaces minimal by removing unused exports. @@ -96,8 +113,8 @@ Keep interfaces minimal by removing unused exports. ### 5. **Unused Functions** ```rescript -let routerUrlToPath = ... // ← Never used -let routeUrlStartsWith = ... // ← Never used +let routerUrlToPath = url => url->String.split("?")->Array.get(0) // ← Never used +let routeUrlStartsWith = (url, prefix) => url->String.startsWith(prefix) // ← Never used ``` Removing these often uncovers further unused logic. @@ -126,10 +143,34 @@ type user = { Permanently marks code as alive (no future warnings). ```rescript +type user = {name: string} + @live let getUserName = user => user.name ``` +### Scoped `@@live` and `@@dead` + +ReScript 12.2 added standalone forms that set the default for the remainder of the current file or module: + +```res +module PublicApi = { + @@live + + let load = () => "loaded" + let save = _value => () +} + +module DeferredCleanup = { + @@dead + + let oldParser = input => input + let oldSerializer = value => value +} +``` + +Items under `@@live` are treated as live roots and can keep their dependencies alive. Items under `@@dead` are suppressed but don't keep their dependencies alive. A later `@@live` or `@@dead` changes the default again, and nested modules inherit the active setting. + ## Configuration Add to your `rescript.json`: @@ -137,8 +178,8 @@ Add to your `rescript.json`: ```json "reanalyze": { "analysis": ["dce"], - "suppress": ["src/bindings", "src/stories", "src/routes"], - "unsuppress": [], + "suppress": ["src/generated/**", "src/stories/**"], + "unsuppress": ["src/generated/handwritten/**"], "transitive": false } ``` @@ -146,10 +187,12 @@ Add to your `rescript.json`: ### Options: - **analysis**: Enables dead code analysis (`"dce"`) -- **suppress**: Silences reporting for paths (still analyzes) -- **unsuppress**: Re-enables reports within suppressed paths +- **suppress**: Silences reporting for matching paths (they are still analyzed) +- **unsuppress**: Re-enables reports for matching paths within a suppressed area - **transitive**: Controls reporting of indirectly dead code +Since ReScript 12.3, `suppress` and `unsuppress` accept glob patterns such as `src/generated/**`. Plain path prefixes continue to work. + **Recommendation:** Set `transitive: false` for incremental cleanup. ## Summary diff --git a/apps/docs/markdown-pages/docs/manual/editor-plugins.mdx b/apps/docs/markdown-pages/docs/manual/editor-plugins.mdx index 84f618bf6..5b434a1df 100644 --- a/apps/docs/markdown-pages/docs/manual/editor-plugins.mdx +++ b/apps/docs/markdown-pages/docs/manual/editor-plugins.mdx @@ -90,14 +90,24 @@ let twoExceptions = (x, y) => { It is possible to silence the analysis by adding a `@doesNotThrow` annotation: ```rescript +exception Invalid_argument(string) + @throws(Invalid_argument) -let stringMake1 = String.make(12, ' ') +let makeSpaces = length => { + if length < 0 { + throw(Invalid_argument("negative length")) + } + " "->String.repeat(length) +} + +@throws(Invalid_argument) +let stringMake1 = makeSpaces(12) // Silence only the make function -let stringMake2 = (@doesNotThrow String.make)(12, ' ') +let stringMake2 = (@doesNotThrow makeSpaces)(12) // Silence the entire call (including arguments to make) -let stringMake3 = @doesNotThrow String.make(12, ' ') +let stringMake3 = @doesNotThrow makeSpaces(12) ``` @@ -107,7 +117,11 @@ let stringMake3 = @doesNotThrow String.make(12, ' ') - Generic exceptions are not understood by the analysis. For example `exn` is not recognized below (only concrete exceptions are): ```rescript -try (foo()) { | exn => throw(exn) } +let foo = () => throw(Not_found) + +try foo() catch { +| exn => throw(exn) +} ``` - Uses of e.g. `List.head` are interpreted as belonging to the standard library. If you re-define `List` in the local scope, the analysis it will think it's dealing with `List` from the standard library. diff --git a/apps/docs/markdown-pages/docs/manual/equality-comparison.mdx b/apps/docs/markdown-pages/docs/manual/equality-comparison.mdx index 675eab021..325d7a327 100644 --- a/apps/docs/markdown-pages/docs/manual/equality-comparison.mdx +++ b/apps/docs/markdown-pages/docs/manual/equality-comparison.mdx @@ -30,13 +30,7 @@ let doStringsMatch = (s1: string, s2: string) => s1 === s2 ```js let t2 = "foo" === "foo"; -let t3 = - { - foo: "bar", - } === - { - foo: "bar", - }; +let t3 = { foo: "bar" } === { foo: "bar" }; function doStringsMatch(s1, s2) { return s1 === s2; @@ -71,14 +65,7 @@ import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.js let t2 = true; -let t3 = Primitive_object.equal( - { - foo: "bar", - }, - { - foo: "bar", - }, -); +let t3 = Primitive_object.equal({ foo: "bar" }, { foo: "bar" }); function doStringsMatch(s1, s2) { return s1 === s2; diff --git a/apps/docs/markdown-pages/docs/manual/exception.mdx b/apps/docs/markdown-pages/docs/manual/exception.mdx index 585da2804..3aa56ba22 100644 --- a/apps/docs/markdown-pages/docs/manual/exception.mdx +++ b/apps/docs/markdown-pages/docs/manual/exception.mdx @@ -24,7 +24,7 @@ throw(InputClosed("The stream has closed!")) import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js"; let InputClosed = /* @__PURE__ */ Primitive_exceptions.create( - "_tempFile.InputClosed", + "Example.InputClosed", ); throw { @@ -64,16 +64,13 @@ let result = ``` ```js -import * as Primitive_exceptions from "./stdlib/Primitive_exceptions.js"; +import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js"; function getItem(item) { if (item === 3) { return 1; } - throw { - RE_EXN_ID: "Not_found", - Error: new Error(), - }; + throw { RE_EXN_ID: "Not_found", Error: new Error() }; } let result; @@ -88,6 +85,8 @@ try { throw exn; } } + +export { getItem, result }; ``` @@ -106,40 +105,53 @@ switch list{1, 2, 3}->List.getOrThrow(4) { ``` ```js -import * as Stdlib_List from "./stdlib/Stdlib_List.js"; -import * as Primitive_exceptions from "./stdlib/Primitive_exceptions.js"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.js"; +import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js"; + +function getItem(item) { + if (item === 3) { + return 1; + } + throw { RE_EXN_ID: "Not_found", Error: new Error() }; +} + +let result; + +try { + result = getItem(2); +} catch (raw_exn) { + let exn = Primitive_exceptions.internalToException(raw_exn); + if (exn.RE_EXN_ID === "Not_found") { + result = 0; + } else { + throw exn; + } +} let exit = 0; let item; try { - item = Stdlib_List.getExn( - { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */ 0, - }, - }, - }, + item = Stdlib_List.getOrThrow( + { hd: 1, tl: { hd: 2, tl: { hd: 3, tl: /* [] */ 0 } } }, 4, ); exit = 1; -} catch (raw_exn) { - let exn = Primitive_exceptions.internalToException(raw_exn); - if (exn.RE_EXN_ID === "Not_found") { +} catch (raw_exn$1) { + let exn$1 = Primitive_exceptions.internalToException(raw_exn$1); + if (exn$1.RE_EXN_ID === "Not_found") { console.log("No such item found!"); } else { - throw exn; + throw exn$1; } } if (exit === 1) { console.log(item); } + +export { getItem, result }; ``` @@ -173,10 +185,7 @@ function getItem(item) { if (item === 3) { return 1; } - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; + throw { RE_EXN_ID: "Not_found", Error: new Error() }; } let result; @@ -197,16 +206,10 @@ let exit = 0; let item; try { - item = Stdlib_List.getOrThrow({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, 4); + item = Stdlib_List.getOrThrow( + { hd: 1, tl: { hd: 2, tl: { hd: 3, tl: /* [] */ 0 } } }, + 4, + ); exit = 1; } catch (raw_exn$1) { let exn$1 = Primitive_exceptions.internalToException(raw_exn$1); @@ -226,7 +229,7 @@ function divide(a, b) { throw { RE_EXN_ID: "Invalid_argument", _1: "Denominator is zero", - Error: new Error() + Error: new Error(), }; } return Primitive_int.div(a, b); @@ -243,11 +246,7 @@ try { } } -export { - getItem, - result, - divide, -} +export { getItem, result, divide }; ```` @@ -284,10 +283,7 @@ function getItem(item) { if (item === 3) { return 1; } - throw { - RE_EXN_ID: "Not_found", - Error: new Error(), - }; + throw { RE_EXN_ID: "Not_found", Error: new Error() }; } let result; @@ -309,16 +305,7 @@ let item; try { item = Stdlib_List.getOrThrow( - { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */ 0, - }, - }, - }, + { hd: 1, tl: { hd: 2, tl: { hd: 3, tl: /* [] */ 0 } } }, 4, ); exit = 1; @@ -344,13 +331,13 @@ function decodeUser(json) { } throw { RE_EXN_ID: "Assert_failure", - _1: ["_tempFile.res", 26, 11], + _1: ["Example.res", 26, 11], Error: new Error(), }; } throw { RE_EXN_ID: "Assert_failure", - _1: ["_tempFile.res", 28, 9], + _1: ["Example.res", 28, 9], Error: new Error(), }; } @@ -405,10 +392,7 @@ function getItem(item) { if (item === 3) { return 1; } - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; + throw { RE_EXN_ID: "Not_found", Error: new Error() }; } let result; @@ -429,16 +413,10 @@ let exit = 0; let item; try { - item = Stdlib_List.getOrThrow({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, 4); + item = Stdlib_List.getOrThrow( + { hd: 1, tl: { hd: 2, tl: { hd: 3, tl: /* [] */ 0 } } }, + 4, + ); exit = 1; } catch (raw_exn$1) { let exn$1 = Primitive_exceptions.internalToException(raw_exn$1); @@ -462,7 +440,7 @@ function isValidEmail(email) { throw { RE_EXN_ID: "Failure", _1: "Invalid email address", - Error: new Error() + Error: new Error(), }; } @@ -480,12 +458,7 @@ try { } } -export { - getItem, - result, - isValidEmail, - isValid, -} +export { getItem, result, isValidEmail, isValid }; ```` @@ -514,10 +487,7 @@ function getItem(item) { if (item === 3) { return 1; } - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; + throw { RE_EXN_ID: "Not_found", Error: new Error() }; } try { @@ -534,16 +504,10 @@ let exit = 0; let item; try { - item = Stdlib_List.getOrThrow({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, 4); + item = Stdlib_List.getOrThrow( + { hd: 1, tl: { hd: 2, tl: { hd: 3, tl: /* [] */ 0 } } }, + 4, + ); exit = 1; } catch (raw_exn$1) { let exn$1 = Primitive_exceptions.internalToException(raw_exn$1); @@ -573,10 +537,7 @@ try { console.log(result); -export { - getItem, - result, -} +export { getItem, result }; ```` @@ -597,14 +558,14 @@ exports.someJsFunctionThatThrows = () => { Then catch it from ReScript: -```res nocheck +```res // import the method in Example.js @module("./Example") external someJsFunctionThatThrows: () => unit = "someJsFunctionThatThrows" try { // call the external method - someJSFunctionThatThrows() + someJsFunctionThatThrows() } catch { | JsExn(exn) => switch JsExn.message(exn) { @@ -640,10 +601,7 @@ function getItem(item) { if (item === 3) { return 1; } - throw { - RE_EXN_ID: "Not_found", - Error: new Error(), - }; + throw { RE_EXN_ID: "Not_found", Error: new Error() }; } let result; @@ -665,16 +623,7 @@ let item; try { item = Stdlib_List.getOrThrow( - { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */ 0, - }, - }, - }, + { hd: 1, tl: { hd: 2, tl: { hd: 3, tl: /* [] */ 0 } } }, 4, ); exit = 1; @@ -731,10 +680,7 @@ function getItem(item) { if (item === 3) { return 1; } - throw { - RE_EXN_ID: "Not_found", - Error: new Error(), - }; + throw { RE_EXN_ID: "Not_found", Error: new Error() }; } let result; @@ -756,16 +702,7 @@ let item; try { item = Stdlib_List.getOrThrow( - { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */ 0, - }, - }, - }, + { hd: 1, tl: { hd: 2, tl: { hd: 3, tl: /* [] */ 0 } } }, 4, ); exit = 1; @@ -824,10 +761,7 @@ function getItem(item) { if (item === 3) { return 1; } - throw { - RE_EXN_ID: "Not_found", - Error: new Error(), - }; + throw { RE_EXN_ID: "Not_found", Error: new Error() }; } let result; @@ -849,16 +783,7 @@ let item; try { item = Stdlib_List.getOrThrow( - { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */ 0, - }, - }, - }, + { hd: 1, tl: { hd: 2, tl: { hd: 3, tl: /* [] */ 0 } } }, 4, ); exit = 1; @@ -876,15 +801,11 @@ if (exit === 1) { } let BadArgument = /* @__PURE__ */ Primitive_exceptions.create( - "_tempFile.BadArgument", + "Example.BadArgument", ); function myTest() { - throw { - RE_EXN_ID: BadArgument, - myMessage: "Oops!", - Error: new Error(), - }; + throw { RE_EXN_ID: BadArgument, myMessage: "Oops!", Error: new Error() }; } export { getItem, result, BadArgument, myTest }; diff --git a/apps/docs/markdown-pages/docs/manual/extensible-variant.mdx b/apps/docs/markdown-pages/docs/manual/extensible-variant.mdx index 800432896..c82a4d7ec 100644 --- a/apps/docs/markdown-pages/docs/manual/extensible-variant.mdx +++ b/apps/docs/markdown-pages/docs/manual/extensible-variant.mdx @@ -14,7 +14,7 @@ Variant types are usually constrained to a fixed set of constructors. There may -```res +```res prelude type t = .. type t += Other @@ -27,11 +27,11 @@ type t += ```js import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js"; -let Other = /* @__PURE__ */ Primitive_exceptions.create("_tempFile.Other"); +let Other = /* @__PURE__ */ Primitive_exceptions.create("Example.Other"); -let Point = /* @__PURE__ */ Primitive_exceptions.create("_tempFile.Point"); +let Point = /* @__PURE__ */ Primitive_exceptions.create("Example.Point"); -let Line = /* @__PURE__ */ Primitive_exceptions.create("_tempFile.Line"); +let Line = /* @__PURE__ */ Primitive_exceptions.create("Example.Line"); export { Other, Point, Line }; ``` @@ -48,7 +48,7 @@ Extensible variants are open-ended, so the compiler will not be able to exhausti -```res nocheck +```res let print = v => switch v { | Point(x, y) => Console.log2("Point", (x, y)) @@ -59,6 +59,14 @@ let print = v => ``` ```js +import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js"; + +let Other = /* @__PURE__ */ Primitive_exceptions.create("Example.Other"); + +let Point = /* @__PURE__ */ Primitive_exceptions.create("Example.Point"); + +let Line = /* @__PURE__ */ Primitive_exceptions.create("Example.Line"); + function print(v) { if (v.RE_EXN_ID === Point) { console.log("Point", [v._1, v._2]); @@ -68,6 +76,8 @@ function print(v) { console.log("Other"); } } + +export { Other, Point, Line, print }; ``` diff --git a/apps/docs/markdown-pages/docs/manual/function.mdx b/apps/docs/markdown-pages/docs/manual/function.mdx index 655052fe1..97da51115 100644 --- a/apps/docs/markdown-pages/docs/manual/function.mdx +++ b/apps/docs/markdown-pages/docs/manual/function.mdx @@ -22,6 +22,8 @@ let greet = (name) => "Hello " ++ name function greet(name) { return "Hello " + name; } + +export { greet }; ``` @@ -32,7 +34,7 @@ When ReScript can evaluate a known pure function call ahead of time, it can emit -```res nocheck +```res let message = greet("world!") // "Hello world!" ``` @@ -54,7 +56,7 @@ If all the arguments are known up front, ReScript can precompute the result too: -```res nocheck +```res let add = (x, y, z) => x + y + z let sum = add(1, 2, 3) // 6 ``` @@ -79,7 +81,7 @@ For longer functions, you'd surround the body with a block: -```res nocheck +```res let greetMore = (name) => { let part1 = "Hello" part1 ++ " " ++ name @@ -102,26 +104,72 @@ export { greet, greetMore }; If your function has no argument, just write `let greetMore = () => {...}`. +## Function Directives + +Use `@directive` directly before a function expression to emit a JavaScript directive at the start of that function. This works with synchronous and asynchronous functions, including functions with labeled arguments. + + + +```res +let greet = @directive("'use server'") async name => { + "Hello " + name +} +``` + +```js +async function greet(name) { + "use server"; + return "Hello " + name; +} + +export { greet }; +``` + + + +The attribute belongs to the function expression, after the `=` rather than before the `let` binding. File-level directives use the separate `@@directive` form. See the [`@directive` syntax reference](../../syntax-lookup/decorator_directive.mdx). + ## Labeled Arguments +
+ +```res prelude +type color = string +@val external setColor: color => unit = "setColor" +@val external startAt: (int, int) => unit = "startAt" +@val external color: color = "color" +@val external payloadRadius: option = "payloadRadius" +@val external mySideEffect: unit => promise = "mySideEffect" +@val external handleError: exn => promise = "handleError" +@val external myFunc: unit => unit = "myFunc" +``` + +
+ Multi-arguments functions, especially those whose arguments are of the same type, can be confusing to call. -```res nocheck +```res let addCoordinates = (x, y) => { - // use x and y here + Console.log2(x, y) } // ... addCoordinates(5, 6) // which is x, which is y? ``` ```js +function greet(name) { + return "Hello " + name; +} + function addCoordinates(x, y) { - // use x and y here + console.log(x, y); } -addCoordinates(5, 6); +console.log(5, 6); + +export { greet, addCoordinates }; ``` @@ -130,20 +178,26 @@ You can attach labels to an argument by prefixing the name with the `~` symbol: -```res nocheck +```res prelude let addCoordinates = (~x, ~y) => { - // use x and y here + Console.log2(x, y) } // ... addCoordinates(~x=5, ~y=6) ``` ```js +function greet(name) { + return "Hello " + name; +} + function addCoordinates(x, y) { - // use x and y here + console.log(x, y); } -addCoordinates(5, 6); +console.log(5, 6); + +export { greet, addCoordinates }; ``` @@ -152,12 +206,24 @@ You can provide the arguments in **any order**: -```res nocheck +```res addCoordinates(~y=6, ~x=5) ``` ```js -addCoordinates(5, 6); +function greet(name) { + return "Hello " + name; +} + +function addCoordinates(x, y) { + console.log(x, y); +} + +console.log(5, 6); + +console.log(5, 6); + +export { greet, addCoordinates }; ``` @@ -166,7 +232,7 @@ The `~x` part in the declaration means the function accepts an argument labeled -```res nocheck +```res let drawCircle = (~radius as r, ~color as c) => { setColor(c) startAt(r, r) @@ -177,12 +243,24 @@ drawCircle(~radius=10, ~color="red") ``` ```js +function greet(name) { + return "Hello " + name; +} + +function addCoordinates(x, y) { + console.log(x, y); +} + +console.log(5, 6); + function drawCircle(r, c) { setColor(c); - return startAt(r, r); + startAt(r, r); } drawCircle(10, "red"); + +export { greet, addCoordinates, drawCircle }; ``` @@ -193,16 +271,30 @@ Here's the syntax for typing the arguments: -```res nocheck +```res let drawCircle = (~radius as r: int, ~color as c: string) => { - // code here + setColor(c) + startAt(r, r) } ``` ```js +function greet(name) { + return "Hello " + name; +} + +function addCoordinates(x, y) { + console.log(x, y); +} + +console.log(5, 6); + function drawCircle(r, c) { - // code here + setColor(c); + startAt(r, r); } + +export { greet, addCoordinates, drawCircle }; ``` @@ -213,7 +305,7 @@ Labeled function arguments can be made optional during declaration. You can then -```res nocheck +```res prelude // radius can be omitted let drawCircle = (~color, ~radius=?) => { setColor(color) @@ -225,16 +317,26 @@ let drawCircle = (~color, ~radius=?) => { ``` ```js -var Caml_option = require("./stdlib/caml_option.js"); +function greet(name) { + return "Hello " + name; +} + +function addCoordinates(x, y) { + console.log(x, y); +} + +console.log(5, 6); function drawCircle(color, radius) { setColor(color); - if (radius === undefined) { - return startAt(1, 1); + if (radius !== undefined) { + startAt(radius, radius); + } else { + startAt(1, 1); } - var r_ = Caml_option.valFromOption(radius); - return startAt(r_, r_); } + +export { greet, addCoordinates, drawCircle }; ``` @@ -251,7 +353,7 @@ If we get back to our previous example and both add a signature and type annotat -```res nocheck +```res let drawCircle: (~color: color, ~radius: int=?) => unit = (~color: color, ~radius: option=?) => { setColor(color) @@ -263,14 +365,26 @@ let drawCircle: (~color: color, ~radius: int=?) => unit = ``` ```js +function greet(name) { + return "Hello " + name; +} + +function addCoordinates(x, y) { + console.log(x, y); +} + +console.log(5, 6); + function drawCircle(color, radius) { setColor(color); if (radius !== undefined) { - return startAt(radius, radius); + startAt(radius, radius); } else { - return startAt(1, 1); + startAt(1, 1); } } + +export { greet, addCoordinates, drawCircle }; ``` @@ -287,7 +401,7 @@ Sometimes, you might want to forward a value to a function without knowing wheth -```res nocheck +```res let result = switch payloadRadius { | None => drawCircle(~color) @@ -296,12 +410,31 @@ let result = ``` ```js -var r = payloadRadius; +function greet(name) { + return "Hello " + name; +} + +function addCoordinates(x, y) { + console.log(x, y); +} -var result = - r !== undefined - ? drawCircle(color, Caml_option.valFromOption(r)) - : drawCircle(color); +console.log(5, 6); + +function drawCircle(color, radius) { + setColor(color); + if (radius !== undefined) { + startAt(radius, radius); + } else { + startAt(1, 1); + } +} + +let r = payloadRadius; + +let result = + r !== undefined ? drawCircle(color, r) : drawCircle(color, undefined); + +export { greet, addCoordinates, drawCircle, result }; ``` @@ -310,12 +443,33 @@ This quickly gets tedious. We provide a shortcut: -```res nocheck +```res let result = drawCircle(~color, ~radius=?payloadRadius) ``` ```js -var result = drawCircle(1, undefined); +function greet(name) { + return "Hello " + name; +} + +function addCoordinates(x, y) { + console.log(x, y); +} + +console.log(5, 6); + +function drawCircle(color, radius) { + setColor(color); + if (radius !== undefined) { + startAt(radius, radius); + } else { + startAt(1, 1); + } +} + +let result = drawCircle(color, payloadRadius); + +export { greet, addCoordinates, drawCircle, result }; ``` @@ -328,7 +482,7 @@ Optional labeled arguments can also be provided a default value. In this case, t -```res nocheck +```res let drawCircle = (~radius=1, ~color) => { setColor(color) startAt(radius, radius) @@ -336,11 +490,23 @@ let drawCircle = (~radius=1, ~color) => { ``` ```js +function greet(name) { + return "Hello " + name; +} + +function addCoordinates(x, y) { + console.log(x, y); +} + +console.log(5, 6); + function drawCircle(radiusOpt, color) { - var radius = radiusOpt !== undefined ? radiusOpt : 1; + let radius = radiusOpt !== undefined ? radiusOpt : 1; setColor(color); - return startAt(radius, radius); + startAt(radius, radius); } + +export { greet, addCoordinates, drawCircle }; ``` @@ -351,7 +517,7 @@ ReScript chooses the sane default of preventing a function to be called recursiv -```res nocheck +```res let rec neverTerminate = () => neverTerminate() ``` @@ -360,13 +526,28 @@ function greet(name) { return "Hello " + name; } +function addCoordinates(x, y) { + console.log(x, y); +} + +console.log(5, 6); + +function drawCircle(color, radius) { + setColor(color); + if (radius !== undefined) { + startAt(radius, radius); + } else { + startAt(1, 1); + } +} + function neverTerminate() { while (true) { continue; } } -export { greet, neverTerminate }; +export { greet, addCoordinates, drawCircle, neverTerminate }; ``` @@ -375,7 +556,7 @@ A simple recursive function may look like this: -```res nocheck +```res // Recursively check every item on the list until one equals the `item` // argument. If a match is found, return `true`, otherwise return `false` let rec listHas = (list, item) => @@ -390,6 +571,21 @@ function greet(name) { return "Hello " + name; } +function addCoordinates(x, y) { + console.log(x, y); +} + +console.log(5, 6); + +function drawCircle(color, radius) { + setColor(color); + if (radius !== undefined) { + startAt(radius, radius); + } else { + startAt(1, 1); + } +} + function listHas(_list, item) { while (true) { let list = _list; @@ -404,7 +600,7 @@ function listHas(_list, item) { } } -export { greet, listHas }; +export { greet, addCoordinates, drawCircle, listHas }; ``` @@ -418,7 +614,7 @@ Mutually recursive functions start like a single recursive function using the -```res nocheck +```res let rec callSecond = () => callFirst() and callFirst = () => callSecond() ``` @@ -428,6 +624,21 @@ function greet(name) { return "Hello " + name; } +function addCoordinates(x, y) { + console.log(x, y); +} + +console.log(5, 6); + +function drawCircle(color, radius) { + setColor(color); + if (radius !== undefined) { + startAt(radius, radius); + } else { + startAt(1, 1); + } +} + function callSecond() { while (true) { continue; @@ -440,7 +651,7 @@ function callFirst() { } } -export { greet, callSecond, callFirst }; +export { greet, addCoordinates, drawCircle, callSecond, callFirst }; ``` @@ -452,12 +663,31 @@ export { greet, callSecond, callFirst }; To partially apply a function, use the explicit `...` syntax. -```res nocheck +```res let add = (a, b) => a + b let addFive = add(5, ...) ``` ```js +function greet(name) { + return "Hello " + name; +} + +function addCoordinates(x, y) { + console.log(x, y); +} + +console.log(5, 6); + +function drawCircle(color, radius) { + setColor(color); + if (radius !== undefined) { + startAt(radius, radius); + } else { + startAt(1, 1); + } +} + function add(a, b) { return (a + b) | 0; } @@ -465,6 +695,8 @@ function add(a, b) { function addFive(extra) { return (5 + extra) | 0; } + +export { greet, addCoordinates, drawCircle, add, addFive }; ``` @@ -476,7 +708,7 @@ The output looks like idiomatic JS: -```res nocheck +```res let getUserName = async (userId) => userId let greetUser = async (userId) => { @@ -490,6 +722,21 @@ function greet(name) { return "Hello " + name; } +function addCoordinates(x, y) { + console.log(x, y); +} + +console.log(5, 6); + +function drawCircle(color, radius) { + setColor(color); + if (radius !== undefined) { + startAt(radius, radius); + } else { + startAt(1, 1); + } +} + async function getUserName(userId) { return userId; } @@ -499,7 +746,7 @@ async function greetUser(userId) { return "Hello " + name + "!"; } -export { greet, getUserName, greetUser }; +export { greet, addCoordinates, drawCircle, getUserName, greetUser }; ``` @@ -515,7 +762,7 @@ Both JS exceptions and exceptions defined in ReScript can be caught. The compile -```res nocheck +```res exception SomeReScriptException let somethingThatMightThrow = async () => throw(SomeReScriptException) @@ -537,15 +784,27 @@ function greet(name) { return "Hello " + name; } +function addCoordinates(x, y) { + console.log(x, y); +} + +console.log(5, 6); + +function drawCircle(color, radius) { + setColor(color); + if (radius !== undefined) { + startAt(radius, radius); + } else { + startAt(1, 1); + } +} + let SomeReScriptException = /* @__PURE__ */ Primitive_exceptions.create( - "_tempFile.SomeReScriptException", + "Example.SomeReScriptException", ); async function somethingThatMightThrow() { - throw { - RE_EXN_ID: SomeReScriptException, - Error: new Error(), - }; + throw { RE_EXN_ID: SomeReScriptException, Error: new Error() }; } async function someAsyncFn() { @@ -565,7 +824,14 @@ async function someAsyncFn() { return Primitive_option.some(data); } -export { greet, SomeReScriptException, somethingThatMightThrow, someAsyncFn }; +export { + greet, + addCoordinates, + drawCircle, + SomeReScriptException, + somethingThatMightThrow, + someAsyncFn, +}; ``` @@ -576,27 +842,48 @@ Occasionally you may want to ignore the return value of a function. ReScript pro -```res nocheck +```res mySideEffect()->Promise.catch(handleError)->ignore setTimeout(myFunc, 1000)->ignore ``` ```js -$$Promise.$$catch(mySideEffect(), function (prim) { - return handleError(prim); -}); +import * as Stdlib_Promise from "@rescript/runtime/lib/es6/Stdlib_Promise.js"; -setTimeout(function (prim) { +function greet(name) { + return "Hello " + name; +} + +function addCoordinates(x, y) { + console.log(x, y); +} + +console.log(5, 6); + +function drawCircle(color, radius) { + setColor(color); + if (radius !== undefined) { + startAt(radius, radius); + } else { + startAt(1, 1); + } +} + +Stdlib_Promise.$$catch(mySideEffect(), (prim) => handleError(prim)); + +setTimeout((prim) => { myFunc(); }, 1000); + +export { greet, addCoordinates, drawCircle }; ``` ## Tips & Tricks -Cheat sheet for the function syntaxes: +Cheat sheet for the function syntaxes. These are alternative declarations and partial expressions, rather than a single complete program: ### Declaration diff --git a/apps/docs/markdown-pages/docs/manual/generalized-algebraic-data-types.mdx b/apps/docs/markdown-pages/docs/manual/generalized-algebraic-data-types.mdx index ad0cd4dde..e923e4f0f 100644 --- a/apps/docs/markdown-pages/docs/manual/generalized-algebraic-data-types.mdx +++ b/apps/docs/markdown-pages/docs/manual/generalized-algebraic-data-types.mdx @@ -22,7 +22,7 @@ GADTs usually are overkill, but when you need them, you need them! Understanding Suppose a simple variant type that represents the current timezone of a date value. This handles both daylight savings and standard time: -```res nocheck +```res prelude type timezone = | EST // standard time | EDT // daylight time @@ -33,9 +33,7 @@ type timezone = Using this variant type, we will end up having functions like this: -{/* TODO: fix this example, it has an error because it doesn't have access to the previous snippet */} - -```res nocheck +```res let convertToDaylight = tz => { switch tz { | EST => EDT @@ -49,9 +47,7 @@ This function is only valid for a subset of our variant type's constructors but Let's see if we can find a way for the compiler to help us with normal variants. We could define another variant type to distinguish the two kinds of timezone. -{/* TODO: fix this example, it has an error because it doesn't have access to the previous snippet */} - -```res nocheck +```res prelude type daylightOrStandard = | Daylight(timezone) | Standard(timezone) @@ -59,9 +55,7 @@ type daylightOrStandard = This has a lot of problems. For one, it's cumbersome and redundant. We would now have to pattern-match twice whenever we deal with a timezone that's wrapped up here. The compiler will force us to check whether we are dealing with daylight or standard time, but notice that there's nothing stopping us from providing invalid timezones to these constructors: -{/* TODO: fix this example, it has an error because it doesn't have access to the previous snippet */} - -```res nocheck +```res let invalidTz1 = Daylight(EST) let invalidTz2 = Standard(EDT) ``` @@ -70,7 +64,7 @@ Consequently, we still have to write our redundant catchall cases. We could defi That could be a passable solution, but what we would really like to do is implement some kind of subtyping relationship. We have two _kinds_ of timezone. This is where GADTs are handy: -```res nocheck +```res type standard type daylight @@ -84,9 +78,16 @@ type rec timezone<_> = We define our type with a type parameter. We manually annotate each constructor, providing it with the correct type parameter indicating whether it is standard or daylight. Each constructor is a `timezone`, but we've added another level of specificity using a type parameter. Constructors are now understood to be `standard` or `daylight` at the _type_ level. Now we can fix our function like this: -{/* TODO: fix this example, it has an error because it doesn't have access to the previous snippet */} +```res +type standard +type daylight + +type rec timezone<_> = + | EST: timezone + | EDT: timezone + | CST: timezone + | CDT: timezone -```res nocheck let convertToDaylight = tz => { switch tz { | EST => EDT @@ -100,9 +101,17 @@ The compiler can infer correctly that this function should only take `timezone = + | EST: timezone + | EDT: timezone + | CST: timezone + | CDT: timezone + let convertToDaylight = tz => switch tz { | EST => EDT @@ -114,22 +123,33 @@ let convertToDaylight = tz => This will complain that `daylight` and `standard` are incompatible. To fix this, we need to explicitly annotate to tell the compiler to accept both: -{/* TODO: fix this example, it has an error because it doesn't have access to the previous snippet */} +```res +type standard +type daylight + +type rec timezone<_> = + | EST: timezone + | EDT: timezone + | CST: timezone + | CDT: timezone -```res nocheck -let convertToDaylight : type a. timezone => timezone = // ... +let convertToDaylight = (type a, tz: timezone): timezone => + switch tz { + | EST => EDT + | CST => CDT + | CDT => CDT + | EDT => EDT + } ``` -The syntax `type a.` here defines a _locally abstract type_ which basically tells the compiler that the type parameter a is some specific type, but we don't care what it is. The cost of the extra specificity and safety that +The `(type a, ...)` syntax here defines a _locally abstract type_ which basically tells the compiler that the type parameter a is some specific type, but we don't care what it is. The cost of the extra specificity and safety that GADTs give us is that the compiler less able to help us with type inference. ## Varying return type Sometimes, a function should have a different return type based on what you give it, and GADTs are how we can do this in a type-safe way. We can implement a generic `add` function that works on both `int` or `float`: -{/* this example purposefully has an error so it is not marked as an example */} - -```res nocheck +```res prelude type rec number<_> = Int(int): number | Float(float): number let add = (type a, x: number, y: number): a => @@ -139,7 +159,11 @@ let add = (type a, x: number, y: number): a => } let foo = add(Int(1), Int(2)) +``` + +Mixing witnesses deliberately produces a type error: +```res nocheck let bar = add(Int(1), Float(2.0)) // the compiler will complain here ``` @@ -149,7 +173,7 @@ We can also use this to avoid returning `option` unnecessarily. We create an arr [^2]: This example is adapted from [here](https://dev.realworldocaml.org/gadts.html). -```res nocheck +```res module IfNotFound = { type rec t<_, _> = | Raise: t<'a, 'a> @@ -189,7 +213,7 @@ interchangeably, hiding the implementation type rather than exposing it. This is `numTy` serves as a type-witness, making it possible to recover type information that was hidden dynamically. Matching on `numTy` will "reveal" the type of the other value in the pair. We can use this to write a generic sum function over arrays of numbers: -```res nocheck +```res type rec numTy<'a> = | Int: numTy | Float: numTy @@ -216,17 +240,13 @@ This API has a method for binding event handlers, `on`. This takes an event and depending on which event we are binding to. A naive implementation might look similar to this, defining a separate method for each stream event to wrap the unsafe version of `on`. -{/* TODO: fix this example, it has an error */} - -```res nocheck +```res module Stream = { type t - @new @module("node:http") external make: unit => t = "stream" - - @send external on : (stream, string, 'a) => unit + @send external on: (t, string, 'a) => unit = "on" let onEnd = (stream, callback: unit=> unit) => stream->on("end", callback) - let onData = (stream, callback: ('a => 'b)) => stream->on("", callback) + let onData = (stream, callback: ('a => 'b)) => stream->on("data", callback) // etc. ... } ``` @@ -247,10 +267,7 @@ The real magic happens in the signature of `on`. Read it carefully, and then loo follow how the type variables are getting filled in, write it out on paper what each type variable is equal to if you need and it will soon become clear. -{/* TODO: fix this example, it has an error */} - -```res nocheck - +```res module Stream = { type t<'a> @@ -262,24 +279,31 @@ module Stream = { @unboxed type chunk = | Str(string) - // Node uses actually its own buffer type, but for the tutorial we are using the stdlib's buffer type. + // Node buffers expose an ArrayBuffer through their buffer property. | Buf(buffer) type rec event<_, _> = // "as" here is setting the runtime representation of our constructor | @as("pipe") Pipe: event => unit> - | @as("end") End: event<'inputStream, option => unit> + | @as("end") End: event unit> | @as("data") Data: event unit> - @new @module("node:http") external make: unit => t<'a> = "Stream" + module Writable = { + type options = {write: (chunk, string, unit => unit) => unit} + @new @module("node:stream") external make: options => t = "Writable" + } + module Readable = { + @module("node:stream") @scope("Readable") + external from: array => t = "from" + } @send external on: (t<'inputStream>, event<'inputStream, 'callback>, 'callback) => unit = "on" } -let writer = Stream.Writable.make() -let reader = Stream.Readable.make() +let writer = Stream.Writable.make({write: (_chunk, _encoding, done) => done()}) +let reader = Stream.Readable.from(["Hello"]) // Types will be correctly inferred for each callback, based on the event parameter provided writer->Stream.on(Pipe, r => { Console.log("Piping has started") @@ -292,7 +316,11 @@ writer->Stream.on(Pipe, r => { ) }) -writer->Stream.on(End, _ => Console.log("End reached")) +reader->Stream.on(End, () => Console.log("End reached")) + +@send +external pipe: (Stream.t, Stream.t) => unit = "pipe" +reader->pipe(writer) ``` diff --git a/apps/docs/markdown-pages/docs/manual/generate-converters-accessors.mdx b/apps/docs/markdown-pages/docs/manual/generate-converters-accessors.mdx index 144ac6205..efd9ea9af 100644 --- a/apps/docs/markdown-pages/docs/manual/generate-converters-accessors.mdx +++ b/apps/docs/markdown-pages/docs/manual/generate-converters-accessors.mdx @@ -35,7 +35,7 @@ Use `@deriving(accessors)` on a variant type to create accessor functions for it -```res +```res prelude @deriving(accessors) type action = | Click @@ -45,10 +45,7 @@ type action = ```js function submit(param_0) { - return { - TAG: "Submit", - _0: param_0, - }; + return { TAG: "Submit", _0: param_0 }; } let click = "Click"; @@ -60,7 +57,7 @@ export { click, submit, cancel }; -Variants constructors with payloads generate functions, payload-less constructors generate plain integers (the internal representation of variants). +Variants constructors with payloads generate functions, payload-less constructors generate plain values (the runtime representation of variants). **Note**: @@ -69,7 +66,7 @@ Variants constructors with payloads generate functions, payload-less constructor ### Usage -```res nocheck +```res let s = submit("hello"); /* gives Submit("hello") */ ``` @@ -99,22 +96,23 @@ pets ``` ```js +function submit(param_0) { + return { TAG: "Submit", _0: param_0 }; +} + function name(param) { return param.name; } -let pets = [ - { - name: "bob", - }, - { - name: "bob2", - }, -]; +let pets = [{ name: "bob" }, { name: "bob2" }]; console.log(pets.map(name).join("&")); -export { name, pets }; +let click = "Click"; + +let cancel = "Cancel"; + +export { click, submit, cancel, name, pets }; ```
diff --git a/apps/docs/markdown-pages/docs/manual/import-export.mdx b/apps/docs/markdown-pages/docs/manual/import-export.mdx index 1a787f925..df6a27f73 100644 --- a/apps/docs/markdown-pages/docs/manual/import-export.mdx +++ b/apps/docs/markdown-pages/docs/manual/import-export.mdx @@ -20,8 +20,11 @@ let studentMessage = Student.message ``` ```js -var Student = require("./Student.res.js"); -var studentMessage = Student.message; +import * as Student from "./Student.res.js"; + +let studentMessage = Student.message; + +export { studentMessage }; ```
diff --git a/apps/docs/markdown-pages/docs/manual/import-from-export-to-js.mdx b/apps/docs/markdown-pages/docs/manual/import-from-export-to-js.mdx index 2ad0befd1..5cc64feba 100644 --- a/apps/docs/markdown-pages/docs/manual/import-from-export-to-js.mdx +++ b/apps/docs/markdown-pages/docs/manual/import-from-export-to-js.mdx @@ -48,8 +48,9 @@ export { root }; ``` ```js -var Path = require("path"); -var root = Path.dirname("/User/github"); +let Path = require("path"); + +let root = Path.dirname("/User/github"); exports.root = root; ``` @@ -88,8 +89,16 @@ export { leftPad, paddedResult }; ``` ```js -var LeftPad = require("./leftPad"); -var paddedResult = LeftPad("hi", 5); +let LeftPad = require("./leftPad"); + +function leftPad(prim0, prim1) { + return LeftPad(prim0, prim1); +} + +let paddedResult = LeftPad("hi", 5); + +exports.leftPad = leftPad; +exports.paddedResult = paddedResult; ```
@@ -135,11 +144,16 @@ Console.log(myJson) ```` ```javascript -import MyJsonJson from "./myJson.json" with {"type": "json", "some-exotic-identifier": "someValue"}; +import MyJsonJson from "./myJson.json" with { + type: "json", + "some-exotic-identifier": "someValue", +}; -var myJson = MyJsonJson; +let myJson = MyJsonJson; console.log(myJson); + +export { myJson }; ```` @@ -165,7 +179,7 @@ Use the `import` function to dynamically import a specific part of a module. Put Let's look at an example. Imagine the following file `MathUtils.res`: -```rescript +```rescript file=MathUtils.res let add = (a, b) => a + b let sub = (a, b) => a - b ``` @@ -185,13 +199,12 @@ Console.log(onePlusOne) ```` ```javascript async function main() { - var add = await import("./MathUtils.mjs").then(function(m) { - return m.add; - }); - - var onePlusOne = add(1, 1); + let add = await import("./MathUtils.js").then((m) => m.add); + let onePlusOne = add(1, 1); console.log(onePlusOne); } + +export { main }; ```` @@ -213,11 +226,12 @@ Console.log(twoPlusTwo) ```` ```javascript async function main() { - var Utils = await import("./MathUtils.mjs"); - - var twoPlusTwo = Utils.add(2, 2); + let Utils = await import("./MathUtils.js"); + let twoPlusTwo = Utils.add(2, 2); console.log(twoPlusTwo); } + +export { main }; ```` @@ -258,9 +272,10 @@ export { $$default as default }; ``` ```js -var $$default = "Bob"; +let $$default = "Bob"; -export { $$default, $$default as default }; +exports.default = $$default; +exports.__esModule = true; ``` diff --git a/apps/docs/markdown-pages/docs/manual/installation.mdx b/apps/docs/markdown-pages/docs/manual/installation.mdx index f02c9ba87..db2352b88 100644 --- a/apps/docs/markdown-pages/docs/manual/installation.mdx +++ b/apps/docs/markdown-pages/docs/manual/installation.mdx @@ -133,6 +133,8 @@ bun create rescript-app + ReScript's native executables are distributed as optional, platform-specific packages such as `@rescript/darwin-arm64`, `@rescript/linux-x64`, and `@rescript/win32-x64`. Package managers install the matching package automatically. Make sure optional dependencies are enabled; if ReScript reports that its platform package is missing, reinstall dependencies without an option such as npm's `--omit=optional`. + **pnpm users:** ReScript-compiled JS imports from `@rescript/runtime` directly, but pnpm's strict isolation does not expose transitive dependencies at the app root. Either install the runtime as a direct dependency (`pnpm add @rescript/runtime`), or hoist it by adding the following to `pnpm-workspace.yaml`: diff --git a/apps/docs/markdown-pages/docs/manual/interop-cheatsheet.mdx b/apps/docs/markdown-pages/docs/manual/interop-cheatsheet.mdx index 3ef87eda6..dad4ab130 100644 --- a/apps/docs/markdown-pages/docs/manual/interop-cheatsheet.mdx +++ b/apps/docs/markdown-pages/docs/manual/interop-cheatsheet.mdx @@ -66,6 +66,7 @@ let add = %raw("(a, b) => a + b") let add = (a, b) => a + b; const a = 1; + export { add }; ``` diff --git a/apps/docs/markdown-pages/docs/manual/interop-with-js-build-systems.mdx b/apps/docs/markdown-pages/docs/manual/interop-with-js-build-systems.mdx index 704281986..1e862bf03 100644 --- a/apps/docs/markdown-pages/docs/manual/interop-with-js-build-systems.mdx +++ b/apps/docs/markdown-pages/docs/manual/interop-with-js-build-systems.mdx @@ -50,10 +50,6 @@ This will: Loaders are indeed troublesome; in the meantime, please use e.g. `%raw("require('./myStyles.css')")` at the top of your file. This just uses [`raw`](./embed-raw-javascript.mdx) to compile the snippet into an actual JS require. -## Getting Project's Dependencies - -`rescript` generates one `MyFile.d` file per `MyFile` source file; you'll find them in `lib/bs`. These are human readable, machine-friendly list of the dependencies of said `MyFile`. You can read into them for your purpose (though mind the IO overhead). Use these files instead of creating your own dependency graph; we did the hard work of tracking the dependencies as best as possible (including inner modules, `open`s, module names overlap, etc). - ## Run Script Per File Built See [js-post-build](./build-configuration.mdx#js-post-build). Though please use it sparingly; if you hook up a node.js script after each file built, you'll incur the node startup time per file! diff --git a/apps/docs/markdown-pages/docs/manual/json.mdx b/apps/docs/markdown-pages/docs/manual/json.mdx index d5576487c..42276de9e 100644 --- a/apps/docs/markdown-pages/docs/manual/json.mdx +++ b/apps/docs/markdown-pages/docs/manual/json.mdx @@ -76,11 +76,13 @@ export { studentNames }; ``` ```js -var StudentsJson = require("./students.json"); +let StudentsJson = require("./students.json"); -var studentNames = StudentsJson; +let studentNames = StudentsJson; console.log(studentNames); + +exports.studentNames = studentNames; ``` diff --git a/apps/docs/markdown-pages/docs/manual/jsx.mdx b/apps/docs/markdown-pages/docs/manual/jsx.mdx index 3b4cdab72..2fe3e6aa1 100644 --- a/apps/docs/markdown-pages/docs/manual/jsx.mdx +++ b/apps/docs/markdown-pages/docs/manual/jsx.mdx @@ -348,8 +348,9 @@ First, configure `rescript.json`: Now you can build Preact components: -```rescript +```rescript file=Name.res // Name.res +@@jsxConfig({module_: "Preact"}) @jsx.component // or @react.component if you want let make = (~name) => Preact.string(`Hello ${name}!`) ``` @@ -376,9 +377,9 @@ Below is a full list of everything you need in a generic JSX transform module, i > You can easily copy-paste-and-adapt this to your needs if you're creating bindings to a JSX framework. Most often, all you'll need to change is what the `@module("") external` points to, so the runtime calls point to the correct JS module. - + -```rescript +```rescript file=Preact.res // Preact.res /* Below is a number of aliases to the common `Jsx` module */ type element = Jsx.element @@ -442,6 +443,12 @@ module Elements = { } ``` +```js +let Elements = {}; + +export { Elements }; +``` + As you can see, most of the things you'll want to implement will be copy paste from the above. But do note that **everything needs to be there unless explicitly noted** or the transform will fail at compile time. diff --git a/apps/docs/markdown-pages/docs/manual/lazy-values.mdx b/apps/docs/markdown-pages/docs/manual/lazy-values.mdx index 997a2da64..7c555d5b3 100644 --- a/apps/docs/markdown-pages/docs/manual/lazy-values.mdx +++ b/apps/docs/markdown-pages/docs/manual/lazy-values.mdx @@ -24,13 +24,15 @@ let expensiveFilesRead = Lazy.make(() => { ``` ```js -import * as Lazy from "./stdlib/Lazy.js"; import * as Nodefs from "node:fs"; +import * as Stdlib_Lazy from "@rescript/runtime/lib/es6/Stdlib_Lazy.js"; -let expensiveFilesRead = Lazy.make(() => { +let expensiveFilesRead = Stdlib_Lazy.make(() => { console.log("Reading dir"); return Nodefs.readdirSync("./pages"); }); + +export { expensiveFilesRead }; ``` diff --git a/apps/docs/markdown-pages/docs/manual/let-binding.mdx b/apps/docs/markdown-pages/docs/manual/let-binding.mdx index b8c5dc1c9..6dab60d8d 100644 --- a/apps/docs/markdown-pages/docs/manual/let-binding.mdx +++ b/apps/docs/markdown-pages/docs/manual/let-binding.mdx @@ -8,6 +8,16 @@ order: 2 # Let Binding +
+ +```res prelude +@val external displayGreeting: bool = "displayGreeting" +@val external calculate: int => int = "calculate" +@val external calculateSomeMore: int => int = "calculateSomeMore" +``` + +
+ A "let binding", in other languages, might be called a "variable declaration". `let` _binds_ values to names. They can be seen and referenced by code that comes _after_ them. @@ -65,7 +75,7 @@ ReScript's `if`, `while` and functions all use the same block scoping mechanism. -```res nocheck +```res if displayGreeting { let message = "Enjoying the docs so far?" Console.log(message) @@ -109,16 +119,20 @@ In ReScript, this obviously works too: -```res nocheck +```res let result1 = 0 let result2 = calculate(result1) let result3 = calculateSomeMore(result2) ``` ```js -var result1 = 0; -var result2 = calculate(0); -var result3 = calculateSomeMore(result2); +let result2 = calculate(0); + +let result3 = calculateSomeMore(result2); + +let result1 = 0; + +export { result1, result2, result3 }; ``` @@ -127,15 +141,18 @@ Additionally, reusing the same let binding name overshadows the previous binding -```res nocheck +```res let result = 0 let result = calculate(result) let result = calculateSomeMore(result) ``` ```js -var result = calculate(0); -var result$1 = calculateSomeMore(result); +let result = calculate(0); + +let result$1 = calculateSomeMore(result); + +export { result$1 as result }; ``` diff --git a/apps/docs/markdown-pages/docs/manual/migrate-to-v12.mdx b/apps/docs/markdown-pages/docs/manual/migrate-to-v12.mdx index 4f31966df..830363ade 100644 --- a/apps/docs/markdown-pages/docs/manual/migrate-to-v12.mdx +++ b/apps/docs/markdown-pages/docs/manual/migrate-to-v12.mdx @@ -98,7 +98,8 @@ let z = lor(a, b) // bitwise OR v12: -```res nocheck +```res +let a = 5 and b = 2 let w = ~~~a // bitwise NOT let x = a ^^^ b // bitwise XOR let y = a &&& b // bitwise AND @@ -117,7 +118,8 @@ let z = asr(a, b) // unsigned right shift v12: -```res nocheck +```res +let a = 5 and b = 2 let x = a << b // logical left shift let y = a >> b // logical right shift let z = a >>> b // unsigned right shift @@ -133,7 +135,8 @@ v11: v12: -```res nocheck +```res +let children = React.string("Hello")
children
``` @@ -165,13 +168,13 @@ v12: v11: -```res nocheck +```res assert 1 == 2 ``` v12: -```res nocheck +```res assert(1 == 2) // Now a regular function call ``` @@ -278,7 +281,7 @@ Below is a consolidated excerpt of all the breaking changes from the compiler ch ### Build system & CLI -- The new Rust-based `rewatch` build system now powers the `rescript` command. The old Ninja-based builder system moved behind `rescript legacy`, and `--compiler-args` became the `compiler-args` subcommand. https://github.com/rescript-lang/rescript/pull/7551 https://github.com/rescript-lang/rescript/pull/7593 https://github.com/rescript-lang/rescript/pull/7928 +- The new Rust-based `rewatch` build system now powers the `rescript` command. The old Ninja-based builder is available through the separate `rescript-legacy` executable, and `--compiler-args` became the `compiler-args` subcommand. https://github.com/rescript-lang/rescript/pull/7551 https://github.com/rescript-lang/rescript/pull/7593 https://github.com/rescript-lang/rescript/pull/7928 - `rescript format` was reimplemented in Rust, its options now use the `--check` / `--stdin` long-form spelling, and the `--all` flag was removed because every tracked file (non-dev by default) is formatted automatically. https://github.com/rescript-lang/rescript/pull/7603 https://github.com/rescript-lang/rescript/pull/7752 - The `rescript dump` command was removed; call `bsc` directly if you need to inspect `.cmi` files. https://github.com/rescript-lang/rescript/pull/7710 diff --git a/apps/docs/markdown-pages/docs/manual/module-functions.mdx b/apps/docs/markdown-pages/docs/manual/module-functions.mdx index d479d418b..5044f7d8d 100644 --- a/apps/docs/markdown-pages/docs/manual/module-functions.mdx +++ b/apps/docs/markdown-pages/docs/manual/module-functions.mdx @@ -24,7 +24,7 @@ const params = useParams<{ tag: string; item: string }>() In ReScript we can create a module function that will return a typed response for the `useParams` hook. - + ```res module Next = { // define our module function @@ -74,42 +74,56 @@ function MakeParams(Params) { return {}; } -let Next = { - MakeParams: MakeParams -}; +let Next = { MakeParams: MakeParams }; -function _tempFile$Component(props) { +function Example$Component(props) { let params = Navigation.useParams(); return JsxRuntime.jsxs("div", { children: [ - JsxRuntime.jsx("p", { - children: "Tag: " + params.tag - }), - JsxRuntime.jsx("p", { - children: "Item: " + params.item - }) - ] + JsxRuntime.jsx("p", { children: "Tag: " + params.tag }), + JsxRuntime.jsx("p", { children: "Item: " + params.item }), + ], }); } -let Component = { - make: _tempFile$Component -}; +let Component = { make: Example$Component }; -export { - Next, - Component, -} +export { Next, Component }; ```` - +```jsx +import * as Navigation from "next/navigation"; +import * as JsxRuntime from "react/jsx-runtime"; + +function MakeParams(Params) { + return {}; +} + +let Next = { MakeParams: MakeParams }; + +function Example$Component(props) { + let params = Navigation.useParams(); + return ( +
+

{"Tag: " + params.tag}

+

{"Item: " + params.item}

+
+ ); +} + +let Component = { make: Example$Component }; + +export { Next, Component }; +``` + +
## Sharing a type with an external binding This becomes incredibly useful when you need to have types that are unique to a project but shared across multiple components. Let's say you want to create a library with a `getEnv` function to load in environment variables found in `import.meta.env`. -```res +```res prelude @val external env: 'a = "import.meta.env" let getEnv = () => { @@ -119,7 +133,7 @@ let getEnv = () => { It's not possible to define types for this that will work for every project, so we just set it as 'a and the consumer of our library can define the return type. -```res nocheck +```res type t = {"LOG_LEVEL": string} let values: t = getEnv() @@ -129,7 +143,7 @@ This isn't great and it doesn't take advantage of ReScript's type system and abi We can instead create a module function that can return a module that has contains a `getEnv` function that has a typed response. -```res +```res prelude module MakeEnv = ( E: { type t @@ -147,7 +161,7 @@ And now consumers of our library can define the types and create a custom versio Notice that in the JavaScript output that the `import.meta.env` is used directly and doesn't require any function calls or runtime overhead. -```res nocheck +```res module Env = MakeEnv({ type t = {"LOG_LEVEL": string} }) @@ -156,21 +170,34 @@ let values = Env.getEnv() ```` ```js -var Env = { - getEnv: getEnv -}; +function getEnv() { + return import.meta.env; +} + +function MakeEnv(E) { + let getEnv = () => import.meta.env; + return { getEnv: getEnv }; +} + +function getEnv$1() { + return import.meta.env; +} -var values = import.meta.env; +let Env = { getEnv: getEnv$1 }; + +let values = import.meta.env; + +export { getEnv, MakeEnv, Env, values }; ```` - + ## Shared functions You might want to share functions across modules, like a way to log a value or render it in React. Here's an example of module function that takes in a type and a transform to string function. -```res +```res prelude module MakeDataModule = ( T: { type t @@ -190,7 +217,7 @@ module MakeDataModule = ( You can now take a module with a type of `t` and a `toString` function and create a new module that has the `log` function and the `Render` component. -```res nocheck +```res prelude module Person = { type t = { firstName: string, lastName: string } let toString = person => person.firstName ++ person.lastName @@ -201,40 +228,51 @@ module PersonData = MakeDataModule(Person) ```` ```js -// Notice that none of the JS output references the MakeDataModule function +function getEnv() { + return import.meta.env; +} + +function MakeEnv(E) { + let getEnv = () => import.meta.env; + return { getEnv: getEnv }; +} + +function MakeDataModule(T) { + let log = (a) => { + console.log("The value is " + T.toString(a)); + }; + let Example$MakeDataModule$Render = (props) => T.toString(props.value); + let Render = { make: Example$MakeDataModule$Render }; + return { log: log, Render: Render }; +} function toString(person) { return person.firstName + person.lastName; } -var Person = { - toString: toString -}; +let Person = { toString: toString }; function log(a) { console.log("The value is " + toString(a)); } -function Person$MakeDataModule$Render(props) { +function Example$MakeDataModule$Render(props) { return toString(props.value); } -var Render = { - make: Person$MakeDataModule$Render -}; +let Render = { make: Example$MakeDataModule$Render }; -var PersonData = { - log: log, - Render: Render -}; +let PersonData = { log: log, Render: Render }; + +export { getEnv, MakeEnv, MakeDataModule, Person, PersonData }; ```` Now the `PersonData` module has the functions from the `MakeDataModule`. - -```res nocheck + +```res @react.component let make = (~person) => { let handleClick = _ => PersonData.log(person) @@ -248,25 +286,120 @@ let make = (~person) => { } ``` ```js -function Person$1(props) { - var person = props.person; - var handleClick = function (param) { - log(person); +import * as JsxRuntime from "react/jsx-runtime"; + +function getEnv() { +return import.meta.env; +} + +function MakeEnv(E) { +let getEnv = () => import.meta.env; +return { getEnv: getEnv }; +} + +function MakeDataModule(T) { +let log = (a) => { +console.log("The value is " + T.toString(a)); +}; +let Example$MakeDataModule$Render = (props) => T.toString(props.value); +let Render = { make: Example$MakeDataModule$Render }; +return { log: log, Render: Render }; +} + +function toString(person) { +return person.firstName + person.lastName; +} + +let Person = { toString: toString }; + +function log(a) { +console.log("The value is " + toString(a)); +} + +function Example$MakeDataModule$Render(props) { +return toString(props.value); +} + +let Render = { make: Example$MakeDataModule$Render }; + +let PersonData = { log: log, Render: Render }; + +function Example(props) { +let person = props.person; +let handleClick = (param) => log(person); +return JsxRuntime.jsxs("div", { +children: [ +"Hello ", +JsxRuntime.jsx(Example$MakeDataModule$Render, { value: person }), +JsxRuntime.jsx("button", { +children: "Log value to console", +onClick: handleClick, +}), +], +}); +} + +let make = Example; + +export { getEnv, MakeEnv, MakeDataModule, Person, PersonData, make }; +``` + +```jsx +import * as JsxRuntime from "react/jsx-runtime"; + +function getEnv() { + return import.meta.env; +} + +function MakeEnv(E) { + let getEnv = () => import.meta.env; + return { getEnv: getEnv }; +} + +function MakeDataModule(T) { + let log = (a) => { + console.log("The value is " + T.toString(a)); }; - return JsxRuntime.jsxs("div", { - children: [ - "Hello ", - JsxRuntime.jsx(Person$MakeDataModule$Render, { - value: person - }), - JsxRuntime.jsx("button", { - children: "Log value to console", - onClick: handleClick - }) - ] - }); + let Example$MakeDataModule$Render = (props) => T.toString(props.value); + let Render = { make: Example$MakeDataModule$Render }; + return { log: log, Render: Render }; +} + +function toString(person) { + return person.firstName + person.lastName; +} + +let Person = { toString: toString }; + +function log(a) { + console.log("The value is " + toString(a)); +} + +function Example$MakeDataModule$Render(props) { + return toString(props.value); +} + +let Render = { make: Example$MakeDataModule$Render }; + +let PersonData = { log: log, Render: Render }; + +function Example(props) { + let person = props.person; + let handleClick = (param) => log(person); + return ( +
+ {"Hello "} + + +
+ ); } + +let make = Example; + +export { getEnv, MakeEnv, MakeDataModule, Person, PersonData, make }; ``` +
## Dependency injection @@ -307,26 +440,68 @@ let updateDb = Db.client.write("new value") ```js import * as DatabaseJs from "database.js"; -function MakeDbConnection(Config) { - let client = DatabaseJs.makeClient(Config.host, Config.database, Config.username, Config.password); - return { - client: client +function getEnv() { + return import.meta.env; +} + +function MakeEnv(E) { + let getEnv = () => import.meta.env; + return { getEnv: getEnv }; +} + +function MakeDataModule(T) { + let log = (a) => { + console.log("The value is " + T.toString(a)); }; + let Example$MakeDataModule$Render = (props) => T.toString(props.value); + let Render = { make: Example$MakeDataModule$Render }; + return { log: log, Render: Render }; +} + +function toString(person) { + return person.firstName + person.lastName; +} + +let Person = { toString: toString }; + +function log(a) { + console.log("The value is " + toString(a)); +} + +function Example$MakeDataModule$Render(props) { + return toString(props.value); +} + +let Render = { make: Example$MakeDataModule$Render }; + +let PersonData = { log: log, Render: Render }; + +function MakeDbConnection(Config) { + let client = DatabaseJs.makeClient( + Config.host, + Config.database, + Config.username, + Config.password, + ); + return { client: client }; } let client = DatabaseJs.makeClient("localhost", "mydb", "root", "password"); -let Db = { - client: client -}; +let Db = { client: client }; let updateDb = client.write("new value"); export { + getEnv, + MakeEnv, + MakeDataModule, + Person, + PersonData, MakeDbConnection, Db, updateDb, -} +}; ````
diff --git a/apps/docs/markdown-pages/docs/manual/module.mdx b/apps/docs/markdown-pages/docs/manual/module.mdx index 8f9df2dbc..789ccc686 100644 --- a/apps/docs/markdown-pages/docs/manual/module.mdx +++ b/apps/docs/markdown-pages/docs/manual/module.mdx @@ -21,7 +21,7 @@ inside a module definition's `{}` block. -```res nocheck +```res prelude module School = { type profession = Teacher | Director @@ -43,10 +43,7 @@ function getProfession(person) { } } -let School = { - person1: "Teacher", - getProfession: getProfession, -}; +let School = { person1: "Teacher", getProfession: getProfession }; export { School }; ``` @@ -58,14 +55,27 @@ using the `.` notation. This demonstrates modules' utility for namespacing. -```res nocheck +```res let anotherPerson: School.profession = School.Teacher Console.log(School.getProfession(anotherPerson)) /* "A teacher" */ ``` ```js -var anotherPerson = /* Teacher */ 0; -console.log("A teacher"); +function getProfession(person) { + if (person === "Teacher") { + return "A teacher"; + } else { + return "A director"; + } +} + +let School = { person1: "Teacher", getProfession: getProfession }; + +console.log(getProfession("Teacher")); + +let anotherPerson = "Teacher"; + +export { School, anotherPerson }; ``` @@ -74,7 +84,7 @@ Nested modules work too. -```res nocheck +```res module MyModule = { module NestedModule = { let message = "hello" @@ -85,17 +95,23 @@ let message = MyModule.NestedModule.message ``` ```js +function getProfession(person) { + if (person === "Teacher") { + return "A teacher"; + } else { + return "A director"; + } +} + +let School = { person1: "Teacher", getProfession: getProfession }; + let message = "hello"; -let NestedModule = { - message: message, -}; +let NestedModule = { message: message }; -let MyModule = { - NestedModule: NestedModule, -}; +let MyModule = { NestedModule: NestedModule }; -export { MyModule, message }; +export { School, MyModule, message }; ``` @@ -107,12 +123,24 @@ module's name. Instead of writing: -```res nocheck +```res let p = School.getProfession(School.person1) ``` ```js -var p = School.getProfession(School.person1); +function getProfession(person) { + if (person === "Teacher") { + return "A teacher"; + } else { + return "A director"; + } +} + +let School = { person1: "Teacher", getProfession: getProfession }; + +let p = getProfession("Teacher"); + +export { School, p }; ``` @@ -121,13 +149,25 @@ We can write: -```res nocheck +```res open School let p = getProfession(person1) ``` ```js -var p = School.getProfession(School.person1); +function getProfession(person) { + if (person === "Teacher") { + return "A teacher"; + } else { + return "A director"; + } +} + +let School = { person1: "Teacher", getProfession: getProfession }; + +let p = getProfession("Teacher"); + +export { School, p }; ``` @@ -138,7 +178,7 @@ The content of `School` module are made visible (**not** copied into the file, b -```res nocheck +```res let p = { open School getProfession(person1) @@ -147,7 +187,19 @@ let p = { ``` ```js -var p = School.getProfession(School.person1); +function getProfession(person) { + if (person === "Teacher") { + return "A teacher"; + } else { + return "A director"; + } +} + +let School = { person1: "Teacher", getProfession: getProfession }; + +let p = getProfession("Teacher"); + +export { School, p }; ``` @@ -156,7 +208,7 @@ var p = School.getProfession(School.person1); There are situations where `open` will cause a warning due to existing identifiers (bindings, types) being redefined. Use `open!` to explicitly tell the compiler that this is desired behavior. -```res nocheck +```res let map = (arr, value) => { value } @@ -177,7 +229,7 @@ As an alternative to `open`ing a module, you can also destructure a module's fun -```res nocheck +```res module User = { let user1 = "Anna" let user2 = "Franz" @@ -191,14 +243,27 @@ let {user1: anna, user2: franz} = module(User) ``` ```js -var user1 = "Anna"; +function getProfession(person) { + if (person === "Teacher") { + return "A teacher"; + } else { + return "A director"; + } +} -var user2 = "Franz"; +let School = { person1: "Teacher", getProfession: getProfession }; -var User = { - user1: user1, - user2: user2, -}; +let user1 = "Anna"; + +let user2 = "Franz"; + +let User = { user1: user1, user2: user2 }; + +let anna = user1; + +let franz = user2; + +export { School, User, user1, user2, anna, franz }; ``` @@ -213,7 +278,7 @@ Using `include` in a module statically "spreads" a module's content into a new o -```res nocheck +```res module BaseComponent = { let defaultGreeting = "Hello" let getAudience = (~excited) => excited ? "world!" : "world" @@ -229,6 +294,16 @@ module ActualComponent = { ``` ```js +function getProfession(person) { + if (person === "Teacher") { + return "A teacher"; + } else { + return "A director"; + } +} + +let School = { person1: "Teacher", getProfession: getProfession }; + function getAudience(excited) { if (excited) { return "world!"; @@ -237,10 +312,7 @@ function getAudience(excited) { } } -let BaseComponent = { - defaultGreeting: "Hello", - getAudience: getAudience, -}; +let BaseComponent = { defaultGreeting: "Hello", getAudience: getAudience }; let defaultGreeting = "Hey"; @@ -254,7 +326,7 @@ let ActualComponent = { render: render, }; -export { BaseComponent, ActualComponent }; +export { School, BaseComponent, ActualComponent }; ``` @@ -281,7 +353,7 @@ inside a signature definition's `{}` block. -```res nocheck +```res /* Using the types defined above */ module type EstablishmentType = { type profession @@ -290,7 +362,17 @@ module type EstablishmentType = { ``` ```js -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ +function getProfession(person) { + if (person === "Teacher") { + return "A teacher"; + } else { + return "A director"; + } +} + +let School = { person1: "Teacher", getProfession: getProfession }; + +export { School }; ``` @@ -322,8 +404,6 @@ concrete type; it's saying "I don't care what the actual type is, but it's used as input to `getProfession`". This is useful to fit many modules under the same interface: - - ```res nocheck module Company: EstablishmentType = { type profession = CEO | Designer | Engineer | ... @@ -334,24 +414,6 @@ module Company: EstablishmentType = { } ``` -```js -function getProfession(person) { - ... -} - -var person1 = ... - -var person2 = ... - -var Company = { - getProfession: getProfession, - person1: person1, - person2: person2 -}; -``` - - - It's also useful to hide the underlying type as an implementation detail others can't rely on. If you ask what the type of `Company.profession` is, instead of exposing the variant, it'll only tell you "it's `Company.profession`". @@ -360,7 +422,38 @@ This also means that the compiler can't make assumptions about the type. In certain cases, when working with abstract types and `option` for example, the compiler doesn't know whether the abstract type can be the JavaScript value `undefined` or not. This can lead to less optimal code being generated. For this reason, you can use the `@notUndefined` decorator to tell the compiler that the abstract type can never be `undefined` -(use with caution and see the `@notUndefined` decorator documentation for more details and caveats). +(use with caution and see the [`@notUndefined` decorator documentation](../../syntax-lookup/decorator_not_undefined.mdx) for more details and caveats). + +### Refining Module Types with Constraints + +A `with type` constraint can refine an abstract type in an existing module type: + +```res prelude +module type Storage = { + type t + let make: string => t + let serialize: t => string +} + +module type PrivateStringStorage = Storage with type t = private string +``` + +The `private` constraint exposes that `t` is represented as `string`, so a `t` can be coerced to `string`, while preventing callers from constructing a `t` from any string. Only functions exposed by the module, such as `make`, can create one. + +```res +module StringStorage: PrivateStringStorage = { + type t = string + let make = value => value + let serialize = value => value +} + +let unwrap = value => { + let _ = StringStorage.serialize(value) + (value :> string) +} +``` + +The call to `serialize` is enough for the compiler to infer `value` as `StringStorage.t`; ReScript 12 allows that inferred type variable to be resolved while checking the coercion. ### Extending module signatures @@ -368,7 +461,7 @@ Like modules themselves, module signatures can also be extended by other module -```res nocheck +```res module type BaseComponent = { let defaultGreeting: string let getAudience: (~excited: bool) => string @@ -382,7 +475,17 @@ module type ActualComponent = { ``` ```js -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ +function getProfession(person) { + if (person === "Teacher") { + return "A teacher"; + } else { + return "A director"; + } +} + +let School = { person1: "Teacher", getProfession: getProfession }; + +export { School }; ``` @@ -396,7 +499,7 @@ type. -```res nocheck +```res module type MyList = { include (module type of List) let myListFun: list<'a> => list<'a> @@ -404,7 +507,17 @@ module type MyList = { ``` ```js -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ +function getProfession(person) { + if (person === "Teacher") { + return "A teacher"; + } else { + return "A director"; + } +} + +let School = { person1: "Teacher", getProfession: getProfession }; + +export { School }; ``` @@ -419,18 +532,28 @@ in the ecosystem to also document the public API of their corresponding modules. -```res nocheck +```res /* file React.res (implementation. Compiles to module React) */ type state = int let render = (str) => str ``` ```js +function getProfession(person) { + if (person === "Teacher") { + return "A teacher"; + } else { + return "A director"; + } +} + +let School = { person1: "Teacher", getProfession: getProfession }; + function render(str) { return str; } -export { render }; +export { School, render }; ``` @@ -485,28 +608,30 @@ module MakeSet = (Item: Comparable) => { ``` ```js -var List = require("./stdlib/list.js"); +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.js"; + +function getProfession(person) { + if (person === "Teacher") { + return "A teacher"; + } else { + return "A director"; + } +} + +let School = { person1: "Teacher", getProfession: getProfession }; function MakeSet(Item) { - var add = function (currentSet, newItem) { - if ( - List.exists(function (x) { - return Item.equal(x, newItem); - }, currentSet) - ) { + let add = (currentSet, newItem) => { + if (Stdlib_List.some(currentSet, (x) => Item.equal(x, newItem))) { return currentSet; } else { - return { - hd: newItem, - tl: currentSet, - }; + return { hd: newItem, tl: currentSet }; } }; - return { - empty: /* [] */ 0, - add: add, - }; + return { empty: /* [] */ 0, add: add }; } + +export { School, MakeSet }; ``` @@ -516,7 +641,7 @@ creating a set, whose items are pairs of integers. -```res nocheck +```res module IntPair = { type t = (int, int) let equal = ((x1: int, y1: int), (x2, y2)) => x1 == x2 && y1 == y2 @@ -530,21 +655,25 @@ module SetOfIntPairs = MakeSet(IntPair) ```js import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.js"; +function getProfession(person) { + if (person === "Teacher") { + return "A teacher"; + } else { + return "A director"; + } +} + +let School = { person1: "Teacher", getProfession: getProfession }; + function MakeSet(Item) { let add = (currentSet, newItem) => { if (Stdlib_List.some(currentSet, (x) => Item.equal(x, newItem))) { return currentSet; } else { - return { - hd: newItem, - tl: currentSet, - }; + return { hd: newItem, tl: currentSet }; } }; - return { - empty: /* [] */ 0, - add: add, - }; + return { empty: /* [] */ 0, add: add }; } function equal(param, param$1) { @@ -559,28 +688,19 @@ function create(x, y) { return [x, y]; } -let IntPair = { - equal: equal, - create: create, -}; +let IntPair = { equal: equal, create: create }; function add(currentSet, newItem) { if (Stdlib_List.some(currentSet, (x) => equal(x, newItem))) { return currentSet; } else { - return { - hd: newItem, - tl: currentSet, - }; + return { hd: newItem, tl: currentSet }; } } -let SetOfIntPairs = { - empty: /* [] */ 0, - add: add, -}; +let SetOfIntPairs = { empty: /* [] */ 0, add: add }; -export { MakeSet, IntPair, SetOfIntPairs }; +export { School, MakeSet, IntPair, SetOfIntPairs }; ``` @@ -594,8 +714,6 @@ modules the functor accepts as arguments and return values. In the previous example, we're exposing the backing type of a set; by giving `MakeSet` a functor signature, we can hide the underlying data structure! - - ```res nocheck module type Comparable = ... @@ -610,12 +728,6 @@ module MakeSet: MakeSetType = (Item: Comparable) => { } ``` -```js -// Empty output -``` - - - ## Exotic Module Filenames **Since 8.3** diff --git a/apps/docs/markdown-pages/docs/manual/mutation.mdx b/apps/docs/markdown-pages/docs/manual/mutation.mdx index db0e95a15..734771814 100644 --- a/apps/docs/markdown-pages/docs/manual/mutation.mdx +++ b/apps/docs/markdown-pages/docs/manual/mutation.mdx @@ -21,9 +21,9 @@ let myValue = ref(5) ``` ```js -var myValue = { - contents: 5, -}; +let myValue = { contents: 5 }; + +export { myValue }; ```
@@ -39,9 +39,7 @@ let five = myValue.contents // 5 ``` ```js -let myValue = { - contents: 5, -}; +let myValue = { contents: 5 }; let five = myValue.contents; @@ -59,9 +57,7 @@ myValue.contents = 6 ``` ```js -let myValue = { - contents: 5, -}; +let myValue = { contents: 5 }; myValue.contents = 6; @@ -79,9 +75,7 @@ myValue := 6 ``` ```js -let myValue = { - contents: 5, -}; +let myValue = { contents: 5 }; myValue.contents = 6; @@ -97,3 +91,22 @@ Note that the previous binding `five` stays `5`, since it got the underlying ite ## Tip & Tricks Before reaching for `ref`, know that you can achieve lightweight, local "mutations" through [overriding let bindings](./let-binding.mdx#binding-shadowing). + +### Self-Referencing Callbacks + +Sometimes a callback needs a value returned by the function that registers it. For example, suppose `subscribe` registers a message callback and returns a function that unsubscribes it. To unsubscribe after the first message, create a `ref` with a no-op function, then assign the returned function to it: + +```res +@val external subscribe: (string => unit) => unit => unit = "subscribe" + +let unsubscribe = ref(() => ()) + +unsubscribe := subscribe(message => { + Console.log(message) + unsubscribe.contents() +}) +``` + +The callback reads `unsubscribe.contents` when a message arrives, so it sees the function assigned after `subscribe` returns. + +This assumes `subscribe` delivers messages after it returns. A callback invoked during subscription would still call the initial no-op function. diff --git a/apps/docs/markdown-pages/docs/manual/null-undefined-option.mdx b/apps/docs/markdown-pages/docs/manual/null-undefined-option.mdx index 92e934d14..e316fe884 100644 --- a/apps/docs/markdown-pages/docs/manual/null-undefined-option.mdx +++ b/apps/docs/markdown-pages/docs/manual/null-undefined-option.mdx @@ -52,7 +52,9 @@ To represent the concept of "maybe null", you'd turn this into an `option` type -```res nocheck +```res prelude +@val external personHasACar: bool = "personHasACar" + let licenseNumber = if personHasACar { Some(5) @@ -62,7 +64,9 @@ let licenseNumber = ``` ```js -var licenseNumber = personHasACar ? 5 : undefined; +let licenseNumber = personHasACar ? 5 : undefined; + +export { licenseNumber }; ``` @@ -71,7 +75,7 @@ Later on, when another piece of code receives such value, it'd be forced to hand -```res nocheck +```res switch licenseNumber { | None => Console.log("The person doesn't have a car") @@ -81,13 +85,15 @@ switch licenseNumber { ``` ```js -var number = licenseNumber; +let licenseNumber = personHasACar ? 5 : undefined; -if (number !== undefined) { - console.log("The person's license number is " + number.toString()); +if (licenseNumber !== undefined) { + console.log("The person's license number is " + licenseNumber.toString()); } else { console.log("The person doesn't have a car"); } + +export { licenseNumber }; ``` @@ -105,9 +111,11 @@ let x = Some(5) ``` ```js +let licenseNumber = personHasACar ? 5 : undefined; + let x = 5; -export { x }; +export { licenseNumber, x }; ```
@@ -121,9 +129,11 @@ let x = None ``` ```js +let licenseNumber = personHasACar ? 5 : undefined; + let x; -export { x }; +export { licenseNumber, x }; ```
@@ -151,7 +161,9 @@ If you're receiving, for example, a JS string that can be `null` and `undefined` ``` ```js -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ +let licenseNumber = personHasACar ? 5 : undefined; + +export { licenseNumber }; ``` @@ -170,11 +182,13 @@ let result = validate(personId) ```js import * as MyIdValidator from "MyIdValidator"; +let licenseNumber = personHasACar ? 5 : undefined; + let personId = "abc123"; let result = MyIdValidator.validate(personId); -export { personId, result }; +export { licenseNumber, personId, result }; ``` diff --git a/apps/docs/markdown-pages/docs/manual/object.mdx b/apps/docs/markdown-pages/docs/manual/object.mdx index d71bd077d..3c965ec9f 100644 --- a/apps/docs/markdown-pages/docs/manual/object.mdx +++ b/apps/docs/markdown-pages/docs/manual/object.mdx @@ -33,7 +33,7 @@ type person = { ``` ```js -// Empty output +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ ``` @@ -56,10 +56,7 @@ let me = { ``` ```js -let me = { - age: 5, - name: "Big ReScript", -}; +let me = { age: 5, name: "Big ReScript" }; export { me }; ``` @@ -70,7 +67,7 @@ export { me }; -```res nocheck +```res type person = { "age": int }; @@ -81,9 +78,11 @@ let me = { ``` ```js -var me = { - age: "hello!", -}; +let ExamplePrelude = {}; + +let me = { age: "hello!" }; + +export { ExamplePrelude, me }; ``` @@ -91,6 +90,9 @@ var me = { Since the type checker doesn't try to match `me` with the type `person`. If you ever want to force an object value to be of a predeclared object type, just annotate the value: ```res nocheck +// This annotation intentionally rejects a string age. +type person = {"age": int} + let me: person = { "age": "hello!" } @@ -102,12 +104,17 @@ Now the type system will error properly. -```res nocheck +```res +let me = {"age": 5, "name": "Big ReScript"} let age = me["age"] ``` ```js -var age = me["age"]; +let me = { age: 5, name: "Big ReScript" }; + +let age = me.age; + +export { me, age }; ``` @@ -160,11 +167,7 @@ let myPoint: point3d = { ``` ```js -let myPoint = { - x: 1.0, - y: 2.0, - z: 3.0, -}; +let myPoint = { x: 1.0, y: 2.0, z: 3.0 }; export { myPoint }; ``` diff --git a/apps/docs/markdown-pages/docs/manual/pattern-matching-destructuring.mdx b/apps/docs/markdown-pages/docs/manual/pattern-matching-destructuring.mdx index e1b852d8d..7a1f6e919 100644 --- a/apps/docs/markdown-pages/docs/manual/pattern-matching-destructuring.mdx +++ b/apps/docs/markdown-pages/docs/manual/pattern-matching-destructuring.mdx @@ -58,17 +58,11 @@ let Success(message) = myResult // "You did it!" assigned to `message` ``` ```js -let student1 = { - name: "John", - age: 10, -}; +let student1 = { name: "John", age: 10 }; let name = "John"; -let myResult = { - TAG: "Success", - _0: "You did it!", -}; +let myResult = { TAG: "Success", _0: "You did it!" }; let message = "You did it!"; @@ -97,10 +91,7 @@ function displayMessage(m) { console.log(m._0); } -displayMessage({ - TAG: "Success", - _0: "You did it!", -}); +displayMessage({ TAG: "Success", _0: "You did it!" }); export { displayMessage }; ``` @@ -111,17 +102,24 @@ For a record, you can rename the field while destructuring: -```res nocheck +```res +type pupil = {name: string, age: int} +let student1 = {name: "John", age: 10} + let {name: n} = student1 // "John" assigned to `n` ``` ```js -var n = "John"; +let student1 = { name: "John", age: 10 }; + +let n = "John"; + +export { student1, n }; ``` -You _can_ in theory destructure array and list at the top level too: +Array and list patterns can be non-exhaustive. These destructuring bindings are rejected at the module's top level: ```res nocheck let myArray = [1, 2, 3] @@ -133,7 +131,7 @@ let list{head, ...tail} = myList // 1 assigned to `head`, `list{2, 3}` assigned to tail ``` -But the array example is **highly disrecommended** (use tuple instead) and the list example will error on you. They're only there for completeness' sake. As you'll see below, the proper way of using destructuring array and list is using `switch`. +Both examples fail with `Such fragile pattern not allowed in the toplevel`: the array may have a different length, and the list may be empty. Use a tuple for a fixed number of elements, or use `switch` to destructure arrays and lists while handling the remaining cases. ## `switch` Based on Shape of Data @@ -151,7 +149,7 @@ type payload = ``` ```js -// Empty output +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ ``` @@ -175,10 +173,7 @@ switch data { ``` ```js -let data = { - TAG: "GoodResult", - _0: "Product shipped!", -}; +let data = { TAG: "GoodResult", _0: "Product shipped!" }; if (typeof data !== "object") { console.log("Bah."); @@ -215,7 +210,7 @@ type person = ``` ```js -// Empty output +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ ``` @@ -256,46 +251,44 @@ let message = switch person1 { ``` ```js -var person1 = { - TAG: "Teacher", - name: "Jane", - age: 35, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; -var message; +let message; if (person1.TAG === "Teacher") { - message = "Hello Jane."; + message = `Hello ` + "Jane" + `.`; } else { - var match = "Jane"; - var match$1 = match.status; - var name = match.name; - var match$2 = match.reportCard; + let match = "Jane"; + let match$1 = match.status; + let name = match.name; + let match$2 = match.reportCard; if (match$2.passing) { message = - "Congrats " + + `Congrats ` + name + - ", nice GPA of " + + `, nice GPA of ` + match$2.gpa.toString() + - " you got there!"; + ` you got there!`; } else { - var exit = 0; + let exit = 0; if (typeof match$1 !== "object") { message = match$1 === "Sick" - ? "How are you feeling?" - : "Good luck next semester " + name + "!"; + ? `How are you feeling?` + : `Good luck next semester ` + name + `!`; } else { exit = 1; } if (exit === 1) { message = match.reportCard.gpa !== 0.0 - ? "Good luck next semester " + name + "!" - : "Come back in " + match$1._0.toString() + " days!"; + ? `Good luck next semester ` + name + `!` + : `Come back in ` + match$1._0.toString() + ` days!`; } } } + +export { person1, message }; ``` @@ -311,9 +304,9 @@ Here's another example of pattern matching, this time on an inline tuple. -```res nocheck +```res type animal = Dog | Cat | Bird -let categoryId = switch (isBig, myAnimal) { +let categoryId = (isBig, myAnimal) => switch (isBig, myAnimal) { | (true, Dog) => 1 | (true, Cat) => 2 | (true, Bird) => 3 @@ -323,7 +316,65 @@ let categoryId = switch (isBig, myAnimal) { ``` ```js -var categoryId = isBig ? (myAnimal + 1) | 0 : myAnimal >= 2 ? 5 : 4; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; + +let message; + +if (person1.TAG === "Teacher") { + message = `Hello ` + "Jane" + `.`; +} else { + let match = "Jane"; + let match$1 = match.status; + let name = match.name; + let match$2 = match.reportCard; + if (match$2.passing) { + message = + `Congrats ` + + name + + `, nice GPA of ` + + match$2.gpa.toString() + + ` you got there!`; + } else { + let exit = 0; + if (typeof match$1 !== "object") { + message = + match$1 === "Sick" + ? `How are you feeling?` + : `Good luck next semester ` + name + `!`; + } else { + exit = 1; + } + if (exit === 1) { + message = + match.reportCard.gpa !== 0.0 + ? `Good luck next semester ` + name + `!` + : `Come back in ` + match$1._0.toString() + ` days!`; + } + } +} + +function categoryId(isBig, myAnimal) { + if (isBig) { + switch (myAnimal) { + case "Dog": + return 1; + case "Cat": + return 2; + case "Bird": + return 3; + } + } else { + switch (myAnimal) { + case "Dog": + case "Cat": + return 4; + case "Bird": + return 5; + } + } +} + +export { person1, message, categoryId }; ``` @@ -353,16 +404,58 @@ switch myStatus { ``` ```js -var myStatus = { - TAG: /* Vacations */ 0, - _0: 10, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; + +let message; -if (typeof myStatus === "number") { +if (person1.TAG === "Teacher") { + message = `Hello ` + "Jane" + `.`; +} else { + let match = "Jane"; + let match$1 = match.status; + let name = match.name; + let match$2 = match.reportCard; + if (match$2.passing) { + message = + `Congrats ` + + name + + `, nice GPA of ` + + match$2.gpa.toString() + + ` you got there!`; + } else { + let exit = 0; + if (typeof match$1 !== "object") { + message = + match$1 === "Sick" + ? `How are you feeling?` + : `Good luck next semester ` + name + `!`; + } else { + exit = 1; + } + if (exit === 1) { + message = + match.reportCard.gpa !== 0.0 + ? `Good luck next semester ` + name + `!` + : `Come back in ` + match$1._0.toString() + ` days!`; + } + } +} + +let myStatus = { TAG: "Vacations", _0: 10 }; + +let exit$1 = 0; + +if (typeof myStatus !== "object") { console.log("Hey! How are you?"); } else { - console.log("Come back in " + (10).toString() + " days!"); + exit$1 = 1; +} + +if (exit$1 === 1) { + console.log(`Come back in ` + (10).toString() + ` days!`); } + +export { person1, message, myStatus }; ``` @@ -383,11 +476,7 @@ switch person1 { ``` ```js -let person1 = { - TAG: "Teacher", - name: "Jane", - age: 35, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; let message; @@ -424,10 +513,7 @@ if (person1.TAG === "Teacher") { } } -let myStatus = { - TAG: "Vacations", - _0: 10, -}; +let myStatus = { TAG: "Vacations", _0: 10 }; let exit$1 = 0; @@ -464,11 +550,7 @@ switch myStatus { ``` ```js -let person1 = { - TAG: "Teacher", - name: "Jane", - age: 35, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; let message; @@ -505,10 +587,7 @@ if (person1.TAG === "Teacher") { } } -let myStatus = { - TAG: "Vacations", - _0: 10, -}; +let myStatus = { TAG: "Vacations", _0: 10 }; let exit$1 = 0; @@ -545,11 +624,7 @@ switch myStatus { ``` ```js -let person1 = { - TAG: "Teacher", - name: "Jane", - age: 35, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; let message; @@ -586,10 +661,7 @@ if (person1.TAG === "Teacher") { } } -let myStatus = { - TAG: "Vacations", - _0: 10, -}; +let myStatus = { TAG: "Vacations", _0: 10 }; let exit$1 = 0; @@ -635,11 +707,7 @@ switch person1 { ``` ```js -let person1 = { - TAG: "Teacher", - name: "Jane", - age: 35, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; let message; @@ -676,10 +744,7 @@ if (person1.TAG === "Teacher") { } } -let myStatus = { - TAG: "Vacations", - _0: 10, -}; +let myStatus = { TAG: "Vacations", _0: 10 }; let exit$1 = 0; @@ -722,11 +787,7 @@ switch person1 { ``` ```js -let person1 = { - TAG: "Teacher", - name: "Jane", - age: 35, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; let message; @@ -763,10 +824,7 @@ if (person1.TAG === "Teacher") { } } -let myStatus = { - TAG: "Vacations", - _0: 10, -}; +let myStatus = { TAG: "Vacations", _0: 10 }; let exit$1 = 0; @@ -829,11 +887,7 @@ let greetAnimal = (animal: animals) => { ``` ```js -let person1 = { - TAG: "Teacher", - name: "Jane", - age: 35, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; let message; @@ -870,10 +924,7 @@ if (person1.TAG === "Teacher") { } } -let myStatus = { - TAG: "Vacations", - _0: 10, -}; +let myStatus = { TAG: "Vacations", _0: 10 }; let exit$1 = 0; @@ -932,7 +983,11 @@ The example above aliases the variant type spread to a variable so we can use it -```res nocheck +```res +type pets = Cat | Dog +type fish = Cod | Salmon +type animals = | ...pets | ...fish + let isPet = (animal: animals) => { switch animal { | ...pets => Console.log("A pet!") @@ -943,6 +998,57 @@ let isPet = (animal: animals) => { ``` ```js +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; + +let message; + +if (person1.TAG === "Teacher") { + message = `Hello ` + "Jane" + `.`; +} else { + let match = "Jane"; + let match$1 = match.status; + let name = match.name; + let match$2 = match.reportCard; + if (match$2.passing) { + message = + `Congrats ` + + name + + `, nice GPA of ` + + match$2.gpa.toString() + + ` you got there!`; + } else { + let exit = 0; + if (typeof match$1 !== "object") { + message = + match$1 === "Sick" + ? `How are you feeling?` + : `Good luck next semester ` + name + `!`; + } else { + exit = 1; + } + if (exit === 1) { + message = + match.reportCard.gpa !== 0.0 + ? `Good luck next semester ` + name + `!` + : `Come back in ` + match$1._0.toString() + ` days!`; + } + } +} + +let myStatus = { TAG: "Vacations", _0: 10 }; + +let exit$1 = 0; + +if (typeof myStatus !== "object") { + console.log("Hey! How are you?"); +} else { + exit$1 = 1; +} + +if (exit$1 === 1) { + console.log(`Come back in ` + (10).toString() + ` days!`); +} + function isPet(animal) { switch (animal) { case "Cat": @@ -955,6 +1061,8 @@ function isPet(animal) { return; } } + +export { person1, message, myStatus, isPet }; ``` @@ -979,11 +1087,7 @@ let isPet = (animal: animals) => { ``` ```js -let person1 = { - TAG: "Teacher", - name: "Jane", - age: 35, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; let message; @@ -1020,10 +1124,7 @@ if (person1.TAG === "Teacher") { } } -let myStatus = { - TAG: "Vacations", - _0: 10, -}; +let myStatus = { TAG: "Vacations", _0: 10 }; let exit$1 = 0; @@ -1073,11 +1174,7 @@ let isPet = (animal: animals) => { ``` ```js -let person1 = { - TAG: "Teacher", - name: "Jane", - age: 35, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; let message; @@ -1114,10 +1211,7 @@ if (person1.TAG === "Teacher") { } } -let myStatus = { - TAG: "Vacations", - _0: 10, -}; +let myStatus = { TAG: "Vacations", _0: 10 }; let exit$1 = 0; @@ -1146,29 +1240,100 @@ export { person1, message, myStatus, isPet }; ### Match on Exceptions -If the function throws an exception (covered later), you can also match on _that_, in addition to the function's normally returned values. +If the function throws an exception (covered later), you can also match on _that_, in addition to the function's normally returned values. `List.find` returns an option in v12, so the helper below raises `Not_found` when no item matches: -```res nocheck -switch List.find(i => i === theItem, myItems) { +```res +let theItem = 2 +let myItems = list{1, 2, 3} + +let findItem = () => + switch List.find(myItems, i => i === theItem) { + | Some(item) => item + | None => throw(Not_found) + } + +switch findItem() { | item => Console.log(item) | exception Not_found => Console.log("No such item found!") } ``` ```js -var exit = 0; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.js"; +import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js"; + +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; + +let message; + +if (person1.TAG === "Teacher") { + message = `Hello ` + "Jane" + `.`; +} else { + let match = "Jane"; + let match$1 = match.status; + let name = match.name; + let match$2 = match.reportCard; + if (match$2.passing) { + message = + `Congrats ` + + name + + `, nice GPA of ` + + match$2.gpa.toString() + + ` you got there!`; + } else { + let exit = 0; + if (typeof match$1 !== "object") { + message = + match$1 === "Sick" + ? `How are you feeling?` + : `Good luck next semester ` + name + `!`; + } else { + exit = 1; + } + if (exit === 1) { + message = + match.reportCard.gpa !== 0.0 + ? `Good luck next semester ` + name + `!` + : `Come back in ` + match$1._0.toString() + ` days!`; + } + } +} + +let myStatus = { TAG: "Vacations", _0: 10 }; + +let exit$1 = 0; -var item; +if (typeof myStatus !== "object") { + console.log("Hey! How are you?"); +} else { + exit$1 = 1; +} + +if (exit$1 === 1) { + console.log(`Come back in ` + (10).toString() + ` days!`); +} + +let myItems = { hd: 1, tl: { hd: 2, tl: { hd: 3, tl: /* [] */ 0 } } }; + +function findItem() { + let item = Stdlib_List.find(myItems, (i) => i === 2); + if (item !== undefined) { + return item; + } + throw { RE_EXN_ID: "Not_found", Error: new Error() }; +} + +let exit$2 = 0; + +let item; try { - item = List.find(function (i) { - return i === theItem; - }, myItems); - exit = 1; + item = findItem(); + exit$2 = 1; } catch (raw_exn) { - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + let exn = Primitive_exceptions.internalToException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { console.log("No such item found!"); } else { @@ -1176,9 +1341,13 @@ try { } } -if (exit === 1) { +if (exit$2 === 1) { console.log(item); } + +let theItem = 2; + +export { person1, message, myStatus, theItem, myItems, findItem }; ``` @@ -1200,11 +1369,7 @@ switch students { ``` ```js -let person1 = { - TAG: "Teacher", - name: "Jane", - age: 35, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; let message; @@ -1241,10 +1406,7 @@ if (person1.TAG === "Teacher") { } } -let myStatus = { - TAG: "Vacations", - _0: 10, -}; +let myStatus = { TAG: "Vacations", _0: 10 }; let exit$1 = 0; @@ -1298,11 +1460,7 @@ printStudents(list{"Jane", "Harvey", "Patrick"}) ``` ```js -let person1 = { - TAG: "Teacher", - name: "Jane", - age: 35, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; let message; @@ -1339,10 +1497,7 @@ if (person1.TAG === "Teacher") { } } -let myStatus = { - TAG: "Vacations", - _0: 10, -}; +let myStatus = { TAG: "Vacations", _0: 10 }; let exit$1 = 0; @@ -1376,13 +1531,7 @@ function printStudents(_students) { printStudents({ hd: "Jane", - tl: { - hd: "Harvey", - tl: { - hd: "Patrick", - tl: /* [] */ 0, - }, - }, + tl: { hd: "Harvey", tl: { hd: "Patrick", tl: /* [] */ 0 } }, }); export { person1, message, myStatus, printStudents }; @@ -1409,14 +1558,64 @@ let b = switch d { ``` ```js -let d = { - A: 5, - B: 6, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; + +let message; + +if (person1.TAG === "Teacher") { + message = `Hello ` + "Jane" + `.`; +} else { + let match = "Jane"; + let match$1 = match.status; + let name = match.name; + let match$2 = match.reportCard; + if (match$2.passing) { + message = + `Congrats ` + + name + + `, nice GPA of ` + + match$2.gpa.toString() + + ` you got there!`; + } else { + let exit = 0; + if (typeof match$1 !== "object") { + message = + match$1 === "Sick" + ? `How are you feeling?` + : `Good luck next semester ` + name + `!`; + } else { + exit = 1; + } + if (exit === 1) { + message = + match.reportCard.gpa !== 0.0 + ? `Good luck next semester ` + name + `!` + : `Come back in ` + match$1._0.toString() + ` days!`; + } + } +} + +let myStatus = { TAG: "Vacations", _0: 10 }; + +let exit$1 = 0; + +if (typeof myStatus !== "object") { + console.log("Hey! How are you?"); +} else { + exit$1 = 1; +} + +if (exit$1 === 1) { + console.log(`Come back in ` + (10).toString() + ` days!`); +} + +let d = { A: 5, B: 6 }; let b = d.B; let b$1 = b !== undefined ? b : undefined; + +export { person1, message, myStatus, d, b$1 as b }; ``` @@ -1435,12 +1634,62 @@ let b = switch d { ``` ```js -let d = { - A: 5, - B: 6, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; + +let message; + +if (person1.TAG === "Teacher") { + message = `Hello ` + "Jane" + `.`; +} else { + let match = "Jane"; + let match$1 = match.status; + let name = match.name; + let match$2 = match.reportCard; + if (match$2.passing) { + message = + `Congrats ` + + name + + `, nice GPA of ` + + match$2.gpa.toString() + + ` you got there!`; + } else { + let exit = 0; + if (typeof match$1 !== "object") { + message = + match$1 === "Sick" + ? `How are you feeling?` + : `Good luck next semester ` + name + `!`; + } else { + exit = 1; + } + if (exit === 1) { + message = + match.reportCard.gpa !== 0.0 + ? `Good luck next semester ` + name + `!` + : `Come back in ` + match$1._0.toString() + ` days!`; + } + } +} + +let myStatus = { TAG: "Vacations", _0: 10 }; + +let exit$1 = 0; + +if (typeof myStatus !== "object") { + console.log("Hey! How are you?"); +} else { + exit$1 = 1; +} + +if (exit$1 === 1) { + console.log(`Come back in ` + (10).toString() + ` days!`); +} + +let d = { A: 5, B: 6 }; let b = d.B; + +export { person1, message, myStatus, d, b }; ``` @@ -1464,11 +1713,7 @@ switch coordinates { ``` ```js -let person1 = { - TAG: "Teacher", - name: "Jane", - age: 35, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; let message; @@ -1505,10 +1750,7 @@ if (person1.TAG === "Teacher") { } } -let myStatus = { - TAG: "Vacations", - _0: 10, -}; +let myStatus = { TAG: "Vacations", _0: 10 }; let exit$1 = 0; @@ -1522,10 +1764,7 @@ if (exit$1 === 1) { console.log(`Come back in ` + (10).toString() + ` days!`); } -let d = { - A: 5, - B: 6, -}; +let d = { A: 5, B: 6 }; console.log(10); @@ -1550,8 +1789,9 @@ Let's revisit one of the above examples: -```res nocheck -let message = switch person1 { +```res +// Intentionally missing the fallback case for other teachers. +let messageFor = person => switch person { | Teacher({name: "Mary" | "Joe"}) => `Hey, still going to the party on Saturday?` | Student({name, reportCard: {passing: true, gpa}}) => @@ -1569,52 +1809,117 @@ let message = switch person1 { ``` ```js -if (person1.TAG) { - var match$1 = person1.status; - var name = person1.name; - var match$2 = person1.reportCard; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; + +let message; + +if (person1.TAG === "Teacher") { + message = `Hello ` + "Jane" + `.`; +} else { + let match = "Jane"; + let match$1 = match.status; + let name = match.name; + let match$2 = match.reportCard; if (match$2.passing) { - "Congrats " + + message = + `Congrats ` + name + - ", nice GPA of " + + `, nice GPA of ` + match$2.gpa.toString() + - " you got there!"; - } else if (typeof match$1 === "number") { - if (match$1 !== 0) { - "Good luck next semester " + name + "!"; + ` you got there!`; + } else { + let exit = 0; + if (typeof match$1 !== "object") { + message = + match$1 === "Sick" + ? `How are you feeling?` + : `Good luck next semester ` + name + `!`; } else { - ("How are you feeling?"); + exit = 1; + } + if (exit === 1) { + message = + match.reportCard.gpa !== 0.0 + ? `Good luck next semester ` + name + `!` + : `Come back in ` + match$1._0.toString() + ` days!`; } - } else if (person1.reportCard.gpa !== 0.0) { - "Good luck next semester " + name + "!"; - } else { - "Come back in " + match$1._0.toString() + " days!"; } +} + +let myStatus = { TAG: "Vacations", _0: 10 }; + +let exit$1 = 0; + +if (typeof myStatus !== "object") { + console.log("Hey! How are you?"); } else { - switch (person1.name) { - case "Joe": - case "Mary": - break; - default: - throw { - RE_EXN_ID: "Match_failure", - _1: ["playground.res", 13, 0], - Error: new Error(), - }; + exit$1 = 1; +} + +if (exit$1 === 1) { + console.log(`Come back in ` + (10).toString() + ` days!`); +} + +let d = { A: 5, B: 6 }; + +function messageFor(person) { + if (person.TAG === "Teacher") { + switch (person.name) { + case "Joe": + case "Mary": + return `Hey, still going to the party on Saturday?`; + default: + throw { + RE_EXN_ID: "Match_failure", + _1: ["Example.res", 59, 27], + Error: new Error(), + }; + } + } else { + let match = person._0; + let match$1 = match.status; + let name = match.name; + let match$2 = match.reportCard; + if (match$2.passing) { + return ( + `Congrats ` + + name + + `, nice GPA of ` + + match$2.gpa.toString() + + ` you got there!` + ); + } + if (typeof match$1 !== "object") { + if (match$1 === "Sick") { + return `How are you feeling?`; + } else { + return `Good luck next semester ` + name + `!`; + } + } + match$1.TAG === "Vacations"; + if (match.reportCard.gpa !== 0.0) { + return `Good luck next semester ` + name + `!`; + } else { + return `Come back in ` + match$1._0.toString() + ` days!`; + } } } + +let b = d.B; + +export { person1, message, myStatus, d, b, messageFor }; ``` -Did you see what we removed? This time, we've omitted the handling of the case where `person1` is `Teacher({name})` when `name` isn't Mary or Joe. +Did you see what we removed? This time, we've omitted the handling of the case where `person` is `Teacher({name})` when `name` isn't Mary or Joe. Failing to handle every scenario of a value likely constitutes the majority of program bugs out there. This happens very often when you refactor a piece of code someone else wrote. Fortunately for ReScript, the compiler will tell you so: ``` -Warning 8: this pattern-matching is not exhaustive. -Here is an example of a value that is not matched: -Some({name: ""}) +Warning number 8 +You forgot to handle a possible case here, for example: +| Teacher({name: "", _}) ``` **BAM**! You've just erased an entire category of important bugs before you even ran the code. In fact, this is how most of nullable values is handled: @@ -1631,11 +1936,7 @@ switch myNullableValue { ``` ```js -let person1 = { - TAG: "Teacher", - name: "Jane", - age: 35, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; let message; @@ -1672,10 +1973,7 @@ if (person1.TAG === "Teacher") { } } -let myStatus = { - TAG: "Vacations", - _0: 10, -}; +let myStatus = { TAG: "Vacations", _0: 10 }; let exit$1 = 0; @@ -1689,10 +1987,7 @@ if (exit$1 === 1) { console.log(`Come back in ` + (10).toString() + ` days!`); } -let d = { - A: 5, - B: 6, -}; +let d = { A: 5, B: 6 }; console.log("value is present"); @@ -1734,11 +2029,7 @@ let optionBoolToBool = opt => { ``` ```js -let person1 = { - TAG: "Teacher", - name: "Jane", - age: 35, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; let message; @@ -1775,10 +2066,7 @@ if (person1.TAG === "Teacher") { } } -let myStatus = { - TAG: "Vacations", - _0: 10, -}; +let myStatus = { TAG: "Vacations", _0: 10 }; let exit$1 = 0; @@ -1792,10 +2080,7 @@ if (exit$1 === 1) { console.log(`Come back in ` + (10).toString() + ` days!`); } -let d = { - A: 5, - B: 6, -}; +let d = { A: 5, B: 6 }; function optionBoolToBool(opt) { if (opt === undefined) { @@ -1826,11 +2111,7 @@ let optionBoolToBool = opt => { ``` ```js -let person1 = { - TAG: "Teacher", - name: "Jane", - age: 35, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; let message; @@ -1867,10 +2148,7 @@ if (person1.TAG === "Teacher") { } } -let myStatus = { - TAG: "Vacations", - _0: 10, -}; +let myStatus = { TAG: "Vacations", _0: 10 }; let exit$1 = 0; @@ -1884,10 +2162,7 @@ if (exit$1 === 1) { console.log(`Come back in ` + (10).toString() + ` days!`); } -let d = { - A: 5, - B: 6, -}; +let d = { A: 5, B: 6 }; function optionBoolToBool(opt) { if (opt !== undefined) { @@ -1919,11 +2194,7 @@ let optionBoolToBool = opt => { ``` ```js -let person1 = { - TAG: "Teacher", - name: "Jane", - age: 35, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; let message; @@ -1960,10 +2231,7 @@ if (person1.TAG === "Teacher") { } } -let myStatus = { - TAG: "Vacations", - _0: 10, -}; +let myStatus = { TAG: "Vacations", _0: 10 }; let exit$1 = 0; @@ -1977,10 +2245,7 @@ if (exit$1 === 1) { console.log(`Come back in ` + (10).toString() + ` days!`); } -let d = { - A: 5, - B: 6, -}; +let d = { A: 5, B: 6 }; function optionBoolToBool(opt) { if (opt !== undefined) { @@ -2011,11 +2276,7 @@ let optionBoolToBool = opt => { ``` ```js -let person1 = { - TAG: "Teacher", - name: "Jane", - age: 35, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; let message; @@ -2052,10 +2313,7 @@ if (person1.TAG === "Teacher") { } } -let myStatus = { - TAG: "Vacations", - _0: 10, -}; +let myStatus = { TAG: "Vacations", _0: 10 }; let exit$1 = 0; @@ -2069,10 +2327,7 @@ if (exit$1 === 1) { console.log(`Come back in ` + (10).toString() + ` days!`); } -let d = { - A: 5, - B: 6, -}; +let d = { A: 5, B: 6 }; function optionBoolToBool(opt) { if (opt !== undefined) { @@ -2103,11 +2358,7 @@ let optionBoolToBool = opt => { ``` ```js -let person1 = { - TAG: "Teacher", - name: "Jane", - age: 35, -}; +let person1 = { TAG: "Teacher", name: "Jane", age: 35 }; let message; @@ -2144,10 +2395,7 @@ if (person1.TAG === "Teacher") { } } -let myStatus = { - TAG: "Vacations", - _0: 10, -}; +let myStatus = { TAG: "Vacations", _0: 10 }; let exit$1 = 0; @@ -2161,10 +2409,7 @@ if (exit$1 === 1) { console.log(`Come back in ` + (10).toString() + ` days!`); } -let d = { - A: 5, - B: 6, -}; +let d = { A: 5, B: 6 }; function optionBoolToBool(opt) { if (opt !== undefined) { diff --git a/apps/docs/markdown-pages/docs/manual/pipe.mdx b/apps/docs/markdown-pages/docs/manual/pipe.mdx index b5c65bcd0..1b25a8ecc 100644 --- a/apps/docs/markdown-pages/docs/manual/pipe.mdx +++ b/apps/docs/markdown-pages/docs/manual/pipe.mdx @@ -10,11 +10,37 @@ order: 15 ReScript provides a tiny but surprisingly useful operator `->`, called the "pipe", that allows you to "flip" your code inside-out. `a(b)` becomes `b->a`. It's a simple piece of syntax that doesn't have any runtime cost. +
+ +{/* Shared bindings for the illustrative functions and values below. */} + +```res prelude +type person = {age: int, name: string} +@val external person: string = "person" +@val external parseData: string => person = "parseData" +@val external getAge: person => int = "getAge" +@val external validateAge: int => unit = "validateAge" +@val external a: (int, int, int) => unit = "a" +@val external one: int = "one" +@val external two: int = "two" +@val external three: int = "three" +@val external name: string = "name" +@val external preprocess: string => string = "preprocess" +@val external add3: (int, int, int) => int = "add3" +@val external makePerson: (~age: int) => person = "makePerson" +@val external namePerson: (person, string) => unit = "namePerson" +@val external input: string = "input" +@val external getName: string => string = "getName" +@val external personDetails: person = "personDetails" +``` + +
+ Why would you use it? Imagine you have the following: -```res nocheck +```res validateAge(getAge(parseData(person))) ``` @@ -28,7 +54,7 @@ This is slightly hard to read, since you need to read the code from the innermos -```res nocheck +```res person ->parseData ->getAge @@ -47,7 +73,7 @@ Basically, `parseData(person)` is transformed into `person->parseData`, and `get -```res nocheck +```res a(one, two, three) ``` @@ -61,7 +87,7 @@ is the same as -```res nocheck +```res one->a(two, three) ``` @@ -103,7 +129,7 @@ type request ``` ```js -// Empty output +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ ``` @@ -112,7 +138,7 @@ You'd use them like this: -```res nocheck +```res let result = Array.filter( Array.map([1, 2, 3], a => a + 1), a => mod(a, 2) == 0 @@ -135,7 +161,7 @@ This looks much worse than the JS counterpart! Clean it up visually with pipe: -```res nocheck +```res let result = [1, 2, 3] ->Array.map(a => a + 1) ->Array.filter(a => mod(a, 2) == 0) @@ -159,12 +185,14 @@ You can pipe into a variant's constructor as if it was a function: -```res nocheck +```res let result = name->preprocess->Some ``` ```js -var result = preprocess(name); +let result = preprocess(name); + +export { result }; ``` @@ -173,12 +201,14 @@ We turn this into: -```res nocheck +```res let result = Some(preprocess(name)) ``` ```js -var result = preprocess(name); +let result = preprocess(name); + +export { result }; ``` @@ -189,7 +219,7 @@ var result = preprocess(name); A placeholder is written as an underscore and it tells ReScript that you want to fill in an argument of a function later. These two have equivalent meaning: -```res nocheck +```res let addTo7 = (x) => add3(3, x, 4) let addTo7 = add3(3, _, 4) ``` @@ -200,7 +230,7 @@ Let's say you have a function `namePerson`, which takes a `person` then a `name` -```res nocheck +```res makePerson(~age=47) ->namePerson("Jane") ``` @@ -215,13 +245,14 @@ If you have a name that you want to apply to a person object, you can use a plac -```res nocheck +```res getName(input) ->namePerson(personDetails, _) ``` ```js -var __x = getName(input); +let __x = getName(input); + namePerson(personDetails, __x); ``` @@ -231,13 +262,16 @@ This allows you to pipe into any positional argument. It also works for named ar -```res nocheck +```res +@val external namePerson: (~person: person, ~name: string) => unit = "namePerson" + getName(input) ->namePerson(~person=personDetails, ~name=_) ``` ```js -var __x = getName(input); +let __x = getName(input); + namePerson(personDetails, __x); ``` diff --git a/apps/docs/markdown-pages/docs/manual/polymorphic-variant.mdx b/apps/docs/markdown-pages/docs/manual/polymorphic-variant.mdx index 4b3506217..f19c537e0 100644 --- a/apps/docs/markdown-pages/docs/manual/polymorphic-variant.mdx +++ b/apps/docs/markdown-pages/docs/manual/polymorphic-variant.mdx @@ -48,7 +48,7 @@ export { myColor, myLabel, myNumber }; Although **optional**, you can still pre-declare a poly variant type: -```res nocheck +```res // Note the surrounding square brackets, and # for constructors type color = [#red | #green | #blue] ``` @@ -134,15 +134,9 @@ let him: account = #Facebook("Josh", 26) ``` ```js -let me = { - NAME: "Instagram", - VAL: "Jenny", -}; +let me = { NAME: "Instagram", VAL: "Jenny" }; -let him = { - NAME: "Facebook", - VAL: ["Josh", 26], -}; +let him = { NAME: "Facebook", VAL: ["Josh", 26] }; export { me, him }; ``` @@ -155,7 +149,7 @@ You can use poly variant types within other poly variant types to create a sum o -```res +```res prelude type red = [#Ruby | #Redwood | #Rust] type blue = [#Sapphire | #Neon | #Navy] @@ -178,7 +172,7 @@ There's also some special [pattern matching](./pattern-matching-destructuring.md -```res nocheck +```res // Continuing the previous example above... switch myColor { @@ -189,22 +183,18 @@ switch myColor { ``` ```js -var other = myColor; - -if (other === "Neon" || other === "Navy" || other === "Sapphire") { - console.log("This is blue-ish"); -} else if (other === "Rust" || other === "Ruby" || other === "Redwood") { - console.log("This is red-ish"); -} else { - console.log("Other color than red and blue: ", other); -} +console.log("This red-ish"); + +let myColor = "Ruby"; + +export { myColor }; ``` This is a shorter version of: -```res nocheck +```res switch myColor { | #Sapphire | #Neon | #Navy => Console.log("This is blue-ish") | #Ruby | #Redwood | #Rust => Console.log("This is red-ish") @@ -285,7 +275,9 @@ let intl = makeNumberFormat(#"de-DE") ```js let intl = Intl.NumberFormat("de-DE"); -export { intl }; +let myColor = "Ruby"; + +export { myColor, intl }; ``` @@ -324,7 +316,9 @@ import * as DirectionJs from "./direction.js"; let myDirection = DirectionJs.myDirection; -export { myDirection }; +let myColor = "Ruby"; + +export { myColor, myDirection }; ``` @@ -335,7 +329,7 @@ Again: since we were using poly variants, the JS Output is practically zero-cost The previous poly variant type annotations we've looked at are the regular "closed" kind. However, there's a way to express "I want at least these constructors" (lower bound) and "I want at most these constructors" (upper bound): -```res nocheck +```res // Only #Red allowed. Closed. let basic: [#Red] = #Red @@ -354,7 +348,7 @@ let background: [< #Red | #Blue] = #Red This is the simplest poly variant definition, and also the most practical one. Like a common variant type, this one defines an exact set of constructors. -```res nocheck +```res type rgb = [ #Red | #Green | #Blue ] let color: rgb = #Green @@ -414,15 +408,29 @@ let message = "Hello " ++ (theCompany :> string) ```js let message = "Hello " + "Apple"; +let myColor = "Ruby"; + let theCompany = "Apple"; -export { theCompany, message }; +export { myColor, theCompany, message }; ``` **Note**: for the coercion to work, the poly variant type needs to be closed; you'd need to annotate it, since otherwise, `theCompany` would be inferred as `[> #Apple]`. +Since ReScript 12, a closed polymorphic variant can also be coerced to a regular variant when their possible constructors have matching runtime representations: + +```res +type command = [#Start | #Stop] +type event = Start | Stop | Pause + +let command: command = #Start +let event: event = (command :> event) +``` + +Here, `#Start` and `Start` are both represented by the string `"Start"`, and every value in `command` can be represented by `event`. The coercion therefore has no runtime cost. + ## Tips & Tricks ### Variant vs Polymorphic Variant diff --git a/apps/docs/markdown-pages/docs/manual/primitive-types.mdx b/apps/docs/markdown-pages/docs/manual/primitive-types.mdx index 131a2a8eb..cdd353066 100644 --- a/apps/docs/markdown-pages/docs/manual/primitive-types.mdx +++ b/apps/docs/markdown-pages/docs/manual/primitive-types.mdx @@ -34,12 +34,12 @@ export { greeting, multilineGreeting }; -To concatenate strings, use `++`: +Use `+` to concatenate strings. The older `++` operator is still supported: ```res -let greetings = "Hello " ++ "world!" +let greetings = "Hello " + "world!" ``` ```js @@ -109,7 +109,7 @@ The more you overload the poor string type, the less the type system (or a teamm ## Char -ReScript has a type for a string with a single letter: +ReScript has a legacy `char` type: @@ -127,7 +127,7 @@ export { firstLetterOfAlphabet }; **Note**: Char doesn't support Unicode or UTF-8 and is therefore not recommended. -To convert a String to a Char, use `String.get("a", 0)`. To convert a Char to a String, use `String.make(1, 'a')`. +Prefer strings and the `String` module for text. `String.get("a", 0)` returns `Some("a")`, an `option`, rather than a `char`. It returns `None` for an out-of-range index. `String.make` converts a single value to a string: `String.make(1)` returns `"1"`. To repeat a string, use `String.repeat("a", 3)`, which returns `"aaa"`. ## Regular Expression @@ -164,13 +164,30 @@ A ReScript boolean has the type `bool` and can be either `true` or `false`. Comm ReScript's `true/false` compiles into a JavaScript `true/false`. +## Arithmetic Operators + +The unified arithmetic operators `+`, `-`, `*`, `/`, `%`, and `**` work with `int`, `float`, and `bigint`. `+` also works with `string`. + +The compiler specializes an operator from the types around it: + +```res +let intSum = 1 + 2 +let floatSum = 1.5 + 2.5 +let stringSum = "Re" + "Script" + +let addFloats = (left: float, right) => left + right +let addMoreFloats = (left, right: float) => left + right +``` + +Both operands must have the same type. If neither operand provides a primitive type, the expression defaults to `int`. + ## Integers 32-bits, truncated when necessary. We provide the usual operations on them: `+`, `-`, `*`, `/`, etc. See [Int](/docs/manual/api/stdlib/int) for helper functions. Integer operators include `+`, `-`, `*`, `/`, `**`, and `%`. -`%` keeps the familiar `mod` naming, but its semantics are remainder (same behavior as JavaScript `%`). +`%` computes the remainder, as in JavaScript. For example, `-7 % 4` is `-3`. Bitwise operators for `int`: `~~~`, `&&&`, `|||`, `^^^`, `<<`, `>>`, `>>>`. @@ -180,7 +197,7 @@ To improve readability, you may place underscores in the middle of numeric liter ## Floats -Arithmetic operators (`+`, `-`, `*`, `/`, `%`, `**`) work for both `int` and `float`. Like `0.5 + 0.6`. See [Float](/docs/manual/api/stdlib/float) for helper functions. +Arithmetic operators (`+`, `-`, `*`, `/`, `%`, `**`) work for both `int` and `float`, as in `0.5 + 0.6`. See [Float](/docs/manual/api/stdlib/float) for helper functions. As with integers, you may use underscores within literals to improve readability. diff --git a/apps/docs/markdown-pages/docs/manual/record.mdx b/apps/docs/markdown-pages/docs/manual/record.mdx index 8a49473e3..8580d4684 100644 --- a/apps/docs/markdown-pages/docs/manual/record.mdx +++ b/apps/docs/markdown-pages/docs/manual/record.mdx @@ -27,7 +27,7 @@ type person = { ``` ```js -// Empty output +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ ``` @@ -61,10 +61,7 @@ let person = { let person = { age: 90, name: "Test Person", - notificationSettings: { - sendEmails: true, - allowPasswordLogin: false, - }, + notificationSettings: { sendEmails: true, allowPasswordLogin: false }, }; export { person }; @@ -110,10 +107,7 @@ let person = { let person = { age: 90, name: "Test Person", - notificationSettings: { - sendEmails: true, - allowPasswordLogin: false, - }, + notificationSettings: { sendEmails: true, allowPasswordLogin: false }, }; export { person }; @@ -135,10 +129,9 @@ let me = { ``` ```js -var me = { - age: 5, - name: "Big ReScript", -}; +let me = { age: 5, name: "Big ReScript" }; + +export { me }; ``` @@ -155,10 +148,7 @@ type schoolPerson = {age: int, name: string} ``` ```js -let me = { - age: 5, - name: "Big ReScript", -}; +let me = { age: 5, name: "Big ReScript" }; export { me }; ``` @@ -176,14 +166,11 @@ let me2 = {School.age: 20, name: "Big ReScript"} ``` ```js -var me = { - age: 20, - name: "Big ReScript", -}; -var me2 = { - age: 20, - name: "Big ReScript", -}; +let me = { age: 20, name: "Big ReScript" }; + +let me2 = { age: 20, name: "Big ReScript" }; + +export { me, me2 }; ``` @@ -201,10 +188,7 @@ let name = me.name ``` ```js -let me = { - age: 5, - name: "Big ReScript", -}; +let me = { age: 5, name: "Big ReScript" }; let name = "Big ReScript"; @@ -224,15 +208,9 @@ let meNextYear = {...me, age: me.age + 1} ``` ```js -let meNextYear = { - age: 6, - name: "Big ReScript", -}; +let meNextYear = { age: 6, name: "Big ReScript" }; -let me = { - age: 5, - name: "Big ReScript", -}; +let me = { age: 5, name: "Big ReScript" }; export { me, meNextYear }; ``` @@ -258,17 +236,11 @@ baby.age = baby.age + 1 // `baby.age` is now 6. Happy birthday! ``` ```js -let baby = { - name: "Baby ReScript", - age: 5, -}; +let baby = { name: "Baby ReScript", age: 5 }; baby.age = (baby.age + 1) | 0; -let me = { - age: 5, - name: "Big ReScript", -}; +let me = { age: 5, name: "Big ReScript" }; export { me, baby }; ``` @@ -295,10 +267,7 @@ type optionalPerson = { ``` ```js -let me = { - age: 5, - name: "Big ReScript", -}; +let me = { age: 5, name: "Big ReScript" }; export { me }; ``` @@ -330,14 +299,9 @@ let friend: optionalPerson = { ``` ```js -let me = { - age: 5, - name: "Big ReScript", -}; +let me = { age: 5, name: "Big ReScript" }; -let friend = { - age: 7, -}; +let friend = { age: 7 }; export { me, friend }; ``` @@ -370,10 +334,7 @@ let withoutName = { ``` ```js -let me = { - age: 123, - name: "Hello", -}; +let me = { age: 123, name: "Hello" }; let newrecord = { ...me }; @@ -410,10 +371,7 @@ let withoutName = { ``` ```js -let me = { - age: 123, - name: "Hello", -}; +let me = { age: 123, name: "Hello" }; let maybeName = "My Name"; @@ -458,10 +416,7 @@ let isRescript = switch me.name { ```js let isRescript = "Hello" === "ReScript"; -let me = { - age: 123, - name: "Hello", -}; +let me = { age: 123, name: "Hello" }; export { me, isRescript }; ``` @@ -493,10 +448,7 @@ let isRescript = switch me { ```js let isRescript = "Hello" === "ReScript"; -let me = { - age: 123, - name: "Hello", -}; +let me = { age: 123, name: "Hello" }; export { me, isRescript }; ``` @@ -525,10 +477,7 @@ let nameWasSet = switch me { ``` ```js -let me = { - age: 123, - name: "Hello", -}; +let me = { age: 123, name: "Hello" }; let nameWasSet = true; @@ -627,7 +576,7 @@ let name = nameFromB(a :> b) Notice how `a` now has more fields than `b`, but we can still coerce `a` to `b` because `b` has a subset of the fields of `a`. -In combination with [optional record fields](./record.mdx#optional-record-fields), one may coerce a mandatory field of an `option` type to an optional field: +Coercion requires matching field optionality. In ReScript 12, a mandatory `option` field cannot be coerced directly to an optional `int` field. Construct the target record explicitly instead: ```rescript type a = { @@ -650,7 +599,8 @@ let a: a = { age: Some(35), } -let name = nameFromB(a :> b) +let b: b = {name: a.name, age: ?a.age} +let name = nameFromB(b) ``` ## Tips & Tricks @@ -661,7 +611,7 @@ With records, you **cannot** say "I'd like this function to take any record type -```res nocheck +```res type person = {age: int, name: string} type monster = {age: int, hasTentacles: bool} @@ -669,9 +619,13 @@ let getAge = (entity) => entity.age ``` ```js +let ExamplePrelude = { me: { age: 5, name: "Big ReScript" } }; + function getAge(entity) { return entity.age; } + +export { ExamplePrelude, getAge }; ``` @@ -679,6 +633,11 @@ function getAge(entity) { Instead, `getAge` will infer that the parameter `entity` must be of type `monster`, the closest record type with the field `age`. The following code's last line fails: ```res nocheck +// This example intentionally rejects the second call to getAge. +type person = {age: int, name: string} +type monster = {age: int, hasTentacles: bool} +let getAge = entity => entity.age + let kraken = {age: 9999, hasTentacles: true} let me = {age: 5, name: "Baby ReScript"} diff --git a/apps/docs/markdown-pages/docs/manual/reserved-keywords.mdx b/apps/docs/markdown-pages/docs/manual/reserved-keywords.mdx index 5d392077d..52eb03fd4 100644 --- a/apps/docs/markdown-pages/docs/manual/reserved-keywords.mdx +++ b/apps/docs/markdown-pages/docs/manual/reserved-keywords.mdx @@ -15,68 +15,28 @@ order: 27 - `and` - `as` - `assert` - -{/* - `begin` */} - -{/* - `class` */} - +- `await` - `constraint` - -{/* - `do` */} -{/* - `done` */} - - `else` - {/* - `end` */} - {/* - `esfun` */} - `exception` - `external` - -* `false` -* `for` - {/* - `fun` */} - {/* - `function` */} - {/* - `functor` */} - +- `false` +- `for` - `if` - `in` - `include` - {/* - `inherit` */} - {/* - `initializer` */} - -* `lazy` -* `let` - +- `let` - `module` - `mutable` - -{/* - `new` */} -{/* - `nonrec` */} - -{/* - `object` */} - - `of` - `open` - {/* - `or` */} - -{/* - `pri` */} -{/* - `pub` */} - +- `private` - `rec` - -{/* - `sig` */} -{/* - `struct` */} - - `switch` - -{/* - `then` */} - - `true` - `try` - `type` - -{/* - `val` */} -{/* - `virtual` */} - - `when` - `while` -- `with` + +`async`, `break`, and `continue` are recognized in specific syntactic contexts, but can also be used as binding names. `list` and `dict` introduce literals when followed immediately by `{`; they can otherwise be used as names. `lazy` and `with` are not reserved. diff --git a/apps/docs/markdown-pages/docs/manual/scoped-polymorphic-types.mdx b/apps/docs/markdown-pages/docs/manual/scoped-polymorphic-types.mdx index cb1a07c15..6b3c885b8 100644 --- a/apps/docs/markdown-pages/docs/manual/scoped-polymorphic-types.mdx +++ b/apps/docs/markdown-pages/docs/manual/scoped-polymorphic-types.mdx @@ -73,17 +73,13 @@ In this example, we create an instance of the logger by calling `getLogger()`, a Let's consider the same logging example in ReScript, but this time using normal polymorphic types: -```res -type logger<'a> = { log: 'a => unit} +```res nocheck +// This example intentionally fails at the second call. +type logger<'a> = {log: 'a => unit} @module("jsAPI") external getLogger: unit => logger<'a> = "getLogger" -``` -In this case, the `logger` type is a simple polymorphic function type `'a => unit`. However, when we attempt to use this type in the same way as before, we encounter an issue: - -```res let myLogger = getLogger() - myLogger.log("Hello, ReScript!") myLogger.log(42) // Type error! ``` @@ -96,11 +92,15 @@ In contrast, scoped polymorphic types, such as `'a. 'a => unit`, overcome this l Scoped polymorphic types work only when they are directly applied to let-bindings or record fields (as demonstrated in the logger example above). They can neither be applied to function bodies, nor to separate type definitions: -```res nocheck +```res exception Abort let testExn: 'a. unit => 'a = () => throw(Abort) // Works! +``` +The following inline annotations intentionally produce syntax errors: + +```res nocheck let testExn2 = (): 'a. 'a = throw(Abort) // Syntax error! type fn = 'a. 'a => unit // Syntax error! ``` diff --git a/apps/docs/markdown-pages/docs/manual/shared-data-types.mdx b/apps/docs/markdown-pages/docs/manual/shared-data-types.mdx index bc00c31c3..1e3d248cd 100644 --- a/apps/docs/markdown-pages/docs/manual/shared-data-types.mdx +++ b/apps/docs/markdown-pages/docs/manual/shared-data-types.mdx @@ -16,8 +16,9 @@ ReScript values compile to their JavaScript equivalents directly, so **no data c **Shared, bidirectionally usable types**: -- String. ReScript strings are JavaScript strings, vice-versa. (Caveat: only our backtick string `` `hello 👋 ${personName}` `` supports unicode and interpolation). +- String. ReScript strings are JavaScript strings, vice-versa. Both double-quoted strings (`"hello 👋"`) and backtick strings support Unicode. Backtick strings also support interpolation, such as `` `hello 👋 ${personName}` ``. - Float. ReScript floats are JavaScript numbers, vice-versa. +- Big integer. ReScript `bigint` values, such as `42n`, are JavaScript big integers. Use the [BigInt API](/docs/manual/api/stdlib/bigint) for operations on them. - Array. Use the [Array API](/docs/manual/api/stdlib/array) for array operations. - Tuple. Compiles to an array at runtime. You can treat a fixed-sized, heterogenous JavaScript array as a ReScript tuple too. - Boolean. @@ -39,10 +40,11 @@ ReScript values compile to their JavaScript equivalents directly, so **no data c **Non-shared types (aka internal types)**: - Character. -- Int64. - Lazy values. - Everything else. Many of these are stable, which means that you can still serialize/deserialize them as-is without manual conversions. But we discourage actively peeking into their structure otherwise. These types require manual conversions if you want to export them for JavaScript consumption. For a seamless JavaScript/TypeScript integration experience, check out the [TypeScript Integration](./typescript-integration.mdx) page instead of doing conversions by hand. + +ReScript v12 no longer provides the legacy `int64` type or `Int64` module. Use `bigint` for large integers instead. diff --git a/apps/docs/markdown-pages/docs/manual/tagged-templates.mdx b/apps/docs/markdown-pages/docs/manual/tagged-templates.mdx index ca0081105..7af778b41 100644 --- a/apps/docs/markdown-pages/docs/manual/tagged-templates.mdx +++ b/apps/docs/markdown-pages/docs/manual/tagged-templates.mdx @@ -65,15 +65,15 @@ let s = (strings, parameters) => { ``` ```js -import * as Core__Array from "./stdlib/core__Array.js"; +import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js"; function s(strings, parameters) { - return Core__Array.reduceWithIndex( + return Stdlib_Array.reduceWithIndex( parameters, strings[0], - function (acc, param, i) { - var s = strings[(i + 1) | 0]; - var p; + (acc, param, i) => { + let s = strings[(i + 1) | 0]; + let p; switch (param.TAG) { case "I": case "F": @@ -90,6 +90,8 @@ function s(strings, parameters) { }, ); } + +export { s }; ``` @@ -142,22 +144,14 @@ function Example$Greetings(props) { children: s( [`hello `, ` you're `, ` year old!`], [ - { - TAG: "S", - _0: props.name, - }, - { - TAG: "I", - _0: props.age, - }, + { TAG: "S", _0: props.name }, + { TAG: "I", _0: props.age }, ], ), }); } -let Greetings = { - make: Example$Greetings, -}; +let Greetings = { make: Example$Greetings }; export { s, Greetings }; ``` @@ -196,23 +190,15 @@ function Example$Greetings(props) { {s( [`hello `, ` you're `, ` year old!`], [ - { - TAG: "S", - _0: props.name, - }, - { - TAG: "I", - _0: props.age, - }, + { TAG: "S", _0: props.name }, + { TAG: "I", _0: props.age }, ], )}
); } -let Greetings = { - make: Example$Greetings, -}; +let Greetings = { make: Example$Greetings }; export { s, Greetings }; ``` diff --git a/apps/docs/markdown-pages/docs/manual/tuple.mdx b/apps/docs/markdown-pages/docs/manual/tuple.mdx index 6c2d1c94a..c6bd1c8c7 100644 --- a/apps/docs/markdown-pages/docs/manual/tuple.mdx +++ b/apps/docs/markdown-pages/docs/manual/tuple.mdx @@ -44,8 +44,11 @@ let my3dCoordinates: coord3d = (20.0, 30.5, 100.0) ``` ```js -var ageAndName = [24, "Lil' ReScript"]; -var my3dCoordinates = [20.0, 30.5, 100.0]; +let ageAndName = [24, "Lil' ReScript"]; + +let my3dCoordinates = [20.0, 30.5, 100.0]; + +export { ageAndName, my3dCoordinates }; ``` @@ -117,11 +120,13 @@ let getCenterCoordinates = () => { ``` ```js -function getCenterCoordinates(param) { - var x = doSomeOperationsHere(undefined); - var y = doSomeMoreOperationsHere(undefined); +function getCenterCoordinates() { + let x = doSomeOperationsHere(); + let y = doSomeMoreOperationsHere(); return [x, y]; } + +export { getCenterCoordinates }; ``` diff --git a/apps/docs/markdown-pages/docs/manual/type.mdx b/apps/docs/markdown-pages/docs/manual/type.mdx index ab388067f..b4dbc50fb 100644 --- a/apps/docs/markdown-pages/docs/manual/type.mdx +++ b/apps/docs/markdown-pages/docs/manual/type.mdx @@ -67,26 +67,31 @@ You can also wrap any expression in parentheses and annotate it: -```res nocheck +```res let myInt = 5 let myInt: int = 5 let myInt = (5: int) + (4: int) let add = (x: int, y: int) : int => x + y -let drawCircle = (~radius as r: int): circleType => /* code here */ ``` ```js -var myInt = 9; function add(x, y) { return (x + y) | 0; } -function drawCircle(r) { - /* code here */ -} + +let myInt = 9; + +export { myInt, add }; ``` +A function's return type can also be annotated. Here is an incomplete example: + +```res nocheck +let drawCircle = (~radius as r: int): circleType => /* code here */ +``` + Note: in the last line, `(~radius as r: int)` is a labeled argument. More on this in the [function](./function.mdx) page. ## Type Alias @@ -217,22 +222,9 @@ let payloadResults: myPayloadResults = [ ```js let payloadResults = [ - { - TAG: "Ok", - _0: { - data: "hi", - }, - }, - { - TAG: "Ok", - _0: { - data: "bye", - }, - }, - { - TAG: "Error", - _0: "Something wrong happened!", - }, + { TAG: "Ok", _0: { data: "hi" } }, + { TAG: "Ok", _0: { data: "bye" } }, + { TAG: "Error", _0: "Something wrong happened!" }, ]; export { payloadResults }; diff --git a/apps/docs/markdown-pages/docs/manual/typescript-integration.mdx b/apps/docs/markdown-pages/docs/manual/typescript-integration.mdx index 60f3ebc0c..09f71960c 100644 --- a/apps/docs/markdown-pages/docs/manual/typescript-integration.mdx +++ b/apps/docs/markdown-pages/docs/manual/typescript-integration.mdx @@ -22,7 +22,7 @@ type t = | A(int) | B(string) is exported to a TypeScript type: ```ts -type t = { TAG: "A"; _0: number } | { TAG: "B"; _0: string }; +export type t = { TAG: "A"; _0: number } | { TAG: "B"; _0: string }; ``` ## A Quick Example @@ -70,7 +70,7 @@ import * as ColorJS from "./Color.res.js"; export type color = "Red" | "Blue"; -export const printColorMessage: (color: color) => void = +export const printColorMessage: (color: color, message: string) => void = ColorJS.printColorMessage as any; ``` @@ -81,7 +81,7 @@ Within our TypeScript application, we can now import and use the function in the ```ts // src/app.ts -import { printColorMessage } from "./Color.gen.tsx"; +import { printColorMessage } from "./Color.gen.js"; printColorMessage("Red", "Hello, genType!"); ``` @@ -90,9 +90,11 @@ printColorMessage("Red", "Hello, genType!"); _Since ReScript `11.0.0`_ modules can be annotated with `@genType` as well. In that case, all types and values of the module will be converted to TS types. Example: - + ```res +// src/MyComp.res + @genType module Size = { type t = @@ -110,14 +112,19 @@ module Size = { ``` ```ts -import * as MyCompBS__Es6Import from "./MyComp.res"; -const MyCompBS: any = MyCompBS__Es6Import; +/* TypeScript file generated from MyComp.res by genType. */ + +/* eslint-disable */ +/* tslint:disable */ + +import * as MyCompJS from "./MyComp.res.js"; export type Size_t = "Small" | "Medium" | "Large"; -export const Size_getNum: (size: Size_t) => number = MyCompBS.Size.getNum; +export const Size_getNum: (size: Size_t) => number = MyCompJS.Size + .getNum as any; -export const Size: { getNum: (size: Size_t) => number } = MyCompBS.Size; +export const Size: { getNum: (size: Size_t) => number } = MyCompJS.Size as any; ``` ```js @@ -132,9 +139,7 @@ function getNum(size) { } } -let Size = { - getNum: getNum, -}; +let Size = { getNum: getNum }; export { Size }; ``` @@ -147,10 +152,15 @@ Add a `gentypeconfig` section to your `rescript.json` (See [Configuration](./bui Every `genType` powered project requires a configuration item `"gentypeconfig"` at top level in the project's `rescript.json`. -The minimal configuration of genType is following: +The examples above use ES modules, in-source JavaScript output and the `.res.js` suffix. Configure these settings together with genType: ```json { + "suffix": ".res.js", + "package-specs": { + "module": "esmodule", + "in-source": true + }, "gentypeconfig": { "module": "esmodule", "moduleResolution": "node", @@ -159,16 +169,21 @@ The minimal configuration of genType is following: } ``` -And don't forget to make sure `allowJs` is set to `true` in the project's `tsconfig.json`: +In the project's `tsconfig.json`, enable `allowJs` to import the generated JavaScript. When TypeScript emits files, use `jsx: "react-jsx"` so that the `.gen.tsx` wrappers compile to `.gen.js`: ```json { "compilerOptions": { - "allowJs": true + "allowJs": true, + "jsx": "react-jsx" } } ``` +The `.js` extension in consumer imports refers to the emitted file; TypeScript resolves it to the `.gen.tsx` source during type-checking. Explicit extensions also work with Node ES modules. + +Use `jsx: "preserve"` when a bundler handles emission and TypeScript runs with `noEmit: true`, as shown below. + ### TypeScript Module Resolutions Make sure to set the same `moduleResolution` value in both `rescript.json` and `tsconfig.json`, so that the output of genType is done with the preferred module resolution. @@ -179,6 +194,7 @@ For example if the TypeScript project uses JavaScript modules with `Node16` / `N // tsconfig.json { "compilerOptions": { + "module": "node16", "moduleResolution": "node16" } } @@ -201,7 +217,10 @@ In case of the TypeScript project using `Bundler` module resolution, `allowImpor // tsconfig.json { "compilerOptions": { + "module": "esnext", "moduleResolution": "bundler", + "jsx": "preserve", + "noEmit": true, "allowImportingTsExtensions": true } } @@ -225,9 +244,32 @@ Save the file and rebuild the project via `npm run build:res` or similar. You sh Any values exported from `MyComponent.res` can then be imported from TypeScript. For example: ```js -import MyComponent from "./components/MyComponent.gen.tsx"; +import { make } from "./components/MyComponent.gen.js"; ``` +## Built-in Type Mappings + +genType recognizes the ReScript 12 standard library directly, so common types don't require TypeScript shims. Important mappings include: + +| ReScript | TypeScript | +| ----------------------------------------------- | --------------------------------------- | +| `int`, `float` | `number` | +| `string`, `bool`, `bigint`, `unit` | `string`, `boolean`, `bigint`, `void` | +| `array<'a>`, tuples | arrays and tuples | +| `option<'a>` | `a \| undefined` | +| `Null.t<'a>` | `a \| null` | +| `Nullable.t<'a>` | `a \| null \| undefined` | +| `dict<'a>` | `{[id: string]: a}` | +| `JSON.t` | `unknown` | +| `Promise.t<'a>` | `Promise` | +| `Date.t`, `RegExp.t`, `Symbol.t` | `Date`, `RegExp`, `symbol` | +| `Map.t`, `WeakMap.t`, `Set.t`, `WeakSet.t` | the corresponding TypeScript collection | +| `ArrayBuffer.t`, `DataView.t`, and typed arrays | the corresponding JavaScript built-in | +| `JsError.t` | `Error` | +| `Intl.*.t` | the corresponding `Intl.*` type | + +ReScript records, variants, `result`, `ref`, and other language-level types are translated to equivalent structural TypeScript types. + ## Experimental features These features are for experimentation only. They could be changed/removed any time, and not be considered breaking changes. diff --git a/apps/docs/markdown-pages/docs/manual/use-illegal-identifier-names.mdx b/apps/docs/markdown-pages/docs/manual/use-illegal-identifier-names.mdx index 3af56c9c4..0c542e232 100644 --- a/apps/docs/markdown-pages/docs/manual/use-illegal-identifier-names.mdx +++ b/apps/docs/markdown-pages/docs/manual/use-illegal-identifier-names.mdx @@ -43,9 +43,7 @@ function calculate(Props) { let my$$unknown$unknown$unknown$unknown = 10; -let myElement = { - "aria-label": "close", -}; +let myElement = { "aria-label": "close" }; let label = "close"; diff --git a/apps/docs/markdown-pages/docs/manual/variant.mdx b/apps/docs/markdown-pages/docs/manual/variant.mdx index e87abcd46..714914497 100644 --- a/apps/docs/markdown-pages/docs/manual/variant.mdx +++ b/apps/docs/markdown-pages/docs/manual/variant.mdx @@ -62,8 +62,11 @@ let pet2 = Zoo.Dog ``` ```js -var pet = "Dog"; -var pet2 = "Dog"; +let pet = "Dog"; + +let pet2 = "Dog"; + +export { pet, pet2 }; ``` @@ -82,7 +85,7 @@ type account = ``` ```js -// Empty output +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ ``` @@ -97,16 +100,9 @@ let friendAccount = Instagram("Jenny") ``` ```js -let myAccount = { - TAG: "Facebook", - _0: "Josh", - _1: 26, -}; +let myAccount = { TAG: "Facebook", _0: "Josh", _1: 26 }; -let friendAccount = { - TAG: "Instagram", - _0: "Jenny", -}; +let friendAccount = { TAG: "Instagram", _0: "Jenny" }; export { myAccount, friendAccount }; ``` @@ -128,11 +124,7 @@ let me = Id({name: "Joe", password: "123"}) ``` ```js -let me = { - TAG: "Id", - name: "Joe", - password: "123", -}; +let me = { TAG: "Id", name: "Joe", password: "123" }; export { me }; ``` @@ -155,13 +147,7 @@ let me = Id({name: "Joe", password: "123"}) ``` ```js -let me = { - TAG: "Id", - _0: { - name: "Joe", - password: "123", - }, -}; +let me = { TAG: "Id", _0: { name: "Joe", password: "123" } }; export { me }; ``` @@ -240,42 +226,21 @@ let g2 = "Goodbye"; let o1 = "Good"; -let o2 = { - TAG: "Error", - _0: "oops!", -}; +let o2 = { TAG: "Error", _0: "oops!" }; let f1 = "Child"; -let f2 = { - TAG: "Mom", - _0: 30, - _1: "Jane", -}; +let f2 = { TAG: "Mom", _0: 30, _1: "Jane" }; -let f3 = { - TAG: "Dad", - _0: 32, -}; +let f3 = { TAG: "Dad", _0: 32 }; let p1 = "Teacher"; -let p2 = { - TAG: "Student", - gpa: 99.5, -}; +let p2 = { TAG: "Student", gpa: 99.5 }; -let a1 = { - TAG: "Warrior", - _0: { - score: 10.5, - }, -}; +let a1 = { TAG: "Warrior", _0: { score: 10.5 } }; -let a2 = { - TAG: "Wizard", - _0: "Joe", -}; +let a2 = { TAG: "Wizard", _0: "Joe" }; export { g1, g2, o1, o2, f1, f2, f3, p1, p2, a1, a2 }; ``` @@ -405,6 +370,10 @@ Here's a list of all possible things you can unbox: - `Blob.t`: `Blob(Blob.t)`. A JavaScript blob. - `File.t`: `File(File.t)`. A JavaScript file. - `RegExp.t`: `RegExp(RegExp.t)`. A JavaScript regexp instance. +- `ArrayBuffer.t` and `DataView.t` +- Typed arrays: `Int8Array.t`, `Uint8Array.t`, `Uint8ClampedArray.t`, `Int16Array.t`, `Uint16Array.t`, `Int32Array.t`, `Uint32Array.t`, `Float32Array.t`, `Float64Array.t`, `BigInt64Array.t`, and `BigUint64Array.t` +- `Set.t<'value>` and `Map.t<'key, 'value>` (since ReScript 12.1) +- `WeakSet.t<'value>` and `WeakMap.t<'key, 'value>` (since ReScript 12.1) Again notice that the constructor names can be anything, what matters is what's in the payload. @@ -459,7 +428,7 @@ let myValidJsonValue = Array([String("Hi"), Number(123.)]) Here's an example of how you could write your own JSON decoders easily using the above, leveraging pattern matching: -```rescript +```rescript prelude @unboxed type rec json = | @as(null) Null @@ -474,7 +443,9 @@ type rec user = { age: int, bestFriend: option, } +``` +```rescript let rec decodeUser = json => switch json { | Object(userDict) => @@ -546,6 +517,18 @@ switch animal { ```` ```javascript +function greetAnimal(animal) { + switch (animal) { + case "Dog": + return "Wof"; + case "Cat": + return "Meow"; + case "Bird": + return "Kashiiin"; + } +} + +export { greetAnimal }; ```` @@ -594,19 +577,20 @@ switch animal { ```` ```javascript function greetAnimal(animal) { - if (!(animal === "Cat" || animal === "Dog" || animal === "Bird")) { - return "I don't know how to greet animal " + animal; + if (animal !== "Dog" && animal !== "Bird" && animal !== "Cat") { + return `I don't know how to greet animal ` + animal; } switch (animal) { - case "Dog" : - return "Wof"; - case "Cat" : - return "Meow"; - case "Bird" : - return "Kashiiin"; - + case "Dog": + return "Wof"; + case "Cat": + return "Meow"; + case "Bird": + return "Kashiiin"; } } + +export { greetAnimal }; ```` @@ -636,6 +620,8 @@ let four: b = Four let oneAsTypeB = (one :> b) ``` +A closed [polymorphic variant](./polymorphic-variant.mdx) can also be coerced to a regular variant when every possible source constructor has the same runtime representation in the target. + ### Coercing Variants to Primitives Variants that are guaranteed to always be represented by a single primitive at runtime can be coerced to that primitive. @@ -740,10 +726,7 @@ function betterDraw(animal) { MyLibrary.draw(animal._0); } -betterDraw({ - TAG: "MyFloat", - _0: 1.5, -}); +betterDraw({ TAG: "MyFloat", _0: 1.5 }); export { betterDraw }; ``` diff --git a/apps/docs/markdown-pages/docs/react/arrays-and-keys.mdx b/apps/docs/markdown-pages/docs/react/arrays-and-keys.mdx index 649e53cdf..600596ae5 100644 --- a/apps/docs/markdown-pages/docs/react/arrays-and-keys.mdx +++ b/apps/docs/markdown-pages/docs/react/arrays-and-keys.mdx @@ -40,27 +40,13 @@ import * as JsxRuntime from "react/jsx-runtime"; function Example(props) { let todos = [ - { - id: "todo1", - text: "Todo 1", - }, - { - id: "todo2", - text: "Todo 2", - }, + { id: "todo1", text: "Todo 1" }, + { id: "todo2", text: "Todo 2" }, ]; let items = todos.map((todo) => - JsxRuntime.jsx( - "li", - { - children: todo.text, - }, - todo.id, - ), + JsxRuntime.jsx("li", { children: todo.text }, todo.id), ); - return JsxRuntime.jsx("ul", { - children: items, - }); + return JsxRuntime.jsx("ul", { children: items }); } let make = Example; @@ -73,14 +59,8 @@ import * as JsxRuntime from "react/jsx-runtime"; function Example(props) { let todos = [ - { - id: "todo1", - text: "Todo 1", - }, - { - id: "todo2", - text: "Todo 2", - }, + { id: "todo1", text: "Todo 1" }, + { id: "todo2", text: "Todo 2" }, ]; let items = todos.map((todo) =>
  • {todo.text}
  • ); return
      {items}
    ; @@ -113,13 +93,7 @@ import * as JsxRuntime from "react/jsx-runtime"; let numbers = [1, 2, 3, 4, 5]; let items = numbers.map((number) => - JsxRuntime.jsx( - "li", - { - children: number, - }, - number.toString(), - ), + JsxRuntime.jsx("li", { children: number }, number.toString()), ); export { numbers, items }; @@ -139,7 +113,7 @@ export { numbers, items }; The best way to pick a key is to use a string that uniquely identifies a list item among its siblings. Most often you would use IDs from your data as keys: - + ```res prelude type todo = {id: string, text: string} @@ -155,26 +129,31 @@ let items = Array.map(todos, todo => { ``` ```js -var todos = [ - { - id: "todo1", - text: "Todo 1", - }, - { - id: "todo2", - text: "Todo 2", - }, +import * as JsxRuntime from "react/jsx-runtime"; + +let todos = [ + { id: "todo1", text: "Todo 1" }, + { id: "todo2", text: "Todo 2" }, ]; -var items = todos.map(function (todo) { - return JsxRuntime.jsx( - "li", - { - children: todo.text, - }, - todo.id, - ); -}); +let items = todos.map((todo) => + JsxRuntime.jsx("li", { children: todo.text }, todo.id), +); + +export { todos, items }; +``` + +```jsx +import * as JsxRuntime from "react/jsx-runtime"; + +let todos = [ + { id: "todo1", text: "Todo 1" }, + { id: "todo2", text: "Todo 2" }, +]; + +let items = todos.map((todo) =>
  • {todo.text}
  • ); + +export { todos, items }; ```
    @@ -196,34 +175,14 @@ let items = Array.mapWithIndex(todos, (todo, i) => { import * as JsxRuntime from "react/jsx-runtime"; let todos = [ - { - id: "todo1", - text: "Todo 1", - }, - { - id: "todo2", - text: "Todo 2", - }, + { id: "todo1", text: "Todo 1" }, + { id: "todo2", text: "Todo 2" }, ]; -todos.map((todo) => - JsxRuntime.jsx( - "li", - { - children: todo.text, - }, - todo.id, - ), -); +todos.map((todo) => JsxRuntime.jsx("li", { children: todo.text }, todo.id)); let items = todos.map((todo, i) => - JsxRuntime.jsx( - "li", - { - children: todo.text, - }, - i.toString(), - ), + JsxRuntime.jsx("li", { children: todo.text }, i.toString()), ); export { todos, items }; @@ -233,14 +192,8 @@ export { todos, items }; import * as JsxRuntime from "react/jsx-runtime"; let todos = [ - { - id: "todo1", - text: "Todo 1", - }, - { - id: "todo2", - text: "Todo 2", - }, + { id: "todo1", text: "Todo 1" }, + { id: "todo2", text: "Todo 2" }, ]; todos.map((todo) =>
  • {todo.text}
  • ); @@ -306,37 +259,19 @@ let blog = import * as JsxRuntime from "react/jsx-runtime"; let todos = [ - { - id: "todo1", - text: "Todo 1", - }, - { - id: "todo2", - text: "Todo 2", - }, + { id: "todo1", text: "Todo 1" }, + { id: "todo2", text: "Todo 2" }, ]; let items = todos.map((todo) => - JsxRuntime.jsx( - "li", - { - children: todo.text, - }, - todo.id, - ), + JsxRuntime.jsx("li", { children: todo.text }, todo.id), ); function Example$Blog(props) { let posts = props.posts; let sidebar = JsxRuntime.jsx("ul", { children: posts.map((post) => - JsxRuntime.jsx( - "li", - { - children: post.title, - }, - post.id, - ), + JsxRuntime.jsx("li", { children: post.title }, post.id), ), }); let content = posts.map((post) => @@ -344,12 +279,8 @@ function Example$Blog(props) { "div", { children: [ - JsxRuntime.jsx("h3", { - children: post.title, - }), - JsxRuntime.jsx("p", { - children: post.content, - }), + JsxRuntime.jsx("h3", { children: post.title }), + JsxRuntime.jsx("p", { children: post.content }), ], }, post.id, @@ -360,9 +291,7 @@ function Example$Blog(props) { }); } -let Blog = { - make: Example$Blog, -}; +let Blog = { make: Example$Blog }; let posts = [ { @@ -377,9 +306,7 @@ let posts = [ }, ]; -let blog = JsxRuntime.jsx(Example$Blog, { - posts: posts, -}); +let blog = JsxRuntime.jsx(Example$Blog, { posts: posts }); export { todos, items, Blog, posts, blog }; ``` @@ -388,14 +315,8 @@ export { todos, items, Blog, posts, blog }; import * as JsxRuntime from "react/jsx-runtime"; let todos = [ - { - id: "todo1", - text: "Todo 1", - }, - { - id: "todo2", - text: "Todo 2", - }, + { id: "todo1", text: "Todo 1" }, + { id: "todo2", text: "Todo 2" }, ]; let items = todos.map((todo) =>
  • {todo.text}
  • ); @@ -424,9 +345,7 @@ function Example$Blog(props) { ); } -let Blog = { - make: Example$Blog, -}; +let Blog = { make: Example$Blog }; let posts = [ { @@ -479,51 +398,20 @@ import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.js"; import * as JsxRuntime from "react/jsx-runtime"; let todos = [ - { - id: "todo1", - text: "Todo 1", - }, - { - id: "todo2", - text: "Todo 2", - }, + { id: "todo1", text: "Todo 1" }, + { id: "todo2", text: "Todo 2" }, ]; let items = todos.map((todo) => - JsxRuntime.jsx( - "li", - { - children: todo.text, - }, - todo.id, - ), + JsxRuntime.jsx("li", { children: todo.text }, todo.id), ); function Example(props) { let items = Stdlib_List.toArray({ - hd: { - id: "todo1", - text: "Todo 1", - }, - tl: { - hd: { - id: "todo2", - text: "Todo 2", - }, - tl: /* [] */ 0, - }, - }).map((todo) => - JsxRuntime.jsx( - "li", - { - children: todo.text, - }, - todo.id, - ), - ); - return JsxRuntime.jsx("div", { - children: items, - }); + hd: { id: "todo1", text: "Todo 1" }, + tl: { hd: { id: "todo2", text: "Todo 2" }, tl: /* [] */ 0 }, + }).map((todo) => JsxRuntime.jsx("li", { children: todo.text }, todo.id)); + return JsxRuntime.jsx("div", { children: items }); } let make = Example; @@ -536,31 +424,16 @@ import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.js"; import * as JsxRuntime from "react/jsx-runtime"; let todos = [ - { - id: "todo1", - text: "Todo 1", - }, - { - id: "todo2", - text: "Todo 2", - }, + { id: "todo1", text: "Todo 1" }, + { id: "todo2", text: "Todo 2" }, ]; let items = todos.map((todo) =>
  • {todo.text}
  • ); function Example(props) { let items = Stdlib_List.toArray({ - hd: { - id: "todo1", - text: "Todo 1", - }, - tl: { - hd: { - id: "todo2", - text: "Todo 2", - }, - tl: /* [] */ 0, - }, + hd: { id: "todo1", text: "Todo 1" }, + tl: { hd: { id: "todo2", text: "Todo 2" }, tl: /* [] */ 0 }, }).map((todo) =>
  • {todo.text}
  • ); return
    {items}
    ; } diff --git a/apps/docs/markdown-pages/docs/react/beyond-jsx.mdx b/apps/docs/markdown-pages/docs/react/beyond-jsx.mdx index 290e77fa8..ba2ec08ec 100644 --- a/apps/docs/markdown-pages/docs/react/beyond-jsx.mdx +++ b/apps/docs/markdown-pages/docs/react/beyond-jsx.mdx @@ -16,7 +16,7 @@ JSX is a syntax sugar that allows us to use React components in an HTML like man **Note:** This section requires knowledge about the low level apis for [creating elements](./elements-and-jsx.mdx#creating-elements-from-component-functions), such as `React.createElement` or `ReactDOM.createDOMElementVariadic`. -> **Note:** The output shown for the examples on this page assumes your `rescript.json` to be set to `"jsx": { "version": 4, "mode": "classic" }`. We will update it for automatic mode soon. +> **Note:** These examples use `"jsx": { "version": 4 }` in `rescript.json`. ReScript v12 generates calls to React's automatic JSX runtime, using `jsx` for zero or one child and `jsxs` for multiple children. ## Component Types @@ -56,7 +56,7 @@ module Container = { - + ```res module Friend = { @@ -70,102 +70,166 @@ module Friend = { } ``` -```res nocheck +```res module Friend = { type props<'name, 'children> = { name: 'name, children: 'children, } - let make = ({name, children, _}: props) => { - ReactDOM.createDOMElementVariadic("div", [{React.string(name)}, children]) + let make = ({name, children}: props) => { + ReactDOM.jsxs("div", { + children: ?ReactDOM.someElement(React.array([React.string(name), children])), + }) } } ``` ```js -function Playground$Friend(props) { - return JsxRuntime.jsxs("div", { - children: [props.name, props.children], +import * as JsxRuntime from "react/jsx-runtime"; + +function Example$ExamplePrelude$Friend(props) { + return props.name + ", " + props.age.toString(); +} + +let Friend = { make: Example$ExamplePrelude$Friend }; + +function Example$ExamplePrelude$Container(props) { + return JsxRuntime.jsxs(JsxRuntime.Fragment, { + children: [props.width.toString(), props.children], }); } -var Friend = { - make: Playground$Friend, -}; +let Container = { make: Example$ExamplePrelude$Container }; + +let ExamplePrelude = { Friend: Friend, Container: Container }; + +function Example$Friend(props) { + return JsxRuntime.jsxs("div", { children: [props.name, props.children] }); +} + +let Friend$1 = { make: Example$Friend }; + +export { ExamplePrelude, Friend$1 as Friend }; ``` - +```jsx +import * as JsxRuntime from "react/jsx-runtime"; -In the expanded output: +function Example$ExamplePrelude$Friend(props) { + return props.name + ", " + props.age.toString(); +} -- `props`: A generated record type that has fields according to the labeled arguments of the `make` function -- `make`: A converted `make` function that complies to the component interface `(props) => React.element` +let Friend = { make: Example$ExamplePrelude$Friend }; -### Special Case React.forwardRef +function Example$ExamplePrelude$Container(props) { + return ( + <> + {props.width.toString()} + {props.children} + + ); +} -The `@react.component` decorator also works for `React.forwardRef` calls: +let Container = { make: Example$ExamplePrelude$Container }; - +let ExamplePrelude = { Friend: Friend, Container: Container }; -```res nocheck -module FancyInput = { - @react.component - let make = React.forwardRef((~className=?, ~children, ref) => +function Example$Friend(props) { + return (
    - // use ref here + {props.name} + {props.children}
    - ) + ); } -``` -```res nocheck -// Simplified Output -type props<'className, 'children, 'ref> = { - className?: 'className, - children: 'children, - ref?: 'ref, -} +let Friend$1 = { make: Example$Friend }; -let make = ( - {?className, children, _}: props<'className, 'children, ReactDOM.Ref.currentDomRef>, - ref: Nullable.t, -) => make(~className, ~children, ~ref, ()) +export { ExamplePrelude, Friend$1 as Friend }; ```
    -As shown in the expanded output above, our decorator desugars the function passed to `React.forwardRef` in the same manner as a typical component `make` function. It also creates a `props` type with an optional `ref` field, so we can use it in our JSX call (``). +The decorator produces the same basic interface: + +- `props`: A generated record type that has fields according to the labeled arguments of the `make` function +- `make`: A converted `make` function that complies to the component interface `(props) => React.element` + +### Ref Props + +React 19 function components can receive `ref` as a normal prop. The decorator supports a `~ref` argument that you can pass to a DOM element, as shown in [Refs and the DOM](./refs-and-the-dom.mdx#refs-and-component-functions). + +The decorator also supports [React.forwardRef](./forwarding-refs.mdx) for existing components that use that API. So now that we know how the ReScript React component transformation works, let's have a look on how ReScript transforms our JSX constructs. ## JSX Under the Hood -Whenever we are using JSX with a custom component ("capitalized JSX"), we are actually using `React.createElement` to create a new element. Here is an example of a React component without children: +JSX with a custom component ("capitalized JSX") uses `React.jsx` or `React.jsxs`, which call the corresponding functions from `react/jsx-runtime`. Here is an example of a React component without children: - + ```res let _ = ``` ```res -// classic -React.createElement(Friend.make, {name: "Fred", age:20}) - -// automatic React.jsx(Friend.make, {name: "Fred", age: 20}) ``` ```js -JsxRuntime.jsx(Playground$Friend, { name: "Fred", age: 20 }); +import * as JsxRuntime from "react/jsx-runtime"; + +function Example$Friend(props) { + return props.name + ", " + props.age.toString(); +} + +let Friend = { make: Example$Friend }; + +function Example$Container(props) { + return JsxRuntime.jsxs(JsxRuntime.Fragment, { + children: [props.width.toString(), props.children], + }); +} + +let Container = { make: Example$Container }; + +JsxRuntime.jsx(Example$Friend, { name: "Fred", age: 20 }); + +export { Friend, Container }; +``` + +```jsx +import * as JsxRuntime from "react/jsx-runtime"; + +function Example$Friend(props) { + return props.name + ", " + props.age.toString(); +} + +let Friend = { make: Example$Friend }; + +function Example$Container(props) { + return ( + <> + {props.width.toString()} + {props.children} + + ); +} + +let Container = { make: Example$Container }; + +; + +export { Friend, Container }; ``` -As you can see, it uses `Friend.make` to call the `React.createElement` API. In case you are providing children, it will use `React.createElementVariadic` instead (which is just a different binding for `React.createElement`): +The component function is `Friend.make`, and the props are passed as a record. With multiple children, JSX uses `React.jsxs` and includes them in the `children` prop: - + ```res @@ -175,14 +239,6 @@ As you can see, it uses `Friend.make` to call the `React.createElement` API. In ``` ```res -// classic -React.createElementVariadic( - Container.make, - {width: 200, children: React.null}, - [{React.string("Hello")}, {React.string("World")}], -) - -// automatic React.jsxs( Container.make, {width: 200, children: React.array([{React.string("Hello")}, {React.string("World")}])}, @@ -190,40 +246,128 @@ React.jsxs( ``` ```js -JsxRuntime.jsx(Container, { width: 200, children: null }, "Hello", "World"); +import * as JsxRuntime from "react/jsx-runtime"; + +function Example$Friend(props) { + return props.name + ", " + props.age.toString(); +} + +let Friend = { make: Example$Friend }; + +function Example$Container(props) { + return JsxRuntime.jsxs(JsxRuntime.Fragment, { + children: [props.width.toString(), props.children], + }); +} + +let Container = { make: Example$Container }; + +JsxRuntime.jsxs(Example$Container, { + width: 200, + children: ["Hello", "World"], +}); + +export { Friend, Container }; +``` + +```jsx +import * as JsxRuntime from "react/jsx-runtime"; + +function Example$Friend(props) { + return props.name + ", " + props.age.toString(); +} + +let Friend = { make: Example$Friend }; + +function Example$Container(props) { + return ( + <> + {props.width.toString()} + {props.children} + + ); +} + +let Container = { make: Example$Container }; + + + {"Hello"} + {"World"} +; + +export { Friend, Container }; ``` -Note that the `children: React.null` field has no relevance since React will only care about the children array passed as a third argument. +`React.createElement` and `React.createElementVariadic` remain available for manually creating elements. ReScript v12's JSX transformation uses the automatic runtime functions shown above. ### Dom Elements -"Uncapitalized JSX" expressions are treated as DOM elements and will be converted to `ReactDOM.createDOMElementVariadic` calls: +"Uncapitalized JSX" expressions are treated as DOM elements and use `ReactDOM.jsx` or `ReactDOM.jsxs`: - + ```res
    ``` ```res -// classic -ReactDOM.createDOMElementVariadic("div", ~props={title: "test"}, []) - -// automatic ReactDOM.jsx("div", {title: "test"}) ``` ```js +import * as JsxRuntime from "react/jsx-runtime"; + +function Example$Friend(props) { + return props.name + ", " + props.age.toString(); +} + +let Friend = { make: Example$Friend }; + +function Example$Container(props) { + return JsxRuntime.jsxs(JsxRuntime.Fragment, { + children: [props.width.toString(), props.children], + }); +} + +let Container = { make: Example$Container }; + JsxRuntime.jsx("div", { title: "test" }); + +export { Friend, Container }; +``` + +```jsx +import * as JsxRuntime from "react/jsx-runtime"; + +function Example$Friend(props) { + return props.name + ", " + props.age.toString(); +} + +let Friend = { make: Example$Friend }; + +function Example$Container(props) { + return ( + <> + {props.width.toString()} + {props.children} + + ); +} + +let Container = { make: Example$Container }; + +
    ; + +export { Friend, Container }; ``` The same goes for uncapitalized JSX with children: - + ```res
    @@ -232,32 +376,56 @@ The same goes for uncapitalized JSX with children: ``` ```res -// classic -ReactDOM.createDOMElementVariadic( - "div", - ~props={title: "test"}, - [ReactDOM.createDOMElementVariadic("span", [])], -) - -// automatic ReactDOM.jsx("div", {title: "test", children: ?ReactDOM.someElement(ReactDOM.jsx("span", {}))}) ``` ```js -JsxRuntime.jsx("div", { - children: JsxRuntime.jsx("span", {}), - title: "test", -}); +import * as JsxRuntime from "react/jsx-runtime"; + +function Example$Friend(props) { + return props.name + ", " + props.age.toString(); +} + +let Friend = { make: Example$Friend }; + +function Example$Container(props) { + return JsxRuntime.jsxs(JsxRuntime.Fragment, { + children: [props.width.toString(), props.children], + }); +} + +let Container = { make: Example$Container }; + +JsxRuntime.jsx("div", { children: JsxRuntime.jsx("span", {}), title: "test" }); + +export { Friend, Container }; ``` -```js -React.createElement( - "div", - { - title: "test", - }, - React.createElement("span", undefined), -); +```jsx +import * as JsxRuntime from "react/jsx-runtime"; + +function Example$Friend(props) { + return props.name + ", " + props.age.toString(); +} + +let Friend = { make: Example$Friend }; + +function Example$Container(props) { + return ( + <> + {props.width.toString()} + {props.children} + + ); +} + +let Container = { make: Example$Container }; + +
    + +
    ; + +export { Friend, Container }; ``` diff --git a/apps/docs/markdown-pages/docs/react/components-and-props.mdx b/apps/docs/markdown-pages/docs/react/components-and-props.mdx index 84fe33f2b..d4b040548 100644 --- a/apps/docs/markdown-pages/docs/react/components-and-props.mdx +++ b/apps/docs/markdown-pages/docs/react/components-and-props.mdx @@ -42,9 +42,7 @@ let make = () => { import * as JsxRuntime from "react/jsx-runtime"; function Example(props) { - return JsxRuntime.jsx("div", { - children: "Hello ReScripters!", - }); + return JsxRuntime.jsx("div", { children: "Hello ReScripters!" }); } let make = Example; @@ -98,12 +96,8 @@ function Example(props) { let visitorCountMsg = "You are visitor number: " + String(props.visitorCount); return JsxRuntime.jsxs("div", { children: [ - JsxRuntime.jsx("div", { - children: props.title, - }), - JsxRuntime.jsx("div", { - children: visitorCountMsg, - }), + JsxRuntime.jsx("div", { children: props.title }), + JsxRuntime.jsx("div", { children: visitorCountMsg }), props.children, ], }); @@ -159,9 +153,7 @@ import * as JsxRuntime from "react/jsx-runtime"; function Example(props) { let name = props.name; let greeting = name !== undefined ? "Hello " + name + "!" : "Hello stranger!"; - return JsxRuntime.jsx("div", { - children: greeting, - }); + return JsxRuntime.jsx("div", { children: greeting }); } let make = Example; @@ -216,15 +208,11 @@ function Example$Greeting(props) { return Stdlib_Option.getOr(props.name, ""); } -let Greeting = { - make: Example$Greeting, -}; +let Greeting = { make: Example$Greeting }; let name = "Andrea"; -JsxRuntime.jsx(Example$Greeting, { - name: name, -}); +JsxRuntime.jsx(Example$Greeting, { name: name }); export { Greeting, name }; ``` @@ -237,9 +225,7 @@ function Example$Greeting(props) { return Stdlib_Option.getOr(props.name, ""); } -let Greeting = { - make: Example$Greeting, -}; +let Greeting = { make: Example$Greeting }; let name = "Andrea"; @@ -252,7 +238,9 @@ export { Greeting, name }; ### Special Props `key` and `ref` -You can't define any props called `key` or `ref`. React treats those props differently and the compiler will yield an error whenever you try to define a `~key` or `~ref` argument in your component function. +`key` is reserved for React's element identity. The compiler rejects a `~key` argument in a component function. + +In React 19, function components can accept a `ref` prop. You can define a `~ref` argument and pass it to a DOM element, as shown in [Refs and the DOM](./refs-and-the-dom.mdx). Check out the corresponding [Arrays and Keys](./arrays-and-keys.mdx) and [Forwarding React Refs](./forwarding-refs.mdx) sections for more details. @@ -262,7 +250,7 @@ Prop names like `type` (as in ``) aren't syntactically vali For `aria-*` use camelCasing, e.g., `ariaLabel`. For DOM components, we'll translate it to `aria-label` under the hood. -For `data-*` this is a bit trickier; words with `-` in them aren't valid in ReScript. When you do want to write them, e.g., `
    `, check out the [React.cloneElement](./elements-and-jsx.mdx#cloning-elements) or [React.createDOMElementVariadic](./elements-and-jsx.mdx#creating-dom-elements) section. +For `data-*` this is a bit trickier; words with `-` in them aren't valid in ReScript. When you do want to write them, e.g., `
    `, check out the [React.cloneElement](./elements-and-jsx.mdx#cloning-elements) or [ReactDOM.createDOMElementVariadic](./elements-and-jsx.mdx#creating-dom-elements) section. ## Children Props @@ -301,28 +289,18 @@ function Example$Greeting(props) { return Stdlib_Option.getOr(props.name, ""); } -let Greeting = { - make: Example$Greeting, -}; +let Greeting = { make: Example$Greeting }; function Example$MyList(props) { - return JsxRuntime.jsx("ul", { - children: props.children, - }); + return JsxRuntime.jsx("ul", { children: props.children }); } -let MyList = { - make: Example$MyList, -}; +let MyList = { make: Example$MyList }; JsxRuntime.jsxs(Example$MyList, { children: [ - JsxRuntime.jsx("li", { - children: "Item 1", - }), - JsxRuntime.jsx("li", { - children: "Item 2", - }), + JsxRuntime.jsx("li", { children: "Item 1" }), + JsxRuntime.jsx("li", { children: "Item 2" }), ], }); @@ -337,17 +315,13 @@ function Example$Greeting(props) { return Stdlib_Option.getOr(props.name, ""); } -let Greeting = { - make: Example$Greeting, -}; +let Greeting = { make: Example$Greeting }; function Example$MyList(props) { return
      {props.children}
    ; } -let MyList = { - make: Example$MyList, -}; +let MyList = { make: Example$MyList };
  • {"Item 1"}
  • @@ -383,7 +357,7 @@ module StringChildren = { **Component with an optional `React.element` as children:** -```res nocheck +```res module OptionalChildren = { @react.component let make = (~children: option=?) => { @@ -432,24 +406,25 @@ It's a decorator that tells the ReScript compiler to treat the function as a Rea In JavaScript, a React component is just a function that takes props (an object) and returns JSX. In ReScript, props are typically represented as a record type. The `@react.component` decorator automatically generates that record type and wraps the function for you—so you don't have to. -```res nocheck +```res // Counter.res - @react.component let make = (~title, ~count) => {

    {React.string(title)} {React.int(count)}

    } +``` -// This is equivalent to writing: +The resulting component takes a props record, similar to this manually defined function: +```res type props = {title: string, count: int} -let \"Counter" = ({title, count}: props) => { +let make = ({title, count}: props) => {

    {React.string(title)} {React.int(count)}

    } ``` -However, writing it manually like this means you lose the `make` function name, which prevents JSX from working as expected when using the component elsewhere. +The decorator also gives the generated JavaScript component an uppercased name derived from its ReScript module. Having an uppercased function name also helps distinguish React components from regular functions in [React DevTools](https://react.dev/learn/react-developer-tools). @@ -478,14 +453,10 @@ function Example$Greeting(props) { return Stdlib_Option.getOr(props.name, ""); } -let Greeting = { - make: Example$Greeting, -}; +let Greeting = { make: Example$Greeting }; function Example(props) { - return JsxRuntime.jsxs("h1", { - children: [props.title, props.count], - }); + return JsxRuntime.jsxs("h1", { children: [props.title, props.count] }); } let make = Example; @@ -501,9 +472,7 @@ function Example$Greeting(props) { return Stdlib_Option.getOr(props.name, ""); } -let Greeting = { - make: Example$Greeting, -}; +let Greeting = { make: Example$Greeting }; function Example(props) { return ( @@ -527,7 +496,7 @@ The ReScript type system is really good at inferring the prop types just by look For simple cases, well-scoped usage, or experimentation, it's still fine to omit type annotations: -```res nocheck +```res // Button.res @react.component @@ -568,9 +537,7 @@ function Example$Greeting(props) { return Stdlib_Option.getOr(props.name, ""); } -let Greeting = { - make: Example$Greeting, -}; +let Greeting = { make: Example$Greeting }; function Example(props) { return JsxRuntime.jsx("div", { @@ -591,9 +558,7 @@ function Example$Greeting(props) { return Stdlib_Option.getOr(props.name, ""); } -let Greeting = { - make: Example$Greeting, -}; +let Greeting = { make: Example$Greeting }; function Example(props) { return ( @@ -642,25 +607,15 @@ function Example$Greeting(props) { return Stdlib_Option.getOr(props.name, ""); } -let Greeting = { - make: Example$Greeting, -}; +let Greeting = { make: Example$Greeting }; function make(props) { - return JsxRuntime.jsx("a", { - children: props.children, - href: props.href, - }); + return JsxRuntime.jsx("a", { children: props.children, href: props.href }); } -let Link = { - make: make, -}; +let Link = { make: make }; -JsxRuntime.jsx(make, { - href: "/docs", - children: "Docs", -}); +JsxRuntime.jsx(make, { href: "/docs", children: "Docs" }); export { Greeting, Link }; ``` @@ -673,17 +628,13 @@ function Example$Greeting(props) { return Stdlib_Option.getOr(props.name, ""); } -let Greeting = { - make: Example$Greeting, -}; +let Greeting = { make: Example$Greeting }; function make(props) { return
    {props.children}; } -let Link = { - make: make, -}; +let Link = { make: make }; {"Docs"}; @@ -698,7 +649,7 @@ More details on the `@react.component` decorator and its generated interface can We can also represent React components as submodules, which makes it very convenient to build more complex UI without the need to create multiple files for each composite component (that's probably only used by the parent component anyways): -```res nocheck +```res // src/Button.res module Label = { @react.component @@ -726,26 +677,31 @@ let content =